1/*! For license information please see main.440fff96.js.LICENSE.txt */ 2(()=>{var e={4:(e,t,n)=>{"use strict";var r=n(853),s=n(43),a=n(950);function i(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType)}function l(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{0!==(4098&(t=e).flags)&&(n=t.return),e=t.return}while(e)}return 3===t.tag?n:null}function c(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function d(e){if(l(e)!==e)throw Error(i(188))}function u(e){var t=e.tag;if(5===t||26===t||27===t||6===t)return e;for(e=e.child;null!==e;){if(null!==(t=u(e)))return t;e=e.sibling}return null}var m=Object.assign,h=Symbol.for("react.element"),p=Symbol.for("react.transitional.element"),g=Symbol.for("react.portal"),f=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),b=Symbol.for("react.profiler"),y=Symbol.for("react.provider"),v=Symbol.for("react.consumer"),w=Symbol.for("react.context"),j=Symbol.for("react.forward_ref"),N=Symbol.for("react.suspense"),k=Symbol.for("react.suspense_list"),A=Symbol.for("react.memo"),S=Symbol.for("react.lazy");Symbol.for("react.scope");var E=Symbol.for("react.activity");Symbol.for("react.legacy_hidden"),Symbol.for("react.tracing_marker");var C=Symbol.for("react.memo_cache_sentinel");Symbol.for("react.view_transition");var T=Symbol.iterator;function P(e){return null===e||"object"!==typeof e?null:"function"===typeof(e=T&&e[T]||e["@@iterator"])?e:null}var _=Symbol.for("react.client.reference");function I(e){if(null==e)return null;if("function"===typeof e)return e.$$typeof===_?null:e.displayName||e.name||null;if("string"===typeof e)return e;switch(e){case f:return"Fragment";case b:return"Profiler";case x:return"StrictMode";case N:return"Suspense";case k:return"SuspenseList";case E:return"Activity"}if("object"===typeof e)switch(e.$$typeof){case g:return"Portal";case w:return(e.displayName||"Context")+".Provider";case v:return(e._context.displayName||"Context")+".Consumer";case j:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case A:return null!==(t=e.displayName||null)?t:I(e.type)||"Memo";case S:t=e._payload,e=e._init;try{return I(e(t))}catch(n){}}return null}var D=Array.isArray,R=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,L=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,M={pending:!1,data:null,method:null,action:null},O=[],F=-1;function U(e){return{current:e}}function B(e){0>F||(e.current=O[F],O[F]=null,F--)}function z(e,t){F++,O[F]=e.current,e.current=t}var V=U(null),q=U(null),W=U(null),H=U(null);function G(e,t){switch(z(W,t),z(q,e),z(V,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?su(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)e=au(t=su(t),e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}B(V),z(V,e)}function Y(){B(V),B(q),B(W)}function K(e){null!==e.memoizedState&&z(H,e);var t=V.current,n=au(t,e.type);t!==n&&(z(q,e),z(V,n))}function J(e){q.current===e&&(B(V),B(q)),H.current===e&&(B(H),Ku._currentValue=M)}var $=Object.prototype.hasOwnProperty,Q=r.unstable_scheduleCallback,X=r.unstable_cancelCallback,Z=r.unstable_shouldYield,ee=r.unstable_requestPaint,te=r.unstable_now,ne=r.unstable_getCurrentPriorityLevel,re=r.unstable_ImmediatePriority,se=r.unstable_UserBlockingPriority,ae=r.unstable_NormalPriority,ie=r.unstable_LowPriority,oe=r.unstable_IdlePriority,le=r.log,ce=r.unstable_setDisableYieldValue,de=null,ue=null;function me(e){if("function"===typeof le&&ce(e),ue&&"function"===typeof ue.setStrictMode)try{ue.setStrictMode(de,e)}catch(t){}}var he=Math.clz32?Math.clz32:function(e){return 0===(e>>>=0)?32:31-(pe(e)/ge|0)|0}
vendor: 5,261 bytes, line 2
2,pe=Math.log,ge=Math.LN2;var fe=256,xe=4194304;function be(e){var t=42&e;if(0!==t)return t;switch(e&-e){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:return 64;case 128:return 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 4194048&e;case 4194304:case 8388608:case 16777216:case 33554432:return 62914560&e;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function ye(e,t,n){var r=e.pendingLanes;if(0===r)return 0;var s=0,a=e.suspendedLanes,i=e.pingedLanes;e=e.warmLanes;var o=134217727&r;return 0!==o?0!==(r=o&~a)?s=be(r):0!==(i&=o)?s=be(i):n||0!==(n=o&~e)&&(s=be(n)):0!==(o=r&~a)?s=be(o):0!==i?s=be(i):n||0!==(n=r&~e)&&(s=be(n)),0===s?0:0!==t&&t!==s&&0===(t&a)&&((a=s&-s)>=(n=t&-t)||32===a&&0!==(4194048&n))?t:s}function ve(e,t){return 0===(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)}function we(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;default:return-1}}function je(){var e=fe;return 0===(4194048&(fe<<=1))&&(fe=256),e}function Ne(){var e=xe;return 0===(62914560&(xe<<=1))&&(xe=4194304),e}function ke(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ae(e,t){e.pendingLanes|=t,268435456!==t&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Se(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-he(t);e.entangledLanes|=t,e.entanglements[r]=1073741824|e.entanglements[r]|4194090&n}function Ee(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-he(n),s=1<<r;s&t|e[r]&t&&(e[r]|=t),n&=~s}}function Ce(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Te(e){return 2<(e&=-e)?8<e?0!==(134217727&e)?32:268435456:8:2}function Pe(){var e=L.p;return 0!==e?e:void 0===(e=window.event)?32:cm(e.type)}var _e=Math.random().toString(36).slice(2),Ie="__reactFiber$"+_e,De="__reactProps$"+_e,Re="__reactContainer$"+_e,Le="__reactEvents$"+_e,Me="__reactListeners$"+_e,Oe="__reactHandles$"+_e,Fe="__reactResources$"+_e,Ue="__reactMarker$"+_e;function Be(e){delete e[Ie],delete e[De],delete e[Le],delete e[Me],delete e[Oe]}function ze(e){var t=e[Ie];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Re]||n[Ie]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=yu(e);null!==e;){if(n=e[Ie])return n;e=yu(e)}return t}n=(e=n).parentNode}return null}function Ve(e){if(e=e[Ie]||e[Re]){var t=e.tag;if(5===t||6===t||13===t||26===t||27===t||3===t)return e}return null}function qe(e){var t=e.tag;if(5===t||26===t||27===t||6===t)return e.stateNode;throw Error(i(33))}function We(e){var t=e[Fe];return t||(t=e[Fe]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function He(e){e[Ue]=!0}var Ge=new Set,Ye={};function Ke(e,t){Je(e,t),Je(e+"Capture",t)}function Je(e,t){for(Ye[e]=t,e=0;e<t.length;e++)Ge.add(t[e])}var $e,Qe,Xe=RegExp("^[: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]*$"),Ze={},et={};function tt(e,t,n){if(s=t,$.call(et,s)||!$.call(Ze,s)&&(Xe.test(s)?et[s]=!0:(Ze[s]=!0,0)))if(null===n)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":return void e.removeAttribute(t);case"boolean":var r=t.toLowerCase().slice(0,5);if("data-"!==r&&"aria-"!==r)return void e.removeAttribute(t)}e.setAttribute(t,""+n)}var s}function nt(e,t,n){if(null===n)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":return void e.removeAttribute(t)}e.setAttribute(t,""+n)}}function rt(e,t,n,r){if(null===r)e.removeAttribute(n);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":return void e.removeAttribute(n)}e.setAttributeNS(t,n,""+r)}}function st(e){if(void 0===$e)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);$e=t&&t[1]||"",Qe=-1<n.stack.indexOf("\n at")?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return"\n"+$e+e+Qe}var at=!1;function it(e,t){if(!e||at)return"";at=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),"object"===typeof Reflect&&Reflect.construct){try{Reflect.construct(n,[])}catch(s){var r=s}Reflect.construct(e,[],n)}
2else{try{n.call()}catch(a){r=a}e.call(n.prototype)}}else{try{throw Error()}catch(i){r=i}(n=e())&&"function"===typeof n.catch&&n.catch(function(){})}}catch(o){if(o&&r&&"string"===typeof o.stack)return[o.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var s=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,"name");s&&s.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var a=r.DetermineComponentFrameRoot(),i=a[0],o=a[1];if(i&&o){var l=i.split("\n"),c=o.split("\n");for(s=r=0;r<l.length&&!l[r].includes("DetermineComponentFrameRoot");)r++;for(;s<c.length&&!c[s].includes("DetermineComponentFrameRoot");)s++;if(r===l.length||s===c.length)for(r=l.length-1,s=c.length-1;1<=r&&0<=s&&l[r]!==c[s];)s--;for(;1<=r&&0<=s;r--,s--)if(l[r]!==c[s]){if(1!==r||1!==s)do{if(r--,0>--s||l[r]!==c[s]){var d="\n"+l[r].replace(" at new "," at ");return e.displayName&&d.includes("<anonymous>")&&(d=d.replace("<anonymous>",e.displayName)),d}}while(1<=r&&0<=s);break}}}finally{at=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?st(n):""}function ot(e){switch(e.tag){case 26:case 27:case 5:return st(e.type);case 16:return st("Lazy");case 13:return st("Suspense");case 19:return st("SuspenseList");case 0:case 15:return it(e.type,!1);case 11:return it(e.type.render,!1);case 1:return it(e.type,!0);case 31:return st("Activity");default:return""}}function lt(e){try{var t="";do{t+=ot(e),e=e.return}while(e);return t}catch(n){return"\nError generating stack: "+n.message+"\n"+n.stack}}function ct(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":case"object":return e;default:return""}}function dt(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function ut(e){e._valueTracker||(e._valueTracker=function(e){var t=dt(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&"undefined"!==typeof n&&"function"===typeof n.get&&"function"===typeof n.set){var s=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(e){r=""+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function mt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=dt(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function ht(e){if("undefined"===typeof(e=e||("undefined"!==typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}var pt=/[\n"\\]/g;function gt(e){return e.replace(pt,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function ft(e,t,n,r,s,a,i,o){e.name="",null!=i&&"function"!==typeof i&&"symbol"!==typeof i&&"boolean"!==typeof i?e.type=i:e.removeAttribute("type"),null!=t?"number"===i?(0===t&&""===e.value||e.value!=t)&&(e.value=""+ct(t)):e.value!==""+ct(t)&&(e.value=""+ct(t)):"submit"!==i&&"reset"!==i||e.removeAttribute("value"),null!=t?bt(e,i,ct(t)):null!=n?bt(e,i,ct(n)):null!=r&&e.removeAttribute("value"),null==s&&null!=a&&(e.defaultChecked=!!a),null!=s&&(e.checked=s&&"function"!==typeof s&&"symbol"!==typeof s),null!=o&&"function"!==typeof o&&"symbol"!==typeof o&&"boolean"!==typeof o?e.name=""+ct(o):e.removeAttribute("name")}function xt(e,t,n,r,s,a,i,o){if(null!=a&&"function"!==typeof a&&"symbol"!==typeof a&&"boolean"!==typeof a&&(e.type=a),null!=t||null!=n){if(!("submit"!==a&&"reset"!==a||void 0!==t&&null!==t))return;n=null!=n?""+ct(n):"",t=null!=t?""+ct(t):n,o||t===e.value||(e.value=t),e.defaultValue=t}r="function"!==typeof(r=null!=r?r:s)&&"symbol"!==typeof r&&!!r,e.checked=o?e.checked:!!r,e.defaultChecked=!!r,null!=i&&"function"!==typeof i&&"symbol"!==typeof i&&"boolean"!==typeof i&&(e.name=i)}function bt(e,t,n){"number"===t&&ht(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function yt(e,t,n,r){if(e=e.options,t){t={};for(var s=0;s<n.length;s++)t["$"+n[s]]=!0;for(n=0;n<e.length;n++)s=t.hasOwnProperty("$"+e[n].value),e[n].selected!==s&&(e[n].selected=s),s&&r&&(e[n].defaultSelected=!0)}else{for(n=""+ct(n),t=null,s=0;s<e.length;s++){if(e[s].value===n)return e[s].selected=!0,void(r&&(e[s].defaultSelected=!0));null!==t||e[s].disabled||(t=e[s])}null!==t&&(t.selected=!0)}}function vt(e,t,n){null==t||((t=""+ct(t))!==e.value&&(e.value=t),null!=n)?e.defaultValue=null!=n?""+ct(n):"":e.defaultValue!==t&&(e.defaultValue=t)}function wt(e,t,n,r){if(null==t){if(null!=r){if(null!=n)throw Error(i(92));if(D(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}null==n&&(n=""),t=n}n=ct(t),e.defaultValue=n,(r=e.textContent)===n&&""!==r&&null!==r&&(e.value=r)}function jt(e,t){if(t){var n=e.firstChild;
2if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}var Nt=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function kt(e,t,n){var r=0===t.indexOf("--");null==n||"boolean"===typeof n||""===n?r?e.setProperty(t,""):"float"===t?e.cssFloat="":e[t]="":r?e.setProperty(t,n):"number"!==typeof n||0===n||Nt.has(t)?"float"===t?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function At(e,t,n){if(null!=t&&"object"!==typeof t)throw Error(i(62));if(e=e.style,null!=n){for(var r in n)!n.hasOwnProperty(r)||null!=t&&t.hasOwnProperty(r)||(0===r.indexOf("--")?e.setProperty(r,""):"float"===r?e.cssFloat="":e[r]="");for(var s in t)r=t[s],t.hasOwnProperty(s)&&n[s]!==r&&kt(e,s,r)}else for(var a in t)t.hasOwnProperty(a)&&kt(e,a,t[a])}function St(e){if(-1===e.indexOf("-"))return!1;switch(e){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 Et=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode
2-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Ct=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Tt(e){return Ct.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}var Pt=null;function _t(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var It=null,Dt=null;function Rt(e){var t=Ve(e);if(t&&(e=t.stateNode)){var n=e[De]||null;e:switch(e=t.stateNode,t.type){case"input":if(ft(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,"radio"===n.type&&null!=t){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+gt(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var s=r[De]||null;if(!s)throw Error(i(90));ft(r,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name)}}for(t=0;t<n.length;t++)(r=n[t]).form===e.form&&mt(r)}break e;case"textarea":vt(e,n.value,n.defaultValue);break e;case"select":null!=(t=n.value)&&yt(e,!!n.multiple,t,!1)}}}var Lt=!1;function Mt(e,t,n){if(Lt)return e(t,n);Lt=!0;try{return e(t)}finally{if(Lt=!1,(null!==It||null!==Dt)&&(zc(),It&&(t=It,e=Dt,Dt=It=null,Rt(t),e)))for(t=0;t<e.length;t++)Rt(e[t])}}function Ot(e,t){var n=e.stateNode;if(null===n)return null;var r=n[De]||null;if(null===r)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(r=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!r;break e;default:e=!1}if(e)return null;if(n&&"function"!==typeof n)throw Error(i(231,t,typeof n));return n}var Ft=!("undefined"===typeof window||"undefined"===typeof window.document||"undefined"===typeof window.document.createElement),Ut=!1;if(Ft)try{var Bt={};Object.defineProperty(Bt,"passive",{get:function(){Ut=!0}}),window.addEventListener("test",Bt,Bt),window.removeEventListener("test",Bt,Bt)}catch(Dm){Ut=!1}var zt=null,Vt=null,qt=null;function Wt(){if(qt)return qt;var e,t,n=Vt,r=n.length,s="value"in zt?zt.value:zt.textContent,a=s.length;for(e=0;e<r&&n[e]===s[e];e++);var i=r-e;for(t=1;t<=i&&n[r-t]===s[a-t];t++);return qt=s.slice(e,1<t?1-t:void 0)}function Ht(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}function Gt(){return!0}function Yt(){return!1}function Kt(e){function t(t,n,r,s,a){for(var i in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=s,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(i)&&(t=e[i],this[i]=t?t(s):s[i]);return this.isDefaultPrevented=(null!=s.defaultPrevented?s.defaultPrevented:!1===s.returnValue)?Gt:Yt,this.isPropagationStopped=Yt,this}return m(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!==typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=Gt)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!==typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=Gt)},persist:function(){},isPersistent:Gt}),t}var Jt,$t,Qt,Xt={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Zt=Kt(Xt),en=m({},Xt,{view:0,detail:0}),tn=Kt(en),nn=m({},en,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:pn,button:0,buttons:0,relatedTarget:function(e){return void 0===e.relatedTarget?e.from
vendor: 4,404 bytes, line 2
2Element===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Qt&&(Qt&&"mousemove"===e.type?(Jt=e.screenX-Qt.screenX,$t=e.screenY-Qt.screenY):$t=Jt=0,Qt=e),Jt)},movementY:function(e){return"movementY"in e?e.movementY:$t}}),rn=Kt(nn),sn=Kt(m({},nn,{dataTransfer:0})),an=Kt(m({},en,{relatedTarget:0})),on=Kt(m({},Xt,{animationName:0,elapsedTime:0,pseudoElement:0})),ln=Kt(m({},Xt,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}})),cn=Kt(m({},Xt,{data:0})),dn={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},un={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"},mn={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function hn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=mn[e])&&!!t[e]}function pn(){return hn}var gn=Kt(m({},en,{key:function(e){if(e.key){var t=dn[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=Ht(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?un[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:pn,charCode:function(e){return"keypress"===e.type?Ht(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?Ht(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}})),fn=Kt(m({},nn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),xn=Kt(m({},en,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:pn})),bn=Kt(m({},Xt,{propertyName:0,elapsedTime:0,pseudoElement:0})),yn=Kt(m({},nn,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),vn=Kt(m({},Xt,{newState:0,oldState:0})),wn=[9,13,27,32],jn=Ft&&"CompositionEvent"in window,Nn=null;Ft&&"documentMode"in document&&(Nn=document.documentMode);var kn=Ft&&"TextEvent"in window&&!Nn,An=Ft&&(!jn||Nn&&8<Nn&&11>=Nn),Sn=String.fromCharCode(32),En=!1;function Cn(e,t){switch(e){case"keyup":return-1!==wn.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Tn(e){return"object"===typeof(e=e.detail)&&"data"in e?e.data:null}var Pn=!1;var _n={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 In(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!_n[e.type]:"textarea"===t}function Dn(e,t,n,r){It?Dt?Dt.push(r):Dt=[r]:It=r,0<(t=Wd(t,"onChange")).length&&(n=new Zt("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Rn=null,Ln=null;function Mn(e){Md(e,0)}function On(e){if(mt(qe(e)))return e}function Fn(e,t){if("change"===e)return t}var Un=!1;if(Ft){var Bn;if(Ft){var zn="oninput"in document;if(!zn){var Vn=document.createElement("div");Vn.setAttribute("oninput","return;"),zn="function"===typeof Vn.oninput}Bn=zn}else Bn=!1;Un=Bn&&(!document.documentMode||9<document.documentMode)}function qn(){Rn&&(Rn.detachEvent("onpropertychange",Wn),Ln=Rn=null)}function Wn(e){if("value"===e.propertyName&&On(Ln)){var t=[];Dn(t,Ln,e,_t(e)),Mt(Mn,t)}}function Hn(e,t,n){"focusin"===e?(qn(),Ln=n,(Rn=t).attachEvent("onpropertychange",Wn)):"focusout"===e&&qn()}function Gn(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return On(Ln)}function Yn(e,t){if("click"===e)return On(t)}function Kn(e,t){if("input"===e||"change"===e)return On(t)}var Jn="function"===typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e===1/t)||e!==e&&t!==t};function $n(e,t){if(Jn(e,t))return!0;
vendor: 4,361 bytes, line 2
2if("object"!==typeof e||null===e||"object"!==typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var s=n[r];if(!$.call(t,s)||!Jn(e[s],t[s]))return!1}return!0}function Qn(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Xn(e,t){var n,r=Qn(e);for(e=0;r;){if(3===r.nodeType){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Qn(r)}}function Zn(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?Zn(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function er(e){for(var t=ht((e=null!=e&&null!=e.ownerDocument&&null!=e.ownerDocument.defaultView?e.ownerDocument.defaultView:window).document);t instanceof e.HTMLIFrameElement;){try{var n="string"===typeof t.contentWindow.location.href}catch(r){n=!1}if(!n)break;t=ht((e=t.contentWindow).document)}return t}function tr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}var nr=Ft&&"documentMode"in document&&11>=document.documentMode,rr=null,sr=null,ar=null,ir=!1;function or(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;ir||null==rr||rr!==ht(r)||("selectionStart"in(r=rr)&&tr(r)?r={start:r.selectionStart,end:r.selectionEnd}:r={anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},ar&&$n(ar,r)||(ar=r,0<(r=Wd(sr,"onSelect")).length&&(t=new Zt("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=rr)))}function lr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var cr={animationend:lr("Animation","AnimationEnd"),animationiteration:lr("Animation","AnimationIteration"),animationstart:lr("Animation","AnimationStart"),transitionrun:lr("Transition","TransitionRun"),transitionstart:lr("Transition","TransitionStart"),transitioncancel:lr("Transition","TransitionCancel"),transitionend:lr("Transition","TransitionEnd")},dr={},ur={};function mr(e){if(dr[e])return dr[e];if(!cr[e])return e;var t,n=cr[e];for(t in n)if(n.hasOwnProperty(t)&&t in ur)return dr[e]=n[t];return e}Ft&&(ur=document.createElement("div").style,"AnimationEvent"in window||(delete cr.animationend.animation,delete cr.animationiteration.animation,delete cr.animationstart.animation),"TransitionEvent"in window||delete cr.transitionend.transition);var hr=mr("animationend"),pr=mr("animationiteration"),gr=mr("animationstart"),fr=mr("transitionrun"),xr=mr("transitionstart"),br=mr("transitioncancel"),yr=mr("transitionend"),vr=new Map,wr="abort auxClick beforeToggle 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 jr(e,t){vr.set(e,t),Ke(t,[e])}wr.push("scrollEnd");var Nr=new WeakMap;function kr(e,t){if("object"===typeof e&&null!==e){var n=Nr.get(e);return void 0!==n?n:(t={value:e,source:t,stack:lt(t)},Nr.set(e,t),t)}return{value:e,source:t,stack:lt(t)}}var Ar=[],Sr=0,Er=0;function Cr(){for(var e=Sr,t=Er=Sr=0;t<e;){var n=Ar[t];Ar[t++]=null;var r=Ar[t];Ar[t++]=null;var s=Ar[t];Ar[t++]=null;var a=Ar[t];if(Ar[t++]=null,null!==r&&null!==s){var i=r.pending;null===i?s.next=s:(s.next=i.next,i.next=s),r.pending=s}0!==a&&Ir(n,s,a)}}function Tr(e,t,n,r){Ar[Sr++]=e,Ar[Sr++]=t,Ar[Sr++]=n,Ar[Sr++]=r,Er|=r,e.lanes|=r,null!==(e=e.alternate)&&(e.lanes|=r)}function Pr(e,t,n,r){return Tr(e,t,n,r),Dr(e)}function _r(e,t){return Tr(e,null,null,t),Dr(e)}function Ir(e,t,n){e.lanes|=n;var r=e.alternate;null!==r&&(r.lanes|=n);for(var s=!1,a=e.return;null!==a;
vendor: 7,625 bytes, line 2
2)a.childLanes|=n,null!==(r=a.alternate)&&(r.childLanes|=n),22===a.tag&&(null===(e=a.stateNode)||1&e._visibility||(s=!0)),e=a,a=a.return;return 3===e.tag?(a=e.stateNode,s&&null!==t&&(s=31-he(n),null===(r=(e=a.hiddenUpdates)[s])?e[s]=[t]:r.push(t),t.lane=536870912|n),a):null}function Dr(e){if(50<Ic)throw Ic=0,Dc=null,Error(i(185));for(var t=e.return;null!==t;)t=(e=t).return;return 3===e.tag?e.stateNode:null}var Rr={};function Lr(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Mr(e,t,n,r){return new Lr(e,t,n,r)}function Or(e){return!(!(e=e.prototype)||!e.isReactComponent)}function Fr(e,t){var n=e.alternate;return null===n?((n=Mr(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=65011712&e.flags,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function Ur(e,t){e.flags&=65011714;var n=e.alternate;return null===n?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Br(e,t,n,r,s,a){var o=0;if(r=e,"function"===typeof e)Or(e)&&(o=1);else if("string"===typeof e)o=function(e,t,n){if(1===n||null!=t.itemProp)return!1;switch(e){case"meta":case"title":return!0;case"style":if("string"!==typeof t.precedence||"string"!==typeof t.href||""===t.href)break;return!0;case"link":if("string"!==typeof t.rel||"string"!==typeof t.href||""===t.href||t.onLoad||t.onError)break;return"stylesheet"!==t.rel||(e=t.disabled,"string"===typeof t.precedence&&null==e);case"script":if(t.async&&"function"!==typeof t.async&&"symbol"!==typeof t.async&&!t.onLoad&&!t.onError&&t.src&&"string"===typeof t.src)return!0}return!1}(e,n,V.current)?26:"html"===e||"head"===e||"body"===e?27:5;else e:switch(e){case E:return(e=Mr(31,n,t,s)).elementType=E,e.lanes=a,e;case f:return zr(n.children,s,a,t);case x:o=8,s|=24;break;case b:return(e=Mr(12,n,t,2|s)).elementType=b,e.lanes=a,e;case N:return(e=Mr(13,n,t,s)).elementType=N,e.lanes=a,e;case k:return(e=Mr(19,n,t,s)).elementType=k,e.lanes=a,e;default:if("object"===typeof e&&null!==e)switch(e.$$typeof){case y:case w:o=10;break e;case v:o=9;break e;case j:o=11;break e;case A:o=14;break e;case S:o=16,r=null;break e}o=29,n=Error(i(130,null===e?"null":typeof e,"")),r=null}return(t=Mr(o,n,t,s)).elementType=e,t.type=r,t.lanes=a,t}function zr(e,t,n,r){return(e=Mr(7,e,r,t)).lanes=n,e}function Vr(e,t,n){return(e=Mr(6,e,null,t)).lanes=n,e}function qr(e,t,n){return(t=Mr(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Wr=[],Hr=0,Gr=null,Yr=0,Kr=[],Jr=0,$r=null,Qr=1,Xr="";function Zr(e,t){Wr[Hr++]=Yr,Wr[Hr++]=Gr,Gr=e,Yr=t}function es(e,t,n){Kr[Jr++]=Qr,Kr[Jr++]=Xr,Kr[Jr++]=$r,$r=e;var r=Qr;e=Xr;var s=32-he(r)-1;r&=~(1<<s),n+=1;var a=32-he(t)+s;if(30<a){var i=s-s%5;a=(r&(1<<i)-1).toString(32),r>>=i,s-=i,Qr=1<<32-he(t)+s|n<<s|r,Xr=a+e}else Qr=1<<a|n<<s|r,Xr=e}function ts(e){null!==e.return&&(Zr(e,1),es(e,1,0))}function ns(e){for(;e===Gr;)Gr=Wr[--Hr],Wr[Hr]=null,Yr=Wr[--Hr],Wr[Hr]=null;for(;e===$r;)$r=Kr[--Jr],Kr[Jr]=null,Xr=Kr[--Jr],Kr[Jr]=null,Qr=Kr[--Jr],Kr[Jr]=null}var rs=null,ss=null,as=!1,is=null,os=!1,ls=Error(i(519));function cs(e){throw gs(kr(Error(i(418,"")),e)),ls}function ds(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[Ie]=e,t[De]=r,n){case"dialog":Od("cancel",t),Od("close",t);break;case"iframe":case"object":case"embed":Od("load",t);break;case"video":case"audio":for(n=0;n<Rd.length;n++)Od(Rd[n],t);break;case"source":Od("error",t);break;case"img":case"image":case"link":Od("error",t),Od("load",t);break;case"details":Od("toggle",t);break;case"input":Od("invalid",t),xt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0),ut(t);break;case"select":Od("invalid",t);break;case"textarea":Od("invalid",t),wt(t,r.value,r.defaultValue,r.children),ut(t)}"string"!==typeof(n=r.children)&&"number"!==typeof n&&"bigint"!==typeof n||t.textContent===""+n||!0===r.suppressHydrationWarning||$d(t.textContent,n)?(null!=r.popover&&(Od("beforetoggle",t),Od("toggle",t)),null!=r.onScroll&&Od("scroll",t),null!=r.onScrollEnd&&Od("scrollend",t),null!=r.onClick&&(t.onclick=Qd),t=!0):t=!1,t||cs(e)}function us(e){for(rs=e.return;rs;)switch(rs.tag){case 5:case 13:return void(os=!1);case 27:case 3:return void(os=!0);default:rs=rs.return}}function ms(e){if(e!==rs)return!1;if(!as)return us(e),as=!0,!1;var t,n=e.tag;if((t=3!==n&&27!==n)&&((t=5===n)&&(t=!("form"!==(t=e.type)&&"button"!==t)||iu(e.type,e.memoizedProps)),t=!t),t&&ss&&cs(e),us(e),13===n){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(i(317));e:{for(e=e.nextSibling,n=0;e;){if(8===e.nodeType)if("/$"===(t=e.data)){if(0===n){ss=xu(e.nextSibling);break e}n--}else"$"!==t&&"$!"!==t&&"$?"!==t||n++;e=e.nextSibling}ss=null}}else 27===n?(n=ss,hu(e.type)?(e=bu,bu=null,ss=e):ss=n):ss=rs?xu(e.stateNode.nextSibling):null;return!0}function hs(){ss=rs=null,as=!1}function ps(){var e=is;return null!==e&&(null===yc?yc=e:yc.push.apply(yc,e),is=null),e}function gs(e){null===is?is=[e]:is.push(e)}var fs=U(null),xs=null,bs=null;function ys(e,t,n){z(fs,t._currentValue),t._currentValue=n}function vs(e){e._currentValue=fs.current,B(fs)}function ws(e,t,n){for(;null!==e;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,null!==r&&(r.childLanes|=t)):null!==r&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function js(e,t,n,r){var s=e.child;for(null!==s&&(s.return=e);null!==s;){var a=s.dependencies;if(null!==a){var o=s.child;a=a.firstContext;e:for(;null!==a;){var l=a;a=s;for(var c=0;c<t.length;c++)if(l.context===t[c]){a.lanes|=n,null!==(l=a.alternate)&&(l.lanes|=n),ws(a.return,n,e),r||(o=null);break e}a=l.next}}else if(18===s.tag){if(null===(o=s.return))throw Error(i(341));o.lanes|=n,null!==(a=o.alternate)&&(a.lanes|=n),ws(o,n,e),o=null}else o=s.child;if(null!==o)o.return=s;else for(o=s;null!==o;){if(o===e){o=null;break}if(null!==(s=o.sibling)){s.return=o.return,o=s;break}o=o.return}s=o}}function Ns(e,t,n,r){e=null;for(var s=t,a=!1;null!==s;){if(!a)if(0!==(524288&s.flags))a=!0;else if(0!==(262144&s.flags))break;if(10===s.tag){var o=s.alternate;if(null===o)throw Error(i(387));if(null!==(o=o.memoizedProps)){var l=s.type;Jn(s.pendingProps.value,o.value)||(null!==e?e.push(l):e=[l])}}else if(s===H.current){if(null===(o=s.alternate))throw Error(i(387));o.memoizedState.memoizedState!==s.memoizedState.memoizedState&&(null!==e?e.push(Ku):e=[Ku])}s=s.return}null!==e&&js(t,e,n,r),t.flags|=262144}function ks(e){for(e=e.firstContext;null!==e;){if(!Jn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}
vendor: 22,906 bytes, line 2
2function As(e){xs=e,bs=null,null!==(e=e.dependencies)&&(e.firstContext=null)}function Ss(e){return Cs(xs,e)}function Es(e,t){return null===xs&&As(e),Cs(e,t)}function Cs(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},null===bs){if(null===e)throw Error(i(308));bs=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else bs=bs.next=t;return n}var Ts="undefined"!==typeof AbortController?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},Ps=r.unstable_scheduleCallback,_s=r.unstable_NormalPriority,Is={$$typeof:w,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ds(){return{controller:new Ts,data:new Map,refCount:0}}function Rs(e){e.refCount--,0===e.refCount&&Ps(_s,function(){e.controller.abort()})}var Ls=null,Ms=0,Os=0,Fs=null;function Us(){if(0===--Ms&&null!==Ls){null!==Fs&&(Fs.status="fulfilled");var e=Ls;Ls=null,Os=0,Fs=null;for(var t=0;t<e.length;t++)(0,e[t])()}}var Bs=R.S;R.S=function(e,t){"object"===typeof t&&null!==t&&"function"===typeof t.then&&function(e,t){if(null===Ls){var n=Ls=[];Ms=0,Os=Td(),Fs={status:"pending",value:void 0,then:function(e){n.push(e)}}}Ms++,t.then(Us,Us)}(0,t),null!==Bs&&Bs(e,t)};var zs=U(null);function Vs(){var e=zs.current;return null!==e?e:rc.pooledCache}function qs(e,t){z(zs,null===t?zs.current:t.pool)}function Ws(){var e=Vs();return null===e?null:{parent:Is._currentValue,pool:e}}var Hs=Error(i(460)),Gs=Error(i(474)),Ys=Error(i(542)),Ks={then:function(){}};function Js(e){return"fulfilled"===(e=e.status)||"rejected"===e}function $s(){}function Qs(e,t,n){switch(void 0===(n=e[n])?e.push(t):n!==t&&(t.then($s,$s),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw ea(e=t.reason),e;default:if("string"===typeof t.status)t.then($s,$s);else{if(null!==(e=rc)&&100<e.shellSuspendCounter)throw Error(i(482));(e=t).status="pending",e.then(function(e){if("pending"===t.status){var n=t;n.status="fulfilled",n.value=e}},function(e){if("pending"===t.status){var n=t;n.status="rejected",n.reason=e}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw ea(e=t.reason),e}throw Xs=t,Hs}}var Xs=null;function Zs(){if(null===Xs)throw Error(i(459));var e=Xs;return Xs=null,e}function ea(e){if(e===Hs||e===Ys)throw Error(i(483))}var ta=!1;function na(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ra(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function sa(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function aa(e,t,n){var r=e.updateQueue;if(null===r)return null;if(r=r.shared,0!==(2&nc)){var s=r.pending;return null===s?t.next=t:(t.next=s.next,s.next=t),r.pending=t,t=Dr(e),Ir(e,null,n),t}return Tr(e,r,t,n),Dr(e)}function ia(e,t,n){if(null!==(t=t.updateQueue)&&(t=t.shared,0!==(4194048&n))){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,Ee(e,n)}}function oa(e,t){var n=e.updateQueue,r=e.alternate;if(null!==r&&n===(r=r.updateQueue)){var s=null,a=null;if(null!==(n=n.firstBaseUpdate)){do{var i={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};null===a?s=a=i:a=a.next=i,n=n.next}while(null!==n);null===a?s=a=t:a=a.next=t}else s=a=t;return n={baseState:r.baseState,firstBaseUpdate:s,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},void(e.updateQueue=n)}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var la=!1;function ca(){if(la){if(null!==Fs)throw Fs}}function da(e,t,n,r){la=!1;var s=e.updateQueue;ta=!1;var a=s.firstBaseUpdate,i=s.lastBaseUpdate,o=s.shared.pending;if(null!==o){s.shared.pending=null;var l=o,c=l.next;l.next=null,null===i?a=c:i.next=c,i=l;var d=e.alternate;null!==d&&((o=(d=d.updateQueue).lastBaseUpdate)!==i&&(null===o?d.firstBaseUpdate=c:o.next=c,d.lastBaseUpdate=l))}if(null!==a){var u=s.baseState;for(i=0,d=c=l=null,o=a;;){var h=-536870913&o.lane,p=h!==o.lane;if(p?(ac&h)===h:(r&h)===h){0!==h&&h===Os&&(la=!0),null!==d&&(d=d.next={lane:0,tag:o.tag,payload:o.payload,callback:null,next:null});e:{var g=e,f=o;h=t;var x=n;switch(f.tag){case 1:if("function"===typeof(g=f.payload)){u=g.call(x,u,h);break e}u=g;break e;case 3:g.flags=-65537&g.flags|128;case 0:if(null===(h="function"===typeof(g=f.payload)?g.call(x,u,h):g)||void 0===h)break e;u=m({},u,h);break e;case 2:ta=!0}}null!==(h=o.callback)&&(e.flags|=64,p&&(e.flags|=8192),null===(p=s.callbacks)?s.callbacks=[h]:p.push(h))}else p={lane:h,tag:o.tag,payload:o.payload,callback:o.callback,next:null},null===d?(c=d=p,l=u):d=d.next=p,i|=h;if(null===(o=o.next)){if(null===(o=s.shared.pending))break;o=(p=o).next,p.next=null,s.lastBaseUpdate=p,s.shared.pending=null}}null===d&&(l=u),s.baseState=l,s.firstBaseUpdate=c,s.lastBaseUpdate=d,null===a&&(s.shared.lanes=0),hc|=i,e.lanes=i,e.memoizedState=u}}function ua(e,t){if("function"!==typeof e)throw Error(i(191,e));e.call(t)}function ma(e,t){var n=e.callbacks;if(null!==n)for(e.callbacks=null,e=0;e<n.length;e++)ua(n[e],t)}var ha=U(null),pa=U(0);function ga(e,t){z(pa,e=uc),z(ha,t),uc=e|t.baseLanes}function fa(){z(pa,uc),z(ha,ha.current)}function xa(){uc=pa.current,B(ha),B(pa)}var ba=0,ya=null,va=null,wa=null,ja=!1,Na=!1,ka=!1,Aa=0,Sa=0,Ea=null,Ca=0;function Ta(){throw Error(i(321))}function Pa(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Jn(e[n],t[n]))return!1;return!0}function _a(e,t,n,r,s,a){return ba=a,ya=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,R.H=null===e||null===e.memoizedState?Hi:Gi,ka=!1,a=n(r,s),ka=!1,Na&&(a=Da(t,n,r,s)),Ia(e),a}function Ia(e){R.H=Wi;var t=null!==va&&null!==va.next;if(ba=0,wa=va=ya=null,ja=!1,Sa=0,Ea=null,t)throw Error(i(300));null===e||Eo||null!==(e=e.dependencies)&&ks(e)&&(Eo=!0)}function Da(e,t,n,r){ya=e;var s=0;do{if(Na&&(Ea=null),Sa=0,Na=!1,25<=s)throw Error(i(301));if(s+=1,wa=va=null,null!=e.updateQueue){var a=e.updateQueue;a.lastEffect=null,a.events=null,a.stores=null,null!=a.memoCache&&(a.memoCache.index=0)}R.H=Yi,a=t(n,r)}while(Na);return a}function Ra(){var e=R.H,t=e.useState()[0];return t="function"===typeof t.then?Ba(t):t,e=e.useState()[0],(null!==va?va.memoizedState:null)!==e&&(ya.flags|=1024),t}function La(){var e=0!==Aa;return Aa=0,e}function Ma(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Oa(e){if(ja){for(e=e.memoizedState;null!==e;){var t=e.queue;null!==t&&(t.pending=null),e=e.next}ja=!1}ba=0,wa=va=ya=null,Na=!1,Sa=Aa=0,Ea=null}function Fa(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===wa?ya.memoizedState=wa=e:wa=wa.next=e,wa}function Ua(){if(null===va){var e=ya.alternate;e=null!==e?e.memoizedState:null}else e=va.next;var t=null===wa?ya.memoizedState:wa.next;if(null!==t)wa=t,va=e;else{if(null===e){if(null===ya.alternate)throw Error(i(467));throw Error(i(310))}e={memoizedState:(va=e).memoizedState,baseState:va.baseState,baseQueue:va.baseQueue,queue:va.queue,next:null},null===wa?ya.memoizedState=wa=e:wa=wa.next=e}return wa}function Ba(e){var t=Sa;return Sa+=1,null===Ea&&(Ea=[]),e=Qs(Ea,e,t),t=ya,null===(null===wa?t.memoizedState:wa.next)&&(t=t.alternate,R.H=null===t||null===t.memoizedState?Hi:Gi),e}function za(e){if(null!==e&&"object"===typeof e){if("function"===typeof e.then)return Ba(e);if(e.$$typeof===w)return Ss(e)}throw Error(i(438,String(e)))}function Va(e){var t=null,n=ya.updateQueue;if(null!==n&&(t=n.memoCache),null==t){var r=ya.alternate;null!==r&&(null!==(r=r.updateQueue)&&(null!=(r=r.memoCache)&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(null==t&&(t={data:[],index:0}),null===n&&(n={lastEffect:null,events:null,stores:null,memoCache:null},ya.updateQueue=n),n.memoCache=t,void 0===(n=t.data[t.index]))for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=C;return t.index++,n}function qa(e,t){return"function"===typeof t?t(e):t}function Wa(e){return Ha(Ua(),va,e)}function Ha(e,t,n){var r=e.queue;if(null===r)throw Error(i(311));r.lastRenderedReducer=n;var s=e.baseQueue,a=r.pending;if(null!==a){if(null!==s){var o=s.next;s.next=a.next,a.next=o}t.baseQueue=s=a,r.pending=null}if(a=e.baseState,null===s)e.memoizedState=a;else{var l=o=null,c=null,d=t=s.next,u=!1;do{var m=-536870913&d.lane;if(m!==d.lane?(ac&m)===m:(ba&m)===m){var h=d.revertLane;if(0===h)null!==c&&(c=c.next={lane:0,revertLane:0,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null}),m===Os&&(u=!0);else{if((ba&h)===h){d=d.next,h===Os&&(u=!0);continue}m={lane:0,revertLane:d.revertLane,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null},null===c?(l=c=m,o=a):c=c.next=m,ya.lanes|=h,hc|=h}m=d.action,ka&&n(a,m),a=d.hasEagerState?d.eagerState:n(a,m)}else h={lane:m,revertLane:d.revertLane,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null},null===c?(l=c=h,o=a):c=c.next=h,ya.lanes|=m,hc|=m;d=d.next}while(null!==d&&d!==t);if(null===c?o=a:c.next=l,!Jn(a,e.memoizedState)&&(Eo=!0,u&&null!==(n=Fs)))throw n;e.memoizedState=a,e.baseState=o,e.baseQueue=c,r.lastRenderedState=a}return null===s&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Ga(e){var t=Ua(),n=t.queue;if(null===n)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,s=n.pending,a=t.memoizedState;if(null!==s){n.pending=null;var o=s=s.next;do{a=e(a,o.action),o=o.next}while(o!==s);Jn(a,t.memoizedState)||(Eo=!0),t.memoizedState=a,null===t.baseQueue&&(t.baseState=a),n.lastRenderedState=a}return[a,r]}function Ya(e,t,n){var r=ya,s=Ua(),a=as;if(a){if(void 0===n)throw Error(i(407));n=n()}else n=t();var o=!Jn((va||s).memoizedState,n);if(o&&(s.memoizedState=n,Eo=!0),s=s.queue,fi(2048,8,$a.bind(null,r,s,e),[e]),s.getSnapshot!==t||o||null!==wa&&1&wa.memoizedState.tag){if(r.flags|=2048,hi(9,{destroy:void 0,resource:void 0},Ja.bind(null,r,s,n,t),null),null===rc)throw Error(i(349));a||0!==(124&ba)||Ka(r,t,n)}return n}function Ka(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},null===(t=ya.updateQueue)?(t={lastEffect:null,events:null,stores:null,memoCache:null},ya.updateQueue=t,t.stores=[e]):null===(n=t.stores)?t.stores=[e]:n.push(e)}function Ja(e,t,n,r){t.value=n,t.getSnapshot=r,Qa(t)&&Xa(e)}function $a(e,t,n){return n(function(){Qa(t)&&Xa(e)})}function Qa(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Jn(e,n)}catch(r){return!0}}function Xa(e){var t=_r(e,2);null!==t&&Mc(t,e,2)}function Za(e){var t=Fa();if("function"===typeof e){var n=e;if(e=n(),ka){me(!0);try{n()}finally{me(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:qa,lastRenderedState:e},t}function ei(e,t,n,r){return e.baseState=n,Ha(e,va,"function"===typeof r?r:qa)}function ti(e,t,n,r,s){if(zi(e))throw Error(i(485));if(null!==(e=t.action)){var a={payload:s,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(e){a.listeners.push(e)}};null!==R.T?n(!0):a.isTransition=!1,r(a),null===(n=t.pending)?(a.next=t.pending=a,ni(t,a)):(a.next=n.next,t.pending=n.next=a)}}function ni(e,t){var n=t.action,r=t.payload,s=e.state;if(t.isTransition){var a=R.T,i={};R.T=i;try{var o=n(s,r),l=R.S;null!==l&&l(i,o),ri(e,t,o)}catch(c){ai(e,t,c)}finally{R.T=a}}else try{ri(e,t,a=n(s,r))}catch(d){ai(e,t,d)}}function ri(e,t,n){null!==n&&"object"===typeof n&&"function"===typeof n.then?n.then(function(n){si(e,t,n)},function(n){return ai(e,t,n)}):si(e,t,n)}function si(e,t,n){t.status="fulfilled",t.value=n,ii(t),e.state=n,null!==(t=e.pending)&&((n=t.next)===t?e.pending=null:(n=n.next,t.next=n,ni(e,n)))}function ai(e,t,n){var r=e.pending;if(e.pending=null,null!==r){r=r.next;do{t.status="rejected",t.reason=n,ii(t),t=t.next}while(t!==r)}e.action=null}function ii(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function oi(e,t){return t}function li(e,t){if(as){var n=rc.formState;if(null!==n){e:{var r=ya;if(as){if(ss){t:{for(var s=ss,a=os;8!==s.nodeType;){if(!a){s=null;break t}if(null===(s=xu(s.nextSibling))){s=null;break t}}s="F!"===(a=s.data)||"F"===a?s:null}if(s){ss=xu(s.nextSibling),r="F!"===s.data;break e}}cs(r)}r=!1}r&&(t=n[0])}}return(n=Fa()).memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:oi,lastRenderedState:t},n.queue=r,n=Fi.bind(null,ya,r),r.dispatch=n,r=Za(!1),a=Bi.bind(null,ya,!1,r.queue),s={state:t,dispatch:null,action:e,pending:null},(r=Fa()).queue=s,n=ti.bind(null,ya,s,a,n),s.dispatch=n,r.memoizedState=e,[t,n,!1]}function ci(e){return di(Ua(),va,e)}function di(e,t,n){if(t=Ha(e,t,oi)[0],e=Wa(qa)[0],"object"===typeof t&&null!==t&&"function"===typeof t.then)try{var r=Ba(t)}catch(i){if(i===Hs)throw Ys;throw i}else r=t;var s=(t=Ua()).queue,a=s.dispatch;return n!==t.memoizedState&&(ya.flags|=2048,hi(9,{destroy:void 0,resource:void 0},ui.bind(null,s,n),null)),[r,a,e]}function ui(e,t){e.action=t}function mi(e){var t=Ua(),n=va;if(null!==n)return di(t,n,e);Ua(),t=t.memoizedState;var r=(n=Ua()).queue.dispatch;return n.memoizedState=e,[t,r,!1]}function hi(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},null===(t=ya.updateQueue)&&(t={lastEffect:null,events:null,stores:null,memoCache:null},ya.updateQueue=t),null===(n=t.lastEffect)?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function pi(){return Ua().memoizedState}function gi(e,t,n,r){var s=Fa();r=void 0===r?null:r,ya.flags|=e,s.memoizedState=hi(1|t,{destroy:void 0,resource:void 0},n,r)}function fi(e,t,n,r){var s=Ua();r=void 0===r?null:r;var a=s.memoizedState.inst;null!==va&&null!==r&&Pa(r,va.memoizedState.deps)?s.memoizedState=hi(t,a,n,r):(ya.flags|=e,s.memoizedState=hi(1|t,a,n,r))}function xi(e,t){gi(8390656,8,e,t)}function bi(e,t){fi(2048,8,e,t)}function yi(e,t){return fi(4,2,e,t)}function vi(e,t){return fi(4,4,e,t)}function wi(e,t){if("function"===typeof t){e=e();var n=t(e);return function(){"function"===typeof n?n():t(null)}}if(null!==t&&void 0!==t)return e=e(),t.current=e,function(){t.current=null}}function ji(e,t,n){n=null!==n&&void 0!==n?n.concat([e]):null,fi(4,4,wi.bind(null,t,e),n)}function Ni(){}function ki(e,t){var n=Ua();t=void 0===t?null:t;var r=n.memoizedState;return null!==t&&Pa(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Ai(e,t){var n=Ua();t=void 0===t?null:t;var r=n.memoizedState;if(null!==t&&Pa(t,r[1]))return r[0];if(r=e(),ka){me(!0);try{e()}finally{me(!1)}}return n.memoizedState=[r,t],r}function Si(e,t,n){return void 0===n||0!==(1073741824&ba)?e.memoizedState=t:(e.memoizedState=n,e=Lc(),ya.lanes|=e,hc|=e,n)}function Ei(e,t,n,r){return Jn(n,t)?n:null!==ha.current?(e=Si(e,n,r),Jn(e,t)||(Eo=!0),e):0===(42&ba)?(Eo=!0,e.memoizedState=n):(e=Lc(),ya.lanes|=e,hc|=e,t)}function Ci(e,t,n,r,s){var a=L.p;L.p=0!==a&&8>a?a:8;var i=R.T,o={};R.T=o,Bi(e,!1,t,n);try{var l=s(),c=R.S;if(null!==c&&c(o,l),null!==l&&"object"===typeof l&&"function"===typeof l.then)Ui(e,t,function(e,t){var n=[],r={status:"pending",value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status="fulfilled",r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status="rejected",r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}(l,r),Rc());else Ui(e,t,r,Rc())}catch(d){Ui(e,t,{then:function(){},status:"rejected",reason:d},Rc())}finally{L.p=a,R.T=i}}function Ti(){}function Pi(e,t,n,r){if(5!==e.tag)throw Error(i(476));var s=_i(e).queue;Ci(e,s,t,M,null===n?Ti:function(){return Ii(e),n(r)})}function _i(e){var t=e.memoizedState;if(null!==t)return t;var n={};return(t={memoizedState:M,baseState:M,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:qa,lastRenderedState:M},next:null}).next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:qa,lastRenderedState:n},next:null},e.memoizedState=t,null!==(e=e.alternate)&&(e.memoizedState=t),t}function Ii(e){Ui(e,_i(e).next.queue,{},Rc())}function Di(){return Ss(Ku)}function Ri(){return Ua().memoizedState}function Li(){return Ua().memoizedState}function Mi(e){for(var t=e.return;null!==t;){switch(t.tag){case 24:case 3:var n=Rc(),r=aa(t,e=sa(n),n);return null!==r&&(Mc(r,t,n),ia(r,t,n)),t={cache:Ds()},void(e.payload=t)}t=t.return}}function Oi(e,t,n){var r=Rc();n={lane:r,revertLane:0,action:n,hasEagerState:!1,eagerState:null,next:null},zi(e)?Vi(t,n):null!==(n=Pr(e,t,n,r))&&(Mc(n,e,r),qi(n,t,r))}function Fi(e,t,n){Ui(e,t,n,Rc())}function Ui(e,t,n,r){var s={lane:r,revertLane:0,action:n,hasEagerState:!1,eagerState:null,next:null};if(zi(e))Vi(t,s);else{var a=e.alternate;if(0===e.lanes&&(null===a||0===a.lanes)&&null!==(a=t.lastRenderedReducer))try{var i=t.lastRenderedState,o=a(i,n);if(s.hasEagerState=!0,s.eagerState=o,Jn(o,i))return Tr(e,t,s,0),null===rc&&Cr(),!1}catch(l){}if(null!==(n=Pr(e,t,s,r)))return Mc(n,e,r),qi(n,t,r),!0}return!1}function Bi(e,t,n,r){if(r={lane:2,revertLane:Td(),action:r,hasEagerState:!1,eagerState:null,next:null},zi(e)){if(t)throw Error(i(479))}else null!==(t=Pr(e,n,r,2))&&Mc(t,e,2)}function zi(e){var t=e.alternate;return e===ya||null!==t&&t===ya}function Vi(e,t){Na=ja=!0;var n=e.pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function qi(e,t,n){if(0!==(4194048&n)){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,Ee(e,n)}}var Wi={readContext:Ss,use:za,useCallback:Ta,useContext:Ta,useEffect:Ta,useImperativeHandle:Ta,useLayoutEffect:Ta,useInsertionEffect:Ta,useMemo:Ta,useReducer:Ta,useRef:Ta,useState:Ta,useDebugValue:Ta,useDeferredValue:Ta,useTransition:Ta,useSyncExternalStore:Ta,useId:Ta,useHostTransitionStatus:Ta,useFormState:Ta,useActionState:Ta,useOptimistic:Ta,useMemoCache:Ta,useCacheRefresh:Ta},Hi={readContext:Ss,use:za,useCallback:function(e,t){return Fa().memoizedState=[e,void 0===t?null:t],e},useContext:Ss,useEffect:xi,useImperativeHandle:function(e,t,n){n=null!==n&&void 0!==n?n.concat([e]):null,gi(4194308,4,wi.bind(null,t,e),n)},useLayoutEffect:function(e,t){return gi(4194308,4,e,t)},useInsertionEffect:function(e,t){gi(4,2,e,t)},useMemo:function(e,t){var n=Fa();t=void 0===t?null:t;var r=e();if(ka){me(!0);try{e()}finally{me(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Fa();if(void 0!==n){var s=n(t);if(ka){me(!0);try{n(t)}finally{me(!1)}}}else s=t;return r.memoizedState=r.baseState=s,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:s},r.queue=e,e=e.dispatch=Oi.bind(null,ya,e),[r.memoizedState,e]},useRef:function(e){return e={current:e},Fa().memoizedState=e},useState:function(e){var t=(e=Za(e)).queue,n=Fi.bind(null,ya,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Ni,useDeferredValue:function(e,t){return Si(Fa(),e,t)},useTransition:function(){var e=Za(!1);return e=Ci.bind(null,ya,e.queue,!0,!1),Fa().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=ya,s=Fa();if(as){if(void 0===n)throw Error(i(407));n=n()}else{if(n=t(),null===rc)throw Error(i(349));0!==(124&ac)||Ka(r,t,n)}s.memoizedState=n;var a={value:n,getSnapshot:t};return s.queue=a,xi($a.bind(null,r,a,e),[e]),r.flags|=2048,hi(9,{destroy:void 0,resource:void 0},Ja.bind(null,r,a,n,t),null),n},useId:function(){var e=Fa(),t=rc.identifierPrefix;if(as){var n=Xr;t="\xab"+t+"R"+(n=(Qr&~(1<<32-he(Qr)-1)).toString(32)+n),0<(n=Aa++)&&(t+="H"+n.toString(32)),t+="\xbb"}else t="\xab"+t+"r"+(n=Ca++).toString(32)+"\xbb";return e.memoizedState=t},useHostTransitionStatus:Di,useFormState:li,useActionState:li,useOptimistic:function(e){var t=Fa();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Bi.bind(null,ya,!0,n),n.dispatch=t,[e,t]},useMemoCache:Va,useCacheRefresh:function(){return Fa().memoizedState=Mi.bind(null,ya)}},Gi={readContext:Ss,use:za,useCallback:ki,useContext:Ss,useEffect:bi,useImperativeHandle:ji,useInsertionEffect:yi,useLayoutEffect:vi,useMemo:Ai,useReducer:Wa,useRef:pi,useState:function(){return Wa(qa)},useDebugValue:Ni,useDeferredValue:function(e,t){return Ei(Ua(),va.memoizedState,e,t)},useTransition:function(){var e=Wa(qa)[0],t=Ua().memoizedState;return["boolean"===typeof e?e:Ba(e),t]},useSyncExternalStore:Ya,useId:Ri,useHostTransitionStatus:Di,useFormState:ci,useActionState:ci,useOptimistic:function(e,t){return ei(Ua(),0,e,t)},useMemoCache:Va,useCacheRefresh:Li},Yi={readContext:Ss,use:za,useCallback:ki,useContext:Ss,useEffect:bi,useImperativeHandle:ji,useInsertionEffect:yi,useLayoutEffect:vi,useMemo:Ai,useReducer:Ga,useRef:pi,useState:function(){return Ga(qa)},useDebugValue:Ni,useDeferredValue:function(e,t){var n=Ua();return null===va?Si(n,e,t):Ei(n,va.memoizedState,e,t)},useTransition:function(){var e=Ga(qa)[0],t=Ua().memoizedState;return["boolean"===typeof e?e:Ba(e),t]},useSyncExternalStore:Ya,useId:Ri,useHostTransitionStatus:Di,useFormState:mi,useActionState:mi,useOptimistic:function(e,t){var n=Ua();return null!==va?ei(n,0,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:Va,useCacheRefresh:Li},Ki=null,Ji=0;function $i(e){var t=Ji;return Ji+=1,null===Ki&&(Ki=[]),Qs(Ki,e,t)}function Qi(e,t){t=t.props.ref,e.ref=void 0!==t?t:null}function Xi(e,t){if(t.$$typeof===h)throw Error(i(525));throw e=Object.prototype.toString.call(t),Error(i(31,"[object Object]"===e?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Zi(e){return(0,e._init)(e._payload)}function eo(e){function t(t,n){if(e){var r=t.deletions;null===r?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;null!==r;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;null!==e;)null!==e.key?t.set(e.key,e):t.set(e.index,e),e=e.sibling;return t}function s(e,t){return(e=Fr(e,t)).index=0,e.sibling=null,e}function a(t,n,r){return t.index=r,e?null!==(r=t.alternate)?(r=r.index)<n?(t.flags|=67108866,n):r:(t.flags|=67108866,n):(t.flags|=1048576,n)}function o(t){return e&&null===t.alternate&&(t.flags|=67108866),t}function l(e,t,n,r){return null===t||6!==t.tag?((t=Vr(n,e.mode,r)).return=e,t):((t=s(t,n)).return=e,t)}function c(e,t,n,r){var a=n.type;return a===f?u(e,t,n.props.children,r,n.key):null!==t&&(t.elementType===a||"object"===typeof a&&null!==a&&a.$$typeof===S&&Zi(a)===t.type)?(Qi(t=s(t,n.props),n),t.return=e,t):(Qi(t=Br(n.type,n.key,n.props,null,e.mode,r),n),t.return=e,t)}function d(e,t,n,r){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?((t=qr(n,e.mode,r)).return=e,t):((t=s(t,n.children||[])).return=e,t)}function u(e,t,n,r,a){return null===t||7!==t.tag?((t=zr(n,e.mode,r,a)).return=e,t):((t=s(t,n)).return=e,t)}function m(e,t,n){if("string"===typeof t&&""!==t||"number"===typeof t||"bigint"===typeof t)return(t=Vr(""+t,e.mode,n)).return=e,t;if("object"===typeof t&&null!==t){switch(t.$$typeof){case p:return Qi(n=Br(t.type,t.key,t.props,null,e.mode,n),t),n.return=e,n;case g:return(t=qr(t,e.mode,n)).return=e,t;
vendor: 5,168 bytes, line 2
2case S:return m(e,t=(0,t._init)(t._payload),n)}if(D(t)||P(t))return(t=zr(t,e.mode,n,null)).return=e,t;if("function"===typeof t.then)return m(e,$i(t),n);if(t.$$typeof===w)return m(e,Es(e,t),n);Xi(e,t)}return null}function h(e,t,n,r){var s=null!==t?t.key:null;if("string"===typeof n&&""!==n||"number"===typeof n||"bigint"===typeof n)return null!==s?null:l(e,t,""+n,r);if("object"===typeof n&&null!==n){switch(n.$$typeof){case p:return n.key===s?c(e,t,n,r):null;case g:return n.key===s?d(e,t,n,r):null;case S:return h(e,t,n=(s=n._init)(n._payload),r)}if(D(n)||P(n))return null!==s?null:u(e,t,n,r,null);if("function"===typeof n.then)return h(e,t,$i(n),r);if(n.$$typeof===w)return h(e,t,Es(e,n),r);Xi(e,n)}return null}function x(e,t,n,r,s){if("string"===typeof r&&""!==r||"number"===typeof r||"bigint"===typeof r)return l(t,e=e.get(n)||null,""+r,s);if("object"===typeof r&&null!==r){switch(r.$$typeof){case p:return c(t,e=e.get(null===r.key?n:r.key)||null,r,s);case g:return d(t,e=e.get(null===r.key?n:r.key)||null,r,s);case S:return x(e,t,n,r=(0,r._init)(r._payload),s)}if(D(r)||P(r))return u(t,e=e.get(n)||null,r,s,null);if("function"===typeof r.then)return x(e,t,n,$i(r),s);if(r.$$typeof===w)return x(e,t,n,Es(t,r),s);Xi(t,r)}return null}function b(l,c,d,u){if("object"===typeof d&&null!==d&&d.type===f&&null===d.key&&(d=d.props.children),"object"===typeof d&&null!==d){switch(d.$$typeof){case p:e:{for(var y=d.key;null!==c;){if(c.key===y){if((y=d.type)===f){if(7===c.tag){n(l,c.sibling),(u=s(c,d.props.children)).return=l,l=u;break e}}else if(c.elementType===y||"object"===typeof y&&null!==y&&y.$$typeof===S&&Zi(y)===c.type){n(l,c.sibling),Qi(u=s(c,d.props),d),u.return=l,l=u;break e}n(l,c);break}t(l,c),c=c.sibling}d.type===f?((u=zr(d.props.children,l.mode,u,d.key)).return=l,l=u):(Qi(u=Br(d.type,d.key,d.props,null,l.mode,u),d),u.return=l,l=u)}return o(l);case g:e:{for(y=d.key;null!==c;){if(c.key===y){if(4===c.tag&&c.stateNode.containerInfo===d.containerInfo&&c.stateNode.implementation===d.implementation){n(l,c.sibling),(u=s(c,d.children||[])).return=l,l=u;break e}n(l,c);break}t(l,c),c=c.sibling}(u=qr(d,l.mode,u)).return=l,l=u}return o(l);case S:return b(l,c,d=(y=d._init)(d._payload),u)}if(D(d))return function(s,i,o,l){for(var c=null,d=null,u=i,p=i=0,g=null;null!==u&&p<o.length;p++){u.index>p?(g=u,u=null):g=u.sibling;var f=h(s,u,o[p],l);if(null===f){null===u&&(u=g);break}e&&u&&null===f.alternate&&t(s,u),i=a(f,i,p),null===d?c=f:d.sibling=f,d=f,u=g}if(p===o.length)return n(s,u),as&&Zr(s,p),c;if(null===u){for(;p<o.length;p++)null!==(u=m(s,o[p],l))&&(i=a(u,i,p),null===d?c=u:d.sibling=u,d=u);return as&&Zr(s,p),c}for(u=r(u);p<o.length;p++)null!==(g=x(u,s,p,o[p],l))&&(e&&null!==g.alternate&&u.delete(null===g.key?p:g.key),i=a(g,i,p),null===d?c=g:d.sibling=g,d=g);return e&&u.forEach(function(e){return t(s,e)}),as&&Zr(s,p),c}(l,c,d,u);if(P(d)){if("function"!==typeof(y=P(d)))throw Error(i(150));return function(s,o,l,c){if(null==l)throw Error(i(151));for(var d=null,u=null,p=o,g=o=0,f=null,b=l.next();null!==p&&!b.done;g++,b=l.next()){p.index>g?(f=p,p=null):f=p.sibling;var y=h(s,p,b.value,c);if(null===y){null===p&&(p=f);break}e&&p&&null===y.alternate&&t(s,p),o=a(y,o,g),null===u?d=y:u.sibling=y,u=y,p=f}if(b.done)return n(s,p),as&&Zr(s,g),d;if(null===p){for(;!b.done;g++,b=l.next())null!==(b=m(s,b.value,c))&&(o=a(b,o,g),null===u?d=b:u.sibling=b,u=b);return as&&Zr(s,g),d}for(p=r(p);!b.done;g++,b=l.next())null!==(b=x(p,s,g,b.value,c))&&(e&&null!==b.alternate&&p.delete(null===b.key?g:b.key),o=a(b,o,g),null===u?d=b:u.sibling=b,u=b);return e&&p.forEach(function(e){return t(s,e)}),as&&Zr(s,g),d}(l,c,d=y.call(d),u)}if("function"===typeof d.then)return b(l,c,$i(d),u);if(d.$$typeof===w)return b(l,c,Es(l,d),u);Xi(l,d)}return"string"===typeof d&&""!==d||"number"===typeof d||"bigint"===typeof d?(d=""+d,null!==c&&6===c.tag?(n(l,c.sibling),(u=s(c,d)).return=l,l=u):(n(l,c),(u=Vr(d,l.mode,u)).return=l,l=u),o(l)):n(l,c)}return function(e,t,n,r){try{Ji=0;var s=b(e,t,n,r);return Ki=null,s}catch(i){if(i===Hs||i===Ys)throw i;var a=Mr(29,i,null,e.mode);return a.lanes=r,a.return=e,a}}}var to=eo(!0),no=eo(!1),ro=U(null),so=null;function ao(e){var t=e.alternate;z(co,1&co.current),z(ro,e),null===so&&(null===t||null!==ha.current||null!==t.memoizedState)&&(so=e)}function io(e){if(22===e.tag){if(z(co,co.current),z(ro,e),null===so){var t=e.alternate;null!==t&&null!==t.memoizedState&&(so=e)}}else oo()}function oo(){z(co,co.current),z(ro,ro.current)}function lo(e){B(ro),so===e&&(so=null),B(co)}var co=U(0);function uo(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||"$?"===n.data||fu(n)))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!==(128&t.flags))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}function mo(e,t,n,r){n=null===(n=n(r,t=e.memoizedState))||void 0===n?t:m({},t,n),e.memoizedState=n,0===e.lanes&&(e.updateQueue.baseState=n)}var ho={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Rc(),s=sa(r);
2s.payload=t,void 0!==n&&null!==n&&(s.callback=n),null!==(t=aa(e,s,r))&&(Mc(t,e,r),ia(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Rc(),s=sa(r);s.tag=1,s.payload=t,void 0!==n&&null!==n&&(s.callback=n),null!==(t=aa(e,s,r))&&(Mc(t,e,r),ia(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Rc(),r=sa(n);r.tag=2,void 0!==t&&null!==t&&(r.callback=t),null!==(t=aa(e,r,n))&&(Mc(t,e,n),ia(t,e,n))}};function po(e,t,n,r,s,a,i){return"function"===typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(r,a,i):!t.prototype||!t.prototype.isPureReactComponent||(!$n(n,r)||!$n(s,a))}function go(e,t,n,r){e=t.state,"function"===typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,r),"function"===typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&ho.enqueueReplaceState(t,t.state,null)}function fo(e,t){var n=t;if("ref"in t)for(var r in n={},t)"ref"!==r&&(n[r]=t[r]);if(e=e.defaultProps)for(var s in n===t&&(n=m({},n)),e)void 0===n[s]&&(n[s]=e[s]);return n}var xo="function"===typeof reportError?reportError:function(e){if("object"===typeof window&&"function"===typeof window.ErrorEvent){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:"object"===typeof e&&null!==e&&"string"===typeof e.message?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if("object"===typeof process&&"function"===typeof process.emit)return void process.emit("uncaughtException",e);console.error(e)};function bo(e){xo(e)}function yo(e){console.error(e)}function vo(e){xo(e)}function wo(e,t){try{(0,e.onUncaughtError)(t.value,{componentStack:t.stack})}catch(n){setTimeout(function(){throw n})}}function jo(e,t,n){try{(0,e.onCaughtError)(n.value,{componentStack:n.stack,errorBoundary:1===t.tag?t.stateNode:null})}catch(r){setTimeout(function(){throw r})}}function No(e,t,n){return(n=sa(n)).tag=3,n.payload={element:null},n.callback=function(){wo(e,t)},n}function ko(e){return(e=sa(e)).tag=3,e}function Ao(e,t,n,r){var s=n.type.getDerivedStateFromError;if("function"===typeof s){var a=r.value;e.payload=function(){return s(a)},e.callback=function(){jo(t,n,r)}}var i=n.stateNode;null!==i&&"function"===typeof i.componentDidCatch&&(e.callback=function(){jo(t,n,r),"function"!==typeof s&&(null===kc?kc=new Set([this]):kc.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:null!==e?e:""})})}var So=Error(i(461)),Eo=!1;function Co(e,t,n,r){t.child=null===e?no(t,null,n,r):to(t,e.child,n,r)}function To(e,t,n,r,s){n=n.render;var a=t.ref;if("ref"in r){var i={};for(var o in r)"ref"!==o&&(i[o]=r[o])}else i=r;return As(t),r=_a(e,t,n,i,a,s),o=La(),null===e||Eo?(as&&o&&ts(t),t.flags|=1,Co(e,t,r,s),t.child):(Ma(e,t,s),Jo(e,t,s))}function Po(e,t,n,r,s){if(null===e){var a=n.type;return"function"!==typeof a||Or(a)||void 0!==a.defaultProps||null!==n.compare?((e=Br(n.type,null,r,t,t.mode,s)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=a,_o(e,t,a,r,s))}if(a=e.child,!$o(e,s)){var i=a.memoizedProps;if((n=null!==(n=n.compare)?n:$n)(i,r)&&e.ref===t.ref)return Jo(e,t,s)}return t.flags|=1,(e=Fr(a,r)).ref=t.ref,e.return=t,t.child=e}function _o(e,t,n,r,s){if(null!==e){var a=e.memoizedProps;if($n(a,r)&&e.ref===t.ref){if(Eo=!1,t.pendingProps=r=a,!$o(e,s))return t.lanes=e.lanes,Jo(e,t,s);0!==(131072&e.flags)&&(Eo=!0)}}return Lo(e,t,n,r,s)}function Io(e,t,n){var r=t.pendingProps,s=r.children,a=null!==e?e.memoizedState:null;if("hidden"===r.mode){if(0!==(128&t.flags)){if(r=null!==a?a.baseLanes|n:n,null!==e){for(s=t.child=e.child,a=0;null!==s;)a=a|s.lanes|s.childLanes,s=s.sibling;t.childLanes=a&~r}else t.childLanes=0,t.child=null;return Do(e,t,r,n)}if(0===(536870912&n))return t.lanes=t.childLanes=536870912,Do(e,t,null!==a?a.baseLanes|n:n,n);t.memoizedState={baseLanes:0,cachePool:null},null!==e&&qs(0,null!==a?a.cachePool:null),null!==a?ga(t,a):fa(),io(t)}else null!==a?(qs(0,a.cachePool),ga(t,a),oo(),t.memoizedState=null):(null!==e&&qs(0,null),fa(),oo());return Co(e,t,s,n),t.child}function Do(e,t,n,r){var s=Vs();return s=null===s?null:{parent:Is._currentValue,pool:s},t.memoizedState={baseLanes:n,cachePool:s},null!==e&&qs(0,null),fa(),io(t),null!==e&&Ns(e,t,r,!0),null}function Ro(e,t){var n=t.ref;if(null===n)null!==e&&null!==e.ref&&(t.flags|=4194816);else{if("function"!==typeof n&&"object"!==typeof n)throw Error(i(284));null!==e&&e.ref===n||(t.flags|=4194816)}}
2function Lo(e,t,n,r,s){return As(t),n=_a(e,t,n,r,void 0,s),r=La(),null===e||Eo?(as&&r&&ts(t),t.flags|=1,Co(e,t,n,s),t.child):(Ma(e,t,s),Jo(e,t,s))}function Mo(e,t,n,r,s,a){return As(t),t.updateQueue=null,n=Da(t,r,n,s),Ia(e),r=La(),null===e||Eo?(as&&r&&ts(t),t.flags|=1,Co(e,t,n,a),t.child):(Ma(e,t,a),Jo(e,t,a))}function Oo(e,t,n,r,s){if(As(t),null===t.stateNode){var a=Rr,i=n.contextType;"object"===typeof i&&null!==i&&(a=Ss(i)),a=new n(r,a),t.memoizedState=null!==a.state&&void 0!==a.state?a.state:null,a.updater=ho,t.stateNode=a,a._reactInternals=t,(a=t.stateNode).props=r,a.state=t.memoizedState,a.refs={},na(t),i=n.contextType,a.context="object"===typeof i&&null!==i?Ss(i):Rr,a.state=t.memoizedState,"function"===typeof(i=n.getDerivedStateFromProps)&&(mo(t,n,i,r),a.state=t.memoizedState),"function"===typeof n.getDerivedStateFromProps||"function"===typeof a.getSnapshotBeforeUpdate||"function"!==typeof a.UNSAFE_componentWillMount&&"function"!==typeof a.componentWillMount||(i=a.state,"function"===typeof a.componentWillMount&&a.componentWillMount(),"function"===typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount(),i!==a.state&&ho.enqueueReplaceState(a,a.state,null),da(t,r,a,s),ca(),a.state=t.memoizedState),"function"===typeof a.componentDidMount&&(t.flags|=4194308),r=!0}else if(null===e){a=t.stateNode;var o=t.memoizedProps,l=fo(n,o);a.props=l;var c=a.context,d=n.contextType;i=Rr,"object"===typeof d&&null!==d&&(i=Ss(d));var u=n.getDerivedStateFromProps;d="function"===typeof u||"function"===typeof a.getSnapshotBeforeUpdate,o=t.pendingProps!==o,d||"function"!==typeof a.UNSAFE_componentWillReceiveProps&&"function"!==typeof a.componentWillReceiveProps||(o||c!==i)&&go(t,a,r,i),ta=!1;var m=t.memoizedState;a.state=m,da(t,r,a,s),ca(),c=t.memoizedState,o||m!==c||ta?("function"===typeof u&&(mo(t,n,u,r),c=t.memoizedState),(l=ta||po(t,n,l,r,m,c,i))?(d||"function"!==typeof a.UNSAFE_componentWillMount&&"function"!==typeof a.componentWillMount||("function"===typeof a.componentWillMount&&a.componentWillMount(),"function"===typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount()),"function"===typeof a.componentDidMount&&(t.flags|=4194308)):("function"===typeof a.componentDidMount&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),a.props=r,a.state=c,a.context=i,r=l):("function"===typeof a.componentDidMount&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,ra(e,t),d=fo(n,i=t.memoizedProps),a.props=d,u=t.pendingProps,m=a.context,c=n.contextType,l=Rr,"object"===typeof c&&null!==c&&(l=Ss(c)),(c="function"===typeof(o=n.getDerivedStateFromProps)||"function"===typeof a.getSnapshotBeforeUpdate)||"function"!==typeof a.UNSAFE_componentWillReceiveProps&&"function"!==typeof a.componentWillReceiveProps||(i!==u||m!==l)&&go(t,a,r,l),ta=!1,m=t.memoizedState,a.state=m,da(t,r,a,s),ca();var h=t.memoizedState;i!==u||m!==h||ta||null!==e&&null!==e.dependencies&&ks(e.dependencies)?("function"===typeof o&&(mo(t,n,o,r),h=t.memoizedState),(d=ta||po(t,n,d,r,m,h,l)||null!==e&&null!==e.dependencies&&ks(e.dependencies))?(c||"function"!==typeof a.UNSAFE_componentWillUpdate&&"function"!==typeof a.componentWillUpdate||("function"===typeof a.componentWillUpdate&&a.componentWillUpdate(r,h,l),"function"===typeof a.UNSAFE_componentWillUpdate&&a.UNSAFE_componentWillUpdate(r,h,l)),"function"===typeof a.componentDidUpdate&&(t.flags|=4),"function"===typeof a.getSnapshotBeforeUpdate&&(t.flags|=1024)):("function"!==typeof a.componentDidUpdate||i===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),"function"!==typeof a.getSnapshotBeforeUpdate||i===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=h),a.props=r,a.state=h,a.context=l,r=d):("function"!==typeof a.componentDidUpdate||i===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),"function"!==typeof a.getSnapshotBeforeUpdate||i===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,Ro(e,t),r=0!==(128&t.flags),a||r?(a=t.stateNode,n=r&&"function"!==typeof n.getDerivedStateFromError?null:a.render(),t.flags|=1,null!==e&&r?(t.child=to(t,e.child,null,s),t.child=to(t,null,n,s)):Co(e,t,n,s),t.memoizedState=a.state,e=t.child):e=Jo(e,t,s),e}function Fo(e,t,n,r){return hs(),t.flags|=256,Co(e,t,n,r),t.child}var Uo={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Bo(e){return{baseLanes:e,cachePool:Ws()}}
vendor: 9,086 bytes, line 2
2function zo(e,t,n){return e=null!==e?e.childLanes&~n:0,t&&(e|=fc),e}function Vo(e,t,n){var r,s=t.pendingProps,a=!1,o=0!==(128&t.flags);if((r=o)||(r=(null===e||null!==e.memoizedState)&&0!==(2&co.current)),r&&(a=!0,t.flags&=-129),r=0!==(32&t.flags),t.flags&=-33,null===e){if(as){if(a?ao(t):oo(),as){var l,c=ss;if(l=c){e:{for(l=c,c=os;8!==l.nodeType;){if(!c){c=null;break e}if(null===(l=xu(l.nextSibling))){c=null;break e}}c=l}null!==c?(t.memoizedState={dehydrated:c,treeContext:null!==$r?{id:Qr,overflow:Xr}:null,retryLane:536870912,hydrationErrors:null},(l=Mr(18,null,null,0)).stateNode=c,l.return=t,t.child=l,rs=t,ss=null,l=!0):l=!1}l||cs(t)}if(null!==(c=t.memoizedState)&&null!==(c=c.dehydrated))return fu(c)?t.lanes=32:t.lanes=536870912,null;lo(t)}return c=s.children,s=s.fallback,a?(oo(),c=Wo({mode:"hidden",children:c},a=t.mode),s=zr(s,a,n,null),c.return=t,s.return=t,c.sibling=s,t.child=c,(a=t.child).memoizedState=Bo(n),a.childLanes=zo(e,r,n),t.memoizedState=Uo,s):(ao(t),qo(t,c))}if(null!==(l=e.memoizedState)&&null!==(c=l.dehydrated)){if(o)256&t.flags?(ao(t),t.flags&=-257,t=Ho(e,t,n)):null!==t.memoizedState?(oo(),t.child=e.child,t.flags|=128,t=null):(oo(),a=s.fallback,c=t.mode,s=Wo({mode:"visible",children:s.children},c),(a=zr(a,c,n,null)).flags|=2,s.return=t,a.return=t,s.sibling=a,t.child=s,to(t,e.child,null,n),(s=t.child).memoizedState=Bo(n),s.childLanes=zo(e,r,n),t.memoizedState=Uo,t=a);else if(ao(t),fu(c)){if(r=c.nextSibling&&c.nextSibling.dataset)var d=r.dgst;r=d,(s=Error(i(419))).stack="",s.digest=r,gs({value:s,source:null,stack:null}),t=Ho(e,t,n)}else if(Eo||Ns(e,t,n,!1),r=0!==(n&e.childLanes),Eo||r){if(null!==(r=rc)&&(0!==(s=0!==((s=0!==(42&(s=n&-n))?1:Ce(s))&(r.suspendedLanes|n))?0:s)&&s!==l.retryLane))throw l.retryLane=s,_r(e,s),Mc(r,e,s),So;"$?"===c.data||Yc(),t=Ho(e,t,n)}else"$?"===c.data?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,ss=xu(c.nextSibling),rs=t,as=!0,is=null,os=!1,null!==e&&(Kr[Jr++]=Qr,Kr[Jr++]=Xr,Kr[Jr++]=$r,Qr=e.id,Xr=e.overflow,$r=t),(t=qo(t,s.children)).flags|=4096);return t}return a?(oo(),a=s.fallback,c=t.mode,d=(l=e.child).sibling,(s=Fr(l,{mode:"hidden",children:s.children})).subtreeFlags=65011712&l.subtreeFlags,null!==d?a=Fr(d,a):(a=zr(a,c,n,null)).flags|=2,a.return=t,s.return=t,s.sibling=a,t.child=s,s=a,a=t.child,null===(c=e.child.memoizedState)?c=Bo(n):(null!==(l=c.cachePool)?(d=Is._currentValue,l=l.parent!==d?{parent:d,pool:d}:l):l=Ws(),c={baseLanes:c.baseLanes|n,cachePool:l}),a.memoizedState=c,a.childLanes=zo(e,r,n),t.memoizedState=Uo,s):(ao(t),e=(n=e.child).sibling,(n=Fr(n,{mode:"visible",children:s.children})).return=t,n.sibling=null,null!==e&&(null===(r=t.deletions)?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=n,t.memoizedState=null,n)}function qo(e,t){return(t=Wo({mode:"visible",children:t},e.mode)).return=e,e.child=t}function Wo(e,t){return(e=Mr(22,e,null,t)).lanes=0,e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},e}function Ho(e,t,n){return to(t,e.child,null,n),(e=qo(t,t.pendingProps.children)).flags|=2,t.memoizedState=null,e}function Go(e,t,n){e.lanes|=t;var r=e.alternate;null!==r&&(r.lanes|=t),ws(e.return,t,n)}function Yo(e,t,n,r,s){var a=e.memoizedState;null===a?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:s}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=s)}function Ko(e,t,n){var r=t.pendingProps,s=r.revealOrder,a=r.tail;if(Co(e,t,r.children,n),0!==(2&(r=co.current)))r=1&r|2,t.flags|=128;else{if(null!==e&&0!==(128&e.flags))e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&Go(e,n,t);else if(19===e.tag)Go(e,n,t);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}switch(z(co,r),s){case"forwards":for(n=t.child,s=null;null!==n;)null!==(e=n.alternate)&&null===uo(e)&&(s=n),n=n.sibling;null===(n=s)?(s=t.child,t.child=null):(s=n.sibling,n.sibling=null),Yo(t,!1,s,n,a);break;case"backwards":for(n=null,s=t.child,t.child=null;null!==s;){if(null!==(e=s.alternate)&&null===uo(e)){t.child=s;break}e=s.sibling,s.sibling=n,n=s,s=e}Yo(t,!0,n,null,a);break;case"together":Yo(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Jo(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),hc|=t.lanes,0===(n&t.childLanes)){if(null===e)return null;if(Ns(e,t,n,!1),0===(n&t.childLanes))return null}if(null!==e&&t.child!==e.child)throw Error(i(153));if(null!==t.child){for(n=Fr(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=Fr(e,e.pendingProps)).return=t;n.sibling=null}return t.child}function $o(e,t){return 0!==(e.lanes&t)||!(null===(e=e.dependencies)||!ks(e))}function Qo(e,t,n){if(null!==e)if(e.memoizedProps!==t.pendingProps)Eo=!0;else{if(!$o(e,n)&&0===(128&t.flags))return Eo=!1,function(e,t,n){switch(t.tag){case 3:G(t,t.stateNode.containerInfo),ys(0,Is,e.memoizedState.cache),hs();break;case 27:case 5:K(t);break;case 4:G(t,t.stateNode.containerInfo);break;case 10:ys(0,t.type,t.memoizedProps.value);break;case 13:var r=t.memoizedState;if(null!==r)return null!==r.dehydrated?(ao(t),t.flags|=128,null):0!==(n&t.child.childLanes)?Vo(e,t,n):(ao(t),null!==(e=Jo(e,t,n))?e.sibling:null);ao(t);break;case 19:var s=0!==(128&e.flags);if((r=0!==(n&t.childLanes))||(Ns(e,t,n,!1),r=0!==(n&t.childLanes)),s){if(r)return Ko(e,t,n);t.flags|=128}if(null!==(s=t.memoizedState)&&(s.rendering=null,s.tail=null,s.lastEffect=null),z(co,co.current),r)break;return null;case 22:case 23:return t.lanes=0,Io(e,t,n);case 24:ys(0,Is,e.memoizedState.cache)}return Jo(e,t,n)}(e,t,n);Eo=0!==(131072&e.flags)}else Eo=!1,as&&0!==(1048576&t.flags)&&es(t,Yr,t.index);switch(t.lanes=0,t.tag){case 16:e:{e=t.pendingProps;var r=t.elementType,s=r._init;if(r=s(r._payload),t.type=r,"function"!==typeof r){if(void 0!==r&&null!==r){if((s=r.$$typeof)===j){t.tag=11,t=To(null,t,r,e,n);break e}if(s===A){t.tag=14,t=Po(null,t,r,e,n);break e}}throw t=I(r)||r,Error(i(306,t,""))}Or(r)?(e=fo(r,e),t.tag=1,t=Oo(null,t,r,e,n)):(t.tag=0,t=Lo(null,t,r,e,n))}return t;case 0:return Lo(e,t,t.type,t.pendingProps,n);case 1:return Oo(e,t,r=t.type,s=fo(r,t.pendingProps),n);case 3:e:{if(G(t,t.stateNode.containerInfo),null===e)throw Error(i(387));r=t.pendingProps;var a=t.memoizedState;s=a.element,ra(e,t),da(t,r,null,n);var o=t.memoizedState;if(r=o.cache,ys(0,Is,r),r!==a.cache&&js(t,[Is],n,!0),ca(),r=o.element,a.isDehydrated){if(a={element:r,isDehydrated:!1,cache:o.cache},t.updateQueue.baseState=a,t.memoizedState=a,256&t.flags){t=Fo(e,t,r,n);break e}if(r!==s){gs(s=kr(Error(i(424)),t)),t=Fo(e,t,r,n);break e}if(9===(e=t.stateNode.containerInfo).nodeType)e=e.body;else e="HTML"===e.nodeName?e.ownerDocument.body:e;for(ss=xu(e.firstChild),rs=t,as=!0,is=null,os=!0,n=no(t,null,r,n),t.child=n;n;)n.flags=-3&n.flags|4096,n=n.sibling}else{if(hs(),r===s){t=Jo(e,t,n);break e}Co(e,t,r,n)}t=t.child}return t;case 26:return Ro(e,t),null===e?(n=Cu(t.type,null,t.pendingProps,null))?t.memoizedState=n:as||(n=t.type,e=t.pendingProps,(r=ru(W.current).createElement(n))[Ie]=t,r[De]=e,eu(r,n,e),He(r),t.stateNode=r):t.memoizedState=Cu(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return K(t),null===e&&as&&(r=t.stateNode=vu(t.type,t.pendingProps,W.current),rs=t,os=!0,s=ss,hu(t.type)?(bu=s,ss=xu(r.firstChild)):ss=s),Co(e,t,t.pendingProps.children,n),Ro(e,t),null===e&&(t.flags|=4194304),t.child;case 5:return null===e&&as&&((s=r=ss)&&(null!==(r=function(e,t,n,r){for(;1===e.nodeType;){var s=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&("INPUT"!==e.nodeName||"hidden"!==e.type))break}else if(r){if(!e[Ue])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if("stylesheet"===(a=e.getAttribute("rel"))&&e.hasAttribute("data-precedence"))break;if(a!==s.rel||e.getAttribute("href")!==(null==s.href||""===s.href?null:s.href)||e.getAttribute("crossorigin")!==(null==s.crossOrigin?null:s.crossOrigin)||e.getAttribute("title")!==(null==s.title?null:s.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(((a=e.getAttribute("src"))!==(null==s.src?null:s.src)||e.getAttribute("type")!==(null==s.type?null:s.type)||e.getAttribute("crossorigin")!==(null==s.crossOrigin?null:s.crossOrigin))&&a&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else{if("input"!==t||"hidden"!==e.type)return e;var a=null==s.name?null:""+s.name;if("hidden"===s.type&&e.getAttribute("name")===a)return e}if(null===(e=xu(e.nextSibling)))break}return null}(r,t.type,t.pendingProps,os))?(t.stateNode=r,rs=t,ss=xu(r.firstChild),os=!1,s=!0):s=!1),s||cs(t)),K(t),s=t.type,a=t.pendingProps,o=null!==e?e.memoizedProps:null,r=a.children,iu(s,a)?r=null:null!==o&&iu(s,o)&&(t.flags|=32),null!==t.memoizedState&&(s=_a(e,t,Ra,null,null,n),Ku._currentValue=s),Ro(e,t),Co(e,t,r,n),t.child;case 6:return null===e&&as&&((e=n=ss)&&(null!==(n=function(e,t,n){if(""===t)return null;for(;3!==e.nodeType;
vendor: 9,407 bytes, line 2
2){if((1!==e.nodeType||"INPUT"!==e.nodeName||"hidden"!==e.type)&&!n)return null;if(null===(e=xu(e.nextSibling)))return null}return e}(n,t.pendingProps,os))?(t.stateNode=n,rs=t,ss=null,e=!0):e=!1),e||cs(t)),null;case 13:return Vo(e,t,n);case 4:return G(t,t.stateNode.containerInfo),r=t.pendingProps,null===e?t.child=to(t,null,r,n):Co(e,t,r,n),t.child;case 11:return To(e,t,t.type,t.pendingProps,n);case 7:return Co(e,t,t.pendingProps,n),t.child;case 8:case 12:return Co(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,ys(0,t.type,r.value),Co(e,t,r.children,n),t.child;case 9:return s=t.type._context,r=t.pendingProps.children,As(t),r=r(s=Ss(s)),t.flags|=1,Co(e,t,r,n),t.child;case 14:return Po(e,t,t.type,t.pendingProps,n);case 15:return _o(e,t,t.type,t.pendingProps,n);case 19:return Ko(e,t,n);case 31:return r=t.pendingProps,n=t.mode,r={mode:r.mode,children:r.children},null===e?((n=Wo(r,n)).ref=t.ref,t.child=n,n.return=t,t=n):((n=Fr(e.child,r)).ref=t.ref,t.child=n,n.return=t,t=n),t;case 22:return Io(e,t,n);case 24:return As(t),r=Ss(Is),null===e?(null===(s=Vs())&&(s=rc,a=Ds(),s.pooledCache=a,a.refCount++,null!==a&&(s.pooledCacheLanes|=n),s=a),t.memoizedState={parent:r,cache:s},na(t),ys(0,Is,s)):(0!==(e.lanes&n)&&(ra(e,t),da(t,null,null,n),ca()),s=e.memoizedState,a=t.memoizedState,s.parent!==r?(s={parent:r,cache:r},t.memoizedState=s,0===t.lanes&&(t.memoizedState=t.updateQueue.baseState=s),ys(0,Is,r)):(r=a.cache,ys(0,Is,r),r!==s.cache&&js(t,[Is],n,!0))),Co(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Xo(e){e.flags|=4}function Zo(e,t){if("stylesheet"!==t.type||0!==(4&t.state.loading))e.flags&=-16777217;else if(e.flags|=16777216,!zu(t)){if(null!==(t=ro.current)&&((4194048&ac)===ac?null!==so:(62914560&ac)!==ac&&0===(536870912&ac)||t!==so))throw Xs=Ks,Gs;e.flags|=8192}}function el(e,t){null!==t&&(e.flags|=4),16384&e.flags&&(t=22!==e.tag?Ne():536870912,e.lanes|=t,xc|=t)}function tl(e,t){if(!as)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function nl(e){var t=null!==e.alternate&&e.alternate.child===e.child,n=0,r=0;if(t)for(var s=e.child;null!==s;)n|=s.lanes|s.childLanes,r|=65011712&s.subtreeFlags,r|=65011712&s.flags,s.return=e,s=s.sibling;else for(s=e.child;null!==s;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags,r|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function rl(e,t,n){var r=t.pendingProps;switch(ns(t),t.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:case 1:return nl(t),null;case 3:return n=t.stateNode,r=null,null!==e&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),vs(Is),Y(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),null!==e&&null!==e.child||(ms(t)?Xo(t):null===e||e.memoizedState.isDehydrated&&0===(256&t.flags)||(t.flags|=1024,ps())),nl(t),null;case 26:return n=t.memoizedState,null===e?(Xo(t),null!==n?(nl(t),Zo(t,n)):(nl(t),t.flags&=-16777217)):n?n!==e.memoizedState?(Xo(t),nl(t),Zo(t,n)):(nl(t),t.flags&=-16777217):(e.memoizedProps!==r&&Xo(t),nl(t),t.flags&=-16777217),null;case 27:J(t),n=W.current;var s=t.type;if(null!==e&&null!=t.stateNode)e.memoizedProps!==r&&Xo(t);else{if(!r){if(null===t.stateNode)throw Error(i(166));return nl(t),null}e=V.current,ms(t)?ds(t):(e=vu(s,r,n),t.stateNode=e,Xo(t))}return nl(t),null;case 5:if(J(t),n=t.type,null!==e&&null!=t.stateNode)e.memoizedProps!==r&&Xo(t);else{if(!r){if(null===t.stateNode)throw Error(i(166));return nl(t),null}if(e=V.current,ms(t))ds(t);else{switch(s=ru(W.current),e){case 1:e=s.createElementNS("http://www.w3.org/2000/svg",n);break;case 2:e=s.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;default:switch(n){case"svg":e=s.createElementNS("http://www.w3.org/2000/svg",n);break;case"math":e=s.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;case"script":(e=s.createElement("div")).innerHTML="<script><\/script>",e=e.removeChild(e.firstChild);break;case"select":e="string"===typeof r.is?s.createElement("select",{is:r.is}):s.createElement("select"),r.multiple?e.multiple=!0:r.size&&(e.size=r.size);break;default:e="string"===typeof r.is?s.createElement(n,{is:r.is}):s.createElement(n)}}e[Ie]=t,e[De]=r;e:for(s=t.child;null!==s;){if(5===s.tag||6===s.tag)e.appendChild(s.stateNode);else if(4!==s.tag&&27!==s.tag&&null!==s.child){s.child.return=s,s=s.child;continue}if(s===t)break e;for(;null===s.sibling;){if(null===s.return||s.return===t)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=e;e:switch(eu(e,n,r),n){case"button":case"input":case"select":case"textarea":e=!!r.autoFocus;break e;case"img":e=!0;break e;default:e=!1}e&&Xo(t)}}return nl(t),t.flags&=-16777217,null;case 6:if(e&&null!=t.stateNode)e.memoizedProps!==r&&Xo(t);else{if("string"!==typeof r&&null===t.stateNode)throw Error(i(166));if(e=W.current,ms(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,null!==(s=rs))switch(s.tag){case 27:case 5:r=s.memoizedProps}e[Ie]=t,(e=!!(e.nodeValue===n||null!==r&&!0===r.suppressHydrationWarning||$d(e.nodeValue,n)))||cs(t)}else(e=ru(e).createTextNode(r))[Ie]=t,t.stateNode=e}return nl(t),null;case 13:if(r=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(s=ms(t),null!==r&&null!==r.dehydrated){if(null===e){if(!s)throw Error(i(318));if(!(s=null!==(s=t.memoizedState)?s.dehydrated:null))throw Error(i(317));s[Ie]=t}else hs(),0===(128&t.flags)&&(t.memoizedState=null),t.flags|=4;nl(t),s=!1}else s=ps(),null!==e&&null!==e.memoizedState&&(e.memoizedState.hydrationErrors=s),s=!0;if(!s)return 256&t.flags?(lo(t),t):(lo(t),null)}if(lo(t),0!==(128&t.flags))return t.lanes=n,t;if(n=null!==r,e=null!==e&&null!==e.memoizedState,n){s=null,null!==(r=t.child).alternate&&null!==r.alternate.memoizedState&&null!==r.alternate.memoizedState.cachePool&&(s=r.alternate.memoizedState.cachePool.pool);var a=null;null!==r.memoizedState&&null!==r.memoizedState.cachePool&&(a=r.memoizedState.cachePool.pool),a!==s&&(r.flags|=2048)}return n!==e&&n&&(t.child.flags|=8192),el(t,t.updateQueue),nl(t),null;case 4:return Y(),null===e&&Bd(t.stateNode.containerInfo),nl(t),null;case 10:return vs(t.type),nl(t),null;case 19:if(B(co),null===(s=t.memoizedState))return nl(t),null;if(r=0!==(128&t.flags),null===(a=s.rendering))if(r)tl(s,!1);else{if(0!==mc||null!==e&&0!==(128&e.flags))for(e=t.child;null!==e;){if(null!==(a=uo(e))){for(t.flags|=128,tl(s,!1),e=a.updateQueue,t.updateQueue=e,el(t,e),t.subtreeFlags=0,e=n,n=t.child;null!==n;)Ur(n,e),n=n.sibling;return z(co,1&co.current|2),t.child}e=e.sibling}null!==s.tail&&te()>jc&&(t.flags|=128,r=!0,tl(s,!1),t.lanes=4194304)}else{if(!r)if(null!==(e=uo(a))){if(t.flags|=128,r=!0,e=e.updateQueue,t.updateQueue=e,el(t,e),tl(s,!0),null===s.tail&&"hidden"===s.tailMode&&!a.alternate&&!as)return nl(t),null}else 2*te()-s.renderingStartTime>jc&&536870912!==n&&(t.flags|=128,r=!0,tl(s,!1),t.lanes=4194304);s.isBackwards?(a.sibling=t.child,t.child=a):(null!==(e=s.last)?e.sibling=a:t.child=a,s.last=a)}return null!==s.tail?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=te(),t.sibling=null,e=co.current,z(co,r?1&e|2:1&e),t):(nl(t),null);case 22:case 23:return lo(t),xa(),r=null!==t.memoizedState,null!==e?null!==e.memoizedState!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?0!==(536870912&n)&&0===(128&t.flags)&&(nl(t),6&t.subtreeFlags&&(t.flags|=8192)):nl(t),null!==(n=t.updateQueue)&&el(t,n.retryQueue),n=null,null!==e&&null!==e.memoizedState&&null!==e.memoizedState.cachePool&&(n=e.memoizedState.cachePool.pool),r=null,null!==t.memoizedState&&null!==t.memoizedState.cachePool&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),null!==e&&B(zs),null;case 24:return n=null,null!==e&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),vs(Is),nl(t),null;case 25:case 30:return null}throw Error(i(156,t.tag))}function sl(e,t){switch(ns(t),t.tag){case 1:return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return vs(Is),Y(),0!==(65536&(e=t.flags))&&0===(128&e)?(t.flags=-65537&e|128,t):null;case 26:case 27:case 5:return J(t),null;case 13:if(lo(t),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(i(340));hs()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return B(co),null;case 4:return Y(),null;case 10:return vs(t.type),null;case 22:case 23:return lo(t),xa(),null!==e&&B(zs),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 24:return vs(Is),null;default:return null}}function al(e,t){switch(ns(t),t.tag){case 3:vs(Is),Y();break;case 26:case 27:case 5:J(t);break;case 4:Y();break;case 13:lo(t);break;case 19:B(co);break;case 10:vs(t.type);break;case 22:case 23:lo(t),xa(),null!==e&&B(zs);break;case 24:vs(Is)}}function il(e,t){try{var n=t.updateQueue,r=null!==n?n.lastEffect:null;if(null!==r){var s=r.next;n=s;do{if((n.tag&e)===e){r=void 0;var a=n.create,i=n.inst;r=a(),i.destroy=r}n=n.next}while(n!==s)}}catch(o){dd(t,t.return,o)}}function ol(e,t,n){try{var r=t.updateQueue,s=null!==r?r.lastEffect:null;if(null!==s){var a=s.next;r=a;do{if((r.tag&e)===e){var i=r.inst,o=i.destroy;if(void 0!==o){i.destroy=void 0,s=t;var l=n,c=o;try{c()}catch(d){dd(s,l,d)}}}r=r.next}
vendor: 4,339 bytes, line 2
2while(r!==a)}}catch(d){dd(t,t.return,d)}}function ll(e){var t=e.updateQueue;if(null!==t){var n=e.stateNode;try{ma(t,n)}catch(r){dd(e,e.return,r)}}}function cl(e,t,n){n.props=fo(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(r){dd(e,t,r)}}function dl(e,t){try{var n=e.ref;if(null!==n){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;default:r=e.stateNode}"function"===typeof n?e.refCleanup=n(r):n.current=r}}catch(s){dd(e,t,s)}}function ul(e,t){var n=e.ref,r=e.refCleanup;if(null!==n)if("function"===typeof r)try{r()}catch(s){dd(e,t,s)}finally{e.refCleanup=null,null!=(e=e.alternate)&&(e.refCleanup=null)}else if("function"===typeof n)try{n(null)}catch(a){dd(e,t,a)}else n.current=null}function ml(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&r.focus();break e;case"img":n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(s){dd(e,e.return,s)}}function hl(e,t,n){try{var r=e.stateNode;!function(e,t,n,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var s=null,a=null,o=null,l=null,c=null,d=null,u=null;for(p in n){var m=n[p];if(n.hasOwnProperty(p)&&null!=m)switch(p){case"checked":case"value":break;case"defaultValue":c=m;default:r.hasOwnProperty(p)||Xd(e,t,p,null,r,m)}}for(var h in r){var p=r[h];if(m=n[h],r.hasOwnProperty(h)&&(null!=p||null!=m))switch(h){case"type":a=p;break;case"name":s=p;break;case"checked":d=p;break;case"defaultChecked":u=p;break;case"value":o=p;break;case"defaultValue":l=p;break;case"children":case"dangerouslySetInnerHTML":if(null!=p)throw Error(i(137,t));break;default:p!==m&&Xd(e,t,h,p,r,m)}}return void ft(e,o,l,c,d,u,a,s);case"select":for(a in p=o=l=h=null,n)if(c=n[a],n.hasOwnProperty(a)&&null!=c)switch(a){case"value":break;case"multiple":p=c;default:r.hasOwnProperty(a)||Xd(e,t,a,null,r,c)}for(s in r)if(a=r[s],c=n[s],r.hasOwnProperty(s)&&(null!=a||null!=c))switch(s){case"value":h=a;break;case"defaultValue":l=a;break;case"multiple":o=a;default:a!==c&&Xd(e,t,s,a,r,c)}return t=l,n=o,r=p,void(null!=h?yt(e,!!n,h,!1):!!r!==!!n&&(null!=t?yt(e,!!n,t,!0):yt(e,!!n,n?[]:"",!1)));case"textarea":for(l in p=h=null,n)if(s=n[l],n.hasOwnProperty(l)&&null!=s&&!r.hasOwnProperty(l))switch(l){case"value":case"children":break;default:Xd(e,t,l,null,r,s)}for(o in r)if(s=r[o],a=n[o],r.hasOwnProperty(o)&&(null!=s||null!=a))switch(o){case"value":h=s;break;case"defaultValue":p=s;break;case"children":break;case"dangerouslySetInnerHTML":if(null!=s)throw Error(i(91));break;default:s!==a&&Xd(e,t,o,s,r,a)}return void vt(e,h,p);case"option":for(var g in n)if(h=n[g],n.hasOwnProperty(g)&&null!=h&&!r.hasOwnProperty(g))if("selected"===g)e.selected=!1;else Xd(e,t,g,null,r,h);for(c in r)if(h=r[c],p=n[c],r.hasOwnProperty(c)&&h!==p&&(null!=h||null!=p))if("selected"===c)e.selected=h&&"function"!==typeof h&&"symbol"!==typeof h;else Xd(e,t,c,h,r,p);return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var f in n)h=n[f],n.hasOwnProperty(f)&&null!=h&&!r.hasOwnProperty(f)&&Xd(e,t,f,null,r,h);for(d in r)if(h=r[d],p=n[d],r.hasOwnProperty(d)&&h!==p&&(null!=h||null!=p))switch(d){case"children":case"dangerouslySetInnerHTML":if(null!=h)throw Error(i(137,t));break;default:Xd(e,t,d,h,r,p)}return;default:if(St(t)){for(var x in n)h=n[x],n.hasOwnProperty(x)&&void 0!==h&&!r.hasOwnProperty(x)&&Zd(e,t,x,void 0,r,h);for(u in r)h=r[u],p=n[u],!r.hasOwnProperty(u)||h===p||void 0===h&&void 0===p||Zd(e,t,u,h,r,p);return}}for(var b in n)h=n[b],n.hasOwnProperty(b)&&null!=h&&!r.hasOwnProperty(b)&&Xd(e,t,b,null,r,h);for(m in r)h=r[m],p=n[m],!r.hasOwnProperty(m)||h===p||null==h&&null==p||Xd(e,t,m,h,r,p)}(r,e.type,n,t),r[De]=t}catch(s){dd(e,e.return,s)}}function pl(e){return 5===e.tag||3===e.tag||26===e.tag||27===e.tag&&hu(e.type)||4===e.tag}function gl(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||pl(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(27===e.tag&&hu(e.type))continue e;if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function fl(e,t,n){var r=e.tag;
vendor: 23,356 bytes, line 2
2if(5===r||6===r)e=e.stateNode,t?(9===n.nodeType?n.body:"HTML"===n.nodeName?n.ownerDocument.body:n).insertBefore(e,t):((t=9===n.nodeType?n.body:"HTML"===n.nodeName?n.ownerDocument.body:n).appendChild(e),null!==(n=n._reactRootContainer)&&void 0!==n||null!==t.onclick||(t.onclick=Qd));else if(4!==r&&(27===r&&hu(e.type)&&(n=e.stateNode,t=null),null!==(e=e.child)))for(fl(e,t,n),e=e.sibling;null!==e;)fl(e,t,n),e=e.sibling}function xl(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==r&&(27===r&&hu(e.type)&&(n=e.stateNode),null!==(e=e.child)))for(xl(e,t,n),e=e.sibling;null!==e;)xl(e,t,n),e=e.sibling}function bl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,s=t.attributes;s.length;)t.removeAttributeNode(s[0]);eu(t,r,n),t[Ie]=e,t[De]=n}catch(a){dd(e,e.return,a)}}var yl=!1,vl=!1,wl=!1,jl="function"===typeof WeakSet?WeakSet:Set,Nl=null;function kl(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Ol(e,n),4&r&&il(5,n);break;case 1:if(Ol(e,n),4&r)if(e=n.stateNode,null===t)try{e.componentDidMount()}catch(i){dd(n,n.return,i)}else{var s=fo(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(s,t,e.__reactInternalSnapshotBeforeUpdate)}catch(o){dd(n,n.return,o)}}64&r&&ll(n),512&r&&dl(n,n.return);break;case 3:if(Ol(e,n),64&r&&null!==(e=n.updateQueue)){if(t=null,null!==n.child)switch(n.child.tag){case 27:case 5:case 1:t=n.child.stateNode}try{ma(e,t)}catch(i){dd(n,n.return,i)}}break;case 27:null===t&&4&r&&bl(n);case 26:case 5:Ol(e,n),null===t&&4&r&&ml(n),512&r&&dl(n,n.return);break;case 12:Ol(e,n);break;case 13:Ol(e,n),4&r&&Pl(e,n),64&r&&(null!==(e=n.memoizedState)&&(null!==(e=e.dehydrated)&&function(e,t){var n=e.ownerDocument;if("$?"!==e.data||"complete"===n.readyState)t();else{var r=function(){t(),n.removeEventListener("DOMContentLoaded",r)};n.addEventListener("DOMContentLoaded",r),e._reactRetry=r}}(e,n=pd.bind(null,n))));break;case 22:if(!(r=null!==n.memoizedState||yl)){t=null!==t&&null!==t.memoizedState||vl,s=yl;var a=vl;yl=r,(vl=t)&&!a?Ul(e,n,0!==(8772&n.subtreeFlags)):Ol(e,n),yl=s,vl=a}break;case 30:break;default:Ol(e,n)}}function Al(e){var t=e.alternate;null!==t&&(e.alternate=null,Al(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&(null!==(t=e.stateNode)&&Be(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Sl=null,El=!1;function Cl(e,t,n){for(n=n.child;null!==n;)Tl(e,t,n),n=n.sibling}function Tl(e,t,n){if(ue&&"function"===typeof ue.onCommitFiberUnmount)try{ue.onCommitFiberUnmount(de,n)}catch(a){}switch(n.tag){case 26:vl||ul(n,t),Cl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode).parentNode.removeChild(n);break;case 27:vl||ul(n,t);var r=Sl,s=El;hu(n.type)&&(Sl=n.stateNode,El=!1),Cl(e,t,n),wu(n.stateNode),Sl=r,El=s;break;case 5:vl||ul(n,t);case 6:if(r=Sl,s=El,Sl=null,Cl(e,t,n),El=s,null!==(Sl=r))if(El)try{(9===Sl.nodeType?Sl.body:"HTML"===Sl.nodeName?Sl.ownerDocument.body:Sl).removeChild(n.stateNode)}catch(i){dd(n,t,i)}else try{Sl.removeChild(n.stateNode)}catch(i){dd(n,t,i)}break;case 18:null!==Sl&&(El?(pu(9===(e=Sl).nodeType?e.body:"HTML"===e.nodeName?e.ownerDocument.body:e,n.stateNode),Em(e)):pu(Sl,n.stateNode));break;case 4:r=Sl,s=El,Sl=n.stateNode.containerInfo,El=!0,Cl(e,t,n),Sl=r,El=s;break;case 0:case 11:case 14:case 15:vl||ol(2,n,t),vl||ol(4,n,t),Cl(e,t,n);break;case 1:vl||(ul(n,t),"function"===typeof(r=n.stateNode).componentWillUnmount&&cl(n,t,r)),Cl(e,t,n);break;case 21:Cl(e,t,n);break;case 22:vl=(r=vl)||null!==n.memoizedState,Cl(e,t,n),vl=r;break;default:Cl(e,t,n)}}function Pl(e,t){if(null===t.memoizedState&&(null!==(e=t.alternate)&&(null!==(e=e.memoizedState)&&null!==(e=e.dehydrated))))try{Em(e)}catch(n){dd(t,t.return,n)}}function _l(e,t){var n=function(e){switch(e.tag){case 13:case 19:var t=e.stateNode;return null===t&&(t=e.stateNode=new jl),t;case 22:return null===(t=(e=e.stateNode)._retryCache)&&(t=e._retryCache=new jl),t;default:throw Error(i(435,e.tag))}}(e);t.forEach(function(t){var r=gd.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))})}function Il(e,t){var n=t.deletions;if(null!==n)for(var r=0;r<n.length;r++){var s=n[r],a=e,o=t,l=o;e:for(;null!==l;){switch(l.tag){case 27:if(hu(l.type)){Sl=l.stateNode,El=!1;break e}break;case 5:Sl=l.stateNode,El=!1;break e;case 3:case 4:Sl=l.stateNode.containerInfo,El=!0;break e}l=l.return}if(null===Sl)throw Error(i(160));Tl(a,o,s),Sl=null,El=!1,null!==(a=s.alternate)&&(a.return=null),s.return=null}if(13878&t.subtreeFlags)for(t=t.child;null!==t;)Rl(t,e),t=t.sibling}var Dl=null;function Rl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Il(t,e),Ll(e),4&r&&(ol(3,e,e.return),il(3,e),ol(5,e,e.return));break;case 1:Il(t,e),Ll(e),512&r&&(vl||null===n||ul(n,n.return)),64&r&&yl&&(null!==(e=e.updateQueue)&&(null!==(r=e.callbacks)&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=null===n?r:n.concat(r))));break;case 26:var s=Dl;if(Il(t,e),Ll(e),512&r&&(vl||null===n||ul(n,n.return)),4&r){var a=null!==n?n.memoizedState:null;if(r=e.memoizedState,null===n)if(null===r)if(null===e.stateNode){e:{r=e.type,n=e.memoizedProps,s=s.ownerDocument||s;t:switch(r){case"title":(!(a=s.getElementsByTagName("title")[0])||a[Ue]||a[Ie]||"http://www.w3.org/2000/svg"===a.namespaceURI||a.hasAttribute("itemprop"))&&(a=s.createElement(r),s.head.insertBefore(a,s.querySelector("head > title"))),eu(a,r,n),a[Ie]=e,He(a),r=a;break e;case"link":var o=Uu("link","href",s).get(r+(n.href||""));if(o)for(var l=0;l<o.length;l++)if((a=o[l]).getAttribute("href")===(null==n.href||""===n.href?null:n.href)&&a.getAttribute("rel")===(null==n.rel?null:n.rel)&&a.getAttribute("title")===(null==n.title?null:n.title)&&a.getAttribute("crossorigin")===(null==n.crossOrigin?null:n.crossOrigin)){o.splice(l,1);break t}eu(a=s.createElement(r),r,n),s.head.appendChild(a);break;case"meta":if(o=Uu("meta","content",s).get(r+(n.content||"")))for(l=0;l<o.length;l++)if((a=o[l]).getAttribute("content")===(null==n.content?null:""+n.content)&&a.getAttribute("name")===(null==n.name?null:n.name)&&a.getAttribute("property")===(null==n.property?null:n.property)&&a.getAttribute("http-equiv")===(null==n.httpEquiv?null:n.httpEquiv)&&a.getAttribute("charset")===(null==n.charSet?null:n.charSet)){o.splice(l,1);break t}eu(a=s.createElement(r),r,n),s.head.appendChild(a);break;default:throw Error(i(468,r))}a[Ie]=e,He(a),r=a}e.stateNode=r}else Bu(s,e.type,e.stateNode);else e.stateNode=Ru(s,r,e.memoizedProps);else a!==r?(null===a?null!==n.stateNode&&(n=n.stateNode).parentNode.removeChild(n):a.count--,null===r?Bu(s,e.type,e.stateNode):Ru(s,r,e.memoizedProps)):null===r&&null!==e.stateNode&&hl(e,e.memoizedProps,n.memoizedProps)}break;case 27:Il(t,e),Ll(e),512&r&&(vl||null===n||ul(n,n.return)),null!==n&&4&r&&hl(e,e.memoizedProps,n.memoizedProps);break;case 5:if(Il(t,e),Ll(e),512&r&&(vl||null===n||ul(n,n.return)),32&e.flags){s=e.stateNode;try{jt(s,"")}catch(p){dd(e,e.return,p)}}4&r&&null!=e.stateNode&&hl(e,s=e.memoizedProps,null!==n?n.memoizedProps:s),1024&r&&(wl=!0);break;case 6:if(Il(t,e),Ll(e),4&r){if(null===e.stateNode)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(p){dd(e,e.return,p)}}break;case 3:if(Fu=null,s=Dl,Dl=ku(t.containerInfo),Il(t,e),Dl=s,Ll(e),4&r&&null!==n&&n.memoizedState.isDehydrated)try{Em(t.containerInfo)}catch(p){dd(e,e.return,p)}wl&&(wl=!1,Ml(e));break;case 4:r=Dl,Dl=ku(e.stateNode.containerInfo),Il(t,e),Ll(e),Dl=r;break;case 12:default:Il(t,e),Ll(e);break;case 13:Il(t,e),Ll(e),8192&e.child.flags&&null!==e.memoizedState!==(null!==n&&null!==n.memoizedState)&&(wc=te()),4&r&&(null!==(r=e.updateQueue)&&(e.updateQueue=null,_l(e,r)));break;case 22:s=null!==e.memoizedState;var c=null!==n&&null!==n.memoizedState,d=yl,u=vl;if(yl=d||s,vl=u||c,Il(t,e),vl=u,yl=d,Ll(e),8192&r)e:for(t=e.stateNode,t._visibility=s?-2&t._visibility:1|t._visibility,s&&(null===n||c||yl||vl||Fl(e)),n=null,t=e;;){if(5===t.tag||26===t.tag){if(null===n){c=n=t;try{if(a=c.stateNode,s)"function"===typeof(o=a.style).setProperty?o.setProperty("display","none","important"):o.display="none";else{l=c.stateNode;var m=c.memoizedProps.style,h=void 0!==m&&null!==m&&m.hasOwnProperty("display")?m.display:null;l.style.display=null==h||"boolean"===typeof h?"":(""+h).trim()}}catch(p){dd(c,c.return,p)}}}else if(6===t.tag){if(null===n){c=t;try{c.stateNode.nodeValue=s?"":c.memoizedProps}catch(p){dd(c,c.return,p)}}}else if((22!==t.tag&&23!==t.tag||null===t.memoizedState||t===e)&&null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;null===t.sibling;){if(null===t.return||t.return===e)break e;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}4&r&&(null!==(r=e.updateQueue)&&(null!==(n=r.retryQueue)&&(r.retryQueue=null,_l(e,n))));break;case 19:Il(t,e),Ll(e),4&r&&(null!==(r=e.updateQueue)&&(e.updateQueue=null,_l(e,r)));case 30:case 21:}}function Ll(e){var t=e.flags;if(2&t){try{for(var n,r=e.return;null!==r;){if(pl(r)){n=r;break}r=r.return}if(null==n)throw Error(i(160));switch(n.tag){case 27:var s=n.stateNode;xl(e,gl(e),s);break;case 5:var a=n.stateNode;32&n.flags&&(jt(a,""),n.flags&=-33),xl(e,gl(e),a);break;case 3:case 4:var o=n.stateNode.containerInfo;fl(e,gl(e),o);break;default:throw Error(i(161))}}catch(l){dd(e,e.return,l)}e.flags&=-3}4096&t&&(e.flags&=-4097)}function Ml(e){if(1024&e.subtreeFlags)for(e=e.child;null!==e;){var t=e;Ml(t),5===t.tag&&1024&t.flags&&t.stateNode.reset(),e=e.sibling}}function Ol(e,t){if(8772&t.subtreeFlags)for(t=t.child;null!==t;)kl(e,t.alternate,t),t=t.sibling}function Fl(e){for(e=e.child;null!==e;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:ol(4,t,t.return),Fl(t);break;case 1:ul(t,t.return);var n=t.stateNode;"function"===typeof n.componentWillUnmount&&cl(t,t.return,n),Fl(t);break;case 27:wu(t.stateNode);case 26:case 5:ul(t,t.return),Fl(t);break;case 22:null===t.memoizedState&&Fl(t);break;default:Fl(t)}e=e.sibling}}function Ul(e,t,n){for(n=n&&0!==(8772&t.subtreeFlags),t=t.child;null!==t;){var r=t.alternate,s=e,a=t,i=a.flags;switch(a.tag){case 0:case 11:case 15:Ul(s,a,n),il(4,a);break;case 1:if(Ul(s,a,n),"function"===typeof(s=(r=a).stateNode).componentDidMount)try{s.componentDidMount()}catch(c){dd(r,r.return,c)}if(null!==(s=(r=a).updateQueue)){var o=r.stateNode;try{var l=s.shared.hiddenCallbacks;if(null!==l)for(s.shared.hiddenCallbacks=null,s=0;s<l.length;s++)ua(l[s],o)}catch(c){dd(r,r.return,c)}}n&&64&i&&ll(a),dl(a,a.return);break;case 27:bl(a);case 26:case 5:Ul(s,a,n),n&&null===r&&4&i&&ml(a),dl(a,a.return);break;case 12:Ul(s,a,n);break;case 13:Ul(s,a,n),n&&4&i&&Pl(s,a);break;case 22:null===a.memoizedState&&Ul(s,a,n),dl(a,a.return);break;case 30:break;default:Ul(s,a,n)}t=t.sibling}}function Bl(e,t){var n=null;null!==e&&null!==e.memoizedState&&null!==e.memoizedState.cachePool&&(n=e.memoizedState.cachePool.pool),e=null,null!==t.memoizedState&&null!==t.memoizedState.cachePool&&(e=t.memoizedState.cachePool.pool),e!==n&&(null!=e&&e.refCount++,null!=n&&Rs(n))}function zl(e,t){e=null,null!==t.alternate&&(e=t.alternate.memoizedState.cache),(t=t.memoizedState.cache)!==e&&(t.refCount++,null!=e&&Rs(e))}function Vl(e,t,n,r){if(10256&t.subtreeFlags)for(t=t.child;null!==t;)ql(e,t,n,r),t=t.sibling}function ql(e,t,n,r){var s=t.flags;switch(t.tag){case 0:case 11:case 15:Vl(e,t,n,r),2048&s&&il(9,t);break;case 1:case 13:default:Vl(e,t,n,r);break;case 3:Vl(e,t,n,r),2048&s&&(e=null,null!==t.alternate&&(e=t.alternate.memoizedState.cache),(t=t.memoizedState.cache)!==e&&(t.refCount++,null!=e&&Rs(e)));break;case 12:if(2048&s){Vl(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,i=a.id,o=a.onPostCommit;"function"===typeof o&&o(i,null===t.alternate?"mount":"update",e.passiveEffectDuration,-0)}catch(l){dd(t,t.return,l)}}else Vl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,i=t.alternate,null!==t.memoizedState?2&a._visibility?Vl(e,t,n,r):Hl(e,t):2&a._visibility?Vl(e,t,n,r):(a._visibility|=2,Wl(e,t,n,r,0!==(10256&t.subtreeFlags))),2048&s&&Bl(i,t);break;case 24:Vl(e,t,n,r),2048&s&&zl(t.alternate,t)}}function Wl(e,t,n,r,s){for(s=s&&0!==(10256&t.subtreeFlags),t=t.child;null!==t;){var a=e,i=t,o=n,l=r,c=i.flags;switch(i.tag){case 0:case 11:case 15:Wl(a,i,o,l,s),il(8,i);break;case 23:break;case 22:var d=i.stateNode;null!==i.memoizedState?2&d._visibility?Wl(a,i,o,l,s):Hl(a,i):(d._visibility|=2,Wl(a,i,o,l,s)),s&&2048&c&&Bl(i.alternate,i);break;case 24:Wl(a,i,o,l,s),s&&2048&c&&zl(i.alternate,i);break;default:Wl(a,i,o,l,s)}t=t.sibling}}function Hl(e,t){if(10256&t.subtreeFlags)for(t=t.child;null!==t;){var n=e,r=t,s=r.flags;switch(r.tag){case 22:Hl(n,r),2048&s&&Bl(r.alternate,r);break;case 24:Hl(n,r),2048&s&&zl(r.alternate,r);break;default:Hl(n,r)}t=t.sibling}}var Gl=8192;function Yl(e){if(e.subtreeFlags&Gl)for(e=e.child;null!==e;)Kl(e),e=e.sibling}function Kl(e){switch(e.tag){case 26:Yl(e),e.flags&Gl&&null!==e.memoizedState&&function(e,t,n){if(null===Vu)throw Error(i(475));var r=Vu;if("stylesheet"===t.type&&("string"!==typeof n.media||!1!==matchMedia(n.media).matches)&&0===(4&t.state.loading)){if(null===t.instance){var s=Tu(n.href),a=e.querySelector(Pu(s));if(a)return null!==(e=a._p)&&"object"===typeof e&&"function"===typeof e.then&&(r.count++,r=Wu.bind(r),e.then(r,r)),t.state.loading|=4,t.instance=a,void He(a);a=e.ownerDocument||e,n=_u(n),(s=ju.get(s))&&Mu(n,s),He(a=a.createElement("link"));var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),eu(a,"link",n),t.instance=a}null===r.stylesheets&&(r.stylesheets=new Map),r.stylesheets.set(t,e),(e=t.state.preload)&&0===(3&t.state.loading)&&(r.count++,t=Wu.bind(r),e.addEventListener("load",t),e.addEventListener("error",t))}}(Dl,e.memoizedState,e.memoizedProps);break;case 5:default:Yl(e);break;case 3:case 4:var t=Dl;Dl=ku(e.stateNode.containerInfo),Yl(e),Dl=t;break;case 22:null===e.memoizedState&&(null!==(t=e.alternate)&&null!==t.memoizedState?(t=Gl,Gl=16777216,Yl(e),Gl=t):Yl(e))}}function Jl(e){var t=e.alternate;if(null!==t&&null!==(e=t.child)){t.child=null;do{t=e.sibling,e.sibling=null,e=t}while(null!==e)}}function $l(e){var t=e.deletions;if(0!==(16&e.flags)){if(null!==t)for(var n=0;n<t.length;n++){var r=t[n];Nl=r,Zl(r,e)}Jl(e)}if(10256&e.subtreeFlags)for(e=e.child;null!==e;)Ql(e),e=e.sibling}function Ql(e){switch(e.tag){case 0:case 11:case 15:$l(e),2048&e.flags&&ol(9,e,e.return);break;case 3:case 12:default:$l(e);break;case 22:var t=e.stateNode;null!==e.memoizedState&&2&t._visibility&&(null===e.return||13!==e.return.tag)?(t._visibility&=-3,Xl(e)):$l(e)}}function Xl(e){var t=e.deletions;if(0!==(16&e.flags)){if(null!==t)for(var n=0;n<t.length;n++){var r=t[n];Nl=r,Zl(r,e)}Jl(e)}for(e=e.child;null!==e;){switch((t=e).tag){case 0:case 11:case 15:ol(8,t,t.return),Xl(t);break;case 22:2&(n=t.stateNode)._visibility&&(n._visibility&=-3,Xl(t));break;default:Xl(t)}e=e.sibling}}function Zl(e,t){for(;null!==Nl;){var n=Nl;switch(n.tag){case 0:case 11:case 15:ol(8,n,t);break;case 23:case 22:if(null!==n.memoizedState&&null!==n.memoizedState.cachePool){var r=n.memoizedState.cachePool.pool;null!=r&&r.refCount++}break;case 24:Rs(n.memoizedState.cache)}if(null!==(r=n.child))r.return=n,Nl=r;else e:for(n=e;null!==Nl;){var s=(r=Nl).sibling,a=r.return;if(Al(r),r===n){Nl=null;break e}if(null!==s){s.return=a,Nl=s;break e}Nl=a}}}var ec={getCacheForType:function(e){var t=Ss(Is),n=t.data.get(e);return void 0===n&&(n=e(),t.data.set(e,n)),n}},tc="function"===typeof WeakMap?WeakMap:Map,nc=0,rc=null,sc=null,ac=0,ic=0,oc=null,lc=!1,cc=!1,dc=!1,uc=0,mc=0,hc=0,pc=0,gc=0,fc=0,xc=0,bc=null,yc=null,vc=!1,wc=0,jc=1/0,Nc=null,kc=null,Ac=0,Sc=null,Ec=null,Cc=0,Tc=0,Pc=null,_c=null,Ic=0,Dc=null;function Rc(){if(0!==(2&nc)&&0!==ac)return ac&-ac;if(null!==R.T){return 0!==Os?Os:Td()}return Pe()}function Lc(){0===fc&&(fc=0===(536870912&ac)||as?je():536870912);var e=ro.current;return null!==e&&(e.flags|=32),fc}function Mc(e,t,n){(e!==rc||2!==ic&&9!==ic)&&null===e.cancelPendingCommit||(qc(e,0),Bc(e,ac,fc,!1)),Ae(e,n),0!==(2&nc)&&e===rc||(e===rc&&(0===(2&nc)&&(pc|=n),4===mc&&Bc(e,ac,fc,!1)),jd(e))}function Oc(e,t,n){if(0!==(6&nc))throw Error(i(327));for(var r=!n&&0===(124&t)&&0===(t&e.expiredLanes)||ve(e,t),s=r?function(e,t){var n=nc;nc|=2;var r=Hc(),s=Gc();rc!==e||ac!==t?(Nc=null,jc=te()+500,qc(e,t)):cc=ve(e,t);e:for(;;)try{if(0!==ic&&null!==sc){t=sc;var a=oc;t:switch(ic){case 1:ic=0,oc=null,Zc(e,t,a,1);break;case 2:case 9:if(Js(a)){ic=0,oc=null,Xc(t);break}t=function(){2!==ic&&9!==ic||rc!==e||(ic=7),jd(e)},a.then(t,t);break e;case 3:ic=7;break e;case 4:ic=5;break e;case 7:Js(a)?(ic=0,oc=null,Xc(t)):(ic=0,oc=null,Zc(e,t,a,7));break;case 5:var o=null;switch(sc.tag){case 26:o=sc.memoizedState;case 5:case 27:var l=sc;if(!o||zu(o)){ic=0,oc=null;var c=l.sibling;if(null!==c)sc=c;else{var d=l.return;null!==d?(sc=d,ed(d)):sc=null}break t}}ic=0,oc=null,Zc(e,t,a,5);break;case 6:ic=0,oc=null,Zc(e,t,a,6);break;case 8:Vc(),mc=6;break e;default:throw Error(i(462))}}$c();break}catch(u){Wc(e,u)}return bs=xs=null,R.H=r,R.A=s,nc=n,null!==sc?0:(rc=null,ac=0,Cr(),mc)}(e,t):Kc(e,t,!0),a=r;;){if(0===s){cc&&!r&&Bc(e,t,0,!1);break}if(n=e.current.alternate,!a||Uc(n)){if(2===s){if(a=t,e.errorRecoveryDisabledLanes&a)var o=0;else o=0!==(o=-536870913&e.pendingLanes)?o:536870912&o?536870912:0;if(0!==o){t=o;e:{var l=e;s=bc;var c=l.current.memoizedState.isDehydrated;if(c&&(qc(l,o).flags|=256),2!==(o=Kc(l,o,!1))){if(dc&&!c){l.errorRecoveryDisabledLanes|=a,pc|=a,s=4;break e}a=yc,yc=s,null!==a&&(null===yc?yc=a:yc.push.apply(yc,a))}s=o}if(a=!1,2!==s)continue}}if(1===s){qc(e,0),Bc(e,t,0,!0);break}e:{switch(r=e,a=s){case 0:case 1:throw Error(i(345));case 4:if((4194048&t)!==t)break;case 6:Bc(r,t,fc,!lc);break e;case 2:yc=null;break;case 3:case 5:break;default:throw Error(i(329))}if((62914560&t)===t&&10<(s=wc+300-te())){if(Bc(r,t,fc,!lc),0!==ye(r,0,!0))break e;r.timeoutHandle=lu(Fc.bind(null,r,n,yc,Nc,vc,t,fc,pc,xc,lc,a,2,-0,0),s)}else Fc(r,n,yc,Nc,vc,t,fc,pc,xc,lc,a,0,-0,0)}break}s=Kc(e,t,!1),a=!1}jd(e)}function Fc(e,t,n,r,s,a,o,l,c,d,u,m,h,p){if(e.timeoutHandle=-1,(8192&(m=t.subtreeFlags)||16785408===(16785408&m))&&(Vu={stylesheets:null,count:0,unsuspend:qu},Kl(t),null!==(m=function(){if(null===Vu)throw Error(i(475));var e=Vu;return e.stylesheets&&0===e.count&&Gu(e,e.stylesheets),0<e.count?function(t){var n=setTimeout(function(){if(e.stylesheets&&Gu(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4);return e.unsuspend=t,function(){e.unsuspend=null,clearTimeout(n)}}:null}())))return e.cancelPendingCommit=m(nd.bind(null,e,t,a,n,r,s,o,l,c,u,1,h,p)),void Bc(e,a,o,!d);nd(e,t,a,n,r,s,o,l,c)}function Uc(e){for(var t=e;;){var n=t.tag;if((0===n||11===n||15===n)&&16384&t.flags&&(null!==(n=t.updateQueue)&&null!==(n=n.stores)))for(var r=0;r<n.length;r++){var s=n[r],a=s.getSnapshot;s=s.value;try{if(!Jn(a(),s))return!1}catch(i){return!1}}if(n=t.child,16384&t.subtreeFlags&&null!==n)n.return=t,t=n;else{if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Bc(e,t,n,r){t&=~gc,t&=~pc,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var s=t;0<s;){var a=31-he(s),i=1<<a;r[a]=-1,s&=~i}0!==n&&Se(e,n,t)}function zc(){return 0!==(6&nc)||(Nd(0,!1),!1)}function Vc(){if(null!==sc){if(0===ic)var e=sc.return;else bs=xs=null,Oa(e=sc),Ki=null,Ji=0,e=sc;for(;null!==e;)al(e.alternate,e),e=e.return;sc=null}}function qc(e,t){var n=e.timeoutHandle;-1!==n&&(e.timeoutHandle=-1,cu(n)),null!==(n=e.cancelPendingCommit)&&(e.cancelPendingCommit=null,n()),Vc(),rc=e,sc=n=Fr(e.current,null),ac=t,ic=0,oc=null,lc=!1,cc=ve(e,t),dc=!1,xc=fc=gc=pc=hc=mc=0,yc=bc=null,vc=!1,0!==(8&t)&&(t|=32&t);var r=e.entangledLanes;if(0!==r)for(e=e.entanglements,r&=t;0<r;){var s=31-he(r),a=1<<s;t|=e[s],r&=~a}return uc=t,Cr(),n}function Wc(e,t){ya=null,R.H=Wi,t===Hs||t===Ys?(t=Zs(),ic=3):t===Gs?(t=Zs(),ic=4):ic=t===So?8:null!==t&&"object"===typeof t&&"function"===typeof t.then?6:1,oc=t,null===sc&&(mc=1,wo(e,kr(t,e.current)))}function Hc(){var e=R.H;return R.H=Wi,null===e?Wi:e}function Gc(){var e=R.A;return R.A=ec,e}function Yc(){mc=4,lc||(4194048&ac)!==ac&&null!==ro.current||(cc=!0),0===(134217727&hc)&&0===(134217727&pc)||null===rc||Bc(rc,ac,fc,!1)}function Kc(e,t,n){var r=nc;nc|=2;var s=Hc(),a=Gc();rc===e&&ac===t||(Nc=null,qc(e,t)),t=!1;var i=mc;e:for(;;)try{if(0!==ic&&null!==sc){var o=sc,l=oc;switch(ic){case 8:Vc(),i=6;break e;case 3:case 2:case 9:case 6:null===ro.current&&(t=!0);var c=ic;if(ic=0,oc=null,Zc(e,o,l,c),n&&cc){i=0;break e}break;default:c=ic,ic=0,oc=null,Zc(e,o,l,c)}}Jc(),i=mc;break}catch(d){Wc(e,d)}return t&&e.shellSuspendCounter++,bs=xs=null,nc=r,R.H=s,R.A=a,null===sc&&(rc=null,ac=0,Cr()),i}function Jc(){for(;null!==sc;)Qc(sc)}function $c(){for(;null!==sc&&!Z();)Qc(sc)}function Qc(e){var t=Qo(e.alternate,e,uc);e.memoizedProps=e.pendingProps,null===t?ed(e):sc=t}function Xc(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Mo(n,t,t.pendingProps,t.type,void 0,ac);break;case 11:t=Mo(n,t,t.pendingProps,t.type.render,t.ref,ac);break;case 5:Oa(t);default:al(n,t),t=Qo(n,t=sc=Ur(t,uc),uc)}e.memoizedProps=e.pendingProps,null===t?ed(e):sc=t}function Zc(e,t,n,r){bs=xs=null,Oa(t),Ki=null,Ji=0;var s=t.return;try{if(function(e,t,n,r,s){if(n.flags|=32768,null!==r&&"object"===typeof r&&"function"===typeof r.then){if(null!==(t=n.alternate)&&Ns(t,n,s,!0),null!==(n=ro.current)){switch(n.tag){case 13:return null===so?Yc():null===n.alternate&&0===mc&&(mc=3),n.flags&=-257,n.flags|=65536,n.lanes=s,r===Ks?n.flags|=16384:(null===(t=n.updateQueue)?n.updateQueue=new Set([r]):t.add(r),ud(e,r,s)),!1;case 22:return n.flags|=65536,r===Ks?n.flags|=16384:(null===(t=n.updateQueue)?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):null===(n=t.retryQueue)?t.retryQueue=new Set([r]):n.add(r),ud(e,r,s)),!1}throw Error(i(435,n.tag))}return ud(e,r,s),Yc(),!1}if(as)return null!==(t=ro.current)?(0===(65536&t.flags)&&(t.flags|=256),t.flags|=65536,t.lanes=s,r!==ls&&gs(kr(e=Error(i(422),{cause:r}),n))):(r!==ls&&gs(kr(t=Error(i(423),{cause:r}),n)),(e=e.current.alternate).flags|=65536,s&=-s,e.lanes|=s,r=kr(r,n),oa(e,s=No(e.stateNode,r,s)),4!==mc&&(mc=2)),!1;var a=Error(i(520),{cause:r});if(a=kr(a,n),null===bc?bc=[a]:bc.push(a),4!==mc&&(mc=2),null===t)return!0;r=kr(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=s&-s,n.lanes|=e,oa(n,e=No(n.stateNode,r,e)),!1;case 1:if(t=n.type,a=n.stateNode,0===(128&n.flags)&&("function"===typeof t.getDerivedStateFromError||null!==a&&"function"===typeof a.componentDidCatch&&(null===kc||!kc.has(a))))return n.flags|=65536,s&=-s,n.lanes|=s,Ao(s=ko(s),e,n,r),oa(n,s),!1}n=n.return}while(null!==n);return!1}(e,s,t,n,ac))return mc=1,wo(e,kr(n,e.current)),void(sc=null)}catch(a){if(null!==s)throw sc=s,a;return mc=1,wo(e,kr(n,e.current)),void(sc=null)}32768&t.flags?(as||1===r?e=!0:cc||0!==(536870912&ac)?e=!1:(lc=e=!0,(2===r||9===r||3===r||6===r)&&(null!==(r=ro.current)&&13===r.tag&&(r.flags|=16384))),td(t,e)):ed(t)}function ed(e){var t=e;do{if(0!==(32768&t.flags))return void td(t,lc);e=t.return;var n=rl(t.alternate,t,uc);if(null!==n)return void(sc=n);if(null!==(t=t.sibling))return void(sc=t);sc=t=e}while(null!==t);0===mc&&(mc=5)}function td(e,t){do{var n=sl(e.alternate,e);if(null!==n)return n.flags&=32767,void(sc=n);if(null!==(n=e.return)&&(n.flags|=32768,n.subtreeFlags=0,n.deleti
2ons=null),!t&&null!==(e=e.sibling))return void(sc=e);sc=e=n}while(null!==e);mc=6,sc=null}function nd(e,t,n,r,s,a,o,l,c){e.cancelPendingCommit=null;do{od()}while(0!==Ac);if(0!==(6&nc))throw Error(i(327));if(null!==t){if(t===e.current)throw Error(i(177));if(a=t.lanes|t.childLanes,function(e,t,n,r,s,a){var i=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var o=e.entanglements,l=e.expirationTimes,c=e.hiddenUpdates;for(n=i&~n;0<n;){var d=31-he(n),u=1<<d;o[d]=0,l[d]=-1;var m=c[d];if(null!==m)for(c[d]=null,d=0;d<m.length;d++){var h=m[d];null!==h&&(h.lane&=-536870913)}n&=~u}0!==r&&Se(e,r,0),0!==a&&0===s&&0!==e.tag&&(e.suspendedLanes|=a&~(i&~t))}(e,n,a|=Er,o,l,c),e===rc&&(sc=rc=null,ac=0),Ec=t,Sc=e,Cc=n,Tc=a,Pc=s,_c=r,0!==(10256&t.subtreeFlags)||0!==(10256&t.flags)?(e.callbackNode=null,e.callbackPriority=0,Q(ae,function(){return ld(),null})):(e.callbackNode=null,e.callbackPriority=0),r=0!==(13878&t.flags),0!==(13878&t.subtreeFlags)||r){r=R.T,R.T=null,s=L.p,L.p=2,o=nc,nc|=4;try{!function(e,t){if(e=e.containerInfo,tu=nm,tr(e=er(e))){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{var r=(n=(n=e.ownerDocument)&&n.defaultView||window).getSelection&&n.getSelection();if(r&&0!==r.rangeCount){n=r.anchorNode;var s=r.anchorOffset,a=r.focusNode;r=r.focusOffset;try{n.nodeType,a.nodeType}catch(f){n=null;break e}var o=0,l=-1,c=-1,d=0,u=0,m=e,h=null;t:for(;;){for(var p;m!==n||0!==s&&3!==m.nodeType||(l=o+s),m!==a||0!==r&&3!==m.nodeType||(c=o+r),3===m.nodeType&&(o+=m.nodeValue.length),null!==(p=m.firstChild);)h=m,m=p;for(;;){if(m===e)break t;if(h===n&&++d===s&&(l=o),h===a&&++u===r&&(c=o),null!==(p=m.nextSibling))break;h=(m=h).parentNode}m=p}n=-1===l||-1===c?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(nu={focusedElem:e,selectionRange:n},nm=!1,Nl=t;null!==Nl;)if(e=(t=Nl).child,0!==(1024&t.subtreeFlags)&&null!==e)e.return=t,Nl=e;else for(;null!==Nl;){switch(a=(t=Nl).alternate,e=t.flags,t.tag){case 0:case 11:case 15:case 5:case 26:case 27:case 6:case 4:case 17:break;case 1:if(0!==(1024&e)&&null!==a){e=void 0,n=t,s=a.memoizedProps,a=a.memoizedState,r=n.stateNode;try{var g=fo(n.type,s,(n.elementType,n.type));e=r.getSnapshotBeforeUpdate(g,a),r.__reactInternalSnapshotBeforeUpdate=e}catch(x){dd(n,n.return,x)}}break;case 3:if(0!==(1024&e))if(9===(n=(e=t.stateNode.containerInfo).nodeType))gu(e);else if(1===n)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":gu(e);break;default:e.textContent=""}break;default:if(0!==(1024&e))throw Error(i(163))}if(null!==(e=t.sibling)){e.return=t.return,Nl=e;break}Nl=t.return}}(e,t)}finally{nc=o,L.p=s,R.T=r}}Ac=1,rd(),sd(),ad()}}function rd(){if(1===Ac){Ac=0;var e=Sc,t=Ec,n=0!==(13878&t.flags);if(0!==(13878&t.subtreeFlags)||n){n=R.T,R.T=null;var r=L.p;L.p=2;var s=nc;nc|=4;try{Rl(t,e);var a=nu,i=er(e.containerInfo),o=a.focusedElem,l=a.selectionRange;if(i!==o&&o&&o.ownerDocument&&Zn(o.ownerDocument.documentElement,o)){if(null!==l&&tr(o)){var c=l.start,d=l.end;if(void 0===d&&(d=c),"selectionStart"in o)o.selectionStart=c,o.selectionEnd=Math.min(d,o.value.length);else{var u=o.ownerDocument||document,m=u&&u.defaultView||window;if(m.getSelection){var h=m.getSelection(),p=o.textContent.length,g=Math.min(l.start,p),f=void 0===l.end?g:Math.min(l.end,p);!h.extend&&g>f&&(i=f,f=g,g=i);var x=Xn(o,g),b=Xn(o,f);if(x&&b&&(1!==h.rangeCount||h.anchorNode!==x.node||h.anchorOffset!==x.offset||h.focusNode!==b.node||h.focusOffset!==b.offset)){var y=u.createRange();y.setStart(x.node,x.offset),h.removeAllRanges(),g>f?(h.addRange(y),h.extend(b.node,b.offset)):(y.setEnd(b.node,b.offset),h.addRange(y))}}}}for(u=[],h=o;h=h.parentNode;)1===h.nodeType&&u.push({element:h,left:h.scrollLeft,top:h.scrollTop});for("function"===typeof o.focus&&o.focus(),o=0;o<u.length;o++){var v=u[o];v.element.scrollLeft=v.left,v.element.scrollTop=v.top}}nm=!!tu,nu=tu=null}finally{nc=s,L.p=r,R.T=n}}e.current=t,Ac=2}}
2function sd(){if(2===Ac){Ac=0;var e=Sc,t=Ec,n=0!==(8772&t.flags);if(0!==(8772&t.subtreeFlags)||n){n=R.T,R.T=null;var r=L.p;L.p=2;var s=nc;nc|=4;try{kl(e,t.alternate,t)}finally{nc=s,L.p=r,R.T=n}}Ac=3}}function ad(){if(4===Ac||3===Ac){Ac=0,ee();var e=Sc,t=Ec,n=Cc,r=_c;0!==(10256&t.subtreeFlags)||0!==(10256&t.flags)?Ac=5:(Ac=0,Ec=Sc=null,id(e,e.pendingLanes));var s=e.pendingLanes;if(0===s&&(kc=null),Te(n),t=t.stateNode,ue&&"function"===typeof ue.onCommitFiberRoot)try{ue.onCommitFiberRoot(de,t,void 0,128===(128&t.current.flags))}catch(l){}if(null!==r){t=R.T,s=L.p,L.p=2,R.T=null;try{for(var a=e.onRecoverableError,i=0;i<r.length;i++){var o=r[i];a(o.value,{componentStack:o.stack})}}finally{R.T=t,L.p=s}}0!==(3&Cc)&&od(),jd(e),s=e.pendingLanes,0!==(4194090&n)&&0!==(42&s)?e===Dc?Ic++:(Ic=0,Dc=e):Ic=0,Nd(0,!1)}}function id(e,t){0===(e.pooledCacheLanes&=t)&&(null!=(t=e.pooledCache)&&(e.pooledCache=null,Rs(t)))}function od(e){return rd(),sd(),ad(),ld()}function ld(){if(5!==Ac)return!1;var e=Sc,t=Tc;Tc=0;var n=Te(Cc),r=R.T,s=L.p;try{L.p=32>n?32:n,R.T=null,n=Pc,Pc=null;var a=Sc,o=Cc;if(Ac=0,Ec=Sc=null,Cc=0,0!==(6&nc))throw Error(i(331));var l=nc;if(nc|=4,Ql(a.current),ql(a,a.current,o,n),nc=l,Nd(0,!1),ue&&"function"===typeof ue.onPostCommitFiberRoot)try{ue.onPostCommitFiberRoot(de,a)}catch(c){}return!0}finally{L.p=s,R.T=r,id(e,t)}}function cd(e,t,n){t=kr(n,t),null!==(e=aa(e,t=No(e.stateNode,t,2),2))&&(Ae(e,2),jd(e))}function dd(e,t,n){if(3===e.tag)cd(e,e,n);else for(;null!==t;){if(3===t.tag){cd(t,e,n);break}if(1===t.tag){var r=t.stateNode;if("function"===typeof t.type.getDerivedStateFromError||"function"===typeof r.componentDidCatch&&(null===kc||!kc.has(r))){e=kr(n,e),null!==(r=aa(t,n=ko(2),2))&&(Ao(n,r,t,e),Ae(r,2),jd(r));break}}t=t.return}}function ud(e,t,n){var r=e.pingCache;if(null===r){r=e.pingCache=new tc;var s=new Set;r.set(t,s)}else void 0===(s=r.get(t))&&(s=new Set,r.set(t,s));s.has(n)||(dc=!0,s.add(n),e=md.bind(null,e,t,n),t.then(e,e))}function md(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,rc===e&&(ac&n)===n&&(4===mc||3===mc&&(62914560&ac)===ac&&300>te()-wc?0===(2&nc)&&qc(e,0):gc|=n,xc===ac&&(xc=0)),jd(e)}function hd(e,t){0===t&&(t=Ne()),null!==(e=_r(e,t))&&(Ae(e,t),jd(e))}function pd(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),hd(e,n)}function gd(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,s=e.memoizedState;null!==s&&(n=s.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}null!==r&&r.delete(t),hd(e,n)}var fd=null,xd=null,bd=!1,yd=!1,vd=!1,wd=0;function jd(e){e!==xd&&null===e.next&&(null===xd?fd=xd=e:xd=xd.next=e),yd=!0,bd||(bd=!0,uu(function(){0!==(6&nc)?Q(re,kd):Ad()}))}function Nd(e,t){if(!vd&&yd){vd=!0;do{for(var n=!1,r=fd;null!==r;){if(!t)if(0!==e){var s=r.pendingLanes;if(0===s)var a=0;else{var i=r.suspendedLanes,o=r.pingedLanes;a=(1<<31-he(42|e)+1)-1,a=201326741&(a&=s&~(i&~o))?201326741&a|1:a?2|a:0}0!==a&&(n=!0,Cd(r,a))}else a=ac,0===(3&(a=ye(r,r===rc?a:0,null!==r.cancelPendingCommit||-1!==r.timeoutHandle)))||ve(r,a)||(n=!0,Cd(r,a));r=r.next}}while(n);vd=!1}}function kd(){Ad()}function Ad(){yd=bd=!1;var e=0;0!==wd&&(function(){var e=window.event;if(e&&"popstate"===e.type)return e!==ou&&(ou=e,!0);return ou=null,!1}()&&(e=wd),wd=0);for(var t=te(),n=null,r=fd;null!==r;){var s=r.next,a=Sd(r,t);0===a?(r.next=null,null===n?fd=s:n.next=s,null===s&&(xd=n)):(n=r,(0!==e||0!==(3&a))&&(yd=!0)),r
vendor: 4,268 bytes, line 2
2=s}Nd(e,!1)}function Sd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,s=e.expirationTimes,a=-62914561&e.pendingLanes;0<a;){var i=31-he(a),o=1<<i,l=s[i];-1===l?0!==(o&n)&&0===(o&r)||(s[i]=we(o,t)):l<=t&&(e.expiredLanes|=o),a&=~o}if(n=ac,n=ye(e,e===(t=rc)?n:0,null!==e.cancelPendingCommit||-1!==e.timeoutHandle),r=e.callbackNode,0===n||e===t&&(2===ic||9===ic)||null!==e.cancelPendingCommit)return null!==r&&null!==r&&X(r),e.callbackNode=null,e.callbackPriority=0;if(0===(3&n)||ve(e,n)){if((t=n&-n)===e.callbackPriority)return t;switch(null!==r&&X(r),Te(n)){case 2:case 8:n=se;break;case 32:default:n=ae;break;case 268435456:n=oe}return r=Ed.bind(null,e),n=Q(n,r),e.callbackPriority=t,e.callbackNode=n,t}return null!==r&&null!==r&&X(r),e.callbackPriority=2,e.callbackNode=null,2}function Ed(e,t){if(0!==Ac&&5!==Ac)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(od()&&e.callbackNode!==n)return null;var r=ac;return 0===(r=ye(e,e===rc?r:0,null!==e.cancelPendingCommit||-1!==e.timeoutHandle))?null:(Oc(e,r,t),Sd(e,te()),null!=e.callbackNode&&e.callbackNode===n?Ed.bind(null,e):null)}function Cd(e,t){if(od())return null;Oc(e,t,!0)}function Td(){return 0===wd&&(wd=je()),wd}function Pd(e){return null==e||"symbol"===typeof e||"boolean"===typeof e?null:"function"===typeof e?e:Tt(""+e)}function _d(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}for(var Id=0;Id<wr.length;Id++){var Dd=wr[Id];jr(Dd.toLowerCase(),"on"+(Dd[0].toUpperCase()+Dd.slice(1)))}jr(hr,"onAnimationEnd"),jr(pr,"onAnimationIteration"),jr(gr,"onAnimationStart"),jr("dblclick","onDoubleClick"),jr("focusin","onFocus"),jr("focusout","onBlur"),jr(fr,"onTransitionRun"),jr(xr,"onTransitionStart"),jr(br,"onTransitionCancel"),jr(yr,"onTransitionEnd"),Je("onMouseEnter",["mouseout","mouseover"]),Je("onMouseLeave",["mouseout","mouseover"]),Je("onPointerEnter",["pointerout","pointerover"]),Je("onPointerLeave",["pointerout","pointerover"]),Ke("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ke("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ke("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ke("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ke("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ke("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Rd="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(" "),Ld=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Rd));function Md(e,t){t=0!==(4&t);for(var n=0;n<e.length;n++){var r=e[n],s=r.event;r=r.listeners;e:{var a=void 0;if(t)for(var i=r.length-1;0<=i;i--){var o=r[i],l=o.instance,c=o.currentTarget;if(o=o.listener,l!==a&&s.isPropagationStopped())break e;a=o,s.currentTarget=c;try{a(s)}catch(d){xo(d)}s.currentTarget=null,a=l}else for(i=0;i<r.length;i++){if(l=(o=r[i]).instance,c=o.currentTarget,o=o.listener,l!==a&&s.isPropagationStopped())break e;a=o,s.currentTarget=c;try{a(s)}catch(d){xo(d)}s.currentTarget=null,a=l}}}}function Od(e,t){var n=t[Le];void 0===n&&(n=t[Le]=new Set);var r=e+"__bubble";n.has(r)||(zd(t,e,2,!1),n.add(r))}function Fd(e,t,n){var r=0;t&&(r|=4),zd(n,e,r,t)}var Ud="_reactListening"+Math.random().toString(36).slice(2);function Bd(e){if(!e[Ud]){e[Ud]=!0,Ge.forEach(function(t){"selectionchange"!==t&&(Ld.has(t)||Fd(t,!1,e),Fd(t,!0,e))});var t=9===e.nodeType?e:e.ownerDocument;null===t||t[Ud]||(t[Ud]=!0,Fd("selectionchange",!1,t))}}function zd(e,t,n,r){switch(cm(t)){case 2:var s=rm;break;case 8:s=sm;break;default:s=am}n=s.bind(null,t,n,e),s=void 0,!Ut||"touchstart"!==t&&"touchmove"!==t&&"wheel"!==t||(s=!0),r?void 0!==s?e.addEventListener(t,n,{capture:!0,passive:s}):e.addEventListener(t,n,!0):void 0!==s?e.addEventListener(t,n,{passive:s}):e.addEventListener(t,n,!1)}
vendor: 4,542 bytes, line 2
2function Vd(e,t,n,r,s){var a=r;if(0===(1&t)&&0===(2&t)&&null!==r)e:for(;;){if(null===r)return;var i=r.tag;if(3===i||4===i){var o=r.stateNode.containerInfo;if(o===s)break;if(4===i)for(i=r.return;null!==i;){var c=i.tag;if((3===c||4===c)&&i.stateNode.containerInfo===s)return;i=i.return}for(;null!==o;){if(null===(i=ze(o)))return;if(5===(c=i.tag)||6===c||26===c||27===c){r=a=i;continue e}o=o.parentNode}}r=r.return}Mt(function(){var r=a,s=_t(n),i=[];e:{var o=vr.get(e);if(void 0!==o){var c=Zt,d=e;switch(e){case"keypress":if(0===Ht(n))break e;case"keydown":case"keyup":c=gn;break;case"focusin":d="focus",c=an;break;case"focusout":d="blur",c=an;break;case"beforeblur":case"afterblur":c=an;break;case"click":if(2===n.button)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":c=rn;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":c=sn;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":c=xn;break;case hr:case pr:case gr:c=on;break;case yr:c=bn;break;case"scroll":case"scrollend":c=tn;break;case"wheel":c=yn;break;case"copy":case"cut":case"paste":c=ln;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":c=fn;break;case"toggle":case"beforetoggle":c=vn}var u=0!==(4&t),m=!u&&("scroll"===e||"scrollend"===e),h=u?null!==o?o+"Capture":null:o;u=[];for(var p,g=r;null!==g;){var f=g;if(p=f.stateNode,5!==(f=f.tag)&&26!==f&&27!==f||null===p||null===h||null!=(f=Ot(g,h))&&u.push(qd(g,f,p)),m)break;g=g.return}0<u.length&&(o=new c(o,d,null,n,s),i.push({event:o,listeners:u}))}}if(0===(7&t)){if(c="mouseout"===e||"pointerout"===e,(!(o="mouseover"===e||"pointerover"===e)||n===Pt||!(d=n.relatedTarget||n.fromElement)||!ze(d)&&!d[Re])&&(c||o)&&(o=s.window===s?s:(o=s.ownerDocument)?o.defaultView||o.parentWindow:window,c?(c=r,null!==(d=(d=n.relatedTarget||n.toElement)?ze(d):null)&&(m=l(d),u=d.tag,d!==m||5!==u&&27!==u&&6!==u)&&(d=null)):(c=null,d=r),c!==d)){if(u=rn,f="onMouseLeave",h="onMouseEnter",g="mouse","pointerout"!==e&&"pointerover"!==e||(u=fn,f="onPointerLeave",h="onPointerEnter",g="pointer"),m=null==c?o:qe(c),p=null==d?o:qe(d),(o=new u(f,g+"leave",c,n,s)).target=m,o.relatedTarget=p,f=null,ze(s)===r&&((u=new u(h,g+"enter",d,n,s)).target=p,u.relatedTarget=m,f=u),m=f,c&&d)e:{for(h=d,g=0,p=u=c;p;p=Hd(p))g++;for(p=0,f=h;f;f=Hd(f))p++;for(;0<g-p;)u=Hd(u),g--;for(;0<p-g;)h=Hd(h),p--;for(;g--;){if(u===h||null!==h&&u===h.alternate)break e;u=Hd(u),h=Hd(h)}u=null}else u=null;null!==c&&Gd(i,o,c,u,!1),null!==d&&null!==m&&Gd(i,m,d,u,!0)}if("select"===(c=(o=r?qe(r):window).nodeName&&o.nodeName.toLowerCase())||"input"===c&&"file"===o.type)var x=Fn;else if(In(o))if(Un)x=Kn;else{x=Gn;var b=Hn}else!(c=o.nodeName)||"input"!==c.toLowerCase()||"checkbox"!==o.type&&"radio"!==o.type?r&&St(r.elementType)&&(x=Fn):x=Yn;switch(x&&(x=x(e,r))?Dn(i,x,n,s):(b&&b(e,o,r),"focusout"===e&&r&&"number"===o.type&&null!=r.memoizedProps.value&&bt(o,"number",o.value)),b=r?qe(r):window,e){case"focusin":(In(b)||"true"===b.contentEditable)&&(rr=b,sr=r,ar=null);break;case"focusout":ar=sr=rr=null;break;case"mousedown":ir=!0;break;case"contextmenu":case"mouseup":case"dragend":ir=!1,or(i,n,s);break;case"selectionchange":if(nr)break;case"keydown":case"keyup":or(i,n,s)}var y;if(jn)e:{switch(e){case"compositionstart":var v="onCompositionStart";break e;case"compositionend":v="onCompositionEnd";break e;case"compositionupdate":v="onCompositionUpdate";break e}v=void 0}else Pn?Cn(e,n)&&(v="onCompositionEnd"):"keydown"===e&&229===n.keyCode&&(v="onCompositionStart");v&&(An&&"ko"!==n.locale&&(Pn||"onCompositionStart"!==v?"onCompositionEnd"===v&&Pn&&(y=Wt()):(Vt="value"in(zt=s)?zt.value:zt.textContent,Pn=!0)),0<(b=Wd(r,v)).length&&(v=new cn(v,e,null,n,s),i.push({event:v,listeners:b}),y?v.data=y:null!==(y=Tn(n))&&(v.data=y))),(y=kn?function(e,t){switch(e){case"compositionend":return Tn(t);case"keypress":return 32!==t.which?null:(En=!0,Sn);case"textInput":return(e=t.data)===Sn&&En?null:e;default:return null}}(e,n):function(e,t){if(Pn)return"compositionend"===e||!jn&&Cn(e,t)?(e=Wt(),qt=Vt=zt=null,Pn=!1,e):null;switch(e){case"paste":default:return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return An&&"ko"!==t.locale?null:t.data}}
2(e,n))&&(0<(v=Wd(r,"onBeforeInput")).length&&(b=new cn("onBeforeInput","beforeinput",null,n,s),i.push({event:b,listeners:v}),b.data=y)),function(e,t,n,r,s){if("submit"===t&&n&&n.stateNode===s){var a=Pd((s[De]||null).action),i=r.submitter;i&&null!==(t=(t=i[De]||null)?Pd(t.formAction):i.getAttribute("formAction"))&&(a=t,i=null);var o=new Zt("action","action",null,r,s);e.push({event:o,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(0!==wd){var e=i?_d(s,i):new FormData(s);Pi(n,{pending:!0,data:e,method:s.method,action:a},null,e)}}else"function"===typeof a&&(o.preventDefault(),e=i?_d(s,i):new FormData(s),Pi(n,{pending:!0,data:e,method:s.method,action:a},a,e))},currentTarget:s}]})}}(i,e,r,n,s)}Md(i,t)})}function qd(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Wd(e,t){for(var n=t+"Capture",r=[];null!==e;){var s=e,a=s.stateNode;if(5!==(s=s.tag)&&26!==s&&27!==s||null===a||(null!=(s=Ot(e,n))&&r.unshift(qd(e,s,a)),null!=(s=Ot(e,t))&&r.push(qd(e,s,a))),3===e.tag)return r;e=e.return}return[]}function Hd(e){if(null===e)return null;do{e=e.return}while(e&&5!==e.tag&&27!==e.tag);return e||null}function Gd(e,t,n,r,s){for(var a=t._reactName,i=[];null!==n&&n!==r;){var o=n,l=o.alternate,c=o.stateNode;if(o=o.tag,null!==l&&l===r)break;5!==o&&26!==o&&27!==o||null===c||(l=c,s?null!=(c=Ot(n,a))&&i.unshift(qd(n,c,l)):s||null!=(c=Ot(n,a))&&i.push(qd(n,c,l))),n=n.return}0!==i.length&&e.push({event:t,listeners:i})}var Yd=/\r\n?/g,Kd=/\u0000|\uFFFD/g;function Jd(e){return("string"===typeof e?e:""+e).replace(Yd,"\n").replace(Kd,"")}function $d(e,t){return t=Jd(t),Jd(e)===t}function Qd(){}function Xd(e,t,n,r,s,a){switch(n){case"children":"string"===typeof r?"body"===t||"textarea"===t&&""===r||jt(e,r):("number"===typeof r||"bigint"===typeof r)&&"body"!==t&&jt(e,""+r);break;case"className":nt(e,"class",r);break;case"tabIndex":nt(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":nt(e,n,r);break;case"style":At(e,r,a);break;case"data":if("object"!==t){nt(e,"data",r);break}case"src":case"href":if(""===r&&("a"!==t||"href"!==n)){e.removeAttribute(n);break}if(null==r||"function"===typeof r||"symbol"===typeof r||"boolean"===typeof r){e.removeAttribute(n);break}r=Tt(""+r),e.setAttribute(n,r);break;case"action":case"formAction":if("function"===typeof r){e.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}if("function"===typeof a&&("formAction"===n?("input"!==t&&Xd(e,t,"name",s.name,s,null),Xd(e,t,"formEncType",s.formEncType,s,null),Xd(e,t,"formMethod",s.formMethod,s,null),Xd(e,t,"formTarget",s.formTarget,s,null)):(Xd(e,t,"encType",s.encType,s,null),Xd(e,t,"method",s.method,s,null),Xd(e,t,"target",s.target,s,null))),null==r||"symbol"===typeof r||"boolean"===typeof r){e.removeAttribute(n);break}r=Tt(""+r),e.setAttribute(n,r);break;case"onClick":null!=r&&(e.onclick=Qd);break;case"onScroll":null!=r&&Od("scroll",e);break;case"onScrollEnd":null!=r&&Od("scrollend",e);break;case"dangerouslySetInnerHTML":if(null!=r){if("object"!==typeof r||!("__html"in r))throw Error(i(61));if(null!=(n=r.__html)){if(null!=s.children)throw Error(i(60));e.innerHTML=n}}break;case"multiple":e.multiple=r&&"function"!==typeof r&&"symbol"!==typeof r;break;case"muted":e.muted=r&&"function"!==typeof r&&"symbol"!==typeof r;break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":case"autoFocus":break;case"xlinkHref":if(null==r||"function"===typeof r||"boolean"===typeof r||"symbol"===typeof r){e.removeAttribute("xlink:href");break}n=Tt(""+r),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":null!=r&&"function"!==typeof r&&"symbol"!==typeof r?e.setAttribute(n,""+r):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInl
2ine":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":r&&"function"!==typeof r&&"symbol"!==typeof r?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":!0===r?e.setAttribute(n,""):!1!==r&&null!=r&&"function"!==typeof r&&"symbol"!==typeof r?e.setAttribute(n,r):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":null!=r&&"function"!==typeof r&&"symbol"!==typeof r&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case"rowSpan":case"start":null==r||"function"===typeof r||"symbol"===typeof r||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case"popover":Od("beforetoggle",e),Od("toggle",e),tt(e,"popover",r);break;case"xlinkActuate":rt(e,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":rt(e,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":rt(e,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":rt(e,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":rt(e,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":rt(e,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":rt(e,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":rt(e,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":rt(e,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":tt(e,"is",r);break;case"innerText":case"textContent":break;default:(!(2<n.length)||"o"!==n[0]&&"O"!==n[0]||"n"!==n[1]&&"N"!==n[1])&&tt(e,n=Et.get(n)||n,r)}}function Zd(e,t,n,r,s,a){switch(n){case"style":At(e,r,a);break;case"dangerouslySetInnerHTML":if(null!=r){if("object"!==typeof r||!("__html"in r))throw Error(i(61));if(null!=(n=r.__html)){if(null!=s.children)throw Error(i(60));e.innerHTML=n}}break;case"children":"string"===typeof r?jt(e,r):("number"===typeof r||"bigint"===typeof r)&&jt(e,""+r);break;case"onScroll":null!=r&&Od("scroll",e);break;case"onScrollEnd":null!=r&&Od("scrollend",e);break;case"onClick":null!=r&&(e.onclick=Qd);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":case"innerText":case"textContent":break;default:Ye.hasOwnProperty(n)||("o"!==n[0]||"n"!==n[1]||(s=n.endsWith("Capture"),t=n.slice(2,s?n.length-7:void 0),"function"===typeof(a=null!=(a=e[De]||null)?a[n]:null)&&e.removeEventListener(t,a,s),"function"!==typeof r)?n in e?e[n]=r:!0===r?e.setAttribute(n,""):tt(e,n,r):("function"!==typeof a&&null!==a&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,s)))}}function eu(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Od("error",e),Od("load",e);var r,s=!1,a=!1;for(r in n)if(n.hasOwnProperty(r)){var o=n[r];if(null!=o)switch(r){case"src":s=!0;break;case"srcSet":a=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,t));default:Xd(e,t,r,o,n,null)}}return a&&Xd(e,t,"srcSet",n.srcSet,n,null),void(s&&Xd(e,t,"src",n.src,n,null));case"input":Od("invalid",e);var l=r=o=a=null,c=null,d=null;for(s in n)if(n.hasOwnProperty(s)){var u=n[s];if(null!=u)switch(s){case"name":a=u;break;case"type":o=u;break;case"checked":c=u;break;case"defaultChecked":d=u;break;case"value":r=u;break;case"defaultValue":l=u;break;case"children":case"dangerouslySetInnerHTML":if(null!=u)throw Error(i(137,t));break;default:Xd(e,t,s,u,n,null)}}return xt(e,r,l,c,d,o,a,!1),void ut(e);case"select":for(a in Od("invalid",e),s=o=r=null,n)if(n.hasOwnProperty(a)&&null!=(l=n[a]
vendor: 6,799 bytes, line 2
2))switch(a){case"value":r=l;break;case"defaultValue":o=l;break;case"multiple":s=l;default:Xd(e,t,a,l,n,null)}return t=r,n=o,e.multiple=!!s,void(null!=t?yt(e,!!s,t,!1):null!=n&&yt(e,!!s,n,!0));case"textarea":for(o in Od("invalid",e),r=a=s=null,n)if(n.hasOwnProperty(o)&&null!=(l=n[o]))switch(o){case"value":s=l;break;case"defaultValue":a=l;break;case"children":r=l;break;case"dangerouslySetInnerHTML":if(null!=l)throw Error(i(91));break;default:Xd(e,t,o,l,n,null)}return wt(e,s,a,r),void ut(e);case"option":for(c in n)if(n.hasOwnProperty(c)&&null!=(s=n[c]))if("selected"===c)e.selected=s&&"function"!==typeof s&&"symbol"!==typeof s;else Xd(e,t,c,s,n,null);return;case"dialog":Od("beforetoggle",e),Od("toggle",e),Od("cancel",e),Od("close",e);break;case"iframe":case"object":Od("load",e);break;case"video":case"audio":for(s=0;s<Rd.length;s++)Od(Rd[s],e);break;case"image":Od("error",e),Od("load",e);break;case"details":Od("toggle",e);break;case"embed":case"source":case"link":Od("error",e),Od("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(d in n)if(n.hasOwnProperty(d)&&null!=(s=n[d]))switch(d){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,t));default:Xd(e,t,d,s,n,null)}return;default:if(St(t)){for(u in n)n.hasOwnProperty(u)&&(void 0!==(s=n[u])&&Zd(e,t,u,s,n,void 0));return}}for(l in n)n.hasOwnProperty(l)&&(null!=(s=n[l])&&Xd(e,t,l,s,n,null))}var tu=null,nu=null;function ru(e){return 9===e.nodeType?e:e.ownerDocument}function su(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function au(e,t){if(0===e)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return 1===e&&"foreignObject"===t?0:e}function iu(e,t){return"textarea"===e||"noscript"===e||"string"===typeof t.children||"number"===typeof t.children||"bigint"===typeof t.children||"object"===typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var ou=null;var lu="function"===typeof setTimeout?setTimeout:void 0,cu="function"===typeof clearTimeout?clearTimeout:void 0,du="function"===typeof Promise?Promise:void 0,uu="function"===typeof queueMicrotask?queueMicrotask:"undefined"!==typeof du?function(e){return du.resolve(null).then(e).catch(mu)}:lu;function mu(e){setTimeout(function(){throw e})}function hu(e){return"head"===e}function pu(e,t){var n=t,r=0,s=0;do{var a=n.nextSibling;if(e.removeChild(n),a&&8===a.nodeType)if("/$"===(n=a.data)){if(0<r&&8>r){n=r;var i=e.ownerDocument;if(1&n&&wu(i.documentElement),2&n&&wu(i.body),4&n)for(wu(n=i.head),i=n.firstChild;i;){var o=i.nextSibling,l=i.nodeName;i[Ue]||"SCRIPT"===l||"STYLE"===l||"LINK"===l&&"stylesheet"===i.rel.toLowerCase()||n.removeChild(i),i=o}}if(0===s)return e.removeChild(a),void Em(t);s--}else"$"===n||"$?"===n||"$!"===n?s++:r=n.charCodeAt(0)-48;else r=0;n=a}while(n);Em(t)}function gu(e){var t=e.firstChild;for(t&&10===t.nodeType&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":gu(n),Be(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if("stylesheet"===n.rel.toLowerCase())continue}e.removeChild(n)}}function fu(e){return"$!"===e.data||"$?"===e.data&&"complete"===e.ownerDocument.readyState}function xu(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break;if(8===t){if("$"===(t=e.data)||"$!"===t||"$?"===t||"F!"===t||"F"===t)break;if("/$"===t)return null}}return e}var bu=null;function yu(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("$"===n||"$!"===n||"$?"===n){if(0===t)return e;t--}else"/$"===n&&t++}e=e.previousSibling}return null}function vu(e,t,n){switch(t=ru(n),e){case"html":if(!(e=t.documentElement))throw Error(i(452));return e;case"head":if(!(e=t.head))throw Error(i(453));return e;case"body":if(!(e=t.body))throw Error(i(454));return e;default:throw Error(i(451))}}function wu(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Be(e)}var ju=new Map,Nu=new Set;function ku(e){return"function"===typeof e.getRootNode?e.getRootNode():9===e.nodeType?e:e.ownerDocument}var Au=L.d;L.d={f:function(){var e=Au.f(),t=zc();return e||t},r:function(e){var t=Ve(e);null!==t&&5===t.tag&&"form"===t.type?Ii(t):Au.r(e)},D:function(e){Au.D(e),Eu("dns-prefetch",e,null)},C:function(e,t){Au.C(e,t),Eu("preconnect",e,t)},L:function(e,t,n){Au.L(e,t,n);var r=Su;if(r&&e&&t){var s='link[rel="preload"][as="'+gt(t)+'"]';"image"===t&&n&&n.imageSrcSet?(s+='[imagesrcset="'+gt(n.imageSrcSet)+'"]',"string"===typeof n.imageSizes&&(s+='[imagesizes="'+gt(n.imageSizes)+'"]')):s+='[href="'+gt(e)+'"]';var a=s;switch(t){case"style":a=Tu(e);break;case"script":a=Iu(e)}ju.has(a)||(e=m({rel:"preload",href:"image"===t&&n&&n.imageSrcSet?void 0:e,as:t},n),ju.set(a,e),null!==r.querySelector(s)||"style"===t&&r.querySelector(Pu(a))||"script"===t&&r.querySelector(Du(a))||(eu(t=r.createElement("link"),"link",e),He(t),r.head.appendChild(t)))}},m:function(e,t){Au.m(e,t);var n=Su;if(n&&e){var r=t&&"string"===typeof t.as?t.as:"script",s='link[rel="modulepreload"][as="'+gt(r)+'"][href="'+gt(e)+'"]',a=s;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":a=Iu(e)}if(!ju.has(a)&&(e=m({rel:"modulepreload",href:e},t),ju.set(a,e),null===n.querySelector(s))){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Du(a)))return}eu(r=n.createElement("link"),"link",e),He(r),n.head.appendChild(r)}}},X:function(e,t){Au.X(e,t);var n=Su;if(n&&e){var r=We(n).hoistableScripts,s=Iu(e),a=r.get(s);a||((a=n.querySelector(Du(s)))||(e=m({src:e,async:!0},t),(t=ju.get(s))&&Ou(e,t),He(a=n.createElement("script")),eu(a,"link",e),n.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},r.set(s,a))}},S:function(e,t,n){Au.S(e,t,n);var r=Su;if(r&&e){var s=We(r).hoistableStyles,a=Tu(e);t=t||"default";var i=s.get(a);if(!i){var o={loading:0,preload:null};if(i=r.querySelector(Pu(a)))o.loading=5;else{e=m({rel:"stylesheet",href:e,"data-precedence":t},n),(n=ju.get(a))&&Mu(e,n);var l=i=r.createElement("link");He(l),eu(l,"link",e),l._p=new Promise(function(e,t){l.onload=e,l.onerror=t}),l.addEventListener("load",function(){o.loading|=1}),l.addEventListener("error",function(){o.loading|=2}),o.loading|=4,Lu(i,t,r)}i={type:"stylesheet",instance:i,count:1,state:o},s.set(a,i)}}},M:function(e,t){Au.M(e,t);var n=Su;if(n&&e){var r=We(n).hoistableScripts,s=Iu(e),a=r.get(s);a||((a=n.querySelector(Du(s)))||(e=m({src:e,async:!0,type:"module"},t),(t=ju.get(s))&&Ou(e,t),He(a=n.createElement("script")),eu(a,"link",e),n.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},r.set(s,a))}}};
vendor: 4,931 bytes, line 2
2var Su="undefined"===typeof document?null:document;function Eu(e,t,n){var r=Su;if(r&&"string"===typeof t&&t){var s=gt(t);s='link[rel="'+e+'"][href="'+s+'"]',"string"===typeof n&&(s+='[crossorigin="'+n+'"]'),Nu.has(s)||(Nu.add(s),e={rel:e,crossOrigin:n,href:t},null===r.querySelector(s)&&(eu(t=r.createElement("link"),"link",e),He(t),r.head.appendChild(t)))}}function Cu(e,t,n,r){var s,a,o,l,c=(c=W.current)?ku(c):null;if(!c)throw Error(i(446));switch(e){case"meta":case"title":return null;case"style":return"string"===typeof n.precedence&&"string"===typeof n.href?(t=Tu(n.href),(r=(n=We(c).hoistableStyles).get(t))||(r={type:"style",instance:null,count:0,state:null},n.set(t,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if("stylesheet"===n.rel&&"string"===typeof n.href&&"string"===typeof n.precedence){e=Tu(n.href);var d=We(c).hoistableStyles,u=d.get(e);if(u||(c=c.ownerDocument||c,u={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},d.set(e,u),(d=c.querySelector(Pu(e)))&&!d._p&&(u.instance=d,u.state.loading=5),ju.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},ju.set(e,n),d||(s=c,a=e,o=n,l=u.state,s.querySelector('link[rel="preload"][as="style"]['+a+"]")?l.loading=1:(a=s.createElement("link"),l.preload=a,a.addEventListener("load",function(){return l.loading|=1}),a.addEventListener("error",function(){return l.loading|=2}),eu(a,"link",o),He(a),s.head.appendChild(a))))),t&&null===r)throw Error(i(528,""));return u}if(t&&null!==r)throw Error(i(529,""));return null;case"script":return t=n.async,"string"===typeof(n=n.src)&&t&&"function"!==typeof t&&"symbol"!==typeof t?(t=Iu(n),(r=(n=We(c).hoistableScripts).get(t))||(r={type:"script",instance:null,count:0,state:null},n.set(t,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Tu(e){return'href="'+gt(e)+'"'}function Pu(e){return'link[rel="stylesheet"]['+e+"]"}function _u(e){return m({},e,{"data-precedence":e.precedence,precedence:null})}function Iu(e){return'[src="'+gt(e)+'"]'}function Du(e){return"script[async]"+e}function Ru(e,t,n){if(t.count++,null===t.instance)switch(t.type){case"style":var r=e.querySelector('style[data-href~="'+gt(n.href)+'"]');if(r)return t.instance=r,He(r),r;var s=m({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return He(r=(e.ownerDocument||e).createElement("style")),eu(r,"style",s),Lu(r,n.precedence,e),t.instance=r;case"stylesheet":s=Tu(n.href);var a=e.querySelector(Pu(s));if(a)return t.state.loading|=4,t.instance=a,He(a),a;r=_u(n),(s=ju.get(s))&&Mu(r,s),He(a=(e.ownerDocument||e).createElement("link"));var o=a;return o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),eu(a,"link",r),t.state.loading|=4,Lu(a,n.precedence,e),t.instance=a;case"script":return a=Iu(n.src),(s=e.querySelector(Du(a)))?(t.instance=s,He(s),s):(r=n,(s=ju.get(a))&&Ou(r=m({},n),s),He(s=(e=e.ownerDocument||e).createElement("script")),eu(s,"link",r),e.head.appendChild(s),t.instance=s);case"void":return null;default:throw Error(i(443,t.type))}else"stylesheet"===t.type&&0===(4&t.state.loading)&&(r=t.instance,t.state.loading|=4,Lu(r,n.precedence,e));return t.instance}function Lu(e,t,n){for(var r=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),s=r.length?r[r.length-1]:null,a=s,i=0;i<r.length;i++){var o=r[i];if(o.dataset.precedence===t)a=o;else if(a!==s)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=9===n.nodeType?n.head:n).insertBefore(e,t.firstChild)}function Mu(e,t){null==e.crossOrigin&&(e.crossOrigin=t.crossOrigin),null==e.referrerPolicy&&(e.referrerPolicy=t.referrerPolicy),null==e.title&&(e.title=t.title)}function Ou(e,t){null==e.crossOrigin&&(e.crossOrigin=t.crossOrigin),null==e.referrerPolicy&&(e.referrerPolicy=t.referrerPolicy),null==e.integrity&&(e.integrity=t.integrity)}var Fu=null;function Uu(e,t,n){if(null===Fu){var r=new Map,s=Fu=new Map;s.set(n,r)}else(r=(s=Fu).get(n))||(r=new Map,s.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),s=0;s<n.length;s++){var a=n[s];if(!(a[Ue]||a[Ie]||"link"===e&&"stylesheet"===a.getAttribute("rel"))&&"http://www.w3.org/2000/svg"!==a.namespaceURI){var i=a.getAttribute(t)||"";i=e+i;var o=r.get(i);o?o.push(a):r.set(i,[a])}}return r}function Bu(e,t,n){(e=e.ownerDocument||e).head.insertBefore(n,"title"===t?e.querySelector("head > title"):null)}function zu(e){return"stylesheet"!==e.type||0!==(3&e.state.loading)}var Vu=null;function qu(){}function Wu(){if(this.count--,0===this.count)if(this.stylesheets)Gu(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}var Hu=null;function Gu(e,t){e.stylesheets=null,null!==e.unsuspend&&(e.count++,Hu=new Map,t.forEach(Yu,e),Hu=null,Wu.call(e))}function Yu(e,t){if(!(4&t.state.loading)){var n=Hu.get(e);
vendor: 5,830 bytes, line 2
2if(n)var r=n.get(null);else{n=new Map,Hu.set(e,n);for(var s=e.querySelectorAll("link[data-precedence],style[data-precedence]"),a=0;a<s.length;a++){var i=s[a];"LINK"!==i.nodeName&&"not all"===i.getAttribute("media")||(n.set(i.dataset.precedence,i),r=i)}r&&n.set(null,r)}i=(s=t.instance).getAttribute("data-precedence"),(a=n.get(i)||r)===r&&n.set(null,s),n.set(i,s),this.count++,r=Wu.bind(this),s.addEventListener("load",r),s.addEventListener("error",r),a?a.parentNode.insertBefore(s,a.nextSibling):(e=9===e.nodeType?e.head:e).insertBefore(s,e.firstChild),t.state.loading|=4}}var Ku={$$typeof:w,Provider:null,Consumer:null,_currentValue:M,_currentValue2:M,_threadCount:0};function Ju(e,t,n,r,s,a,i,o){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=ke(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ke(0),this.hiddenUpdates=ke(null),this.identifierPrefix=r,this.onUncaughtError=s,this.onCaughtError=a,this.onRecoverableError=i,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=o,this.incompleteTransitions=new Map}function $u(e,t,n,r,s,a,i,o,l,c,d,u){return e=new Ju(e,t,n,i,o,l,c,u),t=1,!0===a&&(t|=24),a=Mr(3,null,null,t),e.current=a,a.stateNode=e,(t=Ds()).refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},na(a),e}function Qu(e){return e?e=Rr:Rr}function Xu(e,t,n,r,s,a){s=Qu(s),null===r.context?r.context=s:r.pendingContext=s,(r=sa(t)).payload={element:n},null!==(a=void 0===a?null:a)&&(r.callback=a),null!==(n=aa(e,r,t))&&(Mc(n,0,t),ia(n,e,t))}function Zu(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n<t?n:t}}function em(e,t){Zu(e,t),(e=e.alternate)&&Zu(e,t)}function tm(e){if(13===e.tag){var t=_r(e,67108864);null!==t&&Mc(t,0,67108864),em(e,67108864)}}var nm=!0;function rm(e,t,n,r){var s=R.T;R.T=null;var a=L.p;try{L.p=2,am(e,t,n,r)}finally{L.p=a,R.T=s}}function sm(e,t,n,r){var s=R.T;R.T=null;var a=L.p;try{L.p=8,am(e,t,n,r)}finally{L.p=a,R.T=s}}function am(e,t,n,r){if(nm){var s=im(r);if(null===s)Vd(e,t,r,om,n),bm(e,r);else if(function(e,t,n,r,s){switch(t){case"focusin":return um=ym(um,e,t,n,r,s),!0;case"dragenter":return mm=ym(mm,e,t,n,r,s),!0;case"mouseover":return hm=ym(hm,e,t,n,r,s),!0;case"pointerover":var a=s.pointerId;return pm.set(a,ym(pm.get(a)||null,e,t,n,r,s)),!0;case"gotpointercapture":return a=s.pointerId,gm.set(a,ym(gm.get(a)||null,e,t,n,r,s)),!0}return!1}(s,e,t,n,r))r.stopPropagation();else if(bm(e,r),4&t&&-1<xm.indexOf(e)){for(;null!==s;){var a=Ve(s);if(null!==a)switch(a.tag){case 3:if((a=a.stateNode).current.memoizedState.isDehydrated){var i=be(a.pendingLanes);if(0!==i){var o=a;for(o.pendingLanes|=2,o.entangledLanes|=2;i;){var l=1<<31-he(i);o.entanglements[1]|=l,i&=~l}jd(a),0===(6&nc)&&(jc=te()+500,Nd(0,!1))}}break;case 13:null!==(o=_r(a,2))&&Mc(o,0,2),zc(),em(a,2)}if(null===(a=im(r))&&Vd(e,t,r,om,n),a===s)break;s=a}null!==s&&r.stopPropagation()}else Vd(e,t,r,null,n)}}function im(e){return lm(e=_t(e))}var om=null;function lm(e){if(om=null,null!==(e=ze(e))){var t=l(e);if(null===t)e=null;else{var n=t.tag;if(13===n){if(null!==(e=c(t)))return e;e=null}else if(3===n){if(t.stateNode.current.memoizedState.isDehydrated)return 3===t.tag?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return om=e,null}function cm(e){switch(e){case"beforetoggle":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"toggle":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 2;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"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(ne()){case re:return 2;case se:return 8;case ae:case ie:return 32;case oe:return 268435456;default:return 32}default:return 32}}var dm=!1,um=null,mm=null,hm=null,pm=new Map,gm=new Map,fm=[],xm="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".split(" ");function bm(e,t){switch(e){case"focusin":case"focusout":um=null;break;case"dragenter":case"dragleave":mm=null;break;case"mouseover":case"mouseout":hm=null;break;case"pointerover":case"pointerout":pm.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":gm.delete(t.pointerId)}}function ym(e,t,n,r,s,a){return null===e||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[s]},null!==t&&(null!==(t=Ve(t))&&tm(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,null!==s&&-1===t.indexOf(s)&&t.push(s),e)}function vm(e){var t=ze(e.target);if(null!==t){var n=l(t);
vendor: 4,992 bytes, line 2
2if(null!==n)if(13===(t=n.tag)){if(null!==(t=c(n)))return e.blockedOn=t,void function(e,t){var n=L.p;try{return L.p=e,t()}finally{L.p=n}}(e.priority,function(){if(13===n.tag){var e=Rc();e=Ce(e);var t=_r(n,e);null!==t&&Mc(t,0,e),em(n,e)}})}else if(3===t&&n.stateNode.current.memoizedState.isDehydrated)return void(e.blockedOn=3===n.tag?n.stateNode.containerInfo:null)}e.blockedOn=null}function wm(e){if(null!==e.blockedOn)return!1;for(var t=e.targetContainers;0<t.length;){var n=im(e.nativeEvent);if(null!==n)return null!==(t=Ve(n))&&tm(t),e.blockedOn=n,!1;var r=new(n=e.nativeEvent).constructor(n.type,n);Pt=r,n.target.dispatchEvent(r),Pt=null,t.shift()}return!0}function jm(e,t,n){wm(e)&&n.delete(t)}function Nm(){dm=!1,null!==um&&wm(um)&&(um=null),null!==mm&&wm(mm)&&(mm=null),null!==hm&&wm(hm)&&(hm=null),pm.forEach(jm),gm.forEach(jm)}function km(e,t){e.blockedOn===t&&(e.blockedOn=null,dm||(dm=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,Nm)))}var Am=null;function Sm(e){Am!==e&&(Am=e,r.unstable_scheduleCallback(r.unstable_NormalPriority,function(){Am===e&&(Am=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],s=e[t+2];if("function"!==typeof r){if(null===lm(r||n))continue;break}var a=Ve(n);null!==a&&(e.splice(t,3),t-=3,Pi(a,{pending:!0,data:s,method:n.method,action:r},r,s))}}))}function Em(e){function t(t){return km(t,e)}null!==um&&km(um,e),null!==mm&&km(mm,e),null!==hm&&km(hm,e),pm.forEach(t),gm.forEach(t);for(var n=0;n<fm.length;n++){var r=fm[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<fm.length&&null===(n=fm[0]).blockedOn;)vm(n),null===n.blockedOn&&fm.shift();if(null!=(n=(e.ownerDocument||e).$$reactFormReplay))for(r=0;r<n.length;r+=3){var s=n[r],a=n[r+1],i=s[De]||null;if("function"===typeof a)i||Sm(n);else if(i){var o=null;if(a&&a.hasAttribute("formAction")){if(s=a,i=a[De]||null)o=i.formAction;else if(null!==lm(s))continue}else o=i.action;"function"===typeof o?n[r+1]=o:(n.splice(r,3),r-=3),Sm(n)}}}function Cm(e){this._internalRoot=e}function Tm(e){this._internalRoot=e}Tm.prototype.render=Cm.prototype.render=function(e){var t=this._internalRoot;if(null===t)throw Error(i(409));Xu(t.current,Rc(),e,t,null,null)},Tm.prototype.unmount=Cm.prototype.unmount=function(){var e=this._internalRoot;if(null!==e){this._internalRoot=null;var t=e.containerInfo;Xu(e.current,2,null,e,null,null),zc(),t[Re]=null}},Tm.prototype.unstable_scheduleHydration=function(e){if(e){var t=Pe();e={blockedOn:null,target:e,priority:t};for(var n=0;n<fm.length&&0!==t&&t<fm[n].priority;n++);fm.splice(n,0,e),0===n&&vm(e)}};var Pm=s.version;if("19.1.0"!==Pm)throw Error(i(527,Pm,"19.1.0"));L.findDOMNode=function(e){var t=e._reactInternals;if(void 0===t){if("function"===typeof e.render)throw Error(i(188));throw e=Object.keys(e).join(","),Error(i(268,e))}return e=function(e){var t=e.alternate;if(!t){if(null===(t=l(e)))throw Error(i(188));return t!==e?null:e}for(var n=e,r=t;;){var s=n.return;if(null===s)break;var a=s.alternate;if(null===a){if(null!==(r=s.return)){n=r;continue}break}if(s.child===a.child){for(a=s.child;a;){if(a===n)return d(s),e;if(a===r)return d(s),t;a=a.sibling}throw Error(i(188))}if(n.return!==r.return)n=s,r=a;else{for(var o=!1,c=s.child;c;){if(c===n){o=!0,n=s,r=a;break}if(c===r){o=!0,r=s,n=a;break}c=c.sibling}if(!o){for(c=a.child;c;){if(c===n){o=!0,n=a,r=s;break}if(c===r){o=!0,r=a,n=s;break}c=c.sibling}if(!o)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(3!==n.tag)throw Error(i(188));return n.stateNode.current===n?e:t}(t),e=null===(e=null!==e?u(e):null)?null:e.stateNode};var _m={bundleType:0,version:"19.1.0",rendererPackageName:"react-dom",currentDispatcherRef:R,reconcilerVersion:"19.1.0"};if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var Im=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Im.isDisabled&&Im.supportsFiber)try{de=Im.inject(_m),ue=Im}catch(Rm){}}t.createRoot=function(e,t){if(!o(e))throw Error(i(299));var n=!1,r="",s=bo,a=yo,l=vo;return null!==t&&void 0!==t&&(!0===t.unstable_strictMode&&(n=!0),void 0!==t.identifierPrefix&&(r=t.identifierPrefix),void 0!==t.onUncaughtError&&(s=t.onUncaughtError),void 0!==t.onCaughtError&&(a=t.onCaughtError),void 0!==t.onRecoverableError&&(l=t.onRecoverableError),void 0!==t.unstable_transitionCallbacks&&t.unstable_transitionCallbacks),t=$u(e,1,!1,null,0,n,r,s,a,l,0,null),e[Re]=t.current,Bd(e),new Cm(t)},t.hydrateRoot=function(e,t,n){if(!o(e))throw Error(i(299));var r=!1,s="",a=bo,l=yo,c=vo,d=null;return null!==n&&void 0!==n&&(!0===n.unstable_strictMode&&(r=!0),void 0!==n.identifierPrefix&&(s=n.identifierPrefix),void 0!==n.onUncaughtError&&(a=n.onUncaughtError),void 0!==n.onCaughtError&&(l=n.onCaughtError),void 0!==n.onRecoverableError&&(c=n.onRecoverableError),void 0!==n.unstable_transitionCallbacks&&n.unstable_transitionCallbacks,void 0!==n.formState&&(d=n.formState)),(t=$u(e,1,!0,t,0,r,s,a,l,c,0,d)).context=Qu(null),n=t.current,(s=sa(r=Ce(r=Rc()))).callback=null,aa(n,s,r),n=r,t.current.lanes=n,Ae(t,n),jd(t),e[Re]=t.current,Bd(e),new Tm(t)},t.version="19.1.0"}
2,43:(e,t,n)=>{"use strict";e.exports=n(288)},139:(e,t)=>{var n;!function(){"use strict";var r={}.hasOwnProperty;function s(){for(var e="",t=0;t<arguments.length;t++){var n=arguments[t];n&&(e=i(e,a(n)))}return e}function a(e){if("string"===typeof e||"number"===typeof e)return e;if("object"!==typeof e)return"";if(Array.isArray(e))return s.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var n in e)r.call(e,n)&&e[n]&&(t=i(t,n));return t}function i(e,t){return t?e?e+" "+t:e+t:e}e.exports?(s.default=s,e.exports=s):void 0===(n=function(){return s}.apply(t,[]))||(e.exports=n)}()},147:(e,t,n)=>{"use strict";n.d(t,{qk:()=>Ne,c7:()=>Ae,KR:()=>ke,D:()=>je});var r=n(150),s=n(529),a=n(812);const i="firebasestorage.googleapis.com",o="storageBucket";class l extends s.g{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;super(u(e),"Firebase Storage: ".concat(t," (").concat(u(e),")")),this.status_=n,this.customData={serverResponse:null},this._baseMessage=this.message,Object.setPrototypeOf(this,l.prototype)}get status(){return this.status_}set status(e){this.status_=e}_codeEquals(e){return u(e)===this.code}get serverResponse(){return this.customData.serverResponse}set serverResponse(e){this.customData.serverResponse=e,this.customData.serverResponse?this.message="".concat(this._baseMessage,"\n").concat(this.customData.serverResponse):this.message=this._baseMessage}}var c,d;function u(e){return"storage/"+e}function m(){return new l(c.UNKNOWN,"An unknown error occurred, please check the error payload for server response.")}function h(){return new l(c.RETRY_LIMIT_EXCEEDED,"Max retry time for operation exceeded, please try again.")}function p(){return new l(c.CANCELED,"User canceled the upload/download.")}function g(){return new l(c.CANNOT_SLICE_BLOB,"Cannot slice blob for upload. Please retry the upload.")}function f(e){return new l(c.INVALID_ARGUMENT,e)}function x(){return new l(c.APP_DELETED,"The Firebase app was deleted.")}function b(e,t){return new l(c.INVALID_FORMAT,"String does not match format '"+e+"': "+t)}function y(e){throw new l(c.INTERNAL_ERROR,"Internal error: "+e)}!function(e){e.UNKNOWN="unknown",e.OBJECT_NOT_FOUND="object-not-found",e.BUCKET_NOT_FOUND="bucket-not-found",e.PROJECT_NOT_FOUND="project-not-found",e.QUOTA_EXCEEDED="quota-exceeded",e.UNAUTHENTICATED="unauthenticated",e.UNAUTHORIZED="unauthorized",e.UNAUTHORIZED_APP="unauthorized-app",e.RETRY_LIMIT_EXCEEDED="retry-limit-exceeded",e.INVALID_CHECKSUM="invalid-checksum",e.CANCELED="canceled",e.INVALID_EVENT_NAME="invalid-event-name",e.INVALID_URL="invalid-url",e.INVALID_DEFAULT_BUCKET="invalid-default-bucket",e.NO_DEFAULT_BUCKET="no-default-bucket",e.CANNOT_SLICE_BLOB="cannot-slice-blob",e.SERVER_FILE_WRONG_SIZE="server-file-wrong-size",e.NO_DOWNLOAD_URL="no-download-url",e.INVALID_ARGUMENT="invalid-argument",e.INVALID_ARGUMENT_COUNT="invalid-argument-count",e.APP_DELETED="app-deleted",e.INVALID_ROOT_OPERATION="invalid-root-operation",e.INVALID_FORMAT="invalid-format",e.INTERNAL_ERROR="internal-error",e.UNSUPPORTED_ENVIRONMENT="unsupported-environment"}(c||(c={}));class v{constructor(e,t){this.bucket=e,this.path_=t}get path(){return this.path_}get isRoot(){return 0===this.path.length}fullServerUrl(){const e=encodeURIComponent;return"/b/"+e(this.bucket)+"/o/"+e(this.path)}bucketOnlyServerUrl(){return"/b/"+encodeURIComponent(this.bucket)+"/o"}static makeFromBucketSpec(e,t){let n;try{n=v.makeFromUrl(e,t)}catch(s){return new v(e,"")}if(""===n.path)return n;throw r=e,new l(c.INVALID_DEFAULT_BUCKET,"Invalid default bucket '"+r+"'.");var r}static makeFromUrl(e,t){let n=null;const r="([A-Za-z0-9.\\-_]+)";const s=new RegExp("^gs://"+r+"(/(.*))?$","i");function a(e){e.path_=decodeURIComponent(e.path)}const o=t.replace(/[.]/g,"\\."),d=[{regex:s,indices:{bucket:1,path:3},postModify:function(e){"/"===e.path.charAt(e.path.length-1)&&(e.path_=e.path_.slice(0,-1))}},{regex:new RegExp("^https?://".concat(o,"/").concat("v[A-Za-z0-9_]+","/b/").concat(r,"/o").concat("(/([^?#]*).*)?$"),"i"),indices:{bucket:1,path:3},postModify:a},{regex:new RegExp("^https?://".concat(t===i?"(?:storage.googleapis.com|storage.cloud.google.com)":t,"/").concat(r,"/").concat("([^?#]*)"),"i"),indices:{bucket:1,path:2},postModify:a}];for(let i=0;i<d.length;i++){const t=d[i],r=t.regex.exec(e);if(r){const e=r[t.indices.bucket];let s=r[t.indices.path];s||(s=""),n=new v(e,s),t.postModify(n);break}}if(null==n)throw function(e){return new l(c.INVALID_URL,"Invalid URL '"+e+"'.")}(e);return n}}class w{constructor(e){this.promise_=Promise.reject(e)}getPromise(){return this.promise_}cancel(){}}function j(e){return"string"===typeof e||e instanceof String}function N(e){return k()&&e instanceof Blob}function k(){return"undefined"!==typeof Blob}function A(e,t,n,r){if(r<t)throw f("Invalid value for '".concat(e,"'. Expected ").concat(t," or greater."));if(r>n)throw f("Invalid value for '".concat(e,"'. Expected ").concat(n," or less."))}function S(e,t,n){let r=t;return null==n&&(r="https://".concat(t)),"".concat(n,"://").concat(r,"/v0").concat(e)}function E(e){const t=encodeURIComponent;let n="?";for(const r in e)if(e.hasOwnProperty(r)){n=n+(t(r)+"="+t(e[r]))+"&"}return n=n.slice(0,-1),n}function C(e,t){const n=e>=500&&e<600,r=-1!==[408,429].indexOf(e),s=-1!==t.indexOf(e);return n||r||s}
2!function(e){e[e.NO_ERROR=0]="NO_ERROR",e[e.NETWORK_ERROR=1]="NETWORK_ERROR",e[e.ABORT=2]="ABORT"}(d||(d={}));class T{constructor(e,t,n,r,s,a,i,o,l,c,d){let u=!(arguments.length>11&&void 0!==arguments[11])||arguments[11];this.url_=e,this.method_=t,this.headers_=n,this.body_=r,this.successCodes_=s,this.additionalRetryCodes_=a,this.callback_=i,this.errorCallback_=o,this.timeout_=l,this.progressCallback_=c,this.connectionFactory_=d,this.retry=u,this.pendingConnection_=null,this.backoffId_=null,this.canceled_=!1,this.appDelete_=!1,this.promise_=new Promise((e,t)=>{this.resolve_=e,this.reject_=t,this.start_()})}start_(){const e=(e,t)=>{if(t)return void e(!1,new P(!1,null,!0));const n=this.connectionFactory_();this.pendingConnection_=n;const r=e=>{const t=e.loaded,n=e.lengthComputable?e.total:-1;null!==this.progressCallback_&&this.progressCallback_(t,n)};null!==this.progressCallback_&&n.addUploadProgressListener(r),n.send(this.url_,this.method_,this.body_,this.headers_).then(()=>{null!==this.progressCallback_&&n.removeUploadProgressListener(r),this.pendingConnection_=null;const t=n.getErrorCode()===d.NO_ERROR,s=n.getStatus();if(!t||C(s,this.additionalRetryCodes_)&&this.retry){const t=n.getErrorCode()===d.ABORT;return void e(!1,new P(!1,null,t))}const a=-1!==this.successCodes_.indexOf(s);e(!0,new P(a,n))})},t=(e,t)=>{const n=this.resolve_,r=this.reject_,s=t.connection;if(t.wasSuccessCode)try{const e=this.callback_(s,s.getResponse());void 0!==e?n(e):n()}catch(a){r(a)}else if(null!==s){const e=m();e.serverResponse=s.getErrorText(),this.errorCallback_?r(this.errorCallback_(s,e)):r(e)}else if(t.canceled){r(this.appDelete_?x():p())}else{r(h())}};this.canceled_?t(0,new P(!1,null,!0)):this.backoffId_=function(e,t,n){let r=1,s=null,a=null,i=!1,o=0;function l(){return 2===o}let c=!1;function d(){if(!c){c=!0;for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];t.apply(null,n)}}function u(t){s=setTimeout(()=>{s=null,e(h,l())},t)}function m(){a&&clearTimeout(a)}function h(e){if(c)return void m();for(var t=arguments.length,n=new Array(t>1?t-1:0),s=1;s<t;s++)n[s-1]=arguments[s];if(e)return m(),void d.call(null,e,...n);if(l()||i)return m(),void d.call(null,e,...n);let a;r<64&&(r*=2),1===o?(o=2,a=0):a=1e3*(r+Math.random()),u(a)}let p=!1;function g(e){p||(p=!0,m(),c||(null!==s?(e||(o=2),clearTimeout(s),u(0)):e||(o=1)))}return u(0),a=setTimeout(()=>{i=!0,g(!0)},n),g}(e,t,this.timeout_)}getPromise(){return this.promise_}cancel(e){this.canceled_=!0,this.appDelete_=e||!1,null!==this.backoffId_&&(0,this.backoffId_)(!1),null!==this.pendingConnection_&&this.pendingConnection_.abort()}}class P{constructor(e,t,n){this.wasSuccessCode=e,this.connection=t,this.canceled=!!n}}function _(){return"undefined"!==typeof BlobBuilder?BlobBuilder:"undefined"!==typeof WebKitBlobBuilder?WebKitBlobBuilder:void 0}function I(){const e=_();for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(void 0!==e){const t=new e;for(let e=0;e<n.length;e++)t.append(n[e]);return t.getBlob()}if(k())return new Blob(n);throw new l(c.UNSUPPORTED_ENVIRONMENT,"This browser doesn't seem to support creating Blobs")}function D(e){if("undefined"===typeof atob)throw t="base-64",new l(c.UNSUPPORTED_ENVIRONMENT,"".concat(t," is missing. Make sure to install the required polyfills. See https://firebase.google.com/docs/web/environments-js-sdk#polyfills for more information."));var t;return atob(e)}const R="raw",L="base64",M="base64url",O="data_url";class F{constructor(e,t){this.data=e,this.contentType=t||null}}function U(e,t){switch(e){case R:return new F(B(t));case L:case M:return new F(z(e,t));case O:return new F(function(e){const t=new V(e);return t.base64?z(L,t.rest):function(e){let t;try{t=decodeURIComponent(e)}catch(n){throw b(O,"Malformed data URL.")}return B(t)}(t.rest)}(t),new V(t).contentType)}throw m()}function B(e){const t=[];for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);if(r<=127)t.push(r);else if(r<=2047)t.push(192|r>>6,128|63&r);else if(55296===(64512&r)){if(n<e.length-1&&56320===(64512&e.charCodeAt(n+1))){r=65536|(1023&r)<<10|1023&e.charCodeAt(++n),t.push(240|r>>18,128|r>>12&63,128|r>>6&63,128|63&r)}else t.push(239,191,189)}else 56320===(64512&r)?t.push(239,191,189):t.push(224|r>>12,128|r>>6&63,128|63&r)}return new Uint8Array(t)}function z(e,t){switch(e){case L:{const n=-1!==t.indexOf("-"),r=-1!==t.indexOf("_");if(n||r){throw b(e,"Invalid character '"+(n?"-":"_")+"' found: is it base64url encoded?")}break}case M:{const n=-1!==t.indexOf("+"),r=-1!==t.indexOf("/");if(n||r){throw b(e,"Invalid character '"+(n?"+":"/")+"' found: is it base64 encoded?")}t=t.replace(/-/g,"+").replace(/_/g,"/");break}}let n;try{n=D(t)}
2catch(s){if(s.message.includes("polyfill"))throw s;throw b(e,"Invalid character found")}const r=new Uint8Array(n.length);for(let a=0;a<n.length;a++)r[a]=n.charCodeAt(a);return r}class V{constructor(e){this.base64=!1,this.contentType=null;const t=e.match(/^data:([^,]+)?,/);if(null===t)throw b(O,"Must be formatted 'data:[<mediatype>][;base64],<data>");const n=t[1]||null;null!=n&&(this.base64=function(e,t){if(!(e.length>=t.length))return!1;return e.substring(e.length-t.length)===t}(n,";base64"),this.contentType=this.base64?n.substring(0,n.length-7):n),this.rest=e.substring(e.indexOf(",")+1)}}class q{constructor(e,t){let n=0,r="";N(e)?(this.data_=e,n=e.size,r=e.type):e instanceof ArrayBuffer?(t?this.data_=new Uint8Array(e):(this.data_=new Uint8Array(e.byteLength),this.data_.set(new Uint8Array(e))),n=this.data_.length):e instanceof Uint8Array&&(t?this.data_=e:(this.data_=new Uint8Array(e.length),this.data_.set(e)),n=e.length),this.size_=n,this.type_=r}size(){return this.size_}type(){return this.type_}slice(e,t){if(N(this.data_)){const n=function(e,t,n){return e.webkitSlice?e.webkitSlice(t,n):e.mozSlice?e.mozSlice(t,n):e.slice?e.slice(t,n):null}(this.data_,e,t);return null===n?null:new q(n)}{const n=new Uint8Array(this.data_.buffer,e,t-e);return new q(n,!0)}}static getBlob(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(k()){const e=t.map(e=>e instanceof q?e.data_:e);return new q(I.apply(null,e))}{const e=t.map(e=>j(e)?U(R,e).data:e.data_);let n=0;e.forEach(e=>{n+=e.byteLength});const r=new Uint8Array(n);let s=0;return e.forEach(e=>{for(let t=0;t<e.length;t++)r[s++]=e[t]}),new q(r,!0)}}uploadData(){return this.data_}}function W(e){let t;try{t=JSON.parse(e)}catch(r){return null}return"object"!==typeof(n=t)||Array.isArray(n)?null:t;var n}function H(e){const t=e.lastIndexOf("/",e.length-2);return-1===t?e:e.slice(t+1)}function G(e,t){return t}class Y{constructor(e,t,n,r){this.server=e,this.local=t||e,this.writable=!!n,this.xform=r||G}}let K=null;function J(){if(K)return K;const e=[];e.push(new Y("bucket")),e.push(new Y("generation")),e.push(new Y("metageneration")),e.push(new Y("name","fullPath",!0));const t=new Y("name");t.xform=function(e,t){return function(e){return!j(e)||e.length<2?e:H(e)}(t)},e.push(t);const n=new Y("size");return n.xform=function(e,t){return void 0!==t?Number(t):t},e.push(n),e.push(new Y("timeCreated")),e.push(new Y("updated")),e.push(new Y("md5Hash",null,!0)),e.push(new Y("cacheControl",null,!0)),e.push(new Y("contentDisposition",null,!0)),e.push(new Y("contentEncoding",null,!0)),e.push(new Y("contentLanguage",null,!0)),e.push(new Y("contentType",null,!0)),e.push(new Y("metadata","customMetadata",!0)),K=e,K}function $(e,t,n){const r={type:"file"},s=n.length;for(let a=0;a<s;a++){const e=n[a];r[e.local]=e.xform(r,t[e.server])}return function(e,t){Object.defineProperty(e,"ref",{get:function(){const n=e.bucket,r=e.fullPath,s=new v(n,r);return t._makeStorageReference(s)}})}(r,e),r}function Q(e,t,n){const r=W(t);if(null===r)return null;return $(e,r,n)}function X(e,t){const n={},r=t.length;for(let s=0;s<r;s++){const r=t[s];r.writable&&(n[r.server]=e[r.local])}return JSON.stringify(n)}class Z{constructor(e,t,n,r){this.url=e,this.method=t,this.handler=n,this.timeout=r,this.urlParams={},this.headers={},this.body=null,this.errorHandler=null,this.progressCallback=null,this.successCodes=[200],this.additionalRetryCodes=[]}}function ee(e){if(!e)throw m()}function te(e,t){return function(n,r){const s=Q(e,r,t);return ee(null!==s),s}}function ne(e,t){return function(n,r){const s=Q(e,r,t);return ee(null!==s),function(e,t,n,r){const s=W(t);if(null===s)return null;if(!j(s.downloadTokens))return null;const a=s.downloadTokens;if(0===a.length)return null;const i=encodeURIComponent;return a.split(",").map(t=>{const s=e.bucket,a=e.fullPath;return S("/b/"+i(s)+"/o/"+i(a),n,r)+E({alt:"media",token:t})})[0]}(s,r,e.host,e._protocol)}}function re(e){return function(t,n){let r;var s,a;return 401===t.getStatus()?r=t.getErrorText().includes("Firebase App Check token is invalid")?new l(c.UNAUTHORIZED_APP,"This app does not have permission to access Firebase Storage on this project."):new l(c.UNAUTHENTICATED,"User is not authenticated, please authenticate using Firebase Authentication and try again."):402===t.getStatus()?(a=e.bucket,r=new l(c.QUOTA_EXCEEDED,"Quota for bucket '"+a+"' exceeded, please view quota on https://firebase.google.com/pricing/.")):403===t.getStatus()?(s=e.path,r=new l(c.UNAUTHORIZED,"User does not have permission to access '"+s+"'.")):r=n,r.status=t.getStatus(),r.serverResponse=n.serverResponse,r}}function se(e){const t=re(e);return function(n,r){let s=t(n,r);var a;
2return 404===n.getStatus()&&(a=e.path,s=new l(c.OBJECT_NOT_FOUND,"Object '"+a+"' does not exist.")),s.serverResponse=r.serverResponse,s}}function ae(e,t,n){const r=Object.assign({},n);return r.fullPath=e.path,r.size=t.size(),r.contentType||(r.contentType=function(e,t){return e&&e.contentType||t&&t.type()||"application/octet-stream"}(null,t)),r}function ie(e,t,n,r,s){const a=t.bucketOnlyServerUrl(),i={"X-Goog-Upload-Protocol":"multipart"};const o=function(){let e="";for(let t=0;t<2;t++)e+=Math.random().toString().slice(2);return e}();i["Content-Type"]="multipart/related; boundary="+o;const l=ae(t,r,s),c="--"+o+"\r\nContent-Type: application/json; charset=utf-8\r\n\r\n"+X(l,n)+"\r\n--"+o+"\r\nContent-Type: "+l.contentType+"\r\n\r\n",d="\r\n--"+o+"--",u=q.getBlob(c,r,d);if(null===u)throw g();const m={name:l.fullPath},h=S(a,e.host,e._protocol),p=e.maxUploadRetryTime,f=new Z(h,"POST",te(e,n),p);return f.urlParams=m,f.headers=i,f.body=u.uploadData(),f.errorHandler=re(t),f}let oe=null;class le{constructor(){this.sent_=!1,this.xhr_=new XMLHttpRequest,this.initXhr(),this.errorCode_=d.NO_ERROR,this.sendPromise_=new Promise(e=>{this.xhr_.addEventListener("abort",()=>{this.errorCode_=d.ABORT,e()}),this.xhr_.addEventListener("error",()=>{this.errorCode_=d.NETWORK_ERROR,e()}),this.xhr_.addEventListener("load",()=>{e()})})}send(e,t,n,r){if(this.sent_)throw y("cannot .send() more than once");if(this.sent_=!0,this.xhr_.open(t,e,!0),void 0!==r)for(const s in r)r.hasOwnProperty(s)&&this.xhr_.setRequestHeader(s,r[s].toString());return void 0!==n?this.xhr_.send(n):this.xhr_.send(),this.sendPromise_}getErrorCode(){if(!this.sent_)throw y("cannot .getErrorCode() before sending");return this.errorCode_}getStatus(){if(!this.sent_)throw y("cannot .getStatus() before sending");try{return this.xhr_.status}catch(e){return-1}}getResponse(){if(!this.sent_)throw y("cannot .getResponse() before sending");return this.xhr_.response}getErrorText(){if(!this.sent_)throw y("cannot .getErrorText() before sending");return this.xhr_.statusText}abort(){this.xhr_.abort()}getResponseHeader(e){return this.xhr_.getResponseHeader(e)}addUploadProgressListener(e){null!=this.xhr_.upload&&this.xhr_.upload.addEventListener("progress",e)}removeUploadProgressListener(e){null!=this.xhr_.upload&&this.xhr_.upload.removeEventListener("progress",e)}}class ce extends le{initXhr(){this.xhr_.responseType="text"}}function de(){return oe?oe():new ce}class ue{constructor(e,t){this._service=e,this._location=t instanceof v?t:v.makeFromUrl(t,e.host)}toString(){return"gs://"+this._location.bucket+"/"+this._location.path}_newRef(e,t){return new ue(e,t)}get root(){const e=new v(this._location.bucket,"");return this._newRef(this._service,e)}get bucket(){return this._location.bucket}get fullPath(){return this._location.path}get name(){return H(this._location.path)}get storage(){return this._service}get parent(){const e=function(e){if(0===e.length)return null;const t=e.lastIndexOf("/");return-1===t?"":e.slice(0,t)}(this._location.path);if(null===e)return null;const t=new v(this._location.bucket,e);return new ue(this._service,t)}_throwIfRoot(e){if(""===this._location.path)throw function(e){return new l(c.INVALID_ROOT_OPERATION,"The operation '"+e+"' cannot be performed on a root reference, create a non-root reference using child, such as .child('file.png').")}(e)}}function me(e,t,n){e._throwIfRoot("uploadBytes");const r=ie(e.storage,e._location,J(),new q(t,!0),n);return e.storage.makeRequestWithTokens(r,de).then(t=>({metadata:t,ref:e}))}function he(e){e._throwIfRoot("getDownloadURL");const t=function(e,t,n){const r=S(t.fullServerUrl(),e.host,e._protocol),s=e.maxOperationRetryTime,a=new Z(r,"GET",ne(e,n),s);return a.errorHandler=se(t),a}(e.storage,e._location,J());return e.storage.makeRequestWithTokens(t,de).then(e=>{if(null===e)throw new l(c.NO_DOWNLOAD_URL,"The given file does not have any download URLs.");return e})}function pe(e,t){const n=function(e,t){const n=t.split("/").filter(e=>e.length>0).join("/");return 0===e.length?n:e+"/"+n}(e._location.path,t),r=new v(e._location.bucket,n);return new ue(e.storage,r)}function ge(e,t){if(e instanceof be){const n=e;if(null==n._bucket)throw new l(c.NO_DEFAULT_BUCKET,"No default bucket found. Did you set the '"+o+"' property when initializing the app?");const r=new ue(n,n._bucket);return null!=t?ge(r,t):r}return void 0!==t?pe(e,t):e}function fe(e,t){if(t&&/^[A-Za-z]+:\/\//.test(t)){if(e instanceof be)return new ue(e,t);throw f("To use ref(service, url), the first argument must be a Storage instance.")}return ge(e,t)}function xe(e,t){const n=null===t||void 0===t?void 0:t[o];return null==n?null:v.makeFromBucketSpec(n,e)}
2class be{constructor(e,t,n,r,s){this.app=e,this._authProvider=t,this._appCheckProvider=n,this._url=r,this._firebaseVersion=s,this._bucket=null,this._host=i,this._protocol="https",this._appId=null,this._deleted=!1,this._maxOperationRetryTime=12e4,this._maxUploadRetryTime=6e5,this._requests=new Set,this._bucket=null!=r?v.makeFromBucketSpec(r,this._host):xe(this._host,this.app.options)}get host(){return this._host}set host(e){this._host=e,null!=this._url?this._bucket=v.makeFromBucketSpec(this._url,e):this._bucket=xe(e,this.app.options)}get maxUploadRetryTime(){return this._maxUploadRetryTime}set maxUploadRetryTime(e){A("time",0,Number.POSITIVE_INFINITY,e),this._maxUploadRetryTime=e}get maxOperationRetryTime(){return this._maxOperationRetryTime}set maxOperationRetryTime(e){A("time",0,Number.POSITIVE_INFINITY,e),this._maxOperationRetryTime=e}async _getAuthToken(){if(this._overrideAuthToken)return this._overrideAuthToken;const e=this._authProvider.getImmediate({optional:!0});if(e){const t=await e.getToken();if(null!==t)return t.accessToken}return null}async _getAppCheckToken(){if((0,r.xZ)(this.app)&&this.app.settings.appCheckToken)return this.app.settings.appCheckToken;const e=this._appCheckProvider.getImmediate({optional:!0});if(e){return(await e.getToken()).token}return null}_delete(){return this._deleted||(this._deleted=!0,this._requests.forEach(e=>e.cancel()),this._requests.clear()),Promise.resolve()}_makeStorageReference(e){return new ue(this,e)}_makeRequest(e,t,n,r){let s=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];if(this._deleted)return new w(x());{const a=function(e,t,n,r,s,a){let i=!(arguments.length>6&&void 0!==arguments[6])||arguments[6];const o=E(e.urlParams),l=e.url+o,c=Object.assign({},e.headers);return function(e,t){t&&(e["X-Firebase-GMPID"]=t)}(c,t),function(e,t){null!==t&&t.length>0&&(e.Authorization="Firebase "+t)}(c,n),function(e,t){e["X-Firebase-Storage-Version"]="webjs/"+(null!==t&&void 0!==t?t:"AppManager")}(c,a),function(e,t){null!==t&&(e["X-Firebase-AppCheck"]=t)}(c,r),new T(l,e.method,c,e.body,e.successCodes,e.additionalRetryCodes,e.handler,e.errorHandler,e.timeout,e.progressCallback,s,i)}(e,this._appId,n,r,t,this._firebaseVersion,s);return this._requests.add(a),a.getPromise().then(()=>this._requests.delete(a),()=>this._requests.delete(a)),a}}async makeRequestWithTokens(e,t){const[n,r]=await Promise.all([this._getAuthToken(),this._getAppCheckToken()]);return this._makeRequest(e,t,n,r).getPromise()}}const ye="@firebase/storage",ve="0.13.7",we="storage";function je(e,t,n){return me(e=(0,s.Ku)(e),t,n)}function Ne(e){return he(e=(0,s.Ku)(e))}function ke(e,t){return fe(e=(0,s.Ku)(e),t)}function Ae(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:(0,r.Sx)(),t=arguments.length>1?arguments[1]:void 0;e=(0,s.Ku)(e);const n=(0,r.j6)(e,we).getImmediate({identifier:t}),a=(0,s.yU)("storage");return a&&function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};!function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};e.host="".concat(t,":").concat(n),e._protocol="http";const{mockUserToken:a}=r;a&&(e._overrideAuthToken="string"===typeof a?a:(0,s.Fy)(a,e.app.options.projectId))}(e,t,n,r)}(n,...a),n}function Se(e,t){let{instanceIdentifier:n}=t;const s=e.getProvider("app").getImmediate(),a=e.getProvider("auth-internal"),i=e.getProvider("app-check-internal");return new be(s,a,i,n,r.MF)}(0,r.om)(new a.uA(we,Se,"PUBLIC").setMultipleInstances(!0)),(0,r.KO)(ye,ve,""),(0,r.KO)(ye,ve,"esm2017")},150:(e,t,n)=>{"use strict";n.d(t,{MF:()=>ue,j6:()=>ie,xZ:()=>oe,om:()=>ae,Sx:()=>he,Wp:()=>me,KO:()=>pe});var r=n(812),s=n(443),a=n(529),i=n(379);let o,l;const c=new WeakMap,d=new WeakMap,u=new WeakMap,m=new WeakMap,h=new WeakMap;let p={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return d.get(e);if("objectStoreNames"===t)return e.objectStoreNames||u.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return x(e[t])},set:(e,t,n)=>(e[t]=n,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function g(e){return e!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(l||(l=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return e.apply(b(this),n),x(c.get(this))}:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];
2return x(e.apply(b(this),n))}:function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];const a=e.call(b(this),t,...r);return u.set(a,t.sort?t.sort():[t]),x(a)}}function f(e){return"function"===typeof e?g(e):(e instanceof IDBTransaction&&function(e){if(d.has(e))return;const t=new Promise((t,n)=>{const r=()=>{e.removeEventListener("complete",s),e.removeEventListener("error",a),e.removeEventListener("abort",a)},s=()=>{t(),r()},a=()=>{n(e.error||new DOMException("AbortError","AbortError")),r()};e.addEventListener("complete",s),e.addEventListener("error",a),e.addEventListener("abort",a)});d.set(e,t)}(e),t=e,(o||(o=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])).some(e=>t instanceof e)?new Proxy(e,p):e);var t}function x(e){if(e instanceof IDBRequest)return function(e){const t=new Promise((t,n)=>{const r=()=>{e.removeEventListener("success",s),e.removeEventListener("error",a)},s=()=>{t(x(e.result)),r()},a=()=>{n(e.error),r()};e.addEventListener("success",s),e.addEventListener("error",a)});return t.then(t=>{t instanceof IDBCursor&&c.set(t,e)}).catch(()=>{}),h.set(t,e),t}(e);if(m.has(e))return m.get(e);const t=f(e);return t!==e&&(m.set(e,t),h.set(t,e)),t}const b=e=>h.get(e);const y=["get","getKey","getAll","getAllKeys","count"],v=["put","add","delete","clear"],w=new Map;function j(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!==typeof t)return;if(w.get(t))return w.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,s=v.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!s&&!y.includes(n))return;const a=async function(e){const t=this.transaction(e,s?"readwrite":"readonly");let a=t.store;for(var i=arguments.length,o=new Array(i>1?i-1:0),l=1;l<i;l++)o[l-1]=arguments[l];return r&&(a=a.index(o.shift())),(await Promise.all([a[n](...o),s&&t.done]))[0]};return w.set(t,a),a}p=(e=>(0,i.A)((0,i.A)({},e),{},{get:(t,n,r)=>j(t,n)||e.get(t,n,r),has:(t,n)=>!!j(t,n)||e.has(t,n)}))(p);class N{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(e=>{if(function(e){const t=e.getComponent();return"VERSION"===(null===t||void 0===t?void 0:t.type)}(e)){const t=e.getImmediate();return"".concat(t.library,"/").concat(t.version)}return null}).filter(e=>e).join(" ")}}const k="@firebase/app",A="0.11.5",S=new s.Vy("@firebase/app"),E="@firebase/app-compat",C="@firebase/analytics-compat",T="@firebase/analytics",P="@firebase/app-check-compat",_="@firebase/app-check",I="@firebase/auth",D="@firebase/auth-compat",R="@firebase/database",L="@firebase/data-connect",M="@firebase/database-compat",O="@firebase/functions",F="@firebase/functions-compat",U="@firebase/installations",B="@firebase/installations-compat",z="@firebase/messaging",V="@firebase/messaging-compat",q="@firebase/performance",W="@firebase/performance-compat",H="@firebase/remote-config",G="@firebase/remote-config-compat",Y="@firebase/storage",K="@firebase/storage-compat",J="@firebase/firestore",$="@firebase/vertexai",Q="@firebase/firestore-compat",X="firebase",Z="[DEFAULT]",ee={[k]:"fire-core",[E]:"fire-core-compat",[T]:"fire-analytics",[C]:"fire-analytics-compat",[_]:"fire-app-check",[P]:"fire-app-check-compat",[I]:"fire-auth",[D]:"fire-auth-compat",[R]:"fire-rtdb",[L]:"fire-data-connect",[M]:"fire-rtdb-compat",[O]:"fire-fn",[F]:"fire-fn-compat",[U]:"fire-iid",[B]:"fire-iid-compat",[z]:"fire-fcm",[V]:"fire-fcm-compat",[q]:"fire-perf",[W]:"fire-perf-compat",[H]:"fire-rc",[G]:"fire-rc-compat",[Y]:"fire-gcs",[K]:"fire-gcs-compat",[J]:"fire-fst",[Q]:"fire-fst-compat",[$]:"fire-vertex","fire-js":"fire-js",[X]:"fire-js-all"},te=new Map,ne=new Map,re=new Map;function se(e,t){try{e.container.addComponent(t)}catch(n){S.debug("Component ".concat(t.name," failed to register with FirebaseApp ").concat(e.name),n)}}function ae(e){const t=e.name;if(re.has(t))return S.debug("There were multiple attempts to register component ".concat(t,".")),!1;re.set(t,e);for(const n of te.values())se(n,e);for(const n of ne.values())se(n,e);return!0}function ie(e,t){const n=e.container.getProvider("heartbeat").getImmediate({optional:!0});return n&&n.triggerHeartbeat(),e.container.getProvider(t)}function oe(e){return null!==e&&void 0!==e&&void 0!==e.settings}const le={"no-app":"No Firebase App '{$appName}' has been created - call initializeApp() first","bad-app-name":"Illegal App name: '{$appName}'","duplicate-app":"Firebase App named '{$appName}' already exists with different options or config","app-deleted":"Firebase App named '{$appName}' already deleted","server-app-deleted":"Firebase Server App has been deleted","no-options":"Need to provide options, when not being deployed to hosting via source.","invali
2d-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance.","invalid-log-argument":"First argument to `onLog` must be null or a function.","idb-open":"Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.","idb-get":"Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.","idb-set":"Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.","idb-delete":"Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}.","finalization-registry-not-supported":"FirebaseServerApp deleteOnDeref field defined but the JS runtime does not support FinalizationRegistry.","invalid-server-app-environment":"FirebaseServerApp is not for use in browser environments."},ce=new a.FA("app","Firebase",le);class de{constructor(e,t,n){this._isDeleted=!1,this._options=Object.assign({},e),this._config=Object.assign({},t),this._name=t.name,this._automaticDataCollectionEnabled=t.automaticDataCollectionEnabled,this._container=n,this.container.addComponent(new r.uA("app",()=>this,"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(e){this.checkDestroyed(),this._automaticDataCollectionEnabled=e}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(e){this._isDeleted=e}checkDestroyed(){if(this.isDeleted)throw ce.create("app-deleted",{appName:this._name})}}const ue="11.6.1";function me(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e;if("object"!==typeof t){t={name:t}}const s=Object.assign({name:Z,automaticDataCollectionEnabled:!1},t),i=s.name;if("string"!==typeof i||!i)throw ce.create("bad-app-name",{appName:String(i)});if(n||(n=(0,a.T9)()),!n)throw ce.create("no-options");const o=te.get(i);if(o){if((0,a.bD)(n,o.options)&&(0,a.bD)(s,o.config))return o;throw ce.create("duplicate-app",{appName:i})}const l=new r.h1(i);for(const r of re.values())l.addComponent(r);const c=new de(n,s,l);return te.set(i,c),c}function he(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Z;const t=te.get(e);if(!t&&e===Z&&(0,a.T9)())return me();if(!t)throw ce.create("no-app",{appName:e});return t}function pe(e,t,n){var s;let a=null!==(s=ee[e])&&void 0!==s?s:e;n&&(a+="-".concat(n));const i=a.match(/\s|\//),o=t.match(/\s|\//);if(i||o){const e=['Unable to register library "'.concat(a,'" with version "').concat(t,'":')];return i&&e.push('library name "'.concat(a,'" contains illegal characters (whitespace or "/")')),i&&o&&e.push("and"),o&&e.push('version name "'.concat(t,'" contains illegal characters (whitespace or "/")')),void S.warn(e.join(" "))}ae(new r.uA("".concat(a,"-version"),()=>({library:a,version:t}),"VERSION"))}const ge="firebase-heartbeat-store";let fe=null;function xe(){return fe||(fe=function(e,t){let{blocked:n,upgrade:r,blocking:s,terminated:a}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=indexedDB.open(e,t),o=x(i);return r&&i.addEventListener("upgradeneeded",e=>{r(x(i.result),e.oldVersion,e.newVersion,x(i.transaction),e)}),n&&i.addEventListener("blocked",e=>n(e.oldVersion,e.newVersion,e)),o.then(e=>{a&&e.addEventListener("close",()=>a()),s&&e.addEventListener("versionchange",e=>s(e.oldVersion,e.newVersion,e))}).catch(()=>{}),o}("firebase-heartbeat-database",1,{upgrade:(e,t)=>{if(0===t)try{e.createObjectStore(ge)}catch(n){console.warn(n)}}}).catch(e=>{throw ce.create("idb-open",{originalErrorMessage:e.message})})),fe}async function be(e,t){try{const n=(await xe()).transaction(ge,"readwrite"),r=n.objectStore(ge);await r.put(t,ye(e)),await n.done}catch(n){if(n instanceof a.g)S.warn(n.message);else{const e=ce.create("idb-set",{originalErrorMessage:null===n||void 0===n?void 0:n.message});S.warn(e.message)}}}function ye(e){return"".concat(e.name,"!").concat(e.options.appId)}class ve{constructor(e){this.container=e,this._heartbeatsCache=null;const t=this.container.getProvider("app").getImmediate();this._storage=new je(t),this._heartbeatsCachePromise=this._storage.read().then(e=>(this._heartbeatsCache=e,e))}async triggerHeartbeat(){var e,t;try{const n=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),r=we();if(null==(null===(e=this._heartbeatsCache)||void 0===e?void 0:e.heartbeats)&&(this._heartbeatsCache=await this._heartbeatsCachePromise,null==(null===(t=this._heartbeatsCache)||void 0===t?void 0:t.heartbeats)))return;if(this._heartbeatsCache.lastSentHeartbeatDate===r||this._heartbeatsCache.heartbeats.some(e=>e.date===r))return;if(this._heartbeatsCache.heartbeats.push({date:r,agent:n}),this._heartbeatsCache.heartbeats.length>30){const e=function(e){if(0===e.length)return-1;let t=0,n=e[0].date;for(let r=1;r<e.length;r++)e[r].date<n&&(n=e[r].date,t=r);return t}(this._heartbeatsCache.heartbeats);this._heartbeatsCache.heartbeats.splice(e,1)}return this._storage.overwrite(this._heartbeatsCache)}catch(n){S.warn(n)}}async getHeartbeatsHeader(){var e;try{if(null===this._heartbeatsCache&&await this._heartbeatsCachePromise,null==(null===(e=this._heartbeatsCache)||void 0===e?void 0:e.heartbeats)||0===this._heartbeatsCache.heartbeats.length)return"";const t=we(),{heartbeatsToSend:n,unsentEntries:r}=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1024;const n=[];let r=e.slice();for(const s of e){const e=n.find(e=>e.agent===s.agent);if(e){if(e.dates.push(s.date),Ne(n)>t){e.dates.pop();break}}else if(n.push({agent:s.agent,dates:[s.date]}),Ne(n)>t){n.pop();break}r=r.slice(1)}return{heartbeatsToSend:n,unsentEntries:r}}(this._heartbeatsCache.heartbeats),s=(0,a.Uj)(JSON.stringify({version:2,heartbeats:n}));return this._heartbeatsCache.lastSentHeartbeatDate=t,r.length>0?(this._heartbeatsCache.heartbeats=r,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),s}catch(t){return S.warn(t),""}}}function we(){return(new Date).toISOString().substring(0,10)}class je{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return!!(0,a.zW)()&&(0,a.eX)().then(()=>!0).catch(()=>!1)}async read(){if(await this._canUseIndexedDBPromise){const e=await async function(e){try{const t=(await xe()).transaction(ge),n=await t.objectStore(ge).get(ye(e));return await t.done,n}catch(t){if(t instanceof a.g)S.warn(t.message);else{const e=ce.create("idb-get",{originalErrorMessage:null===t||void 0===t?void 0:t.message});S.warn(e.message)}}}(this.app);return(null===e||void 0===e?void 0:e.heartbeats)?e:{heartbeats:[]}}return{heartbeats:[]}}async overwrite(e){var t;if(await this._canUseIndexedDBPromise){const n=await this.read();return be(this.app,{lastSentHeartbeatDate:null!==(t=e.lastSentHeartbeatDate)&&void 0!==t?t:n.lastSentHeartbeatDate,heartbeats:e.heartbeats})}}async add(e){var t;if(await this._canUseIndexedDBPromise){const n=await this.read();return be(this.app,{lastSentHeartbeatDate:null!==(t=e.lastSentHeartbeatDate)&&void 0!==t?t:n.lastSentHeartbeatDate,heartbeats:[...n.heartbeats,...e.heartbeats]})}}}function Ne(e){return(0,a.Uj)(JSON.stringify({version:2,heartbeats:e})).length}var ke;ke="",ae(new r.uA("platform-logger",e=>new N(e),"PRIVATE")),ae(new r.uA("heartbeat",e=>new ve(e),"PRIVATE")),pe(k,A,ke),pe(k,A,"esm2017"),pe("fire-js","")},175:(e,t)=>{"use strict";const n=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,r=/^[\u0021-\u003A\u003C-\u007E]*$/,s=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,a=/^[\u0020-\u003A\u003D-\u007E]*$/,i=Object.prototype.toString,o=(()=>{const e=function(){};return e.prototype=Object.create(null),e})();function l(e,t,n){do{const n=e.charCodeAt(t);if(32!==n&&9!==n)return t}while(++t<n);return n}
2function c(e,t,n){for(;t>n;){const n=e.charCodeAt(--t);if(32!==n&&9!==n)return t+1}return n}function d(e){if(-1===e.indexOf("%"))return e;try{return decodeURIComponent(e)}catch(t){return e}}},193:(e,t,n)=>{"use strict";n.d(t,{Py:()=>Ie,hS:()=>pt,j$:()=>Be,dx:()=>Ke,LB:()=>vt,wf:()=>Ve,Im:()=>$e,Ao:()=>ze,ay:()=>Je,rN:()=>_t,N6:()=>Se,lh:()=>ve,kk:()=>ke,mU:()=>Ze,wj:()=>tt,_j:()=>ct,_S:()=>Oe,$9:()=>be,createProject:()=>He,a:()=>_e,Xf:()=>Re,SX:()=>Ae,Ni:()=>at,IW:()=>yt,xX:()=>ut,XX:()=>We,xx:()=>Xe,wC:()=>At,Gs:()=>St,Vk:()=>Tt,kZ:()=>Pt,GX:()=>rt,S$:()=>qe,cf:()=>Qe,getAllUsers:()=>fe,P5:()=>Ct,zE:()=>Ce,fz:()=>De,GE:()=>Ee,getEventById:()=>je,kQ:()=>we,A0:()=>Te,Nt:()=>et,getGroupById:()=>ot,Nk:()=>it,yL:()=>gt,PJ:()=>dt,f:()=>nt,YQ:()=>Ue,zA:()=>Fe,Qi:()=>ye,A:()=>Et,G6:()=>Ye,JQ:()=>Ge,Ft:()=>jt,l9:()=>Nt,jS:()=>xe,VM:()=>ge,U7:()=>mt,j:()=>ht,l:()=>wt,JW:()=>lt,V1:()=>bt,L0:()=>kt,Y9:()=>Dt,HJ:()=>Le,a9:()=>Me,NK:()=>xt,fd:()=>ft,u8:()=>It,sP:()=>Rt,iZ:()=>Pe,updateEvent:()=>Ne,vW:()=>st});var r=n(379),s=n(472),a=n(791);const{entries:i,setPrototypeOf:o,isFrozen:l,getPrototypeOf:c,getOwnPropertyDescriptor:d}=Object;let{freeze:u,seal:m,create:h}=Object,{apply:p,construct:g}="undefined"!==typeof Reflect&&Reflect;u||(u=function(e){return e}),m||(m=function(e){return e}),p||(p=function(e,t,n){return e.apply(t,n)}),g||(g=function(e,t){return new e(...t)});const f=_(Array.prototype.forEach),x=_(Array.prototype.lastIndexOf),b=_(Array.prototype.pop),y=_(Array.prototype.push),v=_(Array.prototype.splice),w=_(String.prototype.toLowerCase),j=_(String.prototype.toString),N=_(String.prototype.match),k=_(String.prototype.replace),A=_(String.prototype.indexOf),S=_(String.prototype.trim),E=_(Object.prototype.hasOwnProperty),C=_(RegExp.prototype.test),T=(P=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return g(P,t)});var P;function _(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];return p(e,t,r)}}function I(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:w;o&&o(e,null);let r=t.length;for(;r--;){let s=t[r];if("string"===typeof s){const e=n(s);e!==s&&(l(t)||(t[r]=e),s=e)}e[s]=!0}return e}function D(e){for(let t=0;t<e.length;t++){E(e,t)||(e[t]=null)}return e}function R(e){const t=h(null);for(const[n,r]of i(e)){E(e,n)&&(Array.isArray(r)?t[n]=D(r):r&&"object"===typeof r&&r.constructor===Object?t[n]=R(r):t[n]=r)}return t}function L(e,t){for(;null!==e;){const n=d(e,t);if(n){if(n.get)return _(n.get);if("function"===typeof n.value)return _(n.value)}e=c(e)}return function(){return null}}const M=u(["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","section","select","shadow","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"]),O=u(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),F=u(["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"]),U=u(["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"]),B=u(["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"]),z=u(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),V=u(["#text"]),q=u(["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","face","for","headers","height","hidden","high","href","hreflang","id","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","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","
2spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),W=u(["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","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"]),H=u(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),G=u(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Y=m(/\{\{[\w\W]*|[\w\W]*\}\}/gm),K=m(/<%[\w\W]*|[\w\W]*%>/gm),J=m(/\$\{[\w\W]*/gm),$=m(/^data-[\-\w.\u00B7-\uFFFF]+$/),Q=m(/^aria-[\-\w]+$/),X=m(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Z=m(/^(?:\w+script|data):/i),ee=m(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),te=m(/^html$/i),ne=m(/^[a-z][.\w]*(-[.\w]+)+$/i);var re=Object.freeze({__proto__:null,ARIA_ATTR:Q,ATTR_WHITESPACE:ee,CUSTOM_ELEMENT:ne,DATA_ATTR:$,DOCTYPE_NAME:te,ERB_EXPR:K,IS_ALLOWED_URI:X,IS_SCRIPT_OR_DATA:Z,MUSTACHE_EXPR:Y,TMPLIT_EXPR:J});const se=1,ae=3,ie=7,oe=8,le=9,ce=function(){return"undefined"===typeof window?null:window};var de=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ce();const n=t=>e(t);if(n.version="3.2.6",n.removed=[],!t||!t.document||t.document.nodeType!==le||!t.Element)return n.isSupported=!1,n;let{document:r}=t;const s=r,a=s.currentScript,{DocumentFragment:o,HTMLTemplateElement:l,Node:c,Element:d,NodeFilter:m,NamedNodeMap:p=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:g,DOMParser:P,trustedTypes:_}=t,D=d.prototype,Y=L(D,"cloneNode"),K=L(D,"remove"),J=L(D,"nextSibling"),$=L(D,"childNodes"),Q=L(D,"parentNode");if("function"===typeof l){const e=r.createElement("template");e.content&&e.content.ownerDocument&&(r=e.content.ownerDocument)}let Z,ee="";const{implementation:ne,createNodeIterator:de,createDocumentFragment:ue,getElementsByTagName:me}=r,{importNode:he}=s;let pe={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};n.isSupported="function"===typeof i&&"function"===typeof Q&&ne&&void 0!==ne.createHTMLDocument;const{MUSTACHE_EXPR:ge,ERB_EXPR:fe,TMPLIT_EXPR:xe,DATA_ATTR:be,ARIA_ATTR:ye,IS_SCRIPT_OR_DATA:ve,ATTR_WHITESPACE:we,CUSTOM_ELEMENT:je}=re;let{IS_ALLOWED_URI:Ne}=re,ke=null;const Ae=I({},[...M,...O,...F,...B,...V]);let Se=null;const Ee=I({},[...q,...W,...H,...G]);let Ce=Object.seal(h(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}})),Te=null,Pe=null,_e=!0,Ie=!0,De=!1,Re=!0,Le=!1,Me=!0,Oe=!1,Fe=!1,Ue=!1,Be=!1,ze=!1,Ve=!1,qe=!0,We=!1,He=!0,Ge=!1,Ye={},Ke=null;const Je=I({},["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 $e=null;const Qe=I({},["audio","video","img","source","image","track"]);let Xe=null;const Ze=I({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),et="http://www.w3.org/1998/Math/MathML",tt="http://www.w3.org/2000/svg",nt="http://www.w3.org/1999/xhtml";let rt=nt,st=!1,at=null;const it=I({},[et,tt,nt],j);let ot=I({},["mi","mo","mn","ms","mtext"]),lt=I({},["annotation-xml"]);const ct=I({}
vendor: 10,324 bytes, line 2
2,["title","style","font","a","script"]);let dt=null;const ut=["application/xhtml+xml","text/html"];let mt=null,ht=null;const pt=r.createElement("form"),gt=function(e){return e instanceof RegExp||e instanceof Function},ft=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!ht||ht!==e){if(e&&"object"===typeof e||(e={}),e=R(e),dt=-1===ut.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,mt="application/xhtml+xml"===dt?j:w,ke=E(e,"ALLOWED_TAGS")?I({},e.ALLOWED_TAGS,mt):Ae,Se=E(e,"ALLOWED_ATTR")?I({},e.ALLOWED_ATTR,mt):Ee,at=E(e,"ALLOWED_NAMESPACES")?I({},e.ALLOWED_NAMESPACES,j):it,Xe=E(e,"ADD_URI_SAFE_ATTR")?I(R(Ze),e.ADD_URI_SAFE_ATTR,mt):Ze,$e=E(e,"ADD_DATA_URI_TAGS")?I(R(Qe),e.ADD_DATA_URI_TAGS,mt):Qe,Ke=E(e,"FORBID_CONTENTS")?I({},e.FORBID_CONTENTS,mt):Je,Te=E(e,"FORBID_TAGS")?I({},e.FORBID_TAGS,mt):R({}),Pe=E(e,"FORBID_ATTR")?I({},e.FORBID_ATTR,mt):R({}),Ye=!!E(e,"USE_PROFILES")&&e.USE_PROFILES,_e=!1!==e.ALLOW_ARIA_ATTR,Ie=!1!==e.ALLOW_DATA_ATTR,De=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Re=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,Le=e.SAFE_FOR_TEMPLATES||!1,Me=!1!==e.SAFE_FOR_XML,Oe=e.WHOLE_DOCUMENT||!1,Be=e.RETURN_DOM||!1,ze=e.RETURN_DOM_FRAGMENT||!1,Ve=e.RETURN_TRUSTED_TYPE||!1,Ue=e.FORCE_BODY||!1,qe=!1!==e.SANITIZE_DOM,We=e.SANITIZE_NAMED_PROPS||!1,He=!1!==e.KEEP_CONTENT,Ge=e.IN_PLACE||!1,Ne=e.ALLOWED_URI_REGEXP||X,rt=e.NAMESPACE||nt,ot=e.MATHML_TEXT_INTEGRATION_POINTS||ot,lt=e.HTML_INTEGRATION_POINTS||lt,Ce=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&>(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Ce.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&>(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Ce.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"===typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(Ce.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Le&&(Ie=!1),ze&&(Be=!0),Ye&&(ke=I({},V),Se=[],!0===Ye.html&&(I(ke,M),I(Se,q)),!0===Ye.svg&&(I(ke,O),I(Se,W),I(Se,G)),!0===Ye.svgFilters&&(I(ke,F),I(Se,W),I(Se,G)),!0===Ye.mathMl&&(I(ke,B),I(Se,H),I(Se,G))),e.ADD_TAGS&&(ke===Ae&&(ke=R(ke)),I(ke,e.ADD_TAGS,mt)),e.ADD_ATTR&&(Se===Ee&&(Se=R(Se)),I(Se,e.ADD_ATTR,mt)),e.ADD_URI_SAFE_ATTR&&I(Xe,e.ADD_URI_SAFE_ATTR,mt),e.FORBID_CONTENTS&&(Ke===Je&&(Ke=R(Ke)),I(Ke,e.FORBID_CONTENTS,mt)),He&&(ke["#text"]=!0),Oe&&I(ke,["html","head","body"]),ke.table&&(I(ke,["tbody"]),delete Te.tbody),e.TRUSTED_TYPES_POLICY){if("function"!==typeof e.TRUSTED_TYPES_POLICY.createHTML)throw T('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!==typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw T('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');Z=e.TRUSTED_TYPES_POLICY,ee=Z.createHTML("")}else void 0===Z&&(Z=function(e,t){if("object"!==typeof e||"function"!==typeof e.createPolicy)return null;let n=null;const r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(n=t.getAttribute(r));const s="dompurify"+(n?"#"+n:"");try{return e.createPolicy(s,{createHTML:e=>e,createScriptURL:e=>e})}catch(a){return console.warn("TrustedTypes policy "+s+" could not be created."),null}}(_,a)),null!==Z&&"string"===typeof ee&&(ee=Z.createHTML(""));u&&u(e),ht=e}},xt=I({},[...O,...F,...U]),bt=I({},[...B,...z]),yt=function(e){y(n.removed,{element:e});try{Q(e).removeChild(e)}catch(t){K(e)}},vt=function(e,t){try{y(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(r){y(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e)if(Be||ze)try{yt(t)}catch(r){}else try{t.setAttribute(e,"")}catch(r){}},wt=function(e){let t=null,n=null;if(Ue)e="<remove></remove>"+e;else{const t=N(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===dt&&rt===nt&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const s=Z?Z.createHTML(e):e;if(rt===nt)try{t=(new P).parseFromString(s,dt)}catch(i){}if(!t||!t.documentElement){t=ne.createDocument(rt,"template",null);try{t.documentElement.innerHTML=st?ee:s}catch(i){}}const a=t.body||t.documentElement;return e&&n&&a.insertBefore(r.createTextNode(n),a.childNodes[0]||null),rt===nt?me.call(t,Oe?"html":"body")[0]:Oe?t.documentElement:a},jt=function(e){return de.call(e.ownerDocument||e,e,m.SHOW_ELEMENT|m.SHOW_COMMENT|m.SHOW_TEXT|m.SHOW_PROCESSING_INSTRUCTION|m.SHOW_CDATA_SECTION,null)},Nt=function(e){return e instanceof g&&("string"!==typeof e.nodeName||"string"!==typeof e.textContent||"function"!==typeof e.removeChild||!(e.attributes instanceof p)||"function"!==typeof e.removeAttribute||"function"!==typeof e.setAttribute||"string"!==typeof e.namespaceURI||"function"!==typeof e.insertBefore||"function"!==typeof e.hasChildNodes)},kt=function(e){return"function"===typeof c&&e instanceof c};function At(e,t,r){f(e,e=>{e.call(n,t,r,ht)})}const St=function(e){let t=null;if(At(pe.beforeSanitizeElements,e,null),Nt(e))return yt(e),!0;const r=mt(e.nodeName);if(At(pe.uponSanitizeElement,e,{tagName:r,allowedTags:ke}),Me&&e.hasChildNodes()&&!kt(e.firstElementChild)&&C(/<[/\w!]/g,e.innerHTML)&&C(/<[/\w!]/g,e.textContent))return yt(e),!0;if(e.nodeType===ie)return yt(e),!0;if(Me&&e.nodeType===oe&&C(/<[/\w]/g,e.data))return yt(e),!0;if(!ke[r]||Te[r]){if(!Te[r]&&Ct(r)){if(Ce.tagNameCheck instanceof RegExp&&C(Ce.tagNameCheck,r))return!1;if(Ce.tagNameCheck instanceof Function&&Ce.tagNameCheck(r))return!1}if(He&&!Ke[r]){const t=Q(e)||e.parentNode,n=$(e)||e.childNodes;if(n&&t){for(let r=n.length-1;r>=0;--r){const s=Y(n[r],!0);s.__removalCount=(e.__removalCount||0)+1,t.insertBefore(s,J(e))}}}return yt(e),!0}return e instanceof d&&!function(e){let t=Q(e);t&&t.tagName||(t={namespaceURI:rt,tagName:"template"});const n=w(e.tagName),r=w(t.tagName);return!!at[e.namespaceURI]&&(e.namespaceURI===tt?t.namespaceURI===nt?"svg"===n:t.namespaceURI===et?"svg"===n&&("annotation-xml"===r||ot[r]):Boolean(xt[n]):e.namespaceURI===et?t.namespaceURI===nt?"math"===n:t.namespaceURI===tt?"math"===n&<[r]:Boolean(bt[n]):e.namespaceURI===nt?!(t.namespaceURI===tt&&!lt[r])&&!(t.namespaceURI===et&&!ot[r])&&!bt[n]&&(ct[n]||!xt[n]):!("application/xhtml+xml"!==dt||!at[e.namespaceURI]))}(e)?(yt(e),!0):"noscript"!==r&&"noembed"!==r&&"noframes"!==r||!C(/<\/no(script|embed|frames)/i,e.innerHTML)?(Le&&e.nodeType===ae&&(t=e.textContent,f([ge,fe,xe],e=>{t=k(t,e," ")}),e.textContent!==t&&(y(n.removed,{element:e.cloneNode()}),e.textContent=t)),At(pe.afterSanitizeElements,e,null),!1):(yt(e),!0)},Et=function(e,t,n){if(qe&&("id"===t||"name"===t)&&(n in r||n in pt))return!1;if(Ie&&!Pe[t]&&C(be,t));else if(_e&&C(ye,t));else if(!Se[t]||Pe[t]){if(!(Ct(e)&&(Ce.tagNameCheck instanceof RegExp&&C(Ce.tagNameCheck,e)||Ce.tagNameCheck instanceof Function&&Ce.tagNameCheck(e))&&(Ce.attributeNameCheck instanceof RegExp&&C(Ce.attributeNameCheck,t)||Ce.attributeNameCheck instanceof Function&&Ce.attributeNameCheck(t))||"is"===t&&Ce.allowCustomizedBuiltInElements&&(Ce.tagNameCheck instanceof RegExp&&C(Ce.tagNameCheck,n)||Ce.tagNameCheck instanceof Function&&Ce.tagNameCheck(n))))return!1}else if(Xe[t]);else if(C(Ne,k(n,we,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==A(n,"data:")||!$e[e]){if(De&&!C(ve,k(n,we,"")));else if(n)return!1}else;return!0},Ct=function(e){return"annotation-xml"!==e&&N(e,je)},Tt=function(e){At(pe.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||Nt(e))return;const r={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Se,forceKeepAttr:void 0};let s=t.length;for(;s--;){const i=t[s],{name:o,namespaceURI:l,value:c}=i,d=mt(o),u=c;let m="value"===o?u:S(u);if(r.attrName=d,r.attrValue=m,r.keepAttr=!0,r.forceKeepAttr=void 0,At(pe.uponSanitizeAttribute,e,r),m=r.attrValue,!We||"id"!==d&&"name"!==d||(vt(o,e),m="user-content-"+m),Me&&C(/((--!?|])>)|<\/(style|title)/i,m)){vt(o,e);continue}if(r.forceKeepAttr)continue;if(!r.keepAttr){vt(o,e);continue}if(!Re&&C(/\/>/i,m)){vt(o,e);continue}Le&&f([ge,fe,xe],e=>{m=k(m,e," ")});const h=mt(e.nodeName);if(Et(h,d,m)){if(Z&&"object"===typeof _&&"function"===typeof _.getAttributeType)if(l);else switch(_.getAttributeType(h,d)){case"TrustedHTML":m=Z.createHTML(m);break;case"TrustedScriptURL":m=Z.createScriptURL(m)}if(m!==u)try{l?e.setAttributeNS(l,o,m):e.setAttribute(o,m),Nt(e)?yt(e):b(n.removed)}catch(a){vt(o,e)}}else vt(o,e)}At(pe.afterSanitizeAttributes,e,null)},Pt=function e(t){let n=null;const r=jt(t);for(At(pe.beforeSanitizeShadowDOM,t,null);n=r.nextNode();)At(pe.uponSanitizeShadowNode,n,null),St(n),Tt(n),n.content instanceof o&&e(n.content);At(pe.afterSanitizeShadowDOM,t,null)};return n.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=null,a=null,i=null,l=null;if(st=!e,st&&(e="\x3c!--\x3e"),"string"!==typeof e&&!kt(e)){if("function"!==typeof e.toString)throw T("toString is not a function");if("string"!==typeof(e=e.toString()))throw T("dirty is not a string, aborting")}if(!n.isSupported)return e;if(Fe||ft(t),n.removed=[],"string"===typeof e&&(Ge=!1),Ge){if(e.nodeName){const t=mt(e.nodeName);if(!ke[t]||Te[t])throw T("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof c)r=wt("\x3c!----\x3e"),a=r.ownerDocument.importNode(e,!0),a.nodeType===se&&"BODY"===a.nodeName||"HTML"===a.nodeName?r=a:r.appendChild(a);else{if(!Be&&!Le&&!Oe&&-1===e.indexOf("<"))return Z&&Ve?Z.createHTML(e):e;if(r=wt(e),!r)return Be?null:Ve?ee:""}r&&Ue&&yt(r.firstChild);const d=jt(Ge?e:r);for(;i=d.nextNode();)St(i),Tt(i),i.content instanceof o&&Pt(i.content);if(Ge)return e;if(Be){if(ze)for(l=ue.call(r.ownerDocument);r.firstChild;)l.appendChild(r.firstChild);else l=r;return(Se.shadowroot||Se.shadowrootmode)&&(l=he.call(s,l,!0)),l}let u=Oe?r.outerHTML:r.innerHTML;return Oe&&ke["!doctype"]&&r.ownerDocument&&r.ownerDocument.doctype&&r.ownerDocument.doctype.name&&C(te,r.ownerDocument.doctype.name)&&(u="<!DOCTYPE "+r.ownerDocument.doctype.name+">\n"+u),Le&&f([ge,fe,xe],e=>{u=k(u,e," ")}),Z&&Ve?Z.createHTML(u):u},n.setConfig=function(){ft(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Fe=!0},n.clearConfig=function(){ht=null,Fe=!1},n.isValidAttribute=function(e,t,n){ht||ft({});const r=mt(e),s=mt(t);return Et(r,s,n)},n.addHook=function(e,t){"function"===typeof t&&y(pe[e],t)},n.removeHook=function(e,t){if(void 0!==t){const n=x(pe[e],t);
2return-1===n?void 0:v(pe[e],n,1)[0]}return b(pe[e])},n.removeHooks=function(e){pe[e]=[]},n.removeAllHooks=function(){pe={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},n}();const ue={shortText:100,mediumText:500,longText:2e3,description:5e3,title:200,name:50,company:100,position:100,location:100,phone:20,url:2e3},me={basic:{ALLOWED_TAGS:[],ALLOWED_ATTR:[]},rich:{ALLOWED_TAGS:["p","br","strong","em","u","ol","ul","li","a"],ALLOWED_ATTR:["href","target"]},minimal:{ALLOWED_TAGS:["br","strong","em"],ALLOWED_ATTR:[]}},he=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{required:n=!1,minLength:r=0,maxLength:s=ue.longText,pattern:a=null,fieldName:i="Field"}=t;if(!e||""===e.trim())return n?{isValid:!1,error:"".concat(i," is required")}:{isValid:!0};const o=e.trim();return o.length<r?{isValid:!1,error:"".concat(i," must be at least ").concat(r," characters")}:o.length>s?{isValid:!1,error:"".concat(i," must be less than ").concat(s," characters")}:a&&!a.test(o)?{isValid:!1,error:"".concat(i," contains invalid characters")}:{isValid:!0,value:o}},pe=e=>{if(!e||""===e.trim())return{isValid:!1,error:"Comment cannot be empty"};const t=function(e){if(!e||"string"!==typeof e)return"";const t=me[arguments.length>1&&void 0!==arguments[1]?arguments[1]:"basic"]||me.basic;return de.sanitize(e,t)}(e,"minimal");return t.length>ue.longText?{isValid:!1,error:"Comment is too long"}:{isValid:!0,value:t}};n(217);const ge=async e=>{try{const t=await(0,s.x7)((0,s.doc)(a.db,"users",e));return t.exists()?(0,r.A)({id:t.id},t.data()):null}catch(t){throw console.error("Error getting user profile:",t),t}},fe=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:50;try{console.log("\ud83d\udd0d getAllUsers: Starting to fetch users...");try{const t=(0,s.query)((0,s.collection)(a.db,"users"),(0,s.orderBy)("createdAt","desc"),(0,s.limit)(e)),n=(await(0,s.getDocs)(t)).docs.map(e=>(0,r.A)({id:e.id},e.data()));return console.log("\ud83d\udd0d getAllUsers: Successfully fetched users with orderBy:",n.length),n}catch(t){console.warn("\ud83d\udd0d getAllUsers: orderBy failed, trying without orderBy:",t);const n=(0,s.query)((0,s.collection)(a.db,"users"),(0,s.limit)(e)),i=(await(0,s.getDocs)(n)).docs.map(e=>(0,r.A)({id:e.id},e.data()));return console.log("\ud83d\udd0d getAllUsers: Successfully fetched users without orderBy:",i.length),i}}catch(n){throw console.error("\u274c getAllUsers: Error getting users:",n),n}},xe=async()=>{try{console.log("\ud83d\udd0d getUserCount: Checking total users...");const e=(0,s.collection)(a.db,"users"),t=(await(0,s.getDocs)(e)).size;return console.log("\ud83d\udd0d getUserCount: Total users in database:",t),t}catch(e){return console.error("\u274c getUserCount: Error:",e),0}},be=async(e,t)=>{try{return await(0,s.BN)((0,s.doc)(a.db,"memberships",e),(0,r.A)((0,r.A)({},t),{},{createdAt:(0,s.serverTimestamp)(),updatedAt:(0,s.serverTimestamp)()})),!0}catch(n){throw console.error("Error creating membership:",n),n}},ye=async e=>{try{const t=await(0,s.x7)((0,s.doc)(a.db,"memberships",e));return t.exists()?(0,r.A)({id:t.id},t.data()):null}catch(t){throw console.error("Error getting membership:",t),t}},ve=async e=>{try{return(await(0,s.addDoc)((0,s.collection)(a.db,"events"),(0,r.A)((0,r.A)({},e),{},{attendees:[],registrations:[],createdAt:(0,s.serverTimestamp)(),updatedAt:(0,s.serverTimestamp)()}))).id}catch(t){throw console.error("Error creating event:",t),t}},we=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];try{let n;n=t?(0,s.query)((0,s.collection)(a.db,"events"),(0,s.where)("startDate",">=",new Date),(0,s.orderBy)("startDate","asc"),(0,s.limit)(e)):(0,s.query)((0,s.collection)(a.db,"events"),(0,s.orderBy)("startDate","desc"),(0,s.limit)(e));let i=await(0,s.getDocs)(n),o=i.docs.map(e=>(0,r.A)({id:e.id},e.data()));return t&&0===o.length&&(console.log("No upcoming events found, fetching all events..."),n=(0,s.query)((0,s.collection)(a.db,"events"),(0,s.orderBy)("startDate","desc"),(0,s.limit)(e)),i=await(0,s.getDocs)(n),o=i.docs.map(e=>(0,r.A)({id:e.id},e.data()))),console.log("Found ".concat(o.length," events (upcoming: ").concat(t,")")),o}catch(n){return console.error("Error getting events:",n),[]}},je=async e=>{try{const t=await(0,s.x7)((0,s.doc)(a.db,"events",e));return t.exists()?(0,r.A)({id:t.id},t.data()):null}catch(t){throw console.error("Error getting event:",t),t}},Ne=async(e,t)=>{try{return await(0,s.updateDoc)((0,s.doc)(a.db,"events",e),(0,r.A)((0,r.A)({},t),{},{updatedAt:(0,s.serverTimestamp)()})),!0}catch(n){throw console.error("Error updating event:",n),n}},ke=async e=>{try{return(await(0,s.addDoc)((0,s.collection)(a.db,"eventRegistrations"),(0,r.A)((0,r.A)({},e),{},{createdAt:(0,s.serverTimestamp)(),updatedAt:(0,s.serverTimestamp)()}))).id}catch(t){throw console.error("Error creating event registration:",t),t}},Ae=async e=>{try{await(0,s.kd)((0,s.doc)(a.db,"events",e));const t=(0,s.query)((0,s.collection)(a.db,"eventRegistrations"),(0,s.where)("eventId","==",e)),n=(await(0,s.getDocs)(t)).docs.map(e=>(0,s.kd)(e.ref));return await Promise.all(n),!0}catch(t){throw console.error("Error deleting event:",t),t}},Se=async e=>{try{return(await(0,s.addDoc)((0,s.collection)(a.db,"articles"),(0,r.A)((0,r.A)({},e),{},{views:0,likes:0,comments:[],createdAt:(0,s.serverTimestamp)(),updatedAt:(0,s.serverTimestamp)()}))).id}catch(t){throw console.error("Error creating article:",t),t}},Ee=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];try{let i;i=n?t&&"all"!==t?(0,s.query)((0,s.collection)(a.db,"articles"),(0,s.where)("category","==",t),(0,s.limit)(e)):(0,s.query)((0,s.collection)(a.db,"articles"),(0,s.limit)(e)):t&&"all"!==t?(0,s.query)((0,s.collection)(a.db,"articles"),(0,s.where)("category","==",t),(0,s.where)("status","==","published"),(0,s.orderBy)("publishedAt","desc"),(0,s.limit)(e)):(0,s.query)((0,s.collection)(a.db,"articles"),(0,s.where)("status","==","published"),(0,s.orderBy)("publishedAt","desc"),(0,s.limit)(e));let o=await(0,s.getDocs)(i),l=o.docs.map(e=>(0,r.A)({id:e.id},e.data()));return n||0!==l.length||(console.log("No published articles found, trying without status filter..."),i=t&&"all"!==t?(0,s.query)((0,s.collection)(a.db,"articles"),(0,s.where)("category","==",t),(0,s.limit)(e)):(0,s.query)((0,s.collection)(a.db,"articles"),(0,s.limit)(e)),o=await(0,s.getDocs)(i),l=o.docs.map(e=>(0,r.A)({id:e.id},e.data()))),console.log("Found ".concat(l.length," articles (category: ").concat(t,", adminView: ").concat(n,")")),l}catch(i){return console.error("Error getting articles:",i),[]}},Ce=async e=>{try{const t=await(0,s.x7)((0,s.doc)(a.db,"articles",e));return t.exists()?(await(0,s.updateDoc)((0,s.doc)(a.db,"articles",e),{views:(0,s.GV)(1)}),(0,r.A)({id:t.id},t.data())):null}catch(t){throw console.error("Error getting article:",t),t}},Te=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3;try{const t=(0,s.query)((0,s.collection)(a.db,"articles"),(0,s.where)("featured","==",!0),(0,s.where)("status","==","published"),(0,s.orderBy)("publishedAt","desc"),(0,s.limit)(e));return(await(0,s.getDocs)(t)).docs.map(e=>(0,r.A)({id:e.id},e.data()))}catch(t){throw console.error("Error getting featured articles:",t),t}},Pe=async(e,t)=>{try{return await(0,s.updateDoc)((0,s.doc)(a.db,"articles",e),(0,r.A)((0,r.A)({},t),{},{updatedAt:(0,s.serverTimestamp)()})),!0}catch(n){throw console.error("Error updating article:",n),n}},_e=async e=>{try{const t=(0,s.query)((0,s.collection)(a.db,"articleComments"),(0,s.where)("articleId","==",e)),n=(await(0,s.getDocs)(t)).docs.map(e=>(0,s.kd)(e.ref));return await Promise.all(n),await(0,s.kd)((0,s.doc)(a.db,"articles",e)),!0}catch(t){throw console.error("Error deleting article:",t),t}},Ie=async(e,t)=>{try{const n=pe(t.content);if(!n.isValid)throw new Error(n.error);const i=await(0,s.addDoc)((0,s.collection)(a.db,"articleComments"),(0,r.A)((0,r.A)({},t),{},{content:n.value,articleId:e,likes:[],likeCount:0,createdAt:(0,s.serverTimestamp)(),updatedAt:(0,s.serverTimestamp)()}));return await(0,s.updateDoc)((0,s.doc)(a.db,"articles",e),{commentCount:(0,s.GV)(1),updatedAt:(0,s.serverTimestamp)()}),i.id}catch(n){throw console.error("Error adding article comment:",n),n}},De=async e=>{try{const t=(0,s.query)((0,s.collection)(a.db,"articleComments"),(0,s.where)("articleId","==",e),(0,s.orderBy)("createdAt","asc"));return(await(0,s.getDocs)(t)).docs.map(e=>(0,r.A)({id:e.id},e.data()))}catch(t){throw console.error("Error getting article comments:",t),t}},Re=async(e,t)=>{try{return await(0,s.kd)((0,s.doc)(a.db,"articleComments",e)),await(0,s.updateDoc)((0,s.doc)(a.db,"articles",t),{commentCount:(0,s.GV)(-1),updatedAt:(0,s.serverTimestamp)()}),!0}catch(n){throw console.error("Error deleting article comment:",n),n}},Le=async(e,t)=>{try{const n=(0,s.doc)(a.db,"articleComments",e),r=await(0,s.x7)(n);if(r.exists()){const e=r.data();return(e.likes||[]).includes(t)?(await(0,s.updateDoc)(n,{likes:(0,s.C3)(t),likeCount:(0,s.GV)(-1),updatedAt:(0,s.serverTimestamp)()}),!1):(await(0,s.updateDoc)(n,{likes:(0,s.hq)(t),likeCount:(0,s.GV)(1),updatedAt:(0,s.serverTimestamp)()}),!0)}}catch(n){throw console.error("Error toggling article comment like:",n),n}},Me=async(e,t)=>{try{const n=(0,s.doc)(a.db,"articles",e),r=await(0,s.x7)(n);if(r.exists()){const e=r.data();return(e.likes||[]).includes(t)?(await(0,s.updateDoc)(n,{likes:(0,s.C3)(t),likeCount:(0,s.GV)(-1),updatedAt:(0,s.serverTimestamp)()}),!1):(await(0,s.updateDoc)(n,{likes:(0,s.hq)(t),likeCount:(0,s.GV)(1),updatedAt:(0,s.serverTimestamp)()}),!0)}}catch(n){throw console.error("Error toggling article like:",n),n}},Oe=async(e,t)=>{try{return(await(0,s.addDoc)((0,s.collection)(a.db,"jobs"),(0,r.A)((0,r.A)({},e),{},{postedBy:t,applications:[],views:0,status:"active",postedDate:(0,s.serverTimestamp)(),updatedAt:(0,s.serverTimestamp)()}))).id}catch(n){throw console.error("Error creating job:",n),n}},Fe=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{let n=(0,s.query)((0,s.collection)(a.db,"jobs"),(0,s.where)("status","==","active"),(0,s.orderBy)("postedDate","desc"),(0,s.limit)(e));t.location&&(n=(0,s.query)(n,(0,s.where)("location","==",t.location))),t.jobType&&(n=(0,s.query)(n,(0,s.where)("jobType","==",t.jobType)));return(await(0,s.getDocs)(n)).docs.map(e=>(0,r.A)({id:e.id},e.data()))}catch(n){throw console.error("Error getting jobs:",n),n}},Ue=async e=>{try{const n=await(0,s.x7)((0,s.doc)(a.db,"jobs",e));if(n.exists()){try{await(0,s.updateDoc)((0,s.doc)(a.db,"jobs",e),{views:(0,s.GV)(1)})}catch(t){}return(0,r.A)({id:n.id},n.data())}return null}catch(n){throw console.error("Error getting job:",n),n}},Be=async(e,t,n)=>{try{return await(0,s.updateDoc)((0,s.doc)(a.db,"jobs",e),{applications:(0,s.hq)((0,r.A)((0,r.A)({userId:t},n),{},{appliedAt:(new Date).toISOString(),status:"pending"})),updatedAt:(0,s.serverTimestamp)()}),!0}catch(i){throw console.error("Error applying for job:",i),i}},ze=async(e,t)=>{try{return await(0,s.updateDoc)((0,s.doc)(a.db,"jobs",e),{status:"closed",closedAt:(0,s.serverTimestamp)(),closedBy:t,updatedAt:(0,s.serverTimestamp)()}),!0}catch(n){throw console.error("Error closing job:",n),n}},Ve=async(e,t)=>{try{return await(0,s.updateDoc)((0,s.doc)(a.db,"jobs",e),{status:"archived",archivedAt:(0,s.serverTimestamp)(),archivedBy:t,updatedAt:(0,s.serverTimestamp)()}),!0}catch(n){throw console.error("Error archiving job:",n),n}},qe=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100;try{const t=(0,s.query)((0,s.collection)(a.db,"jobs"),(0,s.orderBy)("postedDate","desc"),(0,s.limit)(e));return(await(0,s.getDocs)(t)).docs.map(e=>(0,r.A)({id:e.id},e.data()))}catch(t){return console.error("Error getting all jobs:",t),[]}},We=async e=>{try{const t=(0,s.query)((0,s.collection)(a.db,"applications"),(0,s.where)("postingId","==",e)),n=(await(0,s.getDocs)(t)).docs.map(e=>(0,s.kd)(e.ref));return await Promise.all(n),await(0,s.kd)((0,s.doc)(a.db,"jobs",e)),!0}catch(t){throw console.error("Error deleting job:",t),t}},He=async(e,t)=>{try{return(await(0,s.addDoc)((0,s.collection)(a.db,"projects"),(0,r.A)((0,r.A)({},e),{},{postedBy:t,applications:[],views:0,status:"active",postedDate:(0,s.serverTimestamp)(),updatedAt:(0,s.serverTimestamp)()}))).id}catch(n){throw console.error("Error creating project:",n),n}},Ge=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{let n=(0,s.query)((0,s.collection)(a.db,"projects"),(0,s.where)("status","==","active"),(0,s.orderBy)("postedDate","desc"),(0,s.limit)(e));t.budget&&(n=(0,s.query)(n,(0,s.where)("budgetRange","==",t.budget))),t.timeline&&(n=(0,s.query)(n,(0,s.where)("timeline","==",t.timeline)));return(await(0,s.getDocs)(n)).docs.map(e=>(0,r.A)({id:e.id},e.data()))}catch(n){throw console.error("Error getting projects:",n),n}},Ye=async e=>{try{const n=await(0,s.x7)((0,s.doc)(a.db,"projects",e));if(n.exists()){try{await(0,s.updateDoc)((0,s.doc)(a.db,"projects",e),{views:(0,s.GV)(1)})}catch(t){}return(0,r.A)({id:n.id},n.data())}return null}catch(n){throw console.error("Error getting project:",n),n}},Ke=async(e,t,n)=>{try{return await(0,s.updateDoc)((0,s.doc)(a.db,"projects",e),{applications:(0,s.hq)((0,r.A)((0,r.A)({userId:t},n),{},{appliedAt:(new Date).toISOString(),status:"pending"})),updatedAt:(0,s.serverTimestamp)()}),!0}catch(i){throw console.error("Error applying for project:",i),i}},Je=async(e,t)=>{try{return await(0,s.updateDoc)((0,s.doc)(a.db,"projects",e),{status:"closed",closedAt:(0,s.serverTimestamp)(),closedBy:t,updatedAt:(0,s.serverTimestamp)()}),!0}catch(n){throw console.error("Error closing project:",n),n}},$e=async(e,t)=>{try{return await(0,s.updateDoc)((0,s.doc)(a.db,"projects",e),{status:"archived",archivedAt:(0,s.serverTimestamp)(),archivedBy:t,updatedAt:(0,s.serverTimestamp)()}),!0}catch(n){throw console.error("Error archiving project:",n),n}},Qe=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100;try{const t=(0,s.query)((0,s.collection)(a.db,"projects"),(0,s.orderBy)("postedDate","desc"),(0,s.limit)(e));return(await(0,s.getDocs)(t)).docs.map(e=>(0,r.A)({id:e.id},e.data()))}catch(t){return console.error("Error getting all projects:",t),[]}},Xe=async e=>{try{const t=(0,s.query)((0,s.collection)(a.db,"applications"),(0,s.where)("projectId","==",e)),n=(await(0,s.getDocs)(t)).docs.map(e=>(0,s.kd)(e.ref));return await Promise.all(n),await(0,s.kd)((0,s.doc)(a.db,"projects",e)),!0}catch(t){throw console.error("Error deleting project:",t),t}},Ze=async(e,t)=>{try{return(await(0,s.addDoc)((0,s.collection)(a.db,"forumPosts"),(0,r.A)((0,r.A)({},e),{}
2,{authorId:t,replies:[],likes:[],views:0,createdAt:(0,s.serverTimestamp)(),updatedAt:(0,s.serverTimestamp)()}))).id}catch(n){throw console.error("Error creating forum post:",n),n}},et=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;try{let n;n=t?(0,s.query)((0,s.collection)(a.db,"forumPosts"),(0,s.where)("category","==",t),(0,s.orderBy)("updatedAt","desc"),(0,s.limit)(e)):(0,s.query)((0,s.collection)(a.db,"forumPosts"),(0,s.orderBy)("updatedAt","desc"),(0,s.limit)(e));return(await(0,s.getDocs)(n)).docs.map(e=>(0,r.A)({id:e.id},e.data()))}catch(n){throw console.error("Error getting forum posts:",n),n}},tt=async(e,t)=>{try{return(await(0,s.addDoc)((0,s.collection)(a.db,"groups"),(0,r.A)((0,r.A)({},e),{},{createdBy:t,members:[t],memberCount:1,posts:[],createdAt:(0,s.serverTimestamp)(),updatedAt:(0,s.serverTimestamp)()}))).id}catch(n){throw console.error("Error creating group:",n),n}},nt=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20;try{let t=(0,s.query)((0,s.collection)(a.db,"groups"),(0,s.limit)(e));const n=(await(0,s.getDocs)(t)).docs.map(e=>(0,r.A)({id:e.id},e.data()));return n.sort((e,t)=>(t.memberCount||0)-(e.memberCount||0)),n}catch(t){throw console.error("Error getting groups:",t),t}},rt=async()=>{try{return(await(0,s.getDocs)((0,s.collection)(a.db,"groups"))).docs.map(e=>(0,r.A)({id:e.id},e.data()))}catch(e){throw console.error("Error getting all groups:",e),e}},st=async(e,t)=>{try{return await(0,s.updateDoc)((0,s.doc)(a.db,"groups",e),(0,r.A)((0,r.A)({},t),{},{updatedAt:(0,s.serverTimestamp)()})),!0}catch(n){throw console.error("Error updating group:",n),n}},at=async e=>{try{return await(0,s.kd)((0,s.doc)(a.db,"groups",e)),!0}catch(t){throw console.error("Error deleting group:",t),t}},it=async e=>{try{const t=await(0,s.x7)((0,s.doc)(a.db,"groups",e));if(!t.exists())return[];const n=t.data().members||[];if(0===n.length)return[];const r=n.map(async e=>{try{const t=await(0,s.x7)((0,s.doc)(a.db,"users",e));if(t.exists()){const n=t.data();return{userId:e,name:"".concat(n.firstName||""," ").concat(n.lastName||"").trim(),email:n.email,joinedAt:n.createdAt,role:n.role||"member"}}return null}catch(t){return console.error("Error getting user ".concat(e,":"),t),null}});return(await Promise.all(r)).filter(e=>null!==e)}catch(t){throw console.error("Error getting group members:",t),t}},ot=async e=>{try{console.log("getGroupById called with ID:",e);const t=await(0,s.x7)((0,s.doc)(a.db,"groups",e));if(console.log("Group document exists?",t.exists()),t.exists()){const e=(0,r.A)({id:t.id},t.data());return console.log("Group data found:",e),e}return console.log("No group document found for ID:",e),null}catch(t){throw console.error("Error getting group by ID:",t),t}},lt=async(e,t)=>{try{return await(0,s.updateDoc)((0,s.doc)(a.db,"groups",e),{members:(0,s.C3)(t),memberCount:(0,s.GV)(-1),updatedAt:(0,s.serverTimestamp)()}),!0}catch(n){throw console.error("Error removing user from group:",n),n}},ct=async(e,t)=>{try{const n=he(e.title,{required:!0,maxLength:200,fieldName:"Post Title"});if(!n.isValid)throw new Error(n.error);const i=he(e.content,{required:!0,maxLength:5e3,fieldName:"Post Content"});if(!i.isValid)throw new Error(i.error);return(await(0,s.addDoc)((0,s.collection)(a.db,"groupPosts"),(0,r.A)((0,r.A)({},e),{},{title:n.value,content:i.value,authorId:t,likes:[],likeCount:0,replies:[],commentCount:0,views:0,createdAt:(0,s.serverTimestamp)(),updatedAt:(0,s.serverTimestamp)()}))).id}catch(n){throw console.error("Error creating group post:",n),n}},dt=async e=>{try{const t=(0,s.query)((0,s.collection)(a.db,"groupPosts"),(0,s.where)("groupId","==",e)),n=(await(0,s.getDocs)(t)).docs.map(e=>(0,r.A)({id:e.id},e.data()));return n.sort((e,t)=>{var n,r,s,a;const i=(null===(n=e.createdAt)||void 0===n||null===(r=n.toDate)||void 0===r?void 0:r.call(n))||new Date(e.createdAt||0);return((null===(s=t.createdAt)||void 0===s||null===(a=s.toDate)||void 0===a?void 0:a.call(s))||new Date(t.createdAt||0))-i}),n}catch(t){throw console.error("Error getting group posts:",t),t}},ut=async e=>{try{const t=(0,s.query)((0,s.collection)(a.db,"groupComments"),(0,s.where)("postId","==",e)),n=(await(0,s.getDocs)(t)).docs.map(e=>(0,s.kd)(e.ref));return await Promise.all(n),await(0,s.kd)((0,s.doc)(a.db,"groupPosts",e)),!0}catch(t){throw console.error("Error deleting group post:",t),t}}
2,mt=async(e,t)=>{try{return await(0,s.updateDoc)((0,s.doc)(a.db,"groups",e),{members:(0,s.hq)(t),memberCount:(0,s.GV)(1),updatedAt:(0,s.serverTimestamp)()}),!0}catch(n){throw console.error("Error joining group:",n),n}},ht=async(e,t)=>{try{return await(0,s.updateDoc)((0,s.doc)(a.db,"groups",e),{members:(0,s.C3)(t),memberCount:(0,s.GV)(-1),updatedAt:(0,s.serverTimestamp)()}),!0}catch(n){throw console.error("Error leaving group:",n),n}},pt=async(e,t)=>{try{const n=pe(t.content);if(!n.isValid)throw new Error(n.error);const i=await(0,s.addDoc)((0,s.collection)(a.db,"groupComments"),(0,r.A)((0,r.A)({},t),{},{content:n.value,likes:[],likeCount:0,createdAt:(0,s.serverTimestamp)(),updatedAt:(0,s.serverTimestamp)()}));return await(0,s.updateDoc)((0,s.doc)(a.db,"groupPosts",e),{commentCount:(0,s.GV)(1),updatedAt:(0,s.serverTimestamp)()}),i.id}catch(n){throw console.error("Error adding comment:",n),n}},gt=async e=>{try{console.log("Getting comments for post:",e);const t=(0,s.query)((0,s.collection)(a.db,"groupComments"),(0,s.where)("postId","==",e)),n=(await(0,s.getDocs)(t)).docs.map(e=>(0,r.A)({id:e.id},e.data()));return n.sort((e,t)=>{var n,r,s,a;return((null===(n=e.createdAt)||void 0===n||null===(r=n.toDate)||void 0===r?void 0:r.call(n))||new Date(e.createdAt||0))-((null===(s=t.createdAt)||void 0===s||null===(a=s.toDate)||void 0===a?void 0:a.call(s))||new Date(t.createdAt||0))}),console.log("Found ".concat(n.length," comments for post ").concat(e)),n}catch(t){throw console.error("Error getting comments:",t),t}},ft=async(e,t)=>{try{const n=(0,s.doc)(a.db,"groupPosts",e),r=await(0,s.x7)(n);if(r.exists()){const e=r.data();return(e.likes||[]).includes(t)?(await(0,s.updateDoc)(n,{likes:(0,s.C3)(t),likeCount:(0,s.GV)(-1),updatedAt:(0,s.serverTimestamp)()}),!1):(await(0,s.updateDoc)(n,{likes:(0,s.hq)(t),likeCount:(0,s.GV)(1),updatedAt:(0,s.serverTimestamp)()}),!0)}}catch(n){throw console.error("Error toggling like:",n),n}},xt=async(e,t)=>{try{const n=(0,s.doc)(a.db,"groupComments",e),r=await(0,s.x7)(n);if(r.exists()){const e=r.data();return(e.likes||[]).includes(t)?(await(0,s.updateDoc)(n,{likes:(0,s.C3)(t),likeCount:(0,s.GV)(-1),updatedAt:(0,s.serverTimestamp)()}),!1):(await(0,s.updateDoc)(n,{likes:(0,s.hq)(t),likeCount:(0,s.GV)(1),updatedAt:(0,s.serverTimestamp)()}),!0)}}catch(n){throw console.error("Error toggling comment like:",n),n}},bt=async(e,t,n)=>{try{const i=(0,s.doc)(a.db,"groupComments",e),o=await(0,s.x7)(i);if(!o.exists())return null;const l=(0,r.A)({},o.data().reactions||{});return l[t]===n?delete l[t]:l[t]=n,await(0,s.updateDoc)(i,{reactions:l,updatedAt:(0,s.serverTimestamp)()}),l}catch(i){throw console.error("Error setting comment reaction:",i),i}},yt=async(e,t)=>{try{return await(0,s.kd)((0,s.doc)(a.db,"groupComments",e)),await(0,s.updateDoc)((0,s.doc)(a.db,"groupPosts",t),{commentCount:(0,s.GV)(-1),updatedAt:(0,s.serverTimestamp)()}),!0}catch(n){throw console.error("Error deleting group comment:",n),n}},vt=async e=>{try{await(0,s.updateDoc)((0,s.doc)(a.db,"users",e),{status:"approved",role:"member",memberSince:(0,s.serverTimestamp)(),approvedAt:(0,s.serverTimestamp)(),updatedAt:(0,s.serverTimestamp)()});try{fetch("https://us-central1-the-apn.cloudfunctions.net/engageFounderForMember",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({memberId:e})}).catch(()=>{})}catch(t){}return!0}catch(n){throw console.error("Error approving user:",n),n}},wt=async e=>{try{return await(0,s.updateDoc)((0,s.doc)(a.db,"users",e),{status:"rejected",rejectedAt:(0,s.serverTimestamp)(),updatedAt:(0,s.serverTimestamp)()}),!0}catch(t){throw console.error("Error rejecting user:",t),t}},jt=async()=>{const e={membershipRevenue:0,eventRevenue:0,totalRevenue:0,paidMembers:0,paidEventRegistrations:0,byTier:{}};try{(await(0,s.getDocs)((0,s.collection)(a.db,"memberships"))).forEach(t=>{const n=t.data(),r=Array.isArray(n.paymentHistory)?n.paymentHistory:[];e.membershipRevenue+=r.reduce((e,t)=>e+(Number(t.amount)||0),0),("active"===n.status||r.length>0)&&(e.paidMembers+=1,n.tier&&(e.byTier[n.tier]=(e.byTier[n.tier]||0)+1))})}catch(t){console.warn("getRevenueSummary: memberships read failed",null===t||void 0===t?void 0:t.code)}try{(await(0,s.getDocs)((0,s.collection)(a.db,"eventRegistrations"))).forEac
2h(t=>{const n=t.data();("paid"===n.paymentStatus||Number(n.amount)>0)&&(e.eventRevenue+=Number(n.amount)||0,e.paidEventRegistrations+=1)})}catch(t){console.warn("getRevenueSummary: eventRegistrations read failed",null===t||void 0===t?void 0:t.code)}return e.totalRevenue=e.membershipRevenue+e.eventRevenue,e},Nt=async()=>{try{const e=await(0,s.x7)((0,s.doc)(a.db,"settings","seedContent"));return!!e.exists()&&!!e.data().hidden}catch(e){return console.warn("getSeedContentHidden failed, defaulting to shown:",null===e||void 0===e?void 0:e.code),!1}},kt=async e=>(await(0,s.BN)((0,s.doc)(a.db,"settings","seedContent"),{hidden:!!e,updatedAt:(0,s.serverTimestamp)()},{merge:!0}),!0),At=async e=>{try{await(0,s.kd)((0,s.doc)(a.db,"users",e));try{await(0,s.kd)((0,s.doc)(a.db,"memberships",e))}catch(t){console.log("No membership found for user:",e)}return console.log("User deleted from Firestore:",e),!0}catch(t){throw console.error("Error deleting user from Firestore:",t),t}},St=async e=>{try{const t=(0,s.collection)(a.db,"users"),n=(0,s.query)(t,(0,s.where)("email","==",e)),i=await(0,s.getDocs)(n);if(i.empty)return null;const o=i.docs[0];return(0,r.A)({id:o.id},o.data())}catch(t){throw console.error("Error finding user by email:",t),t}},Et=async()=>{try{const e=(0,s.query)((0,s.collection)(a.db,"users"),(0,s.where)("status","==","pending")),t=(await(0,s.getDocs)(e)).docs.map(e=>(0,r.A)({id:e.id},e.data())),n=e=>{const t=e.createdAt;if(!t)return 0;if("function"===typeof t.toMillis)return t.toMillis();if("number"===typeof t.seconds)return 1e3*t.seconds;const n=new Date(t).getTime();return isNaN(n)?0:n};return t.sort((e,t)=>n(t)-n(e))}catch(e){throw console.error("Error getting pending users:",e),e}},Ct=async()=>{try{const[e,t,n,r]=await Promise.all([(0,s.getDocs)((0,s.collection)(a.db,"users")),(0,s.getDocs)((0,s.collection)(a.db,"jobs")),(0,s.getDocs)((0,s.collection)(a.db,"projects")),(0,s.getDocs)((0,s.collection)(a.db,"events"))]);return{totalUsers:e.size,totalJobs:t.size,totalProjects:n.size,totalEvents:r.size,activeMembers:e.docs.filter(e=>"approved"===e.data().status).length,pendingMembers:e.docs.filter(e=>"pending"===e.data().status).length}}catch(e){throw console.error("Error getting analytics:",e),e}},Tt=async()=>{try{const e=(0,s.doc)(a.db,"users","[email protected]");return await(0,s.updateDoc)(e,{status:"approved",role:"admin",isFoundingMember:!0,isVipMember:!0,memberSince:"January 2020",chapter:"New York",referralCount:10,ambassadorSince:"March 2020",roleStartDate:"January 2020",updatedAt:(0,s.serverTimestamp)()}),console.log("Admin user profile updated successfully"),!0}catch(e){return console.error("Error updating admin user profile:",e),!1}},Pt=async()=>{try{const e=(0,s.query)((0,s.collection)(a.db,"agency_clients"),(0,s.orderBy)("createdAt","desc"));return(await(0,s.getDocs)(e)).docs.map(e=>(0,r.A)({id:e.id},e.data()))}catch(e){throw console.error("Error getting agency clients:",e),e}},_t=async e=>{try{return(await(0,s.addDoc)((0,s.collection)(a.db,"agency_clients"),(0,r.A)((0,r.A)({},e),{},{createdAt:(0,s.serverTimestamp)(),updatedAt:(0,s.serverTimestamp)()}))).id}catch(t){throw console.error("Error creating agency client:",t),t}},It=async(e,t)=>{try{return await(0,s.updateDoc)((0,s.doc)(a.db,"agency_clients",e),(0,r.A)((0,r.A)({},t),{},{updatedAt:(0,s.serverTimestamp)()})),!0}catch(n){throw console.error("Error updating agency client:",n),n}},Dt=async(e,t,n)=>{try{return await(0,s.updateDoc)((0,s.doc)(a.db,"agency_clients",e),{["services.".concat(t)]:n,updatedAt:(0,s.serverTimestamp)()}),!0}catch(r){throw console.error("Error toggling agency client service:",r),r}},Rt=async(e,t)=>{try{return await(0,s.updateDoc)((0,s.doc)(a.db,"agency_clients",e),{tier:t,updatedAt:(0,s.serverTimestamp)()}),!0}catch(n){throw console.error("Error updating agency client tier:",n),n}}},217:(e,t,n)=>{"use strict";n.d(t,{H4:()=>D,oc:()=>R,Fq:()=>L});var r=n(379),s=(n(986),n(43));!function(e){if(!e||"undefined"==typeof document)return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.firstChild?t.insertBefore(n,t.firstChild):t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}(':root{--toastify-color-light: #fff;--toastify-color-dark: #121212;--toastify-color-info: #3498db;--toastify-color-success: #07bc0c;--toastify-color-warning: #f1c40f;--toastify-color-error: hsl(6, 78%, 57%);--toastify-color-transparent: rgba(255, 255, 255, .7);--toastify-icon-color-info: var(--toastify-color-info);--toastify-icon-color-success: var(--toastify-color-success);--toastify-icon-color-warning: var(--toastify-color-warning);--toastify-icon-color-error: var(--toastify-color-error);--toastify-container-width: fit-content;--toastify-toast-width: 320px;--toastify-toast-offset: 16px;--toastify-toast-top: max(var(--toastify-toast-offset), env(safe-area-inset-top));--toastify-toast-right: max(var(--toastify-toast-offset), env(safe-area-inset-right));--toastify-toast-left: max(var(--toastify-toast-offset), env(safe-area-inset-left));--toastify-toast-bottom: max(var(--toastify-toast-offset), env(safe-area-inset-bottom));--toastify-toast-background: #fff;--toastify-toast-padding: 14px;--toastify-toast-min-height: 64px;--toastify-toast-max-height: 800px;--toastify-toast-bd-radius: 6px;--toastify-toast-shadow: 0px 4px 12px rgba(0, 0, 0, .1);--toastify-font-family: sans-serif;--toastify-z-index: 9999;--toastify-text-color-light: #757575;--toastify-text-color-dark: #fff;--toastify-text-color-info: #fff;--toastify-text-color-success: #fff;--toastify-text-color-warning: #fff;--toastify-text-color-error: #fff;--toastify-spinner-color: #616161;--toastify-spinner-color-empty-area: #e0e0e0;--toastify-color-progress-light: linear-gradient(to right, #4cd964, #5ac8fa, #007aff, #34aadc, #5856d6, #ff2d55);--toastify-color-progress-dark: #bb86fc;--toastify-color-progress-info: var(--toastify-color-info);--toastify-color-progress-success: var(--toastify-color-success);--toastify-color-progress-warning: var(--toastify-color-warning);--toastify-color-progress-error: var(--toastify-color-error);--toastify-color-progress-bgo: .2}.Toastify__toast-container{z-index:var(--toastify-z-index);
2-webkit-transform:translate3d(0,0,var(--toastify-z-index));position:fixed;width:var(--toastify-container-width);box-sizing:border-box;color:#fff;display:flex;flex-direction:column}.Toastify__toast-container--top-left{top:var(--toastify-toast-top);left:var(--toastify-toast-left)}.Toastify__toast-container--top-center{top:var(--toastify-toast-top);left:50%;transform:translate(-50%);align-items:center}.Toastify__toast-container--top-right{top:var(--toastify-toast-top);right:var(--toastify-toast-right);align-items:end}.Toastify__toast-container--bottom-left{bottom:var(--toastify-toast-bottom);left:var(--toastify-toast-left)}.Toastify__toast-container--bottom-center{bottom:var(--toastify-toast-bottom);left:50%;transform:translate(-50%);align-items:center}.Toastify__toast-container--bottom-right{bottom:var(--toastify-toast-bottom);right:var(--toastify-toast-right);align-items:end}.Toastify__toast{--y: 0;position:relative;touch-action:none;width:var(--toastify-toast-width);min-height:var(--toastify-toast-min-height);box-sizing:border-box;margin-bottom:1rem;padding:var(--toastify-toast-padding);border-radius:var(--toastify-toast-bd-radius);box-shadow:var(--toastify-toast-shadow);max-height:var(--toastify-toast-max-height);font-family:var(--toastify-font-family);z-index:0;display:flex;flex:1 auto;align-items:center;word-break:break-word}@media only screen and (max-width: 480px){.Toastify__toast-container{width:100vw;left:env(safe-area-inset-left);margin:0}.Toastify__toast-container--top-left,.Toastify__toast-container--top-center,.Toastify__toast-container--top-right{top:env(safe-area-inset-top);transform:translate(0)}.Toastify__toast-container--bottom-left,.Toastify__toast-container--bottom-center,.Toastify__toast-container--bottom-right{bottom:env(safe-area-inset-bottom);transform:translate(0)}.Toastify__toast-container--rtl{right:env(safe-area-inset-right);left:initial}.Toastify__toast{--toastify-toast-width: 100%;margin-bottom:0;border-radius:0}}.Toastify__toast-container[data-stacked=true]{width:var(--toastify-toast-width)}.Toastify__toast--stacked{position:absolute;width:100%;transform:translate3d(0,var(--y),0) scale(var(--s));transition:transform .3s}.Toastify__toast--stacked[data-collapsed] .Toastify__toast-body,.Toastify__toast--stacked[data-collapsed] .Toastify__close-button{transition:opacity .1s}.Toastify__toast--stacked[data-collapsed=false]{overflow:visible}.Toastify__toast--stacked[data-collapsed=true]:not(:last-child)>*{opacity:0}
2.Toastify__toast--stacked:after{content:"";position:absolute;left:0;right:0;height:calc(var(--g) * 1px);bottom:100%}.Toastify__toast--stacked[data-pos=top]{top:0}.Toastify__toast--stacked[data-pos=bot]{bottom:0}.Toastify__toast--stacked[data-pos=bot].Toastify__toast--stacked:before{transform-origin:top}.Toastify__toast--stacked[data-pos=top].Toastify__toast--stacked:before{transform-origin:bottom}.Toastify__toast--stacked:before{content:"";position:absolute;left:0;right:0;bottom:0;height:100%;transform:scaleY(3);z-index:-1}.Toastify__toast--rtl{direction:rtl}.Toastify__toast--close-on-click{cursor:pointer}.Toastify__toast-icon{margin-inline-end:10px;width:22px;flex-shrink:0;display:flex}.Toastify--animate{animation-fill-mode:both;animation-duration:.5s}.Toastify--animate-icon{animation-fill-mode:both;animation-duration:.3s}.Toastify__toast-theme--dark{background:var(--toastify-color-dark);color:var(--toastify-text-color-dark)}.Toastify__toast-theme--light,.Toastify__toast-theme--colored.Toastify__toast--default{background:var(--toastify-color-light);color:var(--toastify-text-color-light)}.Toastify__toast-theme--colored.Toastify__toast--info{color:var(--toastify-text-color-info);background:var(--toastify-color-info)}.Toastify__toast-theme--colored.Toastify__toast--success{color:var(--toastify-text-color-success);background:var(--toastify-color-success)}.Toastify__toast-theme--colored.Toastify__toast--warning{color:var(--toastify-text-color-warning);background:var(--toastify-color-warning)}.Toastify__toast-theme--colored.Toastify__toast--error{color:var(--toastify-text-color-error);background:var(--toastify-color-error)}.Toastify__progress-bar-theme--light{background:var(--toastify-color-progress-light)}.Toastify__progress-bar-theme--dark{background:var(--toastify-color-progress-dark)}.Toastify__progress-bar--info{background:var(--toastify-color-progress-info)}.Toastify__progress-bar--success{background:var(--toastify-color-progress-success)}.Toastify__progress-bar--warning{background:var(--toastify-color-progress-warning)}.Toastify__progress-bar--error{background:var(--toastify-color-progress-error)}.Toastify__progress-bar-theme--colored.Toastify__progress-bar--info,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--success,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--warning,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--error{background:var(--toastify-color-transparent)}.Toastify__close-button{color:#fff;position:absolute;top:6px;right:6px;background:transparent;outline:none;border:none;padding:0;cursor:pointer;opacity:.7;transition:.3s ease;z-index:1}.Toastify__toast--rtl .Toastify__close-button{left:6px;right:unset}.Toastify__close-button--light{color:#000;opacity:.3}.Toastify__close-button>svg{fill:currentColor;height:16px;width:14px}.Toastify__close-button:hover,.Toastify__close-button:focus{opacity:1}@keyframes Toastify__trackProgress{0%{transform:scaleX(1)}to{transform:scaleX(0)}}.Toastify__progress-bar{position:absolute;bottom:0;left:0;width:100%;height:100%;z-index:1;opacity:.7;transform-origin:left}.Toastify__progress-bar--animated{animation:Toastify__trackProgress linear 1 forwards}.Toastify__progress-bar--controlled{transition:transform .2s}.Toastify__progress-bar--rtl{right:0;left:initial;transform-origin:right;border-bottom-left-radius:initial}.Toastify__progress-bar--wrp{position:absolute;overflow:hidden;bottom:0;left:0;width:100%;height:5px;border-bottom-left-radius:var(--toastify-toast-bd-radius);border-bottom-right-radius:var(--toastify-toast-bd-radius)}.Toastify__progress-bar--wrp[data-hidden=true]{opacity:0}.Toastify__progress-bar--bg{opacity:var(--toastify-color-progress-bgo);width:100%;height:100%}.Toastify__spinner{width:20px;height:20px;box-sizing:border-box;border:2px solid;border-radius:100%;border-color:var(--toastify-spinner-color-empty-area);border-right-color:var(--toastify-spinner-color);animation:Toastify__spin .65s linear infinite}@keyframes Toastify__bounceInRight{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(3000px,0,0)}60%{opacity:1;transform:translate3d(-25px,0,0)}75%{transform:translate3d(10px,0,0)}90%{transform:translate3d(-5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutRight{20%{opacity:1;transform:translate3d(-20px,var(--y),0)}to{opacity:0;transform:translate3d(2000px,var(--y),0)}}@keyframes Toastify__bounceInLeft{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(-3000px,0,0)}60%{opacity:1;transform:translate3d(25px,0,0)}75%{transform:translate3d(-10px,0,0)}90%{transform:translate3d(5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutLeft{20%{opacity:1;transform:translate3d(20px,var(--y),0)}to{opacity:0;transform:translate3d(-2000px,var(--y),0)}}@keyframes Toastify__bounceInUp{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,3000px,0)}60%{opacity:1;transform:translate3d(0,-20px,0)}75%{transform:translate3d(0,10px,0)}90%{transform:translate3d(0,-5px,0)}to{transform:translateZ(0)}}@keyframes Toastify__bounceOutUp{20%{transform:translate3d(0,calc(var(--y) - 10px),0)}40%,45%{opacity:1;transform:translate3d(0,calc(var(--y) + 20px),0)}to{opacity:0;transform:translate3d(0,-2000px,0)}}@keyframes Toastify__bounceInDown{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,-3000px,0)}60%{opacity:1;transform:translate3d(0,25px,0)}75%{transform:translate3d(0,-10px,0)}90%{transform:translate3d(0,5px,0)}to{transform:none}}@keyframes Toastify__bounceOutDown{20%{transform:translate3d(0,calc(var(--y) - 10px),0)}40%,45%{opacity:1;transform:translate3d(0,calc(var(--y) + 20px),0)}to{opacity:0;transform:translate3d(0,2000px,0)}}.Toastify__bounce-enter--top-left,.Toastify__bounce-enter--bottom-left{animation-name:Toastify__bounceInLeft}.Toastify__bounce-enter--top-right,.Toastify__bounce-enter--bottom-right{animation-name:Toastify__bounceInRight}.Toastify__bounce-enter--top-center{animation-name:Toastify__bounceInDown}.Toastify__bounce-enter--bottom-center{animation-name:Toastify__bounceInUp}.Toastify__bounce-exit--top-left,.Toastify__bounce-exit--bottom-left{animation-name:Toastify__bounceOutLeft}.Toastify__bounce-exit--top-right,.Toastify__bounce-exit--bottom-right{animation-name:Toastify__bounceOutRight}.Toastify__bounce-exit--top-center{animation-name:Toastify__bounceOutUp}.Toastify__bounce-exit--bottom-center{animation-name:Toastify__bounceOutDown}@keyframes Toastify__zoomIn{0%{opacity:0;transform:scale3d(.3,.3,.3)}50%{opacity:1}}@keyframes Toastify__zoomOut{0%{opacity:1}50%{opacity:0;transform:translate3d(0,var(--y),0) scale3d(.3,.3,.3)}to{opacity:0}
2}.Toastify__zoom-enter{animation-name:Toastify__zoomIn}.Toastify__zoom-exit{animation-name:Toastify__zoomOut}@keyframes Toastify__flipIn{0%{transform:perspective(400px) rotateX(90deg);animation-timing-function:ease-in;opacity:0}40%{transform:perspective(400px) rotateX(-20deg);animation-timing-function:ease-in}60%{transform:perspective(400px) rotateX(10deg);opacity:1}80%{transform:perspective(400px) rotateX(-5deg)}to{transform:perspective(400px)}}@keyframes Toastify__flipOut{0%{transform:translate3d(0,var(--y),0) perspective(400px)}30%{transform:translate3d(0,var(--y),0) perspective(400px) rotateX(-20deg);opacity:1}to{transform:translate3d(0,var(--y),0) perspective(400px) rotateX(90deg);opacity:0}}.Toastify__flip-enter{animation-name:Toastify__flipIn}.Toastify__flip-exit{animation-name:Toastify__flipOut}@keyframes Toastify__slideInRight{0%{transform:translate3d(110%,0,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInLeft{0%{transform:translate3d(-110%,0,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInUp{0%{transform:translate3d(0,110%,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInDown{0%{transform:translate3d(0,-110%,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideOutRight{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(110%,var(--y),0)}}@keyframes Toastify__slideOutLeft{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(-110%,var(--y),0)}}@keyframes Toastify__slideOutDown{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(0,500px,0)}}@keyframes Toastify__slideOutUp{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(0,-500px,0)}}.Toastify__slide-enter--top-left,.Toastify__slide-enter--bottom-left{animation-name:Toastify__slideInLeft}.Toastify__slide-enter--top-right,.Toastify__slide-enter--bottom-right{animation-name:Toastify__slideInRight}.Toastify__slide-enter--top-center{animation-name:Toastify__slideInDown}.Toastify__slide-enter--bottom-center{animation-name:Toastify__slideInUp}.Toastify__slide-exit--top-left,.Toastify__slide-exit--bottom-left{animation-name:Toastify__slideOutLeft;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--top-right,.Toastify__slide-exit--bottom-right{animation-name:Toastify__slideOutRight;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--top-center{animation-name:Toastify__slideOutUp;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--bottom-center{animation-name:Toastify__slideOutDown;animation-timing-function:ease-in;animation-duration:.3s}@keyframes Toastify__spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}\n');var a=e=>"number"==typeof e&&!isNaN(e),i=e=>"string"==typeof e,o=e=>"function"==typeof e,l=e=>(0,s.isValidElement)(e)||i(e)||o(e)||a(e);function c(e){let{enter:t,exit:n,appendPosition:r=!1,collapse:a=!0,collapseDuration:i=300}=e;return function(e){let{children:o,position:l,preventExitTransition:c,done:d,nodeRef:u,isIn:m,playToast:h}=e,p=r?"".concat(t,"--").concat(l):t,g=r?"".concat(n,"--").concat(l):n,f=(0,s.useRef)(0);return(0,s.useLayoutEffect)(()=>{let e=u.current,t=p.split(" "),n=r=>{r.target===u.current&&(h(),e.removeEventListener("animationend",n),e.removeEventListener("animationcancel",n),0===f.current&&"animationcancel"!==r.type&&e.classList.remove(...t))};e.classList.add(...t),e.addEventListener("animationend",n),e.addEventListener("animationcancel",n)},[]),(0,s.useEffect)(()=>{let e=u.current,t=()=>{e.removeEventListener("animationend",t),a?function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:300,{scrollHeight:r,style:s}=e;requestAnimationFrame(()=>{s.minHeight="initial",s.height=r+"px",s.transition="all ".concat(n,"ms"),requestAnimationFrame(()=>{s.height="0",s.padding="0",s.margin="0",setTimeout(t,n)})})}(e,d,i):d()};m||(c?t():(f.current=1,e.className+=" ".concat(g),e.addEventListener("animationend",t)))},[m]),s.createElement(s.Fragment,null,o)}}var d=1,u=()=>"".concat(d++);var m=new Map,h=[],p=new Set,g=()=>m.size>0;function f(e,t){var n;if(t)return!(null==(n=m.get(t))||!n.isToastActive(e));let r=!1;return m.forEach(t=>{t.isToastActive(e)&&(r=!0)}),r}function x(e){if(g()){if(null==e||(e=>i(e)||a(e))(e))m.forEach(t=>{t.removeToast(e)});else if(e&&("containerId"in e||"id"in e)){let t=m.get(e.containerId);t?t.removeToast(e.id):m.forEach(t=>{t.removeToast(e.id)})}}else h=h.filter(t=>null!=e&&t.options.toastId!==e)}function b(e,t){l(e)&&(g()||h.push({content:e,options:t}),m.forEach(n=>
2{n.buildToast(e,t)}))}function y(e,t){m.forEach(n=>{(null==t||null==t||!t.containerId||(null==t?void 0:t.containerId)===n.id)&&n.toggle(e,null==t?void 0:t.id)})}function v(e){return e&&(i(e.toastId)||a(e.toastId))?e.toastId:u()}function w(e,t){return b(e,t),t.toastId}function j(e,t){return(0,r.A)((0,r.A)({},t),{},{type:t&&t.type||e,toastId:v(t)})}function N(e){return(t,n)=>w(t,j(e,n))}function k(e,t){return w(e,j("default",t))}k.loading=(e,t)=>w(e,j("default",(0,r.A)({isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1},t))),k.promise=function(e,t,n){let s,{pending:a,error:l,success:c}=t;a&&(s=i(a)?k.loading(a,n):k.loading(a.render,(0,r.A)((0,r.A)({},n),a)));let d={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},u=(e,t,a)=>{if(null==t)return void k.dismiss(s);let o=(0,r.A)((0,r.A)((0,r.A)({type:e},d),n),{},{data:a}),l=i(t)?{render:t}:t;return s?k.update(s,(0,r.A)((0,r.A)({},o),l)):k(l.render,(0,r.A)((0,r.A)({},o),l)),a},m=o(e)?e():e;return m.then(e=>u("success",c,e)).catch(e=>u("error",l,e)),m},k.success=N("success"),k.info=N("info"),k.error=N("error"),k.warning=N("warning"),k.warn=k.warning,k.dark=(e,t)=>w(e,j("default",(0,r.A)({theme:"dark"},t))),k.dismiss=function(e){x(e)},k.clearWaitingQueue=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};m.forEach(t=>{t.props.limit&&(!e.containerId||t.id===e.containerId)&&t.clearQueue()})},k.isActive=f,k.update=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=((e,t)=>{let{containerId:n}=t;var r;return null==(r=m.get(n||1))?void 0:r.toasts.get(e)})(e,t);if(n){let{props:s,content:a}=n,i=(0,r.A)((0,r.A)((0,r.A)({delay:100},s),t),{},{toastId:t.toastId||e,updateId:u()});i.toastId!==e&&(i.staleId=e);let o=i.render||a;delete i.render,w(o,i)}},k.done=e=>{k.update(e,{progress:1})},k.onChange=function(e){return p.add(e),()=>{p.delete(e)}},k.play=e=>y(!0,e),k.pause=e=>y(!1,e);"undefined"!=typeof window?s.useLayoutEffect:s.useEffect;var A=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return{enter:"Toastify--animate Toastify__".concat(e,"-enter"),exit:"Toastify--animate Toastify__".concat(e,"-exit"),appendPosition:t}};c(A("bounce",!0)),c(A("slide",!0)),c(A("zoom")),c(A("flip"));const S={AUTHENTICATION:"authentication",AUTHORIZATION:"authorization",VALIDATION:"validation",NETWORK:"network",FIREBASE:"firebase",UNKNOWN:"unknown"},E={LOW:"low",MEDIUM:"medium",HIGH:"high",CRITICAL:"critical"},C={"auth/user-not-found":"No account found with this email address.","auth/wrong-password":"Incorrect password. Please try again.","auth/email-already-in-use":"An account with this email already exists.","auth/weak-password":"Password should be at least 6 characters.","auth/invalid-email":"Please enter a valid email address.","auth/user-disabled":"This account has been disabled.","auth/too-many-requests":"Too many failed attempts. Please try again later.","auth/network-request-failed":"Network error. Please check your connection.","auth/requires-recent-login":"Please log out and log back in to continue.","permission-denied":"You do not have permission to perform this action.","not-found":"The requested resource was not found.","already-exists":"This resource already exists.","failed-precondition":"Operation failed due to current system state.","resource-exhausted":"Service temporarily unavailable. Please try again.",unauthenticated:"Please log in to continue.",unavailable:"Service temporarily unavailable. Please try again.","deadline-exceeded":"Request timed out. Please try again.","invalid-argument":"Invalid data provided. Please check your input.","out-of-range":"Value is out of acceptable range.",unimplemented:"This feature is not yet available.",internal:"Internal server error. Please try again later.","data-loss":"Data corruption detected. Please contact support.",cancelled:"Operation was cancelled."},T={ERR_NETWORK:"Network connection failed. Please check your internet connection.",ERR_TIMEOUT:"Request timed out. Please try again.",ERR_BLOCKED:"Request was blocked. Please check your firewall settings.",ERR_FAILED:"Request failed. Please try again later."},P=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:E.MEDIUM;const s={message:e.message,stack:e.stack,code:e.code,timestamp:(new Date).toISOString(),severity:n,context:(0,r.A)({url:window.location.href,userAgent:navigator.userAgent,userId:t.userId||"anonymous",action:t.action||"unknown",component:t.component||"unknown"},t)};n===E.CRITICAL&&console.error("CRITICAL ERROR:",s)},_=e=>{if(!e)return S.UNKNOWN;const t=e.code||"",n=e.message||"";return t.startsWith("auth/")?S.AUTHENTICATION:["permission-denied","unauthenticated"].includes(t)?S.AUTHORIZATION:["invalid-argument","out-of-range","failed-precondition"].includes(t)?S.VALIDATION:t.startsWith("ERR_")||n.includes("network")||n.includes("fetch")?S.NETWORK:t||"FirebaseError"===e.name?S.FIREBASE:S.UNKNOWN},I=e=>{if(!e)return"An unexpected error occurred.";const t=e.code||"",n=e.message||"";if(C[t])return C[t];for(const[r,s]of Object.entries(T))if(t.includes(r)||n.includes(r))return s;switch(_(e)){case S.AUTHENTICATION:return"Authentication failed. Please check your credentials.";case S.AUTHORIZATION:return"You do not have permission to perform this action.";case S.VALIDATION:return"Please check your input and try again.";case S.NETWORK:return"Network error. Please check your connection and try again.";case S.FIREBASE:return"Service temporarily unavailable. Please try again.";default:return"An unexpected error occurred. Please try again."}},D=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{context:n={}
2,showToast:r=!0,toastType:s="error",customMessage:a=null,severity:i=E.MEDIUM,logError:o=!0}=t;o&&P(e,n,i);const l=a||I(e);if(r)switch(s){case"error":default:k.error(l);break;case"warning":k.warning(l);break;case"info":k.info(l)}return{type:_(e),message:l,originalError:e}},R=function(e){k.success(e)},L=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};k.warning(e),P(new Error(e),(0,r.A)((0,r.A)({},t),{},{type:"warning"}),E.LOW)}},288:(e,t)=>{"use strict";var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),h=Symbol.iterator;var p={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,f={};function x(e,t,n){this.props=e,this.context=t,this.refs=f,this.updater=n||p}function b(){}function y(e,t,n){this.props=e,this.context=t,this.refs=f,this.updater=n||p}x.prototype.isReactComponent={},x.prototype.setState=function(e,t){if("object"!==typeof e&&"function"!==typeof e&&null!=e)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},x.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},b.prototype=x.prototype;var v=y.prototype=new b;v.constructor=y,g(v,x.prototype),v.isPureReactComponent=!0;var w=Array.isArray,j={H:null,A:null,T:null,S:null,V:null},N=Object.prototype.hasOwnProperty;function k(e,t,r,s,a,i){return r=i.ref,{$$typeof:n,type:e,key:t,ref:void 0!==r?r:null,props:i}}function A(e){return"object"===typeof e&&null!==e&&e.$$typeof===n}var S=/\/+/g;function E(e,t){return"object"===typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(e){return t[e]})}(""+e.key):t.toString(36)}function C(){}function T(e,t,s,a,i){var o=typeof e;"undefined"!==o&&"boolean"!==o||(e=null);var l,c,d=!1;if(null===e)d=!0;else switch(o){case"bigint":case"string":case"number":d=!0;break;case"object":switch(e.$$typeof){case n:case r:d=!0;break;case m:return T((d=e._init)(e._payload),t,s,a,i)}}if(d)return i=i(e),d=""===a?"."+E(e,0):a,w(i)?(s="",null!=d&&(s=d.replace(S,"$&/")+"/"),T(i,t,s,"",function(e){return e})):null!=i&&(A(i)&&(l=i,c=s+(null==i.key||e&&e.key===i.key?"":(""+i.key).replace(S,"$&/")+"/")+d,i=k(l.type,c,void 0,0,0,l.props)),t.push(i)),1;d=0;var u,p=""===a?".":a+":";if(w(e))for(var g=0;g<e.length;g++)d+=T(a=e[g],t,s,o=p+E(a,g),i);else if("function"===typeof(g=null===(u=e)||"object"!==typeof u?null:"function"===typeof(u=h&&u[h]||u["@@iterator"])?u:null))for(e=g.call(e),g=0;!(a=e.next()).done;)d+=T(a=a.value,t,s,o=p+E(a,g++),i);else if("object"===o){if("function"===typeof e.then)return T(function(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch("string"===typeof e.status?e.then(C,C):(e.status="pending",e.then(function(t){"pending"===e.status&&(e.status="fulfilled",e.value=t)},function(t){"pending"===e.status&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}(e),t,s,a,i);throw t=String(e),Error("Objects are not valid as a React child (found: "+("[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return d}function P(e,t,n){if(null==e)return e;var r=[],s=0;return T(e,r,"","",function(e){return t.call(n,e,s++)}),r}function _(e){if(-1===e._status){var t=e._result;(t=t()).then(function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)},function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)}),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var I="function"===typeof reportError?reportError:function(e){if("object"===typeof window&&"function"===typeof window.ErrorEvent){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:"object"===typeof e&&null!==e&&"string"===typeof e.message?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if("object"===typeof process&&"function"===typeof process.emit)return void process.emit("uncaughtException",e);console.error(e)};function D(){}t.Children={map:P,forEach:function(e,t,n){P(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return P(e,function(){t++}),t},toArray:function(e){return P(e,function(e){return e})||[]},only:function(e){if(!A(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},t.Component=x,t.Fragment=s,t.Profiler=i,t.PureComponent=y,t.StrictMode=a,t.Suspense=
2d,t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=j,t.__COMPILER_RUNTIME={__proto__:null,c:function(e){return j.H.useMemoCache(e)}},t.cache=function(e){return function(){return e.apply(null,arguments)}},t.cloneElement=function(e,t,n){if(null===e||void 0===e)throw Error("The argument must be a React element, but you passed "+e+".");var r=g({},e.props),s=e.key;if(null!=t)for(a in void 0!==t.ref&&void 0,void 0!==t.key&&(s=""+t.key),t)!N.call(t,a)||"key"===a||"__self"===a||"__source"===a||"ref"===a&&void 0===t.ref||(r[a]=t[a]);var a=arguments.length-2;if(1===a)r.children=n;else if(1<a){for(var i=Array(a),o=0;o<a;o++)i[o]=arguments[o+2];r.children=i}return k(e.type,s,void 0,0,0,r)},t.createContext=function(e){return(e={$$typeof:l,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider=e,e.Consumer={$$typeof:o,_context:e},e},t.createElement=function(e,t,n){var r,s={},a=null;if(null!=t)for(r in void 0!==t.key&&(a=""+t.key),t)N.call(t,r)&&"key"!==r&&"__self"!==r&&"__source"!==r&&(s[r]=t[r]);var i=arguments.length-2;if(1===i)s.children=n;else if(1<i){for(var o=Array(i),l=0;l<i;l++)o[l]=arguments[l+2];s.children=o}if(e&&e.defaultProps)for(r in i=e.defaultProps)void 0===s[r]&&(s[r]=i[r]);return k(e,a,void 0,0,0,s)},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:c,render:e}},t.isValidElement=A,t.lazy=function(e){return{$$typeof:m,_payload:{_status:-1,_result:e},_init:_}},t.memo=function(e,t){return{$$typeof:u,type:e,compare:void 0===t?null:t}},t.startTransition=function(e){var t=j.T,n={};j.T=n;try{var r=e(),s=j.S;null!==s&&s(n,r),"object"===typeof r&&null!==r&&"function"===typeof r.then&&r.then(D,I)}catch(a){I(a)}finally{j.T=t}},t.unstable_useCacheRefresh=function(){return j.H.useCacheRefresh()},t.use=function(e){return j.H.use(e)},t.useActionState=function(e,t,n){return j.H.useActionState(e,t,n)},t.useCallback=function(e,t){return j.H.useCallback(e,t)},t.useContext=function(e){return j.H.useContext(e)},t.useDebugValue=function(){},t.useDeferredValue=function(e,t){return j.H.useDeferredValue(e,t)},t.useEffect=function(e,t,n){var r=j.H;if("function"===typeof n)throw Error("useEffect CRUD overload is not enabled in this build of React.");return r.useEffect(e,t)},t.useId=function(){return j.H.useId()},t.useImperativeHandle=function(e,t,n){return j.H.useImperativeHandle(e,t,n)},t.useInsertionEffect=function(e,t){return j.H.useInsertionEffect(e,t)},t.useLayoutEffect=function(e,t){return j.H.useLayoutEffect(e,t)},t.useMemo=function(e,t){return j.H.useMemo(e,t)},t.useOptimistic=function(e,t){return j.H.useOptimistic(e,t)},t.useReducer=function(e,t,n){return j.H.useReducer(e,t,n)},t.useRef=function(e){return j.H.useRef(e)},t.useState=function(e){return j.H.useState(e)},t.useSyncExternalStore=function(e,t,n){return j.H.useSyncExternalStore(e,t,n)},t.useTransition=function(){return j.H.useTransition()},t.version="19.1.0"},324:e=>{e.exports=function(e,t,n,r){var s=n?n.call(r,e,t):void 0;if(void 0!==s)return!!s;if(e===t)return!0;if("object"!==typeof e||!e||"object"!==typeof t||!t)return!1;var a=Object.keys(e),i=Object.keys(t);if(a.length!==i.length)return!1;for(var o=Object.prototype.hasOwnProperty.bind(t),l=0;l<a.length;l++){var c=a[l];if(!o(c))return!1;var d=e[c],u=t[c];if(!1===(s=n?n.call(r,d,u,c):void 0)||void 0===s&&d!==u)return!1}return!0}},362:(e,t,n)=>{"use strict";n.d(t,{HF:()=>Xe,F0:()=>kt,eJ:()=>ht,hG:()=>yt,xI:()=>qn,hg:()=>xt,J1:()=>mt,oM:()=>ft,x9:()=>pt,df:()=>rn,CI:()=>bt,r7:()=>gt});var r=n(150),s=n(529),a=n(443);function i(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var s=0;for(r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]])}return n}Object.create;Object.create;"function"===typeof SuppressedError&&SuppressedError;var o=n(812);function l(){return{"dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}}const c=l,d=new s.FA("auth","Firebase",{"dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}),u=new a.Vy("@firebase/auth");function m(e){if(u.logLevel<=a.$b.ERROR){for(var t=arguments.length,n=new Array(t>1?t-1:0),s=1;s<t;s++)n[s-1]=arguments[s];u.error("Auth (".concat(r.MF,"): ").concat(e),...n)}}function h(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];throw b(e,...n)}function p(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return b(e,...n)}function g(e,t,n){const r=Object.assign(Object.assign({},c()),{[t]:n});
2return new s.FA("auth","Firebase",r).create(t,{appName:e.name})}function f(e){return g(e,"operation-not-supported-in-this-environment","Operations that alter the current user are not supported in conjunction with FirebaseServerApp")}function x(e,t,n){if(!(t instanceof n))throw n.name!==t.constructor.name&&h(e,"argument-error"),g(e,"argument-error","Type of ".concat(t.constructor.name," does not match expected instance.")+"Did you pass a reference from a different Auth SDK?")}function b(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];if("string"!==typeof e){const t=n[0],r=[...n.slice(1)];return r[0]&&(r[0].appName=e.name),e._errorFactory.create(t,...r)}return d.create(e,...n)}function y(e,t){if(!e){for(var n=arguments.length,r=new Array(n>2?n-2:0),s=2;s<n;s++)r[s-2]=arguments[s];throw b(t,...r)}}function v(e){const t="INTERNAL ASSERTION FAILED: "+e;throw m(t),new Error(t)}function w(e,t){e||v(t)}function j(){var e;return"undefined"!==typeof self&&(null===(e=self.location)||void 0===e?void 0:e.href)||""}function N(){return"http:"===k()||"https:"===k()}function k(){var e;return"undefined"!==typeof self&&(null===(e=self.location)||void 0===e?void 0:e.protocol)||null}class A{constructor(e,t){this.shortDelay=e,this.longDelay=t,w(t>e,"Short delay should be less than long delay!"),this.isMobile=(0,s.jZ)()||(0,s.lV)()}get(){return"undefined"!==typeof navigator&&navigator&&"onLine"in navigator&&"boolean"===typeof navigator.onLine&&(N()||(0,s.sr)()||"connection"in navigator)&&!navigator.onLine?Math.min(5e3,this.shortDelay):this.isMobile?this.longDelay:this.shortDelay}}function S(e,t){w(e.emulator,"Emulator should always be set here");const{url:n}=e.emulator;return t?"".concat(n).concat(t.startsWith("/")?t.slice(1):t):n}class E{static initialize(e,t,n){this.fetchImpl=e,t&&(this.headersImpl=t),n&&(this.responseImpl=n)}static fetch(){return this.fetchImpl?this.fetchImpl:"undefined"!==typeof self&&"fetch"in self?self.fetch:"undefined"!==typeof globalThis&&globalThis.fetch?globalThis.fetch:"undefined"!==typeof fetch?fetch:void v("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static headers(){return this.headersImpl?this.headersImpl:"undefined"!==typeof self&&"Headers"in self?self.Headers:"undefined"!==typeof globalThis&&globalThis.Headers?globalThis.Headers:"undefined"!==typeof Headers?Headers:void v("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static response(){return this.responseImpl?this.responseImpl:"undefined"!==typeof self&&"Response"in self?self.Response:"undefined"!==typeof globalThis&&globalThis.Response?globalThis.Response:"undefined"!==typeof Response?Response:void v("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}const C={CREDENTIAL_MISMATCH:"custom-token-mismatch",MISSING_CUSTOM_TOKEN:"internal-error",INVALID_IDENTIFIER:"invalid-email",MISSING_CONTINUE_URI:"internal-error",INVALID_PASSWORD:"wrong-password",MISSING_PASSWORD:"missing-password",INVALID_LOGIN_CREDENTIALS:"invalid-credential",EMAIL_EXISTS:"email-already-in-use",PASSWORD_LOGIN_DISABLED:"operation-not-allowed",INVALID_IDP_RESPONSE:"invalid-credential",INVALID_PENDING_TOKEN:"invalid-credential",FEDERATED_USER_ID_ALREADY_LINKED:"credential-already-in-use",MISSING_REQ_TYPE:"internal-error",EMAIL_NOT_FOUND:"user-not-found",RESET_PASSWORD_EXCEED_LIMIT:"too-many-requests",EXPIRED_OOB_CODE:"expired-action-code",INVALID_OOB_CODE:"invalid-action-code",MISSING_OOB_CODE:"internal-error",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"requires-recent-login",INVALID_ID_TOKEN:"invalid-user-token",TOKEN_EXPIRED:"user-token-expired",USER_NOT_FOUND:"user-token-expired",TOO_MANY_ATTEMPTS_TRY_LATER:"too-many-requests",PASSWORD_DOES_NOT_MEET_REQUIREMENTS:"password-does-not-meet-requirements",INVALID_CODE:"invalid-verification-code",INVALID_SESSION_INFO:"invalid-verification-id",INVALID_TEMPORARY_PROOF:"invalid-credential",MISSING_SESSION_INFO:"missing-verification-id",SESSION_EXPIRED:"code-expired",MISSING_ANDROID_PACKAGE_NAME:"missing-android-pkg-name",UNAUTHORIZED_DOMAIN:"unauthorized-continue-uri",INVALID_OAUTH_CLIENT_ID:"invalid-oauth-client-id",ADMIN_ONLY_OPERATION:"admin-restricted-operation",INVALID_MFA_PENDING_CREDENTIAL:"invalid-multi-factor-session",MFA_ENROLLMENT_NOT_FOUND:"multi-factor-info-not-found",MISSING_MFA_ENROLLMENT_ID:"missing-multi-factor-info",MISSING_MFA_PENDING_CREDENTIAL:"missing-multi-factor-session",SECOND_FACTOR_EXISTS:"second-factor-already-in-use",SECOND_FACTOR_LIMIT_EXCEEDED:"maximum-second-factor-count-exceeded",BLOCKING_FUNCTION_ERROR_RESPONSE:"internal-error",RECAPTCHA_NOT_ENABLED:"recaptcha-not-enabled",MISSING_RECAPTCHA_TOKEN:"missing-rec
2aptcha-token",INVALID_RECAPTCHA_TOKEN:"invalid-recaptcha-token",INVALID_RECAPTCHA_ACTION:"invalid-recaptcha-action",MISSING_CLIENT_TYPE:"missing-client-type",MISSING_RECAPTCHA_VERSION:"missing-recaptcha-version",INVALID_RECAPTCHA_VERSION:"invalid-recaptcha-version",INVALID_REQ_TYPE:"invalid-req-type"},T=["/v1/accounts:signInWithCustomToken","/v1/accounts:signInWithEmailLink","/v1/accounts:signInWithIdp","/v1/accounts:signInWithPassword","/v1/accounts:signInWithPhoneNumber","/v1/token"],P=new A(3e4,6e4);function _(e,t){return e.tenantId&&!t.tenantId?Object.assign(Object.assign({},t),{tenantId:e.tenantId}):t}async function I(e,t,n,r){return D(e,arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},async()=>{let a={},i={};r&&("GET"===t?i=r:a={body:JSON.stringify(r)});const o=(0,s.Am)(Object.assign({key:e.config.apiKey},i)).slice(1),l=await e._getAdditionalHeaders();l["Content-Type"]="application/json",e.languageCode&&(l["X-Firebase-Locale"]=e.languageCode);const c=Object.assign({method:t,headers:l},a);return(0,s.c1)()||(c.referrerPolicy="no-referrer"),E.fetch()(await L(e,e.config.apiHost,n,o),c)})}async function D(e,t,n){e._canInitEmulator=!1;const r=Object.assign(Object.assign({},C),t);try{const t=new O(e),s=await Promise.race([n(),t.promise]);t.clearNetworkTimeout();const a=await s.json();if("needConfirmation"in a)throw F(e,"account-exists-with-different-credential",a);if(s.ok&&!("errorMessage"in a))return a;{const t=s.ok?a.errorMessage:a.error.message,[n,i]=t.split(" : ");if("FEDERATED_USER_ID_ALREADY_LINKED"===n)throw F(e,"credential-already-in-use",a);if("EMAIL_EXISTS"===n)throw F(e,"email-already-in-use",a);if("USER_DISABLED"===n)throw F(e,"user-disabled",a);const o=r[n]||n.toLowerCase().replace(/[_\s]+/g,"-");if(i)throw g(e,o,i);h(e,o)}}catch(a){if(a instanceof s.g)throw a;h(e,"network-request-failed",{message:String(a)})}}async function R(e,t,n,r){let s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};const a=await I(e,t,n,r,s);return"mfaPendingCredential"in a&&h(e,"multi-factor-auth-required",{_serverResponse:a}),a}async function L(e,t,n,r){const s="".concat(t).concat(n,"?").concat(r),a=e,i=a.config.emulator?S(e.config,s):"".concat(e.config.apiScheme,"://").concat(s);if(T.includes(n)&&(await a._persistenceManagerAvailable,"COOKIE"===a._getPersistenceType())){return a._getPersistence()._getFinalTarget(i).toString()}return i}function M(e){switch(e){case"ENFORCE":return"ENFORCE";case"AUDIT":return"AUDIT";case"OFF":return"OFF";default:return"ENFORCEMENT_STATE_UNSPECIFIED"}}class O{clearNetworkTimeout(){clearTimeout(this.timer)}constructor(e){this.auth=e,this.timer=null,this.promise=new Promise((e,t)=>{this.timer=setTimeout(()=>t(p(this.auth,"network-request-failed")),P.get())})}}function F(e,t,n){const r={appName:e.name};n.email&&(r.email=n.email),n.phoneNumber&&(r.phoneNumber=n.phoneNumber);const s=p(e,t,r);return s.customData._tokenResponse=n,s}function U(e){return void 0!==e&&void 0!==e.enterprise}class B{constructor(e){if(this.siteKey="",this.recaptchaEnforcementState=[],void 0===e.recaptchaKey)throw new Error("recaptchaKey undefined");this.siteKey=e.recaptchaKey.split("/")[3],this.recaptchaEnforcementState=e.recaptchaEnforcementState}getProviderEnforcementState(e){if(!this.recaptchaEnforcementState||0===this.recaptchaEnforcementState.length)return null;for(const t of this.recaptchaEnforcementState)if(t.provider&&t.provider===e)return M(t.enforcementState);return null}isProviderEnabled(e){return"ENFORCE"===this.getProviderEnforcementState(e)||"AUDIT"===this.getProviderEnforcementState(e)}isAnyProviderEnabled(){return this.isProviderEnabled("EMAIL_PASSWORD_PROVIDER")||this.isProviderEnabled("PHONE_PROVIDER")}}async function z(e,t){return I(e,"GET","/v2/recaptchaConfig",_(e,t))}async function V(e,t){return I(e,"POST","/v1/accounts:lookup",t)}function q(e){if(e)try{const t=new Date(Number(e));if(!isNaN(t.getTime()))return t.toUTCString()}catch(t){}}function W(e){return 1e3*Number(e)}function H(e){const[t,n,r]=e.split(".");if(void 0===t||void 0===n||void 0===r)return m("JWT malformed, contained fewer than 3 sections"),null;try{const e=(0,s.u)(n);return e?JSON.parse(e):(m("Failed to decode base64 JWT payload"),null)}catch(a){return m("Caught error parsing JWT payload as JSON",null===a||void 0===a?void 0:a.toString()),null}}function G(e){const t=H(e);return y(t,"internal-error"),y("undefined"!==typeof t.exp,"internal-error"),y("undefined"!==typeof t.iat,"internal-error"),Number(t.exp)-Number(t.iat)}async function Y(e,t){if(arguments.length>2&&void 0!==arguments[2]&&arguments[2])return t;try{return await t}
2catch(n){throw n instanceof s.g&&function(e){let{code:t}=e;return t==="auth/".concat("user-disabled")||t==="auth/".concat("user-token-expired")}(n)&&e.auth.currentUser===e&&await e.auth.signOut(),n}}class K{constructor(e){this.user=e,this.isRunning=!1,this.timerId=null,this.errorBackoff=3e4}_start(){this.isRunning||(this.isRunning=!0,this.schedule())}_stop(){this.isRunning&&(this.isRunning=!1,null!==this.timerId&&clearTimeout(this.timerId))}getInterval(e){var t;if(e){const e=this.errorBackoff;return this.errorBackoff=Math.min(2*this.errorBackoff,96e4),e}{this.errorBackoff=3e4;const e=(null!==(t=this.user.stsTokenManager.expirationTime)&&void 0!==t?t:0)-Date.now()-3e5;return Math.max(0,e)}}schedule(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.isRunning)return;const t=this.getInterval(e);this.timerId=setTimeout(async()=>{await this.iteration()},t)}async iteration(){try{await this.user.getIdToken(!0)}catch(e){return void((null===e||void 0===e?void 0:e.code)==="auth/".concat("network-request-failed")&&this.schedule(!0))}this.schedule()}}class J{constructor(e,t){this.createdAt=e,this.lastLoginAt=t,this._initializeTime()}_initializeTime(){this.lastSignInTime=q(this.lastLoginAt),this.creationTime=q(this.createdAt)}_copy(e){this.createdAt=e.createdAt,this.lastLoginAt=e.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}async function $(e){var t;const n=e.auth,r=await e.getIdToken(),s=await Y(e,V(n,{idToken:r}));y(null===s||void 0===s?void 0:s.users.length,n,"internal-error");const a=s.users[0];e._notifyReloadListener(a);const i=(null===(t=a.providerUserInfo)||void 0===t?void 0:t.length)?Q(a.providerUserInfo):[],o=(l=e.providerData,c=i,[...l.filter(e=>!c.some(t=>t.providerId===e.providerId)),...c]);var l,c;const d=e.isAnonymous,u=!(e.email&&a.passwordHash)&&!(null===o||void 0===o?void 0:o.length),m=!!d&&u,h={uid:a.localId,displayName:a.displayName||null,photoURL:a.photoUrl||null,email:a.email||null,emailVerified:a.emailVerified||!1,phoneNumber:a.phoneNumber||null,tenantId:a.tenantId||null,providerData:o,metadata:new J(a.createdAt,a.lastLoginAt),isAnonymous:m};Object.assign(e,h)}function Q(e){return e.map(e=>{var{providerId:t}=e,n=i(e,["providerId"]);return{providerId:t,uid:n.rawId||"",displayName:n.displayName||null,email:n.email||null,phoneNumber:n.phoneNumber||null,photoURL:n.photoUrl||null}})}class X{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(e){y(e.idToken,"internal-error"),y("undefined"!==typeof e.idToken,"internal-error"),y("undefined"!==typeof e.refreshToken,"internal-error");const t="expiresIn"in e&&"undefined"!==typeof e.expiresIn?Number(e.expiresIn):G(e.idToken);this.updateTokensAndExpiration(e.idToken,e.refreshToken,t)}updateFromIdToken(e){y(0!==e.length,"internal-error");const t=G(e);this.updateTokensAndExpiration(e,null,t)}async getToken(e){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]||!this.accessToken||this.isExpired?(y(this.refreshToken,e,"user-token-expired"),this.refreshToken?(await this.refresh(e,this.refreshToken),this.accessToken):null):this.accessToken}clearRefreshToken(){this.refreshToken=null}async refresh(e,t){const{accessToken:n,refreshToken:r,expiresIn:a}=await async function(e,t){const n=await D(e,{},async()=>{const n=(0,s.Am)({grant_type:"refresh_token",refresh_token:t}).slice(1),{tokenApiHost:r,apiKey:a}=e.config,i=await L(e,r,"/v1/token","key=".concat(a)),o=await e._getAdditionalHeaders();return o["Content-Type"]="application/x-www-form-urlencoded",E.fetch()(i,{method:"POST",headers:o,body:n})});return{accessToken:n.access_token,expiresIn:n.expires_in,refreshToken:n.refresh_token}}(e,t);this.updateTokensAndExpiration(n,r,Number(a))}updateTokensAndExpiration(e,t,n){this.refreshToken=t||null,this.accessToken=e||null,this.expirationTime=Date.now()+1e3*n}static fromJSON(e,t){const{refreshToken:n,accessToken:r,expirationTime:s}=t,a=new X;return n&&(y("string"===typeof n,"internal-error",{appName:e}),a.refreshToken=n),r&&(y("string"===typeof r,"internal-error",{appName:e}),a.accessToken=r),s&&(y("number"===typeof s,"internal-error",{appName:e}),a.expirationTime=s),a}toJSON(){return{refreshToken:this.refreshToken,accessToken:this.accessToken,expirationTime:this.expirationTime}}_assign(e){this.accessToken=e.accessToken,this.refreshToken=e.refreshToken,this.expirationTime=e.expirationTime}_clone(){return Object.assign(new X,this.toJSON())}_performRefresh(){return v("not implemented")}}function Z(e,t){y("string"===typeof e||"undefined"===typeof e,"internal-error",{appName:t})}class ee{constructor(e){var{uid:t,auth:n,stsTokenManager:r}=e,s=i(e,["uid","auth","stsTokenManager"]);this.providerId="firebase",this.proactiveRefresh=new K(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=t,this.auth=n,this.stsTokenManager=r,this.accessToken=r.accessToken,this.displayName=s.displayName||null,this.email=s.email||null,this.emailVerified=s.emailVerified||!1,this.phoneNumber=s.phoneNumber||null,this.photoURL=s.photoURL||null,this.isAnonymous=s.isAnonymous||!1,this.tenantId=s.tenantId||null,this.providerData=s.providerData?[...s.providerData]:[],this.metadata=new J(s.createdAt||void 0,s.lastLoginAt||void 0)}async getIdToken(e){const t=await Y(this,this.stsTokenManager.getToken(this.auth,e));return y(t,this.auth,"internal-error"),this.accessToken!==t&&(this.accessToken=t,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),t}getIdTokenResult(e){return async function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=(0,s.Ku)(e),r=await n.getIdToken(t),a=H(r);y(a&&a.exp&&a.auth_time&&a.iat,n.auth,"internal-error");const i="object"===typeof a.firebase?a.firebase:void 0,o=null===i||void 0===i?void 0:i.sign_in_provider;return{claims:a,token:r,authTime:q(W(a.auth_time)),issuedAtTime:q(W(a.iat)),expirationTime:q(W(a.exp)),signInProvider:o||null,signInSecondFactor:(null===i||void 0===i?void 0:i.sign_in_second_factor)||null}}(this,e)}reload(){return async function(e){const t=(0,s.Ku)(e);await $(t),await t.auth._persistUserIfCurrent(t),t.auth._notifyListenersIfCurrent(t)}(this)}_assign(e){this!==e&&(y(this.uid===e.uid,this.auth,"internal-error"),this.displayName=e.displayName,this.photoURL=e.ph
2otoURL,this.email=e.email,this.emailVerified=e.emailVerified,this.phoneNumber=e.phoneNumber,this.isAnonymous=e.isAnonymous,this.tenantId=e.tenantId,this.providerData=e.providerData.map(e=>Object.assign({},e)),this.metadata._copy(e.metadata),this.stsTokenManager._assign(e.stsTokenManager))}_clone(e){const t=new ee(Object.assign(Object.assign({},this),{auth:e,stsTokenManager:this.stsTokenManager._clone()}));return t.metadata._copy(this.metadata),t}_onReload(e){y(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=e,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(e){this.reloadListener?this.reloadListener(e):this.reloadUserInfo=e}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}async _updateTokensIfNecessary(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=!1;e.idToken&&e.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(e),n=!0),t&&await $(this),await this.auth._persistUserIfCurrent(this),n&&this.auth._notifyListenersIfCurrent(this)}async delete(){if((0,r.xZ)(this.auth.app))return Promise.reject(f(this.auth));const e=await this.getIdToken();return await Y(this,async function(e,t){return I(e,"POST","/v1/accounts:delete",t)}(this.auth,{idToken:e})),this.stsTokenManager.clearRefreshToken(),this.auth.signOut()}toJSON(){return Object.assign(Object.assign({uid:this.uid,email:this.email||void 0,emailVerified:this.emailVerified,displayName:this.displayName||void 0,isAnonymous:this.isAnonymous,photoURL:this.photoURL||void 0,phoneNumber:this.phoneNumber||void 0,tenantId:this.tenantId||void 0,providerData:this.providerData.map(e=>Object.assign({},e)),stsTokenManager:this.stsTokenManager.toJSON(),_redirectEventId:this._redirectEventId},this.metadata.toJSON()),{apiKey:this.auth.config.apiKey,appName:this.auth.name})}get refreshToken(){return this.stsTokenManager.refreshToken||""}static _fromJSON(e,t){var n,r,s,a,i,o,l,c;const d=null!==(n=t.displayName)&&void 0!==n?n:void 0,u=null!==(r=t.email)&&void 0!==r?r:void 0,m=null!==(s=t.phoneNumber)&&void 0!==s?s:void 0,h=null!==(a=t.photoURL)&&void 0!==a?a:void 0,p=null!==(i=t.tenantId)&&void 0!==i?i:void 0,g=null!==(o=t._redirectEventId)&&void 0!==o?o:void 0,f=null!==(l=t.createdAt)&&void 0!==l?l:void 0,x=null!==(c=t.lastLoginAt)&&void 0!==c?c:void 0,{uid:b,emailVerified:v,isAnonymous:w,providerData:j,stsTokenManager:N}=t;y(b&&N,e,"internal-error");const k=X.fromJSON(this.name,N);y("string"===typeof b,e,"internal-error"),Z(d,e.name),Z(u,e.name),y("boolean"===typeof v,e,"internal-error"),y("boolean"===typeof w,e,"internal-error"),Z(m,e.name),Z(h,e.name),Z(p,e.name),Z(g,e.name),Z(f,e.name),Z(x,e.name);const A=new ee({uid:b,auth:e,email:u,emailVerified:v,displayName:d,isAnonymous:w,photoURL:h,phoneNumber:m,tenantId:p,stsTokenManager:k,createdAt:f,lastLoginAt:x});return j&&Array.isArray(j)&&(A.providerData=j.map(e=>Object.assign({},e))),g&&(A._redirectEventId=g),A}static async _fromIdTokenResponse(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=new X;r.updateFromServerResponse(t);const s=new ee({uid:t.localId,auth:e,stsTokenManager:r,isAnonymous:n});return await $(s),s}static async _fromGetAccountInfoResponse(e,t,n){const r=t.users[0];y(void 0!==r.localId,"internal-error");const s=void 0!==r.providerUserInfo?Q(r.providerUserInfo):[],a=!(r.email&&r.passwordHash)&&!(null===s||void 0===s?void 0:s.length),i=new X;i.updateFromIdToken(n);const o=new ee({uid:r.localId,auth:e,stsTokenManager:i,isAnonymous:a}),l={uid:r.localId,displayName:r.displayName||null,photoURL:r.photoUrl||null,email:r.email||null,emailVerified:r.emailVerified||!1,phoneNumber:r.phoneNumber||null,tenantId:r.tenantId||null,providerData:s,metadata:new J(r.createdAt,r.lastLoginAt),isAnonymous:!(r.email&&r.passwordHash)&&!(null===s||void 0===s?void 0:s.length)};return Object.assign(o,l),o}}const te=new Map;function ne(e){w(e instanceof Function,"Expected a class definition");let t=te.get(e);return t?(w(t instanceof e,"Instance stored in cache mismatched with class"),t):(t=new e,te.set(e,t),t)}class re{constructor(){this.type="NONE",this.storage={}}async _isAvailable(){return!0}async _set(e,t){this.storage[e]=t}async _get(e){const t=this.storage[e];return void 0===t?null:t}async _remove(e){delete this.storage[e]}_addListener(e,t){}_removeListener(e,t){}}re.type="NONE";const se=re;function ae(e,t,n){return"firebase".concat(":",e,":").concat(t,":").concat(n)}class ie{constructor(e,t,n){this.persistence=e,this.auth=t,this.userKey=n;const{config:r,name:s}=this.auth;this.fullUserKey=ae(this.userKey,r.apiKey,s),this.fullPersistenceKey=ae("persistence",r.apiKey,s),this.boundEventHandler=t._onStorageEvent.bind(t),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}setCurrentUser(e){return this.persistence._set(this.fullUserKey,e.toJSON())}async getCurrentUser(){const e=await this.persistence._get(this.fullUserKey);if(!e)return null;if("string"===typeof e){const t=await V(this.auth,{idToken:e}).catch(()=>{});return t?ee._fromGetAccountInfoResponse(this.auth,t,e):null}return ee._fromJSON(this.auth,e)}removeCurrentUser(){return this.persistence._remove(this.fullUserKey)}savePersistenceForRedirect(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}async setPersistence(e){if(this.persistence===e)return;const t=await this.getCurrentUser();return await this.removeCurrentUser(),this.persistence=e,t?this.setCurrentUser(t):void 0}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static async create(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"authUser";if(!t.length)return new ie(ne(se),e,n);const r=(await Promise.all(t.map(async e=>{if(await e._isAvailable())return e}))).filter(e=>e);let s=r[0]||ne(se);const a=ae(n,e.config.apiKey,e.name);let i=null;for(const c of t)try{const t=await c._get(a);if(t){let n;if("string"===typeof t){const r=await V(e,{idToken:t}).catch(()=>{});if(!r)break;n=await ee._fromGetAccountInfoResponse(e,r,t)}else n=ee._fromJSON(e,t);c!==s&&(i=n),s=c;break}}catch(l){}const o=r.filter(e=>e._shouldAllowMigration);return s._shouldAllowMigration&&o.length?(s=o[0],i&&await s._set(a,i.toJSON()),await Promise.all(t.map(async e=>{if(e!==s)try{await e._remove(a)}catch(l){}})),new ie(s,e,n)):new ie(s,e,n)}}function oe(e){const t=e.toLowerCase();if(t.includes("opera/")||t.includes("opr/")||t.includes("opios/"))return"Opera";if(ue(t))return"IEMobile";if(t.includes("msie")||t.includes("trident/"))return"IE";if(t.includes("edge/"))return"Edge";if(le(t))return"Firefox";if(t.includes("silk/"))return"Silk";if(he(t))return"Blackberry";if(pe(t))return"Webos";if(ce(t))return"Safari";if((t.includes("chrome/")||de(t))&&!t.includes("edge/"))return"Chrome";if(me(t))return"Android";{const t=/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/,n=e.match(t);if(2===(null===n||void 0===n?void 0:n.length))return n[1]}return"Other"}function le(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:(0,s.ZQ)();return/firefox\//i.test(e)}function ce(){const e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:(0,s.ZQ)()).toLowerCase();return e.includes("safari/")&&!e.includes("chrome/")&&!e.includes("crios/")&&!e.includes("android")}function de(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:(0,s.ZQ)();return/crios\//i.test(e)}function ue(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:(0,s.ZQ)();return/iemobile/i.test(e)}function me(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:(0,s.ZQ)();return/android/i.test(e)}function he(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:(0,s.ZQ)();return/blackberry/i.test(e)}function pe(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:(0,s.ZQ)();return/webos/i.test(e)}function ge(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:(0,s.ZQ)();return/iphone|ipad|ipod/i.test(e)||/macintosh/i.test(e)&&/mobile/i.test(e)}function fe(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:(0,s.ZQ)();return ge(e)||me(e)||pe(e)||he(e)||/windows phone/i.test(e)||ue(e)}function xe(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];switch(e){case"Browser":t=oe((0,s.ZQ)());break;case"Worker":t="".concat(oe((0,s.ZQ)()),"-").concat(e);break;default:t=e}const a=n.length?n.join(","):"FirebaseCore-web";return"".concat(t,"/","JsCore","/").concat(r.MF,"/").concat(a)}class be{constructor(e){this.auth=e,this.queue=[]}pushCallback(e,t){const n=t=>new Promise((n,r)=>{try{n(e(t))}catch(s){r(s)}});n.onAbort=t,this.queue.push(n);const r=this.queue.length-1;return()=>{this.queue[r]=()=>Promise.resolve()}}async runMiddleware(e){if(this.auth.currentUser===e)return;const t=[];try{for(const n of this.queue)await n(e),n.onAbort&&t.push(n.onAbort)}catch(n){t.reverse();for(const e of t)try{e()}catch(r){}throw this.auth._errorFactory.create("login-blocked",{originalMessage:null===n||void 0===n?void 0:n.message})}}}class ye{constructor(e){var t,n,r,s;const a=e.customStrengthOptions;this.customStrengthOptions={},this.customStrengthOptions.minPasswordLength=null!==(t=a.minPasswordLength)&&void 0!==t?t:6,a.maxPasswordLength&&(this.customStrengthOptions.maxPasswordLength=a.maxPasswordLength),void 0!==a.containsLowercaseCharacter&&(this.customStrengthOptions.containsLowercaseLetter=a.containsLowercaseCharacter),void 0!==a.containsUppercaseCharacter&&(this.customStrengthOptions.containsUppercaseLetter=a.containsUppercaseCharacter),void 0!==a.containsNumericCharacter&&(this.customStrengthOptions.containsNumericCharacter=a.containsNumericCharacter),void 0!==a.containsNonAlphanumericCharacter&&(this.customStrengthOptions.containsNonAlphanumericCharacter=a.containsNonAlphanumericCharacter),this.enforcementState=e.enforcementState,"ENFORCEMENT_STATE_UNSPECIFIED"===this.enforcementState&&(this.enforcementState="OFF"),this.allowedNonAlphanumericCharacters=null!==(r=null===(n=e.allowedNonAlphanumericCharacters)||void 0===n?void 0:n.join(""))&&void 0!==r?r:"",this.forceUpgradeOnSignin=null!==(s=e.forceUpgradeOnSignin)&&void 0!==s&&s,this.schemaVersion=e.schemaVersion}validatePassword(e){var t,n,r,s,a,i;const o={isValid:!0,passwordPolicy:this};return this.validatePasswordLengthOptions(e,o),this.validatePasswordCharacterOptions(e,o),o.isValid&&
2(o.isValid=null===(t=o.meetsMinPasswordLength)||void 0===t||t),o.isValid&&(o.isValid=null===(n=o.meetsMaxPasswordLength)||void 0===n||n),o.isValid&&(o.isValid=null===(r=o.containsLowercaseLetter)||void 0===r||r),o.isValid&&(o.isValid=null===(s=o.containsUppercaseLetter)||void 0===s||s),o.isValid&&(o.isValid=null===(a=o.containsNumericCharacter)||void 0===a||a),o.isValid&&(o.isValid=null===(i=o.containsNonAlphanumericCharacter)||void 0===i||i),o}validatePasswordLengthOptions(e,t){const n=this.customStrengthOptions.minPasswordLength,r=this.customStrengthOptions.maxPasswordLength;n&&(t.meetsMinPasswordLength=e.length>=n),r&&(t.meetsMaxPasswordLength=e.length<=r)}validatePasswordCharacterOptions(e,t){let n;this.updatePasswordCharacterOptionsStatuses(t,!1,!1,!1,!1);for(let r=0;r<e.length;r++)n=e.charAt(r),this.updatePasswordCharacterOptionsStatuses(t,n>="a"&&n<="z",n>="A"&&n<="Z",n>="0"&&n<="9",this.allowedNonAlphanumericCharacters.includes(n))}updatePasswordCharacterOptionsStatuses(e,t,n,r,s){this.customStrengthOptions.containsLowercaseLetter&&(e.containsLowercaseLetter||(e.containsLowercaseLetter=t)),this.customStrengthOptions.containsUppercaseLetter&&(e.containsUppercaseLetter||(e.containsUppercaseLetter=n)),this.customStrengthOptions.containsNumericCharacter&&(e.containsNumericCharacter||(e.containsNumericCharacter=r)),this.customStrengthOptions.containsNonAlphanumericCharacter&&(e.containsNonAlphanumericCharacter||(e.containsNonAlphanumericCharacter=s))}}class ve{constructor(e,t,n,r){this.app=e,this.heartbeatServiceProvider=t,this.appCheckServiceProvider=n,this.config=r,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new je(this),this.idTokenSubscription=new je(this),this.beforeStateQueue=new be(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION=1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=d,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this._projectPasswordPolicy=null,this._tenantPasswordPolicies={},this._resolvePersistenceManagerAvailable=void 0,this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=e.name,this.clientVersion=r.sdkClientVersion,this._persistenceManagerAvailable=new Promise(e=>this._resolvePersistenceManagerAvailable=e)}_initializeWithPersistence(e,t){return t&&(this._popupRedirectResolver=ne(t)),this._initializationPromise=this.queue(async()=>{var n,r,s;if(!this._deleted&&(this.persistenceManager=await ie.create(this,e),null===(n=this._resolvePersistenceManagerAvailable)||void 0===n||n.call(this),!this._deleted)){if(null===(r=this._popupRedirectResolver)||void 0===r?void 0:r._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch(a){}await this.initializeCurrentUser(t),this.lastNotifiedUid=(null===(s=this.currentUser)||void 0===s?void 0:s.uid)||null,this._deleted||(this._isInitialized=!0)}}),this._initializationPromise}async _onStorageEvent(){if(this._deleted)return;const e=await this.assertedPersistence.getCurrentUser();return this.currentUser||e?this.currentUser&&e&&this.currentUser.uid===e.uid?(this._currentUser._assign(e),void await this.currentUser.getIdToken()):void await this._updateCurrentUser(e,!0):void 0}async initializeCurrentUserFromIdToken(e){try{const t=await V(this,{idToken:e}),n=await ee._fromGetAccountInfoResponse(this,t,e);await this.directlySetCurrentUser(n)}catch(t){console.warn("FirebaseServerApp could not login user with provided authIdToken: ",t),await this.directlySetCurrentUser(null)}}async initializeCurrentUser(e){var t;if((0,r.xZ)(this.app)){const e=this.app.settings.authIdToken;return e?new Promise(t=>{setTimeout(()=>this.initializeCurrentUserFromIdToken(e).then(t,t))}):this.directlySetCurrentUser(null)}const n=await this.assertedPersistence.getCurrentUser();let s=n,a=!1;if(e&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();const n=null===(t=this.redirectUser)||void 0===t?void 0:t._redirectEventId,r=null===s||void 0===s?void 0:s._redirectEventId,i=await this.tryRedirectSignIn(e);n&&n!==r||!(null===i||void 0===i?void 0:i.user)||(s=i.user,a=!0)}if(!s)return this.directlySetCurrentUser(null);
2if(!s._redirectEventId){if(a)try{await this.beforeStateQueue.runMiddleware(s)}catch(i){s=n,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(i))}return s?this.reloadAndSetCurrentUserOrClear(s):this.directlySetCurrentUser(null)}return y(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===s._redirectEventId?this.directlySetCurrentUser(s):this.reloadAndSetCurrentUserOrClear(s)}async tryRedirectSignIn(e){let t=null;try{t=await this._popupRedirectResolver._completeRedirectFn(this,e,!0)}catch(n){await this._setRedirectUser(null)}return t}async reloadAndSetCurrentUserOrClear(e){try{await $(e)}catch(t){if((null===t||void 0===t?void 0:t.code)!=="auth/".concat("network-request-failed"))return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(e)}useDeviceLanguage(){this.languageCode=function(){if("undefined"===typeof navigator)return null;const e=navigator;return e.languages&&e.languages[0]||e.language||null}()}async _delete(){this._deleted=!0}async updateCurrentUser(e){if((0,r.xZ)(this.app))return Promise.reject(f(this));const t=e?(0,s.Ku)(e):null;return t&&y(t.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(t&&t._clone(this))}async _updateCurrentUser(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!this._deleted)return e&&y(this.tenantId===e.tenantId,this,"tenant-id-mismatch"),t||await this.beforeStateQueue.runMiddleware(e),this.queue(async()=>{await this.directlySetCurrentUser(e),this.notifyAuthListeners()})}async signOut(){return(0,r.xZ)(this.app)?Promise.reject(f(this)):(await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0))}setPersistence(e){return(0,r.xZ)(this.app)?Promise.reject(f(this)):this.queue(async()=>{await this.assertedPersistence.setPersistence(ne(e))})}_getRecaptchaConfig(){return null==this.tenantId?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}async validatePassword(e){this._getPasswordPolicyInternal()||await this._updatePasswordPolicy();const t=this._getPasswordPolicyInternal();return t.schemaVersion!==this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION?Promise.reject(this._errorFactory.create("unsupported-password-policy-schema-version",{})):t.validatePassword(e)}_getPasswordPolicyInternal(){return null===this.tenantId?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}async _updatePasswordPolicy(){const e=await async function(e){return I(e,"GET","/v2/passwordPolicy",_(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}))}(this),t=new ye(e);null===this.tenantId?this._projectPasswordPolicy=t:this._tenantPasswordPolicies[this.tenantId]=t}_getPersistenceType(){return this.assertedPersistence.persistence.type}_getPersistence(){return this.assertedPersistence.persistence}_updateErrorMap(e){this._errorFactory=new s.FA("auth","Firebase",e())}onAuthStateChanged(e,t,n){return this.registerStateListener(this.authStateSubscription,e,t,n)}beforeAuthStateChanged(e,t){return this.beforeStateQueue.pushCallback(e,t)}onIdTokenChanged(e,t,n){return this.registerStateListener(this.idTokenSubscription,e,t,n)}authStateReady(){return new Promise((e,t)=>{if(this.currentUser)e();else{const n=this.onAuthStateChanged(()=>{n(),e()},t)}})}async revokeAccessToken(e){if(this.currentUser){const t={providerId:"apple.com",tokenType:"ACCESS_TOKEN",token:e,idToken:await this.currentUser.getIdToken()};null!=this.tenantId&&(t.tenantId=this.tenantId),await async function(e,t){return I(e,"POST","/v2/accounts:revokeToken",_(e,t))}(this,t)}}toJSON(){var e;return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:null===(e=this._currentUser)||void 0===e?void 0:e.toJSON()}}async _setRedirectUser(e,t){const n=await this.getOrInitRedirectPersistenceManager(t);return null===e?n.removeCurrentUser():n.setCurrentUser(e)}async getOrInitRedirectPersistenceManager(e){if(!this.redirectPersistenceManager){const t=e&&ne(e)||this._popupRedirectResolver;y(t,this,"argument-error"),this.redirectPersistenceManager=await ie.create(this,[ne(t._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(e){var t,n;return this._isInitialized&&await this.queue(async()=>{}),(null===(t=this._currentUser)||void 0===t?void 0:t._redirectEventId)===e?this._currentUser:(null===(n=this.redirectUser)||void 0===n?void 0:n._redirectEventId)===e?this.redirectUser:null}async _persistUserIfCurrent(e){if(e===this.currentUser)return this.queue(async()=>this.directlySetCurrentUser(e))}_notifyListenersIfCurrent(e){e===this.currentUser&&this.notifyAuthListeners()}_key(){return"".concat(this.config.authDomain,":").concat(this.config.apiKey,":").concat(this.name)}_startProactiveRefresh(){this.isProactiveRefreshEnabled=!0,this.currentUser&&this._currentUser._startProactiveRefresh()}_stopProactiveRefresh(){this.isProactiveRefreshEnabled=!1,this.currentUser&&this._currentUser._stopProactiveRefresh()}get _currentUser(){return this.currentUser}notifyAuthListeners(){var e,t;if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);const n=null!==(t=null===(e=this.currentUser)||void 0===e?void 0:e.uid)&&void 0!==t?t:null;this.lastNotifiedUid!==n&&(this.lastNotifiedUid=n,this.authStateSubscription.next(this.currentUser))}registerStateListener(e,t,n,r){if(this._deleted)return()=>{};const s="function"===typeof t?t:t.next.bind(t);let a=!1;const i=this._isInitialized?Promise.resolve():this._initializationPromise;if(y(i,this,"internal-error"),i.then(()=>{a||s(this.currentUser)}),"function"===typeof t){const s=e.addObserver(t,n,r);return()=>{a=!0,s()}}{const n=e.addObserver(t);return()=>{a=!0,n()}}}async directlySetCurrentUser(e){this.currentUser&&this.currentUser!==e&&this._currentUser._stopProactiveRefresh(),e&&this.isProactiveRefreshEnabled&&e._startProactiveRefresh(),this.currentUser=e,e?await this.assertedPersistence.setCurrentUser(e):await this.assertedPersistence.removeCurrentUser()}queue(e){return this.operations=this.operations.then(e,e),this.operations}get assertedPersistence(){return y(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(e){e&&!this.frameworks.includes(e)&&(this.frameworks.push(e),this.frameworks.sort(),this.clientVersion=xe(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){var e;const t={"X-Client-Version":this.clientVersion};this.app.options.appId&&(t["X-Firebase-gmpid"]=this.app.options.appId);const n=await(null===(e=this.heartbeatServiceProvider.getImmediate({optional:!0}))||void 0===e?void 0:e.getHeartbeatsHeader());n&&(t["X-Firebase-Client"]=n);const r=await this._getAppCheckToken();return r&&(t["X-Firebase-AppCheck"]=r),t}async _getAppCheckToken(){var e;if((0,r.xZ)(this.app)&&this.app.settings.appCheckToken)return this.app.settings.appCheckToken;const t=await(null===(e=this.appCheckServiceProvider.getImmediate({optional:!0}))||void 0===e?void 0:e.getToken());return(null===t||void 0===t?void 0:t.error)&&function(e){if(u.logLevel<=a.$b.WARN){for(var t=arguments.length,n=new Array(t>1?t-1:0),s=1;s<t;s++)n[s-1]=arguments[s];u.warn("Auth (".concat(r.MF,"): ").concat(e),...n)}}("Error while retrieving App Check token: ".concat(t.error)),null===t||void 0===t?void 0:t.token}}function we(e){return(0,s.Ku)(e)}class je{constructor(e){this.auth=e,this.observer=null,this.addObserver=(0,s.tD)(e=>this.observer=e)}get next(){return y(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}let Ne={async loadJS(){throw new Error("Unable to load external scripts")},recaptchaV2Script:"",recaptchaEnterpriseScript:"",gapiScript:""};function ke(e){return Ne.loadJS(e)}function Ae(e){return"__".concat(e).concat(Math.floor(1e6*Math.random()))}class Se{constructor(){this.enterprise=new Ee}ready(e){e()}execute(e,t){return Promise.resolve("token")}render(e,t){return""}}class Ee{ready(e){e()}execute(e,t){return Promise.resolve("token")}render(e,t){return""}}const Ce="NO_RECAPTCHA";class Te{constructor(e){this.type="recaptcha-enterprise",this.auth=we(e)}async verify(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"verify",t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];function n(t,n,r){const s=window.grecaptcha;U(s)?s.enterprise.ready(()=>{s.enterprise.execute(t,{action:e}).then(e=>{n(e)}).catch(()=>{n(Ce)})}):r(Error("No reCAPTCHA enterprise script loaded."))}if(this.auth.settings.appVerificationDisabledForTesting){return(new Se).execute("siteKey",{action:"verify"})}return new Promise((e,r)=>{(async function(e){if(!t){if(null==e.tenantId&&null!=e._agentRecaptchaConfig)return e._agentRecaptchaConfig.siteKey;if(null!=e.tenantId&&void 0!==e._tenantRecaptchaConfigs[e.tenantId])return e._tenantRecaptchaConfigs[e.tenantId].siteKey}return new Promise(async(t,n)=>
2{z(e,{clientType:"CLIENT_TYPE_WEB",version:"RECAPTCHA_ENTERPRISE"}).then(r=>{if(void 0!==r.recaptchaKey){const n=new B(r);return null==e.tenantId?e._agentRecaptchaConfig=n:e._tenantRecaptchaConfigs[e.tenantId]=n,t(n.siteKey)}n(new Error("recaptcha Enterprise site key undefined"))}).catch(e=>{n(e)})})})(this.auth).then(s=>{if(!t&&U(window.grecaptcha))n(s,e,r);else{if("undefined"===typeof window)return void r(new Error("RecaptchaVerifier is only supported in browser"));let t=Ne.recaptchaEnterpriseScript;0!==t.length&&(t+=s),ke(t).then(()=>{n(s,e,r)}).catch(e=>{r(e)})}}).catch(e=>{r(e)})})}}async function Pe(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=arguments.length>4&&void 0!==arguments[4]&&arguments[4];const a=new Te(e);let i;if(s)i=Ce;else try{i=await a.verify(n)}catch(l){i=await a.verify(n,!0)}const o=Object.assign({},t);if("mfaSmsEnrollment"===n||"mfaSmsSignIn"===n){if("phoneEnrollmentInfo"in o){const e=o.phoneEnrollmentInfo.phoneNumber,t=o.phoneEnrollmentInfo.recaptchaToken;Object.assign(o,{phoneEnrollmentInfo:{phoneNumber:e,recaptchaToken:t,captchaResponse:i,clientType:"CLIENT_TYPE_WEB",recaptchaVersion:"RECAPTCHA_ENTERPRISE"}})}else if("phoneSignInInfo"in o){const e=o.phoneSignInInfo.recaptchaToken;Object.assign(o,{phoneSignInInfo:{recaptchaToken:e,captchaResponse:i,clientType:"CLIENT_TYPE_WEB",recaptchaVersion:"RECAPTCHA_ENTERPRISE"}})}return o}return r?Object.assign(o,{captchaResp:i}):Object.assign(o,{captchaResponse:i}),Object.assign(o,{clientType:"CLIENT_TYPE_WEB"}),Object.assign(o,{recaptchaVersion:"RECAPTCHA_ENTERPRISE"}),o}async function _e(e,t,n,r,s){var a,i;if("EMAIL_PASSWORD_PROVIDER"===s){if(null===(a=e._getRecaptchaConfig())||void 0===a?void 0:a.isProviderEnabled("EMAIL_PASSWORD_PROVIDER")){const s=await Pe(e,t,n,"getOobCode"===n);return r(e,s)}return r(e,t).catch(async s=>{if(s.code==="auth/".concat("missing-recaptcha-token")){console.log("".concat(n," is protected by reCAPTCHA Enterprise for this project. Automatically triggering the reCAPTCHA flow and restarting the flow."));const s=await Pe(e,t,n,"getOobCode"===n);return r(e,s)}return Promise.reject(s)})}if("PHONE_PROVIDER"===s){if(null===(i=e._getRecaptchaConfig())||void 0===i?void 0:i.isProviderEnabled("PHONE_PROVIDER")){const s=await Pe(e,t,n);return r(e,s).catch(async s=>{var a;if("AUDIT"===(null===(a=e._getRecaptchaConfig())||void 0===a?void 0:a.getProviderEnforcementState("PHONE_PROVIDER"))&&(s.code==="auth/".concat("missing-recaptcha-token")||s.code==="auth/".concat("invalid-app-credential"))){console.log("Failed to verify with reCAPTCHA Enterprise. Automatically triggering the reCAPTCHA v2 flow to complete the ".concat(n," flow."));const s=await Pe(e,t,n,!1,!0);return r(e,s)}return Promise.reject(s)})}{const s=await Pe(e,t,n,!1,!0);return r(e,s)}}return Promise.reject(s+" provider is not supported.")}async function Ie(e){const t=we(e),n=await z(t,{clientType:"CLIENT_TYPE_WEB",version:"RECAPTCHA_ENTERPRISE"}),r=new B(n);if(null==t.tenantId?t._agentRecaptchaConfig=r:t._tenantRecaptchaConfigs[t.tenantId]=r,r.isAnyProviderEnabled()){new Te(t).verify()}}function De(e,t,n){const r=we(e);y(/^https?:\/\//.test(t),r,"invalid-emulator-scheme");const a=!!(null===n||void 0===n?void 0:n.disableWarnings),i=Re(t),{host:o,port:l}=function(e){const t=Re(e),n=/(\/\/)?([^?#/]+)/.exec(e.substr(t.length));if(!n)return{host:"",port:null};const r=n[2].split("@").pop()||"",s=/^(\[[^\]]+\])(:|$)/.exec(r);if(s){const e=s[1];return{host:e,port:Le(r.substr(e.length+1))}}{const[e,t]=r.split(":");return{host:e,port:Le(t)}}}(t),c=null===l?"":":".concat(l),d={url:"".concat(i,"//").concat(o).concat(c,"/")},u=Object.freeze({host:o,port:l,protocol:i.replace(":",""),options:Object.freeze({disableWarnings:a})});if(!r._canInitEmulator)return y(r.config.emulator&&r.emulatorConfig,r,"emulator-config-failed"),void y((0,s.bD)(d,r.config.emulator)&&(0,s.bD)(u,r.emulatorConfig),r,"emulator-config-failed");r.config.emulator=d,r.emulatorConfig=u,r.settings.appVerificationDisabledForTesting=!0,a||function(){function e(){const e=document.createElement("p"),t=e.style;e.innerText="Running in emulator mode. Do not use with production credentials.",t.position="fixed",t.width="100%",t.backgroundColor="#ffffff",t.border=".1em solid #000000",t.color="#b50000",t.bottom="0px",t.left="0px",t.margin="0px",t.zIndex="10000",t.textAlign="center",e.classList.add("firebase-emulator-warning"),document.body.appendChild(e)}"undefined"!==typeof console&&"function"===typeof console.info&&console.info("WARNING: You are using the Auth Emulator, which is intended for local testing only. Do not use with production credentials.");"undefined"!==typeof window&&"undefined"!==typeof document&&("loading"===document.readyState?window.addEventListener("DOMContentLoaded",e):e())}()}function Re(e){const t=e.indexOf(":");
2return t<0?"":e.substr(0,t+1)}function Le(e){if(!e)return null;const t=Number(e);return isNaN(t)?null:t}class Me{constructor(e,t){this.providerId=e,this.signInMethod=t}toJSON(){return v("not implemented")}_getIdTokenResponse(e){return v("not implemented")}_linkToIdToken(e,t){return v("not implemented")}_getReauthenticationResolver(e){return v("not implemented")}}async function Oe(e,t){return I(e,"POST","/v1/accounts:signUp",t)}async function Fe(e,t){return R(e,"POST","/v1/accounts:signInWithPassword",_(e,t))}async function Ue(e,t){return I(e,"POST","/v1/accounts:sendOobCode",_(e,t))}async function Be(e,t){return Ue(e,t)}class ze extends Me{constructor(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;super("password",n),this._email=e,this._password=t,this._tenantId=r}static _fromEmailAndPassword(e,t){return new ze(e,t,"password")}static _fromEmailAndCode(e,t){return new ze(e,t,"emailLink",arguments.length>2&&void 0!==arguments[2]?arguments[2]:null)}toJSON(){return{email:this._email,password:this._password,signInMethod:this.signInMethod,tenantId:this._tenantId}}static fromJSON(e){const t="string"===typeof e?JSON.parse(e):e;if((null===t||void 0===t?void 0:t.email)&&(null===t||void 0===t?void 0:t.password)){if("password"===t.signInMethod)return this._fromEmailAndPassword(t.email,t.password);if("emailLink"===t.signInMethod)return this._fromEmailAndCode(t.email,t.password,t.tenantId)}return null}async _getIdTokenResponse(e){switch(this.signInMethod){case"password":return _e(e,{returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"},"signInWithPassword",Fe,"EMAIL_PASSWORD_PROVIDER");case"emailLink":return async function(e,t){return R(e,"POST","/v1/accounts:signInWithEmailLink",_(e,t))}(e,{email:this._email,oobCode:this._password});default:h(e,"internal-error")}}async _linkToIdToken(e,t){switch(this.signInMethod){case"password":return _e(e,{idToken:t,returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"},"signUpPassword",Oe,"EMAIL_PASSWORD_PROVIDER");case"emailLink":return async function(e,t){return R(e,"POST","/v1/accounts:signInWithEmailLink",_(e,t))}(e,{idToken:t,email:this._email,oobCode:this._password});default:h(e,"internal-error")}}_getReauthenticationResolver(e){return this._getIdTokenResponse(e)}}async function Ve(e,t){return R(e,"POST","/v1/accounts:signInWithIdp",_(e,t))}class qe extends Me{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(e){const t=new qe(e.providerId,e.signInMethod);return e.idToken||e.accessToken?(e.idToken&&(t.idToken=e.idToken),e.accessToken&&(t.accessToken=e.accessToken),e.nonce&&!e.pendingToken&&(t.nonce=e.nonce),e.pendingToken&&(t.pendingToken=e.pendingToken)):e.oauthToken&&e.oauthTokenSecret?(t.accessToken=e.oauthToken,t.secret=e.oauthTokenSecret):h("argument-error"),t}toJSON(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,n
2once:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}static fromJSON(e){const t="string"===typeof e?JSON.parse(e):e,{providerId:n,signInMethod:r}=t,s=i(t,["providerId","signInMethod"]);if(!n||!r)return null;const a=new qe(n,r);return a.idToken=s.idToken||void 0,a.accessToken=s.accessToken||void 0,a.secret=s.secret,a.nonce=s.nonce,a.pendingToken=s.pendingToken||null,a}_getIdTokenResponse(e){return Ve(e,this.buildRequest())}_linkToIdToken(e,t){const n=this.buildRequest();return n.idToken=t,Ve(e,n)}_getReauthenticationResolver(e){const t=this.buildRequest();return t.autoCreate=!1,Ve(e,t)}buildRequest(){const e={requestUri:"http://localhost",returnSecureToken:!0};if(this.pendingToken)e.pendingToken=this.pendingToken;else{const t={};this.idToken&&(t.id_token=this.idToken),this.accessToken&&(t.access_token=this.accessToken),this.secret&&(t.oauth_token_secret=this.secret),t.providerId=this.providerId,this.nonce&&!this.pendingToken&&(t.nonce=this.nonce),e.postBody=(0,s.Am)(t)}return e}}async function We(e,t){return I(e,"POST","/v1/accounts:sendVerificationCode",_(e,t))}const He={USER_NOT_FOUND:"user-not-found"};class Ge extends Me{constructor(e){super("phone","phone"),this.params=e}static _fromVerification(e,t){return new Ge({verificationId:e,verificationCode:t})}static _fromTokenResponse(e,t){return new Ge({phoneNumber:e,temporaryProof:t})}_getIdTokenResponse(e){return async function(e,t){return R(e,"POST","/v1/accounts:signInWithPhoneNumber",_(e,t))}(e,this._makeVerificationRequest())}_linkToIdToken(e,t){return async function(e,t){const n=await R(e,"POST","/v1/accounts:signInWithPhoneNumber",_(e,t));if(n.temporaryProof)throw F(e,"account-exists-with-different-credential",n);return n}(e,Object.assign({idToken:t},this._makeVerificationRequest()))}_getReauthenticationResolver(e){return async function(e,t){return R(e,"POST","/v1/accounts:signInWithPhoneNumber",_(e,Object.assign(Object.assign({},t),{operation:"REAUTH"})),He)}(e,this._makeVerificationRequest())}_makeVerificationRequest(){const{temporaryProof:e,phoneNumber:t,verificationId:n,verificationCode:r}=this.params;return e&&t?{temporaryProof:e,phoneNumber:t}:{sessionInfo:n,code:r}}toJSON(){const e={providerId:this.providerId};return this.params.phoneNumber&&(e.phoneNumber=this.params.phoneNumber),this.params.temporaryProof&&(e.temporaryProof=this.params.temporaryProof),this.params.verificationCode&&(e.verificationCode=this.params.verificationCode),this.params.verificationId&&(e.verificationId=this.params.verificationId),e}static fromJSON(e){"string"===typeof e&&(e=JSON.parse(e));const{verificationId:t,verificationCode:n,phoneNumber:r,temporaryProof:s}=e;return n||t||r||s?new Ge({verificationId:t,verificationCode:n,phoneNumber:r,temporaryProof:s}):null}}class Ye{constructor(e){var t,n,r,a,i,o;const l=(0,s.I9)((0,s.hp)(e)),c=null!==(t=l.apiKey)&&void 0!==t?t:null,d=null!==(n=l.oobCode)&&void 0!==n?n:null,u=function(e){switch(e){case"recoverEmail":return"RECOVER_EMAIL";case"resetPassword":return"PASSWORD_RESET";case"signIn":return"EMAIL_SIGNIN";case"verifyEmail":return"VERIFY_EMAIL";case"verifyAndChangeEmail":return"VERIFY_AND_CHANGE_EMAIL";case"revertSecondFactorAddition":return"REVERT_SECOND_FACTOR_ADDITION";default:return null}}(null!==(r=l.mode)&&void 0!==r?r:null);y(c&&d&&u,"argument-error"),this.apiKey=c,this.operation=u,this.code=d,this.continueUrl=null!==(a=l.continueUrl)&&void 0!==a?a:null,this.languageCode=null!==(i=l.lang)&&void 0!==i?i:null,this.tenantId=null!==(o=l.tenantId)&&void 0!==o?o:null}static parseLink(e){const t=function(e){const t=(0,s.I9)((0,s.hp)(e)).link,n=t?(0,s.I9)((0,s.hp)(t)).deep_link_id:null,r=(0,s.I9)((0,s.hp)(e)).deep_link_id;return(r?(0,s.I9)((0,s.hp)(r)).link:null)||r||n||t||e}(e);try{return new Ye(t)}catch(n){return null}}}class Ke{constructor(){this.providerId=Ke.PROVIDER_ID}static credential(e,t){return ze._fromEmailAndPassword(e,t)}static credentialWithLink(e,t){const n=Ye.parseLink(t);return y(n,"argument-error"),ze._fromEmailAndCode(e,n.code,n.tenantId)}}Ke.PROVIDER_ID="password",Ke.EMAIL_PASSWORD_SIGN_IN_METHOD="password",Ke.EMAIL_LINK_SIGN_IN_METHOD="emailLink";class Je{constructor(e){this.providerId=e,this.defaultLanguageCode=null,this.customParameters={}}setDefaultLanguage(e){this.defaultLanguageCode=e}setCustomParameters(e){return this.customParameters=e,this}getCustomParameters(){return this.customParameters}}class $e extends Je{constructor(){super(...arguments),this.scopes=[]}addScope(e){return this.scopes.includes(e)||this.scopes.push(e),this}getScopes(){return[...this.scopes]}}class Qe extends $e{constructor(){super("facebook.com")}static credential(e){return qe._fromParams({providerId:Qe.PROVIDER_ID,signInMethod:Qe.FACEBOOK_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return Qe.credentialFromTaggedObject(e)}static credentialFromError(e){return Qe.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject(e){let{_tokenResponse:t}=e;if(!t||!("oauthAccessToken"in t))return null;if(!t.oauthAccessToken)return null;try{return Qe.credential(t.oauthAccessToken)}catch(n){return null}}}Qe.FACEBOOK_SIGN_IN_METHOD="facebook.com",Qe.PROVIDER_ID="facebook.com";class Xe extends $e{constructor(){super("google.com"),this.addScope("profile")}static credential(e,t){return qe._fromParams({providerId:Xe.PROVIDER_ID,signInMethod:Xe.GOOGLE_SIGN_IN_METHOD,idToken:e,accessToken:t})}static credentialFromResult(e){return Xe.credentialFromTaggedObject(e)}static credentialFromError(e){return Xe.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject(e){let{_tokenResponse:t}=e;if(!t)return null;const{oauthIdToken:n,oauthAccessToken:r}=t;if(!n&&!r)return null;try{return Xe.credential(n,r)}catch(s){return null}}}Xe.GOOGLE_SIGN_IN_METHOD="google.com",Xe.PROVIDER_ID="google.com";class Ze extends $e{constructor(){super("github.com")}static credential(e){return qe._fromParams({providerId:Ze.PROVIDER_ID,signInMethod:Ze.GITHUB_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return Ze.credentialFromTaggedObject(e)}static credentialFromError(e){return Ze.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject(e){let{_tokenResponse:t}=e;if(!t||!("oauthAccessToken"in t))return null;if(!t.oauthAccessToken)return null;try{return Ze.credential(t.oauthAccessToken)}catch(n){return null}}}Ze.GITHUB_SIGN_IN_METHOD="github.com",Ze.PROVIDER_ID="github.com";class et extends $e{constructor(){super("twitter.com")}static credential(e,t){return qe._fromParams({providerId:et.PROVIDER_ID,signInMethod:et.TWITTER_SIGN_IN_METHOD,oauthToken:e,oauthTokenSecret:t})}static credentialFromResult(e){return et.credentialFromTaggedObject(e)}static credentialFromError(e){return et.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject(e){let{_tokenResponse:t}=e;if(!t)return null;const{oauthAccessToken:n,oauthTokenSecret:r}=t;if(!n||!r)return null;try{return et.credential(n,r)}catch(s){return null}}}async function tt(e,t){return R(e,"POST","/v1/accounts:signUp",_(e,t))}et.TWITTER_SIGN_IN_METHOD="twitter.com",et.PROVIDER_ID="twitter.com";class nt{constructor(e){this.user=e.user,this.providerId=e.providerId,this._tokenResponse=e._tokenResponse,this.operationType=e.operationType}static async _fromIdTokenResponse(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const s=await ee._fromIdTokenResponse(e,n,r),a=rt(n);return new nt({user:s,providerId:a,_tokenResponse:n,operationType:t})}static async _forOperation(e,t,n){await e._updateTokensIfNecessary(n,!0);const r=rt(n);
2return new nt({user:e,providerId:r,_tokenResponse:n,operationType:t})}}function rt(e){return e.providerId?e.providerId:"phoneNumber"in e?"phone":null}class st extends s.g{constructor(e,t,n,r){var s;super(t.code,t.message),this.operationType=n,this.user=r,Object.setPrototypeOf(this,st.prototype),this.customData={appName:e.name,tenantId:null!==(s=e.tenantId)&&void 0!==s?s:void 0,_serverResponse:t.customData._serverResponse,operationType:n}}static _fromErrorAndOperation(e,t,n,r){return new st(e,t,n,r)}}function at(e,t,n,r){return("reauthenticate"===t?n._getReauthenticationResolver(e):n._getIdTokenResponse(e)).catch(n=>{if(n.code==="auth/".concat("multi-factor-auth-required"))throw st._fromErrorAndOperation(e,n,t,r);throw n})}async function it(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=await Y(e,t._linkToIdToken(e.auth,await e.getIdToken()),n);return nt._forOperation(e,"link",r)}async function ot(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const{auth:s}=e;if((0,r.xZ)(s.app))return Promise.reject(f(s));const a="reauthenticate";try{const r=await Y(e,at(s,a,t,e),n);y(r.idToken,s,"internal-error");const i=H(r.idToken);y(i,s,"internal-error");const{sub:o}=i;return y(e.uid===o,s,"user-mismatch"),nt._forOperation(e,a,r)}catch(i){throw(null===i||void 0===i?void 0:i.code)==="auth/".concat("user-not-found")&&h(s,"user-mismatch"),i}}async function lt(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if((0,r.xZ)(e.app))return Promise.reject(f(e));const s="signIn",a=await at(e,s,t),i=await nt._fromIdTokenResponse(e,s,a);return n||await e._updateCurrentUser(i.user),i}async function ct(e,t){return lt(we(e),t)}function dt(e,t,n){var r;y((null===(r=n.url)||void 0===r?void 0:r.length)>0,e,"invalid-continue-uri"),y("undefined"===typeof n.dynamicLinkDomain||n.dynamicLinkDomain.length>0,e,"invalid-dynamic-link-domain"),y("undefined"===typeof n.linkDomain||n.linkDomain.length>0,e,"invalid-hosting-link-domain"),t.continueUrl=n.url,t.dynamicLinkDomain=n.dynamicLinkDomain,t.linkDomain=n.linkDomain,t.canHandleCodeInApp=n.handleCodeInApp,n.iOS&&(y(n.iOS.bundleId.length>0,e,"missing-ios-bundle-id"),t.iOSBundleId=n.iOS.bundleId),n.android&&(y(n.android.packageName.length>0,e,"missing-android-pkg-name"),t.androidInstallApp=n.android.installApp,t.androidMinimumVersionCode=n.android.minimumVersion,t.androidPackageName=n.android.packageName)}async function ut(e){const t=we(e);t._getPasswordPolicyInternal()&&await t._updatePasswordPolicy()}async function mt(e,t,n){const r=we(e),s={requestType:"PASSWORD_RESET",email:t,clientType:"CLIENT_TYPE_WEB"};n&&dt(r,s,n),await _e(r,s,"getOobCode",Be,"EMAIL_PASSWORD_PROVIDER")}async function ht(e,t,n){if((0,r.xZ)(e.app))return Promise.reject(f(e));const s=we(e),a=_e(s,{returnSecureToken:!0,email:t,password:n,clientType:"CLIENT_TYPE_WEB"},"signUpPassword",tt,"EMAIL_PASSWORD_PROVIDER"),i=await a.catch(t=>{throw t.code==="auth/".concat("password-does-not-meet-requirements")&&ut(e),t}),o=await nt._fromIdTokenResponse(s,"signIn",i);return await s._updateCurrentUser(o.user),o}function pt(e,t,n){return(0,r.xZ)(e.app)?Promise.reject(f(e)):ct((0,s.Ku)(e),Ke.credential(t,n)).catch(async t=>{throw t.code==="auth/".concat("password-does-not-meet-requirements")&&ut(e),t})}async function gt(e,t){let{displayName:n,photoURL:r}=t;if(void 0===n&&void 0===r)return;const a=(0,s.Ku)(e),i={idToken:await a.getIdToken(),displayName:n,photoUrl:r,returnSecureToken:!0},o=await Y(a,async function(e,t){return I(e,"POST","/v1/accounts:update",t)}(a.auth,i));a.displayName=o.displayName||null,a.photoURL=o.photoUrl||null;const l=a.providerData.find(e=>{let{providerId:t}=e;return"password"===t});l&&(l.displayName=a.displayName,l.photoURL=a.photoURL),await a._updateTokensIfNecessary(o)}function ft(e,t){return(0,s.Ku)(e).setPersistence(t)}function xt(e,t,n,r){return(0,s.Ku)(e).onAuthStateChanged(t,n,r)}function bt(e){return(0,s.Ku)(e).signOut()}async function yt(e){return(0,s.Ku)(e).delete()}function vt(e,t){return I(e,"POST","/v2/accounts/mfaEnrollment:start",_(e,t))}new WeakMap;const wt="__sak";class jt{constructor(e,t){this.storageRetriever=e,this.type=t}_isAvailable(){try{return this.storage?(this.storage.setItem(wt,"1"),this.storage.removeItem(wt),Promise.resolve(!0)):Promise.resolve(!1)}catch(e){return Promise.resolve(!1)}}_set(e,t){return this.storage.setItem(e,JSON.stringify(t)),Promise.resolve()}_get(e){const t=this.storage.getItem(e);return Promise.resolve(t?JSON.parse(t):null)}_remove(e){return this.storage.removeItem(e),Promise.resolve()}get storage(){return this.storageRetriever()}}class Nt extends jt{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(e,t)=>this.onStorageEvent(e,t),this.listeners={},this.localCache={},this.pollTimer=null,this.fallbackToPolling=fe(),this._shouldAllowMigration=!0}forAllChangedKeys(e){for(const t of Object.keys(this.listeners)){const n=this.storage.getItem(t),r=this.localCache[t];n!==r&&e(t,r,n)}}onStorageEvent(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];
2if(!e.key)return void this.forAllChangedKeys((e,t,n)=>{this.notifyListeners(e,n)});const n=e.key;t?this.detachListener():this.stopPolling();const r=()=>{const e=this.storage.getItem(n);(t||this.localCache[n]!==e)&&this.notifyListeners(n,e)},a=this.storage.getItem(n);(0,s.lT)()&&10===document.documentMode&&a!==e.newValue&&e.newValue!==e.oldValue?setTimeout(r,10):r()}notifyListeners(e,t){this.localCache[e]=t;const n=this.listeners[e];if(n)for(const r of Array.from(n))r(t?JSON.parse(t):t)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((e,t,n)=>{this.onStorageEvent(new StorageEvent("storage",{key:e,oldValue:t,newValue:n}),!0)})},1e3)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(e,t){0===Object.keys(this.listeners).length&&(this.fallbackToPolling?this.startPolling():this.attachListener()),this.listeners[e]||(this.listeners[e]=new Set,this.localCache[e]=this.storage.getItem(e)),this.listeners[e].add(t)}_removeListener(e,t){this.listeners[e]&&(this.listeners[e].delete(t),0===this.listeners[e].size&&delete this.listeners[e]),0===Object.keys(this.listeners).length&&(this.detachListener(),this.stopPolling())}async _set(e,t){await super._set(e,t),this.localCache[e]=JSON.stringify(t)}async _get(e){const t=await super._get(e);return this.localCache[e]=JSON.stringify(t),t}async _remove(e){await super._remove(e),delete this.localCache[e]}}Nt.type="LOCAL";const kt=Nt;function At(e){var t,n;const r=e.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),s=RegExp("".concat(r,"=([^;]+)"));return null!==(n=null===(t=document.cookie.match(s))||void 0===t?void 0:t[1])&&void 0!==n?n:null}function St(e){const t="http:"===window.location.protocol;return"".concat(t?"__dev_":"__HOST-","FIREBASE_").concat(e.split(":")[3])}class Et{constructor(){this.type="COOKIE",this.listenerUnsubscribes=new Map}_getFinalTarget(e){if(void 0===typeof window)return e;const t=new URL("".concat(window.location.origin,"/__cookies__"));return t.searchParams.set("finalTarget",e),t}async _isAvailable(){var e;return!("boolean"===typeof isSecureContext&&!isSecureContext)&&("undefined"!==typeof navigator&&"undefined"!==typeof document&&(null===(e=navigator.cookieEnabled)||void 0===e||e))}async _set(e,t){}async _get(e){if(!this._isAvailable())return null;const t=St(e);if(window.cookieStore){const e=await window.cookieStore.get(t);return null===e||void 0===e?void 0:e.value}return At(t)}async _remove(e){if(!this._isAvailable())return;if(!await this._get(e))return;const t=St(e);document.cookie="".concat(t,"=;Max-Age=34560000;Partitioned;Secure;SameSite=Strict;Path=/;Priority=High"),await fetch("/__cookies__",{method:"DELETE"}).catch(()=>{})}_addListener(e,t){if(!this._isAvailable())return;const n=St(e);if(window.cookieStore){const e=e=>{const r=e.changed.find(e=>e.name===n);r&&t(r.value);e.deleted.find(e=>e.name===n)&&t(null)},r=()=>window.cookieStore.removeEventListener("change",e);return this.listenerUnsubscribes.set(t,r),window.cookieStore.addEventListener("change",e)}let r=At(n);const s=setInterval(()=>{const e=At(n);e!==r&&(t(e),r=e)},1e3);this.listenerUnsubscribes.set(t,()=>clearInterval(s))}_removeListener(e,t){const n=this.listenerUnsubscribes.get(t);n&&(n(),this.listenerUnsubscribes.delete(t))}}Et.type="COOKIE";class Ct extends jt{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(e,t){}_removeListener(e,t){}}Ct.type="SESSION";const Tt=Ct;class Pt{constructor(e){this.eventTarget=e,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(e){const t=this.receivers.find(t=>t.isListeningto(e));if(t)return t;const n=new Pt(e);return this.receivers.push(n),n}isListeningto(e){return this.eventTarget===e}async handleEvent(e){const t=e,{eventId:n,eventType:r,data:s}=t.data,a=this.handlersMap[r];if(!(null===a||void 0===a?void 0:a.size))return;t.ports[0].postMessage({status:"ack",eventId:n,eventType:r});const i=Array.from(a).map(async e=>e(t.origin,s)),o=await function(e){return Promise.all(e.map(async e=>{try{return{fulfilled:!0,value:await e}}catch(t){return{fulfilled:!1,reason:t}}}))}(i);t.ports[0].postMessage({status:"done",eventId:n,eventType:r,response:o})}_subscribe(e,t){0===Object.keys(this.handlersMap).length&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[e]||(this.handlersMap[e]=new Set),this.handlersMap[e].add(t)}_unsubscribe(e,t){this.handlersMap[e]&&t&&this.handlersMap[e].delete(t),t&&0!==this.handlersMap[e].size||delete this.handlersMap[e],0===Object.keys(this.handlersMap).length&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}}function _t(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,n="";for(let r=0;r<t;r++)n+=Math.floor(10*Math.random());return e+n}Pt.receivers=[];class It{constructor(e){this.target=e,this.handlers=new Set}removeMessageHandler(e){e.messageChannel&&(e.messageChannel.port1.removeEventListener("message",e.onMessage),e.messageChannel.port1.close()),this.handlers.delete(e)}async _send(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:50;const r="undefined"!==typeof MessageChannel?new MessageChannel:null;if(!r)throw new Error("connection_unavailable");let s,a;return new Promise((i,o)=>{const l=_t("",20);r.port1.start();const c=setTimeout(()=>{o(new Error("unsupported_event"))},n);a={messageChannel:r,onMessage(e){const t=e;if(t.data.eventId===l)switch(t.data.status){case"ack":clearTimeout(c),s=setTimeout(()=>{o(new Error("timeout"))},3e3);break;case"done":clearTimeout(s),i(t.data.response);break;default:clearTimeout(c),clearTimeout(s),o(new Error("invalid_response"))}}},this.handlers.add(a),r.port1.addEventListener("message",a.onMessage),this.target.postMessage({eventType:e,eventId:l,data:t},[r.port2])}).finally(()=>{a&&this.removeMessageHandler(a)})}}function Dt(){return window}
2function Rt(){return"undefined"!==typeof Dt().WorkerGlobalScope&&"function"===typeof Dt().importScripts}const Lt="firebaseLocalStorageDb",Mt="firebaseLocalStorage",Ot="fbase_key";class Ft{constructor(e){this.request=e}toPromise(){return new Promise((e,t)=>{this.request.addEventListener("success",()=>{e(this.request.result)}),this.request.addEventListener("error",()=>{t(this.request.error)})})}}function Ut(e,t){return e.transaction([Mt],t?"readwrite":"readonly").objectStore(Mt)}function Bt(){const e=indexedDB.open(Lt,1);return new Promise((t,n)=>{e.addEventListener("error",()=>{n(e.error)}),e.addEventListener("upgradeneeded",()=>{const t=e.result;try{t.createObjectStore(Mt,{keyPath:Ot})}catch(r){n(r)}}),e.addEventListener("success",async()=>{const n=e.result;n.objectStoreNames.contains(Mt)?t(n):(n.close(),await function(){const e=indexedDB.deleteDatabase(Lt);return new Ft(e).toPromise()}(),t(await Bt()))})})}async function zt(e,t,n){const r=Ut(e,!0).put({[Ot]:t,value:n});return new Ft(r).toPromise()}function Vt(e,t){const n=Ut(e,!0).delete(t);return new Ft(n).toPromise()}class qt{constructor(){this.type="LOCAL",this._shouldAllowMigration=!0,this.listeners={},this.localCache={},this.pollTimer=null,this.pendingWrites=0,this.receiver=null,this.sender=null,this.serviceWorkerReceiverAvailable=!1,this.activeServiceWorker=null,this._workerInitializationPromise=this.initializeServiceWorkerMessaging().then(()=>{},()=>{})}async _openDb(){return this.db||(this.db=await Bt()),this.db}async _withRetries(e){let t=0;for(;;)try{const t=await this._openDb();return await e(t)}catch(n){if(t++>3)throw n;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return Rt()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=Pt._getInstance(Rt()?self:null),this.receiver._subscribe("keyChanged",async(e,t)=>({keyProcessed:(await this._poll()).includes(t.key)})),this.receiver._subscribe("ping",async(e,t)=>["keyChanged"])}async initializeSender(){var e,t;if(this.activeServiceWorker=await async function(){if(!(null===navigator||void 0===navigator?void 0:navigator.serviceWorker))return null;try{return(await navigator.serviceWorker.ready).active}catch(e){return null}}(),!this.activeServiceWorker)return;this.sender=new It(this.activeServiceWorker);const n=await this.sender._send("ping",{},800);n&&(null===(e=n[0])||void 0===e?void 0:e.fulfilled)&&(null===(t=n[0])||void 0===t?void 0:t.value.includes("keyChanged"))&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(e){if(this.sender&&this.activeServiceWorker&&function(){var e;return(null===(e=null===navigator||void 0===navigator?void 0:navigator.serviceWorker)||void 0===e?void 0:e.controller)||null}()===this.activeServiceWorker)try{await this.sender._send("keyChanged",{key:e},this.serviceWorkerReceiverAvailable?800:50)}catch(t){}}async _isAvailable(){try{if(!indexedDB)return!1;const e=await Bt();return await zt(e,wt,"1"),await Vt(e,wt),!0}catch(e){}return!1}async _withPendingWrite(e){this.pendingWrites++;try{await e()}finally{this.pendingWrites--}}async _set(e,t){return this._withPendingWrite(async()=>(await this._withRetries(n=>zt(n,e,t)),this.localCache[e]=t,this.notifyServiceWorker(e)))}async _get(e){const t=await this._withRetries(t=>async function(e,t){const n=Ut(e,!1).get(t),r=await new Ft(n).toPromise();return void 0===r?null:r.value}(t,e));return this.localCache[e]=t,t}async _remove(e){return this._withPendingWrite(async()=>(await this._withRetries(t=>Vt(t,e)),delete this.localCache[e],this.notifyServiceWorker(e)))}async _poll(){const e=await this._withRetries(e=>{const t=Ut(e,!1).getAll();return new Ft(t).toPromise()});if(!e)return[];if(0!==this.pendingWrites)return[];const t=[],n=new Set;if(0!==e.length)for(const{fbase_key:r,value:s}of e)n.add(r),JSON.stringify(this.localCache[r])!==JSON.stringify(s)&&(this.notifyListeners(r,s),t.push(r));for(const r of Object.keys(this.localCache))this.localCache[r]&&!n.has(r)&&(this.notifyListeners(r,null),t.push(r));return t}notifyListeners(e,t){this.localCache[e]=t;const n=this.listeners[e];if(n)for(const r of Array.from(n))r(t)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(async()=>this._poll(),800)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(e,t){0===Object.keys(this.listeners).length&&this.startPolling(),this.listeners[e]||(this.listeners[e]=new Set,this._get(e)),this.listeners[e].add(t)}_removeListener(e,t){this.listeners[e]&&(this.listeners[e].delete(t),0===this.listeners[e].size&&delete this.listeners[e]),0===Object.keys(this.listeners).length&&this.stopPolling()}}qt.type="LOCAL";const Wt=qt;function Ht(e,t){return I(e,"POST","/v2/accounts/mfaSignIn:start",_(e,t))}Ae("rcb"),new A(3e4,6e4);const Gt="recaptcha";async function Yt(e,t,n){var r;if(!e._getRecaptchaConfig())try{await Ie(e)}catch(s){console.log("Failed to initialize reCAPTCHA Enterprise config. Triggering the reCAPTCHA v2 verification.")}try{let s;if(s="string"===typeof t?{phoneNumber:t}
2:t,"session"in s){const t=s.session;if("phoneNumber"in s){y("enroll"===t.type,e,"internal-error");const r={idToken:t.credential,phoneEnrollmentInfo:{phoneNumber:s.phoneNumber,clientType:"CLIENT_TYPE_WEB"}},a=_e(e,r,"mfaSmsEnrollment",async(e,t)=>{if(t.phoneEnrollmentInfo.captchaResponse===Ce){y((null===n||void 0===n?void 0:n.type)===Gt,e,"argument-error");return vt(e,await Kt(e,t,n))}return vt(e,t)},"PHONE_PROVIDER");return(await a.catch(e=>Promise.reject(e))).phoneSessionInfo.sessionInfo}{y("signin"===t.type,e,"internal-error");const a=(null===(r=s.multiFactorHint)||void 0===r?void 0:r.uid)||s.multiFactorUid;y(a,e,"missing-multi-factor-info");const i={mfaPendingCredential:t.credential,mfaEnrollmentId:a,phoneSignInInfo:{clientType:"CLIENT_TYPE_WEB"}},o=_e(e,i,"mfaSmsSignIn",async(e,t)=>{if(t.phoneSignInInfo.captchaResponse===Ce){y((null===n||void 0===n?void 0:n.type)===Gt,e,"argument-error");return Ht(e,await Kt(e,t,n))}return Ht(e,t)},"PHONE_PROVIDER");return(await o.catch(e=>Promise.reject(e))).phoneResponseInfo.sessionInfo}}{const t={phoneNumber:s.phoneNumber,clientType:"CLIENT_TYPE_WEB"},r=_e(e,t,"sendVerificationCode",async(e,t)=>{if(t.captchaResponse===Ce){y((null===n||void 0===n?void 0:n.type)===Gt,e,"argument-error");return We(e,await Kt(e,t,n))}return We(e,t)},"PHONE_PROVIDER");return(await r.catch(e=>Promise.reject(e))).sessionInfo}}finally{null===n||void 0===n||n._reset()}}async function Kt(e,t,n){y(n.type===Gt,e,"argument-error");const r=await n.verify();y("string"===typeof r,e,"argument-error");const s=Object.assign({},t);if("phoneEnrollmentInfo"in s){const e=s.phoneEnrollmentInfo.phoneNumber,t=s.phoneEnrollmentInfo.captchaResponse,n=s.phoneEnrollmentInfo.clientType,a=s.phoneEnrollmentInfo.recaptchaVersion;return Object.assign(s,{phoneEnrollmentInfo:{phoneNumber:e,recaptchaToken:r,captchaResponse:t,clientType:n,recaptchaVersion:a}}),s}if("phoneSignInInfo"in s){const e=s.phoneSignInInfo.captchaResponse,t=s.phoneSignInInfo.clientType,n=s.phoneSignInInfo.recaptchaVersion;return Object.assign(s,{phoneSignInInfo:{recaptchaToken:r,captchaResponse:e,clientType:t,recaptchaVersion:n}}),s}return Object.assign(s,{recaptchaToken:r}),s}class Jt{constructor(e){this.providerId=Jt.PROVIDER_ID,this.auth=we(e)}verifyPhoneNumber(e,t){return Yt(this.auth,e,(0,s.Ku)(t))}static credential(e,t){return Ge._fromVerification(e,t)}static credentialFromResult(e){const t=e;return Jt.credentialFromTaggedObject(t)}static credentialFromError(e){return Jt.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject(e){let{_tokenResponse:t}=e;if(!t)return null;const{phoneNumber:n,temporaryProof:r}=t;return n&&r?Ge._fromTokenResponse(n,r):null}}function $t(e,t){return t?ne(t):(y(e._popupRedirectResolver,e,"argument-error"),e._popupRedirectResolver)}Jt.PROVIDER_ID="phone",Jt.PHONE_SIGN_IN_METHOD="phone";class Qt extends Me{constructor(e){super("custom","custom"),this.params=e}_getIdTokenResponse(e){return Ve(e,this._buildIdpRequest())}_linkToIdToken(e,t){return Ve(e,this._buildIdpRequest(t))}_getReauthenticationResolver(e){return Ve(e,this._buildIdpRequest())}_buildIdpRequest(e){const t={requestUri:this.params.requestUri,sessionId:this.params.sessionId,postBody:this.params.postBody,tenantId:this.params.tenantId,pendingToken:this.params.pendingToken,returnSecureToken:!0,returnIdpCredential:!0};return e&&(t.idToken=e),t}}function Xt(e){return lt(e.auth,new Qt(e),e.bypassAuthState)}function Zt(e){const{auth:t,user:n}=e;return y(n,t,"internal-error"),ot(n,new Qt(e),e.bypassAuthState)}async function en(e){const{auth:t,user:n}=e;return y(n,t,"internal-error"),it(n,new Qt(e),e.bypassAuthState)}class tn{constructor(e,t,n,r){let s=arguments.length>4&&void 0!==arguments[4]&&arguments[4];this.auth=e,this.resolver=n,this.user=r,this.bypassAuthState=s,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(t)?t:[t]}execute(){return new Promise(async(e,t)=>{this.pendingPromise={resolve:e,reject:t};try{this.eventManager=await this.resolver._initialize(this.auth),await this.onExecution(),this.eventManager.registerConsumer(this)}catch(n){this.reject(n)}})}async onAuthEvent(e){const{urlResponse:t,sessionId:n,postBody:r,tenantId:s,error:a,type:i}=e;if(a)return void this.reject(a);const o={auth:this.auth,requestUri:t,sessionId:n,tenantId:s||void 0,postBody:r||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(i)(o))}catch(l){this.reject(l)}}onError(e){this.reject(e)}getIdpTask(e){switch(e){case"signInViaPopup":case"signInViaRedirect":return Xt;case"linkViaPopup":case"linkViaRedirect":return en;case"reauthViaPopup":case"reauthViaRedirect":return Zt;default:h(this.auth,"internal-error")}}resolve(e){w(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(e),this.unregisterAndCleanUp()}reject(e){w(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.reject(e),this.unregisterAndCleanUp()}unregisterAndCleanUp(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}}const nn=new A(2e3,1e4);async function rn(e,t,n){if((0,r.xZ)(e.app))return Promise.reject(p(e,"operation-not-supported-in-this-environment"));const s=we(e);x(e,t,Je);const a=$t(s,n);return new sn(s,"signInViaPopup",t,a).executeNotNull()}
2class sn extends tn{constructor(e,t,n,r,s){super(e,t,r,s),this.provider=n,this.authWindow=null,this.pollId=null,sn.currentPopupAction&&sn.currentPopupAction.cancel(),sn.currentPopupAction=this}async executeNotNull(){const e=await this.execute();return y(e,this.auth,"internal-error"),e}async onExecution(){w(1===this.filter.length,"Popup operations only handle one event");const e=_t();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],e),this.authWindow.associatedEvent=e,this.resolver._originValidation(this.auth).catch(e=>{this.reject(e)}),this.resolver._isIframeWebStorageSupported(this.auth,e=>{e||this.reject(p(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()}get eventId(){var e;return(null===(e=this.authWindow)||void 0===e?void 0:e.associatedEvent)||null}cancel(){this.reject(p(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,sn.currentPopupAction=null}pollUserCancellation(){const e=()=>{var t,n;(null===(n=null===(t=this.authWindow)||void 0===t?void 0:t.window)||void 0===n?void 0:n.closed)?this.pollId=window.setTimeout(()=>{this.pollId=null,this.reject(p(this.auth,"popup-closed-by-user"))},8e3):this.pollId=window.setTimeout(e,nn.get())};e()}}sn.currentPopupAction=null;const an=new Map;class on extends tn{constructor(e,t){super(e,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],t,void 0,arguments.length>2&&void 0!==arguments[2]&&arguments[2]),this.eventId=null}async execute(){let e=an.get(this.auth._key());if(!e){try{const t=await async function(e,t){const n=dn(t),r=cn(e);if(!await r._isAvailable())return!1;const s="true"===await r._get(n);return await r._remove(n),s}(this.resolver,this.auth)?await super.execute():null;e=()=>Promise.resolve(t)}catch(t){e=()=>Promise.reject(t)}an.set(this.auth._key(),e)}return this.bypassAuthState||an.set(this.auth._key(),()=>Promise.resolve(null)),e()}async onAuthEvent(e){if("signInViaRedirect"===e.type)return super.onAuthEvent(e);if("unknown"!==e.type){if(e.eventId){const t=await this.auth._redirectUserForId(e.eventId);if(t)return this.user=t,super.onAuthEvent(e);this.resolve(null)}}else this.resolve(null)}async onExecution(){}cleanUp(){}}function ln(e,t){an.set(e._key(),t)}function cn(e){return ne(e._redirectPersistence)}function dn(e){return ae("pendingRedirect",e.config.apiKey,e.name)}async function un(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if((0,r.xZ)(e.app))return Promise.reject(f(e));const s=we(e),a=$t(s,t),i=new on(s,a,n),o=await i.execute();return o&&!n&&(delete o.user._redirectEventId,await s._persistUserIfCurrent(o.user),await s._setRedirectUser(null,t)),o}class mn{constructor(e){this.auth=e,this.cachedEventUids=new Set,this.consumers=new Set,this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1,this.lastProcessedEventTime=Date.now()}registerConsumer(e){this.consumers.add(e),this.queuedRedirectEvent&&this.isEventForConsumer(this.queuedRedirectEvent,e)&&(this.sendToConsumer(this.queuedRedirectEvent,e),this.saveEventToCache(this.queuedRedirectEvent),this.queuedRedirectEvent=null)}unregisterConsumer(e){this.consumers.delete(e)}onEvent(e){if(this.hasEventBeenHandled(e))return!1;let t=!1;return this.consumers.forEach(n=>{this.isEventForConsumer(e,n)&&(t=!0,this.sendToConsumer(e,n),this.saveEventToCache(e))}),this.hasHandledPotentialRedirect||!function(e){switch(e.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return pn(e);default:return!1}}(e)||(this.hasHandledPotentialRedirect=!0,t||(this.queuedRedirectEvent=e,t=!0)),t}sendToConsumer(e,t){var n;if(e.error&&!pn(e)){const r=(null===(n=e.error.code)||void 0===n?void 0:n.split("auth/")[1])||"internal-error";t.onError(p(this.auth,r))}else t.onAuthEvent(e)}isEventForConsumer(e,t){const n=null===t.eventId||!!e.eventId&&e.eventId===t.eventId;return t.filter.includes(e.type)&&n}hasEventBeenHandled(e){return Date.now()-this.lastProcessedEventTime>=6e5&&this.cachedEventUids.clear(),this.cachedEventUids.has(hn(e))}saveEventToCache(e){this.cachedEventUids.add(hn(e)),this.lastProcessedEventTime=
2Date.now()}}function hn(e){return[e.type,e.eventId,e.sessionId,e.tenantId].filter(e=>e).join("-")}function pn(e){let{type:t,error:n}=e;return"unknown"===t&&(null===n||void 0===n?void 0:n.code)==="auth/".concat("no-auth-event")}const gn=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,fn=/^https?/;async function xn(e){if(e.config.emulator)return;const{authorizedDomains:t}=await async function(e){return I(e,"GET","/v1/projects",arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})}(e);for(const r of t)try{if(bn(r))return}catch(n){}h(e,"unauthorized-domain")}function bn(e){const t=j(),{protocol:n,hostname:r}=new URL(t);if(e.startsWith("chrome-extension://")){const s=new URL(e);return""===s.hostname&&""===r?"chrome-extension:"===n&&e.replace("chrome-extension://","")===t.replace("chrome-extension://",""):"chrome-extension:"===n&&s.hostname===r}if(!fn.test(n))return!1;if(gn.test(e))return r===e;const s=e.replace(/\./g,"\\.");return new RegExp("^(.+\\."+s+"|"+s+")$","i").test(r)}const yn=new A(3e4,6e4);function vn(){const e=Dt().___jsl;if(null===e||void 0===e?void 0:e.H)for(const t of Object.keys(e.H))if(e.H[t].r=e.H[t].r||[],e.H[t].L=e.H[t].L||[],e.H[t].r=[...e.H[t].L],e.CP)for(let n=0;n<e.CP.length;n++)e.CP[n]=null}function wn(e){return new Promise((t,n)=>{var r,s,a;function i(){vn(),gapi.load("gapi.iframes",{callback:()=>{t(gapi.iframes.getContext())},ontimeout:()=>{vn(),n(p(e,"network-request-failed"))},timeout:yn.get()})}if(null===(s=null===(r=Dt().gapi)||void 0===r?void 0:r.iframes)||void 0===s?void 0:s.Iframe)t(gapi.iframes.getContext());else{if(!(null===(a=Dt().gapi)||void 0===a?void 0:a.load)){const t=Ae("iframefcb");return Dt()[t]=()=>{gapi.load?i():n(p(e,"network-request-failed"))},ke("".concat(Ne.gapiScript,"?onload=").concat(t)).catch(e=>n(e))}i()}}).catch(e=>{throw jn=null,e})}let jn=null;const Nn=new A(5e3,15e3),kn={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},An=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function Sn(e){const t=e.config;y(t.authDomain,e,"auth-domain-config-required");const n=t.emulator?S(t,"emulator/auth/iframe"):"https://".concat(e.config.authDomain,"/").concat("__/auth/iframe"),a={apiKey:t.apiKey,appName:e.name,v:r.MF},i=An.get(e.config.apiHost);i&&(a.eid=i);const o=e._getFrameworks();return o.length&&(a.fw=o.join(",")),"".concat(n,"?").concat((0,s.Am)(a).slice(1))}async function En(e){const t=await function(e){return jn=jn||wn(e),jn}(e),n=Dt().gapi;return y(n,e,"internal-error"),t.open({where:document.body,url:Sn(e),messageHandlersFilter:n.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:kn,dontclear:!0},t=>new Promise(async(n,r)=>{await t.restyle({setHideOnLeave:!1});const s=p(e,"network-request-failed"),a=Dt().setTimeout(()=>{r(s)},Nn.get());function i(){Dt().clearTimeout(a),n(t)}t.ping(i).then(i,()=>{r(s)})}))}const Cn={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"};class Tn{constructor(e){this.window=e,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch(e){}}}function Pn(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:500,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:600;const i=Math.max((window.screen.availHeight-a)/2,0).toString(),o=Math.max((window.screen.availWidth-r)/2,0).toString();let l="";const c=Object.assign(Object.assign({},Cn),{width:r.toString(),height:a.toString(),top:i,left:o}),d=(0,s.ZQ)().toLowerCase();n&&(l=de(d)?"_blank":n),le(d)&&(t=t||"http://localhost",c.scrollbars="yes");const u=Object.entries(c).reduce((e,t)=>{let[n,r]=t;return"".concat(e).concat(n,"=").concat(r,",")},"");if(function(){var e;return ge(arguments.length>0&&void 0!==arguments[0]?arguments[0]:(0,s.ZQ)())&&!!(null===(e=window.navigator)||void 0===e?void 0:e.standalone)}(d)&&"_self"!==l)return function(e,t){const n=document.createElement("a");n.href=e,n.target=t;const r=document.createEvent("MouseEvent");r.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),n.dispatchEvent(r)}(t||"",l),new Tn(null);const m=window.open(t||"",l,u);y(m,e,"popup-blocked");try{m.focus()}catch(h){}return new Tn(m)}const _n="__/auth/handler",In="emulator/auth/handler",Dn=encodeURIComponent("fac");async function Rn(e,t,n,a,i,o){y(e.config.authDomain,e,"auth-domain-config-required"),y(e.config.apiKey,e,"invali
2d-api-key");const l={apiKey:e.config.apiKey,appName:e.name,authType:n,redirectUrl:a,v:r.MF,eventId:i};if(t instanceof Je){t.setDefaultLanguage(e.languageCode),l.providerId=t.providerId||"",(0,s.Im)(t.getCustomParameters())||(l.customParameters=JSON.stringify(t.getCustomParameters()));for(const[e,t]of Object.entries(o||{}))l[e]=t}if(t instanceof $e){const e=t.getScopes().filter(e=>""!==e);e.length>0&&(l.scopes=e.join(","))}e.tenantId&&(l.tid=e.tenantId);const c=l;for(const r of Object.keys(c))void 0===c[r]&&delete c[r];const d=await e._getAppCheckToken(),u=d?"#".concat(Dn,"=").concat(encodeURIComponent(d)):"";return"".concat(function(e){let{config:t}=e;if(!t.emulator)return"https://".concat(t.authDomain,"/").concat(_n);return S(t,In)}(e),"?").concat((0,s.Am)(c).slice(1)).concat(u)}const Ln="webStorageSupport";const Mn=class{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=Tt,this._completeRedirectFn=un,this._overrideRedirectResult=ln}async _openPopup(e,t,n,r){var s;w(null===(s=this.eventManagers[e._key()])||void 0===s?void 0:s.manager,"_initialize() not called before _openPopup()");return Pn(e,await Rn(e,t,n,j(),r),_t())}async _openRedirect(e,t,n,r){await this._originValidation(e);return function(e){Dt().location.href=e}(await Rn(e,t,n,j(),r)),new Promise(()=>{})}_initialize(e){const t=e._key();if(this.eventManagers[t]){const{manager:e,promise:n}=this.eventManagers[t];return e?Promise.resolve(e):(w(n,"If manager is not set, promise should be"),n)}const n=this.initAndGetManager(e);return this.eventManagers[t]={promise:n},n.catch(()=>{delete this.eventManagers[t]}),n}async initAndGetManager(e){const t=await En(e),n=new mn(e);return t.register("authEvent",t=>{y(null===t||void 0===t?void 0:t.authEvent,e,"invalid-auth-event");return{status:n.onEvent(t.authEvent)?"ACK":"ERROR"}},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[e._key()]={manager:n},this.iframes[e._key()]=t,n}_isIframeWebStorageSupported(e,t){this.iframes[e._key()].send(Ln,{type:Ln},n=>{var r;const s=null===(r=null===n||void 0===n?void 0:n[0])||void 0===r?void 0:r[Ln];void 0!==s&&t(!!s),h(e,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(e){const t=e._key();return this.originValidationPromises[t]||(this.originValidationPromises[t]=xn(e)),this.originValidationPromises[t]}get _shouldInitProactively(){return fe()||ce()||ge()}};var On="@firebase/auth",Fn="1.10.1";class Un{constructor(e){this.auth=e,this.internalListeners=new Map}getUid(){var e;return this.assertAuthConfigured(),(null===(e=this.auth.currentUser)||void 0===e?void 0:e.uid)||null}async getToken(e){if(this.assertAuthConfigured(),await this.auth._initializationPromise,!this.auth.currentUser)return null;return{accessToken:await this.auth.currentUser.getIdToken(e)}}addAuthTokenListener(e){if(this.assertAuthConfigured(),this.internalListeners.has(e))return;const t=this.auth.onIdTokenChanged(t=>{e((null===t||void 0===t?void 0:t.stsTokenManager.accessToken)||null)});this.internalListeners.set(e,t),this.updateProactiveRefresh()}removeAuthTokenListener(e){this.assertAuthConfigured();const t=this.internalListeners.get(e);t&&(this.internalListeners.delete(e),t(),this.updateProactiveRefresh())}assertAuthConfigured(){y(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}const Bn=(0,s.XA)("authIdTokenMaxAge")||300;let zn=null;const Vn=e=>async t=>{const n=t&&await t.getIdTokenResult(),r=n&&((new Date).getTime()-Date.parse(n.issuedAtTime))/1e3;if(r&&r>Bn)return;const s=null===n||void 0===n?void 0:n.token;zn!==s&&(zn=s,await fetch(e,{method:s?"POST":"DELETE",headers:s?{Authorization:"Bearer ".concat(s)}:{}}))};function qn(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:(0,r.Sx)();const t=(0,r.j6)(e,"auth");if(t.isInitialized())return t.getImmediate();const n=function(e,t){const n=(0,r.j6)(e,"auth");if(n.isInitialized()){const e=n.getImmediate(),r=n.getOptions();if((0,s.bD)(r,null!==t&&void 0!==t?t:{}))return e;h(e,"already-initialized")}return n.initialize({options:t})}(e,{popupRedirectResolver:Mn,persistence:[Wt,kt,Tt]}),a=(0,s.XA)("authTokenSyncURL");if(a&&"boolean"===typeof isSecureContext&&isSecureContext){const e=new URL(a,location.origin);if(location.origin===e.origin){const t=Vn(e.toString());!function(e,t,n){(0,s.Ku)(e).beforeAuthStateChanged(t,n)}(n,t,()=>t(n.currentUser)),function(e,t,n,r){(0,s.Ku)(e).onIdTokenChanged(t,n,r)}(n,e=>t(e))}}const i=(0,s.Tj)("auth");return i&&De(n,"http://".concat(i)),n}var Wn;Ne={loadJS:e=>
2new Promise((t,n)=>{const r=document.createElement("script");r.setAttribute("src",e),r.onload=t,r.onerror=e=>{const t=p("internal-error");t.customData=e,n(t)},r.type="text/javascript",r.charset="UTF-8",function(){var e,t;return null!==(t=null===(e=document.getElementsByTagName("head"))||void 0===e?void 0:e[0])&&void 0!==t?t:document}().appendChild(r)}),gapiScript:"https://apis.google.com/js/api.js",recaptchaV2Script:"https://www.google.com/recaptcha/api.js",recaptchaEnterpriseScript:"https://www.google.com/recaptcha/enterprise.js?render="},Wn="Browser",(0,r.om)(new o.uA("auth",(e,t)=>{let{options:n}=t;const r=e.getProvider("app").getImmediate(),s=e.getProvider("heartbeat"),a=e.getProvider("app-check-internal"),{apiKey:i,authDomain:o}=r.options;y(i&&!i.includes(":"),"invalid-api-key",{appName:r.name});const l={apiKey:i,authDomain:o,clientPlatform:Wn,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:xe(Wn)},c=new ve(r,s,a,l);return function(e,t){const n=(null===t||void 0===t?void 0:t.persistence)||[],r=(Array.isArray(n)?n:[n]).map(ne);(null===t||void 0===t?void 0:t.errorMap)&&e._updateErrorMap(t.errorMap),e._initializeWithPersistence(r,null===t||void 0===t?void 0:t.popupRedirectResolver)}(c,n),c},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((e,t,n)=>{e.getProvider("auth-internal").initialize()})),(0,r.om)(new o.uA("auth-internal",e=>(e=>new Un(e))(we(e.getProvider("auth").getImmediate())),"PRIVATE").setInstantiationMode("EXPLICIT")),(0,r.KO)(On,Fn,function(e){switch(e){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";case"WebExtension":return"web-extension";default:return}}(Wn)),(0,r.KO)(On,Fn,"esm2017")},366:e=>{var t="undefined"!==typeof Element,n="function"===typeof Map,r="function"===typeof Set,s="function"===typeof ArrayBuffer&&!!ArrayBuffer.isView;function a(e,i){if(e===i)return!0;if(e&&i&&"object"==typeof e&&"object"==typeof i){if(e.constructor!==i.constructor)return!1;var o,l,c,d;if(Array.isArray(e)){if((o=e.length)!=i.length)return!1;for(l=o;0!==l--;)if(!a(e[l],i[l]))return!1;return!0}if(n&&e instanceof Map&&i instanceof Map){if(e.size!==i.size)return!1;for(d=e.entries();!(l=d.next()).done;)if(!i.has(l.value[0]))return!1;for(d=e.entries();!(l=d.next()).done;)if(!a(l.value[1],i.get(l.value[0])))return!1;return!0}if(r&&e instanceof Set&&i instanceof Set){if(e.size!==i.size)return!1;for(d=e.entries();!(l=d.next()).done;)if(!i.has(l.value[0]))return!1;return!0}if(s&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(i)){if((o=e.length)!=i.length)return!1;for(l=o;0!==l--;)if(e[l]!==i[l])return!1;return!0}if(e.constructor===RegExp)return e.source===i.source&&e.flags===i.flags;if(e.valueOf!==Object.prototype.valueOf&&"function"===typeof e.valueOf&&"function"===typeof i.valueOf)return e.valueOf()===i.valueOf();if(e.toString!==Object.prototype.toString&&"function"===typeof e.toString&&"function"===typeof i.toString)return e.toString()===i.toString();if((o=(c=Object.keys(e)).length)!==Object.keys(i).length)return!1;for(l=o;0!==l--;)if(!Object.prototype.hasOwnProperty.call(i,c[l]))return!1;if(t&&e instanceof Element)return!1;for(l=o;0!==l--;)if(("_owner"!==c[l]&&"__v"!==c[l]&&"__o"!==c[l]||!e.$$typeof)&&!a(e[c[l]],i[c[l]]))return!1;return!0}return e!==e&&i!==i}e.exports=function(e,t){try{return a(e,t)}catch(n){if((n.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw n}}},379:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(705);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach(function(t){(0,r.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}},391:(e,t,n)=>{"use strict";!function e(){if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}(),e.exports=n(4)},395:(e,t,n)=>{"use strict";n.d(t,{Uz:()=>S,Qg:()=>E});var r=n(150),s=n(529),a=n(812);const i="type.googleapis.com/google.protobuf.Int64Value",o="type.googleapis.com/google.protobuf.UInt64Value";function l(e,t){const n={};for(const r in e)e.hasOwnProperty(r)&&(n[r]=t(e[r]));return n}function c(e){if(null==e)return null;if(e instanceof Number&&(e=e.valueOf()),"number"===typeof e&&isFinite(e))return e;if(!0===e||!1===e)return e;if("[object String]"===Object.prototype.toString.call(e))return e;if(e instanceof Date)return e.toISOString();if(Array.isArray(e))return e.map(e=>c(e));if("function"===typeof e||"object"===typeof e)return l(e,e=>c(e));throw new Error("Data cannot be encoded in JSON: "+e)}function d(e){if(null==e)return e;if(e["@type"])switch(e["@type"]){case i:case o:{const t=Number(e.value);if(isNaN(t))throw new Error("Data cannot be decoded from JSON: "+e);return t}default:throw new Error("Data cannot be decoded from JSON: "+e)}return Array.isArray(e)?e.map(e=>d(e)):"function"===typeof e||"object"===typeof e?l(e,e=>d(e)):e}const u="functions",m={OK:"ok",CANCELLED:"cancelled",UNKNOWN:"unknown",INVALID_ARGUMENT:"invalid-argument",DEADLINE_EXCEEDED:"deadline-exceeded",NOT_FOUND:"not-found",ALREADY_EXISTS:"already-exists",PERMISSION_DENIED:"permission-denied",UNAUTHENTICATED:"unauthenticated",RESOURCE_EXHAUSTED:"resource-exhausted",FAILED_PRECONDITION:"failed-precondition",ABORTED:"aborted",OUT_OF_RANGE:"out-of-range",UNIMPLEMENT
2ED:"unimplemented",INTERNAL:"internal",UNAVAILABLE:"unavailable",DATA_LOSS:"data-loss"};class h extends s.g{constructor(e,t,n){super("".concat(u,"/").concat(e),t||""),this.details=n,Object.setPrototypeOf(this,h.prototype)}}function p(e,t){let n,r=function(e){if(e>=200&&e<300)return"ok";switch(e){case 0:case 500:return"internal";case 400:return"invalid-argument";case 401:return"unauthenticated";case 403:return"permission-denied";case 404:return"not-found";case 409:return"aborted";case 429:return"resource-exhausted";case 499:return"cancelled";case 501:return"unimplemented";case 503:return"unavailable";case 504:return"deadline-exceeded"}return"unknown"}(e),s=r;try{const e=t&&t.error;if(e){const t=e.status;if("string"===typeof t){if(!m[t])return new h("internal","internal");r=m[t],s=t}const a=e.message;"string"===typeof a&&(s=a),n=e.details,void 0!==n&&(n=d(n))}}catch(a){}return"ok"===r?null:new h(r,s,n)}class g{constructor(e,t,n,s){this.app=e,this.auth=null,this.messaging=null,this.appCheck=null,this.serverAppAppCheckToken=null,(0,r.xZ)(e)&&e.settings.appCheckToken&&(this.serverAppAppCheckToken=e.settings.appCheckToken),this.auth=t.getImmediate({optional:!0}),this.messaging=n.getImmediate({optional:!0}),this.auth||t.get().then(e=>this.auth=e,()=>{}),this.messaging||n.get().then(e=>this.messaging=e,()=>{}),this.appCheck||null===s||void 0===s||s.get().then(e=>this.appCheck=e,()=>{})}async getAuthToken(){if(this.auth)try{const e=await this.auth.getToken();return null===e||void 0===e?void 0:e.accessToken}catch(e){return}}async getMessagingToken(){if(this.messaging&&"Notification"in self&&"granted"===Notification.permission)try{return await this.messaging.getToken()}catch(e){return}}async getAppCheckToken(e){if(this.serverAppAppCheckToken)return this.serverAppAppCheckToken;if(this.appCheck){const t=e?await this.appCheck.getLimitedUseToken():await this.appCheck.getToken();return t.error?null:t.token}return null}async getContext(e){return{authToken:await this.getAuthToken(),messagingToken:await this.getMessagingToken(),appCheckToken:await this.getAppCheckToken(e)}}}const f="us-central1",x=/^data: (.*?)(?:\n|$)/;class b{constructor(e,t,n,r){let s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:f,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:function(){return fetch(...arguments)};this.app=e,this.fetchImpl=a,this.emulatorOrigin=null,this.contextProvider=new g(e,t,n,r),this.cancelAllRequests=new Promise(e=>{this.deleteService=()=>Promise.resolve(e())});try{const e=new URL(s);this.customDomain=e.origin+("/"===e.pathname?"":e.pathname),this.region=f}catch(i){this.customDomain=null,this.region=s}}_delete(){return this.deleteService()}_url(e){const t=this.app.options.projectId;if(null!==this.emulatorOrigin){const n=this.emulatorOrigin;return"".concat(n,"/").concat(t,"/").concat(this.region,"/").concat(e)}return null!==this.customDomain?"".concat(this.customDomain,"/").concat(e):"https://".concat(this.region,"-").concat(t,".cloudfunctions.net/").concat(e)}}function y(e,t,n){const r=r=>function(e,t,n,r){const s=e._url(t);return j(e,s,n,r)}(e,t,r,n||{});return r.stream=(n,r)=>function(e,t,n,r){const s=e._url(t);return N(e,s,n,r||{})}(e,t,n,r),r}async function v(e,t,n,r){let s;n["Content-Type"]="application/json";try{s=await r(e,{method:"POST",body:JSON.stringify(t),headers:n})}catch(i){return{status:0,json:null}}let a=null;try{a=await s.json()}catch(i){}return{status:s.status,json:a}}async function w(e,t){const n={},r=await e.contextProvider.getContext(t.limitedUseAppCheckTokens);return r.authToken&&(n.Authorization="Bearer "+r.authToken),r.messagingToken&&(n["Firebase-Instance-ID-Token"]=r.messagingToken),null!==r.appCheckToken&&(n["X-Firebase-AppCheck"]=r.appCheckToken),n}async function j(e,t,n,r){const s={data:n=c(n)},a=await w(e,r),i=function(e){let t=null;return{promise:new Promise((n,r)=>{t=setTimeout(()=>{r(new h("deadline-exceeded","deadline-exceeded"))},e)}),cancel:()=>{t&&clearTimeout(t)}}}(r.timeout||7e4),o=await Promise.race([v(t,s,a,e.fetchImpl),i.promise,e.cancelAllRequests]);if(i.cancel(),!o)throw new h("cancelled","Firebase Functions instance was deleted.");const l=p(o.status,o.json);if(l)throw l;
2if(!o.json)throw new h("internal","Response is not valid JSON object.");let u=o.json.data;if("undefined"===typeof u&&(u=o.json.result),"undefined"===typeof u)throw new h("internal","Response is missing data field.");return{data:d(u)}}async function N(e,t,n,r){var s;const a={data:n=c(n)},i=await w(e,r);let o,l,u;i["Content-Type"]="application/json",i.Accept="text/event-stream";try{o=await e.fetchImpl(t,{method:"POST",body:JSON.stringify(a),headers:i,signal:null===r||void 0===r?void 0:r.signal})}catch(f){if(f instanceof Error&&"AbortError"===f.name){const e=new h("cancelled","Request was cancelled.");return{data:Promise.reject(e),stream:{[Symbol.asyncIterator]:()=>({next:()=>Promise.reject(e)})}}}const e=p(0,null);return{data:Promise.reject(e),stream:{[Symbol.asyncIterator]:()=>({next:()=>Promise.reject(e)})}}}const m=new Promise((e,t)=>{l=e,u=t});null===(s=null===r||void 0===r?void 0:r.signal)||void 0===s||s.addEventListener("abort",()=>{const e=new h("cancelled","Request was cancelled.");u(e)});const g=function(e,t,n,r){const s=(e,r)=>{const s=e.match(x);if(!s)return;const a=s[1];try{const e=JSON.parse(a);if("result"in e)return void t(d(e.result));if("message"in e)return void r.enqueue(d(e.message));if("error"in e){const t=p(0,e);return r.error(t),void n(t)}}catch(i){if(i instanceof h)return r.error(i),void n(i)}},a=new TextDecoder;return new ReadableStream({start(t){let i="";return o();async function o(){if(null===r||void 0===r?void 0:r.aborted){const e=new h("cancelled","Request was cancelled");return t.error(e),n(e),Promise.resolve()}try{const{value:l,done:c}=await e.read();if(c)return i.trim()&&s(i.trim(),t),void t.close();if(null===r||void 0===r?void 0:r.aborted){const r=new h("cancelled","Request was cancelled");return t.error(r),n(r),void await e.cancel()}i+=a.decode(l,{stream:!0});const d=i.split("\n");i=d.pop()||"";for(const e of d)e.trim()&&s(e.trim(),t);return o()}catch(l){const e=l instanceof h?l:p(0,null);t.error(e),n(e)}}},cancel:()=>e.cancel()})}(o.body.getReader(),l,u,null===r||void 0===r?void 0:r.signal);return{stream:{[Symbol.asyncIterator](){const e=g.getReader();return{async next(){const{value:t,done:n}=await e.read();return{value:t,done:n}},return:async()=>(await e.cancel(),{done:!0,value:void 0})}}},data:m}}const k="@firebase/functions",A="0.12.3";function S(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:(0,r.Sx)(),t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:f;const n=(0,r.j6)((0,s.Ku)(e),u).getImmediate({identifier:t}),a=(0,s.yU)("functions");return a&&function(e,t,n){!function(e,t,n){e.emulatorOrigin="http://".concat(t,":").concat(n)}((0,s.Ku)(e),t,n)}(n,...a),n}function E(e,t,n){return y((0,s.Ku)(e),t,n)}var C;(0,r.om)(new a.uA(u,(e,t)=>{let{instanceIdentifier:n}=t;const r=e.getProvider("app").getImmediate(),s=e.getProvider("auth-internal"),a=e.getProvider("messaging-internal"),i=e.getProvider("app-check-internal");return new b(r,s,a,i,n)},"PUBLIC").setMultipleInstances(!0)),(0,r.KO)(k,A,C),(0,r.KO)(k,A,"esm2017")},443:(e,t,n)=>{"use strict";n.d(t,{$b:()=>s,Vy:()=>c});const r=[];var s;!function(e){e[e.DEBUG=0]="DEBUG",e[e.VERBOSE=1]="VERBOSE",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR",e[e.SILENT=5]="SILENT"}(s||(s={}));const a={debug:s.DEBUG,verbose:s.VERBOSE,info:s.INFO,warn:s.WARN,error:s.ERROR,silent:s.SILENT},i=s.INFO,o={[s.DEBUG]:"log",[s.VERBOSE]:"log",[s.INFO]:"info",[s.WARN]:"warn",[s.ERROR]:"error"},l=function(e,t){if(t<e.logLevel)return;const n=(new Date).toISOString(),r=o[t];if(!r)throw new Error("Attempted to log a message with an invalid logType (value: ".concat(t,")"));for(var s=arguments.length,a=new Array(s>2?s-2:0),i=2;i<s;i++)a[i-2]=arguments[i];console[r]("[".concat(n,"] ").concat(e.name,":"),...a)};class c{constructor(e){this.name=e,this._logLevel=i,this._logHandler=l,this._userLogHandler=null,r.push(this)}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in s))throw new TypeError('Invalid value "'.concat(e,'" assigned to `logLevel`'));this._logLevel=e}setLogLevel(e){this._logLevel="string"===typeof e?a[e]:e}get logHandler(){return this._logHandler}set logHandler(e){if("function"!==typeof e)throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=e}get userLogHandler(){return this._userLogHandler}set userLogHandler(e){this._userLogHandler=e}debug(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this._userLogHandler&&this._userLogHandler(this,s.DEBUG,...t),this._logHandler(this,s.DEBUG,...t)}log(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this._userLogHandler&&this._userLogHandler(this,s.VERBOSE,...t),this._logHandler(this,s.VERBOSE,...t)}info(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this._userLogHandler&&this._userLogHandler(this,s.INFO,...t),this._logHandler(this,s.INFO,...t)}warn(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this._userLogHandler&&this._userLogHandler(this,s.WARN,...t),this._logHandler(this,s.WARN,...t)}error(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this._userLogHandler&&this._userLogHandler(this,s.ERROR,...t),this._logHandler(this,s.ERROR,...t)}}}
2,472:(e,t,n)=>{"use strict";n.d(t,{Dc:()=>ne,addDoc:()=>pc,C3:()=>vc,hq:()=>yc,collection:()=>Qo,kd:()=>hc,doc:()=>Xo,x7:()=>lc,getDocs:()=>dc,aU:()=>sl,GV:()=>wc,limit:()=>Ql,aQ:()=>gc,orderBy:()=>Jl,query:()=>Wl,serverTimestamp:()=>bc,BN:()=>uc,updateDoc:()=>mc,where:()=>Gl});var r,s,a=n(150),i=n(812),o=n(443),l=n(529),c="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:{},d={};(function(){var e;function t(){this.blockSize=-1,this.blockSize=64,this.g=Array(4),this.B=Array(this.blockSize),this.o=this.h=0,this.s()}function n(e,t,n){n||(n=0);var r=Array(16);if("string"===typeof t)for(var s=0;16>s;++s)r[s]=t.charCodeAt(n++)|t.charCodeAt(n++)<<8|t.charCodeAt(n++)<<16|t.charCodeAt(n++)<<24;else for(s=0;16>s;++s)r[s]=t[n++]|t[n++]<<8|t[n++]<<16|t[n++]<<24;t=e.g[0],n=e.g[1],s=e.g[2];var a=e.g[3],i=t+(a^n&(s^a))+r[0]+3614090360&4294967295;i=(n=(s=(a=(t=(n=(s=(a=(t=(n=(s=(a=(t=(n=(s=(a=(t=(n=(s=(a=(t=(n=(s=(a=(t=(n=(s=(a=(t=(n=(s=(a=(t=(n=(s=(a=(t=(n=(s=(a=(t=(n=(s=(a=(t=(n=(s=(a=(t=(n=(s=(a=(t=(n=(s=(a=(t=(n=(s=(a=(t=n+(i<<7&4294967295|i>>>25))+((i=a+(s^t&(n^s))+r[1]+3905402710&4294967295)<<12&4294967295|i>>>20))+((i=s+(n^a&(t^n))+r[2]+606105819&4294967295)<<17&4294967295|i>>>15))+((i=n+(t^s&(a^t))+r[3]+3250441966&4294967295)<<22&4294967295|i>>>10))+((i=t+(a^n&(s^a))+r[4]+4118548399&4294967295)<<7&4294967295|i>>>25))+((i=a+(s^t&(n^s))+r[5]+1200080426&4294967295)<<12&4294967295|i>>>20))+((i=s+(n^a&(t^n))+r[6]+2821735955&4294967295)<<17&4294967295|i>>>15))+((i=n+(t^s&(a^t))+r[7]+4249261313&4294967295)<<22&4294967295|i>>>10))+((i=t+(a^n&(s^a))+r[8]+1770035416&4294967295)<<7&4294967295|i>>>25))+((i=a+(s^t&(n^s))+r[9]+2336552879&4294967295)<<12&4294967295|i>>>20))+((i=s+(n^a&(t^n))+r[10]+4294925233&4294967295)<<17&4294967295|i>>>15))+((i=n+(t^s&(a^t))+r[11]+2304563134&4294967295)<<22&4294967295|i>>>10))+((i=t+(a^n&(s^a))+r[12]+1804603682&4294967295)<<7&4294967295|i>>>25))+((i=a+(s^t&(n^s))+r[13]+4254626195&4294967295)<<12&4294967295|i>>>20))+((i=s+(n^a&(t^n))+r[14]+2792965006&4294967295)<<17&4294967295|i>>>15))+((i=n+(t^s&(a^t))+r[15]+1236535329&4294967295)<<22&4294967295|i>>>10))+((i=t+(s^a&(n^s))+r[1]+4129170786&4294967295)<<5&4294967295|i>>>27))+((i=a+(n^s&(t^n))+r[6]+3225465664&4294967295)<<9&4294967295|i>>>23))+((i=s+(t^n&(a^t))+r[11]+643717713&4294967295)<<14&4294967295|i>>>18))+((i=n+(a^t&(s^a))+r[0]+3921069994&4294967295)<<20&4294967295|i>>>12))+((i=t+(s^a&(n^s))+r[5]+3593408605&4294967295)<<5&4294967295|i>>>27))+((i=a+(n^s&(t^n))+r[10]+38016083&4294967295)<<9&4294967295|i>>>23))+((i=s+(t^n&(a^t))+r[15]+3634488961&4294967295)<<14&4294967295|i>>>18))+((i=n+(a^t&(s^a))+r[4]+3889429448&4294967295)<<20&4294967295|i>>>12))+((i=t+(s^a&(n^s))+r[9]+568446438&4294967295)<<5&4294967295|i>>>27))+((i=a+(n^s&(t^n))+r[14]+3275163606&4294967295)<<9&4294967295|i>>>23))+((i=s+(t^n&(a^t))+r[3]+4107603335&4294967295)<<14&4294967295|i>>>18))+((i=n+(a^t&(s^a))+r[8]+1163531501&4294967295)<<20&4294967295|i>>>12))+((i=t+(s^a&(n^s))+r[13]+2850285829&4294967295)<<5&4294967295|i>>>27))+((i=a+(n^s&(t^n))+r[2]+4243563512&4294967295)<<9&4294967295|i>>>23))+((i=s+(t^n&(a^t))+r[7]+1735328473&4294967295)<<14&4294967295|i>>>18))+((i=n+(a^t&(s^a))+r[12]+2368359562&4294967295)<<20&4294967295|i>>>12))+((i=t+(n^s^a)+r[5]+4294588738&4294967295)<<4&4294967295|i>>>28))+((i=a+(t^n^s)+r[8]+2272392833&4294967295)<<11&4294967295|i>>>21))+((i=s+(a^t^n)+r[11]+1839030562&4294967295)<<16&4294967295|i>>>16))+((i=n+(s^a^t)+r[14]+4259657740&4294967295)<<23&4294967295|i>>>9))+((i=t+(n^s^a)+r[1]+2763975236&4294967295)<<4&4294967295|i>>>28))+((i=a+(t^n^s)+r[4]+1272893353&4294967295)<<11&4294967295|i>>>21))+((i=s+(a^t^n)+r[7]+4139469664&4294967295)<<16&4294967295|i>>>16))+((i=n+(s^a^t)+r[10]+3200236656&4294967295)<<23&4294967295|i>>>9))+((i=t+(n^s^a)+r[13]+681279174&4294967295)<<4&4294967295|i>>>28))+((i=a+(t^n^s)+r[0]+3936430074&4294967295)<<11&4294967295|i>>>21))+((i=s+(a^t^n)+r[3]+3572445317&4294967295)<<16&4294967295|i>>>16))+((i=n+(s^a^t)+r[6]+76029189&4294967295)<<23&4294967295|i>>>9))+((i=t+(n^s^a)+r[9]+3654602809&4294967295)<<4&4294967295|i>>>28))+((i=a+(t^n^s)+r[12]+3873151461&4294967295)<<11&4294967295|i>>>21))+((i=s+(a^t^n)+r[15]+530742520&4294967295)<<16&4294967295|i>>>16))+((i=n+(s^a^t)+r[2]+3299628645&4294967295)<<23&4294967295|i>>>9))+((i=t+(s^(n|~a))+r[0]+4096336452&4294967295)<<6&4294967295|i>>>26))+((i=a+(n^(t|~s))+r[7]+1126891415&4294967295)<<10&4294967295|i>>>22))+((i=s+(t^(a|~n))+r[14]+2878612391&4294967295)<<15&4294967295|i>>>17))+((i=n+(a^(s|~t))+r[5]+4237533241&4294967295)<<21&4294967295|i>>>11))+((i=t+(s^(n|~a))+r[12]+1700485571&4294967295)<<6&4294967295|i>>>26))+((i=a+(n^(t|~s))+r[3]+2399980690&4294967295)<<10&4294967295|i>>>22))+((i=s+(t^(a|~n))+r[10]+4293915773&4294967295)<<15&4294967295|i>>>17))+((i=n+(a^(s|~t))+r[1]+2240044497&4294967295)<<21&4294967295|i>>>11))+((i=t+(s^(n|~a))+r[8]+1873313359&4294967295)<<6&4294967295|i>>>26))+((i=a+(n^(t|~s))+r[15]+4264355552&4294967295)<<10&4294967295|i>>>22))+((i=s+(t^(a|~n))+r[6]+2734768916&4294967295)<<15&4294967295|i>>>17))+((i=n+(a^(s|~t))+r[13]+1309151649&4294967295)<<21&4294967295|i>>>11))+((a=(t=n+((i=t+(s^(n|~a))+r[4]+4149444226&4294967295)<<6&4294967295|i>>>
226))+((i=a+(n^(t|~s))+r[11]+3174756917&4294967295)<<10&4294967295|i>>>22))^((s=a+((i=s+(t^(a|~n))+r[2]+718787259&4294967295)<<15&4294967295|i>>>17))|~t))+r[9]+3951481745&4294967295,e.g[0]=e.g[0]+t&4294967295,e.g[1]=e.g[1]+(s+(i<<21&4294967295|i>>>11))&4294967295,e.g[2]=e.g[2]+s&4294967295,e.g[3]=e.g[3]+a&4294967295}function a(e,t){this.h=t;for(var n=[],r=!0,s=e.length-1;0<=s;s--){var a=0|e[s];r&&a==t||(n[s]=a,r=!1)}this.g=n}!function(e,t){function n(){}n.prototype=t.prototype,e.D=t.prototype,e.prototype=new n,e.prototype.constructor=e,e.C=function(e,n,r){for(var s=Array(arguments.length-2),a=2;a<arguments.length;a++)s[a-2]=arguments[a];return t.prototype[n].apply(e,s)}}(t,function(){this.blockSize=-1}),t.prototype.s=function(){this.g[0]=1732584193,this.g[1]=4023233417,this.g[2]=2562383102,this.g[3]=271733878,this.o=this.h=0},t.prototype.u=function(e,t){void 0===t&&(t=e.length);for(var r=t-this.blockSize,s=this.B,a=this.h,i=0;i<t;){if(0==a)for(;i<=r;)n(this,e,i),i+=this.blockSize;if("string"===typeof e){for(;i<t;)if(s[a++]=e.charCodeAt(i++),a==this.blockSize){n(this,s),a=0;break}}else for(;i<t;)if(s[a++]=e[i++],a==this.blockSize){n(this,s),a=0;break}}this.h=a,this.o+=t},t.prototype.v=function(){var e=Array((56>this.h?this.blockSize:2*this.blockSize)-this.h);e[0]=128;for(var t=1;t<e.length-8;++t)e[t]=0;var n=8*this.o;for(t=e.length-8;t<e.length;++t)e[t]=255&n,n/=256;for(this.u(e),e=Array(16),t=n=0;4>t;++t)for(var r=0;32>r;r+=8)e[n++]=this.g[t]>>>r&255;return e};var i={};function o(e){return-128<=e&&128>e?function(e,t){var n=i;return Object.prototype.hasOwnProperty.call(n,e)?n[e]:n[e]=t(e)}(e,function(e){return new a([0|e],0>e?-1:0)}):new a([0|e],0>e?-1:0)}function l(e){if(isNaN(e)||!isFinite(e))return c;if(0>e)return g(l(-e));for(var t=[],n=1,r=0;e>=n;r++)t[r]=e/n|0,n*=4294967296;return new a(t,0)}var c=o(0),u=o(1),m=o(16777216);function h(e){if(0!=e.h)return!1;for(var t=0;t<e.g.length;t++)if(0!=e.g[t])return!1;return!0}function p(e){return-1==e.h}function g(e){for(var t=e.g.length,n=[],r=0;r<t;r++)n[r]=~e.g[r];return new a(n,~e.h).add(u)}function f(e,t){return e.add(g(t))}function x(e,t){for(;(65535&e[t])!=e[t];)e[t+1]+=e[t]>>>16,e[t]&=65535,t++}function b(e,t){this.g=e,this.h=t}function y(e,t){if(h(t))throw Error("division by zero");if(h(e))return new b(c,c);if(p(e))return t=y(g(e),t),new b(g(t.g),g(t.h));if(p(t))return t=y(e,g(t)),new b(g(t.g),t.h);if(30<e.g.length){if(p(e)||p(t))throw Error("slowDivide_ only works with positive integers.");for(var n=u,r=t;0>=r.l(e);)n=v(n),r=v(r);var s=w(n,1),a=w(r,1);for(r=w(r,2),n=w(n,2);!h(r);){var i=a.add(r);0>=i.l(e)&&(s=s.add(n),a=i),r=w(r,1),n=w(n,1)}return t=f(e,s.j(t)),new b(s,t)}for(s=c;0<=e.l(t);){for(n=Math.max(1,Math.floor(e.m()/t.m())),r=48>=(r=Math.ceil(Math.log(n)/Math.LN2))?1:Math.pow(2,r-48),i=(a=l(n)).j(t);p(i)||0<i.l(e);)i=(a=l(n-=r)).j(t);h(a)&&(a=u),s=s.add(a),e=f(e,i)}return new b(s,e)}function v(e){for(var t=e.g.length+1,n=[],r=0;r<t;r++)n[r]=e.i(r)<<1|e.i(r-1)>>>31;return new a(n,e.h)}function w(e,t){var n=t>>5;t%=32;for(var r=e.g.length-n,s=[],i=0;i<r;i++)s[i]=0<t?e.i(i+n)>>>t|e.i(i+n+1)<<32-t:e.i(i+n);return new a(s,e.h)}(e=a.prototype).m=function(){if(p(this))return-g(this).m();for(var e=0,t=1,n=0;n<this.g.length;n++){var r=this.i(n);e+=(0<=r?r:4294967296+r)*t,t*=4294967296}return e},e.toString=function(e){if(2>(e=e||10)||36<e)throw Error("radix out of range: "+e);if(h(this))return"0";if(p(this))return"-"+g(this).toString(e);for(var t=l(Math.pow(e,6)),n=this,r="";;){var s=y(n,t).g,a=((0<(n=f(n,s.j(t))).g.length?n.g[0]:n.h)>>>0).toString(e);if(h(n=s))return a+r;for(;6>a.length;)a="0"+a;r=a+r}},e.i=function(e){return 0>e?0:e<this.g.length?this.g[e]:this.h},e.l=function(e){return p(e=f(this,e))?-1:h(e)?0:1},e.abs=function(){return p(this)?g(this):this},e.add=function(e){for(var t=Math.max(this.g.length,e.g.length),n=[],r=0,s=0;s<=t;s++){var i=r+(65535&this.i(s))+(65535&e.i(s)),o=(i>>>16)+(this.i(s)>>>16)+(e.i(s)>>>16);r=o>>>16,i&=65535,o&=65535,n[s]=o<<16|i}return new a(n,-2147483648&n[n.length-1]?-1:0)},e.j=function(e){if(h(this)||h(e))return c;if(p(this))return p(e)?g(this).j(g(e)):g(g(this).j(e));if(p(e))return g(this.j(g(e)));if(0>this.l(m)&&0>e.l(m))return l(this.m()*e.m());for(var t=this.g.length+e.g.length,n=[],r=0;r<2*t;r++)n[r]=0;for(r=0;r<this.g.length;r++)for(var s=0;s<e.g.length;s++){var i=this.i(r)>>>16,o=65535&this.i(r),d=e.i(s)>>>16,u=65535&e.i(s);n[2*r+2*s]+=o*u,x(n,2*r+2*s),n[2*r+2*s+1]+=i*u,x(n,2*r+2*s+1),n[2*r+2*s+1]+=o*d,x(n,2*r+2*s+1),n[2*r+2*s+2]+=i*d,x(n,2*r+2*s+2)}for(r=0;r<t;r++)n[r]=n[2*r+1]<<16|n[2*r];for(r=t;r<2*t;r++)n[r]=0;return new a(n,0)},e.A=function(e){return y(this,e).h},e.and=function(e){for(var t=Math.max(this.g.length,e.g.length),n=[],r=0;r<t;r++)n[r]=this.i(r)&e.i(r);return new a(n,this.h&e.h)},e.or=function(e){for(var t=Math.max(this.g.length,e.g.length),n=[],r=0;r<t;r++)n[r]=this.i(r)|e.i(r);return new a(n,this.h|e.h)},e.xor=function(e){for(var t=Math.max(this.g.length,e.g.length),n=[],r=0;r<t;r++)n[r]=this.i(r)^e.i(r);return new a(n,this.h^e.h)},t.prototype.digest=t.prototype.v,t.prototype.reset=t.prototype.s,t.prototype.update=t.prototype.u,s=d.Md5=t,a.prototype.add=a.prototype.add,a.prototype.multiply=a.prototype.j,a.prototype.modulo=a.prototype.A,a.prototype.compare=a.prototype.l,a.prototype.toNumber=a.prototype.m,a.prototype.toString=a.prototype.toString,a.prototype.getBits=a.prototype.i,a.fromNumber=l,a.fromString=function e(t,n){if(0==t.length)throw Error("number format error: empty string");if(2>(n=n||10)||36<n)throw Error("radix out of range: "+n);
2if("-"==t.charAt(0))return g(e(t.substring(1),n));if(0<=t.indexOf("-"))throw Error('number format error: interior "-" character');for(var r=l(Math.pow(n,8)),s=c,a=0;a<t.length;a+=8){var i=Math.min(8,t.length-a),o=parseInt(t.substring(a,a+i),n);8>i?(i=l(Math.pow(n,i)),s=s.j(i).add(l(o))):s=(s=s.j(r)).add(l(o))}return s},r=d.Integer=a}).apply("undefined"!==typeof c?c:"undefined"!==typeof self?self:"undefined"!==typeof window?window:{});var u,m,h,p,g,f,x,b,y="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:{},v={};(function(){var e,t="function"==typeof Object.defineProperties?Object.defineProperty:function(e,t,n){return e==Array.prototype||e==Object.prototype||(e[t]=n.value),e};var n=function(e){e=["object"==typeof globalThis&&globalThis,e,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof y&&y];for(var t=0;t<e.length;++t){var n=e[t];if(n&&n.Math==Math)return n}throw Error("Cannot find global object")}(this);!function(e,r){if(r)e:{var s=n;e=e.split(".");for(var a=0;a<e.length-1;a++){var i=e[a];if(!(i in s))break e;s=s[i]}(r=r(a=s[e=e[e.length-1]]))!=a&&null!=r&&t(s,e,{configurable:!0,writable:!0,value:r})}}("Array.prototype.values",function(e){return e||function(){return function(e,t){e instanceof String&&(e+="");var n=0,r=!1,s={next:function(){if(!r&&n<e.length){var s=n++;return{value:t(s,e[s]),done:!1}}return r=!0,{done:!0,value:void 0}}};return s[Symbol.iterator]=function(){return s},s}(this,function(e,t){return t})}});var r=r||{},s=this||self;function a(e){var t=typeof e;return"array"==(t="object"!=t?t:e?Array.isArray(e)?"array":t:"null")||"object"==t&&"number"==typeof e.length}function i(e){var t=typeof e;return"object"==t&&null!=e||"function"==t}function o(e,t,n){return e.call.apply(e.bind,arguments)}function l(e,t,n){if(!e)throw Error();if(2<arguments.length){var r=Array.prototype.slice.call(arguments,2);return function(){var n=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(n,r),e.apply(t,n)}}return function(){return e.apply(t,arguments)}}function c(e,t,n){return(c=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?o:l).apply(null,arguments)}function d(e,t){var n=Array.prototype.slice.call(arguments,1);return function(){var t=n.slice();return t.push.apply(t,arguments),e.apply(this,t)}}function w(e,t){function n(){}n.prototype=t.prototype,e.aa=t.prototype,e.prototype=new n,e.prototype.constructor=e,e.Qb=function(e,n,r){for(var s=Array(arguments.length-2),a=2;a<arguments.length;a++)s[a-2]=arguments[a];return t.prototype[n].apply(e,s)}}function j(e){const t=e.length;if(0<t){const n=Array(t);for(let r=0;r<t;r++)n[r]=e[r];return n}return[]}function N(e,t){for(let n=1;n<arguments.length;n++){const t=arguments[n];if(a(t)){const n=e.length||0,r=t.length||0;e.length=n+r;for(let s=0;s<r;s++)e[n+s]=t[s]}else e.push(t)}}function k(e){return/^[\s\xa0]*$/.test(e)}function A(){var e=s.navigator;return e&&(e=e.userAgent)?e:""}function S(e){return S[" "](e),e}S[" "]=function(){};var E=-1!=A().indexOf("Gecko")&&!(-1!=A().toLowerCase().indexOf("webkit")&&-1==A().indexOf("Edge"))&&!(-1!=A().indexOf("Trident")||-1!=A().indexOf("MSIE"))&&-1==A().indexOf("Edge");function C(e,t,n){for(const r in e)t.call(n,e[r],r,e)}function T(e){const t={};for(const n in e)t[n]=e[n];return t}const P="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function _(e,t){let n,r;for(let s=1;s<arguments.length;s++){for(n in r=arguments[s],r)e[n]=r[n];for(let t=0;t<P.length;t++)n=P[t],Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}}function I(e){var t=1;e=e.split(":");const n=[];for(;0<t&&e.length;)n.push(e.shift()),t--;return e.length&&n.push(e.join(":")),n}function D(e){s.setTimeout(()=>{throw e},0)}function R(){var e=U;let t=null;return e.g&&(t=e.g,e.g=e.g.next,e.g||(e.h=null),t.next=null),t}var L=new class{constructor(e,t){this.i=e,this.j=t,this.h=0,this.g=null}get(){let e;return 0<this.h?(this.h--,e=this.g,this.g=e.next,e.next=null):e=this.i(),e}}(()=>new M,e=>e.reset());class M{constructor(){this.next=this.g=this.h=null}set(e,t){this.h=e,this.g=t,this.next=null}reset(){this.next=this.g=this.h=null}}let O,F=!1,U=new class{constructor(){this.h=this.g=null}add(e,t){const n=L.get();n.set(e,t),this.h?this.h.next=n:this.g=n,this.h=n}},B=()=>{const e=s.Promise.resolve(void 0);O=()=>{e.then(z)}};var z=()=>{for(var e;e=R();){try{e.h.call(e.g)}catch(n){D(n)}var t=L;t.j(e),100>t.h&&(t.h++,e.next=t.g,t.g=e)}F=!1};function V(){this.s=this.s,this.C=this.C}function q(e,t){this.type=e,this.g=this.target=t,this.defaultPrevented=!1}V.prototype.s=!1,V.prototype.ma=function(){this.s||(this.s=!0,this.N())},V.prototype.N=function(){if(this.C)for(;this.C.length;)this.C.shift()()},q.prototype.h=function(){this.defaultPrevented=!0};var W=function(){if(!s.addEventListener||!Object.defineProperty)return!1;var e=!1,t=Object.defineProperty({},"passive",{get:function(){e=!0}});try{const e=()=>{};s.addEventListener("test",e,t),s.removeEventListener("test",e,t)}catch(n){}return e}();function H(e,t){if(q.call(this,e?e.type:""),this.relatedTarget=this.g=this.target=null,this.button=this.screenY=this.screenX=this.clientY=this.clientX=0,this.key="",this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1,this.state=null,this.pointerId=0,this.pointerType="",this.i=null,e){var n=this.type=e.type,r=e.changedTouches&&e.changedTouches.length?e.changedTouches[0]:null;if(this.target=e.target||e.srcElement,this.g=t,t=e.relatedTarget){if(E){e:{try{S(t.nodeName);var s=!0;break e}catch(a){}s=!1}s||(t=null)}}
2else"mouseover"==n?t=e.fromElement:"mouseout"==n&&(t=e.toElement);this.relatedTarget=t,r?(this.clientX=void 0!==r.clientX?r.clientX:r.pageX,this.clientY=void 0!==r.clientY?r.clientY:r.pageY,this.screenX=r.screenX||0,this.screenY=r.screenY||0):(this.clientX=void 0!==e.clientX?e.clientX:e.pageX,this.clientY=void 0!==e.clientY?e.clientY:e.pageY,this.screenX=e.screenX||0,this.screenY=e.screenY||0),this.button=e.button,this.key=e.key||"",this.ctrlKey=e.ctrlKey,this.altKey=e.altKey,this.shiftKey=e.shiftKey,this.metaKey=e.metaKey,this.pointerId=e.pointerId||0,this.pointerType="string"===typeof e.pointerType?e.pointerType:G[e.pointerType]||"",this.state=e.state,this.i=e,e.defaultPrevented&&H.aa.h.call(this)}}w(H,q);var G={2:"touch",3:"pen",4:"mouse"};H.prototype.h=function(){H.aa.h.call(this);var e=this.i;e.preventDefault?e.preventDefault():e.returnValue=!1};var Y="closure_listenable_"+(1e6*Math.random()|0),K=0;function J(e,t,n,r,s){this.listener=e,this.proxy=null,this.src=t,this.type=n,this.capture=!!r,this.ha=s,this.key=++K,this.da=this.fa=!1}function $(e){e.da=!0,e.listener=null,e.proxy=null,e.src=null,e.ha=null}function Q(e){this.src=e,this.g={},this.h=0}function X(e,t){var n=t.type;if(n in e.g){var r,s=e.g[n],a=Array.prototype.indexOf.call(s,t,void 0);(r=0<=a)&&Array.prototype.splice.call(s,a,1),r&&($(t),0==e.g[n].length&&(delete e.g[n],e.h--))}}function Z(e,t,n,r){for(var s=0;s<e.length;++s){var a=e[s];if(!a.da&&a.listener==t&&a.capture==!!n&&a.ha==r)return s}return-1}Q.prototype.add=function(e,t,n,r,s){var a=e.toString();(e=this.g[a])||(e=this.g[a]=[],this.h++);var i=Z(e,t,r,s);return-1<i?(t=e[i],n||(t.fa=!1)):((t=new J(t,this.src,a,!!r,s)).fa=n,e.push(t)),t};var ee="closure_lm_"+(1e6*Math.random()|0),te={};function ne(e,t,n,r,s){if(r&&r.once)return se(e,t,n,r,s);if(Array.isArray(t)){for(var a=0;a<t.length;a++)ne(e,t[a],n,r,s);return null}return n=ue(n),e&&e[Y]?e.K(t,n,i(r)?!!r.capture:!!r,s):re(e,t,n,!1,r,s)}function re(e,t,n,r,s,a){if(!t)throw Error("Invalid event type");var o=i(s)?!!s.capture:!!s,l=ce(e);if(l||(e[ee]=l=new Q(e)),(n=l.add(t,n,r,o,a)).proxy)return n;if(r=function(){function e(n){return t.call(e.src,e.listener,n)}const t=le;return e}(),n.proxy=r,r.src=e,r.listener=n,e.addEventListener)W||(s=o),void 0===s&&(s=!1),e.addEventListener(t.toString(),r,s);else if(e.attachEvent)e.attachEvent(oe(t.toString()),r);else{if(!e.addListener||!e.removeListener)throw Error("addEventListener and attachEvent are unavailable.");e.addListener(r)}return n}function se(e,t,n,r,s){if(Array.isArray(t)){for(var a=0;a<t.length;a++)se(e,t[a],n,r,s);return null}return n=ue(n),e&&e[Y]?e.L(t,n,i(r)?!!r.capture:!!r,s):re(e,t,n,!0,r,s)}function ae(e,t,n,r,s){if(Array.isArray(t))for(var a=0;a<t.length;a++)ae(e,t[a],n,r,s);else r=i(r)?!!r.capture:!!r,n=ue(n),e&&e[Y]?(e=e.i,(t=String(t).toString())in e.g&&(-1<(n=Z(a=e.g[t],n,r,s))&&($(a[n]),Array.prototype.splice.call(a,n,1),0==a.length&&(delete e.g[t],e.h--)))):e&&(e=ce(e))&&(t=e.g[t.toString()],e=-1,t&&(e=Z(t,n,r,s)),(n=-1<e?t[e]:null)&&ie(n))}function ie(e){if("number"!==typeof e&&e&&!e.da){var t=e.src;if(t&&t[Y])X(t.i,e);else{var n=e.type,r=e.proxy;t.removeEventListener?t.removeEventListener(n,r,e.capture):t.detachEvent?t.detachEvent(oe(n),r):t.addListener&&t.removeListener&&t.removeListener(r),(n=ce(t))?(X(n,e),0==n.h&&(n.src=null,t[ee]=null)):$(e)}}}function oe(e){return e in te?te[e]:te[e]="on"+e}function le(e,t){if(e.da)e=!0;else{t=new H(t,this);var n=e.listener,r=e.ha||e.src;e.fa&&ie(e),e=n.call(r,t)}return e}function ce(e){return(e=e[ee])instanceof Q?e:null}var de="__closure_events_fn_"+(1e9*Math.random()>>>0);function ue(e){return"function"===typeof e?e:(e[de]||(e[de]=function(t){return e.handleEvent(t)}),e[de])}function me(){V.call(this),this.i=new Q(this),this.M=this,this.F=null}function he(e,t){var n,r=e.F;if(r)for(n=[];r;r=r.F)n.push(r);if(e=e.M,r=t.type||t,"string"===typeof t)t=new q(t,e);else if(t instanceof q)t.target=t.target||e;else{var s=t;_(t=new q(r,e),s)}if(s=!0,n)for(var a=n.length-1;0<=a;a--){var i=t.g=n[a];s=pe(i,r,!0,t)&&s}if(s=pe(i=t.g=e,r,!0,t)&&s,s=pe(i,r,!1,t)&&s,n)for(a=0;a<n.length;a++)s=pe(i=t.g=n[a],r,!1,t)&&s}function pe(e,t,n,r){if(!(t=e.i.g[String(t)]))return!0;t=t.concat();for(var s=!0,a=0;a<t.length;++a){var i=t[a];if(i&&!i.da&&i.capture==n){var o=i.listener,l=i.ha||i.src;i.fa&&X(e.i,i),s=!1!==o.call(l,r)&&s}}return s&&!r.defaultPrevented}function ge(e,t,n){if("function"===typeof e)n&&(e=c(e,n));else{if(!e||"function"!=typeof e.handleEvent)throw Error("Invalid listener argument");e=c(e.handleEvent,e)}return 2147483647<Number(t)?-1:s.setTimeout(e,t||0)}function fe(e){e.g=ge(()=>{e.g=null,e.i&&(e.i=!1,fe(e))},e.l);const t=e.h;e.h=null,e.m.apply(null,t)}w(me,V),me.prototype[Y]=!0,me.prototype.removeEventListener=function(e,t,n,r){ae(this,e,t,n,r)},me.prototype.N=function(){if(me.aa.N.call(this),this.i){var e,t=this.i;for(e in t.g){for(var n=t.g[e],r=0;r<n.length;r++)$(n[r]);delete t.g[e],t.h--}}this.F=null},me.prototype.K=function(e,t,n,r){return this.i.add(String(e),t,!1,n,r)},me.prototype.L=function(e,t,n,r){return this.i.add(String(e),t,!0,n,r)};class xe extends V{constructor(e,t){super(),this.m=e,this.l=t,this.h=null,this.i=!1,this.g=null}j(e){this.h=arguments,this.g?this.i=!0:fe(this)}N(){super.N(),this.g&&(s.clearTimeout(this.g),this.g=null,this.i=!1,this.h=null)}}function be(e){V.call(this),this.h=e,this.g={}}w(be,V);var ye=[];function ve(e){C(e.g,function(e,t){this.g.hasOwnProperty(t)&&ie(e)},e),e.g={}}be.prototype.N=function(){be.aa.N.call(this),ve(this)},be.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented")};var we=s.JSON.stringify,je=s.JSON.parse,Ne=class{stringify(e){return s.JSON.stringify(e,void 0)}parse(e){return s.JSON.parse(e,void 0)}};function ke(){}function Ae(e){return e.h||(e.h=e.i())}function Se(){}ke.prototype.h=null;var Ee={OPEN:"a",kb:"b",Ja:"c",wb:"d"};function Ce(){q.call(this,"d")}function Te(){q.call(this,"c")}w(Ce,q),w(Te,q);var Pe={},_e=null;function Ie(){return _e=_e||new me}function De(e){q.call(this,Pe.La,e)}function Re(e){const t=Ie();he(t,new De(t))}function Le(e,t){q.call(this,Pe.STAT_EVENT,e),this.stat=t}function Me(e){const t=Ie();he(t,new Le(t,e))}function Oe(e,t){q.call(this,Pe.Ma,e),this.size=t}function Fe(e,t){if("function"!==typeof e)throw Error("Fn must not be null and must be a function");return s.setTimeout(function(){e()},t)}function Ue(){this.g=!0}function Be(e,t,n,r){e.info(function(){return"XMLHTTP TEXT ("+t+"): "+function(e,t){if(!e.g)return t;if(!t)return null;try{var n=JSON.parse(t);if(n)for(e=0;e<n.length;e++)if(Array.isArray(n[e])){var r=n[e];if(!(2>r.length)){var s=r[1];if(Array.isArray(s)&&!(1>s.length)){var a=s[0];if("noop"!=a&&"stop"!=a&&"close"!=a)for(var i=1;i<s.length;i++)s[i]=""}}}return we(n)}catch(o){return t}}(e,n)+(r?" "+r:"")})}Pe.La="serverreachability",w(De,q),Pe.STAT_EVENT="statevent",w(Le,q),Pe.Ma="timingevent",w(Oe,q),Ue.prototype.xa=function(){this.g=!1},Ue.prototype.info=function(){};var ze,Ve={NO_ERROR:0,gb:1,tb:2,sb:3,nb:4,rb:5,ub:6,Ia:7,TIMEOUT:8,xb:9},qe={lb:"complete",Hb:"success",Ja:"error",Ia:"abort",zb:"ready",Ab:"readystatechange",TIMEOUT:"timeout",vb:"incrementaldata",yb:"progress",ob:"downloadprogress",Pb:"uploadprogress"};function We(){}function He(e,t,n,r){this.j=e,this.i=t,this.l=n,this.R=r||1,this.U=new be(this),this.I=45e3,this.H=null,this.o=!1,this.m=this.A=this.v=this.L=this.F=this.S=this.B=null,this.D=[],this.g=null,this.C=0,this.s=this.u=null,this.X=-1,this.J=!1,this.O=0,this.M=null,this.W=this.K=this.T=this.P=!1,this.h=new Ge}function Ge(){this.i=null,this.g="",this.h=!1}w(We,ke),We.prototype.g=function(){return new XMLHttpRequest},We.prototype.i=function(){return{}},ze=new We;var Ye={},Ke={};function Je(e,t,n){e.L=1,e.v=wt(ft(t)),e.m=n,e.P=!0,$e(e,null)}function $e(e,t){e.F=Date.now(),Ze(e),e.A=ft(e.v);var n=e.A,r=e.R;Array.isArray(r)||(r=[String(r)]),Lt(n.i,"t",r),e.C=0,n=e.j.J,e.h=new Ge,e.g=Nn(e.j,n?t:null,!e.m),
20<e.O&&(e.M=new xe(c(e.Y,e,e.g),e.O)),t=e.U,n=e.g,r=e.ca;var s="readystatechange";Array.isArray(s)||(s&&(ye[0]=s.toString()),s=ye);for(var a=0;a<s.length;a++){var i=ne(n,s[a],r||t.handleEvent,!1,t.h||t);if(!i)break;t.g[i.key]=i}t=e.H?T(e.H):{},e.m?(e.u||(e.u="POST"),t["Content-Type"]="application/x-www-form-urlencoded",e.g.ea(e.A,e.u,e.m,t)):(e.u="GET",e.g.ea(e.A,e.u,null,t)),Re(),function(e,t,n,r,s,a){e.info(function(){if(e.g)if(a)for(var i="",o=a.split("&"),l=0;l<o.length;l++){var c=o[l].split("=");if(1<c.length){var d=c[0];c=c[1];var u=d.split("_");i=2<=u.length&&"type"==u[1]?i+(d+"=")+c+"&":i+(d+"=redacted&")}}else i=null;else i=a;return"XMLHTTP REQ ("+r+") [attempt "+s+"]: "+t+"\n"+n+"\n"+i})}(e.i,e.u,e.A,e.l,e.R,e.m)}function Qe(e){return!!e.g&&("GET"==e.u&&2!=e.L&&e.j.Ca)}function Xe(e,t){var n=e.C,r=t.indexOf("\n",n);return-1==r?Ke:(n=Number(t.substring(n,r)),isNaN(n)?Ye:(r+=1)+n>t.length?Ke:(t=t.slice(r,r+n),e.C=r+n,t))}function Ze(e){e.S=Date.now()+e.I,et(e,e.I)}function et(e,t){if(null!=e.B)throw Error("WatchDog timer not null");e.B=Fe(c(e.ba,e),t)}function tt(e){e.B&&(s.clearTimeout(e.B),e.B=null)}function nt(e){0==e.j.G||e.J||bn(e.j,e)}function rt(e){tt(e);var t=e.M;t&&"function"==typeof t.ma&&t.ma(),e.M=null,ve(e.U),e.g&&(t=e.g,e.g=null,t.abort(),t.ma())}function st(e,t){try{var n=e.j;if(0!=n.G&&(n.g==e||ct(n.h,e)))if(!e.K&&ct(n.h,e)&&3==n.G){try{var r=n.Da.g.parse(t)}catch(d){r=null}if(Array.isArray(r)&&3==r.length){var s=r;if(0==s[0]){e:if(!n.u){if(n.g){if(!(n.g.F+3e3<e.F))break e;xn(n),on(n)}pn(n),Me(18)}}else n.za=s[1],0<n.za-n.T&&37500>s[2]&&n.F&&0==n.v&&!n.C&&(n.C=Fe(c(n.Za,n),6e3));if(1>=lt(n.h)&&n.ca){try{n.ca()}catch(d){}n.ca=void 0}}else vn(n,11)}else if((e.K||n.g==e)&&xn(n),!k(t))for(s=n.Da.g.parse(t),t=0;t<s.length;t++){let c=s[t];if(n.T=c[0],c=c[1],2==n.G)if("c"==c[0]){n.K=c[1],n.ia=c[2];const t=c[3];null!=t&&(n.la=t,n.j.info("VER="+n.la));const s=c[4];null!=s&&(n.Aa=s,n.j.info("SVER="+n.Aa));const d=c[5];null!=d&&"number"===typeof d&&0<d&&(r=1.5*d,n.L=r,n.j.info("backChannelRequestTimeoutMs_="+r)),r=n;const u=e.g;if(u){const e=u.g?u.g.getResponseHeader("X-Client-Wire-Protocol"):null;if(e){var a=r.h;a.g||-1==e.indexOf("spdy")&&-1==e.indexOf("quic")&&-1==e.indexOf("h2")||(a.j=a.l,a.g=new Set,a.h&&(dt(a,a.h),a.h=null))}if(r.D){const e=u.g?u.g.getResponseHeader("X-HTTP-Session-Id"):null;e&&(r.ya=e,vt(r.I,r.D,e))}}n.G=3,n.l&&n.l.ua(),n.ba&&(n.R=Date.now()-e.F,n.j.info("Handshake RTT: "+n.R+"ms"));var i=e;if((r=n).qa=jn(r,r.J?r.ia:null,r.W),i.K){ut(r.h,i);var o=i,l=r.L;l&&(o.I=l),o.B&&(tt(o),Ze(o)),r.g=i}else hn(r);0<n.i.length&&cn(n)}else"stop"!=c[0]&&"close"!=c[0]||vn(n,7);else 3==n.G&&("stop"==c[0]||"close"==c[0]?"stop"==c[0]?vn(n,7):an(n):"noop"!=c[0]&&n.l&&n.l.ta(c),n.v=0)}Re()}catch(d){}}He.prototype.ca=function(e){e=e.target;const t=this.M;t&&3==tn(e)?t.j():this.Y(e)},He.prototype.Y=function(e){try{if(e==this.g)e:{const m=tn(this.g);var t=this.g.Ba();this.g.Z();if(!(3>m)&&(3!=m||this.g&&(this.h.h||this.g.oa()||nn(this.g)))){this.J||4!=m||7==t||Re(),tt(this);var n=this.g.Z();this.X=n;t:if(Qe(this)){var r=nn(this.g);e="";var a=r.length,i=4==tn(this.g);if(!this.h.i){if("undefined"===typeof TextDecoder){rt(this),nt(this);var o="";break t}this.h.i=new s.TextDecoder}for(t=0;t<a;t++)this.h.h=!0,e+=this.h.i.decode(r[t],{stream:!(i&&t==a-1)});r.length=0,this.h.g+=e,this.C=0,o=this.h.g}else o=this.g.oa();if(this.o=200==n,function(e,t,n,r,s,a,i){e.info(function(){return"XMLHTTP RESP ("+r+") [ attempt "+s+"]: "+t+"\n"+n+"\n"+a+" "+i})}(this.i,this.u,this.A,this.l,this.R,m,n),this.o){if(this.T&&!this.K){t:{if(this.g){var l,c=this.g;if((l=c.g?c.g.getResponseHeader("X-HTTP-Initial-Response"):null)&&!k(l)){var d=l;break t}}d=null}if(!(n=d)){this.o=!1,this.s=3,Me(12),rt(this),nt(this);break e}Be(this.i,this.l,n,"Initial handshake response via X-HTTP-Initial-Response"),this.K=!0,st(this,n)}if(this.P){let e;for(n=!0;!this.J&&this.C<o.length;){if(e=Xe(this,o),e==Ke){4==m&&(this.s=4,Me(14),n=!1),Be(this.i,this.l,null,"[Incomplete Response]");break}if(e==Ye){this.s=4,Me(15),Be(this.i,this.l,o,"[Invalid Chunk]"),n=!1;break}Be(this.i,this.l,e,null),st(this,e)}if(Qe(this)&&0!=this.C&&(this.h.g=this.h.g.slice(this.C),this.C=0),4!=m||0!=o.length||this.h.h||(this.s=1,Me(16),n=!1),this.o=this.o&&n,n){if(0<o.length&&!this.W){this.W=!0;var u=this.j;
2u.g==this&&u.ba&&!u.M&&(u.j.info("Great, no buffering proxy detected. Bytes received: "+o.length),gn(u),u.M=!0,Me(11))}}else Be(this.i,this.l,o,"[Invalid Chunked Response]"),rt(this),nt(this)}else Be(this.i,this.l,o,null),st(this,o);4==m&&rt(this),this.o&&!this.J&&(4==m?bn(this.j,this):(this.o=!1,Ze(this)))}else(function(e){const t={};e=(e.g&&2<=tn(e)&&e.g.getAllResponseHeaders()||"").split("\r\n");for(let r=0;r<e.length;r++){if(k(e[r]))continue;var n=I(e[r]);const s=n[0];if("string"!==typeof(n=n[1]))continue;n=n.trim();const a=t[s]||[];t[s]=a,a.push(n)}!function(e,t){for(const n in e)t.call(void 0,e[n],n,e)}(t,function(e){return e.join(", ")})})(this.g),400==n&&0<o.indexOf("Unknown SID")?(this.s=3,Me(12)):(this.s=0,Me(13)),rt(this),nt(this)}}}catch(m){}},He.prototype.cancel=function(){this.J=!0,rt(this)},He.prototype.ba=function(){this.B=null;const e=Date.now();0<=e-this.S?(function(e,t){e.info(function(){return"TIMEOUT: "+t})}(this.i,this.A),2!=this.L&&(Re(),Me(17)),rt(this),this.s=2,nt(this)):et(this,this.S-e)};var at=class{constructor(e,t){this.g=e,this.map=t}};function it(e){this.l=e||10,s.PerformanceNavigationTiming?e=0<(e=s.performance.getEntriesByType("navigation")).length&&("hq"==e[0].nextHopProtocol||"h2"==e[0].nextHopProtocol):e=!!(s.chrome&&s.chrome.loadTimes&&s.chrome.loadTimes()&&s.chrome.loadTimes().wasFetchedViaSpdy),this.j=e?this.l:1,this.g=null,1<this.j&&(this.g=new Set),this.h=null,this.i=[]}function ot(e){return!!e.h||!!e.g&&e.g.size>=e.j}function lt(e){return e.h?1:e.g?e.g.size:0}function ct(e,t){return e.h?e.h==t:!!e.g&&e.g.has(t)}function dt(e,t){e.g?e.g.add(t):e.h=t}function ut(e,t){e.h&&e.h==t?e.h=null:e.g&&e.g.has(t)&&e.g.delete(t)}function mt(e){if(null!=e.h)return e.i.concat(e.h.D);if(null!=e.g&&0!==e.g.size){let t=e.i;for(const n of e.g.values())t=t.concat(n.D);return t}return j(e.i)}function ht(e,t){if(e.forEach&&"function"==typeof e.forEach)e.forEach(t,void 0);else if(a(e)||"string"===typeof e)Array.prototype.forEach.call(e,t,void 0);else for(var n=function(e){if(e.na&&"function"==typeof e.na)return e.na();if(!e.V||"function"!=typeof e.V){if("undefined"!==typeof Map&&e instanceof Map)return Array.from(e.keys());if(!("undefined"!==typeof Set&&e instanceof Set)){if(a(e)||"string"===typeof e){var t=[];e=e.length;for(var n=0;n<e;n++)t.push(n);return t}t=[],n=0;for(const r in e)t[n++]=r;return t}}}(e),r=function(e){if(e.V&&"function"==typeof e.V)return e.V();if("undefined"!==typeof Map&&e instanceof Map||"undefined"!==typeof Set&&e instanceof Set)return Array.from(e.values());if("string"===typeof e)return e.split("");if(a(e)){for(var t=[],n=e.length,r=0;r<n;r++)t.push(e[r]);return t}for(r in t=[],n=0,e)t[n++]=e[r];return t}(e),s=r.length,i=0;i<s;i++)t.call(void 0,r[i],n&&n[i],e)}it.prototype.cancel=function(){if(this.i=mt(this),this.h)this.h.cancel(),this.h=null;else if(this.g&&0!==this.g.size){for(const e of this.g.values())e.cancel();this.g.clear()}};var pt=RegExp("^(?:([^:/?#.]+):)?(?://(?:([^\\\\/?#]*)@)?([^\\\\/?#]*?)(?::([0-9]+))?(?=[\\\\/?#]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#([\\s\\S]*))?$");function gt(e){if(this.g=this.o=this.j="",this.s=null,this.m=this.l="",this.h=!1,e instanceof gt){this.h=e.h,xt(this,e.j),this.o=e.o,this.g=e.g,bt(this,e.s),this.l=e.l;var t=e.i,n=new _t;n.i=t.i,t.g&&(n.g=new Map(t.g),n.h=t.h),yt(this,n),this.m=e.m}else e&&(t=String(e).match(pt))?(this.h=!1,xt(this,t[1]||"",!0),this.o=jt(t[2]||""),this.g=jt(t[3]||"",!0),bt(this,t[4]),this.l=jt(t[5]||"",!0),yt(this,t[6]||"",!0),this.m=jt(t[7]||"")):(this.h=!1,this.i=new _t(null,this.h))}function ft(e){return new gt(e)}function xt(e,t,n){e.j=n?jt(t,!0):t,e.j&&(e.j=e.j.replace(/:$/,""))}function bt(e,t){if(t){if(t=Number(t),isNaN(t)||0>t)throw Error("Bad port number "+t);e.s=t}else e.s=null}function yt(e,t,n){t instanceof _t?(e.i=t,function(e,t){t&&!e.j&&(It(e),e.i=null,e.g.forEach(function(e,t){var n=t.toLowerCase();t!=n&&(Dt(this,t),Lt(this,n,e))},e)),e.j=t}(e.i,e.h)):(n||(t=Nt(t,Tt)),e.i=new _t(t,e.h))}function vt(e,t,n){e.i.set(t,n)}function wt(e){return vt(e,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^Date.now()).toString(36)),e}function jt(e,t){return e?t?decodeURI(e.replace(/%25/g,"%2525")):decodeURIComponent(e):""}function Nt(e,t,n){return"string"===typeof e?(e=encodeURI(e).replace(t,kt),n&&(e=e.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),e):null}function kt(e){return"%"+((e=e.charCodeAt(0))>>4&15).toString(16)+(15&e).toString(16)}gt.prototype.toString=function(){var e=[],t=this.j;t&&e.push(Nt(t,St,!0),":");var n=this.g;return(n||"file"==t)&&(e.push("//"),(t=this.o)&&e.push(Nt(t,St,!0),"@"),e.push(encodeURIComponent(String(n)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),null!=(n=this.s)&&e.push(":",String(n))),(n=this.l)&&(this.g&&"/"!=n.charAt(0)&&e.push("/"),e.push(Nt(n,"/"==n.charAt(0)?Ct:Et,!0))),(n=this.i.toString())&&e.push("?",n),(n=this.m)&&e.push("#",Nt(n,Pt)),e.join("")};
2var At,St=/[#\/\?@]/g,Et=/[#\?:]/g,Ct=/[#\?]/g,Tt=/[#\?@]/g,Pt=/#/g;function _t(e,t){this.h=this.g=null,this.i=e||null,this.j=!!t}function It(e){e.g||(e.g=new Map,e.h=0,e.i&&function(e,t){if(e){e=e.split("&");for(var n=0;n<e.length;n++){var r=e[n].indexOf("="),s=null;if(0<=r){var a=e[n].substring(0,r);s=e[n].substring(r+1)}else a=e[n];t(a,s?decodeURIComponent(s.replace(/\+/g," ")):"")}}}(e.i,function(t,n){e.add(decodeURIComponent(t.replace(/\+/g," ")),n)}))}function Dt(e,t){It(e),t=Mt(e,t),e.g.has(t)&&(e.i=null,e.h-=e.g.get(t).length,e.g.delete(t))}function Rt(e,t){return It(e),t=Mt(e,t),e.g.has(t)}function Lt(e,t,n){Dt(e,t),0<n.length&&(e.i=null,e.g.set(Mt(e,t),j(n)),e.h+=n.length)}function Mt(e,t){return t=String(t),e.j&&(t=t.toLowerCase()),t}function Ot(e,t,n,r,s){try{s&&(s.onload=null,s.onerror=null,s.onabort=null,s.ontimeout=null),r(n)}catch(a){}}function Ft(){this.g=new Ne}function Ut(e,t,n){const r=n||"";try{ht(e,function(e,n){let s=e;i(e)&&(s=we(e)),t.push(r+n+"="+encodeURIComponent(s))})}catch(s){throw t.push(r+"type="+encodeURIComponent("_badmap")),s}}function Bt(e){this.l=e.Ub||null,this.j=e.eb||!1}function zt(e,t){me.call(this),this.D=e,this.o=t,this.m=void 0,this.status=this.readyState=0,this.responseType=this.responseText=this.response=this.statusText="",this.onreadystatechange=null,this.u=new Headers,this.h=null,this.B="GET",this.A="",this.g=!1,this.v=this.j=this.l=null}function Vt(e){e.j.read().then(e.Pa.bind(e)).catch(e.ga.bind(e))}function qt(e){e.readyState=4,e.l=null,e.j=null,e.v=null,Wt(e)}function Wt(e){e.onreadystatechange&&e.onreadystatechange.call(e)}function Ht(e){let t="";return C(e,function(e,n){t+=n,t+=":",t+=e,t+="\r\n"}),t}function Gt(e,t,n){e:{for(r in n){var r=!1;break e}r=!0}r||(n=Ht(n),"string"===typeof e?null!=n&&encodeURIComponent(String(n)):vt(e,t,n))}function Yt(e){me.call(this),this.headers=new Map,this.o=e||null,this.h=!1,this.v=this.g=null,this.D="",this.m=0,this.l="",this.j=this.B=this.u=this.A=!1,this.I=null,this.H="",this.J=!1}(e=_t.prototype).add=function(e,t){It(this),this.i=null,e=Mt(this,e);var n=this.g.get(e);return n||this.g.set(e,n=[]),n.push(t),this.h+=1,this},e.forEach=function(e,t){It(this),this.g.forEach(function(n,r){n.forEach(function(n){e.call(t,n,r,this)},this)},this)},e.na=function(){It(this);const e=Array.from(this.g.values()),t=Array.from(this.g.keys()),n=[];for(let r=0;r<t.length;r++){const s=e[r];for(let e=0;e<s.length;e++)n.push(t[r])}return n},e.V=function(e){It(this);let t=[];if("string"===typeof e)Rt(this,e)&&(t=t.concat(this.g.get(Mt(this,e))));else{e=Array.from(this.g.values());for(let n=0;n<e.length;n++)t=t.concat(e[n])}return t},e.set=function(e,t){return It(this),this.i=null,Rt(this,e=Mt(this,e))&&(this.h-=this.g.get(e).length),this.g.set(e,[t]),this.h+=1,this},e.get=function(e,t){return e&&0<(e=this.V(e)).length?String(e[0]):t},e.toString=function(){if(this.i)return this.i;if(!this.g)return"";const e=[],t=Array.from(this.g.keys());for(var n=0;n<t.length;n++){var r=t[n];const a=encodeURIComponent(String(r)),i=this.V(r);for(r=0;r<i.length;r++){var s=a;""!==i[r]&&(s+="="+encodeURIComponent(String(i[r]))),e.push(s)}}return this.i=e.join("&")},w(Bt,ke),Bt.prototype.g=function(){return new zt(this.l,this.j)},Bt.prototype.i=(At={},function(){return At}),w(zt,me),(e=zt.prototype).open=function(e,t){if(0!=this.readyState)throw this.abort(),Error("Error reopening a connection");this.B=e,this.A=t,this.readyState=1,Wt(this)},e.send=function(e){if(1!=this.readyState)throw this.abort(),Error("need to call open() first. ");this.g=!0;const t={headers:this.u,method:this.B,credentials:this.m,cache:void 0};e&&(t.body=e),(this.D||s).fetch(new Request(this.A,t)).then(this.Sa.bind(this),this.ga.bind(this))},e.abort=function(){this.response=this.responseText="",this.u=new Headers,this.status=0,this.j&&this.j.cancel("Request was aborted.").catch(()=>{}),1<=this.readyState&&this.g&&4!=this.readyState&&(this.g=!1,qt(this)),this.readyState=0},e.Sa=function(e){if(this.g&&(this.l=e,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=e.headers,this.readyState=2,Wt(this)),this.g&&(this.readyState=3,Wt(this),this.g)))if("arraybuffer"===this.responseType)e.arrayBuffer().then(this.Qa.bind(this),this.ga.bind(this));else if("undefined"!==typeof s.ReadableStream&&"body"in e){if(this.j=e.body.getReader(),this.o){if(this.responseType)throw Error('responseType must be empty for "streamBinaryChunks" mode responses.');this.response=[]}else this.response=this.responseText="",this.v=new TextDecoder;Vt(this)}else e.text().then(this.Ra.bind(this),this.ga.bind(this))},e.Pa=function(e){if(this.g){if(this.o&&e.value)this.response.push(e.value);else if(!this.o){var t=e.value?e.value:new Uint8Array(0);(t=this.v.decode(t,{stream:!e.done}))&&(this.response=this.responseText+=t)}e.done?qt(this):Wt(this),3==this.readyState&&Vt(this)}},e.Ra=function(e){this.g&&(this.response=this.responseText=e,qt(this))},e.Qa=function(e){this.g&&(this.response=e,qt(this))},e.ga=function(){this.g&&qt(this)},e.setRequestHeader=function(e,t){this.u.append(e,t)},e.getResponseHeader=function(e){return this.h&&this.h.get(e.toLowerCase())||""},e.getAllResponseHeaders=function(){if(!this.h)return"";const e=[],t=this.h.entries();for(var n=t.next();!n.done;)n=n.value,e.push(n[0]+": "+n[1]),n=t.next();return e.join("\r\n")},Object.defineProperty(zt.prototype,"withCredentials",{get:function(){return"include"===this.m},set:function(e){this.m=e?"include":"same-origin"}}),w(Yt,me);var Kt=/^https?$/i,Jt=["POST","PUT"];function $t(e,t){e.h=!1,e.g&&(e.j=!0,e.g.abort(),e.j=!1),e.l=t,e.m=5,Qt(e),Zt(e)}function Qt(e){e.A||(e.A=!0,he(e,"complete"),he(e,"error"))}function Xt(e){if(e.h&&"undefined"!=typeof r&&(!e.v[1]||4!=tn(e)||2!=e.Z()))if(e.u&&4==tn(e))ge(e.Ea,0,e);else if(he(e,"readystatechange"),4==tn(e)){e.h=!1;try{const r=e.Z();e:switch(r){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var t=!0;break e;default:t=!1}var n;if(!(n=t)){var a;if(a=0===r){var i=String(e.D).match(pt)[1]||null;!i&&s.self&&s.self.location&&(i=s.self.location.protocol.slice(0,-1)),a=!Kt.test(i?i.toLowerCase():"")}n=a}if(n)he(e,"complete"),he(e,"success");else{e.m=6;try{var o=2<tn(e)?e.g.statusText:""}catch(l){o=""}e.l=o+" ["+e.Z()+"]",Qt(e)}}finally{Zt(e)}}}function Zt(e,t){if(e.g){en(e);const r=e.g,s=e.v[0]?()=>{}:null;e.g=null,e.v=null,t||he(e,"ready");try{r.onreadystatechange=s}catch(n){}}}function en(e){e.I&&(s.clearTimeout(e.I),e.I=null)}function tn(e){return e.g?e.g.readyState:0}function nn(e){try{if(!e.g)return null;if("response"in e.g)return e.g.response;switch(e.H){case"":case"text":return e.g.responseText;case"arraybuffer":if("mozResponseArrayBuffer"in e.g)return e.g.mozResponseArrayBuffer}return null}catch(t){return null}}
2function rn(e,t,n){return n&&n.internalChannelParams&&n.internalChannelParams[e]||t}function sn(e){this.Aa=0,this.i=[],this.j=new Ue,this.ia=this.qa=this.I=this.W=this.g=this.ya=this.D=this.H=this.m=this.S=this.o=null,this.Ya=this.U=0,this.Va=rn("failFast",!1,e),this.F=this.C=this.u=this.s=this.l=null,this.X=!0,this.za=this.T=-1,this.Y=this.v=this.B=0,this.Ta=rn("baseRetryDelayMs",5e3,e),this.cb=rn("retryDelaySeedMs",1e4,e),this.Wa=rn("forwardChannelMaxRetries",2,e),this.wa=rn("forwardChannelRequestTimeoutMs",2e4,e),this.pa=e&&e.xmlHttpFactory||void 0,this.Xa=e&&e.Tb||void 0,this.Ca=e&&e.useFetchStreams||!1,this.L=void 0,this.J=e&&e.supportsCrossDomainXhr||!1,this.K="",this.h=new it(e&&e.concurrentRequestLimit),this.Da=new Ft,this.P=e&&e.fastHandshake||!1,this.O=e&&e.encodeInitMessageHeaders||!1,this.P&&this.O&&(this.O=!1),this.Ua=e&&e.Rb||!1,e&&e.xa&&this.j.xa(),e&&e.forceLongPolling&&(this.X=!1),this.ba=!this.P&&this.X&&e&&e.detectBufferingProxy||!1,this.ja=void 0,e&&e.longPollingTimeout&&0<e.longPollingTimeout&&(this.ja=e.longPollingTimeout),this.ca=void 0,this.R=0,this.M=!1,this.ka=this.A=null}function an(e){if(ln(e),3==e.G){var t=e.U++,n=ft(e.I);if(vt(n,"SID",e.K),vt(n,"RID",t),vt(n,"TYPE","terminate"),un(e,n),(t=new He(e,e.j,t)).L=2,t.v=wt(ft(n)),n=!1,s.navigator&&s.navigator.sendBeacon)try{n=s.navigator.sendBeacon(t.v.toString(),"")}catch(r){}!n&&s.Image&&((new Image).src=t.v,n=!0),n||(t.g=Nn(t.j,null),t.g.ea(t.v)),t.F=Date.now(),Ze(t)}wn(e)}function on(e){e.g&&(gn(e),e.g.cancel(),e.g=null)}function ln(e){on(e),e.u&&(s.clearTimeout(e.u),e.u=null),xn(e),e.h.cancel(),e.s&&("number"===typeof e.s&&s.clearTimeout(e.s),e.s=null)}function cn(e){if(!ot(e.h)&&!e.s){e.s=!0;var t=e.Ga;O||B(),F||(O(),F=!0),U.add(t,e),e.B=0}}function dn(e,t){var n;n=t?t.l:e.U++;const r=ft(e.I);vt(r,"SID",e.K),vt(r,"RID",n),vt(r,"AID",e.T),un(e,r),e.m&&e.o&&Gt(r,e.m,e.o),n=new He(e,e.j,n,e.B+1),null===e.m&&(n.H=e.o),t&&(e.i=t.D.concat(e.i)),t=mn(e,n,1e3),n.I=Math.round(.5*e.wa)+Math.round(.5*e.wa*Math.random()),dt(e.h,n),Je(n,r,t)}function un(e,t){e.H&&C(e.H,function(e,n){vt(t,n,e)}),e.l&&ht({},function(e,n){vt(t,n,e)})}function mn(e,t,n){n=Math.min(e.i.length,n);var r=e.l?c(e.l.Na,e.l,e):null;e:{var s=e.i;let t=-1;for(;;){const e=["count="+n];-1==t?0<n?(t=s[0].g,e.push("ofs="+t)):t=0:e.push("ofs="+t);let i=!0;for(let o=0;o<n;o++){let n=s[o].g;const l=s[o].map;if(n-=t,0>n)t=Math.max(0,s[o].g-100),i=!1;else try{Ut(l,e,"req"+n+"_")}catch(a){r&&r(l)}}if(i){r=e.join("&");break e}}}return e=e.i.splice(0,n),t.D=e,r}function hn(e){if(!e.g&&!e.u){e.Y=1;var t=e.Fa;O||B(),F||(O(),F=!0),U.add(t,e),e.v=0}}function pn(e){return!(e.g||e.u||3<=e.v)&&(e.Y++,e.u=Fe(c(e.Fa,e),yn(e,e.v)),e.v++,!0)}function gn(e){null!=e.A&&(s.clearTimeout(e.A),e.A=null)}function fn(e){e.g=new He(e,e.j,"rpc",e.Y),null===e.m&&(e.g.H=e.o),e.g.O=0;var t=ft(e.qa);vt(t,"RID","rpc"),vt(t,"SID",e.K),vt(t,"AID",e.T),vt(t,"CI",e.F?"0":"1"),!e.F&&e.ja&&vt(t,"TO",e.ja),vt(t,"TYPE","xmlhttp"),un(e,t),e.m&&e.o&&Gt(t,e.m,e.o),e.L&&(e.g.I=e.L);var n=e.g;e=e.ia,n.L=1,n.v=wt(ft(t)),n.m=null,n.P=!0,$e(n,e)}function xn(e){null!=e.C&&(s.clearTimeout(e.C),e.C=null)}function bn(e,t){var n=null;if(e.g==t){xn(e),gn(e),e.g=null;var r=2}else{if(!ct(e.h,t))return;n=t.D,ut(e.h,t),r=1}if(0!=e.G)if(t.o)if(1==r){n=t.m?t.m.length:0,t=Date.now()-t.F;var s=e.B;he(r=Ie(),new Oe(r,n)),cn(e)}else hn(e);else if(3==(s=t.s)||0==s&&0<t.X||!(1==r&&function(e,t){return!(lt(e.h)>=e.h.j-(e.s?1:0))&&(e.s?(e.i=t.D.concat(e.i),!0):!(1==e.G||2==e.G||e.B>=(e.Va?0:e.Wa))&&(e.s=Fe(c(e.Ga,e,t),yn(e,e.B)),e.B++,!0))}(e,t)||2==r&&pn(e)))switch(n&&0<n.length&&(t=e.h,t.i=t.i.concat(n)),s){case 1:vn(e,5);break;case 4:vn(e,10);break;case 3:vn(e,6);break;default:vn(e,2)}}function yn(e,t){let n=e.Ta+Math.floor(Math.random()*e.cb);return e.isActive()||(n*=2),n*t}function vn(e,t){if(e.j.info("Error code "+t),2==t){var n=c(e.fb,e),r=e.Xa;const t=!r;r=new gt(r||"//www.google.com/images/cleardot.gif"),s.location&&"http"==s.location.protocol||xt(r,"https"),wt(r),t?function(e,t){const n=new Ue;if(s.Image){const r=new Image;r.onload=d(Ot,n,"TestLoadImage: loaded",!0,t,r),r.onerror=d(Ot,n,"TestLoadImage: error",!1,t,r),r.onabort=d(Ot,n,"TestLoadImage: abort",!1,t,r),r.ontimeout=d(Ot,n,"TestLoadImage: timeout",!1,t,r),s.setTimeout(function(){r.ontimeout&&r.ontimeout()},1e4),r.src=e}else t(!1)}(r.toString(),n):function(e,t){new Ue;const n=new AbortController,r=setTimeout(()=>{n.abort(),Ot(0,0,!1,t)},1e4);fetch(e,{signal:n.signal}).then(e=>{clearTimeout(r),e.ok?Ot(0,0,!0,t):Ot(0,0,!1,t)}).catch(()=>{clearTimeout(r),Ot(0,0,!1,t)})}(r.toString(),n)}else Me(2);e.G=0,e.l&&e.l.sa(t),wn(e),ln(e)}function wn(e){if(e.G=0,e.ka=[],e.l){const t=mt(e.h);
20==t.length&&0==e.i.length||(N(e.ka,t),N(e.ka,e.i),e.h.i.length=0,j(e.i),e.i.length=0),e.l.ra()}}function jn(e,t,n){var r=n instanceof gt?ft(n):new gt(n);if(""!=r.g)t&&(r.g=t+"."+r.g),bt(r,r.s);else{var a=s.location;r=a.protocol,t=t?t+"."+a.hostname:a.hostname,a=+a.port;var i=new gt(null);r&&xt(i,r),t&&(i.g=t),a&&bt(i,a),n&&(i.l=n),r=i}return n=e.D,t=e.ya,n&&t&&vt(r,n,t),vt(r,"VER",e.la),un(e,r),r}function Nn(e,t,n){if(t&&!e.J)throw Error("Can't create secondary domain capable XhrIo object.");return(t=e.Ca&&!e.pa?new Yt(new Bt({eb:n})):new Yt(e.pa)).Ha(e.J),t}function kn(){}function An(){}function Sn(e,t){me.call(this),this.g=new sn(t),this.l=e,this.h=t&&t.messageUrlParams||null,e=t&&t.messageHeaders||null,t&&t.clientProtocolHeaderRequired&&(e?e["X-Client-Protocol"]="webchannel":e={"X-Client-Protocol":"webchannel"}),this.g.o=e,e=t&&t.initMessageHeaders||null,t&&t.messageContentType&&(e?e["X-WebChannel-Content-Type"]=t.messageContentType:e={"X-WebChannel-Content-Type":t.messageContentType}),t&&t.va&&(e?e["X-WebChannel-Client-Profile"]=t.va:e={"X-WebChannel-Client-Profile":t.va}),this.g.S=e,(e=t&&t.Sb)&&!k(e)&&(this.g.m=e),this.v=t&&t.supportsCrossDomainXhr||!1,this.u=t&&t.sendRawJson||!1,(t=t&&t.httpSessionIdParam)&&!k(t)&&(this.g.D=t,null!==(e=this.h)&&t in e&&(t in(e=this.h)&&delete e[t])),this.j=new Tn(this)}function En(e){Ce.call(this),e.__headers__&&(this.headers=e.__headers__,this.statusCode=e.__status__,delete e.__headers__,delete e.__status__);var t=e.__sm__;if(t){e:{for(const n in t){e=n;break e}e=void 0}(this.i=e)&&(e=this.i,t=null!==t&&e in t?t[e]:void 0),this.data=t}else this.data=e}function Cn(){Te.call(this),this.status=1}function Tn(e){this.g=e}(e=Yt.prototype).Ha=function(e){this.J=e},e.ea=function(e,t,n,r){if(this.g)throw Error("[goog.net.XhrIo] Object is active with another request="+this.D+"; newUri="+e);t=t?t.toUpperCase():"GET",this.D=e,this.l="",this.m=0,this.A=!1,this.h=!0,this.g=this.o?this.o.g():ze.g(),this.v=this.o?Ae(this.o):Ae(ze),this.g.onreadystatechange=c(this.Ea,this);try{this.B=!0,this.g.open(t,String(e),!0),this.B=!1}catch(i){return void $t(this,i)}if(e=n||"",n=new Map(this.headers),r)if(Object.getPrototypeOf(r)===Object.prototype)for(var a in r)n.set(a,r[a]);else{if("function"!==typeof r.keys||"function"!==typeof r.get)throw Error("Unknown input type for opt_headers: "+String(r));for(const e of r.keys())n.set(e,r.get(e))}r=Array.from(n.keys()).find(e=>"content-type"==e.toLowerCase()),a=s.FormData&&e instanceof s.FormData,!(0<=Array.prototype.indexOf.call(Jt,t,void 0))||r||a||n.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");for(const[s,o]of n)this.g.setRequestHeader(s,o);this.H&&(this.g.responseType=this.H),"withCredentials"in this.g&&this.g.withCredentials!==this.J&&(this.g.withCredentials=this.J);try{en(this),this.u=!0,this.g.send(e),this.u=!1}catch(i){$t(this,i)}},e.abort=function(e){this.g&&this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1,this.m=e||7,he(this,"complete"),he(this,"abort"),Zt(this))},e.N=function(){this.g&&(this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1),Zt(this,!0)),Yt.aa.N.call(this)},e.Ea=function(){this.s||(this.B||this.u||this.j?Xt(this):this.bb())},e.bb=function(){Xt(this)},e.isActive=function(){return!!this.g},e.Z=function(){try{return 2<tn(this)?this.g.status:-1}catch(At){return-1}},e.oa=function(){try{return this.g?this.g.responseText:""}catch(At){return""}},e.Oa=function(e){if(this.g){var t=this.g.responseText;return e&&0==t.indexOf(e)&&(t=t.substring(e.length)),je(t)}},e.Ba=function(){return this.m},e.Ka=function(){return"string"===typeof this.l?this.l:String(this.l)},(e=sn.prototype).la=8,e.G=1,e.connect=function(e,t,n,r){Me(0),this.W=e,this.H=t||{},n&&void 0!==r&&(this.H.OSID=n,this.H.OAID=r),this.F=this.X,this.I=jn(this,null,this.W),cn(this)},e.Ga=function(e){if(this.s)if(this.s=null,1==this.G){if(!e){this.U=Math.floor(1e5*Math.random()),e=this.U++;const s=new He(this,this.j,e);let a=this.o;if(this.S&&(a?(a=T(a),_(a,this.S)):a=this.S),null!==this.m||this.O||(s.H=a,a=null),this.P)e:{for(var t=0,n=0;n<this.i.length;n++){var r=this.i[n];if(void 0===(r="__data__"in r.map&&"string"===typeof(r=r.map.__data__)?r.length:void 0))break;if(4096<(t+=r)){t=n;break e}if(4096===t||n===this.i.length-1){t=n+1;break e}}t=1e3}else t=1e3;
2t=mn(this,s,t),vt(n=ft(this.I),"RID",e),vt(n,"CVER",22),this.D&&vt(n,"X-HTTP-Session-Id",this.D),un(this,n),a&&(this.O?t="headers="+encodeURIComponent(String(Ht(a)))+"&"+t:this.m&&Gt(n,this.m,a)),dt(this.h,s),this.Ua&&vt(n,"TYPE","init"),this.P?(vt(n,"$req",t),vt(n,"SID","null"),s.T=!0,Je(s,n,null)):Je(s,n,t),this.G=2}}else 3==this.G&&(e?dn(this,e):0==this.i.length||ot(this.h)||dn(this))},e.Fa=function(){if(this.u=null,fn(this),this.ba&&!(this.M||null==this.g||0>=this.R)){var e=2*this.R;this.j.info("BP detection timer enabled: "+e),this.A=Fe(c(this.ab,this),e)}},e.ab=function(){this.A&&(this.A=null,this.j.info("BP detection timeout reached."),this.j.info("Buffering proxy detected and switch to long-polling!"),this.F=!1,this.M=!0,Me(10),on(this),fn(this))},e.Za=function(){null!=this.C&&(this.C=null,on(this),pn(this),Me(19))},e.fb=function(e){e?(this.j.info("Successfully pinged google.com"),Me(2)):(this.j.info("Failed to ping google.com"),Me(1))},e.isActive=function(){return!!this.l&&this.l.isActive(this)},(e=kn.prototype).ua=function(){},e.ta=function(){},e.sa=function(){},e.ra=function(){},e.isActive=function(){return!0},e.Na=function(){},An.prototype.g=function(e,t){return new Sn(e,t)},w(Sn,me),Sn.prototype.m=function(){this.g.l=this.j,this.v&&(this.g.J=!0),this.g.connect(this.l,this.h||void 0)},Sn.prototype.close=function(){an(this.g)},Sn.prototype.o=function(e){var t=this.g;if("string"===typeof e){var n={};n.__data__=e,e=n}else this.u&&((n={}).__data__=we(e),e=n);t.i.push(new at(t.Ya++,e)),3==t.G&&cn(t)},Sn.prototype.N=function(){this.g.l=null,delete this.j,an(this.g),delete this.g,Sn.aa.N.call(this)},w(En,Ce),w(Cn,Te),w(Tn,kn),Tn.prototype.ua=function(){he(this.g,"a")},Tn.prototype.ta=function(e){he(this.g,new En(e))},Tn.prototype.sa=function(e){he(this.g,new Cn)},Tn.prototype.ra=function(){he(this.g,"b")},An.prototype.createWebChannel=An.prototype.g,Sn.prototype.send=Sn.prototype.o,Sn.prototype.open=Sn.prototype.m,Sn.prototype.close=Sn.prototype.close,b=v.createWebChannelTransport=function(){return new An},x=v.getStatEventTarget=function(){return Ie()},f=v.Event=Pe,g=v.Stat={mb:0,pb:1,qb:2,Jb:3,Ob:4,Lb:5,Mb:6,Kb:7,Ib:8,Nb:9,PROXY:10,NOPROXY:11,Gb:12,Cb:13,Db:14,Bb:15,Eb:16,Fb:17,ib:18,hb:19,jb:20},Ve.NO_ERROR=0,Ve.TIMEOUT=8,Ve.HTTP_ERROR=6,p=v.ErrorCode=Ve,qe.COMPLETE="complete",h=v.EventType=qe,Se.EventType=Ee,Ee.OPEN="a",Ee.CLOSE="b",Ee.ERROR="c",Ee.MESSAGE="d",me.prototype.listen=me.prototype.K,m=v.WebChannel=Se,v.FetchXmlHttpFactory=Bt,Yt.prototype.listenOnce=Yt.prototype.L,Yt.prototype.getLastError=Yt.prototype.Ka,Yt.prototype.getLastErrorCode=Yt.prototype.Ba,Yt.prototype.getStatus=Yt.prototype.Z,Yt.prototype.getResponseJson=Yt.prototype.Oa,Yt.prototype.getResponseText=Yt.prototype.oa,Yt.prototype.send=Yt.prototype.ea,Yt.prototype.setWithCredentials=Yt.prototype.Ha,u=v.XhrIo=Yt}).apply("undefined"!==typeof y?y:"undefined"!==typeof self?self:"undefined"!==typeof window?window:{});const w="@firebase/firestore",j="4.7.11";class N{constructor(e){this.uid=e}isAuthenticated(){return null!=this.uid}toKey(){return this.isAuthenticated()?"uid:"+this.uid:"anonymous-user"}isEqual(e){return e.uid===this.uid}}N.UNAUTHENTICATED=new N(null),N.GOOGLE_CREDENTIALS=new N("google-credentials-uid"),N.FIRST_PARTY=new N("first-party-uid"),N.MOCK_USER=new N("mock-user");let k="11.6.1";const A=new o.Vy("@firebase/firestore");function S(){return A.logLevel}function E(e){if(A.logLevel<=o.$b.DEBUG){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];const s=n.map(P);A.debug("Firestore (".concat(k,"): ").concat(e),...s)}}function C(e){if(A.logLevel<=o.$b.ERROR){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];const s=n.map(P);A.error("Firestore (".concat(k,"): ").concat(e),...s)}}function T(e){if(A.logLevel<=o.$b.WARN){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];const s=n.map(P);A.warn("Firestore (".concat(k,"): ").concat(e),...s)}}function P(e){if("string"==typeof e)return e;try{return function(e){return JSON.stringify(e)}(e)}catch(t){return e}}function _(e,t,n){let r="Unexpected state";"string"==typeof t?r=t:n=t,I(e,r,n)}function I(e,t,n){let r="FIRESTORE (".concat(k,") INTERNAL ASSERTION FAILED: ").concat(t," (ID: ").concat(e.toString(16),")");
2if(void 0!==n)try{r+=" CONTEXT: "+JSON.stringify(n)}catch(e){r+=" CONTEXT: "+n}throw C(r),new Error(r)}function D(e,t,n,r){let s="Unexpected state";"string"==typeof n?s=n:r=n,e||I(t,s,r)}function R(e,t){return e}const L={OK:"ok",CANCELLED:"cancelled",UNKNOWN:"unknown",INVALID_ARGUMENT:"invalid-argument",DEADLINE_EXCEEDED:"deadline-exceeded",NOT_FOUND:"not-found",ALREADY_EXISTS:"already-exists",PERMISSION_DENIED:"permission-denied",UNAUTHENTICATED:"unauthenticated",RESOURCE_EXHAUSTED:"resource-exhausted",FAILED_PRECONDITION:"failed-precondition",ABORTED:"aborted",OUT_OF_RANGE:"out-of-range",UNIMPLEMENTED:"unimplemented",INTERNAL:"internal",UNAVAILABLE:"unavailable",DATA_LOSS:"data-loss"};class M extends l.g{constructor(e,t){super(e,t),this.code=e,this.message=t,this.toString=()=>"".concat(this.name,": [code=").concat(this.code,"]: ").concat(this.message)}}class O{constructor(){this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}}class F{constructor(e,t){this.user=t,this.type="OAuth",this.headers=new Map,this.headers.set("Authorization","Bearer ".concat(e))}}class U{getToken(){return Promise.resolve(null)}invalidateToken(){}start(e,t){e.enqueueRetryable(()=>t(N.UNAUTHENTICATED))}shutdown(){}}class B{constructor(e){this.token=e,this.changeListener=null}getToken(){return Promise.resolve(this.token)}invalidateToken(){}start(e,t){this.changeListener=t,e.enqueueRetryable(()=>t(this.token.user))}shutdown(){this.changeListener=null}}class z{constructor(e){this.t=e,this.currentUser=N.UNAUTHENTICATED,this.i=0,this.forceRefresh=!1,this.auth=null}start(e,t){D(void 0===this.o,42304);let n=this.i;const r=e=>this.i!==n?(n=this.i,t(e)):Promise.resolve();let s=new O;this.o=()=>{this.i++,this.currentUser=this.u(),s.resolve(),s=new O,e.enqueueRetryable(()=>r(this.currentUser))};const a=()=>{const t=s;e.enqueueRetryable(async()=>{await t.promise,await r(this.currentUser)})},i=e=>{E("FirebaseAuthCredentialsProvider","Auth detected"),this.auth=e,this.o&&(this.auth.addAuthTokenListener(this.o),a())};this.t.onInit(e=>i(e)),setTimeout(()=>{if(!this.auth){const e=this.t.getImmediate({optional:!0});e?i(e):(E("FirebaseAuthCredentialsProvider","Auth not yet detected"),s.resolve(),s=new O)}},0),a()}getToken(){const e=this.i,t=this.forceRefresh;return this.forceRefresh=!1,this.auth?this.auth.getToken(t).then(t=>this.i!==e?(E("FirebaseAuthCredentialsProvider","getToken aborted due to token change."),this.getToken()):t?(D("string"==typeof t.accessToken,31837,{l:t}),new F(t.accessToken,this.currentUser)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.auth&&this.o&&this.auth.removeAuthTokenListener(this.o),this.o=void 0}u(){const e=this.auth&&this.auth.getUid();return D(null===e||"string"==typeof e,2055,{h:e}),new N(e)}}class V{constructor(e,t,n){this.P=e,this.T=t,this.I=n,this.type="FirstParty",this.user=N.FIRST_PARTY,this.A=new Map}R(){return this.I?this.I():null}get headers(){this.A.set("X-Goog-AuthUser",this.P);const e=this.R();return e&&this.A.set("Authorization",e),this.T&&this.A.set("X-Goog-Iam-Authorization-Token",this.T),this.A}}class q{constructor(e,t,n){this.P=e,this.T=t,this.I=n}getToken(){return Promise.resolve(new V(this.P,this.T,this.I))}start(e,t){e.enqueueRetryable(()=>t(N.FIRST_PARTY))}shutdown(){}invalidateToken(){}}class W{constructor(e){this.value=e,this.type="AppCheck",this.headers=new Map,e&&e.length>0&&this.headers.set("x-firebase-appcheck",this.value)}}class H{constructor(e,t){this.V=t,this.forceRefresh=!1,this.appCheck=null,this.m=null,this.p=null,(0,a.xZ)(e)&&e.settings.appCheckToken&&(this.p=e.settings.appCheckToken)}start(e,t){D(void 0===this.o,3512);const n=e=>{null!=e.error&&E("FirebaseAppCheckTokenProvider","Error getting App Check token; using placeholder token instead. Error: ".concat(e.error.message));const n=e.token!==this.m;return this.m=e.token,E("FirebaseAppCheckTokenProvider","Received ".concat(n?"new":"existing"," token.")),n?t(e.token):Promise.resolve()};this.o=t=>{e.enqueueRetryable(()=>n(t))};const r=e=>{E("FirebaseAppCheckTokenProvider","AppCheck detected"),this.appCheck=e,this.o&&this.appCheck.addTokenListener(this.o)};this.V.onInit(e=>r(e)),setTimeout(()=>{if(!this.appCheck){const e=this.V.getImmediate({optional:!0});e?r(e):E("FirebaseAppCheckTokenProvider","AppCheck not yet detected")}},0)}getToken(){if(this.p)return Promise.resolve(new W(this.p));const e=this.forceRefresh;return this.forceRefresh=!1,this.appCheck?this.appCheck.getToken(e).then(e=>
2e?(D("string"==typeof e.token,44558,{tokenResult:e}),this.m=e.token,new W(e.token)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.appCheck&&this.o&&this.appCheck.removeTokenListener(this.o),this.o=void 0}}function G(e){const t="undefined"!=typeof self&&(self.crypto||self.msCrypto),n=new Uint8Array(e);if(t&&"function"==typeof t.getRandomValues)t.getRandomValues(n);else for(let r=0;r<e;r++)n[r]=Math.floor(256*Math.random());return n}function Y(){return new TextEncoder}class K{static newId(){const e=62*Math.floor(256/62);let t="";for(;t.length<20;){const n=G(40);for(let r=0;r<n.length;++r)t.length<20&&n[r]<e&&(t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".charAt(n[r]%62))}return t}}function J(e,t){return e<t?-1:e>t?1:0}function $(e,t){let n=0;for(;n<e.length&&n<t.length;){const r=e.codePointAt(n),s=t.codePointAt(n);if(r!==s){if(r<128&&s<128)return J(r,s);{const a=Y(),i=X(a.encode(Q(e,n)),a.encode(Q(t,n)));return 0!==i?i:J(r,s)}}n+=r>65535?2:1}return J(e.length,t.length)}function Q(e,t){return e.codePointAt(t)>65535?e.substring(t,t+2):e.substring(t,t+1)}function X(e,t){for(let n=0;n<e.length&&n<t.length;++n)if(e[n]!==t[n])return J(e[n],t[n]);return J(e.length,t.length)}function Z(e,t,n){return e.length===t.length&&e.every((e,r)=>n(e,t[r]))}const ee=-62135596800,te=1e6;class ne{static now(){return ne.fromMillis(Date.now())}static fromDate(e){return ne.fromMillis(e.getTime())}static fromMillis(e){const t=Math.floor(e/1e3),n=Math.floor((e-1e3*t)*te);return new ne(t,n)}constructor(e,t){if(this.seconds=e,this.nanoseconds=t,t<0)throw new M(L.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+t);if(t>=1e9)throw new M(L.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+t);if(e<ee)throw new M(L.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e);if(e>=253402300800)throw new M(L.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e)}toDate(){return new Date(this.toMillis())}toMillis(){return 1e3*this.seconds+this.nanoseconds/te}_compareTo(e){return this.seconds===e.seconds?J(this.nanoseconds,e.nanoseconds):J(this.seconds,e.seconds)}isEqual(e){return e.seconds===this.seconds&&e.nanoseconds===this.nanoseconds}toString(){return"Timestamp(seconds="+this.seconds+", nanoseconds="+this.nanoseconds+")"}toJSON(){return{seconds:this.seconds,nanoseconds:this.nanoseconds}}valueOf(){const e=this.seconds-ee;return String(e).padStart(12,"0")+"."+String(this.nanoseconds).padStart(9,"0")}}class re{static fromTimestamp(e){return new re(e)}static min(){return new re(new ne(0,0))}static max(){return new re(new ne(253402300799,999999999))}constructor(e){this.timestamp=e}compareTo(e){return this.timestamp._compareTo(e.timestamp)}isEqual(e){return this.timestamp.isEqual(e.timestamp)}toMicroseconds(){return 1e6*this.timestamp.seconds+this.timestamp.nanoseconds/1e3}toString(){return"SnapshotVersion("+this.timestamp.toString()+")"}toTimestamp(){return this.timestamp}}const se="__name__";class ae{constructor(e,t,n){void 0===t?t=0:t>e.length&&_(637,{offset:t,range:e.length}),void 0===n?n=e.length-t:n>e.length-t&&_(1746,{length:n,range:e.length-t}),this.segments=e,this.offset=t,this.len=n}get length(){return this.len}isEqual(e){return 0===ae.comparator(this,e)}child(e){const t=this.segments.slice(this.offset,this.limit());return e instanceof ae?e.forEach(e=>{t.push(e)}):t.push(e),this.construct(t)}limit(){return this.offset+this.length}popFirst(e){return e=void 0===e?1:e,this.construct(this.segments,this.offset+e,this.length-e)}popLast(){return this.construct(this.segments,this.offset,this.length-1)}firstSegment(){return this.segments[this.offset]}lastSegment(){return this.get(this.length-1)}get(e){return this.segments[this.offset+e]}isEmpty(){return 0===this.length}isPrefixOf(e){if(e.length<this.length)return!1;for(let t=0;t<this.length;t++)if(this.get(t)!==e.get(t))return!1;return!0}isImmediateParentOf(e){if(this.length+1!==e.length)return!1;for(let t=0;t<this.length;t++)if(this.get(t)!==e.get(t))return!1;return!0}forEach(e){for(let t=this.offset,n=this.limit();t<n;t++)e(this.segments[t])}toArray(){return this.segments.slice(this.offset,this.limit())}static comparator(e,t){const n=Math.min(e.length,t.length);for(let r=0;r<n;r++){const n=ae.compareSegments(e.get(r),t.get(r));if(0!==n)return n}return J(e.length,t.length)}static compareSegments(e,t){const n=ae.isNumericId(e),r=ae.isNumericId(t);return n&&!r?-1:!n&&r?1:n&&r?ae.extractNumericId(e).compare(ae.extractNumericId(t)):$(e,t)}static isNumericId(e){return e.startsWith("__id")&&e.endsWith("__")}static extractNumericId(e){return r.fromString(e.substring(4,e.length-2))}}class ie extends ae{construct(e,t,n){return new ie(e,t,n)}canonicalString(){return this.toArray().join("/")}toString(){return this.canonicalString()}
2toUriEncodedString(){return this.toArray().map(encodeURIComponent).join("/")}static fromString(){const e=[];for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];for(const s of n){if(s.indexOf("//")>=0)throw new M(L.INVALID_ARGUMENT,"Invalid segment (".concat(s,"). Paths must not contain // in them."));e.push(...s.split("/").filter(e=>e.length>0))}return new ie(e)}static emptyPath(){return new ie([])}}const oe=/^[_a-zA-Z][_a-zA-Z0-9]*$/;class le extends ae{construct(e,t,n){return new le(e,t,n)}static isValidIdentifier(e){return oe.test(e)}canonicalString(){return this.toArray().map(e=>(e=e.replace(/\\/g,"\\\\").replace(/`/g,"\\`"),le.isValidIdentifier(e)||(e="`"+e+"`"),e)).join(".")}toString(){return this.canonicalString()}isKeyField(){return 1===this.length&&this.get(0)===se}static keyField(){return new le([se])}static fromServerFormat(e){const t=[];let n="",r=0;const s=()=>{if(0===n.length)throw new M(L.INVALID_ARGUMENT,"Invalid field path (".concat(e,"). Paths must not be empty, begin with '.', end with '.', or contain '..'"));t.push(n),n=""};let a=!1;for(;r<e.length;){const t=e[r];if("\\"===t){if(r+1===e.length)throw new M(L.INVALID_ARGUMENT,"Path has trailing escape character: "+e);const t=e[r+1];if("\\"!==t&&"."!==t&&"`"!==t)throw new M(L.INVALID_ARGUMENT,"Path has invalid escape sequence: "+e);n+=t,r+=2}else"`"===t?(a=!a,r++):"."!==t||a?(n+=t,r++):(s(),r++)}if(s(),a)throw new M(L.INVALID_ARGUMENT,"Unterminated ` in path: "+e);return new le(t)}static emptyPath(){return new le([])}}class ce{constructor(e){this.path=e}static fromPath(e){return new ce(ie.fromString(e))}static fromName(e){return new ce(ie.fromString(e).popFirst(5))}static empty(){return new ce(ie.emptyPath())}get collectionGroup(){return this.path.popLast().lastSegment()}hasCollectionId(e){return this.path.length>=2&&this.path.get(this.path.length-2)===e}getCollectionGroup(){return this.path.get(this.path.length-2)}getCollectionPath(){return this.path.popLast()}isEqual(e){return null!==e&&0===ie.comparator(this.path,e.path)}toString(){return this.path.toString()}static comparator(e,t){return ie.comparator(e.path,t.path)}static isDocumentKey(e){return e.length%2==0}static fromSegments(e){return new ce(new ie(e.slice()))}}const de=-1;class ue{constructor(e,t,n,r){this.indexId=e,this.collectionGroup=t,this.fields=n,this.indexState=r}}ue.UNKNOWN_ID=-1;function me(e,t){const n=e.toTimestamp().seconds,r=e.toTimestamp().nanoseconds+1,s=re.fromTimestamp(1e9===r?new ne(n+1,0):new ne(n,r));return new pe(s,ce.empty(),t)}function he(e){return new pe(e.readTime,e.key,de)}class pe{constructor(e,t,n){this.readTime=e,this.documentKey=t,this.largestBatchId=n}static min(){return new pe(re.min(),ce.empty(),de)}static max(){return new pe(re.max(),ce.empty(),de)}}function ge(e,t){let n=e.readTime.compareTo(t.readTime);return 0!==n?n:(n=ce.comparator(e.documentKey,t.documentKey),0!==n?n:J(e.largestBatchId,t.largestBatchId))}const fe="The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.";class xe{constructor(){this.onCommittedListeners=[]}addOnCommittedListener(e){this.onCommittedListeners.push(e)}raiseOnCommittedEvent(){this.onCommittedListeners.forEach(e=>e())}}async function be(e){if(e.code!==L.FAILED_PRECONDITION||e.message!==fe)throw e;E("LocalStore","Unexpectedly lost primary lease")}class ye{constructor(e){this.nextCallback=null,this.catchCallback=null,this.result=void 0,this.error=void 0,this.isDone=!1,this.callbackAttached=!1,e(e=>{this.isDone=!0,this.result=e,this.nextCallback&&this.nextCallback(e)},e=>{this.isDone=!0,this.error=e,this.catchCallback&&this.catchCallback(e)})}catch(e){return this.next(void 0,e)}next(e,t){return this.callbackAttached&&_(59440),this.callbackAttached=!0,this.isDone?this.error?this.wrapFailure(t,this.error):this.wrapSuccess(e,this.result):new ye((n,r)=>{this.nextCallback=t=>{this.wrapSuccess(e,t).next(n,r)},this.catchCallback=e=>{this.wrapFailure(t,e).next(n,r)}})}toPromise(){return new Promise((e,t)=>{this.next(e,t)})}wrapUserFunction(e){try{const t=e();return t instanceof ye?t:ye.resolve(t)}catch(e){return ye.reject(e)}}wrapSuccess(e,t){return e?this.wrapUserFunction(()=>e(t)):ye.resolve(t)}wrapFailure(e,t){return e?this.wrapUserFunction(()=>e(t)):ye.reject(t)}static resolve(e){return new ye((t,n)=>{t(e)})}static reject(e){return new ye((t,n)=>{n(e)})}static waitFor(e){return new ye((t,n)=>{let r=0,s=0,a=!1;
2e.forEach(e=>{++r,e.next(()=>{++s,a&&s===r&&t()},e=>n(e))}),a=!0,s===r&&t()})}static or(e){let t=ye.resolve(!1);for(const n of e)t=t.next(e=>e?ye.resolve(e):n());return t}static forEach(e,t){const n=[];return e.forEach((e,r)=>{n.push(t.call(this,e,r))}),this.waitFor(n)}static mapArray(e,t){return new ye((n,r)=>{const s=e.length,a=new Array(s);let i=0;for(let o=0;o<s;o++){const l=o;t(e[l]).next(e=>{a[l]=e,++i,i===s&&n(a)},e=>r(e))}})}static doWhile(e,t){return new ye((n,r)=>{const s=()=>{!0===e()?t().next(()=>{s()},r):n()};s()})}}function ve(e){const t=e.match(/Android ([\d.]+)/i),n=t?t[1].split(".").slice(0,2).join("."):"-1";return Number(n)}function we(e){return"IndexedDbTransactionError"===e.name}class je{constructor(e,t){this.previousValue=e,t&&(t.sequenceNumberHandler=e=>this.ue(e),this.ce=e=>t.writeSequenceNumber(e))}ue(e){return this.previousValue=Math.max(e,this.previousValue),this.previousValue}next(){const e=++this.previousValue;return this.ce&&this.ce(e),e}}je.le=-1;const Ne=-1;function ke(e){return null==e}function Ae(e){return 0===e&&1/e==-1/0}function Se(e){return"number"==typeof e&&Number.isInteger(e)&&!Ae(e)&&e<=Number.MAX_SAFE_INTEGER&&e>=Number.MIN_SAFE_INTEGER}const Ee="\x01";function Ce(e){let t="";for(let n=0;n<e.length;n++)t.length>0&&(t=Pe(t)),t=Te(e.get(n),t);return Pe(t)}function Te(e,t){let n=t;const r=e.length;for(let s=0;s<r;s++){const t=e.charAt(s);switch(t){case"\0":n+="\x01\x10";break;case Ee:n+="\x01\x11";break;default:n+=t}}return n}function Pe(e){return e+Ee+"\x01"}const _e="remoteDocuments",Ie="owner",De="mutationQueues",Re="mutations";const Le="documentMutations",Me="remoteDocumentsV14",Oe="remoteDocumentGlobal",Fe="targets",Ue="targetDocuments",Be="targetGlobal",ze="collectionParents",Ve="clientMetadata",qe="bundles",We="namedQueries",He="indexConfiguration",Ge="indexState",Ye="indexEntries",Ke="documentOverlays",Je="globals",$e=[De,Re,Le,_e,Fe,Ie,Be,Ue,Ve,Oe,ze,qe,We],Qe=[De,Re,Le,Me,Fe,Ie,Be,Ue,Ve,Oe,ze,qe,We,Ke],Xe=Qe,Ze=[...Xe,He,Ge,Ye];function et(e){let t=0;for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}function tt(e,t){for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t(n,e[n])}function nt(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}class rt{constructor(e,t){this.comparator=e,this.root=t||at.EMPTY}insert(e,t){return new rt(this.comparator,this.root.insert(e,t,this.comparator).copy(null,null,at.BLACK,null,null))}remove(e){return new rt(this.comparator,this.root.remove(e,this.comparator).copy(null,null,at.BLACK,null,null))}get(e){let t=this.root;for(;!t.isEmpty();){const n=this.comparator(e,t.key);if(0===n)return t.value;n<0?t=t.left:n>0&&(t=t.right)}return null}indexOf(e){let t=0,n=this.root;for(;!n.isEmpty();){const r=this.comparator(e,n.key);if(0===r)return t+n.left.size;r<0?n=n.left:(t+=n.left.size+1,n=n.right)}return-1}isEmpty(){return this.root.isEmpty()}get size(){return this.root.size}minKey(){return this.root.minKey()}maxKey(){return this.root.maxKey()}inorderTraversal(e){return this.root.inorderTraversal(e)}forEach(e){this.inorderTraversal((t,n)=>(e(t,n),!1))}toString(){const e=[];return this.inorderTraversal((t,n)=>(e.push("".concat(t,":").concat(n)),!1)),"{".concat(e.join(", "),"}")}reverseTraversal(e){return this.root.reverseTraversal(e)}getIterator(){return new st(this.root,null,this.comparator,!1)}getIteratorFrom(e){return new st(this.root,e,this.comparator,!1)}getReverseIterator(){return new st(this.root,null,this.comparator,!0)}getReverseIteratorFrom(e){return new st(this.root,e,this.comparator,!0)}}class st{constructor(e,t,n,r){this.isReverse=r,this.nodeStack=[];let s=1;for(;!e.isEmpty();)if(s=t?n(e.key,t):1,t&&r&&(s*=-1),s<0)e=this.isReverse?e.left:e.right;else{if(0===s){this.nodeStack.push(e);break}this.nodeStack.push(e),e=this.isReverse?e.right:e.left}}getNext(){let e=this.nodeStack.pop();const t={key:e.key,value:e.value};if(this.isReverse)for(e=e.left;!e.isEmpty();)this.nodeStack.push(e),e=e.right;else for(e=e.right;!e.isEmpty();)this.nodeStack.push(e),e=e.left;return t}hasNext(){return this.nodeStack.length>0}peek(){if(0===this.nodeStack.length)return null;const e=this.nodeStack[this.nodeStack.length-1];return{key:e.key,value:e.value}}}
vendor: 4,270 bytes, line 2
2class at{constructor(e,t,n,r,s){this.key=e,this.value=t,this.color=null!=n?n:at.RED,this.left=null!=r?r:at.EMPTY,this.right=null!=s?s:at.EMPTY,this.size=this.left.size+1+this.right.size}copy(e,t,n,r,s){return new at(null!=e?e:this.key,null!=t?t:this.value,null!=n?n:this.color,null!=r?r:this.left,null!=s?s:this.right)}isEmpty(){return!1}inorderTraversal(e){return this.left.inorderTraversal(e)||e(this.key,this.value)||this.right.inorderTraversal(e)}reverseTraversal(e){return this.right.reverseTraversal(e)||e(this.key,this.value)||this.left.reverseTraversal(e)}min(){return this.left.isEmpty()?this:this.left.min()}minKey(){return this.min().key}maxKey(){return this.right.isEmpty()?this.key:this.right.maxKey()}insert(e,t,n){let r=this;const s=n(e,r.key);return r=s<0?r.copy(null,null,null,r.left.insert(e,t,n),null):0===s?r.copy(null,t,null,null,null):r.copy(null,null,null,null,r.right.insert(e,t,n)),r.fixUp()}removeMin(){if(this.left.isEmpty())return at.EMPTY;let e=this;return e.left.isRed()||e.left.left.isRed()||(e=e.moveRedLeft()),e=e.copy(null,null,null,e.left.removeMin(),null),e.fixUp()}remove(e,t){let n,r=this;if(t(e,r.key)<0)r.left.isEmpty()||r.left.isRed()||r.left.left.isRed()||(r=r.moveRedLeft()),r=r.copy(null,null,null,r.left.remove(e,t),null);else{if(r.left.isRed()&&(r=r.rotateRight()),r.right.isEmpty()||r.right.isRed()||r.right.left.isRed()||(r=r.moveRedRight()),0===t(e,r.key)){if(r.right.isEmpty())return at.EMPTY;n=r.right.min(),r=r.copy(n.key,n.value,null,null,r.right.removeMin())}r=r.copy(null,null,null,null,r.right.remove(e,t))}return r.fixUp()}isRed(){return this.color}fixUp(){let e=this;return e.right.isRed()&&!e.left.isRed()&&(e=e.rotateLeft()),e.left.isRed()&&e.left.left.isRed()&&(e=e.rotateRight()),e.left.isRed()&&e.right.isRed()&&(e=e.colorFlip()),e}moveRedLeft(){let e=this.colorFlip();return e.right.left.isRed()&&(e=e.copy(null,null,null,null,e.right.rotateRight()),e=e.rotateLeft(),e=e.colorFlip()),e}moveRedRight(){let e=this.colorFlip();return e.left.left.isRed()&&(e=e.rotateRight(),e=e.colorFlip()),e}rotateLeft(){const e=this.copy(null,null,at.RED,null,this.right.left);return this.right.copy(null,null,this.color,e,null)}rotateRight(){const e=this.copy(null,null,at.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,e)}colorFlip(){const e=this.left.copy(null,null,!this.left.color,null,null),t=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,e,t)}checkMaxDepth(){const e=this.check();return Math.pow(2,e)<=this.size+1}check(){if(this.isRed()&&this.left.isRed())throw _(43730,{key:this.key,value:this.value});if(this.right.isRed())throw _(14113,{key:this.key,value:this.value});const e=this.left.check();if(e!==this.right.check())throw _(27949);return e+(this.isRed()?0:1)}}at.EMPTY=null,at.RED=!0,at.BLACK=!1,at.EMPTY=new class{constructor(){this.size=0}get key(){throw _(57766)}get value(){throw _(16141)}get color(){throw _(16727)}get left(){throw _(29726)}get right(){throw _(36894)}copy(e,t,n,r,s){return this}insert(e,t,n){return new at(e,t)}remove(e,t){return this}isEmpty(){return!0}inorderTraversal(e){return!1}reverseTraversal(e){return!1}minKey(){return null}maxKey(){return null}isRed(){return!1}checkMaxDepth(){return!0}check(){return 0}};class it{constructor(e){this.comparator=e,this.data=new rt(this.comparator)}has(e){return null!==this.data.get(e)}first(){return this.data.minKey()}last(){return this.data.maxKey()}get size(){return this.data.size}indexOf(e){return this.data.indexOf(e)}forEach(e){this.data.inorderTraversal((t,n)=>(e(t),!1))}forEachInRange(e,t){const n=this.data.getIteratorFrom(e[0]);for(;n.hasNext();){const r=n.getNext();if(this.comparator(r.key,e[1])>=0)return;t(r.key)}}forEachWhile(e,t){let n;for(n=void 0!==t?this.data.getIteratorFrom(t):this.data.getIterator();n.hasNext();)if(!e(n.getNext().key))return}firstAfterOrEqual(e){const t=this.data.getIteratorFrom(e);return t.hasNext()?t.getNext().key:null}getIterator(){return new ot(this.data.getIterator())}getIteratorFrom(e){return new ot(this.data.getIteratorFrom(e))}add(e){return this.copy(this.data.remove(e).insert(e,!0))}delete(e){return this.has(e)?this.copy(this.data.remove(e)):this}isEmpty(){return this.data.isEmpty()}unionWith(e){let t=this;
2return t.size<e.size&&(t=e,e=this),e.forEach(e=>{t=t.add(e)}),t}isEqual(e){if(!(e instanceof it))return!1;if(this.size!==e.size)return!1;const t=this.data.getIterator(),n=e.data.getIterator();for(;t.hasNext();){const e=t.getNext().key,r=n.getNext().key;if(0!==this.comparator(e,r))return!1}return!0}toArray(){const e=[];return this.forEach(t=>{e.push(t)}),e}toString(){const e=[];return this.forEach(t=>e.push(t)),"SortedSet("+e.toString()+")"}copy(e){const t=new it(this.comparator);return t.data=e,t}}class ot{constructor(e){this.iter=e}getNext(){return this.iter.getNext().key}hasNext(){return this.iter.hasNext()}}class lt{constructor(e){this.fields=e,e.sort(le.comparator)}static empty(){return new lt([])}unionWith(e){let t=new it(le.comparator);for(const n of this.fields)t=t.add(n);for(const n of e)t=t.add(n);return new lt(t.toArray())}covers(e){for(const t of this.fields)if(t.isPrefixOf(e))return!0;return!1}isEqual(e){return Z(this.fields,e.fields,(e,t)=>e.isEqual(t))}}class ct extends Error{constructor(){super(...arguments),this.name="Base64DecodeError"}}class dt{constructor(e){this.binaryString=e}static fromBase64String(e){const t=function(e){try{return atob(e)}catch(e){throw"undefined"!=typeof DOMException&&e instanceof DOMException?new ct("Invalid base64 string: "+e):e}}(e);return new dt(t)}static fromUint8Array(e){const t=function(e){let t="";for(let n=0;n<e.length;++n)t+=String.fromCharCode(e[n]);return t}(e);return new dt(t)}[Symbol.iterator](){let e=0;return{next:()=>e<this.binaryString.length?{value:this.binaryString.charCodeAt(e++),done:!1}:{value:void 0,done:!0}}}toBase64(){return function(e){return btoa(e)}(this.binaryString)}toUint8Array(){return function(e){const t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t}(this.binaryString)}approximateByteSize(){return 2*this.binaryString.length}compareTo(e){return J(this.binaryString,e.binaryString)}isEqual(e){return this.binaryString===e.binaryString}}dt.EMPTY_BYTE_STRING=new dt("");const ut=new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);function mt(e){if(D(!!e,39018),"string"==typeof e){let t=0;const n=ut.exec(e);if(D(!!n,46558,{timestamp:e}),n[1]){let e=n[1];e=(e+"000000000").substr(0,9),t=Number(e)}const r=new Date(e);return{seconds:Math.floor(r.getTime()/1e3),nanos:t}}return{seconds:ht(e.seconds),nanos:ht(e.nanos)}}function ht(e){return"number"==typeof e?e:"string"==typeof e?Number(e):0}function pt(e){return"string"==typeof e?dt.fromBase64String(e):dt.fromUint8Array(e)}const gt="server_timestamp",ft="__type__",xt="__previous_value__",bt="__local_write_time__";function yt(e){var t,n;return(null===(n=((null===(t=null==e?void 0:e.mapValue)||void 0===t?void 0:t.fields)||{})[ft])||void 0===n?void 0:n.stringValue)===gt}function vt(e){const t=e.mapValue.fields[xt];return yt(t)?vt(t):t}function wt(e){const t=mt(e.mapValue.fields[bt].timestampValue);return new ne(t.seconds,t.nanos)}class jt{constructor(e,t,n,r,s,a,i,o,l){this.databaseId=e,this.appId=t,this.persistenceKey=n,this.host=r,this.ssl=s,this.forceLongPolling=a,this.autoDetectLongPolling=i,this.longPollingOptions=o,this.useFetchStreams=l}}const Nt="(default)";class kt{constructor(e,t){this.projectId=e,this.database=t||Nt}static empty(){return new kt("","")}get isDefaultDatabase(){return this.database===Nt}isEqual(e){return e instanceof kt&&e.projectId===this.projectId&&e.database===this.database}}const At="__type__",St="__max__",Et={mapValue:{fields:{__type__:{stringValue:St}}}},Ct="__vector__",Tt="value";function Pt(e){return"nullValue"in e?0:"booleanValue"in e?1:"integerValue"in e||"doubleValue"in e?2:"timestampValue"in e?3:"stringValue"in e?5:"bytesValue"in e?6:"referenceValue"in e?7:"geoPointValue"in e?8:"arrayValue"in e?9:"mapValue"in e?yt(e)?4:Yt(e)?9007199254740991:Ht(e)?10:11:_(28295,{value:e})}function _t(e,t){if(e===t)return!0;const n=Pt(e);if(n!==Pt(t))return!1;switch(n){case 0:case 9007199254740991:return!0;case 1:return e.booleanValue===t.booleanValue;case 4:return wt(e).isEqual(wt(t));case 3:return function(e,t){if("string"==typeof e.timestampValue&&"string"==typeof t.timestampValue&&e.timestampValue.length===t.timestampValue.length)return e.timestampValue===t.timestampValue;const n=mt(e.timestampValue),r=mt(t.timestampValue);return n.seconds===r.seconds&&n.nanos===r.nanos}(e,t);case 5:return e.stringValue===t.stringValue;
2case 6:return function(e,t){return pt(e.bytesValue).isEqual(pt(t.bytesValue))}(e,t);case 7:return e.referenceValue===t.referenceValue;case 8:return function(e,t){return ht(e.geoPointValue.latitude)===ht(t.geoPointValue.latitude)&&ht(e.geoPointValue.longitude)===ht(t.geoPointValue.longitude)}(e,t);case 2:return function(e,t){if("integerValue"in e&&"integerValue"in t)return ht(e.integerValue)===ht(t.integerValue);if("doubleValue"in e&&"doubleValue"in t){const n=ht(e.doubleValue),r=ht(t.doubleValue);return n===r?Ae(n)===Ae(r):isNaN(n)&&isNaN(r)}return!1}(e,t);case 9:return Z(e.arrayValue.values||[],t.arrayValue.values||[],_t);case 10:case 11:return function(e,t){const n=e.mapValue.fields||{},r=t.mapValue.fields||{};if(et(n)!==et(r))return!1;for(const s in n)if(n.hasOwnProperty(s)&&(void 0===r[s]||!_t(n[s],r[s])))return!1;return!0}(e,t);default:return _(52216,{left:e})}}function It(e,t){return void 0!==(e.values||[]).find(e=>_t(e,t))}function Dt(e,t){if(e===t)return 0;const n=Pt(e),r=Pt(t);if(n!==r)return J(n,r);switch(n){case 0:case 9007199254740991:return 0;case 1:return J(e.booleanValue,t.booleanValue);case 2:return function(e,t){const n=ht(e.integerValue||e.doubleValue),r=ht(t.integerValue||t.doubleValue);return n<r?-1:n>r?1:n===r?0:isNaN(n)?isNaN(r)?0:-1:1}(e,t);case 3:return Rt(e.timestampValue,t.timestampValue);case 4:return Rt(wt(e),wt(t));case 5:return $(e.stringValue,t.stringValue);case 6:return function(e,t){const n=pt(e),r=pt(t);return n.compareTo(r)}(e.bytesValue,t.bytesValue);case 7:return function(e,t){const n=e.split("/"),r=t.split("/");for(let s=0;s<n.length&&s<r.length;s++){const e=J(n[s],r[s]);if(0!==e)return e}return J(n.length,r.length)}(e.referenceValue,t.referenceValue);case 8:return function(e,t){const n=J(ht(e.latitude),ht(t.latitude));return 0!==n?n:J(ht(e.longitude),ht(t.longitude))}(e.geoPointValue,t.geoPointValue);case 9:return Lt(e.arrayValue,t.arrayValue);case 10:return function(e,t){var n,r,s,a;const i=e.fields||{},o=t.fields||{},l=null===(n=i[Tt])||void 0===n?void 0:n.arrayValue,c=null===(r=o[Tt])||void 0===r?void 0:r.arrayValue,d=J((null===(s=null==l?void 0:l.values)||void 0===s?void 0:s.length)||0,(null===(a=null==c?void 0:c.values)||void 0===a?void 0:a.length)||0);return 0!==d?d:Lt(l,c)}(e.mapValue,t.mapValue);case 11:return function(e,t){if(e===Et.mapValue&&t===Et.mapValue)return 0;if(e===Et.mapValue)return 1;if(t===Et.mapValue)return-1;const n=e.fields||{},r=Object.keys(n),s=t.fields||{},a=Object.keys(s);r.sort(),a.sort();for(let i=0;i<r.length&&i<a.length;++i){const e=$(r[i],a[i]);if(0!==e)return e;const t=Dt(n[r[i]],s[a[i]]);if(0!==t)return t}return J(r.length,a.length)}(e.mapValue,t.mapValue);default:throw _(23264,{Pe:n})}}function Rt(e,t){if("string"==typeof e&&"string"==typeof t&&e.length===t.length)return J(e,t);const n=mt(e),r=mt(t),s=J(n.seconds,r.seconds);return 0!==s?s:J(n.nanos,r.nanos)}function Lt(e,t){const n=e.values||[],r=t.values||[];for(let s=0;s<n.length&&s<r.length;++s){const e=Dt(n[s],r[s]);if(e)return e}return J(n.length,r.length)}function Mt(e){return Ot(e)}function Ot(e){return"nullValue"in e?"null":"booleanValue"in e?""+e.booleanValue:"integerValue"in e?""+e.integerValue:"doubleValue"in e?""+e.doubleValue:"timestampValue"in e?function(e){const t=mt(e);return"time(".concat(t.seconds,",").concat(t.nanos,")")}(e.timestampValue):"stringValue"in e?e.stringValue:"bytesValue"in e?function(e){return pt(e).toBase64()}(e.bytesValue):"referenceValue"in e?function(e){return ce.fromName(e).toString()}(e.referenceValue):"geoPointValue"in e?function(e){return"geo(".concat(e.latitude,",").concat(e.longitude,")")}(e.geoPointValue):"arrayValue"in e?function(e){let t="[",n=!0;for(const r of e.values||[])n?n=!1:t+=",",t+=Ot(r);return t+"]"}(e.arrayValue):"mapValue"in e?function(e){const t=Object.keys(e.fields||{}).sort();let n="{",r=!0;for(const s of t)r?r=!1:n+=",",n+="".concat(s,":").concat(Ot(e.fields[s]));return n+"}"}(e.mapValue):_(61005,{value:e})}function Ft(e){switch(Pt(e)){case 0:case 1:return 4;case 2:return 8;case 3:case 8:return 16;case 4:const t=vt(e);return t?16+Ft(t):16;case 5:return 2*e.stringValue.length;case 6:return pt(e.bytesValue).approximateByteSize();case 7:return e.referenceValue.length;case 9:return function(e){return(e.values||[]).reduce((e,t)=>
2e+Ft(t),0)}(e.arrayValue);case 10:case 11:return function(e){let t=0;return tt(e.fields,(e,n)=>{t+=e.length+Ft(n)}),t}(e.mapValue);default:throw _(13486,{value:e})}}function Ut(e,t){return{referenceValue:"projects/".concat(e.projectId,"/databases/").concat(e.database,"/documents/").concat(t.path.canonicalString())}}function Bt(e){return!!e&&"integerValue"in e}function zt(e){return!!e&&"arrayValue"in e}function Vt(e){return!!e&&"nullValue"in e}function qt(e){return!!e&&"doubleValue"in e&&isNaN(Number(e.doubleValue))}function Wt(e){return!!e&&"mapValue"in e}function Ht(e){var t,n;return(null===(n=((null===(t=null==e?void 0:e.mapValue)||void 0===t?void 0:t.fields)||{})[At])||void 0===n?void 0:n.stringValue)===Ct}function Gt(e){if(e.geoPointValue)return{geoPointValue:Object.assign({},e.geoPointValue)};if(e.timestampValue&&"object"==typeof e.timestampValue)return{timestampValue:Object.assign({},e.timestampValue)};if(e.mapValue){const t={mapValue:{fields:{}}};return tt(e.mapValue.fields,(e,n)=>t.mapValue.fields[e]=Gt(n)),t}if(e.arrayValue){const t={arrayValue:{values:[]}};for(let n=0;n<(e.arrayValue.values||[]).length;++n)t.arrayValue.values[n]=Gt(e.arrayValue.values[n]);return t}return Object.assign({},e)}function Yt(e){return(((e.mapValue||{}).fields||{}).__type__||{}).stringValue===St}class Kt{constructor(e){this.value=e}static empty(){return new Kt({mapValue:{}})}field(e){if(e.isEmpty())return this.value;{let t=this.value;for(let n=0;n<e.length-1;++n)if(t=(t.mapValue.fields||{})[e.get(n)],!Wt(t))return null;return t=(t.mapValue.fields||{})[e.lastSegment()],t||null}}set(e,t){this.getFieldsMap(e.popLast())[e.lastSegment()]=Gt(t)}setAll(e){let t=le.emptyPath(),n={},r=[];e.forEach((e,s)=>{if(!t.isImmediateParentOf(s)){const e=this.getFieldsMap(t);this.applyChanges(e,n,r),n={},r=[],t=s.popLast()}e?n[s.lastSegment()]=Gt(e):r.push(s.lastSegment())});const s=this.getFieldsMap(t);this.applyChanges(s,n,r)}delete(e){const t=this.field(e.popLast());Wt(t)&&t.mapValue.fields&&delete t.mapValue.fields[e.lastSegment()]}isEqual(e){return _t(this.value,e.value)}getFieldsMap(e){let t=this.value;t.mapValue.fields||(t.mapValue={fields:{}});for(let n=0;n<e.length;++n){let r=t.mapValue.fields[e.get(n)];Wt(r)&&r.mapValue.fields||(r={mapValue:{fields:{}}},t.mapValue.fields[e.get(n)]=r),t=r}return t.mapValue.fields}applyChanges(e,t,n){tt(t,(t,n)=>e[t]=n);for(const r of n)delete e[r]}clone(){return new Kt(Gt(this.value))}}function Jt(e){const t=[];return tt(e.fields,(e,n)=>{const r=new le([e]);if(Wt(n)){const e=Jt(n.mapValue).fields;if(0===e.length)t.push(r);else for(const n of e)t.push(r.child(n))}else t.push(r)}),new lt(t)}class $t{constructor(e,t,n,r,s,a,i){this.key=e,this.documentType=t,this.version=n,this.readTime=r,this.createTime=s,this.data=a,this.documentState=i}static newInvalidDocument(e){return new $t(e,0,re.min(),re.min(),re.min(),Kt.empty(),0)}static newFoundDocument(e,t,n,r){return new $t(e,1,t,re.min(),n,r,0)}static newNoDocument(e,t){return new $t(e,2,t,re.min(),re.min(),Kt.empty(),0)}static newUnknownDocument(e,t){return new $t(e,3,t,re.min(),re.min(),Kt.empty(),2)}convertToFoundDocument(e,t){return!this.createTime.isEqual(re.min())||2!==this.documentType&&0!==this.documentType||(this.createTime=e),this.version=e,this.documentType=1,this.data=t,this.documentState=0,this}convertToNoDocument(e){return this.version=e,this.documentType=2,this.data=Kt.empty(),this.documentState=0,this}convertToUnknownDocument(e){return this.version=e,this.documentType=3,this.data=Kt.empty(),this.documentState=2,this}setHasCommittedMutations(){return this.documentState=2,this}setHasLocalMutations(){return this.documentState=1,this.version=re.min(),this}setReadTime(e){return this.readTime=e,this}get hasLocalMutations(){return 1===this.documentState}get hasCommittedMutations(){return 2===this.documentState}get hasPendingWrites(){return this.hasLocalMutations||this.hasCommittedMutations}isValidDocument(){return 0!==this.documentType}isFoundDocument(){return 1===this.documentType}isNoDocument(){return 2===this.documentType}isUnknownDocument(){return 3===this.documentType}isEqual(e){return e instanceof $t&&this.key.isEqual(e.key)&&this.version.isEqual(e.version)&&this.documentType===e.documentType&&this.documentState===e.documentState&&this.data.isEqual(e.data)}mutableCopy(){return new $t(this.key,this.documentType,this.version,this.readTime,this.createTime,this.data.clone(),this.documentState)}toString(){return"Document(".concat(this.key,", ").concat(this.version,", ").concat(JSON.stringify(this.data.value),", {createTime: ").concat(this.createTime,"}), {documentType: ").concat(this.documentType,"}), {documentState: ").concat(this.documentState,"})")}}class Qt{constructor(e,t){this.position=e,this.inclusive=t}}function Xt(e,t,n){let r=0;for(let s=0;s<e.position.length;s++){const a=t[s],i=e.position[s];if(r=a.field.isKeyField()?ce.comparator(ce.fromName(i.referenceValue),n.key):Dt
2(i,n.data.field(a.field)),"desc"===a.dir&&(r*=-1),0!==r)break}return r}function Zt(e,t){if(null===e)return null===t;if(null===t)return!1;if(e.inclusive!==t.inclusive||e.position.length!==t.position.length)return!1;for(let n=0;n<e.position.length;n++)if(!_t(e.position[n],t.position[n]))return!1;return!0}class en{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"asc";this.field=e,this.dir=t}}function tn(e,t){return e.dir===t.dir&&e.field.isEqual(t.field)}class nn{}class rn extends nn{constructor(e,t,n){super(),this.field=e,this.op=t,this.value=n}static create(e,t,n){return e.isKeyField()?"in"===t||"not-in"===t?this.createKeyFieldInFilter(e,t,n):new mn(e,t,n):"array-contains"===t?new fn(e,n):"in"===t?new xn(e,n):"not-in"===t?new bn(e,n):"array-contains-any"===t?new yn(e,n):new rn(e,t,n)}static createKeyFieldInFilter(e,t,n){return"in"===t?new hn(e,n):new pn(e,n)}matches(e){const t=e.data.field(this.field);return"!="===this.op?null!==t&&void 0===t.nullValue&&this.matchesComparison(Dt(t,this.value)):null!==t&&Pt(this.value)===Pt(t)&&this.matchesComparison(Dt(t,this.value))}matchesComparison(e){switch(this.op){case"<":return e<0;case"<=":return e<=0;case"==":return 0===e;case"!=":return 0!==e;case">":return e>0;case">=":return e>=0;default:return _(47266,{operator:this.op})}}isInequality(){return["<","<=",">",">=","!=","not-in"].indexOf(this.op)>=0}getFlattenedFilters(){return[this]}getFilters(){return[this]}}class sn extends nn{constructor(e,t){super(),this.filters=e,this.op=t,this.Te=null}static create(e,t){return new sn(e,t)}matches(e){return an(this)?void 0===this.filters.find(t=>!t.matches(e)):void 0!==this.filters.find(t=>t.matches(e))}getFlattenedFilters(){return null!==this.Te||(this.Te=this.filters.reduce((e,t)=>e.concat(t.getFlattenedFilters()),[])),this.Te}getFilters(){return Object.assign([],this.filters)}}function an(e){return"and"===e.op}function on(e){return ln(e)&&an(e)}function ln(e){for(const t of e.filters)if(t instanceof sn)return!1;return!0}function cn(e){if(e instanceof rn)return e.field.canonicalString()+e.op.toString()+Mt(e.value);if(on(e))return e.filters.map(e=>cn(e)).join(",");{const t=e.filters.map(e=>cn(e)).join(",");return"".concat(e.op,"(").concat(t,")")}}function dn(e,t){return e instanceof rn?function(e,t){return t instanceof rn&&e.op===t.op&&e.field.isEqual(t.field)&&_t(e.value,t.value)}(e,t):e instanceof sn?function(e,t){return t instanceof sn&&e.op===t.op&&e.filters.length===t.filters.length&&e.filters.reduce((e,n,r)=>e&&dn(n,t.filters[r]),!0)}(e,t):void _(19439)}function un(e){return e instanceof rn?function(e){return"".concat(e.field.canonicalString()," ").concat(e.op," ").concat(Mt(e.value))}(e):e instanceof sn?function(e){return e.op.toString()+" {"+e.getFilters().map(un).join(" ,")+"}"}(e):"Filter"}class mn extends rn{constructor(e,t,n){super(e,t,n),this.key=ce.fromName(n.referenceValue)}matches(e){const t=ce.comparator(e.key,this.key);return this.matchesComparison(t)}}class hn extends rn{constructor(e,t){super(e,"in",t),this.keys=gn("in",t)}matches(e){return this.keys.some(t=>t.isEqual(e.key))}}class pn extends rn{constructor(e,t){super(e,"not-in",t),this.keys=gn("not-in",t)}matches(e){return!this.keys.some(t=>t.isEqual(e.key))}}function gn(e,t){var n;return((null===(n=t.arrayValue)||void 0===n?void 0:n.values)||[]).map(e=>ce.fromName(e.referenceValue))}class fn extends rn{constructor(e,t){super(e,"array-contains",t)}matches(e){const t=e.data.field(this.field);return zt(t)&&It(t.arrayValue,this.value)}}class xn extends rn{constructor(e,t){super(e,"in",t)}matches(e){const t=e.data.field(this.field);return null!==t&&It(this.value.arrayValue,t)}}class bn extends rn{constructor(e,t){super(e,"not-in",t)}matches(e){if(It(this.value.arrayValue,{nullValue:"NULL_VALUE"}))return!1;const t=e.data.field(this.field);return null!==t&&void 0===t.nullValue&&!It(this.value.arrayValue,t)}}class yn extends rn{constructor(e,t){super(e,"array-contains-any",t)}matches(e){const t=e.data.field(this.field);return!(!zt(t)||!t.arrayValue.values)&&t.arrayValue.values.some(e=>It(this.value.arrayValue,e))}}class vn{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,i=arguments.length>6&&void 0!==arguments[6]?arguments[6]:null;this.path=e,this.collectionGroup=t,this.orderBy=n,this.filters=r,this.limit=s,this.startAt=a,this.endAt=i,this.Ie=null}}function wn(e){return new vn(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,arguments.length>6&&void 0!==arguments[6]?arguments[6]:null)}function jn(e){const t=R(e);if(null===t.Ie){let e=t.path.canonicalString();null!==t.collectionGroup&&(e+="|cg:"+t.collectionGroup),e+="|f:",e+=t.filters.map(e=>cn(e)).join(","),e+="|ob:",e+=t.orderBy.map(e=>function(e){return e.field.canonicalString()+e.dir}(e)).join(","),ke(t.limit)||(e+="|l:",e+=t.limit),t.startAt&&(e+="|lb:",e+=t.startAt.inclusive?"b:":"a:",e+=t.startAt.position.map(e=>Mt(e)).join(",")),t.endAt&&(e+="|ub:",e+=t.endAt.inclusive?"a:":"b:",e+=t.endAt.position.map(e=>Mt(e)).join(",")),t.Ie=e}return t.Ie}function Nn(e,t){if(e.limit!==t.limit)return!1;if(e.orderBy.length!==t.orderBy.length)return!1;for(let n=0;n<e.orderBy.length;n++)if(!tn(e.orderBy[n],t.orderBy[n]))return!1;if(e.filters.length!==t.filters.length)return!1;for(let n=0;n<e.filters.length;n++)if(!dn(e.filters[n],t.filters[n]))return!1;return e.collectionGroup===t.collectionGroup&&!!e.path.isEqual(t.path)&&!!Zt(e.startAt,t.startAt)&&Zt(e.endAt,t.endAt)}function kn(e){return ce.isDocumentKey(e.path)&&null===e.collectionGroup&&0===e.filters.length}class An{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"F",i=arguments.length>6&&void 0!==arguments[6]?arguments[6]:null,o=arguments.length>7&&void 0!==arguments[7]?arguments[7]:null;this.path=e,this.collectionGroup=t,this.explicitOrderBy=n,this.filters=r,this.limit=s,this.limitType=a,this.startAt=i,this.endAt=o,this.Ee=null,this.de=null,this.Ae=null,this.startAt,this.endAt}}function Sn(e,t,n,r,s,a,i,o){return new An(e,t,n,r,s,a,i,o)}function En(e){return new An(e)}function Cn(e){return 0===e.filters.length&&null===e.limit&&null==e.startAt&&null==e.endAt&&(0===e.explicitOrderBy.length||1===e.explicitOrderBy.length&&e.explicitOrderBy[0].field.isKeyField())}function Tn(e){return null!==e.collectionGroup}function Pn(e){const t=R(e);if(null===t.Ee){t.Ee=[];const e=new Set;for(const s of t.explicitOrderBy)t.Ee.push(s),e.add(s.field.canonicalString());const n=t.explicitOrderBy.length>0?t.explicitOrderBy[t.explicitOrderBy.length-1].dir:"asc",r=function(e){let t=new it(le.comparator);
2return e.filters.forEach(e=>{e.getFlattenedFilters().forEach(e=>{e.isInequality()&&(t=t.add(e.field))})}),t}(t);r.forEach(r=>{e.has(r.canonicalString())||r.isKeyField()||t.Ee.push(new en(r,n))}),e.has(le.keyField().canonicalString())||t.Ee.push(new en(le.keyField(),n))}return t.Ee}function _n(e){const t=R(e);return t.de||(t.de=In(t,Pn(e))),t.de}function In(e,t){if("F"===e.limitType)return wn(e.path,e.collectionGroup,t,e.filters,e.limit,e.startAt,e.endAt);{t=t.map(e=>{const t="desc"===e.dir?"asc":"desc";return new en(e.field,t)});const n=e.endAt?new Qt(e.endAt.position,e.endAt.inclusive):null,r=e.startAt?new Qt(e.startAt.position,e.startAt.inclusive):null;return wn(e.path,e.collectionGroup,t,e.filters,e.limit,n,r)}}function Dn(e,t){const n=e.filters.concat([t]);return new An(e.path,e.collectionGroup,e.explicitOrderBy.slice(),n,e.limit,e.limitType,e.startAt,e.endAt)}function Rn(e,t,n){return new An(e.path,e.collectionGroup,e.explicitOrderBy.slice(),e.filters.slice(),t,n,e.startAt,e.endAt)}function Ln(e,t){return Nn(_n(e),_n(t))&&e.limitType===t.limitType}function Mn(e){return"".concat(jn(_n(e)),"|lt:").concat(e.limitType)}function On(e){return"Query(target=".concat(function(e){let t=e.path.canonicalString();return null!==e.collectionGroup&&(t+=" collectionGroup="+e.collectionGroup),e.filters.length>0&&(t+=", filters: [".concat(e.filters.map(e=>un(e)).join(", "),"]")),ke(e.limit)||(t+=", limit: "+e.limit),e.orderBy.length>0&&(t+=", orderBy: [".concat(e.orderBy.map(e=>function(e){return"".concat(e.field.canonicalString()," (").concat(e.dir,")")}(e)).join(", "),"]")),e.startAt&&(t+=", startAt: ",t+=e.startAt.inclusive?"b:":"a:",t+=e.startAt.position.map(e=>Mt(e)).join(",")),e.endAt&&(t+=", endAt: ",t+=e.endAt.inclusive?"a:":"b:",t+=e.endAt.position.map(e=>Mt(e)).join(",")),"Target(".concat(t,")")}(_n(e)),"; limitType=").concat(e.limitType,")")}function Fn(e,t){return t.isFoundDocument()&&function(e,t){const n=t.key.path;return null!==e.collectionGroup?t.key.hasCollectionId(e.collectionGroup)&&e.path.isPrefixOf(n):ce.isDocumentKey(e.path)?e.path.isEqual(n):e.path.isImmediateParentOf(n)}(e,t)&&function(e,t){for(const n of Pn(e))if(!n.field.isKeyField()&&null===t.data.field(n.field))return!1;return!0}(e,t)&&function(e,t){for(const n of e.filters)if(!n.matches(t))return!1;return!0}(e,t)&&function(e,t){return!(e.startAt&&!function(e,t,n){const r=Xt(e,t,n);return e.inclusive?r<=0:r<0}(e.startAt,Pn(e),t))&&!(e.endAt&&!function(e,t,n){const r=Xt(e,t,n);return e.inclusive?r>=0:r>0}(e.endAt,Pn(e),t))}(e,t)}function Un(e){return e.collectionGroup||(e.path.length%2==1?e.path.lastSegment():e.path.get(e.path.length-2))}function Bn(e){return(t,n)=>{let r=!1;for(const s of Pn(e)){const e=zn(s,t,n);if(0!==e)return e;r=r||s.field.isKeyField()}return 0}}function zn(e,t,n){const r=e.field.isKeyField()?ce.comparator(t.key,n.key):function(e,t,n){const r=t.data.field(e),s=n.data.field(e);return null!==r&&null!==s?Dt(r,s):_(42886)}(e.field,t,n);switch(e.dir){case"asc":return r;case"desc":return-1*r;default:return _(19790,{direction:e.dir})}}class Vn{constructor(e,t){this.mapKeyFn=e,this.equalsFn=t,this.inner={},this.innerSize=0}get(e){const t=this.mapKeyFn(e),n=this.inner[t];if(void 0!==n)for(const[r,s]of n)if(this.equalsFn(r,e))return s}has(e){return void 0!==this.get(e)}set(e,t){const n=this.mapKeyFn(e),r=this.inner[n];if(void 0===r)return this.inner[n]=[[e,t]],void this.innerSize++;for(let s=0;s<r.length;s++)if(this.equalsFn(r[s][0],e))return void(r[s]=[e,t]);r.push([e,t]),this.innerSize++}delete(e){const t=this.mapKeyFn(e),n=this.inner[t];if(void 0===n)return!1;for(let r=0;r<n.length;r++)if(this.equalsFn(n[r][0],e))return 1===n.length?delete this.inner[t]:n.splice(r,1),this.innerSize--,!0;return!1}forEach(e){tt(this.inner,(t,n)=>{for(const[r,s]of n)e(r,s)})}isEmpty(){return nt(this.inner)}size(){return this.innerSize}}const qn=new rt(ce.comparator);function Wn(){return qn}const Hn=new rt(ce.comparator);function Gn(){let e=Hn;for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];for(const s of n)e=e.insert(s.key,s);return e}function Yn(e){let t=Hn;return e.forEach((e,n)=>t=t.insert(e,n.overlayedDocument)),t}function Kn(){return $n()}function Jn(){return $n()}function $n(){return new Vn(e=>e.toString(),(e,t)=>e.isEqual(t))}const Qn=new rt(ce.comparator),Xn=new it(ce.comparator);function Zn(){let e=Xn;for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];for(const s of n)e=e.add(s);return e}const er=new it(J);function tr(){return er}function nr(e,t){if(e.useProto3Json){if(isNaN(t))return{doubleValue:"NaN"};if(t===1/0)return{doubleValue:"Infinity"};if(t===-1/0)return{doubleValue:"-Infinity"}}return{doubleValue:Ae(t)?"-0":t}}function rr(e){return{integerValue:""+e}}function sr(e,t){return Se(t)?rr(t):nr(e,t)}class ar{constructor(){this._=void 0}}function ir(e,t,n){return e instanceof cr?function(e,t){const n={fields:{[ft]:{stringValue:gt},[bt]:{timestampValue:{seconds:e.seconds,nanos:e.nanoseconds}}}};return t&&yt(t)&&(t=vt(t)),t&&(n.fields[xt]=t),{mapValue:n}}
2(n,t):e instanceof dr?ur(e,t):e instanceof mr?hr(e,t):function(e,t){const n=lr(e,t),r=gr(n)+gr(e.Re);return Bt(n)&&Bt(e.Re)?rr(r):nr(e.serializer,r)}(e,t)}function or(e,t,n){return e instanceof dr?ur(e,t):e instanceof mr?hr(e,t):n}function lr(e,t){return e instanceof pr?function(e){return Bt(e)||function(e){return!!e&&"doubleValue"in e}(e)}(t)?t:{integerValue:0}:null}class cr extends ar{}class dr extends ar{constructor(e){super(),this.elements=e}}function ur(e,t){const n=fr(t);for(const r of e.elements)n.some(e=>_t(e,r))||n.push(r);return{arrayValue:{values:n}}}class mr extends ar{constructor(e){super(),this.elements=e}}function hr(e,t){let n=fr(t);for(const r of e.elements)n=n.filter(e=>!_t(e,r));return{arrayValue:{values:n}}}class pr extends ar{constructor(e,t){super(),this.serializer=e,this.Re=t}}function gr(e){return ht(e.integerValue||e.doubleValue)}function fr(e){return zt(e)&&e.arrayValue.values?e.arrayValue.values.slice():[]}class xr{constructor(e,t){this.field=e,this.transform=t}}class br{constructor(e,t){this.version=e,this.transformResults=t}}class yr{constructor(e,t){this.updateTime=e,this.exists=t}static none(){return new yr}static exists(e){return new yr(void 0,e)}static updateTime(e){return new yr(e)}get isNone(){return void 0===this.updateTime&&void 0===this.exists}isEqual(e){return this.exists===e.exists&&(this.updateTime?!!e.updateTime&&this.updateTime.isEqual(e.updateTime):!e.updateTime)}}function vr(e,t){return void 0!==e.updateTime?t.isFoundDocument()&&t.version.isEqual(e.updateTime):void 0===e.exists||e.exists===t.isFoundDocument()}class wr{}function jr(e,t){if(!e.hasLocalMutations||t&&0===t.fields.length)return null;if(null===t)return e.isNoDocument()?new Ir(e.key,yr.none()):new Er(e.key,e.data,yr.none());{const n=e.data,r=Kt.empty();let s=new it(le.comparator);for(let e of t.fields)if(!s.has(e)){let t=n.field(e);null===t&&e.length>1&&(e=e.popLast(),t=n.field(e)),null===t?r.delete(e):r.set(e,t),s=s.add(e)}return new Cr(e.key,r,new lt(s.toArray()),yr.none())}}function Nr(e,t,n){e instanceof Er?function(e,t,n){const r=e.value.clone(),s=Pr(e.fieldTransforms,t,n.transformResults);r.setAll(s),t.convertToFoundDocument(n.version,r).setHasCommittedMutations()}(e,t,n):e instanceof Cr?function(e,t,n){if(!vr(e.precondition,t))return void t.convertToUnknownDocument(n.version);const r=Pr(e.fieldTransforms,t,n.transformResults),s=t.data;s.setAll(Tr(e)),s.setAll(r),t.convertToFoundDocument(n.version,s).setHasCommittedMutations()}(e,t,n):function(e,t,n){t.convertToNoDocument(n.version).setHasCommittedMutations()}(0,t,n)}function kr(e,t,n,r){return e instanceof Er?function(e,t,n,r){if(!vr(e.precondition,t))return n;const s=e.value.clone(),a=_r(e.fieldTransforms,r,t);return s.setAll(a),t.convertToFoundDocument(t.version,s).setHasLocalMutations(),null}(e,t,n,r):e instanceof Cr?function(e,t,n,r){if(!vr(e.precondition,t))return n;const s=_r(e.fieldTransforms,r,t),a=t.data;return a.setAll(Tr(e)),a.setAll(s),t.convertToFoundDocument(t.version,a).setHasLocalMutations(),null===n?null:n.unionWith(e.fieldMask.fields).unionWith(e.fieldTransforms.map(e=>e.field))}(e,t,n,r):function(e,t,n){return vr(e.precondition,t)?(t.convertToNoDocument(t.version).setHasLocalMutations(),null):n}(e,t,n)}function Ar(e,t){let n=null;for(const r of e.fieldTransforms){const e=t.data.field(r.field),s=lr(r.transform,e||null);null!=s&&(null===n&&(n=Kt.empty()),n.set(r.field,s))}return n||null}function Sr(e,t){return e.type===t.type&&!!e.key.isEqual(t.key)&&!!e.precondition.isEqual(t.precondition)&&!!function(e,t){return void 0===e&&void 0===t||!(!e||!t)&&Z(e,t,(e,t)=>function(e,t){return e.field.isEqual(t.field)&&function(e,t){return e instanceof dr&&t instanceof dr||e instanceof mr&&t instanceof mr?Z(e.elements,t.elements,_t):e instanceof pr&&t instanceof pr?_t(e.Re,t.Re):e instanceof cr&&t instanceof cr}(e.transform,t.transform)}(e,t))}(e.fieldTransforms,t.fieldTransforms)&&(0===e.type?e.value.isEqual(t.value):1!==e.type||e.data.isEqual(t.data)&&e.fieldMask.isEqual(t.fieldMask))}class Er extends wr{constructor(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];
2super(),this.key=e,this.value=t,this.precondition=n,this.fieldTransforms=r,this.type=0}getFieldMask(){return null}}class Cr extends wr{constructor(e,t,n,r){let s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];super(),this.key=e,this.data=t,this.fieldMask=n,this.precondition=r,this.fieldTransforms=s,this.type=1}getFieldMask(){return this.fieldMask}}function Tr(e){const t=new Map;return e.fieldMask.fields.forEach(n=>{if(!n.isEmpty()){const r=e.data.field(n);t.set(n,r)}}),t}function Pr(e,t,n){const r=new Map;D(e.length===n.length,32656,{Ve:n.length,me:e.length});for(let s=0;s<n.length;s++){const a=e[s],i=a.transform,o=t.data.field(a.field);r.set(a.field,or(i,o,n[s]))}return r}function _r(e,t,n){const r=new Map;for(const s of e){const e=s.transform,a=n.data.field(s.field);r.set(s.field,ir(e,a,t))}return r}class Ir extends wr{constructor(e,t){super(),this.key=e,this.precondition=t,this.type=2,this.fieldTransforms=[]}getFieldMask(){return null}}class Dr extends wr{constructor(e,t){super(),this.key=e,this.precondition=t,this.type=3,this.fieldTransforms=[]}getFieldMask(){return null}}class Rr{constructor(e,t,n,r){this.batchId=e,this.localWriteTime=t,this.baseMutations=n,this.mutations=r}applyToRemoteDocument(e,t){const n=t.mutationResults;for(let r=0;r<this.mutations.length;r++){const t=this.mutations[r];t.key.isEqual(e.key)&&Nr(t,e,n[r])}}applyToLocalView(e,t){for(const n of this.baseMutations)n.key.isEqual(e.key)&&(t=kr(n,e,t,this.localWriteTime));for(const n of this.mutations)n.key.isEqual(e.key)&&(t=kr(n,e,t,this.localWriteTime));return t}applyToLocalDocumentSet(e,t){const n=Jn();return this.mutations.forEach(r=>{const s=e.get(r.key),a=s.overlayedDocument;let i=this.applyToLocalView(a,s.mutatedFields);i=t.has(r.key)?null:i;const o=jr(a,i);null!==o&&n.set(r.key,o),a.isValidDocument()||a.convertToNoDocument(re.min())}),n}keys(){return this.mutations.reduce((e,t)=>e.add(t.key),Zn())}isEqual(e){return this.batchId===e.batchId&&Z(this.mutations,e.mutations,(e,t)=>Sr(e,t))&&Z(this.baseMutations,e.baseMutations,(e,t)=>Sr(e,t))}}class Lr{constructor(e,t,n,r){this.batch=e,this.commitVersion=t,this.mutationResults=n,this.docVersions=r}static from(e,t,n){D(e.mutations.length===n.length,58842,{fe:e.mutations.length,ge:n.length});let r=Qn;const s=e.mutations;for(let a=0;a<s.length;a++)r=r.insert(s[a].key,n[a].version);return new Lr(e,t,n,r)}}class Mr{constructor(e,t){this.largestBatchId=e,this.mutation=t}getKey(){return this.mutation.key}isEqual(e){return null!==e&&this.mutation===e.mutation}toString(){return"Overlay{\n largestBatchId: ".concat(this.largestBatchId,",\n mutation: ").concat(this.mutation.toString(),"\n }")}}class Or{constructor(e,t){this.count=e,this.unchangedNames=t}}var Fr,Ur;function Br(e){switch(e){case L.OK:return _(64938);case L.CANCELLED:case L.UNKNOWN:case L.DEADLINE_EXCEEDED:case L.RESOURCE_EXHAUSTED:case L.INTERNAL:case L.UNAVAILABLE:case L.UNAUTHENTICATED:return!1;case L.INVALID_ARGUMENT:case L.NOT_FOUND:case L.ALREADY_EXISTS:case L.PERMISSION_DENIED:case L.FAILED_PRECONDITION:case L.ABORTED:case L.OUT_OF_RANGE:case L.UNIMPLEMENTED:case L.DATA_LOSS:return!0;default:return _(15467,{code:e})}}function zr(e){if(void 0===e)return C("GRPC error has no .code"),L.UNKNOWN;switch(e){case Fr.OK:return L.OK;case Fr.CANCELLED:return L.CANCELLED;case Fr.UNKNOWN:return L.UNKNOWN;case Fr.DEADLINE_EXCEEDED:return L.DEADLINE_EXCEEDED;case Fr.RESOURCE_EXHAUSTED:return L.RESOURCE_EXHAUSTED;case Fr.INTERNAL:return L.INTERNAL;case Fr.UNAVAILABLE:return L.UNAVAILABLE;case Fr.UNAUTHENTICATED:return L.UNAUTHENTICATED;case Fr.INVALID_ARGUMENT:return L.INVALID_ARGUMENT;case Fr.NOT_FOUND:return L.NOT_FOUND;case Fr.ALREADY_EXISTS:return L.ALREADY_EXISTS;case Fr.PERMISSION_DENIED:return L.PERMISSION_DENIED;case Fr.FAILED_PRECONDITION:return L.FAILED_PRECONDITION;case Fr.ABORTED:return L.ABORTED;case Fr.OUT_OF_RANGE:return L.OUT_OF_RANGE;case Fr.UNIMPLEMENTED:return L.UNIMPLEMENTED;case Fr.DATA_LOSS:return L.DATA_LOSS;default:return _(39323,{code:e})}}(Ur=Fr||(Fr={}))[Ur.OK=0]="OK",Ur[Ur.CANCELLED=1]="CANCELLED",Ur[Ur.UNKNOWN=2]="UNKNOWN",Ur[Ur.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",Ur[Ur.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",Ur[Ur.NOT_FOUND=5]="NOT_FOUND",Ur[Ur.ALREADY_EXISTS=6]="ALREADY_EXISTS",Ur[Ur.PERMISSION_DENIED=7]="PERMISSION_DENIED",Ur[Ur.UNAUTHENTICATED=16]="UNAUTHENTICATED",Ur[Ur.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",Ur[Ur.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",Ur[Ur.ABORTED=10]="ABORTED",Ur[Ur.OUT_OF_RANGE=11]="OUT_OF_RANGE",Ur[Ur.UNIMPLEMENT
2ED=12]="UNIMPLEMENTED",Ur[Ur.INTERNAL=13]="INTERNAL",Ur[Ur.UNAVAILABLE=14]="UNAVAILABLE",Ur[Ur.DATA_LOSS=15]="DATA_LOSS";let Vr=null;const qr=new r([4294967295,4294967295],0);function Wr(e){const t=Y().encode(e),n=new s;return n.update(t),new Uint8Array(n.digest())}function Hr(e){const t=new DataView(e.buffer),n=t.getUint32(0,!0),s=t.getUint32(4,!0),a=t.getUint32(8,!0),i=t.getUint32(12,!0);return[new r([n,s],0),new r([a,i],0)]}class Gr{constructor(e,t,n){if(this.bitmap=e,this.padding=t,this.hashCount=n,t<0||t>=8)throw new Yr("Invalid padding: ".concat(t));if(n<0)throw new Yr("Invalid hash count: ".concat(n));if(e.length>0&&0===this.hashCount)throw new Yr("Invalid hash count: ".concat(n));if(0===e.length&&0!==t)throw new Yr("Invalid padding when bitmap length is 0: ".concat(t));this.pe=8*e.length-t,this.ye=r.fromNumber(this.pe)}we(e,t,n){let s=e.add(t.multiply(r.fromNumber(n)));return 1===s.compare(qr)&&(s=new r([s.getBits(0),s.getBits(1)],0)),s.modulo(this.ye).toNumber()}be(e){return!!(this.bitmap[Math.floor(e/8)]&1<<e%8)}mightContain(e){if(0===this.pe)return!1;const t=Wr(e),[n,r]=Hr(t);for(let s=0;s<this.hashCount;s++){const e=this.we(n,r,s);if(!this.be(e))return!1}return!0}static create(e,t,n){const r=e%8==0?0:8-e%8,s=new Uint8Array(Math.ceil(e/8)),a=new Gr(s,r,t);return n.forEach(e=>a.insert(e)),a}insert(e){if(0===this.pe)return;const t=Wr(e),[n,r]=Hr(t);for(let s=0;s<this.hashCount;s++){const e=this.we(n,r,s);this.Se(e)}}Se(e){const t=Math.floor(e/8),n=e%8;this.bitmap[t]|=1<<n}}class Yr extends Error{constructor(){super(...arguments),this.name="BloomFilterError"}}class Kr{constructor(e,t,n,r,s){this.snapshotVersion=e,this.targetChanges=t,this.targetMismatches=n,this.documentUpdates=r,this.resolvedLimboDocuments=s}static createSynthesizedRemoteEventForCurrentChange(e,t,n){const r=new Map;return r.set(e,Jr.createSynthesizedTargetChangeForCurrentChange(e,t,n)),new Kr(re.min(),r,new rt(J),Wn(),Zn())}}class Jr{constructor(e,t,n,r,s){this.resumeToken=e,this.current=t,this.addedDocuments=n,this.modifiedDocuments=r,this.removedDocuments=s}static createSynthesizedTargetChangeForCurrentChange(e,t,n){return new Jr(n,t,Zn(),Zn(),Zn())}}class $r{constructor(e,t,n,r){this.De=e,this.removedTargetIds=t,this.key=n,this.ve=r}}class Qr{constructor(e,t){this.targetId=e,this.Ce=t}}class Xr{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:dt.EMPTY_BYTE_STRING,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;this.state=e,this.targetIds=t,this.resumeToken=n,this.cause=r}}class Zr{constructor(){this.Fe=0,this.Me=ns(),this.xe=dt.EMPTY_BYTE_STRING,this.Oe=!1,this.Ne=!0}get current(){return this.Oe}get resumeToken(){return this.xe}get Be(){return 0!==this.Fe}get Le(){return this.Ne}ke(e){e.approximateByteSize()>0&&(this.Ne=!0,this.xe=e)}qe(){let e=Zn(),t=Zn(),n=Zn();return this.Me.forEach((r,s)=>{switch(s){case 0:e=e.add(r);break;case 2:t=t.add(r);break;case 1:n=n.add(r);break;default:_(38017,{changeType:s})}}),new Jr(this.xe,this.Oe,e,t,n)}Qe(){this.Ne=!1,this.Me=ns()}$e(e,t){this.Ne=!0,this.Me=this.Me.insert(e,t)}Ue(e){this.Ne=!0,this.Me=this.Me.remove(e)}Ke(){this.Fe+=1}We(){this.Fe-=1,D(this.Fe>=0,3241,{Fe:this.Fe})}Ge(){this.Ne=!0,this.Oe=!0}}class es{constructor(e){this.ze=e,this.je=new Map,this.He=Wn(),this.Je=ts(),this.Ye=ts(),this.Ze=new rt(J)}Xe(e){for(const t of e.De)e.ve&&e.ve.isFoundDocument()?this.et(t,e.ve):this.tt(t,e.key,e.ve);for(const t of e.removedTargetIds)this.tt(t,e.key,e.ve)}nt(e){this.forEachTarget(e,t=>{const n=this.rt(t);switch(e.state){case 0:this.it(t)&&n.ke(e.resumeToken);break;case 1:n.We(),n.Be||n.Qe(),n.ke(e.resumeToken);break;case 2:n.We(),n.Be||this.removeTarget(t);break;case 3:this.it(t)&&(n.Ge(),n.ke(e.resumeToken));break;case 4:this.it(t)&&(this.st(t),n.ke(e.resumeToken));break;default:_(56790,{state:e.state})}})}forEachTarget(e,t){e.targetIds.length>0?e.targetIds.forEach(t):this.je.forEach((e,n)=>{this.it(n)&&t(n)})}ot(e){const t=e.targetId,n=e.Ce.count,r=this._t(t);if(r){const s=r.target;if(kn(s))if(0===n){const e=new ce(s.path);this.tt(t,e,$t.newNoDocument(e,re.min()))}else D(1===n,20013,{expectedCount:n});else{const r=this.ut(t);if(r!==n){const n=this.ct(e),s=n?this.lt(n,e,r):1;if(0!==s){this.st(t);const e=2===s?"TargetPurposeExistenceFilterMismatchBloom":"TargetPurposeExistenceFilterMismatch";this.Ze=this.Ze.insert(t,e)}
2null==Vr||Vr.ht(function(e,t,n,r,s){var a,i,o,l,c,d;const u={localCacheCount:e,existenceFilterCount:t.count,databaseId:n.database,projectId:n.projectId},m=t.unchangedNames;return m&&(u.bloomFilter={applied:0===s,hashCount:null!==(a=null==m?void 0:m.hashCount)&&void 0!==a?a:0,bitmapLength:null!==(l=null===(o=null===(i=null==m?void 0:m.bits)||void 0===i?void 0:i.bitmap)||void 0===o?void 0:o.length)&&void 0!==l?l:0,padding:null!==(d=null===(c=null==m?void 0:m.bits)||void 0===c?void 0:c.padding)&&void 0!==d?d:0,mightContain:e=>{var t;return null!==(t=null==r?void 0:r.mightContain(e))&&void 0!==t&&t}}),u}(r,e.Ce,this.ze.Pt(),n,s))}}}}ct(e){const t=e.Ce.unchangedNames;if(!t||!t.bits)return null;const{bits:{bitmap:n="",padding:r=0},hashCount:s=0}=t;let a,i;try{a=pt(n).toUint8Array()}catch(e){if(e instanceof ct)return T("Decoding the base64 bloom filter in existence filter failed ("+e.message+"); ignoring the bloom filter and falling back to full re-query."),null;throw e}try{i=new Gr(a,r,s)}catch(e){return T(e instanceof Yr?"BloomFilter error: ":"Applying bloom filter failed: ",e),null}return 0===i.pe?null:i}lt(e,t,n){return t.Ce.count===n-this.Tt(e,t.targetId)?0:2}Tt(e,t){const n=this.ze.getRemoteKeysForTarget(t);let r=0;return n.forEach(n=>{const s=this.ze.Pt(),a="projects/".concat(s.projectId,"/databases/").concat(s.database,"/documents/").concat(n.path.canonicalString());e.mightContain(a)||(this.tt(t,n,null),r++)}),r}It(e){const t=new Map;this.je.forEach((n,r)=>{const s=this._t(r);if(s){if(n.current&&kn(s.target)){const t=new ce(s.target.path);this.Et(t).has(r)||this.dt(r,t)||this.tt(r,t,$t.newNoDocument(t,e))}n.Le&&(t.set(r,n.qe()),n.Qe())}});let n=Zn();this.Ye.forEach((e,t)=>{let r=!0;t.forEachWhile(e=>{const t=this._t(e);return!t||"TargetPurposeLimboResolution"===t.purpose||(r=!1,!1)}),r&&(n=n.add(e))}),this.He.forEach((t,n)=>n.setReadTime(e));const r=new Kr(e,t,this.Ze,this.He,n);return this.He=Wn(),this.Je=ts(),this.Ye=ts(),this.Ze=new rt(J),r}et(e,t){if(!this.it(e))return;const n=this.dt(e,t.key)?2:0;this.rt(e).$e(t.key,n),this.He=this.He.insert(t.key,t),this.Je=this.Je.insert(t.key,this.Et(t.key).add(e)),this.Ye=this.Ye.insert(t.key,this.At(t.key).add(e))}tt(e,t,n){if(!this.it(e))return;const r=this.rt(e);this.dt(e,t)?r.$e(t,1):r.Ue(t),this.Ye=this.Ye.insert(t,this.At(t).delete(e)),this.Ye=this.Ye.insert(t,this.At(t).add(e)),n&&(this.He=this.He.insert(t,n))}removeTarget(e){this.je.delete(e)}ut(e){const t=this.rt(e).qe();return this.ze.getRemoteKeysForTarget(e).size+t.addedDocuments.size-t.removedDocuments.size}Ke(e){this.rt(e).Ke()}rt(e){let t=this.je.get(e);return t||(t=new Zr,this.je.set(e,t)),t}At(e){let t=this.Ye.get(e);return t||(t=new it(J),this.Ye=this.Ye.insert(e,t)),t}Et(e){let t=this.Je.get(e);return t||(t=new it(J),this.Je=this.Je.insert(e,t)),t}it(e){const t=null!==this._t(e);return t||E("WatchChangeAggregator","Detected inactive target",e),t}_t(e){const t=this.je.get(e);return t&&t.Be?null:this.ze.Rt(e)}st(e){this.je.set(e,new Zr),this.ze.getRemoteKeysForTarget(e).forEach(t=>{this.tt(e,t,null)})}dt(e,t){return this.ze.getRemoteKeysForTarget(e).has(t)}}function ts(){return new rt(ce.comparator)}function ns(){return new rt(ce.comparator)}const rs={asc:"ASCENDING",desc:"DESCENDING"},ss={"<":"LESS_THAN","<=":"LESS_THAN_OR_EQUAL",">":"GREATER_THAN",">=":"GREATER_THAN_OR_EQUAL","==":"EQUAL","!=":"NOT_EQUAL","array-contains":"ARRAY_CONTAINS",in:"IN","not-in":"NOT_IN","array-contains-any":"ARRAY_CONTAINS_ANY"},as={and:"AND",or:"OR"};class is{constructor(e,t){this.databaseId=e,this.useProto3Json=t}}function os(e,t){return e.useProto3Json||ke(t)?t:{value:t}}function ls(e,t){return e.useProto3Json?"".concat(new Date(1e3*t.seconds).toISOString().replace(/\.\d*/,"").replace("Z",""),".").concat(("000000000"+t.nanoseconds).slice(-9),"Z"):{seconds:""+t.seconds,nanos:t.nanoseconds}}function cs(e,t){return e.useProto3Json?t.toBase64():t.toUint8Array()}function ds(e,t){return ls(e,t.toTimestamp())}function us(e){return D(!!e,49232),re.fromTimestamp(function(e){const t=mt(e);return new ne(t.seconds,t.nanos)}(e))}function ms(e,t){return hs(e,t).canonicalString()}function hs(e,t){const n=function(e){return new ie(["projects",e.projectId,"databases",e.database])}(e).child("documents");return void 0===t?n:n.child(t)}function ps(e){const t=ie.fromString(e);return D(Rs(t),10190,{key:t.toString()}),t}function gs(e,t){return ms(e.databaseId,t.path)}function fs(e,t){const n=ps(t);
2if(n.get(1)!==e.databaseId.projectId)throw new M(L.INVALID_ARGUMENT,"Tried to deserialize key from different project: "+n.get(1)+" vs "+e.databaseId.projectId);if(n.get(3)!==e.databaseId.database)throw new M(L.INVALID_ARGUMENT,"Tried to deserialize key from different database: "+n.get(3)+" vs "+e.databaseId.database);return new ce(vs(n))}function xs(e,t){return ms(e.databaseId,t)}function bs(e){const t=ps(e);return 4===t.length?ie.emptyPath():vs(t)}function ys(e){return new ie(["projects",e.databaseId.projectId,"databases",e.databaseId.database]).canonicalString()}function vs(e){return D(e.length>4&&"documents"===e.get(4),29091,{key:e.toString()}),e.popFirst(5)}function ws(e,t,n){return{name:gs(e,t),fields:n.value.mapValue.fields}}function js(e,t){let n;if(t instanceof Er)n={update:ws(e,t.key,t.value)};else if(t instanceof Ir)n={delete:gs(e,t.key)};else if(t instanceof Cr)n={update:ws(e,t.key,t.data),updateMask:Ds(t.fieldMask)};else{if(!(t instanceof Dr))return _(16599,{ft:t.type});n={verify:gs(e,t.key)}}return t.fieldTransforms.length>0&&(n.updateTransforms=t.fieldTransforms.map(e=>function(e,t){const n=t.transform;if(n instanceof cr)return{fieldPath:t.field.canonicalString(),setToServerValue:"REQUEST_TIME"};if(n instanceof dr)return{fieldPath:t.field.canonicalString(),appendMissingElements:{values:n.elements}};if(n instanceof mr)return{fieldPath:t.field.canonicalString(),removeAllFromArray:{values:n.elements}};if(n instanceof pr)return{fieldPath:t.field.canonicalString(),increment:n.Re};throw _(20930,{transform:t.transform})}(0,e))),t.precondition.isNone||(n.currentDocument=function(e,t){return void 0!==t.updateTime?{updateTime:ds(e,t.updateTime)}:void 0!==t.exists?{exists:t.exists}:_(27497)}(e,t.precondition)),n}function Ns(e,t){return{documents:[xs(e,t.path)]}}function ks(e,t){const n={structuredQuery:{}},r=t.path;let s;null!==t.collectionGroup?(s=r,n.structuredQuery.from=[{collectionId:t.collectionGroup,allDescendants:!0}]):(s=r.popLast(),n.structuredQuery.from=[{collectionId:r.lastSegment()}]),n.parent=xs(e,s);const a=function(e){if(0!==e.length)return Is(sn.create(e,"and"))}(t.filters);a&&(n.structuredQuery.where=a);const i=function(e){if(0!==e.length)return e.map(e=>function(e){return{field:Ps(e.field),direction:Es(e.dir)}}(e))}(t.orderBy);i&&(n.structuredQuery.orderBy=i);const o=os(e,t.limit);return null!==o&&(n.structuredQuery.limit=o),t.startAt&&(n.structuredQuery.startAt=function(e){return{before:e.inclusive,values:e.position}}(t.startAt)),t.endAt&&(n.structuredQuery.endAt=function(e){return{before:!e.inclusive,values:e.position}}(t.endAt)),{gt:n,parent:s}}function As(e){let t=bs(e.parent);const n=e.structuredQuery,r=n.from?n.from.length:0;let s=null;if(r>0){D(1===r,65062);const e=n.from[0];e.allDescendants?s=e.collectionId:t=t.child(e.collectionId)}let a=[];n.where&&(a=function(e){const t=Ss(e);return t instanceof sn&&on(t)?t.getFilters():[t]}(n.where));let i=[];n.orderBy&&(i=function(e){return e.map(e=>function(e){return new en(_s(e.field),function(e){switch(e){case"ASCENDING":return"asc";case"DESCENDING":return"desc";default:return}}(e.direction))}(e))}(n.orderBy));let o=null;n.limit&&(o=function(e){let t;return t="object"==typeof e?e.value:e,ke(t)?null:t}(n.limit));let l=null;n.startAt&&(l=function(e){const t=!!e.before,n=e.values||[];return new Qt(n,t)}(n.startAt));let c=null;return n.endAt&&(c=function(e){const t=!e.before,n=e.values||[];return new Qt(n,t)}(n.endAt)),Sn(t,s,i,a,o,"F",l,c)}function Ss(e){return void 0!==e.unaryFilter?function(e){switch(e.unaryFilter.op){case"IS_NAN":const t=_s(e.unaryFilter.field);return rn.create(t,"==",{doubleValue:NaN});case"IS_NULL":const n=_s(e.unaryFilter.field);return rn.create(n,"==",{nullValue:"NULL_VALUE"});case"IS_NOT_NAN":const r=_s(e.unaryFilter.field);return rn.create(r,"!=",{doubleValue:NaN});case"IS_NOT_NULL":const s=_s(e.unaryFilter.field);return rn.create(s,"!=",{nullValue:"NULL_VALUE"});case"OPERATOR_UNSPECIFIED":return _(61313);default:return _(60726)}}(e):void 0!==e.fieldFilter?function(e){return rn.create(_s(e.fieldFilter.field),function(e){switch(e){case"EQUAL":return"==";case"NOT_EQUAL":return"!=";case"GREATER_THAN":return">";case"GREATER_THAN_OR_EQUAL":return">=";case"LESS_THAN":return"<";case"LESS_THAN_OR_EQUAL":return"<=";case"ARRAY_CONTAINS":return"array-contains";case"IN":return"in";case"NOT_IN":return"not-in";case"ARRAY_CONTAINS_ANY":return"array-contains-any";case"OPERATOR_UNSPECIFIED":return _(58110);default:return _(50506)}}(e.fieldFilter.op),e.fieldFilter.value)}(e):void 0!==e.compositeFilter?function(e){return sn.create(e.compositeFilter.filters.map(e=>Ss(e)),function(e){switch(e){case"AND":return"and";case"OR":return"or";default:return _(1026)}}(e.compositeFilter.op))}(e):_(30097,{filter:e})}function Es(e){return rs[e]}function Cs(e){return ss[e]}function Ts(e){return as[e]}function Ps(e){return{fieldPath:e.canonicalString()}}function _s(e){return le.fromServerFormat(e.fieldPath)}function Is(e){return e instanceof rn?function(e){if("=="===e.op){if(qt(e.value))return{unaryFilter:{field:Ps(e.field),op:"IS_NAN"}};if(Vt(e.value))return{unaryFilter:{field:Ps(e.field),op:"IS_NULL"}}}else if("!="===e.op){if(qt(e.value))return{unaryFilter:{field:Ps(e.field),op:"IS_NOT_NA
2N"}};if(Vt(e.value))return{unaryFilter:{field:Ps(e.field),op:"IS_NOT_NULL"}}}return{fieldFilter:{field:Ps(e.field),op:Cs(e.op),value:e.value}}}(e):e instanceof sn?function(e){const t=e.getFilters().map(e=>Is(e));return 1===t.length?t[0]:{compositeFilter:{op:Ts(e.op),filters:t}}}(e):_(54877,{filter:e})}function Ds(e){const t=[];return e.fields.forEach(e=>t.push(e.canonicalString())),{fieldPaths:t}}function Rs(e){return e.length>=4&&"projects"===e.get(0)&&"databases"===e.get(2)}class Ls{constructor(e,t,n,r){let s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:re.min(),a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:re.min(),i=arguments.length>6&&void 0!==arguments[6]?arguments[6]:dt.EMPTY_BYTE_STRING,o=arguments.length>7&&void 0!==arguments[7]?arguments[7]:null;this.target=e,this.targetId=t,this.purpose=n,this.sequenceNumber=r,this.snapshotVersion=s,this.lastLimboFreeSnapshotVersion=a,this.resumeToken=i,this.expectedCount=o}withSequenceNumber(e){return new Ls(this.target,this.targetId,this.purpose,e,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken,this.expectedCount)}withResumeToken(e,t){return new Ls(this.target,this.targetId,this.purpose,this.sequenceNumber,t,this.lastLimboFreeSnapshotVersion,e,null)}withExpectedCount(e){return new Ls(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken,e)}withLastLimboFreeSnapshotVersion(e){return new Ls(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,e,this.resumeToken,this.expectedCount)}}class Ms{constructor(e){this.wt=e}}function Os(e){const t=As({parent:e.parent,structuredQuery:e.structuredQuery});return"LAST"===e.limitType?Rn(t,t.limit,"L"):t}class Fs{constructor(){}vt(e,t){this.Ct(e,t),t.Ft()}Ct(e,t){if("nullValue"in e)this.Mt(t,5);else if("booleanValue"in e)this.Mt(t,10),t.xt(e.booleanValue?1:0);else if("integerValue"in e)this.Mt(t,15),t.xt(ht(e.integerValue));else if("doubleValue"in e){const n=ht(e.doubleValue);isNaN(n)?this.Mt(t,13):(this.Mt(t,15),Ae(n)?t.xt(0):t.xt(n))}else if("timestampValue"in e){let n=e.timestampValue;this.Mt(t,20),"string"==typeof n&&(n=mt(n)),t.Ot("".concat(n.seconds||"")),t.xt(n.nanos||0)}else if("stringValue"in e)this.Nt(e.stringValue,t),this.Bt(t);else if("bytesValue"in e)this.Mt(t,30),t.Lt(pt(e.bytesValue)),this.Bt(t);else if("referenceValue"in e)this.kt(e.referenceValue,t);else if("geoPointValue"in e){const n=e.geoPointValue;this.Mt(t,45),t.xt(n.latitude||0),t.xt(n.longitude||0)}else"mapValue"in e?Yt(e)?this.Mt(t,Number.MAX_SAFE_INTEGER):Ht(e)?this.qt(e.mapValue,t):(this.Qt(e.mapValue,t),this.Bt(t)):"arrayValue"in e?(this.$t(e.arrayValue,t),this.Bt(t)):_(19022,{Ut:e})}Nt(e,t){this.Mt(t,25),this.Kt(e,t)}Kt(e,t){t.Ot(e)}Qt(e,t){const n=e.fields||{};this.Mt(t,55);for(const r of Object.keys(n))this.Nt(r,t),this.Ct(n[r],t)}qt(e,t){var n,r;const s=e.fields||{};this.Mt(t,53);const a=Tt,i=(null===(r=null===(n=s[a].arrayValue)||void 0===n?void 0:n.values)||void 0===r?void 0:r.length)||0;this.Mt(t,15),t.xt(ht(i)),this.Nt(a,t),this.Ct(s[a],t)}$t(e,t){const n=e.values||[];this.Mt(t,50);for(const r of n)this.Ct(r,t)}kt(e,t){this.Mt(t,37),ce.fromName(e).path.forEach(e=>{this.Mt(t,60),this.Kt(e,t)})}Mt(e,t){e.xt(t)}Bt(e){e.xt(2)}}Fs.Wt=new Fs;class Us{constructor(){this.yn=new Bs}addToCollectionParentIndex(e,t){return this.yn.add(t),ye.resolve()}getCollectionParents(e,t){return ye.resolve(this.yn.getEntries(t))}addFieldIndex(e,t){return ye.resolve()}deleteFieldIndex(e,t){return ye.resolve()}deleteAllFieldIndexes(e){return ye.resolve()}createTargetIndexes(e,t){return ye.resolve()}getDocumentsMatchingTarget(e,t){return ye.resolve(null)}getIndexType(e,t){return ye.resolve(0)}getFieldIndexes(e,t){return ye.resolve([])}getNextCollectionGroupToUpdate(e){return ye.resolve(null)}getMinOffset(e,t){return ye.resolve(pe.min())}getMinOffsetFromCollectionGroup(e,t){return ye.resolve(pe.min())}updateCollectionGroup(e,t,n){return ye.resolve()}updateIndexEntries(e,t){return ye.resolve()}}class Bs{constructor(){this.index={}}add(e){const t=e.lastSegment(),n=e.popLast(),r=this.index[t]||new it(ie.comparator),s=!r.has(n);return this.index[t]=r.add(n),s}has(e){const t=e.lastSegment(),n=e.popLast(),r=this.index[t];return r&&r.has(n)}getEntries(e){return(this.index[e]||new it(ie.comparator)).toArray()}}new Uint8Array(0);const zs={didRun:!1,sequenceNumbersCollected:0,targetsRemoved:0,documentsRemoved:0},Vs=41943040;class qs{static withCacheSize(e){return new qs(e,qs.DEFAULT_COLLECTION_PE
2RCENTILE,qs.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT)}constructor(e,t,n){this.cacheSizeCollectionThreshold=e,this.percentileToCollect=t,this.maximumSequenceNumbersToCollect=n}}qs.DEFAULT_COLLECTION_PERCENTILE=10,qs.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT=1e3,qs.DEFAULT=new qs(Vs,qs.DEFAULT_COLLECTION_PERCENTILE,qs.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT),qs.DISABLED=new qs(-1,0,0);class Ws{constructor(e){this.nr=e}next(){return this.nr+=2,this.nr}static rr(){return new Ws(0)}static ir(){return new Ws(-1)}}const Hs="LruGarbageCollector",Gs=1048576;function Ys(e,t){let[n,r]=e,[s,a]=t;const i=J(n,s);return 0===i?J(r,a):i}class Ks{constructor(e){this.cr=e,this.buffer=new it(Ys),this.lr=0}hr(){return++this.lr}Pr(e){const t=[e,this.hr()];if(this.buffer.size<this.cr)this.buffer=this.buffer.add(t);else{const e=this.buffer.last();Ys(t,e)<0&&(this.buffer=this.buffer.delete(e).add(t))}}get maxValue(){return this.buffer.last()[0]}}class Js{constructor(e,t,n){this.garbageCollector=e,this.asyncQueue=t,this.localStore=n,this.Tr=null}start(){-1!==this.garbageCollector.params.cacheSizeCollectionThreshold&&this.Ir(6e4)}stop(){this.Tr&&(this.Tr.cancel(),this.Tr=null)}get started(){return null!==this.Tr}Ir(e){E(Hs,"Garbage collection scheduled in ".concat(e,"ms")),this.Tr=this.asyncQueue.enqueueAfterDelay("lru_garbage_collection",e,async()=>{this.Tr=null;try{await this.localStore.collectGarbage(this.garbageCollector)}catch(e){we(e)?E(Hs,"Ignoring IndexedDB error during garbage collection: ",e):await be(e)}await this.Ir(3e5)})}}class $s{constructor(e,t){this.Er=e,this.params=t}calculateTargetCount(e,t){return this.Er.dr(e).next(e=>Math.floor(t/100*e))}nthSequenceNumber(e,t){if(0===t)return ye.resolve(je.le);const n=new Ks(t);return this.Er.forEachTarget(e,e=>n.Pr(e.sequenceNumber)).next(()=>this.Er.Ar(e,e=>n.Pr(e))).next(()=>n.maxValue)}removeTargets(e,t,n){return this.Er.removeTargets(e,t,n)}removeOrphanedDocuments(e,t){return this.Er.removeOrphanedDocuments(e,t)}collect(e,t){return-1===this.params.cacheSizeCollectionThreshold?(E("LruGarbageCollector","Garbage collection skipped; disabled"),ye.resolve(zs)):this.getCacheSize(e).next(n=>n<this.params.cacheSizeCollectionThreshold?(E("LruGarbageCollector","Garbage collection skipped; Cache size ".concat(n," is lower than threshold ").concat(this.params.cacheSizeCollectionThreshold)),zs):this.Rr(e,t))}getCacheSize(e){return this.Er.getCacheSize(e)}Rr(e,t){let n,r,s,a,i,l,c;const d=Date.now();return this.calculateTargetCount(e,this.params.percentileToCollect).next(t=>(t>this.params.maximumSequenceNumbersToCollect?(E("LruGarbageCollector","Capping sequence numbers to collect down to the maximum of ".concat(this.params.maximumSequenceNumbersToCollect," from ").concat(t)),r=this.params.maximumSequenceNumbersToCollect):r=t,a=Date.now(),this.nthSequenceNumber(e,r))).next(r=>(n=r,i=Date.now(),this.removeTargets(e,n,t))).next(t=>(s=t,l=Date.now(),this.removeOrphanedDocuments(e,n))).next(e=>(c=Date.now(),S()<=o.$b.DEBUG&&E("LruGarbageCollector","LRU Garbage Collection\n\tCounted targets in ".concat(a-d,"ms\n\tDetermined least recently used ").concat(r," in ")+(i-a)+"ms\n"+"\tRemoved ".concat(s," targets in ")+(l-i)+"ms\n"+"\tRemoved ".concat(e," documents in ")+(c-l)+"ms\n"+"Total Duration: ".concat(c-d,"ms")),ye.resolve({didRun:!0,sequenceNumbersCollected:r,targetsRemoved:s,documentsRemoved:e})))}}function Qs(e,t){return new $s(e,t)}class Xs{constructor(){this.changes=new Vn(e=>e.toString(),(e,t)=>e.isEqual(t)),this.changesApplied=!1}addEntry(e){this.assertNotApplied(),this.changes.set(e.key,e)}removeEntry(e,t){this.assertNotApplied(),this.changes.set(e,$t.newInvalidDocument(e).setReadTime(t))}getEntry(e,t){this.assertNotApplied();const n=this.changes.get(t);return void 0!==n?ye.resolve(n):this.getFromCache(e,t)}getEntries(e,t){return this.getAllFromCache(e,t)}apply(e){return this.assertNotApplied(),this.changesApplied=!0,this.applyChanges(e)}assertNotApplied(){}}class Zs{constructor(e,t){this.overlayedDocument=e,this.mutatedFields=t}}class ea{constructor(e,t,n,r){this.remoteDocumentCache=e,this.mutation
2Queue=t,this.documentOverlayCache=n,this.indexManager=r}getDocument(e,t){let n=null;return this.documentOverlayCache.getOverlay(e,t).next(r=>(n=r,this.remoteDocumentCache.getEntry(e,t))).next(e=>(null!==n&&kr(n.mutation,e,lt.empty(),ne.now()),e))}getDocuments(e,t){return this.remoteDocumentCache.getEntries(e,t).next(t=>this.getLocalViewOfDocuments(e,t,Zn()).next(()=>t))}getLocalViewOfDocuments(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Zn();const r=Kn();return this.populateOverlays(e,r,t).next(()=>this.computeViews(e,t,r,n).next(e=>{let t=Gn();return e.forEach((e,n)=>{t=t.insert(e,n.overlayedDocument)}),t}))}getOverlayedDocuments(e,t){const n=Kn();return this.populateOverlays(e,n,t).next(()=>this.computeViews(e,t,n,Zn()))}populateOverlays(e,t,n){const r=[];return n.forEach(e=>{t.has(e)||r.push(e)}),this.documentOverlayCache.getOverlays(e,r).next(e=>{e.forEach((e,n)=>{t.set(e,n)})})}computeViews(e,t,n,r){let s=Wn();const a=$n(),i=$n();return t.forEach((e,t)=>{const i=n.get(t.key);r.has(t.key)&&(void 0===i||i.mutation instanceof Cr)?s=s.insert(t.key,t):void 0!==i?(a.set(t.key,i.mutation.getFieldMask()),kr(i.mutation,t,i.mutation.getFieldMask(),ne.now())):a.set(t.key,lt.empty())}),this.recalculateAndSaveOverlays(e,s).next(e=>(e.forEach((e,t)=>a.set(e,t)),t.forEach((e,t)=>{var n;return i.set(e,new Zs(t,null!==(n=a.get(e))&&void 0!==n?n:null))}),i))}recalculateAndSaveOverlays(e,t){const n=$n();let r=new rt((e,t)=>e-t),s=Zn();return this.mutationQueue.getAllMutationBatchesAffectingDocumentKeys(e,t).next(e=>{for(const s of e)s.keys().forEach(e=>{const a=t.get(e);if(null===a)return;let i=n.get(e)||lt.empty();i=s.applyToLocalView(a,i),n.set(e,i);const o=(r.get(s.batchId)||Zn()).add(e);r=r.insert(s.batchId,o)})}).next(()=>{const a=[],i=r.getReverseIterator();for(;i.hasNext();){const r=i.getNext(),o=r.key,l=r.value,c=Jn();l.forEach(e=>{if(!s.has(e)){const r=jr(t.get(e),n.get(e));null!==r&&c.set(e,r),s=s.add(e)}}),a.push(this.documentOverlayCache.saveOverlays(e,o,c))}return ye.waitFor(a)}).next(()=>n)}recalculateAndSaveOverlaysForDocumentKeys(e,t){return this.remoteDocumentCache.getEntries(e,t).next(t=>this.recalculateAndSaveOverlays(e,t))}getDocumentsMatchingQuery(e,t,n,r){return function(e){return ce.isDocumentKey(e.path)&&null===e.collectionGroup&&0===e.filters.length}(t)?this.getDocumentsMatchingDocumentQuery(e,t.path):Tn(t)?this.getDocumentsMatchingCollectionGroupQuery(e,t,n,r):this.getDocumentsMatchingCollectionQuery(e,t,n,r)}getNextDocuments(e,t,n,r){return this.remoteDocumentCache.getAllFromCollectionGroup(e,t,n,r).next(s=>{const a=r-s.size>0?this.documentOverlayCache.getOverlaysForCollectionGroup(e,t,n.largestBatchId,r-s.size):ye.resolve(Kn());let i=de,o=s;return a.next(t=>ye.forEach(t,(t,n)=>(i<n.largestBatchId&&(i=n.largestBatchId),s.get(t)?ye.resolve():this.remoteDocumentCache.getEntry(e,t).next(e=>{o=o.insert(t,e)}))).next(()=>this.populateOverlays(e,t,s)).next(()=>this.computeViews(e,o,t,Zn())).next(e=>({batchId:i,changes:Yn(e)})))})}getDocumentsMatchingDocumentQuery(e,t){return this.getDocument(e,new ce(t)).next(e=>{let t=Gn();return e.isFoundDocument()&&(t=t.insert(e.key,e)),t})}getDocumentsMatchingCollectionGroupQuery(e,t,n,r){const s=t.collectionGroup;let a=Gn();return this.indexManager.getCollectionParents(e,s).next(i=>ye.forEach(i,i=>{const o=function(e,t){return new An(t,null,e.explicitOrderBy.slice(),e.filters.slice(),e.limit,e.limitType,e.startAt,e.endAt)}(t,i.child(s));return this.getDocumentsMatchingCollectionQuery(e,o,n,r).next(e=>{e.forEach((e,t)=>{a=a.insert(e,t)})})}).next(()=>a))}getDocumentsMatchingCollectionQuery(e,t,n,r){let s;return this.documentOverlayCache.getOverlaysForCollection(e,t.path,n.largestBatchId).next(a=>(s=a,this.remoteDocumentCache.getDocumentsMatchingQuery(e,t,n,s,r))).next(e=>{s.forEach((t,n)=>{const r=n.getKey();null===e.get(r)&&(e=e.insert(r,$t.newInvalidDocument(r)))});let n=Gn();return e.forEach((e,r)=>{const a=s.get(e);void 0!==a&&kr(a.mutation,r,lt.empty(),ne.now()),Fn(t,r)&&(n=n.insert(e,r))}),n})}}class ta{constructor(e){this.serializer=e,this.Fr=new Map,this.Mr=new Map}
2getBundleMetadata(e,t){return ye.resolve(this.Fr.get(t))}saveBundleMetadata(e,t){return this.Fr.set(t.id,function(e){return{id:e.id,version:e.version,createTime:us(e.createTime)}}(t)),ye.resolve()}getNamedQuery(e,t){return ye.resolve(this.Mr.get(t))}saveNamedQuery(e,t){return this.Mr.set(t.name,function(e){return{name:e.name,query:Os(e.bundledQuery),readTime:us(e.readTime)}}(t)),ye.resolve()}}class na{constructor(){this.overlays=new rt(ce.comparator),this.Or=new Map}getOverlay(e,t){return ye.resolve(this.overlays.get(t))}getOverlays(e,t){const n=Kn();return ye.forEach(t,t=>this.getOverlay(e,t).next(e=>{null!==e&&n.set(t,e)})).next(()=>n)}saveOverlays(e,t,n){return n.forEach((n,r)=>{this.St(e,t,r)}),ye.resolve()}removeOverlaysForBatchId(e,t,n){const r=this.Or.get(n);return void 0!==r&&(r.forEach(e=>this.overlays=this.overlays.remove(e)),this.Or.delete(n)),ye.resolve()}getOverlaysForCollection(e,t,n){const r=Kn(),s=t.length+1,a=new ce(t.child("")),i=this.overlays.getIteratorFrom(a);for(;i.hasNext();){const e=i.getNext().value,a=e.getKey();if(!t.isPrefixOf(a.path))break;a.path.length===s&&e.largestBatchId>n&&r.set(e.getKey(),e)}return ye.resolve(r)}getOverlaysForCollectionGroup(e,t,n,r){let s=new rt((e,t)=>e-t);const a=this.overlays.getIterator();for(;a.hasNext();){const e=a.getNext().value;if(e.getKey().getCollectionGroup()===t&&e.largestBatchId>n){let t=s.get(e.largestBatchId);null===t&&(t=Kn(),s=s.insert(e.largestBatchId,t)),t.set(e.getKey(),e)}}const i=Kn(),o=s.getIterator();for(;o.hasNext()&&(o.getNext().value.forEach((e,t)=>i.set(e,t)),!(i.size()>=r)););return ye.resolve(i)}St(e,t,n){const r=this.overlays.get(n.key);if(null!==r){const e=this.Or.get(r.largestBatchId).delete(n.key);this.Or.set(r.largestBatchId,e)}this.overlays=this.overlays.insert(n.key,new Mr(t,n));let s=this.Or.get(t);void 0===s&&(s=Zn(),this.Or.set(t,s)),this.Or.set(t,s.add(n.key))}}class ra{constructor(){this.sessionToken=dt.EMPTY_BYTE_STRING}getSessionToken(e){return ye.resolve(this.sessionToken)}setSessionToken(e,t){return this.sessionToken=t,ye.resolve()}}class sa{constructor(){this.Nr=new it(aa.Br),this.Lr=new it(aa.kr)}isEmpty(){return this.Nr.isEmpty()}addReference(e,t){const n=new aa(e,t);this.Nr=this.Nr.add(n),this.Lr=this.Lr.add(n)}qr(e,t){e.forEach(e=>this.addReference(e,t))}removeReference(e,t){this.Qr(new aa(e,t))}$r(e,t){e.forEach(e=>this.removeReference(e,t))}Ur(e){const t=new ce(new ie([])),n=new aa(t,e),r=new aa(t,e+1),s=[];return this.Lr.forEachInRange([n,r],e=>{this.Qr(e),s.push(e.key)}),s}Kr(){this.Nr.forEach(e=>this.Qr(e))}Qr(e){this.Nr=this.Nr.delete(e),this.Lr=this.Lr.delete(e)}Wr(e){const t=new ce(new ie([])),n=new aa(t,e),r=new aa(t,e+1);let s=Zn();return this.Lr.forEachInRange([n,r],e=>{s=s.add(e.key)}),s}containsKey(e){const t=new aa(e,0),n=this.Nr.firstAfterOrEqual(t);return null!==n&&e.isEqual(n.key)}}class aa{constructor(e,t){this.key=e,this.Gr=t}static Br(e,t){return ce.comparator(e.key,t.key)||J(e.Gr,t.Gr)}static kr(e,t){return J(e.Gr,t.Gr)||ce.comparator(e.key,t.key)}}class ia{constructor(e,t){this.indexManager=e,this.referenceDelegate=t,this.mutationQueue=[],this.Jn=1,this.zr=new it(aa.Br)}checkEmpty(e){return ye.resolve(0===this.mutationQueue.length)}addMutationBatch(e,t,n,r){const s=this.Jn;this.Jn++,this.mutationQueue.length>0&&this.mutationQueue[this.mutationQueue.length-1];const a=new Rr(s,t,n,r);this.mutationQueue.push(a);for(const i of r)this.zr=this.zr.add(new aa(i.key,s)),this.indexManager.addToCollectionParentIndex(e,i.key.path.popLast());return ye.resolve(a)}lookupMutationBatch(e,t){return ye.resolve(this.jr(t))}getNextMutationBatchAfterBatchId(e,t){const n=t+1,r=this.Hr(n),s=r<0?0:r;return ye.resolve(this.mutationQueue.length>s?this.mutationQueue[s]:null)}getHighestUnacknowledgedBatchId(){return ye.resolve(0===this.mutationQueue.length?Ne:this.Jn-1)}getAllMutationBatches(e){return ye.resolve(this.mutationQueue.slice())}getAllMutationBatchesAffectingDocumentKey(e,t){const n=new aa(t,0),r=new aa(t,Number.POSITIVE_INFINITY),s=[];return this.zr.forEachInRange([n,r],e=>{const t=this.jr(e.Gr);s.push(t)}),ye.resolve(s)}getAllMutationBatchesAffectingDocumentKeys(e,t){let n=new it(J);
2return t.forEach(e=>{const t=new aa(e,0),r=new aa(e,Number.POSITIVE_INFINITY);this.zr.forEachInRange([t,r],e=>{n=n.add(e.Gr)})}),ye.resolve(this.Jr(n))}getAllMutationBatchesAffectingQuery(e,t){const n=t.path,r=n.length+1;let s=n;ce.isDocumentKey(s)||(s=s.child(""));const a=new aa(new ce(s),0);let i=new it(J);return this.zr.forEachWhile(e=>{const t=e.key.path;return!!n.isPrefixOf(t)&&(t.length===r&&(i=i.add(e.Gr)),!0)},a),ye.resolve(this.Jr(i))}Jr(e){const t=[];return e.forEach(e=>{const n=this.jr(e);null!==n&&t.push(n)}),t}removeMutationBatch(e,t){D(0===this.Yr(t.batchId,"removed"),55003),this.mutationQueue.shift();let n=this.zr;return ye.forEach(t.mutations,r=>{const s=new aa(r.key,t.batchId);return n=n.delete(s),this.referenceDelegate.markPotentiallyOrphaned(e,r.key)}).next(()=>{this.zr=n})}Xn(e){}containsKey(e,t){const n=new aa(t,0),r=this.zr.firstAfterOrEqual(n);return ye.resolve(t.isEqual(r&&r.key))}performConsistencyCheck(e){return this.mutationQueue.length,ye.resolve()}Yr(e,t){return this.Hr(e)}Hr(e){return 0===this.mutationQueue.length?0:e-this.mutationQueue[0].batchId}jr(e){const t=this.Hr(e);return t<0||t>=this.mutationQueue.length?null:this.mutationQueue[t]}}class oa{constructor(e){this.Zr=e,this.docs=new rt(ce.comparator),this.size=0}setIndexManager(e){this.indexManager=e}addEntry(e,t){const n=t.key,r=this.docs.get(n),s=r?r.size:0,a=this.Zr(t);return this.docs=this.docs.insert(n,{document:t.mutableCopy(),size:a}),this.size+=a-s,this.indexManager.addToCollectionParentIndex(e,n.path.popLast())}removeEntry(e){const t=this.docs.get(e);t&&(this.docs=this.docs.remove(e),this.size-=t.size)}getEntry(e,t){const n=this.docs.get(t);return ye.resolve(n?n.document.mutableCopy():$t.newInvalidDocument(t))}getEntries(e,t){let n=Wn();return t.forEach(e=>{const t=this.docs.get(e);n=n.insert(e,t?t.document.mutableCopy():$t.newInvalidDocument(e))}),ye.resolve(n)}getDocumentsMatchingQuery(e,t,n,r){let s=Wn();const a=t.path,i=new ce(a.child("__id-9223372036854775808__")),o=this.docs.getIteratorFrom(i);for(;o.hasNext();){const{key:e,value:{document:i}}=o.getNext();if(!a.isPrefixOf(e.path))break;e.path.length>a.length+1||ge(he(i),n)<=0||(r.has(i.key)||Fn(t,i))&&(s=s.insert(i.key,i.mutableCopy()))}return ye.resolve(s)}getAllFromCollectionGroup(e,t,n,r){_(9500)}Xr(e,t){return ye.forEach(this.docs,e=>t(e))}newChangeBuffer(e){return new la(this)}getSize(e){return ye.resolve(this.size)}}class la extends Xs{constructor(e){super(),this.vr=e}applyChanges(e){const t=[];
vendor: 4,776 bytes, line 2
2return this.changes.forEach((n,r)=>{r.isValidDocument()?t.push(this.vr.addEntry(e,r)):this.vr.removeEntry(n)}),ye.waitFor(t)}getFromCache(e,t){return this.vr.getEntry(e,t)}getAllFromCache(e,t){return this.vr.getEntries(e,t)}}class ca{constructor(e){this.persistence=e,this.ei=new Vn(e=>jn(e),Nn),this.lastRemoteSnapshotVersion=re.min(),this.highestTargetId=0,this.ti=0,this.ni=new sa,this.targetCount=0,this.ri=Ws.rr()}forEachTarget(e,t){return this.ei.forEach((e,n)=>t(n)),ye.resolve()}getLastRemoteSnapshotVersion(e){return ye.resolve(this.lastRemoteSnapshotVersion)}getHighestSequenceNumber(e){return ye.resolve(this.ti)}allocateTargetId(e){return this.highestTargetId=this.ri.next(),ye.resolve(this.highestTargetId)}setTargetsMetadata(e,t,n){return n&&(this.lastRemoteSnapshotVersion=n),t>this.ti&&(this.ti=t),ye.resolve()}ar(e){this.ei.set(e.target,e);const t=e.targetId;t>this.highestTargetId&&(this.ri=new Ws(t),this.highestTargetId=t),e.sequenceNumber>this.ti&&(this.ti=e.sequenceNumber)}addTargetData(e,t){return this.ar(t),this.targetCount+=1,ye.resolve()}updateTargetData(e,t){return this.ar(t),ye.resolve()}removeTargetData(e,t){return this.ei.delete(t.target),this.ni.Ur(t.targetId),this.targetCount-=1,ye.resolve()}removeTargets(e,t,n){let r=0;const s=[];return this.ei.forEach((a,i)=>{i.sequenceNumber<=t&&null===n.get(i.targetId)&&(this.ei.delete(a),s.push(this.removeMatchingKeysForTargetId(e,i.targetId)),r++)}),ye.waitFor(s).next(()=>r)}getTargetCount(e){return ye.resolve(this.targetCount)}getTargetData(e,t){const n=this.ei.get(t)||null;return ye.resolve(n)}addMatchingKeys(e,t,n){return this.ni.qr(t,n),ye.resolve()}removeMatchingKeys(e,t,n){this.ni.$r(t,n);const r=this.persistence.referenceDelegate,s=[];return r&&t.forEach(t=>{s.push(r.markPotentiallyOrphaned(e,t))}),ye.waitFor(s)}removeMatchingKeysForTargetId(e,t){return this.ni.Ur(t),ye.resolve()}getMatchingKeysForTargetId(e,t){const n=this.ni.Wr(t);return ye.resolve(n)}containsKey(e,t){return ye.resolve(this.ni.containsKey(t))}}class da{constructor(e,t){this.ii={},this.overlays={},this.si=new je(0),this.oi=!1,this.oi=!0,this._i=new ra,this.referenceDelegate=e(this),this.ai=new ca(this),this.indexManager=new Us,this.remoteDocumentCache=function(e){return new oa(e)}(e=>this.referenceDelegate.ui(e)),this.serializer=new Ms(t),this.ci=new ta(this.serializer)}start(){return Promise.resolve()}shutdown(){return this.oi=!1,Promise.resolve()}get started(){return this.oi}setDatabaseDeletedListener(){}setNetworkEnabled(){}getIndexManager(e){return this.indexManager}getDocumentOverlayCache(e){let t=this.overlays[e.toKey()];return t||(t=new na,this.overlays[e.toKey()]=t),t}getMutationQueue(e,t){let n=this.ii[e.toKey()];return n||(n=new ia(t,this.referenceDelegate),this.ii[e.toKey()]=n),n}getGlobalsCache(){return this._i}getTargetCache(){return this.ai}getRemoteDocumentCache(){return this.remoteDocumentCache}getBundleCache(){return this.ci}runTransaction(e,t,n){E("MemoryPersistence","Starting transaction:",e);const r=new ua(this.si.next());return this.referenceDelegate.li(),n(r).next(e=>this.referenceDelegate.hi(r).next(()=>e)).toPromise().then(e=>(r.raiseOnCommittedEvent(),e))}Pi(e,t){return ye.or(Object.values(this.ii).map(n=>()=>n.containsKey(e,t)))}}class ua extends xe{constructor(e){super(),this.currentSequenceNumber=e}}class ma{constructor(e){this.persistence=e,this.Ti=new sa,this.Ii=null}static Ei(e){return new ma(e)}get di(){if(this.Ii)return this.Ii;throw _(60996)}addReference(e,t,n){return this.Ti.addReference(n,t),this.di.delete(n.toString()),ye.resolve()}removeReference(e,t,n){return this.Ti.removeReference(n,t),this.di.add(n.toString()),ye.resolve()}markPotentiallyOrphaned(e,t){return this.di.add(t.toString()),ye.resolve()}removeTarget(e,t){this.Ti.Ur(t.targetId).forEach(e=>this.di.add(e.toString()));const n=this.persistence.getTargetCache();return n.getMatchingKeysForTargetId(e,t.targetId).next(e=>{e.forEach(e=>this.di.add(e.toString()))}).next(()=>n.removeTargetData(e,t))}li(){this.Ii=new Set}hi(e){const t=this.persistence.getRemoteDocumentCache().newChangeBuffer();return ye.forEach(this.di,n=>{const r=ce.fromPath(n);return this.Ai(e,r).next(e=>{e||t.removeEntry(r,re.min())})}).next(()=>(this.Ii=null,t.apply(e)))}updateLimboDocument(e,t){return this.Ai(e,t).next(e=>{e?this.di.delete(t.toString()):this.di.add(t.toString())})}ui(e){return 0}Ai(e,t){return ye.or([()=>ye.resolve(this.Ti.containsKey(t)),()=>this.persistence.getTargetCache().containsKey(e,t),()=>this.persistence.Pi(e,t)])}}class ha{constructor(e,t){this.persistence=e,this.Ri=new Vn(e=>Ce(e.path),(e,t)=>e.isEqual(t)),this.garbageCollector=Qs(this,t)}static Ei(e,t){return new ha(e,t)}li(){}hi(e){return ye.resolve()}forEachTarget(e,t){return this.persistence.getTargetCache().forEac
2hTarget(e,t)}dr(e){const t=this.Vr(e);return this.persistence.getTargetCache().getTargetCount(e).next(e=>t.next(t=>e+t))}Vr(e){let t=0;return this.Ar(e,e=>{t++}).next(()=>t)}Ar(e,t){return ye.forEach(this.Ri,(n,r)=>this.gr(e,n,r).next(e=>e?ye.resolve():t(r)))}removeTargets(e,t,n){return this.persistence.getTargetCache().removeTargets(e,t,n)}removeOrphanedDocuments(e,t){let n=0;const r=this.persistence.getRemoteDocumentCache(),s=r.newChangeBuffer();return r.Xr(e,r=>this.gr(e,r,t).next(e=>{e||(n++,s.removeEntry(r,re.min()))})).next(()=>s.apply(e)).next(()=>n)}markPotentiallyOrphaned(e,t){return this.Ri.set(t,e.currentSequenceNumber),ye.resolve()}removeTarget(e,t){const n=t.withSequenceNumber(e.currentSequenceNumber);return this.persistence.getTargetCache().updateTargetData(e,n)}addReference(e,t,n){return this.Ri.set(n,e.currentSequenceNumber),ye.resolve()}removeReference(e,t,n){return this.Ri.set(n,e.currentSequenceNumber),ye.resolve()}updateLimboDocument(e,t){return this.Ri.set(t,e.currentSequenceNumber),ye.resolve()}ui(e){let t=e.key.toString().length;return e.isFoundDocument()&&(t+=Ft(e.data.value)),t}gr(e,t,n){return ye.or([()=>this.persistence.Pi(e,t),()=>this.persistence.getTargetCache().containsKey(e,t),()=>{const e=this.Ri.get(t);return ye.resolve(void 0!==e&&e>n)}])}getCacheSize(e){return this.persistence.getRemoteDocumentCache().getSize(e)}}class pa{constructor(e,t,n,r){this.targetId=e,this.fromCache=t,this.ls=n,this.hs=r}static Ps(e,t){let n=Zn(),r=Zn();for(const s of t.docChanges)switch(s.type){case 0:n=n.add(s.doc.key);break;case 1:r=r.add(s.doc.key)}return new pa(e,t.fromCache,n,r)}}class ga{constructor(){this._documentReadCount=0}get documentReadCount(){return this._documentReadCount}incrementDocumentReadCount(e){this._documentReadCount+=e}}class fa{constructor(){this.Ts=!1,this.Is=!1,this.Es=100,this.ds=(0,l.nr)()?8:ve((0,l.ZQ)())>0?6:4}initialize(e,t){this.As=e,this.indexManager=t,this.Ts=!0}getDocumentsMatchingQuery(e,t,n,r){const s={result:null};return this.Rs(e,t).next(e=>{s.result=e}).next(()=>{if(!s.result)return this.Vs(e,t,r,n).next(e=>{s.result=e})}).next(()=>{if(s.result)return;const n=new ga;return this.fs(e,t,n).next(r=>{if(s.result=r,this.Is)return this.gs(e,t,n,r.size)})}).next(()=>s.result)}gs(e,t,n,r){return n.documentReadCount<this.Es?(S()<=o.$b.DEBUG&&E("QueryEngine","SDK will not create cache indexes for query:",On(t),"since it only creates cache indexes for collection contains","more than or equal to",this.Es,"documents"),ye.resolve()):(S()<=o.$b.DEBUG&&E("QueryEngine","Query:",On(t),"scans",n.documentReadCount,"local documents and returns",r,"documents as results."),n.documentReadCount>this.ds*r?(S()<=o.$b.DEBUG&&E("QueryEngine","The SDK decides to create cache indexes for query:",On(t),"as using cache indexes may help improve performance."),this.indexManager.createTargetIndexes(e,_n(t))):ye.resolve())}Rs(e,t){if(Cn(t))return ye.resolve(null);let n=_n(t);return this.indexManager.getIndexType(e,n).next(r=>0===r?null:(null!==t.limit&&1===r&&(t=Rn(t,null,"F"),n=_n(t)),this.indexManager.getDocumentsMatchingTarget(e,n).next(r=>{const s=Zn(...r);return this.As.getDocuments(e,s).next(r=>this.indexManager.getMinOffset(e,n).next(n=>{const a=this.ps(t,r);return this.ys(t,a,s,n.readTime)?this.Rs(e,Rn(t,null,"F")):this.ws(e,a,t,n)}))})))}Vs(e,t,n,r){return Cn(t)||r.isEqual(re.min())?ye.resolve(null):this.As.getDocuments(e,n).next(s=>{const a=this.ps(t,s);return this.ys(t,a,n,r)?ye.resolve(null):(S()<=o.$b.DEBUG&&E("QueryEngine","Re-using previous result from %s to execute query: %s",r.toString(),On(t)),this.ws(e,a,t,me(r,de)).next(e=>e))})}ps(e,t){let n=new it(Bn(e));return t.forEach((t,r)=>{Fn(e,r)&&(n=n.add(r))}),n}ys(e,t,n,r){if(null===e.limit)return!1;if(n.size!==t.size)return!0;const s="F"===e.limitType?t.last():t.first();return!!s&&(s.hasPendingWrites||s.version.compareTo(r)>0)}fs(e,t,n){return S()<=o.$b.DEBUG&&E("QueryEngine","Using full collection scan to execute query:",On(t)),this.As.getDocumentsMatchingQuery(e,t,pe.min(),n)}ws(e,t,n,r){return this.As.getDocumentsMatchingQuery(e,n,r).next(e=>(t.forEach(t=>{e=e.insert(t.key,t)}),e))}}const xa="LocalStore",ba=3e8;class ya{constructor(e,t,n,r){this.persistence=e,this.bs=t,this.serializer
2=r,this.Ss=new rt(J),this.Ds=new Vn(e=>jn(e),Nn),this.vs=new Map,this.Cs=e.getRemoteDocumentCache(),this.ai=e.getTargetCache(),this.ci=e.getBundleCache(),this.Fs(n)}Fs(e){this.documentOverlayCache=this.persistence.getDocumentOverlayCache(e),this.indexManager=this.persistence.getIndexManager(e),this.mutationQueue=this.persistence.getMutationQueue(e,this.indexManager),this.localDocuments=new ea(this.Cs,this.mutationQueue,this.documentOverlayCache,this.indexManager),this.Cs.setIndexManager(this.indexManager),this.bs.initialize(this.localDocuments,this.indexManager)}collectGarbage(e){return this.persistence.runTransaction("Collect garbage","readwrite-primary",t=>e.collect(t,this.Ss))}}function va(e,t,n,r){return new ya(e,t,n,r)}async function wa(e,t){const n=R(e);return await n.persistence.runTransaction("Handle user change","readonly",e=>{let r;return n.mutationQueue.getAllMutationBatches(e).next(s=>(r=s,n.Fs(t),n.mutationQueue.getAllMutationBatches(e))).next(t=>{const s=[],a=[];let i=Zn();for(const e of r){s.push(e.batchId);for(const t of e.mutations)i=i.add(t.key)}for(const e of t){a.push(e.batchId);for(const t of e.mutations)i=i.add(t.key)}return n.localDocuments.getDocuments(e,i).next(e=>({Ms:e,removedBatchIds:s,addedBatchIds:a}))})})}function ja(e){const t=R(e);return t.persistence.runTransaction("Get last remote snapshot version","readonly",e=>t.ai.getLastRemoteSnapshotVersion(e))}function Na(e,t,n){let r=Zn(),s=Zn();return n.forEach(e=>r=r.add(e)),t.getEntries(e,r).next(e=>{let r=Wn();return n.forEach((n,a)=>{const i=e.get(n);a.isFoundDocument()!==i.isFoundDocument()&&(s=s.add(n)),a.isNoDocument()&&a.version.isEqual(re.min())?(t.removeEntry(n,a.readTime),r=r.insert(n,a)):!i.isValidDocument()||a.version.compareTo(i.version)>0||0===a.version.compareTo(i.version)&&i.hasPendingWrites?(t.addEntry(a),r=r.insert(n,a)):E(xa,"Ignoring outdated watch update for ",n,". Current version:",i.version," Watch version:",a.version)}),{xs:r,Os:s}})}function ka(e,t){const n=R(e);return n.persistence.runTransaction("Get next mutation batch","readonly",e=>(void 0===t&&(t=Ne),n.mutationQueue.getNextMutationBatchAfterBatchId(e,t)))}function Aa(e,t){const n=R(e);return n.persistence.runTransaction("Allocate target","readwrite",e=>{let r;return n.ai.getTargetData(e,t).next(s=>s?(r=s,ye.resolve(r)):n.ai.allocateTargetId(e).next(s=>(r=new Ls(t,s,"TargetPurposeListen",e.currentSequenceNumber),n.ai.addTargetData(e,r).next(()=>r))))}).then(e=>{const r=n.Ss.get(e.targetId);return(null===r||e.snapshotVersion.compareTo(r.snapshotVersion)>0)&&(n.Ss=n.Ss.insert(e.targetId,e),n.Ds.set(t,e.targetId)),e})}async function Sa(e,t,n){const r=R(e),s=r.Ss.get(t),a=n?"readwrite":"readwrite-primary";try{n||await r.persistence.runTransaction("Release target",a,e=>r.persistence.referenceDelegate.removeTarget(e,s))}catch(e){if(!we(e))throw e;E(xa,"Failed to update sequence numbers for target ".concat(t,": ").concat(e))}r.Ss=r.Ss.remove(t),r.Ds.delete(s.target)}function Ea(e,t,n){const r=R(e);let s=re.min(),a=Zn();return r.persistence.runTransaction("Execute query","readwrite",e=>function(e,t,n){const r=R(e),s=r.Ds.get(n);return void 0!==s?ye.resolve(r.Ss.get(s)):r.ai.getTargetData(t,n)}(r,e,_n(t)).next(t=>{if(t)return s=t.lastLimboFreeSnapshotVersion,r.ai.getMatchingKeysForTargetId(e,t.targetId).next(e=>{a=e})}).next(()=>r.bs.getDocumentsMatchingQuery(e,t,n?s:re.min(),n?a:Zn())).next(e=>(Ca(r,Un(t),e),{documents:e,Ns:a})))}function Ca(e,t,n){let r=e.vs.get(t)||re.min();n.forEach((e,t)=>{t.readTime.compareTo(r)>0&&(r=t.readTime)}),e.vs.set(t,r)}class Ta{constructor(){this.activeTargetIds=tr()}$s(e){this.activeTargetIds=this.activeTargetIds.add(e)}Us(e){this.activeTargetIds=this.activeTargetIds.delete(e)}Qs(){const e={activeTargetIds:this.activeTargetIds.toArray(),updateTimeMs:Date.now()};return JSON.stringify(e)}}class Pa{constructor(){this.So=new Ta,this.Do={},this.onlineStateHandler=null,this.sequenceNumberHandler=null}addPendingMutation(e){}updateMutationState(e,t,n){}addLocalQueryTarget(e){return(!(arguments.length>1&&void 0!==arguments[1])||arguments[1])&&this.So.$s(e),this.Do[e]||"not-current"}updateQueryState(e,t,n){this.Do[e]=t}removeLocalQueryTarget(e){this.So.Us(e)}isLocalQueryTarget(e){return this.So.activeTargetIds.has(e)}clearQueryState(e){delete this.Do[e]}getAllActiveQueryTargets(){return this.So.activeTargetIds}isActiveQueryTarget(e){return this.So.activeTargetIds.has(e)}start(){return this.So=new Ta,Promise.resolve()}handleUserChange(e,t,n){}setOnlineState(e){}shutdown(){}writeSequenceNumber(e){}notifyBundleLoaded(e){}}class _a{vo(e){}shutdown(){}}const Ia="ConnectivityMonitor";class Da{constructor(){this.Co=()=>this.Fo(),this.Mo=()=>this.xo(),this.Oo=[],this.No()}vo(e){this.Oo.push(e)}shutdown(){window.removeEventListener("online",this.Co),window.removeEventListener("offline",this.Mo)}No(){window.addEventListener("online",this.Co),window.addEventListener("offline",this.Mo)}Fo(){E(Ia,"Network connectivity changed: AVAILABLE");for(const e of this.Oo)e(0)}xo(){E(Ia,"Network connectivity changed: UNAVAILABLE");for(const e of this.Oo)e(1)}static C(){return"undefined"!=typeof window&&void 0!==window.addEventListener&&void 0!==window.removeEventListener}}let Ra=null;function La(){return null===Ra?Ra=268435456+Math.round(2147483648*Math.random()):Ra++,"0x"+Ra.toString(16)}const Ma="RestConnection",Oa={BatchGetDocuments:"batchGet",Commit:"commit",RunQuery:"runQuery",RunAggregation
2Query:"runAggregationQuery"};class Fa{get Bo(){return!1}constructor(e){this.databaseInfo=e,this.databaseId=e.databaseId;const t=e.ssl?"https":"http",n=encodeURIComponent(this.databaseId.projectId),r=encodeURIComponent(this.databaseId.database);this.Lo=t+"://"+e.host,this.ko="projects/".concat(n,"/databases/").concat(r),this.qo=this.databaseId.database===Nt?"project_id=".concat(n):"project_id=".concat(n,"&database_id=").concat(r)}Qo(e,t,n,r,s){const a=La(),i=this.$o(e,t.toUriEncodedString());E(Ma,"Sending RPC '".concat(e,"' ").concat(a,":"),i,n);const o={"google-cloud-resource-prefix":this.ko,"x-goog-request-params":this.qo};return this.Uo(o,r,s),this.Ko(e,i,o,n).then(t=>(E(Ma,"Received RPC '".concat(e,"' ").concat(a,": "),t),t),t=>{throw T(Ma,"RPC '".concat(e,"' ").concat(a," failed with error: "),t,"url: ",i,"request:",n),t})}Wo(e,t,n,r,s,a){return this.Qo(e,t,n,r,s)}Uo(e,t,n){e["X-Goog-Api-Client"]="gl-js/ fire/"+k,e["Content-Type"]="text/plain",this.databaseInfo.appId&&(e["X-Firebase-GMPID"]=this.databaseInfo.appId),t&&t.headers.forEach((t,n)=>e[n]=t),n&&n.headers.forEach((t,n)=>e[n]=t)}$o(e,t){const n=Oa[e];return"".concat(this.Lo,"/v1/").concat(t,":").concat(n)}terminate(){}}class Ua{constructor(e){this.Go=e.Go,this.zo=e.zo}jo(e){this.Ho=e}Jo(e){this.Yo=e}Zo(e){this.Xo=e}onMessage(e){this.e_=e}close(){this.zo()}send(e){this.Go(e)}t_(){this.Ho()}n_(){this.Yo()}r_(e){this.Xo(e)}i_(e){this.e_(e)}}const Ba="WebChannelConnection";class za extends Fa{constructor(e){super(e),this.forceLongPolling=e.forceLongPolling,this.autoDetectLongPolling=e.autoDetectLongPolling,this.useFetchStreams=e.useFetchStreams,this.longPollingOptions=e.longPollingOptions}Ko(e,t,n,r){const s=La();return new Promise((a,i)=>{const o=new u;o.setWithCredentials(!0),o.listenOnce(h.COMPLETE,()=>{try{switch(o.getLastErrorCode()){case p.NO_ERROR:const t=o.getResponseJson();E(Ba,"XHR for RPC '".concat(e,"' ").concat(s," received:"),JSON.stringify(t)),a(t);break;case p.TIMEOUT:E(Ba,"RPC '".concat(e,"' ").concat(s," timed out")),i(new M(L.DEADLINE_EXCEEDED,"Request time out"));break;case p.HTTP_ERROR:const n=o.getStatus();if(E(Ba,"RPC '".concat(e,"' ").concat(s," failed with status:"),n,"response text:",o.getResponseText()),n>0){let e=o.getResponseJson();Array.isArray(e)&&(e=e[0]);const t=null==e?void 0:e.error;if(t&&t.status&&t.message){const e=function(e){const t=e.toLowerCase().replace(/_/g,"-");return Object.values(L).indexOf(t)>=0?t:L.UNKNOWN}(t.status);i(new M(e,t.message))}else i(new M(L.UNKNOWN,"Server responded with status "+o.getStatus()))}else i(new M(L.UNAVAILABLE,"Connection failed."));break;default:_(9055,{s_:e,streamId:s,o_:o.getLastErrorCode(),__:o.getLastError()})}}finally{E(Ba,"RPC '".concat(e,"' ").concat(s," completed."))}});const l=JSON.stringify(r);E(Ba,"RPC '".concat(e,"' ").concat(s," sending request:"),r),o.send(t,"POST",l,n,15)})}a_(e,t,n){const r=La(),s=[this.Lo,"/","google.firestore.v1.Firestore","/",e,"/channel"],a=b(),i=x(),o={httpSessionIdParam:"gsessionid",initMessageHeaders:{},messageUrlParams:{database:"projects/".concat(this.databaseId.projectId,"/databases/").concat(this.databaseId.database)},sendRawJson:!0,supportsCrossDomainXhr:!0,internalChannelParams:{forwardChannelRequestTimeoutMs:6e5},forceLongPolling:this.forceLongPolling,detectBufferingProxy:this.autoDetectLongPolling},l=this.longPollingOptions.timeoutSeconds;void 0!==l&&(o.longPollingTimeout=Math.round(1e3*l)),this.useFetchStreams&&(o.useFetchStreams=!0),this.Uo(o.initMessageHeaders,t,n),o.encodeInitMessageHeaders=!0;const c=s.join("");E(Ba,"Creating RPC '".concat(e,"' stream ").concat(r,": ").concat(c),o);const d=a.createWebChannel(c,o);let u=!1,h=!1;const p=new Ua({Go:t=>{h?E(Ba,"Not sending because RPC '".concat(e,"' stream ").concat(r," is closed:"),t):(u||(E(Ba,"Opening RPC '".concat(e,"' stream ").concat(r," transport.")),d.open(),u=!0),E(Ba,"RPC '".concat(e,"' stream ").concat(r," sending:"),t),d.send(t))},zo:()=>d.close()}),y=(e,t,n)=>{e.listen(t,e=>{try{n(e)}catch(e){setTimeout(()=>{throw e},0)}})};return y(d,m.EventType.OPEN,()=>{h||(E(Ba,"RPC '".concat(e,"' stream ").concat(r," transport opened.")),p.t_())}),y(d,m.EventType.CLOSE,()=>{h||(h=!0,E(Ba,"RPC '".concat(e,"' stream ").concat(r," transport closed")),p.r_())}
2),y(d,m.EventType.ERROR,t=>{h||(h=!0,T(Ba,"RPC '".concat(e,"' stream ").concat(r," transport errored. Name:"),t.name,"Message:",t.message),p.r_(new M(L.UNAVAILABLE,"The operation could not be completed")))}),y(d,m.EventType.MESSAGE,t=>{var n;if(!h){const s=t.data[0];D(!!s,16349);const a=s,i=(null==a?void 0:a.error)||(null===(n=a[0])||void 0===n?void 0:n.error);if(i){E(Ba,"RPC '".concat(e,"' stream ").concat(r," received error:"),i);const t=i.status;let n=function(e){const t=Fr[e];if(void 0!==t)return zr(t)}(t),s=i.message;void 0===n&&(n=L.INTERNAL,s="Unknown error status: "+t+" with message "+i.message),h=!0,p.r_(new M(n,s)),d.close()}else E(Ba,"RPC '".concat(e,"' stream ").concat(r," received:"),s),p.i_(s)}}),y(i,f.STAT_EVENT,t=>{t.stat===g.PROXY?E(Ba,"RPC '".concat(e,"' stream ").concat(r," detected buffering proxy")):t.stat===g.NOPROXY&&E(Ba,"RPC '".concat(e,"' stream ").concat(r," detected no buffering proxy"))}),setTimeout(()=>{p.n_()},0),p}}function Va(){return"undefined"!=typeof document?document:null}function qa(e){return new is(e,!0)}class Wa{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e3,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1.5,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:6e4;this.bi=e,this.timerId=t,this.u_=n,this.c_=r,this.l_=s,this.h_=0,this.P_=null,this.T_=Date.now(),this.reset()}reset(){this.h_=0}I_(){this.h_=this.l_}E_(e){this.cancel();const t=Math.floor(this.h_+this.d_()),n=Math.max(0,Date.now()-this.T_),r=Math.max(0,t-n);r>0&&E("ExponentialBackoff","Backing off for ".concat(r," ms (base delay: ").concat(this.h_," ms, delay with jitter: ").concat(t," ms, last attempt: ").concat(n," ms ago)")),this.P_=this.bi.enqueueAfterDelay(this.timerId,r,()=>(this.T_=Date.now(),e())),this.h_*=this.c_,this.h_<this.u_&&(this.h_=this.u_),this.h_>this.l_&&(this.h_=this.l_)}A_(){null!==this.P_&&(this.P_.skipDelay(),this.P_=null)}cancel(){null!==this.P_&&(this.P_.cancel(),this.P_=null)}d_(){return(Math.random()-.5)*this.h_}}const Ha="PersistentStream";class Ga{constructor(e,t,n,r,s,a,i,o){this.bi=e,this.R_=n,this.V_=r,this.connection=s,this.authCredentialsProvider=a,this.appCheckCredentialsProvider=i,this.listener=o,this.state=0,this.m_=0,this.f_=null,this.g_=null,this.stream=null,this.p_=0,this.y_=new Wa(e,t)}w_(){return 1===this.state||5===this.state||this.b_()}b_(){return 2===this.state||3===this.state}start(){this.p_=0,4!==this.state?this.auth():this.S_()}async stop(){this.w_()&&await this.close(0)}D_(){this.state=0,this.y_.reset()}v_(){this.b_()&&null===this.f_&&(this.f_=this.bi.enqueueAfterDelay(this.R_,6e4,()=>this.C_()))}F_(e){this.M_(),this.stream.send(e)}async C_(){if(this.b_())return this.close(0)}M_(){this.f_&&(this.f_.cancel(),this.f_=null)}x_(){this.g_&&(this.g_.cancel(),this.g_=null)}async close(e,t){this.M_(),this.x_(),this.y_.cancel(),this.m_++,4!==e?this.y_.reset():t&&t.code===L.RESOURCE_EXHAUSTED?(C(t.toString()),C("Using maximum backoff delay to prevent overloading the backend."),this.y_.I_()):t&&t.code===L.UNAUTHENTICATED&&3!==this.state&&(this.authCredentialsProvider.invalidateToken(),this.appCheckCredentialsProvider.invalidateToken()),null!==this.stream&&(this.O_(),this.stream.close(),this.stream=null),this.state=e,await this.listener.Zo(t)}O_(){}auth(){this.state=1;const e=this.N_(this.m_),t=this.m_;Promise.all([this.authCredentialsProvider.getToken(),this.appCheckCredentialsProvider.getToken()]).then(e=>{let[n,r]=e;this.m_===t&&this.B_(n,r)},t=>{e(()=>{const e=new M(L.UNKNOWN,"Fetching auth token failed: "+t.message);return this.L_(e)})})}B_(e,t){const n=this.N_(this.m_);this.stream=this.k_(e,t),this.stream.jo(()=>{n(()=>this.listener.jo())}),this.stream.Jo(()=>{n(()=>(this.state=2,this.g_=this.bi.enqueueAfterDelay(this.V_,1e4,()=>(this.b_()&&(this.state=3),Promise.resolve())),this.listener.Jo()))}),this.stream.Zo(e=>{n(()=>this.L_(e))}),this.stream.onMessage(e=>{n(()=>1==++this.p_?this.q_(e):this.onNext(e))})}S_(){this.state=5,this.y_.E_(async()=>{this.state=0,this.start()})}L_(e){return E(Ha,"close with error: ".concat(e)),this.stream=null,this.close(4,e)}N_(e){return t=>{this.bi.enqueueAndForget(()=>this.m_===e?t():(E(Ha,"stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve()))}}}class Ya extends Ga{constructor(e,t,n,r,s,a){super(e,"listen_stream_connection_backoff","listen_stream_idle","health_check_timeout",t,n,r,a),this.serializer
2=s}k_(e,t){return this.connection.a_("Listen",e,t)}q_(e){return this.onNext(e)}onNext(e){this.y_.reset();const t=function(e,t){let n;if("targetChange"in t){t.targetChange;const r=function(e){return"NO_CHANGE"===e?0:"ADD"===e?1:"REMOVE"===e?2:"CURRENT"===e?3:"RESET"===e?4:_(39313,{state:e})}(t.targetChange.targetChangeType||"NO_CHANGE"),s=t.targetChange.targetIds||[],a=function(e,t){return e.useProto3Json?(D(void 0===t||"string"==typeof t,58123),dt.fromBase64String(t||"")):(D(void 0===t||t instanceof Buffer||t instanceof Uint8Array,16193),dt.fromUint8Array(t||new Uint8Array))}(e,t.targetChange.resumeToken),i=t.targetChange.cause,o=i&&function(e){const t=void 0===e.code?L.UNKNOWN:zr(e.code);return new M(t,e.message||"")}(i);n=new Xr(r,s,a,o||null)}else if("documentChange"in t){t.documentChange;const r=t.documentChange;r.document,r.document.name,r.document.updateTime;const s=fs(e,r.document.name),a=us(r.document.updateTime),i=r.document.createTime?us(r.document.createTime):re.min(),o=new Kt({mapValue:{fields:r.document.fields}}),l=$t.newFoundDocument(s,a,i,o),c=r.targetIds||[],d=r.removedTargetIds||[];n=new $r(c,d,l.key,l)}else if("documentDelete"in t){t.documentDelete;const r=t.documentDelete;r.document;const s=fs(e,r.document),a=r.readTime?us(r.readTime):re.min(),i=$t.newNoDocument(s,a),o=r.removedTargetIds||[];n=new $r([],o,i.key,i)}else if("documentRemove"in t){t.documentRemove;const r=t.documentRemove;r.document;const s=fs(e,r.document),a=r.removedTargetIds||[];n=new $r([],a,s,null)}else{if(!("filter"in t))return _(11601,{Vt:t});{t.filter;const e=t.filter;e.targetId;const{count:r=0,unchangedNames:s}=e,a=new Or(r,s),i=e.targetId;n=new Qr(i,a)}}return n}(this.serializer,e),n=function(e){if(!("targetChange"in e))return re.min();const t=e.targetChange;return t.targetIds&&t.targetIds.length?re.min():t.readTime?us(t.readTime):re.min()}(e);return this.listener.Q_(t,n)}U_(e){const t={};t.database=ys(this.serializer),t.addTarget=function(e,t){let n;const r=t.target;if(n=kn(r)?{documents:Ns(e,r)}:{query:ks(e,r).gt},n.targetId=t.targetId,t.resumeToken.approximateByteSize()>0){n.resumeToken=cs(e,t.resumeToken);const r=os(e,t.expectedCount);null!==r&&(n.expectedCount=r)}else if(t.snapshotVersion.compareTo(re.min())>0){n.readTime=ls(e,t.snapshotVersion.toTimestamp());const r=os(e,t.expectedCount);null!==r&&(n.expectedCount=r)}return n}(this.serializer,e);const n=function(e,t){const n=function(e){switch(e){case"TargetPurposeListen":return null;case"TargetPurposeExistenceFilterMismatch":return"existence-filter-mismatch";case"TargetPurposeExistenceFilterMismatchBloom":return"existence-filter-mismatch-bloom";case"TargetPurposeLimboResolution":return"limbo-document";default:return _(28987,{purpose:e})}}(t.purpose);return null==n?null:{"goog-listen-tags":n}}(this.serializer,e);n&&(t.labels=n),this.F_(t)}K_(e){const t={};t.database=ys(this.serializer),t.removeTarget=e,this.F_(t)}}class Ka extends Ga{constructor(e,t,n,r,s,a){super(e,"write_stream_connection_backoff","write_stream_idle","health_check_timeout",t,n,r,a),this.serializer=s}get W_(){return this.p_>0}start(){this.lastStreamToken=void 0,super.start()}O_(){this.W_&&this.G_([])}k_(e,t){return this.connection.a_("Write",e,t)}q_(e){return D(!!e.streamToken,31322),this.lastStreamToken=e.streamToken,D(!e.writeResults||0===e.writeResults.length,55816),this.listener.z_()}onNext(e){D(!!e.streamToken,12678),this.lastStreamToken=e.streamToken,this.y_.reset();const t=function(e,t){return e&&e.length>0?(D(void 0!==t,14353),e.map(e=>function(e,t){let n=e.updateTime?us(e.updateTime):us(t);return n.isEqual(re.min())&&(n=us(t)),new br(n,e.transformResults||[])}(e,t))):[]}(e.writeResults,e.commitTime),n=us(e.commitTime);return this.listener.j_(n,t)}H_(){const e={};e.database=ys(this.serializer),this.F_(e)}G_(e){const t={streamToken:this.lastStreamToken,writes:e.map(e=>js(this.serializer,e))};this.F_(t)}}class Ja{}class $a extends Ja{constructor(e,t,n,r){super(),this.authCredentials=e,this.appCheckCredentials=t,this.connection=n,this.serializer=r,this.J_=!1}Y_(){if(this.J_)throw new M(L.FAILED_PRECONDITION,"The client has already been terminated.")}Qo(e,t,n,r){return this.Y_(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(s=>{let[a,i]=s;return this.connection.Qo(e,hs(t,n),r,a,i)}).catch(e=>{throw"FirebaseError"===e.name?(e.code===L.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),e):new M(L.UNKNOWN,e.toString())})}
2Wo(e,t,n,r,s){return this.Y_(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(a=>{let[i,o]=a;return this.connection.Wo(e,hs(t,n),r,i,o,s)}).catch(e=>{throw"FirebaseError"===e.name?(e.code===L.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),e):new M(L.UNKNOWN,e.toString())})}terminate(){this.J_=!0,this.connection.terminate()}}class Qa{constructor(e,t){this.asyncQueue=e,this.onlineStateHandler=t,this.state="Unknown",this.Z_=0,this.X_=null,this.ea=!0}ta(){0===this.Z_&&(this.na("Unknown"),this.X_=this.asyncQueue.enqueueAfterDelay("online_state_timeout",1e4,()=>(this.X_=null,this.ra("Backend didn't respond within 10 seconds."),this.na("Offline"),Promise.resolve())))}ia(e){"Online"===this.state?this.na("Unknown"):(this.Z_++,this.Z_>=1&&(this.sa(),this.ra("Connection failed 1 times. Most recent error: ".concat(e.toString())),this.na("Offline")))}set(e){this.sa(),this.Z_=0,"Online"===e&&(this.ea=!1),this.na(e)}na(e){e!==this.state&&(this.state=e,this.onlineStateHandler(e))}ra(e){const t="Could not reach Cloud Firestore backend. ".concat(e,"\nThis typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.");this.ea?(C(t),this.ea=!1):E("OnlineStateTracker",t)}sa(){null!==this.X_&&(this.X_.cancel(),this.X_=null)}}const Xa="RemoteStore";class Za{constructor(e,t,n,r,s){this.localStore=e,this.datastore=t,this.asyncQueue=n,this.remoteSyncer={},this.oa=[],this._a=new Map,this.aa=new Set,this.ua=[],this.ca=s,this.ca.vo(e=>{n.enqueueAndForget(async()=>{li(this)&&(E(Xa,"Restarting streams for network reachability change."),await async function(e){const t=R(e);t.aa.add(4),await ti(t),t.la.set("Unknown"),t.aa.delete(4),await ei(t)}(this))})}),this.la=new Qa(n,r)}}async function ei(e){if(li(e))for(const t of e.ua)await t(!0)}async function ti(e){for(const t of e.ua)await t(!1)}function ni(e,t){const n=R(e);n._a.has(t.targetId)||(n._a.set(t.targetId,t),oi(n)?ii(n):Ei(n).b_()&&si(n,t))}function ri(e,t){const n=R(e),r=Ei(n);n._a.delete(t),r.b_()&&ai(n,t),0===n._a.size&&(r.b_()?r.v_():li(n)&&n.la.set("Unknown"))}function si(e,t){if(e.ha.Ke(t.targetId),t.resumeToken.approximateByteSize()>0||t.snapshotVersion.compareTo(re.min())>0){const n=e.remoteSyncer.getRemoteKeysForTarget(t.targetId).size;t=t.withExpectedCount(n)}Ei(e).U_(t)}function ai(e,t){e.ha.Ke(t),Ei(e).K_(t)}function ii(e){e.ha=new es({getRemoteKeysForTarget:t=>e.remoteSyncer.getRemoteKeysForTarget(t),Rt:t=>e._a.get(t)||null,Pt:()=>e.datastore.serializer.databaseId}),Ei(e).start(),e.la.ta()}function oi(e){return li(e)&&!Ei(e).w_()&&e._a.size>0}function li(e){return 0===R(e).aa.size}function ci(e){e.ha=void 0}async function di(e){e.la.set("Online")}async function ui(e){e._a.forEach((t,n)=>{si(e,t)})}async function mi(e,t){ci(e),oi(e)?(e.la.ia(t),ii(e)):e.la.set("Unknown")}async function hi(e,t,n){if(e.la.set("Online"),t instanceof Xr&&2===t.state&&t.cause)try{await async function(e,t){const n=t.cause;for(const r of t.targetIds)e._a.has(r)&&(await e.remoteSyncer.rejectListen(r,n),e._a.delete(r),e.ha.removeTarget(r))}(e,t)}catch(n){E(Xa,"Failed to remove targets %s: %s ",t.targetIds.join(","),n),await pi(e,n)}else if(t instanceof $r?e.ha.Xe(t):t instanceof Qr?e.ha.ot(t):e.ha.nt(t),!n.isEqual(re.min()))try{const t=await ja(e.localStore);n.compareTo(t)>=0&&await function(e,t){const n=e.ha.It(t);
2return n.targetChanges.forEach((n,r)=>{if(n.resumeToken.approximateByteSize()>0){const s=e._a.get(r);s&&e._a.set(r,s.withResumeToken(n.resumeToken,t))}}),n.targetMismatches.forEach((t,n)=>{const r=e._a.get(t);if(!r)return;e._a.set(t,r.withResumeToken(dt.EMPTY_BYTE_STRING,r.snapshotVersion)),ai(e,t);const s=new Ls(r.target,t,n,r.sequenceNumber);si(e,s)}),e.remoteSyncer.applyRemoteEvent(n)}(e,n)}catch(t){E(Xa,"Failed to raise snapshot:",t),await pi(e,t)}}async function pi(e,t,n){if(!we(t))throw t;e.aa.add(1),await ti(e),e.la.set("Offline"),n||(n=()=>ja(e.localStore)),e.asyncQueue.enqueueRetryable(async()=>{E(Xa,"Retrying IndexedDB access"),await n(),e.aa.delete(1),await ei(e)})}function gi(e,t){return t().catch(n=>pi(e,n,t))}async function fi(e){const t=R(e),n=Ci(t);let r=t.oa.length>0?t.oa[t.oa.length-1].batchId:Ne;for(;xi(t);)try{const e=await ka(t.localStore,r);if(null===e){0===t.oa.length&&n.v_();break}r=e.batchId,bi(t,e)}catch(e){await pi(t,e)}yi(t)&&vi(t)}function xi(e){return li(e)&&e.oa.length<10}function bi(e,t){e.oa.push(t);const n=Ci(e);n.b_()&&n.W_&&n.G_(t.mutations)}function yi(e){return li(e)&&!Ci(e).w_()&&e.oa.length>0}function vi(e){Ci(e).start()}async function wi(e){Ci(e).H_()}async function ji(e){const t=Ci(e);for(const n of e.oa)t.G_(n.mutations)}async function Ni(e,t,n){const r=e.oa.shift(),s=Lr.from(r,t,n);await gi(e,()=>e.remoteSyncer.applySuccessfulWrite(s)),await fi(e)}async function ki(e,t){t&&Ci(e).W_&&await async function(e,t){if(function(e){return Br(e)&&e!==L.ABORTED}(t.code)){const n=e.oa.shift();Ci(e).D_(),await gi(e,()=>e.remoteSyncer.rejectFailedWrite(n.batchId,t)),await fi(e)}}(e,t),yi(e)&&vi(e)}async function Ai(e,t){const n=R(e);n.asyncQueue.verifyOperationInProgress(),E(Xa,"RemoteStore received new credentials");const r=li(n);n.aa.add(3),await ti(n),r&&n.la.set("Unknown"),await n.remoteSyncer.handleCredentialChange(t),n.aa.delete(3),await ei(n)}async function Si(e,t){const n=R(e);t?(n.aa.delete(2),await ei(n)):t||(n.aa.add(2),await ti(n),n.la.set("Unknown"))}function Ei(e){return e.Pa||(e.Pa=function(e,t,n){const r=R(e);return r.Y_(),new Ya(t,r.connection,r.authCredentials,r.appCheckCredentials,r.serializer,n)}(e.datastore,e.asyncQueue,{jo:di.bind(null,e),Jo:ui.bind(null,e),Zo:mi.bind(null,e),Q_:hi.bind(null,e)}),e.ua.push(async t=>{t?(e.Pa.D_(),oi(e)?ii(e):e.la.set("Unknown")):(await e.Pa.stop(),ci(e))})),e.Pa}function Ci(e){return e.Ta||(e.Ta=function(e,t,n){const r=R(e);return r.Y_(),new Ka(t,r.connection,r.authCredentials,r.appCheckCredentials,r.serializer,n)}(e.datastore,e.asyncQueue,{jo:()=>Promise.resolve(),Jo:wi.bind(null,e),Zo:ki.bind(null,e),z_:ji.bind(null,e),j_:Ni.bind(null,e)}),e.ua.push(async t=>{t?(e.Ta.D_(),await fi(e)):(await e.Ta.stop(),e.oa.length>0&&(E(Xa,"Stopping write stream with ".concat(e.oa.length," pending writes")),e.oa=[]))})),e.Ta}class Ti{constructor(e,t,n,r,s){this.asyncQueue=e,this.timerId=t,this.targetTimeMs=n,this.op=r,this.removalCallback=s,this.deferred=new O,this.then=this.deferred.promise.then.bind(this.deferred.promise),this.deferred.promise.catch(e=>{})}get promise(){return this.deferred.promise}static createAndSchedule(e,t,n,r,s){const a=Date.now()+n,i=new Ti(e,t,a,r,s);return i.start(n),i}start(e){this.timerHandle=setTimeout(()=>this.handleDelayElapsed(),e)}skipDelay(){return this.handleDelayElapsed()}cancel(e){null!==this.timerHandle&&(this.clearTimeout(),this.deferred.reject(new M(L.CANCELLED,"Operation cancelled"+(e?": "+e:""))))}handleDelayElapsed(){this.asyncQueue.enqueueAndForget(()=>null!==this.timerHandle?(this.clearTimeout(),this.op().then(e=>this.deferred.resolve(e))):Promise.resolve())}clearTimeout(){null!==this.timerHandle&&(this.removalCallback(this),clearTimeout(this.timerHandle),this.timerHandle=null)}}function Pi(e,t){if(C("AsyncQueue","".concat(t,": ").concat(e)),we(e))return new M(L.UNAVAILABLE,"".concat(t,": ").concat(e));throw e}class _i{static emptySet(e){return new _i(e.comparator)}constructor(e){this.comparator=e?(t,n)=>e(t,n)||ce.comparator(t.key,n.key):(e,t)=>ce.comparator(e.key,t.key),this.keyedMap=Gn(),this.sortedSet=new rt(this.comparator)}has(e){return null!=this.keyedMap.get(e)}get(e){return this.keyedMap.get(e)}first(){return this.sortedSet.minKey()}last(){return this.sortedSet.maxKey()}isEmpty(){return this.sortedSet.isEmpty()}indexOf(e){const t=this.keyedMap.get(e);return t?this.sortedSet.indexOf(t):-1}get size(){return this.sortedSet.size}forEach(e){this.sortedSet.inorderTraversal((t,n)=>(e(t),!1))}add(e){const t=this.delete(e.key);return t.copy(t.keyedMap.insert(e.key,e),t.sortedSet.insert(e,null))}delete(e){const t=this.get(e);return t?this.copy(this.keyedMap.remove(e),this.sortedSet.remove(t)):this}isEqual(e){if(!(e instanceof _i))return!1;if(this.size!==e.size)return!1;const t=this.sortedSet.getIterator(),n=e.sortedSet.getIterator();for(;t.hasNext();){const e=t.getNext().key,r=n.getNext().key;if(!e.isEqual(r))return!1}return!0}toString(){const e=[];return this.forEach(t=>{e.push(t.toString())}),0===e.length?"DocumentSet ()":"DocumentSet (\n "+e.join(" \n")+"\n)"}copy(e,t){const n=new _i;return n.comparator=this.comparator,n.keyedMap=e,n.sortedSet=t,n}}class Ii{constructor(){this.Ia=new rt(ce.comparator)}track(e){const t=e.doc.key,n=this.Ia.get(t);n?0!==e.type&&3===n.type?this.Ia=this.Ia.insert(t,e):3===e.type&&1!==n.type?this.Ia=this.Ia.insert(t,{type:n.type,doc:e.doc}):2===e.type&&2===n.type?this.Ia=this.Ia.insert(t,{type:2,doc:e.doc}):2===e.type&&0===n.type?this.Ia=this.Ia.insert(t,{type:0,doc:e.doc}):1===e.type&&0===n.type?this.Ia=this.Ia.remove(t):1===e.type&&2===n.type?this.Ia=this.Ia.insert(t,{type:1,doc:n.doc}):0===e.type&&1===n.type?this.Ia=this.Ia.insert(t,{type:2,doc:e.doc}):_(63341,{Vt:e,Ea:n}):this.Ia=this.Ia.insert(t,e)}da(){const e=[];return this.Ia.inorderTraversal((t,n)=>{e.push(n)}),e}}class Di{constructor(e,t,n,r,s,a,i,o,l){this.query=e,this.docs=t,this.oldDocs=n,this.docChanges=r,this.mutatedKeys=s,this.fromCache=a,this.syncStateChanged=i,this.excludesMetadataChanges=o,this.hasCachedResults=l}
2static fromInitialDocuments(e,t,n,r,s){const a=[];return t.forEach(e=>{a.push({type:0,doc:e})}),new Di(e,t,_i.emptySet(t),a,n,r,!0,!1,s)}get hasPendingWrites(){return!this.mutatedKeys.isEmpty()}isEqual(e){if(!(this.fromCache===e.fromCache&&this.hasCachedResults===e.hasCachedResults&&this.syncStateChanged===e.syncStateChanged&&this.mutatedKeys.isEqual(e.mutatedKeys)&&Ln(this.query,e.query)&&this.docs.isEqual(e.docs)&&this.oldDocs.isEqual(e.oldDocs)))return!1;const t=this.docChanges,n=e.docChanges;if(t.length!==n.length)return!1;for(let r=0;r<t.length;r++)if(t[r].type!==n[r].type||!t[r].doc.isEqual(n[r].doc))return!1;return!0}}class Ri{constructor(){this.Aa=void 0,this.Ra=[]}Va(){return this.Ra.some(e=>e.ma())}}class Li{constructor(){this.queries=Mi(),this.onlineState="Unknown",this.fa=new Set}terminate(){!function(e,t){const n=R(e),r=n.queries;n.queries=Mi(),r.forEach((e,n)=>{for(const r of n.Ra)r.onError(t)})}(this,new M(L.ABORTED,"Firestore shutting down"))}}function Mi(){return new Vn(e=>Mn(e),Ln)}async function Oi(e,t){const n=R(e);let r=3;const s=t.query;let a=n.queries.get(s);a?!a.Va()&&t.ma()&&(r=2):(a=new Ri,r=t.ma()?0:1);try{switch(r){case 0:a.Aa=await n.onListen(s,!0);break;case 1:a.Aa=await n.onListen(s,!1);break;case 2:await n.onFirstRemoteStoreListen(s)}}catch(e){const n=Pi(e,"Initialization of query '".concat(On(t.query),"' failed"));return void t.onError(n)}n.queries.set(s,a),a.Ra.push(t),t.ga(n.onlineState),a.Aa&&t.pa(a.Aa)&&zi(n)}async function Fi(e,t){const n=R(e),r=t.query;let s=3;const a=n.queries.get(r);if(a){const e=a.Ra.indexOf(t);e>=0&&(a.Ra.splice(e,1),0===a.Ra.length?s=t.ma()?0:1:!a.Va()&&t.ma()&&(s=2))}switch(s){case 0:return n.queries.delete(r),n.onUnlisten(r,!0);case 1:return n.queries.delete(r),n.onUnlisten(r,!1);case 2:return n.onLastRemoteStoreUnlisten(r);default:return}}function Ui(e,t){const n=R(e);let r=!1;for(const s of t){const e=s.query,t=n.queries.get(e);if(t){for(const e of t.Ra)e.pa(s)&&(r=!0);t.Aa=s}}r&&zi(n)}function Bi(e,t,n){const r=R(e),s=r.queries.get(t);if(s)for(const a of s.Ra)a.onError(n);r.queries.delete(t)}function zi(e){e.fa.forEach(e=>{e.next()})}var Vi,qi;(qi=Vi||(Vi={})).ya="default",qi.Cache="cache";class Wi{constructor(e,t,n){this.query=e,this.wa=t,this.ba=!1,this.Sa=null,this.onlineState="Unknown",this.options=n||{}}pa(e){if(!this.options.includeMetadataChanges){const t=[];for(const n of e.docChanges)3!==n.type&&t.push(n);e=new Di(e.query,e.docs,e.oldDocs,t,e.mutatedKeys,e.fromCache,e.syncStateChanged,!0,e.hasCachedResults)}let t=!1;return this.ba?this.Da(e)&&(this.wa.next(e),t=!0):this.va(e,this.onlineState)&&(this.Ca(e),t=!0),this.Sa=e,t}onError(e){this.wa.error(e)}ga(e){this.onlineState=e;let t=!1;return this.Sa&&!this.ba&&this.va(this.Sa,e)&&(this.Ca(this.Sa),t=!0),t}va(e,t){if(!e.fromCache)return!0;if(!this.ma())return!0;const n="Offline"!==t;return(!this.options.Fa||!n)&&(!e.docs.isEmpty()||e.hasCachedResults||"Offline"===t)}Da(e){if(e.docChanges.length>0)return!0;const t=this.Sa&&this.Sa.hasPendingWrites!==e.hasPendingWrites;return!(!e.syncStateChanged&&!t)&&!0===this.options.includeMetadataChanges}Ca(e){e=Di.fromInitialDocuments(e.query,e.docs,e.mutatedKeys,e.fromCache,e.hasCachedResults),this.ba=!0,this.wa.next(e)}ma(){return this.options.source!==Vi.Cache}}class Hi{constructor(e){this.key=e}}class Gi{constructor(e){this.key=e}}class Yi{constructor(e,t){this.query=e,this.qa=t,this.Qa=null,this.hasCachedResults=!1,this.current=!1,this.$a=Zn(),this.mutatedKeys=Zn(),this.Ua=Bn(e),this.Ka=new _i(this.Ua)}get Wa(){return this.qa}Ga(e,t){const n=t?t.za:new Ii,r=t?t.Ka:this.Ka;let s=t?t.mutatedKeys:this.mutatedKeys,a=r,i=!1;const o="F"===this.query.limitType&&r.size===this.query.limit?r.last():null,l="L"===this.query.limitType&&r.size===this.query.limit?r.first():null;if(e.inorderTraversal((e,t)=>{const c=r.get(e),d=Fn(this.query,t)?t:null,u=!!c&&this.mutatedKeys.has(c.key),m=!!d&&(d.hasLocalMutations||this.mutatedKeys.has(d.key)&&d.hasCommittedMutations);let h=!1;c&&d?c.data.isEqual(d.data)?u!==m&&(n.track({type:3,doc:d}),h=!0):this.ja(c,d)||(n.track({type:2,doc:d}),h=!0,(o&&this.Ua(d,o)>0||l&&this.Ua(d,l)<0)&&(i=!0)):!c&&d?(n.track({type:0,doc:d}),h=!0):c&&!d&&(n.track({type:1,doc:c}),h=!0,(o||l)&&(i=!0)),h&&(d?(a=a.add(d),s=m?s.add(e):s.delete(e)):(a=a.delete(e),s=s.delete(e)))}),null!==this.query.limit)for(;a.size>this.query.limit;){const e="F"===this.query.limitType?a.last():a.first();a=a.delete(e.key),s=s.delete(e.key),n.track({type:1,doc:e})}return{Ka:a,za:n,ys:i,mutatedKeys:s}}ja(e,t){return e.hasLocalMutations&&t.hasCommittedMutations&&!t.hasLocalMutations}
2applyChanges(e,t,n,r){const s=this.Ka;this.Ka=e.Ka,this.mutatedKeys=e.mutatedKeys;const a=e.za.da();a.sort((e,t)=>function(e,t){const n=e=>{switch(e){case 0:return 1;case 2:case 3:return 2;case 1:return 0;default:return _(20277,{Vt:e})}};return n(e)-n(t)}(e.type,t.type)||this.Ua(e.doc,t.doc)),this.Ha(n),r=null!=r&&r;const i=t&&!r?this.Ja():[],o=0===this.$a.size&&this.current&&!r?1:0,l=o!==this.Qa;return this.Qa=o,0!==a.length||l?{snapshot:new Di(this.query,e.Ka,s,a,e.mutatedKeys,0===o,l,!1,!!n&&n.resumeToken.approximateByteSize()>0),Ya:i}:{Ya:i}}ga(e){return this.current&&"Offline"===e?(this.current=!1,this.applyChanges({Ka:this.Ka,za:new Ii,mutatedKeys:this.mutatedKeys,ys:!1},!1)):{Ya:[]}}Za(e){return!this.qa.has(e)&&!!this.Ka.has(e)&&!this.Ka.get(e).hasLocalMutations}Ha(e){e&&(e.addedDocuments.forEach(e=>this.qa=this.qa.add(e)),e.modifiedDocuments.forEach(e=>{}),e.removedDocuments.forEach(e=>this.qa=this.qa.delete(e)),this.current=e.current)}Ja(){if(!this.current)return[];const e=this.$a;this.$a=Zn(),this.Ka.forEach(e=>{this.Za(e.key)&&(this.$a=this.$a.add(e.key))});const t=[];return e.forEach(e=>{this.$a.has(e)||t.push(new Gi(e))}),this.$a.forEach(n=>{e.has(n)||t.push(new Hi(n))}),t}Xa(e){this.qa=e.Ns,this.$a=Zn();const t=this.Ga(e.documents);return this.applyChanges(t,!0)}eu(){return Di.fromInitialDocuments(this.query,this.Ka,this.mutatedKeys,0===this.Qa,this.hasCachedResults)}}const Ki="SyncEngine";class Ji{constructor(e,t,n){this.query=e,this.targetId=t,this.view=n}}class $i{constructor(e){this.key=e,this.tu=!1}}class Qi{constructor(e,t,n,r,s,a){this.localStore=e,this.remoteStore=t,this.eventManager=n,this.sharedClientState=r,this.currentUser=s,this.maxConcurrentLimboResolutions=a,this.nu={},this.ru=new Vn(e=>Mn(e),Ln),this.iu=new Map,this.su=new Set,this.ou=new rt(ce.comparator),this._u=new Map,this.au=new sa,this.uu={},this.cu=new Map,this.lu=Ws.ir(),this.onlineState="Unknown",this.hu=void 0}get isPrimaryClient(){return!0===this.hu}}async function Xi(e,t){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const r=vo(e);let s;const a=r.ru.get(t);return a?(r.sharedClientState.addLocalQueryTarget(a.targetId),s=a.view.eu()):s=await eo(r,t,n,!0),s}async function Zi(e,t){const n=vo(e);await eo(n,t,!0,!1)}async function eo(e,t,n,r){const s=await Aa(e.localStore,_n(t)),a=s.targetId,i=e.sharedClientState.addLocalQueryTarget(a,n);let o;return r&&(o=await to(e,t,a,"current"===i,s.resumeToken)),e.isPrimaryClient&&n&&ni(e.remoteStore,s),o}async function to(e,t,n,r,s){e.Pu=(t,n,r)=>async function(e,t,n,r){let s=t.view.Ga(n);s.ys&&(s=await Ea(e.localStore,t.query,!1).then(e=>{let{documents:n}=e;return t.view.Ga(n,s)}));const a=r&&r.targetChanges.get(t.targetId),i=r&&null!=r.targetMismatches.get(t.targetId),o=t.view.applyChanges(s,e.isPrimaryClient,a,i);return po(e,t.targetId,o.Ya),o.snapshot}(e,t,n,r);const a=await Ea(e.localStore,t,!0),i=new Yi(t,a.Ns),o=i.Ga(a.documents),l=Jr.createSynthesizedTargetChangeForCurrentChange(n,r&&"Offline"!==e.onlineState,s),c=i.applyChanges(o,e.isPrimaryClient,l);po(e,n,c.Ya);const d=new Ji(t,n,i);return e.ru.set(t,d),e.iu.has(n)?e.iu.get(n).push(t):e.iu.set(n,[t]),c.snapshot}async function no(e,t,n){const r=R(e),s=r.ru.get(t),a=r.iu.get(s.targetId);if(a.length>1)return r.iu.set(s.targetId,a.filter(e=>!Ln(e,t))),void r.ru.delete(t);r.isPrimaryClient?(r.sharedClientState.removeLocalQueryTarget(s.targetId),r.sharedCl
2ientState.isActiveQueryTarget(s.targetId)||await Sa(r.localStore,s.targetId,!1).then(()=>{r.sharedClientState.clearQueryState(s.targetId),n&&ri(r.remoteStore,s.targetId),mo(r,s.targetId)}).catch(be)):(mo(r,s.targetId),await Sa(r.localStore,s.targetId,!0))}async function ro(e,t){const n=R(e),r=n.ru.get(t),s=n.iu.get(r.targetId);n.isPrimaryClient&&1===s.length&&(n.sharedClientState.removeLocalQueryTarget(r.targetId),ri(n.remoteStore,r.targetId))}async function so(e,t){const n=R(e);try{const e=await function(e,t){const n=R(e),r=t.snapshotVersion;let s=n.Ss;return n.persistence.runTransaction("Apply remote event","readwrite-primary",e=>{const a=n.Cs.newChangeBuffer({trackRemovals:!0});s=n.Ss;const i=[];t.targetChanges.forEach((a,o)=>{const l=s.get(o);if(!l)return;i.push(n.ai.removeMatchingKeys(e,a.removedDocuments,o).next(()=>n.ai.addMatchingKeys(e,a.addedDocuments,o)));let c=l.withSequenceNumber(e.currentSequenceNumber);null!==t.targetMismatches.get(o)?c=c.withResumeToken(dt.EMPTY_BYTE_STRING,re.min()).withLastLimboFreeSnapshotVersion(re.min()):a.resumeToken.approximateByteSize()>0&&(c=c.withResumeToken(a.resumeToken,r)),s=s.insert(o,c),function(e,t,n){return 0===e.resumeToken.approximateByteSize()||(t.snapshotVersion.toMicroseconds()-e.snapshotVersion.toMicroseconds()>=ba||n.addedDocuments.size+n.modifiedDocuments.size+n.removedDocuments.size>0)}(l,c,a)&&i.push(n.ai.updateTargetData(e,c))});let o=Wn(),l=Zn();if(t.documentUpdates.forEach(r=>{t.resolvedLimboDocuments.has(r)&&i.push(n.persistence.referenceDelegate.updateLimboDocument(e,r))}),i.push(Na(e,a,t.documentUpdates).next(e=>{o=e.xs,l=e.Os})),!r.isEqual(re.min())){const t=n.ai.getLastRemoteSnapshotVersion(e).next(t=>n.ai.setTargetsMetadata(e,e.currentSequenceNumber,r));i.push(t)}return ye.waitFor(i).next(()=>a.apply(e)).next(()=>n.localDocuments.getLocalViewOfDocuments(e,o,l)).next(()=>o)}).then(e=>(n.Ss=s,e))}(n.localStore,t);
2t.targetChanges.forEach((e,t)=>{const r=n._u.get(t);r&&(D(e.addedDocuments.size+e.modifiedDocuments.size+e.removedDocuments.size<=1,22616),e.addedDocuments.size>0?r.tu=!0:e.modifiedDocuments.size>0?D(r.tu,14607):e.removedDocuments.size>0&&(D(r.tu,42227),r.tu=!1))}),await xo(n,e,t)}catch(e){await be(e)}}function ao(e,t,n){const r=R(e);if(r.isPrimaryClient&&0===n||!r.isPrimaryClient&&1===n){const e=[];r.ru.forEach((n,r)=>{const s=r.view.ga(t);s.snapshot&&e.push(s.snapshot)}),function(e,t){const n=R(e);n.onlineState=t;let r=!1;n.queries.forEach((e,n)=>{for(const s of n.Ra)s.ga(t)&&(r=!0)}),r&&zi(n)}(r.eventManager,t),e.length&&r.nu.Q_(e),r.onlineState=t,r.isPrimaryClient&&r.sharedClientState.setOnlineState(t)}}async function io(e,t,n){const r=R(e);r.sharedClientState.updateQueryState(t,"rejected",n);const s=r._u.get(t),a=s&&s.key;if(a){let e=new rt(ce.comparator);e=e.insert(a,$t.newNoDocument(a,re.min()));const n=Zn().add(a),s=new Kr(re.min(),new Map,new rt(J),e,n);await so(r,s),r.ou=r.ou.remove(a),r._u.delete(t),fo(r)}else await Sa(r.localStore,t,!1).then(()=>mo(r,t,n)).catch(be)}async function oo(e,t){const n=R(e),r=t.batch.batchId;try{const e=await function(e,t){const n=R(e);return n.persistence.runTransaction("Acknowledge batch","readwrite-primary",e=>{const r=t.batch.keys(),s=n.Cs.newChangeBuffer({trackRemovals:!0});return function(e,t,n,r){const s=n.batch,a=s.keys();let i=ye.resolve();return a.forEach(e=>{i=i.next(()=>r.getEntry(t,e)).next(t=>{const a=n.docVersions.get(e);D(null!==a,48541),t.version.compareTo(a)<0&&(s.applyToRemoteDocument(t,n),t.isValidDocument()&&(t.setReadTime(n.commitVersion),r.addEntry(t)))})}),i.next(()=>e.mutationQueue.removeMutationBatch(t,s))}(n,e,t,s).next(()=>s.apply(e)).next(()=>n.mutationQueue.performConsistencyCheck(e)).next(()=>n.documentOverlayCache.removeOverlaysForBatchId(e,r,t.batch.batchId)).next(()=>n.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(e,function(e){let t=Zn();for(let n=0;n<e.mutationResults.length;++n)e.mutationResults[n].transformResults.length>0&&(t=t.add(e.batch.mutations[n].key));return t}(t))).next(()=>n.localDocuments.getDocuments(e,r))})}(n.localStore,t);uo(n,r,null),co(n,r),n.sharedClientState.updateMutationState(r,"acknowledged"),await xo(n,e)}catch(e){await be(e)}}async function lo(e,t,n){const r=R(e);try{const e=await function(e,t){const n=R(e);return n.persistence.runTransaction("Reject batch","readwrite-primary",e=>{let r;
2return n.mutationQueue.lookupMutationBatch(e,t).next(t=>(D(null!==t,37113),r=t.keys(),n.mutationQueue.removeMutationBatch(e,t))).next(()=>n.mutationQueue.performConsistencyCheck(e)).next(()=>n.documentOverlayCache.removeOverlaysForBatchId(e,r,t)).next(()=>n.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(e,r)).next(()=>n.localDocuments.getDocuments(e,r))})}(r.localStore,t);uo(r,t,n),co(r,t),r.sharedClientState.updateMutationState(t,"rejected",n),await xo(r,e)}catch(n){await be(n)}}function co(e,t){(e.cu.get(t)||[]).forEach(e=>{e.resolve()}),e.cu.delete(t)}function uo(e,t,n){const r=R(e);let s=r.uu[r.currentUser.toKey()];if(s){const e=s.get(t);e&&(n?e.reject(n):e.resolve(),s=s.remove(t)),r.uu[r.currentUser.toKey()]=s}}function mo(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;e.sharedClientState.removeLocalQueryTarget(t);for(const r of e.iu.get(t))e.ru.delete(r),n&&e.nu.Tu(r,n);e.iu.delete(t),e.isPrimaryClient&&e.au.Ur(t).forEach(t=>{e.au.containsKey(t)||ho(e,t)})}function ho(e,t){e.su.delete(t.path.canonicalString());const n=e.ou.get(t);null!==n&&(ri(e.remoteStore,n),e.ou=e.ou.remove(t),e._u.delete(n),fo(e))}function po(e,t,n){for(const r of n)r instanceof Hi?(e.au.addReference(r.key,t),go(e,r)):r instanceof Gi?(E(Ki,"Document no longer in limbo: "+r.key),e.au.removeReference(r.key,t),e.au.containsKey(r.key)||ho(e,r.key)):_(19791,{Iu:r})}function go(e,t){const n=t.key,r=n.path.canonicalString();e.ou.get(n)||e.su.has(r)||(E(Ki,"New document in limbo: "+n),e.su.add(r),fo(e))}function fo(e){for(;e.su.size>0&&e.ou.size<e.maxConcurrentLimboResolutions;){const t=e.su.values().next().value;e.su.delete(t);const n=new ce(ie.fromString(t)),r=e.lu.next();e._u.set(r,new $i(n)),e.ou=e.ou.insert(n,r),ni(e.remoteStore,new Ls(_n(En(n.path)),r,"TargetPurposeLimboResolution",je.le))}}async function xo(e,t,n){const r=R(e),s=[],a=[],i=[];r.ru.isEmpty()||(r.ru.forEach((e,o)=>{i.push(r.Pu(o,t,n).then(e=>{var t;if((e||n)&&r.isPrimaryClient){const s=e?!e.fromCache:null===(t=null==n?void 0:n.targetChanges.get(o.targetId))||void 0===t?void 0:t.current;
2r.sharedClientState.updateQueryState(o.targetId,s?"current":"not-current")}if(e){s.push(e);const t=pa.Ps(o.targetId,e);a.push(t)}}))}),await Promise.all(i),r.nu.Q_(s),await async function(e,t){const n=R(e);try{await n.persistence.runTransaction("notifyLocalViewChanges","readwrite",e=>ye.forEach(t,t=>ye.forEach(t.ls,r=>n.persistence.referenceDelegate.addReference(e,t.targetId,r)).next(()=>ye.forEach(t.hs,r=>n.persistence.referenceDelegate.removeReference(e,t.targetId,r)))))}catch(e){if(!we(e))throw e;E(xa,"Failed to update sequence numbers: "+e)}for(const r of t){const e=r.targetId;if(!r.fromCache){const t=n.Ss.get(e),r=t.snapshotVersion,s=t.withLastLimboFreeSnapshotVersion(r);n.Ss=n.Ss.insert(e,s)}}}(r.localStore,a))}async function bo(e,t){const n=R(e);if(!n.currentUser.isEqual(t)){E(Ki,"User change. New user:",t.toKey());const e=await wa(n.localStore,t);n.currentUser=t,function(e,t){e.cu.forEach(e=>{e.forEach(e=>{e.reject(new M(L.CANCELLED,t))})}),e.cu.clear()}(n,"'waitForPendingWrites' promise is rejected due to a user change."),n.sharedClientState.handleUserChange(t,e.removedBatchIds,e.addedBatchIds),await xo(n,e.Ms)}}function yo(e,t){const n=R(e),r=n._u.get(t);if(r&&r.tu)return Zn().add(r.key);{let e=Zn();const r=n.iu.get(t);if(!r)return e;for(const t of r){const r=n.ru.get(t);e=e.unionWith(r.view.Wa)}return e}}function vo(e){const t=R(e);return t.remoteStore.remoteSyncer.applyRemoteEvent=so.bind(null,t),t.remoteStore.remoteSyncer.getRemoteKeysForTarget=yo.bind(null,t),t.remoteStore.remoteSyncer.rejectListen=io.bind(null,t),t.nu.Q_=Ui.bind(null,t.eventManager),t.nu.Tu=Bi.bind(null,t.eventManager),t}function wo(e){const t=R(e);return t.remoteStore.remoteSyncer.applySuccessfulWrite=oo.bind(null,t),t.remoteStore.remoteSyncer.rejectFailedWrite=lo.bind(null,t),t}class jo{constructor(){this.kind="memory",this.synchronizeTabs=!1}async initialize(e){this.serializer=qa(e.databaseInfo.databaseId),this.sharedClientState=this.Au(e),this.persistence=this.Ru(e),await this.persistence.start(),this.localStore=this.Vu(e),this.gcScheduler=this.mu(e,this.localStore),this.indexBackfillerScheduler=this.fu(e,this.localStore)}mu(e,t){return null}fu(e,t){return null}Vu(e){return va(this.persistence,new fa,e.initialUser,this.serializer)}Ru(e){return new da(ma.Ei,this.serializer)}Au(e){return new Pa}async terminate(){var e,t;null===(e=this.gcScheduler)||void 0===e||e.stop(),null===(t=this.indexBackfillerScheduler)||void 0===t||t.stop(),this.sharedClientState.shutdown(),await this.persistence.shutdown()}}jo.provider={build:()=>new jo};class No extends jo{constructor(e){super(),this.cacheSizeBytes=e}mu(e,t){D(this.persistence.referenceDelegate instanceof ha,46915);const n=this.persistence.referenceDelegate.garbageCollector;return new Js(n,e.asyncQueue,t)}Ru(e){const t=void 0!==this.cacheSizeBytes?qs.withCacheSize(this.cacheSizeBytes):qs.DEFAULT;return new da(e=>ha.Ei(e,t),this.serializer)}}class ko{async initialize(e,t){this.localStore||(this.localStore=e.localStore,this.sharedClientState=e.sharedClientState,this.datastore=this.createDatastore(t),this.remoteStore=this.createRemoteStore(t),this.eventManager=this.createEventManager(t),this.syncEngine=this.createSyncEngine(t,!e.synchronizeTabs),this.sharedClientState.onlineStateHandler=e=>ao(this.syncEngine,e,1),this.remoteStore.remoteSyncer.handleCredentialChange=bo.bind(null,this.syncEngine),await Si(this.remoteStore,this.syncEngine.isPrimaryClient))}createEventManager(e){return new Li}createDatastore(e){const t=qa(e.databaseInfo.databaseId),n=function(e){return new za(e)}(e.databaseInfo);return function(e,t,n,r){return new $a(e,t,n,r)}(e.authCredentials,e.appCheckCredentials,n,t)}createRemoteStore(e){return function(e,t,n,r,s){return new Za(e,t,n,r,s)}(this.localStore,this.datastore,e.asyncQueue,e=>ao(this.syncEngine,e,0),Da.C()?new Da:new _a)}createSyncEngine(e,t){return function(e,t,n,r,s,a,i){const o=new Qi(e,t,n,r,s,a);return i&&(o.hu=!0),o}(this.localStore,this.remoteStore,this.eventManager,this.sharedClientState,e.initialUser,e.maxConcurrentLimboResolutions,t)}async terminate(){var e,t;await async function(e){const t=R(e);E(Xa,"RemoteStore shutting down."),t.aa.add(5),await ti(t),t.ca.shutdown(),t.la.set("Unknown")}(this.remoteStore),null===(e=this.datastore)||void 0===e||e.terminate(),null===(t=this.eventManager)||void 0===t||t.terminate()}}ko.provider={build:()=>new ko};class Ao{constructor(e){this.observer=e,this.muted=!1}next(e){this.muted||this.observer.next&&this.pu(this.observer.next,e)}error(e){this.muted||(this.observer.error?this.pu(this.observer.error,e):C("Uncaught Error in snapshot listener:",e.toString()))}yu(){this.muted=!0}
2pu(e,t){setTimeout(()=>{this.muted||e(t)},0)}}const So="FirestoreClient";class Eo{constructor(e,t,n,r,s){this.authCredentials=e,this.appCheckCredentials=t,this.asyncQueue=n,this.databaseInfo=r,this.user=N.UNAUTHENTICATED,this.clientId=K.newId(),this.authCredentialListener=()=>Promise.resolve(),this.appCheckCredentialListener=()=>Promise.resolve(),this._uninitializedComponentsProvider=s,this.authCredentials.start(n,async e=>{E(So,"Received user=",e.uid),await this.authCredentialListener(e),this.user=e}),this.appCheckCredentials.start(n,e=>(E(So,"Received new app check token=",e),this.appCheckCredentialListener(e,this.user)))}get configuration(){return{asyncQueue:this.asyncQueue,databaseInfo:this.databaseInfo,clientId:this.clientId,authCredentials:this.authCredentials,appCheckCredentials:this.appCheckCredentials,initialUser:this.user,maxConcurrentLimboResolutions:100}}setCredentialChangeListener(e){this.authCredentialListener=e}setAppCheckTokenChangeListener(e){this.appCheckCredentialListener=e}terminate(){this.asyncQueue.enterRestrictedMode();const e=new O;return this.asyncQueue.enqueueAndForgetEvenWhileRestricted(async()=>{try{this._onlineComponents&&await this._onlineComponents.terminate(),this._offlineComponents&&await this._offlineComponents.terminate(),this.authCredentials.shutdown(),this.appCheckCredentials.shutdown(),e.resolve()}catch(t){const n=Pi(t,"Failed to shutdown persistence");e.reject(n)}}),e.promise}}async function Co(e,t){e.asyncQueue.verifyOperationInProgress(),E(So,"Initializing OfflineComponentProvider");const n=e.configuration;await t.initialize(n);let r=n.initialUser;e.setCredentialChangeListener(async e=>{r.isEqual(e)||(await wa(t.localStore,e),r=e)}),t.persistence.setDatabaseDeletedListener(()=>e.terminate()),e._offlineComponents=t}async function To(e,t){e.asyncQueue.verifyOperationInProgress();const n=await Po(e);E(So,"Initializing OnlineComponentProvider"),await t.initialize(n,e.configuration),e.setCredentialChangeListener(e=>Ai(t.remoteStore,e)),e.setAppCheckTokenChangeListener((e,n)=>Ai(t.remoteStore,n)),e._onlineComponents=t}async function Po(e){if(!e._offlineComponents)if(e._uninitializedComponentsProvider){E(So,"Using user provided OfflineComponentProvider");try{await Co(e,e._uninitializedComponentsProvider._offline)}catch(t){const n=t;if(!function(e){return"FirebaseError"===e.name?e.code===L.FAILED_PRECONDITION||e.code===L.UNIMPLEMENTED:!("undefined"!=typeof DOMException&&e instanceof DOMException)||22===e.code||20===e.code||11===e.code}(n))throw n;T("Error using user provided cache. Falling back to memory cache: "+n),await Co(e,new jo)}}else E(So,"Using default OfflineComponentProvider"),await Co(e,new No(void 0));return e._offlineComponents}async function _o(e){return e._onlineComponents||(e._uninitializedComponentsProvider?(E(So,"Using user provided OnlineComponentProvider"),await To(e,e._uninitializedComponentsProvider._online)):(E(So,"Using default OnlineComponentProvider"),await To(e,new ko))),e._onlineComponents}function Io(e){return _o(e).then(e=>e.syncEngine)}async function Do(e){const t=await _o(e),n=t.eventManager;return n.onListen=Xi.bind(null,t.syncEngine),n.onUnlisten=no.bind(null,t.syncEngine),n.onFirstRemoteStoreListen=Zi.bind(null,t.syncEngine),n.onLastRemoteStoreUnlisten=ro.bind(null,t.syncEngine),n}function Ro(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=new O;return e.asyncQueue.enqueueAndForget(async()=>function(e,t,n,r,s){const a=new Ao({next:o=>{a.yu(),t.enqueueAndForget(()=>Fi(e,i));const l=o.docs.has(n);!l&&o.fromCache?s.reject(new M(L.UNAVAILABLE,"Failed to get document because the client is offline.")):l&&o.fromCache&&r&&"server"===r.source?s.reject(new M(L.UNAVAILABLE,'Failed to get document from server. (However, this document does exist in the local cache. Run again without setting source to "server" to retrieve the cached document.)')):s.resolve(o)},error:e=>s.reject(e)}),i=new Wi(En(n.path),a,{includeMetadataChanges:!0,Fa:!0});return Oi(e,i)}(await Do(e),e.asyncQueue,t,n,r)),r.promise}function Lo(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=new O;return e.asyncQueue.enqueueAndForget(async()=>
2function(e,t,n,r,s){const a=new Ao({next:n=>{a.yu(),t.enqueueAndForget(()=>Fi(e,i)),n.fromCache&&"server"===r.source?s.reject(new M(L.UNAVAILABLE,'Failed to get documents from server. (However, these documents may exist in the local cache. Run again without setting source to "server" to retrieve the cached documents.)')):s.resolve(n)},error:e=>s.reject(e)}),i=new Wi(n,a,{includeMetadataChanges:!0,Fa:!0});return Oi(e,i)}(await Do(e),e.asyncQueue,t,n,r)),r.promise}function Mo(e){const t={};return void 0!==e.timeoutSeconds&&(t.timeoutSeconds=e.timeoutSeconds),t}const Oo=new Map;function Fo(e,t,n){if(!n)throw new M(L.INVALID_ARGUMENT,"Function ".concat(e,"() cannot be called with an empty ").concat(t,"."))}function Uo(e){if(!ce.isDocumentKey(e))throw new M(L.INVALID_ARGUMENT,"Invalid document reference. Document references must have an even number of segments, but ".concat(e," has ").concat(e.length,"."))}function Bo(e){if(ce.isDocumentKey(e))throw new M(L.INVALID_ARGUMENT,"Invalid collection reference. Collection references must have an odd number of segments, but ".concat(e," has ").concat(e.length,"."))}function zo(e){if(void 0===e)return"undefined";if(null===e)return"null";if("string"==typeof e)return e.length>20&&(e="".concat(e.substring(0,20),"...")),JSON.stringify(e);if("number"==typeof e||"boolean"==typeof e)return""+e;if("object"==typeof e){if(e instanceof Array)return"an array";{const t=function(e){return e.constructor?e.constructor.name:null}(e);return t?"a custom ".concat(t," object"):"an object"}}return"function"==typeof e?"a function":_(12329,{type:typeof e})}function Vo(e,t){if("_delegate"in e&&(e=e._delegate),!(e instanceof t)){if(t.name===e.constructor.name)throw new M(L.INVALID_ARGUMENT,"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");{const n=zo(e);throw new M(L.INVALID_ARGUMENT,"Expected type '".concat(t.name,"', but it was: ").concat(n))}}return e}function qo(e,t){if(t<=0)throw new M(L.INVALID_ARGUMENT,"Function ".concat(e,"() requires a positive number, but it was: ").concat(t,"."))}const Wo="firestore.googleapis.com",Ho=!0;class Go{constructor(e){var t,n;if(void 0===e.host){if(void 0!==e.ssl)throw new M(L.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host=Wo,this.ssl=Ho}else this.host=e.host,this.ssl=null!==(t=e.ssl)&&void 0!==t?t:Ho;if(this.credentials=e.credentials,this.ignoreUndefinedProperties=!!e.ignoreUndefinedProperties,this.localCache=e.localCache,void 0===e.cacheSizeBytes)this.cacheSizeBytes=Vs;else{if(-1!==e.cacheSizeBytes&&e.cacheSizeBytes<Gs)throw new M(L.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");this.cacheSizeBytes=e.cacheSizeBytes}(function(e,t,n,r){if(!0===t&&!0===r)throw new M(L.INVALID_ARGUMENT,"".concat(e," and ").concat(n," cannot be used together."))})("experimentalForceLongPolling",e.experimentalForceLongPolling,"experimentalAutoDetectLongPolling",e.experimentalAutoDetectLongPolling),this.experimentalForceLongPolling=!!e.experimentalForceLongPolling,this.experimentalForceLongPolling?this.experimentalAutoDetectLongPolling=!1:void 0===e.experimentalAutoDetectLongPolling?this.experimentalAutoDetectLongPolling=!0:this.experimentalAutoDetectLongPolling=!!e.experimentalAutoDetectLongPolling,this.experimentalLongPollingOptions=Mo(null!==(n=e.experimentalLongPollingOptions)&&void 0!==n?n:{}),function(e){if(void 0!==e.timeoutSeconds){if(isNaN(e.timeoutSeconds))throw new M(L.INVALID_ARGUMENT,"invalid long polling timeout: ".concat(e.timeoutSeconds," (must not be NaN)"));if(e.timeoutSeconds<5)throw new M(L.INVALID_ARGUMENT,"invalid long polling timeout: ".concat(e.timeoutSeconds," (minimum allowed value is 5)"));if(e.timeoutSeconds>30)throw new M(L.INVALID_ARGUMENT,"invalid long polling timeout: ".concat(e.timeoutSeconds," (maximum allowed value is 30)"))}}(this.experimentalLongPollingOptions),this.useFetchStreams=!!e.useFetchStreams}isEqual(e){return this.host===e.host&&this.ssl===e.ssl&&this.credentials===e.credentials&&this.cacheSizeBytes===e.cacheSizeBytes&&this.experimentalForceLongPolling===e.experimentalForceLongPolling&&this.experimentalAutoDetectLongPolling===e.experimentalAutoDetectLongPolling&&function(e,t){return e.timeoutSeconds===t.timeoutSeconds}(this.experimentalLongPollingOptions,e.experimentalLongPollingOptions)&&this.ignoreUndefinedProperties===e.ignoreUndefinedProperties&&this.useFetchStreams===e.useFetchStreams}}class Yo{constructor(e,t,n,r){this._authCredentials=e,this._appCheckCredentials=t,this._databaseId=n,this._app=r,this.type="firestore-lite",this._persistenceKey="(lite)",this._settings=new Go({}),this._settingsFrozen=!1,this._emulatorOptions={},this._terminateTask="notTerminated"}get app(){if(!this._app)throw new M(L.FAILED_PRECONDITION,"Firestore was not initialized using the Firebase SDK. 'app' is not available");return this._app}get _initialized(){return this._settingsFrozen}get _terminated(){return"notTerminated"!==this._terminateTask}_setSettings(e){if(this._settingsFrozen)throw new M(L.FAILED_PRECONDITION,"Firestore has already been started and its settings can no longer be changed. You can only modify settings before calling any other methods on a Firestore object.");this._settings=new Go(e),this._emulatorOptions=e.emulatorOptions||{},void 0!==e.credentials&&(this._authCredentials=function(e){if(!e)return new U;switch(e.type){case"firstParty":return new q(e.sessionIndex||"0",e.iamToken||null,e.authTokenFactory||null);case"provider":return e.client;default:throw new M(L.INVALID_ARGUMENT,"makeAuthCredentialsProvider failed due to invali
2d credential type")}}(e.credentials))}_getSettings(){return this._settings}_getEmulatorOptions(){return this._emulatorOptions}_freezeSettings(){return this._settingsFrozen=!0,this._settings}_delete(){return"notTerminated"===this._terminateTask&&(this._terminateTask=this._terminate()),this._terminateTask}async _restart(){"notTerminated"===this._terminateTask?await this._terminate():this._terminateTask="notTerminated"}toJSON(){return{app:this._app,databaseId:this._databaseId,settings:this._settings}}_terminate(){return function(e){const t=Oo.get(e);t&&(E("ComponentProvider","Removing Datastore"),Oo.delete(e),t.terminate())}(this),Promise.resolve()}}class Ko{constructor(e,t,n){this.converter=t,this._query=n,this.type="query",this.firestore=e}withConverter(e){return new Ko(this.firestore,e,this._query)}}class Jo{constructor(e,t,n){this.converter=t,this._key=n,this.type="document",this.firestore=e}get _path(){return this._key.path}get id(){return this._key.path.lastSegment()}get path(){return this._key.path.canonicalString()}get parent(){return new $o(this.firestore,this.converter,this._key.path.popLast())}withConverter(e){return new Jo(this.firestore,e,this._key)}}class $o extends Ko{constructor(e,t,n){super(e,t,En(n)),this._path=n,this.type="collection"}get id(){return this._query.path.lastSegment()}get path(){return this._query.path.canonicalString()}get parent(){const e=this._path.popLast();return e.isEmpty()?null:new Jo(this.firestore,null,new ce(e))}withConverter(e){return new $o(this.firestore,e,this._path)}}function Qo(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),s=2;s<n;s++)r[s-2]=arguments[s];if(e=(0,l.Ku)(e),Fo("collection","path",t),e instanceof Yo){const n=ie.fromString(t,...r);return Bo(n),new $o(e,null,n)}{if(!(e instanceof Jo||e instanceof $o))throw new M(L.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const n=e._path.child(ie.fromString(t,...r));return Bo(n),new $o(e.firestore,null,n)}}function Xo(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),s=2;s<n;s++)r[s-2]=arguments[s];if(e=(0,l.Ku)(e),1===arguments.length&&(t=K.newId()),Fo("doc","path",t),e instanceof Yo){const n=ie.fromString(t,...r);return Uo(n),new Jo(e,null,new ce(n))}{if(!(e instanceof Jo||e instanceof $o))throw new M(L.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const n=e._path.child(ie.fromString(t,...r));return Uo(n),new Jo(e.firestore,e instanceof $o?e.converter:null,new ce(n))}}const Zo="AsyncQueue";class el{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Promise.resolve();this.Qu=[],this.$u=!1,this.Uu=[],this.Ku=null,this.Wu=!1,this.Gu=!1,this.zu=[],this.y_=new Wa(this,"async_queue_retry"),this.ju=()=>{const e=Va();e&&E(Zo,"Visibility state changed to "+e.visibilityState),this.y_.A_()},this.Hu=e;const t=Va();t&&"function"==typeof t.addEventListener&&t.addEventListener("visibilitychange",this.ju)}get isShuttingDown(){return this.$u}enqueueAndForget(e){this.enqueue(e)}enqueueAndForgetEvenWhileRestricted(e){this.Ju(),this.Yu(e)}enterRestrictedMode(e){if(!this.$u){this.$u=!0,this.Gu=e||!1;const t=Va();t&&"function"==typeof t.removeEventListener&&t.removeEventListener("visibilitychange",this.ju)}}enqueue(e){if(this.Ju(),this.$u)return new Promise(()=>{});const t=new O;return this.Yu(()=>this.$u&&this.Gu?Promise.resolve():(e().then(t.resolve,t.reject),t.promise)).then(()=>t.promise)}enqueueRetryable(e){this.enqueueAndForget(()=>(this.Qu.push(e),this.Zu()))}async Zu(){if(0!==this.Qu.length){try{await this.Qu[0](),this.Qu.shift(),this.y_.reset()}catch(e){if(!we(e))throw e;E(Zo,"Operation failed with retryable error: "+e)}this.Qu.length>0&&this.y_.E_(()=>this.Zu())}}Yu(e){const t=this.Hu.then(()=>(this.Wu=!0,e().catch(e=>{throw this.Ku=e,this.Wu=!1,C("INTERNAL UNHANDLED ERROR: ",tl(e)),e}).then(e=>(this.Wu=!1,e))));return this.Hu=t,t}enqueueAfterDelay(e,t,n){this.Ju(),this.zu.indexOf(e)>-1&&(t=0);const r=Ti.createAndSchedule(this,e,t,n,e=>this.Xu(e));return this.Uu.push(r),r}Ju(){this.Ku&&_(47125,{ec:tl(this.Ku)})}verifyOperationInProgress(){}async tc(){let e;do{e=this.Hu,await e}while(e!==this.Hu)}nc(e){for(const t of this.Uu)if(t.timerId===e)return!0;return!1}rc(e){return this.tc().then(()=>{this.Uu.sort((e,t)=>
2e.targetTimeMs-t.targetTimeMs);for(const t of this.Uu)if(t.skipDelay(),"all"!==e&&t.timerId===e)break;return this.tc()})}sc(e){this.zu.push(e)}Xu(e){const t=this.Uu.indexOf(e);this.Uu.splice(t,1)}}function tl(e){let t=e.message||"";return e.stack&&(t=e.stack.includes(e.message)?e.stack:e.message+"\n"+e.stack),t}function nl(e){return function(e,t){if("object"!=typeof e||null===e)return!1;const n=e;for(const r of t)if(r in n&&"function"==typeof n[r])return!0;return!1}(e,["next","error","complete"])}class rl extends Yo{constructor(e,t,n,r){super(e,t,n,r),this.type="firestore",this._queue=new el,this._persistenceKey=(null==r?void 0:r.name)||"[DEFAULT]"}async _terminate(){if(this._firestoreClient){const e=this._firestoreClient.terminate();this._queue=new el(e),this._firestoreClient=void 0,await e}}}function sl(e,t){const n="object"==typeof e?e:(0,a.Sx)(),r="string"==typeof e?e:t||Nt,s=(0,a.j6)(n,"firestore").getImmediate({identifier:r});if(!s._initialized){const e=(0,l.yU)("firestore");e&&function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};var s;const a=(e=Vo(e,Yo))._getSettings(),i=Object.assign(Object.assign({},a),{emulatorOptions:e._getEmulatorOptions()}),o="".concat(t,":").concat(n);a.host!==Wo&&a.host!==o&&T("Host has been set in both settings() and connectFirestoreEmulator(), emulator host will be used.");const c=Object.assign(Object.assign({},a),{host:o,ssl:!1,emulatorOptions:r});if(!(0,l.bD)(c,i)&&(e._setSettings(c),r.mockUserToken)){let t,n;if("string"==typeof r.mockUserToken)t=r.mockUserToken,n=N.MOCK_USER;else{t=(0,l.Fy)(r.mockUserToken,null===(s=e._app)||void 0===s?void 0:s.options.projectId);const a=r.mockUserToken.sub||r.mockUserToken.user_id;if(!a)throw new M(L.INVALID_ARGUMENT,"mockUserToken must contain 'sub' or 'user_id' field!");n=new N(a)}e._authCredentials=new B(new F(t,n))}}(s,...e)}return s}function al(e){if(e._terminated)throw new M(L.FAILED_PRECONDITION,"The client has already been terminated.");return e._firestoreClient||il(e),e._firestoreClient}function il(e){var t,n,r;const s=e._freezeSettings(),a=function(e,t,n,r){return new jt(e,t,n,r.host,r.ssl,r.experimentalForceLongPolling,r.experimentalAutoDetectLongPolling,Mo(r.experimentalLongPollingOptions),r.useFetchStreams)}(e._databaseId,(null===(t=e._app)||void 0===t?void 0:t.options.appId)||"",e._persistenceKey,s);e._componentsProvider||(null===(n=s.localCache)||void 0===n?void 0:n._offlineComponentProvider)&&(null===(r=s.localCache)||void 0===r?void 0:r._onlineComponentProvider)&&(e._componentsProvider={_offline:s.localCache._offlineComponentProvider,_online:s.localCache._onlineComponentProvider}),e._firestoreClient=new Eo(e._authCredentials,e._appCheckCredentials,e._queue,a,e._componentsProvider&&function(e){const t=null==e?void 0:e._online.build();return{_offline:null==e?void 0:e._offline.build(t),_online:t}}(e._componentsProvider))}class ol{constructor(e){this._byteString=e}static fromBase64String(e){try{return new ol(dt.fromBase64String(e))}catch(e){throw new M(L.INVALID_ARGUMENT,"Failed to construct data from Base64 string: "+e)}}static fromUint8Array(e){return new ol(dt.fromUint8Array(e))}toBase64(){return this._byteString.toBase64()}toUint8Array(){return this._byteString.toUint8Array()}toString(){return"Bytes(base64: "+this.toBase64()+")"}isEqual(e){return this._byteString.isEqual(e._byteString)}}class ll{constructor(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];for(let r=0;r<t.length;++r)if(0===t[r].length)throw new M(L.INVALID_ARGUMENT,"Invalid field name at argument $(i + 1). Field names must not be empty.");this._internalPath=new le(t)}isEqual(e){return this._internalPath.isEqual(e._internalPath)}}class cl{constructor(e){this._methodName=e}}class dl{constructor(e,t){if(!isFinite(e)||e<-90||e>90)throw new M(L.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+e);if(!isFinite(t)||t<-180||t>180)throw new M(L.INVALID_ARGUMENT,"Longitude must be a number between -180 and 180, but was: "+t);this._lat=e,this._long=t}get latitude(){return this._lat}get longitude(){return this._long}isEqual(e){return this._lat===e._lat&&this._long===e._long}toJSON(){return{latitude:this._lat,longitude:this._long}}_compareTo(e){return J(this._lat,e._lat)||J(this._long,e._long)}}class ul{constructor(e){this._values=(e||[]).map(e=>e)}toArray(){return this._values.map(e=>e)}isEqual(e){return function(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;++n)if(e[n]!==t[n])return!1;return!0}(this._values,e._values)}}const ml=/^__.*__$/;class hl{constructor(e,t,n){this.data=e,this.fieldMask=t,this.fieldTransforms=n}toMutation(e,t){return null!==this.fieldMask?new Cr(e,this.data,this.fieldMask,t,this.fieldTransforms):new Er(e,this.data,t,this.fieldTransforms)}}class pl{constructor(e,t,n){this.data=e,this.fieldMask=t,this.fieldTransforms=n}toMutation(e,t){return new Cr(e,this.data,this.fieldMask,t,this.fieldTransforms)}}function gl(e){switch(e){case 0:case 2:case 1:return!0;case 3:case 4:return!1;default:throw _(40011,{oc:e})}}class fl{constructor(e,t,n,r,s,a){this.settings=e,this.databaseId=t,this.serializer
2=n,this.ignoreUndefinedProperties=r,void 0===s&&this._c(),this.fieldTransforms=s||[],this.fieldMask=a||[]}get path(){return this.settings.path}get oc(){return this.settings.oc}ac(e){return new fl(Object.assign(Object.assign({},this.settings),e),this.databaseId,this.serializer,this.ignoreUndefinedProperties,this.fieldTransforms,this.fieldMask)}uc(e){var t;const n=null===(t=this.path)||void 0===t?void 0:t.child(e),r=this.ac({path:n,cc:!1});return r.lc(e),r}hc(e){var t;const n=null===(t=this.path)||void 0===t?void 0:t.child(e),r=this.ac({path:n,cc:!1});return r._c(),r}Pc(e){return this.ac({path:void 0,cc:!0})}Tc(e){return Ml(e,this.settings.methodName,this.settings.Ic||!1,this.path,this.settings.Ec)}contains(e){return void 0!==this.fieldMask.find(t=>e.isPrefixOf(t))||void 0!==this.fieldTransforms.find(t=>e.isPrefixOf(t.field))}_c(){if(this.path)for(let e=0;e<this.path.length;e++)this.lc(this.path.get(e))}lc(e){if(0===e.length)throw this.Tc("Document fields must not be empty");if(gl(this.oc)&&ml.test(e))throw this.Tc('Document fields cannot begin and end with "__"')}}class xl{constructor(e,t,n){this.databaseId=e,this.ignoreUndefinedProperties=t,this.serializer=n||qa(e)}dc(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return new fl({oc:e,methodName:t,Ec:n,path:le.emptyPath(),cc:!1,Ic:r},this.databaseId,this.serializer,this.ignoreUndefinedProperties)}}function bl(e){const t=e._freezeSettings(),n=qa(e._databaseId);return new xl(e._databaseId,!!t.ignoreUndefinedProperties,n)}function yl(e,t,n,r,s){let a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};const i=e.dc(a.merge||a.mergeFields?2:0,t,n,s);Il("Data must be an object, but it was:",i,r);const o=Pl(r,i);let l,c;if(a.merge)l=new lt(i.fieldMask),c=i.fieldTransforms;else if(a.mergeFields){const e=[];for(const r of a.mergeFields){const s=Dl(t,r,n);if(!i.contains(s))throw new M(L.INVALID_ARGUMENT,"Field '".concat(s,"' is specified in your field mask but missing from your input data."));Ol(e,s)||e.push(s)}l=new lt(e),c=i.fieldTransforms.filter(e=>l.covers(e.field))}else l=null,c=i.fieldTransforms;return new hl(new Kt(o),l,c)}class vl extends cl{_toFieldTransform(e){if(2!==e.oc)throw 1===e.oc?e.Tc("".concat(this._methodName,"() can only appear at the top level of your update data")):e.Tc("".concat(this._methodName,"() cannot be used with set() unless you pass {merge:true}"));return e.fieldMask.push(e.path),null}isEqual(e){return e instanceof vl}}function wl(e,t,n){return new fl({oc:3,Ec:t.settings.Ec,methodName:e._methodName,cc:n},t.databaseId,t.serializer,t.ignoreUndefinedProperties)}class jl extends cl{_toFieldTransform(e){return new xr(e.path,new cr)}isEqual(e){return e instanceof jl}}class Nl extends cl{constructor(e,t){super(e),this.Ac=t}_toFieldTransform(e){const t=wl(this,e,!0),n=this.Ac.map(e=>Tl(e,t)),r=new dr(n);return new xr(e.path,r)}isEqual(e){return e instanceof Nl&&(0,l.bD)(this.Ac,e.Ac)}}class kl extends cl{constructor(e,t){super(e),this.Ac=t}_toFieldTransform(e){const t=wl(this,e,!0),n=this.Ac.map(e=>Tl(e,t)),r=new mr(n);return new xr(e.path,r)}isEqual(e){return e instanceof kl&&(0,l.bD)(this.Ac,e.Ac)}}class Al extends cl{constructor(e,t){super(e),this.Rc=t}_toFieldTransform(e){const t=new pr(e.serializer,sr(e.serializer,this.Rc));return new xr(e.path,t)}isEqual(e){return e instanceof Al&&this.Rc===e.Rc}}function Sl(e,t,n,r){const s=e.dc(1,t,n);Il("Data must be an object, but it was:",s,r);const a=[],i=Kt.empty();tt(r,(e,r)=>{const o=Ll(t,e,n);r=(0,l.Ku)(r);const c=s.hc(o);if(r instanceof vl)a.push(o);else{const e=Tl(r,c);null!=e&&(a.push(o),i.set(o,e))}});const o=new lt(a);return new pl(i,o,s.fieldTransforms)}function El(e,t,n,r,s,a){const i=e.dc(1,t,n),o=[Dl(t,r,n)],c=[s];if(a.length%2!=0)throw new M(L.INVALID_ARGUMENT,"Function ".concat(t,"() needs to be called with an even number of arguments that alternate between field names and values."));for(let l=0;l<a.length;l+=2)o.push(Dl(t,a[l])),c.push(a[l+1]);const d=[],u=Kt.empty();for(let h=o.length-1;h>=0;--h)if(!Ol(d,o[h])){const e=o[h];let t=c[h];t=(0,l.Ku)(t);const n=i.hc(e);if(t instanceof vl)d.push(e);else{const r=Tl(t,n);null!=r&&(d.push(e),u.set(e,r))}}const m=new lt(d);return new pl(u,m,i.fieldTransforms)}function Cl(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return Tl(n,e.dc(r?4:3,t))}function Tl(e,t){if(_l(e=(0,l.Ku)(e)))return Il("Unsupported field value:",t,e),Pl(e,t);if(e instanceof cl)return function(e,t){if(!gl(t.oc))throw t.Tc("".concat(e._methodName,"() can only be used with update(
2) and set()"));if(!t.path)throw t.Tc("".concat(e._methodName,"() is not currently supported inside arrays"));const n=e._toFieldTransform(t);n&&t.fieldTransforms.push(n)}(e,t),null;if(void 0===e&&t.ignoreUndefinedProperties)return null;if(t.path&&t.fieldMask.push(t.path),e instanceof Array){if(t.settings.cc&&4!==t.oc)throw t.Tc("Nested arrays are not supported");return function(e,t){const n=[];let r=0;for(const s of e){let e=Tl(s,t.Pc(r));null==e&&(e={nullValue:"NULL_VALUE"}),n.push(e),r++}return{arrayValue:{values:n}}}(e,t)}return function(e,t){if(null===(e=(0,l.Ku)(e)))return{nullValue:"NULL_VALUE"};if("number"==typeof e)return sr(t.serializer,e);if("boolean"==typeof e)return{booleanValue:e};if("string"==typeof e)return{stringValue:e};if(e instanceof Date){const n=ne.fromDate(e);return{timestampValue:ls(t.serializer,n)}}if(e instanceof ne){const n=new ne(e.seconds,1e3*Math.floor(e.nanoseconds/1e3));return{timestampValue:ls(t.serializer,n)}}if(e instanceof dl)return{geoPointValue:{latitude:e.latitude,longitude:e.longitude}};if(e instanceof ol)return{bytesValue:cs(t.serializer,e._byteString)};if(e instanceof Jo){const n=t.databaseId,r=e.firestore._databaseId;if(!r.isEqual(n))throw t.Tc("Document reference is for database ".concat(r.projectId,"/").concat(r.database," but should be for database ").concat(n.projectId,"/").concat(n.database));return{referenceValue:ms(e.firestore._databaseId||t.databaseId,e._key.path)}}if(e instanceof ul)return function(e,t){return{mapValue:{fields:{[At]:{stringValue:Ct},[Tt]:{arrayValue:{values:e.toArray().map(e=>{if("number"!=typeof e)throw t.Tc("VectorValues must only contain numeric values.");return nr(t.serializer,e)})}}}}}}(e,t);throw t.Tc("Unsupported field value: ".concat(zo(e)))}(e,t)}function Pl(e,t){const n={};return nt(e)?t.path&&t.path.length>0&&t.fieldMask.push(t.path):tt(e,(e,r)=>{const s=Tl(r,t.uc(e));null!=s&&(n[e]=s)}),{mapValue:{fields:n}}}function _l(e){return!("object"!=typeof e||null===e||e instanceof Array||e instanceof Date||e instanceof ne||e instanceof dl||e instanceof ol||e instanceof Jo||e instanceof cl||e instanceof ul)}function Il(e,t,n){if(!_l(n)||!function(e){return"object"==typeof e&&null!==e&&(Object.getPrototypeOf(e)===Object.prototype||null===Object.getPrototypeOf(e))}(n)){const r=zo(n);throw"an object"===r?t.Tc(e+" a custom object"):t.Tc(e+" "+r)}}function Dl(e,t,n){if((t=(0,l.Ku)(t))instanceof ll)return t._internalPath;if("string"==typeof t)return Ll(e,t);throw Ml("Field path arguments must be of type string or ",e,!1,void 0,n)}const Rl=new RegExp("[~\\*/\\[\\]]");function Ll(e,t,n){if(t.search(Rl)>=0)throw Ml("Invalid field path (".concat(t,"). Paths must not contain '~', '*', '/', '[', or ']'"),e,!1,void 0,n);try{return new ll(...t.split("."))._internalPath}catch(r){throw Ml("Invalid field path (".concat(t,"). Paths must not be empty, begin with '.', end with '.', or contain '..'"),e,!1,void 0,n)}}function Ml(e,t,n,r,s){const a=r&&!r.isEmpty(),i=void 0!==s;let o="Function ".concat(t,"() called with invalid data");n&&(o+=" (via `toFirestore()`)"),o+=". ";let l="";return(a||i)&&(l+=" (found",a&&(l+=" in field ".concat(r)),i&&(l+=" in document ".concat(s)),l+=")"),new M(L.INVALID_ARGUMENT,o+e+l)}function Ol(e,t){return e.some(e=>e.isEqual(t))}class Fl{constructor(e,t,n,r,s){this._firestore=e,this._userDataWriter=t,this._key=n,this._document=r,this._converter=s}get id(){return this._key.path.lastSegment()}get ref(){return new Jo(this._firestore,this._converter,this._key)}exists(){return null!==this._document}data(){if(this._document){if(this._converter){const e=new Ul(this._firestore,this._userDataWriter,this._key,this._document,null);return this._converter.fromFirestore(e)}return this._userDataWriter.convertValue(this._document.data.value)}}get(e){if(this._document){const t=this._document.data.field(Bl("DocumentSnapshot.get",e));if(null!==t)return this._userDataWriter.convertValue(t)}}}class Ul extends Fl{data(){return super.data()}}function Bl(e,t){return"string"==typeof t?Ll(e,t):t instanceof ll?t._internalPath:t._delegate._internalPath}function zl(e){if("L"===e.limitType&&0===e.explicitOrderBy.length)throw new M(L.UNIMPLEMENT
2ED,"limitToLast() queries require specifying at least one orderBy() clause")}class Vl{}class ql extends Vl{}function Wl(e,t){let n=[];for(var r=arguments.length,s=new Array(r>2?r-2:0),a=2;a<r;a++)s[a-2]=arguments[a];t instanceof Vl&&n.push(t),n=n.concat(s),function(e){const t=e.filter(e=>e instanceof Yl).length,n=e.filter(e=>e instanceof Hl).length;if(t>1||t>0&&n>0)throw new M(L.INVALID_ARGUMENT,"InvalidQuery. When using composite filters, you cannot use more than one filter at the top level. Consider nesting the multiple filters within an `and(...)` statement. For example: change `query(query, where(...), or(...))` to `query(query, and(where(...), or(...)))`.")}(n);for(const i of n)e=i._apply(e);return e}class Hl extends ql{constructor(e,t,n){super(),this._field=e,this._op=t,this._value=n,this.type="where"}static _create(e,t,n){return new Hl(e,t,n)}_apply(e){const t=this._parse(e);return ec(e._query,t),new Ko(e.firestore,e.converter,Dn(e._query,t))}_parse(e){const t=bl(e.firestore),n=function(e,t,n,r,s,a,i){let o;if(s.isKeyField()){if("array-contains"===a||"array-contains-any"===a)throw new M(L.INVALID_ARGUMENT,"Invalid Query. You can't perform '".concat(a,"' queries on documentId()."));if("in"===a||"not-in"===a){Zl(i,a);const t=[];for(const n of i)t.push(Xl(r,e,n));o={arrayValue:{values:t}}}else o=Xl(r,e,i)}else"in"!==a&&"not-in"!==a&&"array-contains-any"!==a||Zl(i,a),o=Cl(n,t,i,"in"===a||"not-in"===a);return rn.create(s,a,o)}(e._query,"where",t,e.firestore._databaseId,this._field,this._op,this._value);return n}}function Gl(e,t,n){const r=t,s=Bl("where",e);return Hl._create(s,r,n)}class Yl extends Vl{constructor(e,t){super(),this.type=e,this._queryConstraints=t}static _create(e,t){return new Yl(e,t)}_parse(e){const t=this._queryConstraints.map(t=>t._parse(e)).filter(e=>e.getFilters().length>0);return 1===t.length?t[0]:sn.create(t,this._getOperator())}_apply(e){const t=this._parse(e);return 0===t.getFilters().length?e:(function(e,t){let n=e;const r=t.getFlattenedFilters();for(const s of r)ec(n,s),n=Dn(n,s)}(e._query,t),new Ko(e.firestore,e.converter,Dn(e._query,t)))}_getQueryConstraints(){return this._queryConstraints}_getOperator(){return"and"===this.type?"and":"or"}}class Kl extends ql{constructor(e,t){super(),this._field=e,this._direction=t,this.type="orderBy"}static _create(e,t){return new Kl(e,t)}_apply(e){const t=function(e,t,n){if(null!==e.startAt)throw new M(L.INVALID_ARGUMENT,"Invalid query. You must not call startAt() or startAfter() before calling orderBy().");if(null!==e.endAt)throw new M(L.INVALID_ARGUMENT,"Invalid query. You must not call endAt() or endBefore() before calling orderBy().");return new en(t,n)}(e._query,this._field,this._direction);return new Ko(e.firestore,e.converter,function(e,t){const n=e.explicitOrderBy.concat([t]);return new An(e.path,e.collectionGroup,n,e.filters.slice(),e.limit,e.limitType,e.startAt,e.endAt)}(e._query,t))}}function Jl(e){const t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"asc",n=Bl("orderBy",e);return Kl._create(n,t)}class $l extends ql{constructor(e,t,n){super(),this.type=e,this._limit=t,this._limitType=n}static _create(e,t,n){return new $l(e,t,n)}_apply(e){return new Ko(e.firestore,e.converter,Rn(e._query,this._limit,this._limitType))}}function Ql(e){return qo("limit",e),$l._create("limit",e,"F")}function Xl(e,t,n){if("string"==typeof(n=(0,l.Ku)(n))){if(""===n)throw new M(L.INVALID_ARGUMENT,"Invalid query. When querying with documentId(), you must provide a valid document ID, but it was an empty string.");if(!Tn(t)&&-1!==n.indexOf("/"))throw new M(L.INVALID_ARGUMENT,"Invalid query. When querying a collection by documentId(), you must provide a plain document ID, but '".concat(n,"' contains a '/' character."));const r=t.path.child(ie.fromString(n));if(!ce.isDocumentKey(r))throw new M(L.INVALID_ARGUMENT,"Invalid query. When querying a collection group by documentId(), the value provided must result in a valid document path, but '".concat(r,"' is not because it has an odd number of segments (").concat(r.length,")."));return Ut(e,new ce(r))}if(n instanceof Jo)return Ut(e,n._key);throw new M(L.INVALID_ARGUMENT,"Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: ".concat(zo(n),"."))}function Zl(e,t){if(!Array.isArray(e)||0===e.length)throw new M(L.INVALID_ARGUMENT,"Invalid Query. A non-empty array is required for '".concat(t.toString(),"' filters."))}function ec(e,t){const n=function(e,t){for(const n of e)for(const e of n.getFlattenedFilters())if(t.indexOf(e.op)>=0)return e.op;return null}(e.filters,function(e){switch(e){case"!=":return["!=","not-in"];case"array-contains-any":case"in":return["not-in"];case"not-in":return["array-contains-any","in","not-in","!="];default:return[]}}(t.op));if(null!==n)throw n===t.op?new M(L.INVALID_ARGUMENT,"Invalid query. You cannot use more than one '".concat(t.op.toString(),"' filter.")):new M(L.INVALID_ARGUMENT,"Invalid query. You cannot use '".concat(t.op.toString(),"' filters with '").concat(n.toString(),"' filters."))}class tc{convertValue(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"none";switch(Pt(e)){case 0:return null;case 1:return e.booleanValue;case 2:return ht(e.integerValue||e.doubleValue);case 3:return this.convertTimestamp(e.timestampValue);case 4:return this.convertServerTimestamp(e,t);case 5:return e.stringValue;case 6:return this.convertBytes(pt(e.bytesValue));case 7:return this.convertReference(e.referenceValue);case 8:return this.convertGeoPoint(e.geoPointValue);case 9:return this.convertArray(e.arrayValue,t);case 11:return this.convertObject(e.mapValue,t);case 10:return this.convertVectorValue(e.mapValue);default:throw _(62114,{value:e})}}convertObject(e,t){return this.convertObjectMap(e.fields,t)}convertObjectMap(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"none";const n={};return tt(e,(e,r)=>{n[e]=this.convertValue(r,t)}),n}convertVectorValue(e){var t,n,r;const s=null===(r=null===(n=null===(t=e.fields)||void 0===t?void 0:t[Tt].arrayValue)||void 0===n?void 0:n.values)||void 0===r?void 0:r.map(e=>ht(e.doubleValue));return new ul(s)}convertGeoPoint(e){return new dl(ht(e.latitude),ht(e.longitude))}convertArray(e,t){return(e.values||[]).map(e=>this.convertValue(e,t))}convertServerTimestamp(e,t){switch(t){case"previous":const n=vt(e);return null==n?null:this.convertValue(n,t);case"estimate":return this.convertTimestamp(wt(e));default:return null}}convertTimestamp(e){const t=mt(e);return new ne(t.seconds,t.nanos)}convertDocumentKey(e,t){const n=ie.fromString(e);D(Rs(n),9688,{name:e});const r=new kt(n.get(1),n.get(3)),s=new ce(n.popFirst(5));return r.isEqual(t)||C("Document ".concat(s," contains a document reference within a different database (").concat(r.projectId,"/").concat(r.database,") which is not supported. It will be treated as a reference in the current database (").concat(t.projectId,"/").concat(t.database,") instead.")),s}}function nc(e,t,n){let r;return r=e?n&&(n.merge||n.mergeFields)?e.toFirestore(t,n):e.toFirestore(t):t,r}class rc{constructor(e,t){this.hasPendingWrites=e,this.fromCache=t}isEqual(e){return this.hasPendingWrites===e.hasPendingWrites&&this.fromCache===e.fromCache}}class sc extends Fl{constructor(e,t,n,r,s,a){super(e,t,n,r,a),this._firestore=e,this._firestoreImpl=e,this.metadata=s}exists(){return super.exists()}data(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this._document){if(this._converter){const t=new ac(this._firestore,this._userDataWriter,this._key,this._document,this.metadata,null);return this._converter.fromFirestore(t,e)}return this._userDataWriter.convertValue(this._document.data.value,e.serverTimestamps)}}get(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this._document){const n=this._document.data.field(Bl("DocumentSnapshot.get",e));if(null!==n)return this._userDataWriter.convertValue(n,t.serverTimestamps)}}}class ac extends sc{data(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return super.data(e)}}class ic{constructor(e,t,n,r){this._firestore=e,this._userDataWriter=t,this._snapshot=r,this.metadata=new rc(r.hasPendingWrites,r.fromCache),this.query=n}get docs(){const e=[];return this.forEach(t=>e.push(t)),e}get size(){return this._snapshot.docs.size}get empty(){return 0===this.size}forEach(e,t){this._snapshot.docs.forEach(n=>{e.call(t,new ac(this._firestore,this._userDataWriter,n.key,n,new rc(this._snapshot.mutatedKeys.has(n.key),this._snapshot.fromCache),this.query.converter))})}
2docChanges(){const e=!!(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).includeMetadataChanges;if(e&&this._snapshot.excludesMetadataChanges)throw new M(L.INVALID_ARGUMENT,"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");return this._cachedChanges&&this._cachedChangesIncludeMetadataChanges===e||(this._cachedChanges=function(e,t){if(e._snapshot.oldDocs.isEmpty()){let t=0;return e._snapshot.docChanges.map(n=>{const r=new ac(e._firestore,e._userDataWriter,n.doc.key,n.doc,new rc(e._snapshot.mutatedKeys.has(n.doc.key),e._snapshot.fromCache),e.query.converter);return n.doc,{type:"added",doc:r,oldIndex:-1,newIndex:t++}})}{let n=e._snapshot.oldDocs;return e._snapshot.docChanges.filter(e=>t||3!==e.type).map(t=>{const r=new ac(e._firestore,e._userDataWriter,t.doc.key,t.doc,new rc(e._snapshot.mutatedKeys.has(t.doc.key),e._snapshot.fromCache),e.query.converter);let s=-1,a=-1;return 0!==t.type&&(s=n.indexOf(t.doc.key),n=n.delete(t.doc.key)),1!==t.type&&(n=n.add(t.doc),a=n.indexOf(t.doc.key)),{type:oc(t.type),doc:r,oldIndex:s,newIndex:a}})}}(this,e),this._cachedChangesIncludeMetadataChanges=e),this._cachedChanges}}function oc(e){switch(e){case 0:return"added";case 2:case 3:return"modified";case 1:return"removed";default:return _(61501,{type:e})}}function lc(e){e=Vo(e,Jo);const t=Vo(e.firestore,rl);return Ro(al(t),e._key).then(n=>xc(t,e,n))}class cc extends tc{constructor(e){super(),this.firestore=e}convertBytes(e){return new ol(e)}convertReference(e){const t=this.convertDocumentKey(e,this.firestore._databaseId);return new Jo(this.firestore,null,t)}}function dc(e){e=Vo(e,Ko);const t=Vo(e.firestore,rl),n=al(t),r=new cc(t);return zl(e._query),Lo(n,e._query).then(n=>new ic(t,r,e,n))}function uc(e,t,n){e=Vo(e,Jo);const r=Vo(e.firestore,rl),s=nc(e.converter,t,n);return fc(r,[yl(bl(r),"setDoc",e._key,s,null!==e.converter,n).toMutation(e._key,yr.none())])}function mc(e,t,n){e=Vo(e,Jo);const r=Vo(e.firestore,rl),s=bl(r);let a;for(var i=arguments.length,o=new Array(i>3?i-3:0),c=3;c<i;c++)o[c-3]=arguments[c];return a="string"==typeof(t=(0,l.Ku)(t))||t instanceof ll?El(s,"updateDoc",e._key,t,n,o):Sl(s,"updateDoc",e._key,t),fc(r,[a.toMutation(e._key,yr.exists(!0))])}function hc(e){return fc(Vo(e.firestore,rl),[new Ir(e._key,yr.none())])}function pc(e,t){const n=Vo(e.firestore,rl),r=Xo(e),s=nc(e.converter,t);return fc(n,[yl(bl(e.firestore),"addDoc",r._key,s,null!==e.converter,{}).toMutation(r._key,yr.exists(!1))]).then(()=>r)}function gc(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var s,a,i;e=(0,l.Ku)(e);let o={includeMetadataChanges:!1,source:"default"},c=0;"object"!=typeof n[c]||nl(n[c])||(o=n[c],c++);const d={includeMetadataChanges:o.includeMetadataChanges,source:o.source};if(nl(n[c])){const e=n[c];n[c]=null===(s=e.next)||void 0===s?void 0:s.bind(e),n[c+1]=null===(a=e.error)||void 0===a?void 0:a.bind(e),n[c+2]=null===(i=e.complete)||void 0===i?void 0:i.bind(e)}let u,m,h;if(e instanceof Jo)m=Vo(e.firestore,rl),h=En(e._key.path),u={next:t=>{n[c]&&n[c](xc(m,e,t))},error:n[c+1],complete:n[c+2]};else{const t=Vo(e,Ko);m=Vo(t.firestore,rl),h=t._query;const r=new cc(m);u={next:e=>{n[c]&&n[c](new ic(m,r,t,e))},error:n[c+1],complete:n[c+2]},zl(e._query)}return function(e,t,n,r){const s=new Ao(r),a=new Wi(t,s,n);return e.asyncQueue.enqueueAndForget(async()=>Oi(await Do(e),a)),()=>{s.yu(),e.asyncQueue.enqueueAndForget(async()=>Fi(await Do(e),a))}}(al(m),h,d,u)}function fc(e,t){return function(e,t){const n=new O;return e.asyncQueue.enqueueAndForget(async()=>async function(e,t,n){const r=wo(e);try{const e=await function(e,t){const n=R(e),r=ne.now(),s=t.reduce((e,t)=>e.add(t.key),Zn());let a,i;return n.persistence.runTransaction("Locally write mutations","readwrite",e=>{let o=Wn(),l=Zn();return n.Cs.getEntries(e,s).next(e=>{o=e,o.forEach((e,t)=>{t.isValidDocument()||(l=l.add(e))})}).next(()=>n.localDocuments.getOverlayedDocuments(e,o)).next(s=>{a=s;const i=[];for(const e of t){const t=Ar(e,a.get(e.key).overlayedDocument);null!=t&&i.push(new Cr(e.key,t,Jt(t.value.mapValue),yr.exists(!0)))}
2return n.mutationQueue.addMutationBatch(e,r,i,t)}).next(t=>{i=t;const r=t.applyToLocalDocumentSet(a,l);return n.documentOverlayCache.saveOverlays(e,t.batchId,r)})}).then(()=>({batchId:i.batchId,changes:Yn(a)}))}(r.localStore,t);r.sharedClientState.addPendingMutation(e.batchId),function(e,t,n){let r=e.uu[e.currentUser.toKey()];r||(r=new rt(J)),r=r.insert(t,n),e.uu[e.currentUser.toKey()]=r}(r,e.batchId,n),await xo(r,e.changes),await fi(r.remoteStore)}catch(e){const t=Pi(e,"Failed to persist write");n.reject(t)}}(await Io(e),t,n)),n.promise}(al(e),t)}function xc(e,t,n){const r=n.docs.get(t._key),s=new cc(e);return new sc(e,s,t._key,r,new rc(n.hasPendingWrites,n.fromCache),t.converter)}function bc(){return new jl("serverTimestamp")}function yc(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Nl("arrayUnion",t)}function vc(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new kl("arrayRemove",t)}function wc(e){return new Al("increment",e)}new WeakMap;!function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];!function(e){k=e}(a.MF),(0,a.om)(new i.uA("firestore",(e,n)=>{let{instanceIdentifier:r,options:s}=n;const a=e.getProvider("app").getImmediate(),i=new rl(new z(e.getProvider("auth-internal")),new H(a,e.getProvider("app-check-internal")),function(e,t){if(!Object.prototype.hasOwnProperty.apply(e.options,["projectId"]))throw new M(L.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');return new kt(e.options.projectId,t)}(a,r),a);return s=Object.assign({useFetchStreams:t},s),i._setSettings(s),i},"PUBLIC").setMultipleInstances(!0)),(0,a.KO)(w,j,e),(0,a.KO)(w,j,"esm2017")}()}
2,529:(e,t,n)=>{"use strict";n.d(t,{cY:()=>p,FA:()=>S,g:()=>A,u:()=>o,Uj:()=>i,Fy:()=>g,tD:()=>R,bD:()=>T,hp:()=>D,T9:()=>m,Tj:()=>d,yU:()=>u,XA:()=>h,mS:()=>l,Ku:()=>O,ZQ:()=>f,sr:()=>y,c1:()=>b,Im:()=>C,lT:()=>w,zW:()=>N,jZ:()=>x,lV:()=>v,nr:()=>j,Am:()=>_,I9:()=>I,eX:()=>k});const r=function(e){const t=[];let n=0;for(let r=0;r<e.length;r++){let s=e.charCodeAt(r);s<128?t[n++]=s:s<2048?(t[n++]=s>>6|192,t[n++]=63&s|128):55296===(64512&s)&&r+1<e.length&&56320===(64512&e.charCodeAt(r+1))?(s=65536+((1023&s)<<10)+(1023&e.charCodeAt(++r)),t[n++]=s>>18|240,t[n++]=s>>12&63|128,t[n++]=s>>6&63|128,t[n++]=63&s|128):(t[n++]=s>>12|224,t[n++]=s>>6&63|128,t[n++]=63&s|128)}return t},s={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:"function"===typeof atob,encodeByteArray(e,t){if(!Array.isArray(e))throw Error("encodeByteArray takes an array as a parameter");this.init_();const n=t?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[];for(let s=0;s<e.length;s+=3){const t=e[s],a=s+1<e.length,i=a?e[s+1]:0,o=s+2<e.length,l=o?e[s+2]:0,c=t>>2,d=(3&t)<<4|i>>4;let u=(15&i)<<2|l>>6,m=63&l;o||(m=64,a||(u=64)),r.push(n[c],n[d],n[u],n[m])}return r.join("")},encodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(r(e),t)},decodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):function(e){const t=[];let n=0,r=0;for(;n<e.length;){const s=e[n++];if(s<128)t[r++]=String.fromCharCode(s);else if(s>191&&s<224){const a=e[n++];t[r++]=String.fromCharCode((31&s)<<6|63&a)}else if(s>239&&s<365){const a=((7&s)<<18|(63&e[n++])<<12|(63&e[n++])<<6|63&e[n++])-65536;t[r++]=String.fromCharCode(55296+(a>>10)),t[r++]=String.fromCharCode(56320+(1023&a))}else{const a=e[n++],i=e[n++];t[r++]=String.fromCharCode((15&s)<<12|(63&a)<<6|63&i)}}return t.join("")}(this.decodeStringToByteArray(e,t))},decodeStringToByteArray(e,t){this.init_();const n=t?this.charToByteMapWebSafe_:this.charToByteMap_,r=[];for(let s=0;s<e.length;){const t=n[e.charAt(s++)],i=s<e.length?n[e.charAt(s)]:0;++s;const o=s<e.length?n[e.charAt(s)]:64;++s;const l=s<e.length?n[e.charAt(s)]:64;if(++s,null==t||null==i||null==o||null==l)throw new a;const c=t<<2|i>>4;if(r.push(c),64!==o){const e=i<<4&240|o>>2;if(r.push(e),64!==l){const e=o<<6&192|l;r.push(e)}}}return r},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let e=0;e<this.ENCODED_VALS.length;e++)this.byteToCharMap_[e]=this.ENCODED_VALS.charAt(e),this.charToByteMap_[this.byteToCharMap_[e]]=e,this.byteToCharMapWebSafe_[e]=this.ENCODED_VALS_WEBSAFE.charAt(e),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[e]]=e,e>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(e)]=e,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(e)]=e)}}};class a extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const i=function(e){return function(e){const t=r(e);return s.encodeByteArray(t,!0)}(e).replace(/\./g,"")},o=function(e){try{return s.decodeString(e,!0)}catch(t){console.error("base64Decode failed: ",t)}return null};function l(){if("undefined"!==typeof self)return self;if("undefined"!==typeof window)return window;if("undefined"!==typeof n.g)return n.g;throw new Error("Unable to locate global object.")}const c=()=>{try{return l().__FIREBASE_DEFAULTS__||(()=>{if("undefined"===typeof process)return;const e={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_DEBUG:"true",REACT_APP_EMAILJS_PUBLIC_KEY:"your-emailjs-public-key",REACT_APP_EMAILJS_SERVICE_ID:"your-emailjs-service-id",REACT_APP_EMAILJS_TEMPLATE_ID:"your-emailjs-template-id",REACT_APP_ENVIRONMENT:"development",REACT_APP_FIREBASE_API_KEY:"AIzaSyCldlZuqyf25VFuTgRkQH5lVo-ohxE9P6E",REACT_APP_FIREBASE_APP_ID:"1:462477660480:web:cf4338dd149dec6670eaa5",REACT_APP_FIREBASE_AUTH_DOMAIN:"the-apn.firebaseapp.com",REACT_APP_FIREBASE_MESSAGING_SENDER_ID:"462477660480",REACT_APP_FIREBASE_PROJECT_ID:"the-apn",REACT_APP_FIREBASE_STORAGE_BUCKET:"the-apn.firebasestorage.app",REACT_APP_LINKEDIN_CLIENT_ID:"your-linkedin-client-id",REACT_APP_PAYPAL_CLIENT_ID:"AdMd2uVTb0FcGkk2mFpxkMVcDCCC-a3plmioVusIdWjNP3IX48gijhJomgPpg9vBZEmhirZ4odOX38p7",REACT_APP_PAYPAL_CLIENT_ID_LIVE:"AVxmacawl8XsTAt73wWVAZLbojvCkdYAWijaO6E4juw3iAZNEk6Ddk_k6DKo7qLLpdVS6rQa_PjYlMUi",REACT_APP_STRIPE_PUBLISHABLE_KEY:"pk_live_51Kr8J3Ec8kNP7Yp7Tu6erT0Ti9b2qUuacRAPc8kfvjV7nxACrPfmoeGuU8wkIJIOptmFCoCkqW2rAPbAc35Zu2Kg00T0uBJJAv"}.__FIREBASE_DEFAULTS__;return e?JSON.parse(e):void 0})()||(()=>{if("undefined"===typeof document)return;let e;try{e=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;
2]+)/)}catch(n){return}const t=e&&o(e[1]);return t&&JSON.parse(t)})()}catch(e){return void console.info("Unable to get __FIREBASE_DEFAULTS__ due to: ".concat(e))}},d=e=>{var t,n;return null===(n=null===(t=c())||void 0===t?void 0:t.emulatorHosts)||void 0===n?void 0:n[e]},u=e=>{const t=d(e);if(!t)return;const n=t.lastIndexOf(":");if(n<=0||n+1===t.length)throw new Error("Invalid host ".concat(t," with no separate hostname and port!"));const r=parseInt(t.substring(n+1),10);return"["===t[0]?[t.substring(1,n-1),r]:[t.substring(0,n),r]},m=()=>{var e;return null===(e=c())||void 0===e?void 0:e.config},h=e=>{var t;return null===(t=c())||void 0===t?void 0:t["_".concat(e)]};class p{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}wrapCallback(e){return(t,n)=>{t?this.reject(t):this.resolve(n),"function"===typeof e&&(this.promise.catch(()=>{}),1===e.length?e(t):e(t,n))}}}function g(e,t){if(e.uid)throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');const n=t||"demo-project",r=e.iat||0,s=e.sub||e.user_id;if(!s)throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");const a=Object.assign({iss:"https://securetoken.google.com/".concat(n),aud:n,iat:r,exp:r+3600,auth_time:r,sub:s,user_id:s,firebase:{sign_in_provider:"custom",identities:{}}},e);return[i(JSON.stringify({alg:"none",type:"JWT"})),i(JSON.stringify(a)),""].join(".")}function f(){return"undefined"!==typeof navigator&&"string"===typeof navigator.userAgent?navigator.userAgent:""}function x(){return"undefined"!==typeof window&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(f())}function b(){return"undefined"!==typeof navigator&&"Cloudflare-Workers"===navigator.userAgent}function y(){const e="object"===typeof chrome?chrome.runtime:"object"===typeof browser?browser.runtime:void 0;return"object"===typeof e&&void 0!==e.id}function v(){return"object"===typeof navigator&&"ReactNative"===navigator.product}function w(){const e=f();return e.indexOf("MSIE ")>=0||e.indexOf("Trident/")>=0}function j(){return!function(){var e;const t=null===(e=c())||void 0===e?void 0:e.forceEnvironment;if("node"===t)return!0;if("browser"===t)return!1;try{return"[object process]"===Object.prototype.toString.call(n.g.process)}catch(r){return!1}}()&&!!navigator.userAgent&&navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome")}function N(){try{return"object"===typeof indexedDB}catch(e){return!1}}function k(){return new Promise((e,t)=>{try{let n=!0;const r="validate-browser-context-for-indexeddb-analytics-module",s=self.indexedDB.open(r);s.onsuccess=()=>{s.result.close(),n||self.indexedDB.deleteDatabase(r),e(!0)},s.onupgradeneeded=()=>{n=!1},s.onerror=()=>{var e;t((null===(e=s.error)||void 0===e?void 0:e.message)||"")}}catch(n){t(n)}})}class A extends Error{constructor(e,t,n){super(t),this.code=e,this.customData=n,this.name="FirebaseError",Object.setPrototypeOf(this,A.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,S.prototype.create)}}class S{constructor(e,t,n){this.service=e,this.serviceName=t,this.errors=n}create(e){const t=(arguments.length<=1?void 0:arguments[1])||{},n="".concat(this.service,"/").concat(e),r=this.errors[e],s=r?function(e,t){return e.replace(E,(e,n)=>{const r=t[n];return null!=r?String(r):"<".concat(n,"?>")})}(r,t):"Error",a="".concat(this.serviceName,": ").concat(s," (").concat(n,").");return new A(n,a,t)}}const E=/\{\$([^}]+)}/g;function C(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}function T(e,t){if(e===t)return!0;const n=Object.keys(e),r=Object.keys(t);for(const s of n){if(!r.includes(s))return!1;const n=e[s],a=t[s];if(P(n)&&P(a)){if(!T(n,a))return!1}else if(n!==a)return!1}for(const s of r)if(!n.includes(s))return!1;return!0}function P(e){return null!==e&&"object"===typeof e}function _(e){const t=[];for(const[n,r]of Object.entries(e))Array.isArray(r)?r.forEach(e=>{t.push(encodeURIComponent(n)+"="+encodeURIComponent(e))}):t.push(encodeURIComponent(n)+"="+encodeURIComponent(r));return t.length?"&"+t.join("&"):""}function I(e){const t={};
2return e.replace(/^\?/,"").split("&").forEach(e=>{if(e){const[n,r]=e.split("=");t[decodeURIComponent(n)]=decodeURIComponent(r)}}),t}function D(e){const t=e.indexOf("?");if(!t)return"";const n=e.indexOf("#",t);return e.substring(t,n>0?n:void 0)}function R(e,t){const n=new L(e,t);return n.subscribe.bind(n)}class L{constructor(e,t){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=t,this.task.then(()=>{e(this)}).catch(e=>{this.error(e)})}next(e){this.forEachObserver(t=>{t.next(e)})}error(e){this.forEachObserver(t=>{t.error(e)}),this.close(e)}complete(){this.forEachObserver(e=>{e.complete()}),this.close()}subscribe(e,t,n){let r;if(void 0===e&&void 0===t&&void 0===n)throw new Error("Missing Observer.");r=function(e,t){if("object"!==typeof e||null===e)return!1;for(const n of t)if(n in e&&"function"===typeof e[n])return!0;return!1}(e,["next","error","complete"])?e:{next:e,error:t,complete:n},void 0===r.next&&(r.next=M),void 0===r.error&&(r.error=M),void 0===r.complete&&(r.complete=M);const s=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?r.error(this.finalError):r.complete()}catch(e){}}),this.observers.push(r),s}unsubscribeOne(e){void 0!==this.observers&&void 0!==this.observers[e]&&(delete this.observers[e],this.observerCount-=1,0===this.observerCount&&void 0!==this.onNoObservers&&this.onNoObservers(this))}forEachObserver(e){if(!this.finalized)for(let t=0;t<this.observers.length;t++)this.sendOne(t,e)}sendOne(e,t){this.task.then(()=>{if(void 0!==this.observers&&void 0!==this.observers[e])try{t(this.observers[e])}catch(n){"undefined"!==typeof console&&console.error&&console.error(n)}})}close(e){this.finalized||(this.finalized=!0,void 0!==e&&(this.finalError=e),this.task.then(()=>{this.observers=void 0,this.onNoObservers=void 0}))}}function M(){}function O(e){return e&&e._delegate?e._delegate:e}},579:(e,t,n)=>{"use strict";e.exports=n(799)},672:(e,t,n)=>{"use strict";var r=n(43);function s(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(){}var i={d:{f:a,r:function(){throw Error(s(522))},D:a,C:a,L:a,m:a,X:a,S:a,M:a},p:0,findDOMNode:null},o=Symbol.for("react.portal");var l=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){return"font"===e?"":"string"===typeof t?"use-credentials"===t?t:"":void 0}t.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,t.createPortal=function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!t||1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType)throw Error(s(299));return function(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:o,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}(e,t,null,n)},t.flushSync=function(e){var t=l.T,n=i.p;try{if(l.T=null,i.p=2,e)return e()}finally{l.T=t,i.p=n,i.d.f()}},t.preconnect=function(e,t){"string"===typeof e&&(t?t="string"===typeof(t=t.crossOrigin)?"use-credentials"===t?t:"":void 0:t=null,i.d.C(e,t))},t.prefetchDNS=function(e){"string"===typeof e&&i.d.D(e)},t.preinit=function(e,t){if("string"===typeof e&&t&&"string"===typeof t.as){var n=t.as,r=c(n,t.crossOrigin),s="string"===typeof t.integrity?t.integrity:void 0,a="string"===typeof t.fetchPriority?t.fetchPriority:void 0;"style"===n?i.d.S(e,"string"===typeof t.precedence?t.precedence:void 0,{crossOrigin:r,integrity:s,fetchPriority:a}):"script"===n&&i.d.X(e,{crossOrigin:r,integrity:s,fetchPriority:a,nonce:"string"===typeof t.nonce?t.nonce:void 0})}},t.preinitModule=function(e,t){if("string"===typeof e)if("object"===typeof t&&null!==t){if(null==t.as||"script"===t.as){var n=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:"string"===typeof t.integrity?t.integrity:void 0,nonce:"string"===typeof t.nonce?t.nonce:void 0})}}else null==t&&i.d.M(e)},t.preload=function(e,t){if("string"===typeof e&&"object"===typeof t&&null!==t&&"string"===typeof t.as){var n=t.as,r=c(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:"string"===typeof t.integrity?t.integrity:void 0,nonce:"string"===typeof t.nonce?t.nonce:void 0,type:"string"===typeof t.type?t.type:void 0,fetchPriority:"string"===typeof t.fetchPriority?t.fetchPriority:void 0,referrerPolicy:"str
2ing"===typeof t.referrerPolicy?t.referrerPolicy:void 0,imageSrcSet:"string"===typeof t.imageSrcSet?t.imageSrcSet:void 0,imageSizes:"string"===typeof t.imageSizes?t.imageSizes:void 0,media:"string"===typeof t.media?t.media:void 0})}},t.preloadModule=function(e,t){if("string"===typeof e)if(t){var n=c(t.as,t.crossOrigin);i.d.m(e,{as:"string"===typeof t.as&&"script"!==t.as?t.as:void 0,crossOrigin:n,integrity:"string"===typeof t.integrity?t.integrity:void 0})}else i.d.m(e)},t.requestFormReset=function(e){i.d.r(e)},t.unstable_batchedUpdates=function(e,t){return e(t)},t.useFormState=function(e,t,n){return l.H.useFormState(e,t,n)},t.useFormStatus=function(){return l.H.useHostTransitionStatus()},t.version="19.1.0"},705:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function s(e){var t=function(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var s=n.call(e,t||"default");if("object"!=r(s))return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==r(t)?t:t+""}function a(e,t,n){return(t=s(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,{A:()=>a})},740:e=>{"use strict";e.exports=function(e,t,n,r,s,a,i,o){if(!e){var l;if(void 0===t)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,s,a,i,o],d=0;(l=new Error(t.replace(/%s/g,function(){return c[d++]}))).name="Invariant Violation"}throw l.framesToPop=1,l}}},791:(e,t,n)=>{"use strict";n.d(t,{j2:()=>d,db:()=>u,Cn:()=>h,IG:()=>m});var r=n(150);(0,r.KO)("firebase","11.6.1","app");var s=n(362),a=n(472),i=n(147),o=n(395);const l=["REACT_APP_FIREBASE_API_KEY","REACT_APP_FIREBASE_AUTH_DOMAIN","REACT_APP_FIREBASE_PROJECT_ID","REACT_APP_FIREBASE_STORAGE_BUCKET","REACT_APP_FIREBASE_MESSAGING_SENDER_ID","REACT_APP_FIREBASE_APP_ID"].filter(e=>!{NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_DEBUG:"true",REACT_APP_EMAILJS_PUBLIC_KEY:"your-emailjs-public-key",REACT_APP_EMAILJS_SERVICE_ID:"your-emailjs-service-id",REACT_APP_EMAILJS_TEMPLATE_ID:"your-emailjs-template-id",REACT_APP_ENVIRONMENT:"development",REACT_APP_FIREBASE_API_KEY:"AIzaSyCldlZuqyf25VFuTgRkQH5lVo-ohxE9P6E",REACT_APP_FIREBASE_APP_ID:"1:462477660480:web:cf4338dd149dec6670eaa5",REACT_APP_FIREBASE_AUTH_DOMAIN:"the-apn.firebaseapp.com",REACT_APP_FIREBASE_MESSAGING_SENDER_ID:"462477660480",REACT_APP_FIREBASE_PROJECT_ID:"the-apn",REACT_APP_FIREBASE_STORAGE_BUCKET:"the-apn.firebasestorage.app",REACT_APP_LINKEDIN_CLIENT_ID:"your-linkedin-client-id",REACT_APP_PAYPAL_CLIENT_ID:"AdMd2uVTb0FcGkk2mFpxkMVcDCCC-a3plmioVusIdWjNP3IX48gijhJomgPpg9vBZEmhirZ4odOX38p7",REACT_APP_PAYPAL_CLIENT_ID_LIVE:"AVxmacawl8XsTAt73wWVAZLbojvCkdYAWijaO6E4juw3iAZNEk6Ddk_k6DKo7qLLpdVS6rQa_PjYlMUi",REACT_APP_STRIPE_PUBLISHABLE_KEY:"pk_live_51Kr8J3Ec8kNP7Yp7Tu6erT0Ti9b2qUuacRAPc8kfvjV7nxACrPfmoeGuU8wkIJIOptmFCoCkqW2rAPbAc35Zu2Kg00T0uBJJAv"}[e]);if(l.length>0)throw new Error("Missing required environment variables: ".concat(l.join(", "),". Please check your .env file."));const c=(0,r.Wp)({apiKey:"AIzaSyCldlZuqyf25VFuTgRkQH5lVo-ohxE9P6E",authDomain:"the-apn.firebaseapp.com",projectId:"the-apn",storageBucket:"the-apn.firebasestorage.app",messagingSenderId:"462477660480",appId:"1:462477660480:web:cf4338dd149dec6670eaa5"}),d=(0,s.xI)(c),u=(0,a.aU)(c),m=(0,i.c7)(c),h=(0,o.Uz)(c);(0,s.oM)(d,s.F0).catch(e=>{console.error("Error setting auth persistence:",e)})},799:(e,t)=>
2{"use strict";var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function s(e,t,r){var s=null;if(void 0!==r&&(s=""+r),void 0!==t.key&&(s=""+t.key),"key"in t)for(var a in r={},t)"key"!==a&&(r[a]=t[a]);else r=t;return t=r.ref,{$$typeof:n,type:e,key:s,ref:void 0!==t?t:null,props:r}}t.Fragment=r,t.jsx=s,t.jsxs=s},812:(e,t,n)=>{"use strict";n.d(t,{h1:()=>o,uA:()=>s});var r=n(529);class s{constructor(e,t,n){this.name=e,this.instanceFactory=t,this.type=n,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(e){return this.instantiationMode=e,this}setMultipleInstances(e){return this.multipleInstances=e,this}setServiceProps(e){return this.serviceProps=e,this}setInstanceCreatedCallback(e){return this.onInstanceCreated=e,this}}const a="[DEFAULT]";class i{constructor(e,t){this.name=e,this.container=t,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(e){const t=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(t)){const e=new r.cY;if(this.instancesDeferred.set(t,e),this.isInitialized(t)||this.shouldAutoInitialize())try{const n=this.getOrInitializeService({instanceIdentifier:t});n&&e.resolve(n)}catch(n){}}return this.instancesDeferred.get(t).promise}getImmediate(e){var t;const n=this.normalizeInstanceIdentifier(null===e||void 0===e?void 0:e.identifier),r=null!==(t=null===e||void 0===e?void 0:e.optional)&&void 0!==t&&t;if(!this.isInitialized(n)&&!this.shouldAutoInitialize()){if(r)return null;throw Error("Service ".concat(this.name," is not available"))}try{return this.getOrInitializeService({instanceIdentifier:n})}catch(s){if(r)return null;throw s}}getComponent(){return this.component}setComponent(e){if(e.name!==this.name)throw Error("Mismatching Component ".concat(e.name," for Provider ").concat(this.name,"."));if(this.component)throw Error("Component for ".concat(this.name," has already been provided"));if(this.component=e,this.shouldAutoInitialize()){if(function(e){return"EAGER"===e.instantiationMode}(e))try{this.getOrInitializeService({instanceIdentifier:a})}catch(t){}for(const[e,n]of this.instancesDeferred.entries()){const r=this.normalizeInstanceIdentifier(e);try{const e=this.getOrInitializeService({instanceIdentifier:r});n.resolve(e)}catch(t){}}}}clearInstance(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a;this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)}async delete(){const e=Array.from(this.instances.values());await Promise.all([...e.filter(e=>"INTERNAL"in e).map(e=>e.INTERNAL.delete()),...e.filter(e=>"_delete"in e).map(e=>e._delete())])}isComponentSet(){return null!=this.component}isInitialized(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a;return this.instances.has(e)}getOptions(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a;return this.instancesOptions.get(e)||{}}initialize(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{options:t={}}=e,n=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(n))throw Error("".concat(this.name,"(").concat(n,") has already been initialized"));if(!this.isComponentSet())throw Error("Component ".concat(this.name," has not been registered yet"));const r=this.getOrInitializeService({instanceIdentifier:n,options:t});for(const[s,a]of this.instancesDeferred.entries()){n===this.normalizeInstanceIdentifier(s)&&a.resolve(r)}return r}onInit(e,t){var n;const r=this.normalizeInstanceIdentifier(t),s=null!==(n=this.onInitCallbacks.get(r))&&void 0!==n?n:new Set;s.add(e),this.onInitCallbacks.set(r,s);const a=this.instances.get(r);return a&&e(a,r),()=>{s.delete(e)}}invokeOnInitCallbacks(e,t){const n=this.onInitCallbacks.get(t);if(n)for(const s of n)try{s(e,t)}catch(r){}}getOrInitializeService(e){let{instanceIdentifier:t,options:n={}}=e,r=this.instances.get(t);if(!r&&this.component&&(r=this.component.instanceFactory(this.container,{instanceIdentifier:(s=t,s===a?void 0:s),options:n}),this.instances.set(t,r),this.instancesOptions.set(t,n),this.invokeOnInitCallbacks(r,t),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,t,r)}catch(i){}var s;return r||null}normalizeInstanceIdentifier(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a;return this.component?this.component.multipleInstances?e:a:e}shouldAutoInitialize(){return!!this.component&&"EXPLICIT"!==this.component.instantiationMode}}class o{constructor(e){this.name=e,this.providers=new Map}addComponent(e){const t=this.getProvider(e.name);if(t.isComponentSet())throw new Error("Component ".concat(e.name," has already been registered with ").concat(this.name));t.setComponent(e)}addOrOverwriteComponent(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)}getProvider(e){if(this.providers.has(e))return this.providers.get(e);const t=new i(e,this);return this.providers.set(e,t),t}getProviders(){return Array.from(this.providers.values())}}}
2,823:(e,t,n)=>{"use strict";n.d(t,{P_:()=>p,Ss:()=>o,bA:()=>c,he:()=>d,notifyAdminsNewUser:()=>f,ul:()=>l,zW:()=>m});var r=n(379),s=n(472),a=n(791);const i={ANNOUNCEMENT:"announcement",JOB_APPLICATION:"job_application",PROJECT_APPLICATION:"project_application",EVENT_REGISTRATION:"event_registration",EVENT_CREATED:"event_created",EVENT_UPDATED:"event_updated",EVENT_REMINDER:"event_reminder",MEMBERSHIP_APPROVED:"membership_approved",GROUP_INVITATION:"group_invitation",GROUP_NEW_POST:"group_new_post",GROUP_NEW_MEMBER:"group_new_member",GROUP_EVENT_CREATED:"group_event_created",FORUM_REPLY:"forum_reply",FORUM_LIKE:"forum_like",SYSTEM_UPDATE:"system_update",PAYMENT_RECEIVED:"payment_received",PAYMENT_FAILED:"payment_failed",ADMIN_NEW_USER:"admin_new_user",ADMIN_NEW_EVENT:"admin_new_event",ADMIN_NEW_JOB:"admin_new_job",ADMIN_NEW_PROJECT:"admin_new_project",ADMIN_NEW_GROUP:"admin_new_group",ADMIN_PENDING_APPROVAL:"admin_pending_approval",ADMIN_SYSTEM_ALERT:"admin_system_alert"},o=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:20;try{const n=(0,s.query)((0,s.collection)(a.db,"notifications"),(0,s.where)("userId","==",e),(0,s.orderBy)("createdAt","desc"),(0,s.limit)(t));return(await(0,s.getDocs)(n)).docs.map(e=>(0,r.A)({id:e.id},e.data()))}catch(n){throw console.error("Error getting notifications:",n),n}},l=async e=>{try{const t=(0,s.query)((0,s.collection)(a.db,"notifications"),(0,s.where)("userId","==",e),(0,s.where)("read","==",!1));return(await(0,s.getDocs)(t)).size}catch(t){throw console.error("Error getting unread count:",t),t}},c=async e=>{try{await(0,s.updateDoc)((0,s.doc)(a.db,"notifications",e),{read:!0,readAt:(0,s.serverTimestamp)()})}catch(t){throw console.error("Error marking notification as read:",t),t}},d=async e=>{try{const t=(0,s.query)((0,s.collection)(a.db,"notifications"),(0,s.where)("userId","==",e),(0,s.where)("read","==",!1)),n=await(0,s.getDocs)(t),r=n.docs.map(e=>(0,s.updateDoc)((0,s.doc)(a.db,"notifications",e.id),{read:!0,readAt:(0,s.serverTimestamp)()}));return await Promise.all(r),n.size}catch(t){throw console.error("Error marking all notifications as read:",t),t}},u=async function(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};try{const l=e.map(e=>({userId:e,type:t,title:n,message:r,actionUrl:i,metadata:o,read:!1,createdAt:(0,s.serverTimestamp)()})).map(e=>(0,s.addDoc)((0,s.collection)(a.db,"notifications"),e));return(await Promise.all(l)).map(e=>e.id)}catch(l){throw console.error("Error sending notifications to users:",l),l}},m=async function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;try{const{getAllUsers:s}=await Promise.resolve().then(n.bind(n,193)),a=await s(1e3),o=a.filter(e=>"approved"===e.status).map(e=>e.id);if(0===o.length)throw new Error("No approved members found");return await u(o,i.ANNOUNCEMENT,e,t,r)}catch(s){throw console.error("Error sending announcement notification:",s),s}},h=async function(e,t,r,s){let a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null;try{const{getGroupById:o}=await Promise.resolve().then(n.bind(n,193)),l=await o(e);if(!l||!l.members)throw new Error("Group not found or has no members");const c=l.members.filter(e=>e!==i);return 0===c.length?[]:await u(c,t,r,s,a,{groupId:e,groupName:l.name})}catch(o){throw console.error("Error notifying group members:",o),o}},p=async function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return await h(e,i.GROUP_NEW_POST,"New Discussion in Group","".concat(n,' started a new discussion: "').concat(t,'"'),"/groups/".concat(e),r)},g=async()=>{try{const{getAllUsers:e}=await Promise.resolve().then(n.bind(n,193)),t=await e(1e3);return t.filter(e=>"admin"===e.role).map(e=>e.id)}catch(e){return console.error("Error getting admin users:",e),[]}},f=async(e,t)=>{try{const n=await g();return 0===n.length?void console.log("No admin users found to notify"):await u(n,i.ADMIN_NEW_USER,"New User Registration","".concat(e," (").concat(t,") has registered and needs approval"),"/admin?tab=pending",{newUserName:e,newUserEmail:t})}catch(n){throw console.error("Error notifying admins about new user:",n),n}}},853:(e,t,n)=>{"use strict";e.exports=n(896)},896:(e,t)=>{"use strict";function n(e,t){var n=e.length;e.push(t);e:for(;0<n;){var r=n-1>>>1,s=e[r];if(!(0<a(s,t)))break e;e[r]=t,e[n]=s,n=r}}function r(e){return 0===e.length?null:e[0]}function s(e){if(0===e.length)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,s=e.length,i=s>>>1;r<i;){var o=2*(r+1)-1,l=e[o],c=o+1,d=e[c];if(0>
2a(l,n))c<s&&0>a(d,l)?(e[r]=d,e[c]=n,r=c):(e[r]=l,e[o]=n,r=o);else{if(!(c<s&&0>a(d,n)))break e;e[r]=d,e[c]=n,r=c}}}return t}function a(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if(t.unstable_now=void 0,"object"===typeof performance&&"function"===typeof performance.now){var i=performance;t.unstable_now=function(){return i.now()}}else{var o=Date,l=o.now();t.unstable_now=function(){return o.now()-l}}var c=[],d=[],u=1,m=null,h=3,p=!1,g=!1,f=!1,x=!1,b="function"===typeof setTimeout?setTimeout:null,y="function"===typeof clearTimeout?clearTimeout:null,v="undefined"!==typeof setImmediate?setImmediate:null;function w(e){for(var t=r(d);null!==t;){if(null===t.callback)s(d);else{if(!(t.startTime<=e))break;s(d),t.sortIndex=t.expirationTime,n(c,t)}t=r(d)}}function j(e){if(f=!1,w(e),!g)if(null!==r(c))g=!0,k||(k=!0,N());else{var t=r(d);null!==t&&I(j,t.startTime-e)}}var N,k=!1,A=-1,S=5,E=-1;function C(){return!!x||!(t.unstable_now()-E<S)}function T(){if(x=!1,k){var e=t.unstable_now();E=e;var n=!0;try{e:{g=!1,f&&(f=!1,y(A),A=-1),p=!0;var a=h;try{t:{for(w(e),m=r(c);null!==m&&!(m.expirationTime>e&&C());){var i=m.callback;if("function"===typeof i){m.callback=null,h=m.priorityLevel;var o=i(m.expirationTime<=e);if(e=t.unstable_now(),"function"===typeof o){m.callback=o,w(e),n=!0;break t}m===r(c)&&s(c),w(e)}else s(c);m=r(c)}if(null!==m)n=!0;else{var l=r(d);null!==l&&I(j,l.startTime-e),n=!1}}break e}finally{m=null,h=a,p=!1}
2n=void 0}}finally{n?N():k=!1}}}if("function"===typeof v)N=function(){v(T)};else if("undefined"!==typeof MessageChannel){var P=new MessageChannel,_=P.port2;P.port1.onmessage=T,N=function(){_.postMessage(null)}}else N=function(){b(T,0)};function I(e,n){A=b(function(){e(t.unstable_now())},n)}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(e){e.callback=null},t.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):S=0<e?Math.floor(1e3/e):5},t.unstable_getCurrentPriorityLevel=function(){return h},t.unstable_next=function(e){switch(h){case 1:case 2:case 3:var t=3;break;default:t=h}var n=h;h=t;try{return e()}finally{h=n}},t.unstable_requestPaint=function(){x=!0},t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=h;h=e;try{return t()}finally{h=n}},t.unstable_scheduleCallback=function(e,s,a){var i=t.unstable_now();switch("object"===typeof a&&null!==a?a="number"===typeof(a=a.delay)&&0<a?i+a:i:a=i,e){case 1:var o=-1;break;case 2:o=250;break;case 5:o=1073741823;break;case 4:o=1e4;break;default:o=5e3}return e={id:u++,callback:s,priorityLevel:e,startTime:a,expirationTime:o=a+o,sortIndex:-1},a>i?(e.sortIndex=a,n(d,e),null===r(c)&&e===r(d)&&(f?(y(A),A=-1):f=!0,I(j,a-i))):(e.sortIndex=o,n(c,e),g||p||(g=!0,k||(k=!0,N()))),e},t.unstable_shouldYield=C,t.unstable_wrapCallback=function(e){var t=h;return function(){var n=h;h=t;try{return e.apply(this,arguments)}finally{h=n}}}},950:(e,t,n)=>{"use strict";!function e(){if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}(),e.exports=n(672)},972:(e,t,n)=>{"use strict";n.r(t),n.d(t,{loadStripe:()=>p});var r,s="https://js.stripe.com/v3",a=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,i="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used",o=function(e){var t=e&&!e.advancedFraudSignals?"?advancedFraudSignals=false":"",n=document.createElement("script");n.src="".concat(s).concat(t);var r=document.head||document.body;if(!r)throw new Error("Expected document.body not to be null. Stripe.js requires a <body> element.");return r.appendChild(n),n},l=null,c=null,d=null,u=function(e){return null!==l?l:(l=new Promise(function(t,n){if("undefined"!==typeof window&&"undefined"!==typeof document)if(window.Stripe&&e&&console.warn(i),window.Stripe)t(window.Stripe);else try{var r=function(){for(var e=document.querySelectorAll('script[src^="'.concat(s,'"]')),t=0;t<e.length;t++){var n=e[t];if(a.test(n.src))return n}return null}();if(r&&e)console.warn(i);else if(r){if(r&&null!==d&&null!==c){var l;r.removeEventListener("load",d),r.removeEventListener("error",c),null===(l=r.parentNode)||void 0===l||l.removeChild(r),r=o(e)}}else r=o(e);d=function(e,t){return function(){window.Stripe?e(window.Stripe):t(new Error("Stripe.js not available"))}}(t,n),c=function(e){return function(){e(new Error("Failed to load Stripe.js"))}}(n),r.addEventListener("load",d),r.addEventListener("error",c)}catch(u){return void n(u)}else t(null)})).catch(function(e){return l=null,Promise.reject(e)})},m=!1,h=function(){return r||(r=u(null).catch(function(e){return r=null,Promise.reject(e)}))};Promise.resolve().then(function(){return h()}).catch(function(e){m||console.warn(e)});var p=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];m=!0;var r=Date.now();return h().then(function(e){return function(e,t,n){if(null===e)return null;var r=e.apply(void 0,t);return function(e,t){e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",version:"2.4.0",startTime:t})}(r,n),r}(e,t,r)})}},986:(e,t,n)=>{"use strict";function r(e,t){if(null==e)return{};var n,r,s=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}n.d(t,{A:()=>r})}},t={};function n(r){var s=t[r];
2if(void 0!==s)return s.exports;var a=t[r]={exports:{}};return e[r](a,a.exports,n),a.exports}n.m=e,n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce((t,r)=>(n.f[r](e,t),t),[])),n.u=e=>"static/js/"+e+"."+{238:"b81a9536",453:"7340dbaa"}[e]+".chunk.js",n.miniCssF=e=>{},n.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={},t="apn:";n.l=(r,s,a,i)=>{if(e[r])e[r].push(s);else{var o,l;if(void 0!==a)for(var c=document.getElementsByTagName("script"),d=0;d<c.length;d++){var u=c[d];if(u.getAttribute("src")==r||u.getAttribute("data-webpack")==t+a){o=u;break}}o||(l=!0,(o=document.createElement("script")).charset="utf-8",o.timeout=120,n.nc&&o.setAttribute("nonce",n.nc),o.setAttribute("data-webpack",t+a),o.src=r),e[r]=[s];var m=(t,n)=>{o.onerror=o.onload=null,clearTimeout(h);var s=e[r];if(delete e[r],o.parentNode&&o.parentNode.removeChild(o),s&&s.forEach(e=>e(n)),t)return t(n)},h=setTimeout(m.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=m.bind(null,o.onerror),o.onload=m.bind(null,o.onload),l&&document.head.appendChild(o)}}})(),n.r=e=>{"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.p="/",(()=>{var e={792:0};n.f.j=(t,r)=>{var s=n.o(e,t)?e[t]:void 0;if(0!==s)if(s)r.push(s[2]);else{var a=new Promise((n,r)=>s=e[t]=[n,r]);r.push(s[2]=a);var i=n.p+n.u(t),o=new Error;n.l(i,r=>{if(n.o(e,t)&&(0!==(s=e[t])&&(e[t]=void 0),s)){var a=r&&("load"===r.type?"missing":r.type),i=r&&r.target&&r.target.src;o.message="Loading chunk "+t+" failed.\n("+a+": "+i+")",o.name="ChunkLoadError",o.type=a,o.request=i,s[1](o)}},"chunk-"+t,t)}};var t=(t,r)=>{var s,a,i=r[0],o=r[1],l=r[2],c=0;if(i.some(t=>0!==e[t])){for(s in o)n.o(o,s)&&(n.m[s]=o[s]);if(l)l(n)}for(t&&t(r);c<i.length;c++)a=i[c],n.o(e,a)&&e[a]&&e[a][0](),e[a]=0},r=self.webpackChunkapn=self.webpackChunkapn||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))})(),(()=>{"use strict";var e=n(43),t=n(391),r=n(986),s=n(379);n(175);const a=["sri"],i=["page"],o=["page","matches"],l=["onClick","discover","prefetch","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],c=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],d=["discover","fetcherKey","navigate","reloadDocument","replace","state","method","action","onSubmit","relative","preventScrollReset","viewTransition"];var u="popstate";function m(){return y(function(e,t){let{pathname:n,search:r,hash:s}=e.location;return f("",{pathname:n,search:r,hash:s},t.state&&t.state.usr||null,t.state&&t.state.key||"default")},function(e,t){return"string"===typeof t?t:x(t)},null,arguments.length>0&&void 0!==arguments[0]?arguments[0]:{})}function h(e,t){if(!1===e||null===e||"undefined"===typeof e)throw new Error(t)}function p(e,t){if(!e){"undefined"!==typeof console&&console.warn(t);try{throw new Error(t)}catch(n){}}}function g(e,t){return{usr:e.state,key:e.key,idx:t}}function f(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3?arguments[3]:void 0;return(0,s.A)((0,s.A)({pathname:"string"===typeof e?e:e.pathname,search:"",hash:""},"string"===typeof t?b(t):t),{},{state:n,key:t&&t.key||r||Math.random().toString(36).substring(2,10)})}function x(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&"?"!==n&&(t+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(t+="#"===r.charAt(0)?r:"#"+r),t}function b(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function y(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},{window:a=document.defaultView,v5Compat:i=!1}=r,o=a.history,l="POP",c=null,d=m();function m(){return(o.state||{idx:null}).idx}function p(){l="POP";let e=m(),t=null==e?null:e-d;d=e,c&&c({action:l,location:y.location,delta:t})}function b(e){let t="null"!==a.location.origin?a.location.origin:a.location.href,n="string"===typeof e?e:
2x(e);return n=n.replace(/ $/,"%20"),h(t,"No window.location.(origin|href) available to create URL for href: ".concat(n)),new URL(n,t)}null==d&&(d=0,o.replaceState((0,s.A)((0,s.A)({},o.state),{},{idx:d}),""));let y={get action(){return l},get location(){return e(a,o)},listen(e){if(c)throw new Error("A history only accepts one active listener");return a.addEventListener(u,p),c=e,()=>{a.removeEventListener(u,p),c=null}},createHref:e=>t(a,e),createURL:b,encodeLocation(e){let t=b(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){l="PUSH";let r=f(y.location,e,t);n&&n(r,e),d=m()+1;let s=g(r,d),u=y.createHref(r);try{o.pushState(s,"",u)}catch(h){if(h instanceof DOMException&&"DataCloneError"===h.name)throw h;a.location.assign(u)}i&&c&&c({action:l,location:y.location,delta:1})},replace:function(e,t){l="REPLACE";let r=f(y.location,e,t);n&&n(r,e),d=m();let s=g(r,d),a=y.createHref(r);o.replaceState(s,"",a),i&&c&&c({action:l,location:y.location,delta:0})},go:e=>o.go(e)};return y}new WeakMap;function v(e,t){return w(e,t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:"/",!1)}function w(e,t,n,r){let s=M(("string"===typeof t?b(t):t).pathname||"/",n);if(null==s)return null;let a=j(e);!function(e){e.sort((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){let n=e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n]);return n?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)))}(a);let i=null;for(let o=0;null==i&&o<a.length;++o){let e=L(s);i=I(a[o],e,r)}return i}function j(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",s=(e,s,a)=>{let i={relativePath:void 0===a?e.path||"":a,caseSensitive:!0===e.caseSensitive,childrenIndex:s,route:e};i.relativePath.startsWith("/")&&(h(i.relativePath.startsWith(r),'Absolute route path "'.concat(i.relativePath,'" nested under path "').concat(r,'" is not valid. An absolute child route path must start with the combined path of all its parent routes.')),i.relativePath=i.relativePath.slice(r.length));let o=z([r,i.relativePath]),l=n.concat(i);e.children&&e.children.length>0&&(h(!0!==e.index,'Index routes must not have child routes. Please remove all child routes from route path "'.concat(o,'".')),j(e.children,t,l,o)),(null!=e.path||e.index)&&t.push({path:o,score:_(o,e.index),routesMeta:l})};return e.forEach((e,t)=>{var n;if(""!==e.path&&null!==(n=e.path)&&void 0!==n&&n.includes("?"))for(let r of N(e.path))s(e,t,r);else s(e,t)}),t}function N(e){let t=e.split("/");if(0===t.length)return[];let[n,...r]=t,s=n.endsWith("?"),a=n.replace(/\?$/,"");if(0===r.length)return s?[a,""]:[a];let i=N(r.join("/")),o=[];return o.push(...i.map(e=>""===e?a:[a,e].join("/"))),s&&o.push(...i),o.map(t=>e.startsWith("/")&&""===t?"/":t)}var k=/^:[\w-]+$/,A=3,S=2,E=1,C=10,T=-2,P=e=>"*"===e;function _(e,t){let n=e.split("/"),r=n.length;return n.some(P)&&(r+=T),t&&(r+=S),n.filter(e=>!P(e)).reduce((e,t)=>e+(k.test(t)?A:""===t?E:C),r)}function I(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],{routesMeta:r}=e,s={},a="/",i=[];for(let o=0;o<r.length;++o){let e=r[o],l=o===r.length-1,c="/"===a?t:t.slice(a.length)||"/",d=D({path:e.relativePath,caseSensitive:e.caseSensitive,end:l},c),u=e.route;if(!d&&l&&n&&!r[r.length-1].route.index&&(d=D({path:e.relativePath,caseSensitive:e.caseSensitive,end:!1},c)),!d)return null;
2Object.assign(s,d.params),i.push({params:s,pathname:z([a,d.pathname]),pathnameBase:V(z([a,d.pathnameBase])),route:u}),"/"!==d.pathnameBase&&(a=z([a,d.pathnameBase]))}return i}function D(e,t){"string"===typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=R(e.path,e.caseSensitive,e.end),s=t.match(n);if(!s)return null;let a=s[0],i=a.replace(/(.)\/+$/,"$1"),o=s.slice(1);return{params:r.reduce((e,t,n)=>{let{paramName:r,isOptional:s}=t;if("*"===r){let e=o[n]||"";i=a.slice(0,a.length-e.length).replace(/(.)\/+$/,"$1")}const l=o[n];return e[r]=s&&!l?void 0:(l||"").replace(/%2F/g,"/"),e},{}),pathname:a,pathnameBase:i,pattern:e}}function R(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];p("*"===e||!e.endsWith("*")||e.endsWith("/*"),'Route path "'.concat(e,'" will be treated as if it were "').concat(e.replace(/\*$/,"/*"),'" because the `*` character must always follow a `/` in the pattern. To get rid of this warning, please change the route path to "').concat(e.replace(/\*$/,"/*"),'".'));let r=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(e,t,n)=>(r.push({paramName:t,isOptional:null!=n}),n?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),s+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":""!==e&&"/"!==e&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),r]}function L(e){try{return e.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(t){return p(!1,'The URL path "'.concat(e,'" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (').concat(t,").")),e}}function M(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&"/"!==r?null:e.slice(n)||"/"}function O(e,t,n,r){return"Cannot include a '".concat(e,"' character in a manually specified `to.").concat(t,"` field [").concat(JSON.stringify(r),"]. Please separate it out to the `to.").concat(n,'` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.')}function F(e){return e.filter((e,t)=>0===t||e.route.path&&e.route.path.length>0)}function U(e){let t=F(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function B(e,t,n){let r,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3];"string"===typeof e?r=b(e):(r=(0,s.A)({},e),h(!r.pathname||!r.pathname.includes("?"),O("?","pathname","search",r)),h(!r.pathname||!r.pathname.includes("#"),O("#","pathname","hash",r)),h(!r.search||!r.search.includes("#"),O("#","search","hash",r)));let i,o=""===e||""===r.pathname,l=o?"/":r.pathname;if(null==l)i=n;else{let e=t.length-1;if(!a&&l.startsWith("..")){let t=l.split("/");for(;".."===t[0];)t.shift(),e-=1;r.pathname=t.join("/")}i=e>=0?t[e]:"/"}let c=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/",{pathname:n,search:r="",hash:s=""}="string"===typeof e?b(e):e,a=n?n.startsWith("/")?n:function(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(e=>{".."===e?n.length>1&&n.pop():"."!==e&&n.push(e)}),n.length>1?n.join("/"):"/"}(n,t):t;return{pathname:a,search:q(r),hash:W(s)}}(r,i),d=l&&"/"!==l&&l.endsWith("/"),u=(o||"."===l)&&n.endsWith("/");return c.pathname.endsWith("/")||!d&&!u||(c.pathname+="/"),c}var z=e=>e.join("/").replace(/\/\/+/g,"/"),V=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),q=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",W=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";function H(e){return null!=e&&"number"===typeof e.status&&"string"===typeof e.statusText&&"boolean"===typeof e.internal&&"data"in e}var G=["POST","PUT","PATCH","DELETE"],Y=(new Set(G),["GET",...G]);new Set(Y),Symbol("ResetLoaderData");var K=e.createContext(null);K.displayName="DataRouter";var J=e.createContext(null);J.displayName="DataRouterState";var $=e.createContext({isTransitioning:!1});$.displayName="ViewTransition";var Q=e.createContext(new Map);Q.displayName="Fetchers";var X=e.createContext(null);X.displayName="Await";var Z=e.createContext(null);Z.displayName="Navigation";var ee=e.createContext(null);ee.displayName="Location";var te=e.createContext({outlet:null,matches:[],isDataRoute:!1});te.displayName="Route";var ne=e.createContext(null);ne.displayName="RouteError";function re(){return null!=e.useContext(ee)}function se(){return h(re(),"useLocation() may be used only in the context of a <Router> component."),e.useContext(ee).location}var ae="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function ie(t){e.useContext(Z).static||e.useLayoutEffect(t)}function oe(){let{isDataRoute:t}=e.useContext(te);return t?function(){let{router:t}=xe("useNavigate"),n=ye("useNavigate"),r=e.useRef(!1);ie(()=>{r.current=!0});let a=e.useCallback(async function(e){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};p(r.current,ae),r.current&&("number"===typeof e?t.navigate(e):await t.navigate(e,(0,s.A)({fromRouteId:n},a)))},[t,n]);return a}():function(){h(re(),"useNavigate() may be used only in the context of a <Router> component.");let t=e.useContext(K),{basename:n,navigator:r}=e.useContext(Z),{matches:s}=e.useContext(te),{pathname:a}=se(),i=JSON.stringify(U(s)),o=e.useRef(!1);ie(()=>{o.current=!0});let l=e.useCallback(function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(p(o.current,ae),!o.current)return;if("number"===typeof e)return void r.go(e);let l=B(e,JSON.parse(i),a,"path"===s.relative);null==t&&"/"!==n&&(l.pathname="/"===l.pathname?n:z([n,l.pathname])),(s.replace?r.replace:r.push)(l,s.state,s)},[n,r,i,a,t]);return l}()}e.createContext(null);function le(){let{matches:t}=e.useContext(te),n=t[t.length-1];return n?n.params:{}}function ce(t){let{relative:n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{matches:r}=e.useContext(te),{pathname:s}=se(),a=JSON.stringify(U(r));return e.useMemo(()=>B(t,JSON.parse(a),s,"path"===n),[t,a,s,n])}function de(t,n,r,a){h(re(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i,static:o}=e.useContext(Z),{matches:l}=e.useContext(te),c=l[l.length-1],d=c?c.params:{},u=c?c.pathname:"/",m=c?c.pathnameBase:"/",g=c&&c.route;{let e=g&&g.path||"";je(u,!g||e.endsWith("*")||e.endsWith("*?"),'You rendered descendant <Routes> (or called `useRoutes()`) at "'.concat(u,'" (under <Route path="').concat(e,'">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won\'t match anymore and therefore the child routes will never render.\n\nPlease change the parent <Route path="').concat(e,'"> to <Route path="').concat("/"===e?"*":"".concat(e,"/*"),'">.'))}let f,x=se();if(n){var y;let e="string"===typeof n?b(n):n;h("/"===m||(null===(y=e.pathname)||void 0===y?void 0:y.startsWith(m)),'When overriding the location using `<Routes location>` or `useRoutes(routes, location)`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "'.concat(m,'" but pathname "').concat(e.pathname,'" was given in the `location` prop.')),f=e}else f=x;let w=f.pathname||"/",j=w;if("/"!==m){let e=m.replace(/^\//,"").split("/");j="/"+w.replace(/^\//,"").split("/").slice(e.length).join("/")}let N=!o&&r&&r.matches&&r.matches.length>0?r.matches:v(t,{pathname:j});p(g||null!=N,'No routes matched location "'.concat(f.pathname).concat(f.search).concat(f.hash,'" ')),p(null==N||void 0!==N[N.length-1].route.element||void 0!==N[N.length-1].route.Component||void 0!==N[N.length-1].route.lazy,'Matched leaf route at location "'.concat(f.pathname).concat(f.search).concat(f.hash,'" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.'));let k=ge(N&&N.map(e=>Object.assign({},e,{params:Object.assign({},d,e.params),pathname:z([m,i.encodeLocation?i.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?m:z([m,i.encodeLocation?i.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])})),l,r,a);return n&&k?e.createElement(ee.Provider,{value:{location:(0,s.A)({pathname:"/",search:"",hash:"",state:null,key:"default"},f),navigationType:"POP"}},k):k}function ue(){let t=ve(),n=H(t)?"".concat(t.status," ").concat(t.statusText):t instanceof Error?t.message:JSON.stringify(t),r=t instanceof Error?t.stack:null,s="rgba(200,200,200, 0.5)",a={padding:"0.5rem",backgroundColor:s},i={padding:"2px 4px",backgroundColor:s},o=null;return console.error("Error handled by React Router default ErrorBoundary:",t),o=e.createElement(e.Fragment,null,e.createElement("p",null,"\ud83d\udcbf Hey developer \ud83d\udc4b"),e.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",e.createElement("code",{style:i},"ErrorBoundary")," or"," ",e.createElement("code",{style:i},"errorElement")," prop on your route.")),e.createElement(e.Fragment,null,e.createElement("h2",null,"Unexpected Application
2Error!"),e.createElement("h3",{style:{fontStyle:"italic"}},n),r?e.createElement("pre",{style:a},r):null,o)}var me=e.createElement(ue,null),he=class extends e.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:void 0!==e.error?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return void 0!==this.state.error?e.createElement(te.Provider,{value:this.props.routeContext},e.createElement(ne.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function pe(t){let{routeContext:n,match:r,children:s}=t,a=e.useContext(K);return a&&a.static&&a.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=r.route.id),e.createElement(te.Provider,{value:n},s)}function ge(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(null==t){if(!r)return null;if(r.errors)t=r.matches;else{if(0!==n.length||r.initialized||!(r.matches.length>0))return null;t=r.matches}}let s=t,a=null===r||void 0===r?void 0:r.errors;if(null!=a){let e=s.findIndex(e=>e.route.id&&void 0!==(null===a||void 0===a?void 0:a[e.route.id]));h(e>=0,"Could not find a matching route for errors on route IDs: ".concat(Object.keys(a).join(","))),s=s.slice(0,Math.min(s.length,e+1))}let i=!1,o=-1;if(r)for(let e=0;e<s.length;e++){let t=s[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(o=e),t.route.id){let{loaderData:e,errors:n}=r,a=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!n||void 0===n[t.route.id]);if(t.route.lazy||a){i=!0,s=o>=0?s.slice(0,o+1):[s[0]];break}}}return s.reduceRight((t,l,c)=>{let d,u=!1,m=null,h=null;r&&(d=a&&l.route.id?a[l.route.id]:void 0,m=l.route.errorElement||me,i&&(o<0&&0===c?(je("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),u=!0,h=null):o===c&&(u=!0,h=l.route.hydrateFallbackElement||null)));let p=n.concat(s.slice(0,c+1)),g=()=>{let n;return n=d?m:u?h:l.route.Component?e.createElement(l.route.Component,null):l.route.element?l.route.element:t,e.createElement(pe,{match:l,routeContext:{outlet:t,matches:p,isDataRoute:null!=r},children:n})};return r&&(l.route.ErrorBoundary||l.route.errorElement||0===c)?e.createElement(he,{location:r.location,revalidation:r.revalidation,component:m,error:d,children:g(),routeContext:{outlet:null,matches:p,isDataRoute:!0}}):g()},null)}function fe(e){return"".concat(e," must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.")}function xe(t){let n=e.useContext(K);return h(n,fe(t)),n}function be(t){let n=e.useContext(J);return h(n,fe(t)),n}function ye(t){let n=function(t){let n=e.useContext(te);return h(n,fe(t)),n}(t),r=n.matches[n.matches.length-1];return h(r.route.id,"".concat(t,' can only be used on routes that contain a unique "id"')),r.route.id}function ve(){var t;let n=e.useContext(ne),r=be("useRouteError"),s=ye("useRouteError");return void 0!==n?n:null===(t=r.errors)||void 0===t?void 0:t[s]}var we={};function je(e,t,n){t||we[e]||(we[e]=!0,p(!1,n))}e.memo(function(e){let{routes:t,future:n,state:r}=e;return de(t,void 0,r,n)});function Ne(t){let{to:n,replace:r,state:s,relative:a}=t;h(re(),"<Navigate> may be used only in the context of a <Router> component.");let{static:i}=e.useContext(Z);p(!i,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:o}=e.useContext(te),{pathname:l}=se(),c=oe(),d=B(n,U(o),l,"path"===a),u=JSON.stringify(d);return e.useEffect(()=>{c(JSON.parse(u),{replace:r,state:s,relative:a})},[c,u,a,r,s]),null}function ke(e){h(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function Ae(t){let{basename:n="/",children:r=null,location:s,navigationType:a="POP",navigator:i,static:o=!1}=t;h(!re(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let l=n.replace(/^\/*/,"/"),c=e.useMemo(()=>({basename:l,navigator:i,static:o,future:{}}),[l,i,o]);"string"===typeof s&&(s=b(s));
2let{pathname:d="/",search:u="",hash:m="",state:g=null,key:f="default"}=s,x=e.useMemo(()=>{let e=M(d,l);return null==e?null:{location:{pathname:e,search:u,hash:m,state:g,key:f},navigationType:a}},[l,d,u,m,g,f,a]);return p(null!=x,'<Router basename="'.concat(l,'"> is not able to match the URL "').concat(d).concat(u).concat(m,"\" because it does not start with the basename, so the <Router> won't render anything.")),null==x?null:e.createElement(Z.Provider,{value:c},e.createElement(ee.Provider,{children:r,value:x}))}function Se(e){let{children:t,location:n}=e;return de(Ee(t),n)}e.Component;function Ee(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=[];return e.Children.forEach(t,(t,s)=>{if(!e.isValidElement(t))return;let a=[...n,s];if(t.type===e.Fragment)return void r.push.apply(r,Ee(t.props.children,a));h(t.type===ke,"[".concat("string"===typeof t.type?t.type:t.type.name,"] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>")),h(!t.props.index||!t.props.children,"An index route cannot have child routes.");let i={id:t.props.id||a.join("-"),caseSensitive:t.props.caseSensitive,element:t.props.element,Component:t.props.Component,index:t.props.index,path:t.props.path,loader:t.props.loader,action:t.props.action,hydrateFallbackElement:t.props.hydrateFallbackElement,HydrateFallback:t.props.HydrateFallback,errorElement:t.props.errorElement,ErrorBoundary:t.props.ErrorBoundary,hasErrorBoundary:!0===t.props.hasErrorBoundary||null!=t.props.ErrorBoundary||null!=t.props.errorElement,shouldRevalidate:t.props.shouldRevalidate,handle:t.props.handle,lazy:t.props.lazy};t.props.children&&(i.children=Ee(t.props.children,a)),r.push(i)}),r}var Ce="get",Te="application/x-www-form-urlencoded";function Pe(e){return null!=e&&"string"===typeof e.tagName}function _e(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return new URLSearchParams("string"===typeof e||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(e=>[n,e]):[[n,r]])},[]))}var Ie=null;var De=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Re(e){return null==e||De.has(e)?e:(p(!1,'"'.concat(e,'" is not a valid `encType` for `<Form>`/`<fetcher.Form>` and will default to "').concat(Te,'"')),null)}function Le(e,t){let n,r,s,a,i;if(Pe(o=e)&&"form"===o.tagName.toLowerCase()){let i=e.getAttribute("action");r=i?M(i,t):null,n=e.getAttribute("method")||Ce,s=Re(e.getAttribute("enctype"))||Te,a=new FormData(e)}else if(function(e){return Pe(e)&&"button"===e.tagName.toLowerCase()}(e)||function(e){return Pe(e)&&"input"===e.tagName.toLowerCase()}(e)&&("submit"===e.type||"image"===e.type)){let i=e.form;if(null==i)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let o=e.getAttribute("formaction")||i.getAttribute("action");if(r=o?M(o,t):null,n=e.getAttribute("formmethod")||i.getAttribute("method")||Ce,s=Re(e.getAttribute("formenctype"))||Re(i.getAttribute("enctype"))||Te,a=new FormData(i,e),!function(){if(null===Ie)try{new FormData(document.createElement("form"),0),Ie=!1}catch(e){Ie=!0}return Ie}()){let{name:t,type:n,value:r}=e;if("image"===n){let e=t?"".concat(t,"."):"";a.append("".concat(e,"x"),"0"),a.append("".concat(e,"y"),"0")}else t&&a.append(t,r)}}else{if(Pe(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Ce,r=null,s=Te,i=e}var o;return a&&"text/plain"===s&&(i=a,a=void 0),{action:r,method:n.toLowerCase(),encType:s,formData:a,body:i}}function Me(e,t){if(!1===e||null===e||"undefined"===typeof e)throw new Error(t)}async function Oe(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error("Error loading route module `".concat(e.module,"`, reloading page...")),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Fe(e){return null!=e&&"string"===typeof e.page}function Ue(e){return null!=e&&(null==e.href?"preload"===e.rel&&"string"===typeof e.imageSrcSet&&"string"===typeof e.imageSizes:"string"===typeof e.rel&&"string"===typeof e.href)}function Be(e,t,n,r,s,a){let i=(e,t)=>!n[t]||e.route.id!==n[t].route.id,o=(e,t)=>{var r;return n[t].pathname!==e.pathname||(null===(r=n[t].route.path)||void 0===r?void 0:r.endsWith("*"))&&n[t].params["*"]!==e.params["*"]};return"assets"===a?t.filter((e,t)=>
2i(e,t)||o(e,t)):"data"===a?t.filter((t,a)=>{let l=r.routes[t.route.id];if(!l||!l.hasLoader)return!1;if(i(t,a)||o(t,a))return!0;if(t.route.shouldRevalidate){var c;let r=t.route.shouldRevalidate({currentUrl:new URL(s.pathname+s.search+s.hash,window.origin),currentParams:(null===(c=n[0])||void 0===c?void 0:c.params)||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if("boolean"===typeof r)return r}return!0}):[]}function ze(e,t){let{includeHydrateFallback:n}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return r=e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let s=[r.module];return r.clientActionModule&&(s=s.concat(r.clientActionModule)),r.clientLoaderModule&&(s=s.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(s=s.concat(r.hydrateFallbackModule)),r.imports&&(s=s.concat(r.imports)),s}).flat(1),[...new Set(r)];var r}function Ve(e,t){let n=new Set,r=new Set(t);return e.reduce((e,s)=>{if(t&&!Fe(s)&&"script"===s.as&&s.href&&r.has(s.href))return e;let a=JSON.stringify(function(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}(s));return n.has(a)||(n.add(a),e.push({key:a,link:s})),e},[])}function qe(e){return{__html:e}}Symbol("SingleFetchRedirect");var We=new Set([100,101,204,205]);function He(e,t){let n="string"===typeof e?new URL(e,"undefined"===typeof window?"server://singlefetch/":window.location.origin):e;return"/"===n.pathname?n.pathname="_root.data":t&&"/"===M(n.pathname,t)?n.pathname="".concat(t.replace(/\/$/,""),"/_root.data"):n.pathname="".concat(n.pathname.replace(/\/$/,""),".data"),n}e.Component;function Ge(t){let{error:n,isOutsideRemixApp:r}=t;console.error(n);let s,a=e.createElement("script",{dangerouslySetInnerHTML:{__html:'\n console.log(\n "\ud83d\udcbf Hey developer \ud83d\udc4b. You can provide a way better UX than this when your app throws errors. Check out https://remix.run/guides/errors for more information."\n );\n '}});if(H(n))return e.createElement(Ye,{title:"Unhandled Thrown Response!"},e.createElement("h1",{style:{fontSize:"24px"}},n.status," ",n.statusText),a);if(n instanceof Error)0;else{let e=null==n?"Unknown Error":"object"===typeof n&&"toString"in n?n.toString():JSON.stringify(n);new Error(e)}return e.createElement(Ye,{title:"Application Error!",isOutsideRemixApp:r},e.createElement("h1",{style:{fontSize:"24px"}},"Application Error"),e.createElement("pre",{style:{padding:"2rem",background:"hsla(10, 50%, 50%, 0.1)",color:"red",overflow:"auto"}},s.stack),a)}function Ye(t){var n;let{title:r,renderScripts:s,isOutsideRemixApp:a,children:i}=t,{routeModules:o}=Xe();return null!==o.root&&void 0!==n&&n.Layout&&!a?i:e.createElement("html",{lang:"en"},e.createElement("head",null,e.createElement("meta",{charSet:"utf-8"}),e.createElement("meta",{name:"viewport",content:"width=device-width,initial-scale=1,viewport-fit=cover"}),e.createElement("title",null,r)),e.createElement("body",null,e.createElement("main",{style:{fontFamily:"system-ui, sans-serif",padding:"2rem"}},i,s?e.createElement(at,null):null)))}function Ke(e){return!0===e}function Je(){let t=e.useContext(K);return Me(t,"You must render this element inside a <DataRouterContext.Provider> element"),t}function $e(){let t=e.useContext(J);return Me(t,"You must render this element inside a <DataRouterStateContext.Provider> element"),t}var Qe=e.createContext(void 0);function Xe(){let t=e.useContext(Qe);return Me(t,"You must render this element inside a <HydratedRouter> element"),t}function Ze(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function et(e,t,n){if(n&&!st)return[e[0]];if(t){let n=e.findIndex(e=>void 0!==t[e.route.id]);return e.slice(0,n+1)}return e}function tt(t){let{page:n}=t,a=(0,r.A)(t,i),{router:o}=Je(),l=e.useMemo(()=>v(o.routes,n,o.basename),[o.routes,n,o.basename]);return l?e.createElement(rt,(0,s.A)({page:n,matches:l},a)):null}function nt(t){let{manifest:n,routeModules:r}=Xe(),[a,i]=e.useState([]);return e.useEffect(()=>{let e=!1;return async function(e,t,n){return Ve((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];
2if(r){let e=await Oe(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(Ue).filter(e=>"stylesheet"===e.rel||"preload"===e.rel).map(e=>"stylesheet"===e.rel?(0,s.A)((0,s.A)({},e),{},{rel:"prefetch",as:"style"}):(0,s.A)((0,s.A)({},e),{},{rel:"prefetch"})))}(t,n,r).then(t=>{e||i(t)}),()=>{e=!0}},[t,n,r]),a}function rt(t){let{page:n,matches:a}=t,i=(0,r.A)(t,o),l=se(),{manifest:c,routeModules:d}=Xe(),{basename:u}=Je(),{loaderData:m,matches:h}=$e(),p=e.useMemo(()=>Be(n,a,h,c,l,"data"),[n,a,h,c,l]),g=e.useMemo(()=>Be(n,a,h,c,l,"assets"),[n,a,h,c,l]),f=e.useMemo(()=>{if(n===l.pathname+l.search+l.hash)return[];let e=new Set,t=!1;if(a.forEach(n=>{var r;let s=c.routes[n.route.id];s&&s.hasLoader&&(!p.some(e=>e.route.id===n.route.id)&&n.route.id in m&&null!==(r=d[n.route.id])&&void 0!==r&&r.shouldRevalidate||s.hasClientLoader?t=!0:e.add(n.route.id))}),0===e.size)return[];let r=He(n,u);return t&&e.size>0&&r.searchParams.set("_routes",a.filter(t=>e.has(t.route.id)).map(e=>e.route.id).join(",")),[r.pathname+r.search]},[u,m,l,c,p,a,n,d]),x=e.useMemo(()=>ze(g,c),[g,c]),b=nt(g);return e.createElement(e.Fragment,null,f.map(t=>e.createElement("link",(0,s.A)({key:t,rel:"prefetch",as:"fetch",href:t},i))),x.map(t=>e.createElement("link",(0,s.A)({key:t,rel:"modulepreload",href:t},i))),b.map(t=>{let{key:n,link:r}=t;return e.createElement("link",(0,s.A)({key:n},r))}))}Qe.displayName="FrameworkContext";var st=!1;function at(t){let{manifest:n,serverHandoffString:i,isSpaMode:o,ssr:l,renderMeta:c}=Xe(),{router:d,static:u,staticContext:m}=Je(),{matches:h}=$e(),p=Ke(l);c&&(c.didRenderScripts=!0);let g=et(h,null,o);e.useEffect(()=>{0},[]);let f=e.useMemo(()=>{var o;let l=m?"window.__reactRouterContext = ".concat(i,";").concat("window.__reactRouterContext.stream = new ReadableStream({start(controller){window.__reactRouterContext.streamController = controller;}}).pipeThrough(new TextEncoderStream());"):" ",c=u?"".concat(null!==n.hmr&&void 0!==o&&o.runtime?"import ".concat(JSON.stringify(n.hmr.runtime),";"):"").concat(p?"":"import ".concat(JSON.stringify(n.url)),";\n").concat(g.map((e,t)=>{let r="route".concat(t),s=n.routes[e.route.id];Me(s,"Route ".concat(e.route.id," not found in manifest"));let{clientActionModule:a,clientLoaderModule:i,clientMiddlewareModule:o,hydrateFallbackModule:l,module:c}=s,d=[...a?[{module:a,varName:"".concat(r,"_clientAction")}]:[],...i?[{module:i,varName:"".concat(r,"_clientLoader")}]:[],...o?[{module:o,varName:"".concat(r,"_clientMiddleware")}]:[],...l?[{module:l,varName:"".concat(r,"_HydrateFallback")}]:[],{module:c,varName:"".concat(r,"_main")}];return 1===d.length?"import * as ".concat(r," from ").concat(JSON.stringify(c),";"):[d.map(e=>"import * as ".concat(e.varName,' from "').concat(e.module,'";')).join("\n"),"const ".concat(r," = {").concat(d.map(e=>"...".concat(e.varName)).join(","),"};")].join("\n")}).join("\n"),"\n ").concat(p?"window.__reactRouterManifest = ".concat(JSON.stringify(function(e,t){let{sri:n}=e,i=(0,r.A)(e,a),o=new Set(t.state.matches.map(e=>e.route.id)),l=t.state.location.pathname.split("/").filter(Boolean),c=["/"];for(l.pop();l.length>0;)c.push("/".concat(l.join("/"))),l.pop();c.forEach(e=>{let n=v(t.routes,e,t.basename);n&&n.forEach(e=>o.add(e.route.id))});let d=[...o].reduce((e,t)=>Object.assign(e,{[t]:i.routes[t]}),{});return(0,s.A)((0,s.A)({},i),{},{routes:d,sri:!!n||void 0})}(n,d),null,2),";"):"","\n window.__reactRouterRouteModules = {").concat(g.map((e,t)=>"".concat(JSON.stringify(e.route.id),":route").concat(t)).join(","),"};\n\nimport(").concat(JSON.stringify(n.entry.module),");"):" ";return e.createElement(e.Fragment,null,e.createElement("script",(0,s.A)((0,s.A)({},t),{},{suppressHydrationWarning:!0,dangerouslySetInnerHTML:qe(l),type:void 0})),e.createElement("script",(0,s.A)((0,s.A)({},t),{},{suppressHydrationWarning:!0,dangerouslySetInnerHTML:qe(c),type:"module",async:!0})))},[]),x=st?[]:(n.entry.imports.concat(ze(g,n,{includeHydrateFallback:!0})),[...new Set(b)]);var b;let y="object"===typeof n.sri?n.sri:{};return st?null:e.createElement(e.Fragment,null,"object"===typeof n.sri?e.createElement("script",{"rr-importmap":"",type:"importmap",suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:JSON.stringify({integrity:y})}}):null,p?null:e.createElement("link",{rel:"modulepreload",href:n.url,crossOrigin:t.crossOrigin,integrity:y[n.url],suppressHydrationWarning:!0}),e.createElement("link",{rel:"modulepreload",href:n.entry.module,crossOrigin:t.crossOrigin,integrity:y[n.entry.module],suppressHydrationWarning:!0}),x.map(n=>e.createElement("link",{key:n,rel:"modulepreload",href:n,crossOrigin:t.crossOrigin,integrity:y[n],suppressHydrationWarning:!0})),f)}function it(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return e=>{t.forEach(t=>{"function"===typeof t?t(e):null!=t&&(t.current=e)})}}var ot="undefined"!==typeof window&&"undefined"!==typeof window.document&&"undefined"!==typeof window.document.createElement;try{ot&&(window.__reactRouterVersion="7.5.3")}catch(Nd){}function lt(t){let{basename:n,children:r,window:s}=t,a=e.useRef();null==a.current&&(a.current=m({window:s,v5Compat:!0}));let i=a.current,[o,l]=e.useState({action:i.action,location:i.location}),c=e.useCallback(t=>
2{e.startTransition(()=>l(t))},[l]);return e.useLayoutEffect(()=>i.listen(c),[i,c]),e.createElement(Ae,{basename:n,children:r,location:o.location,navigationType:o.action,navigator:i})}var ct=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,dt=e.forwardRef(function(t,n){let a,{onClick:i,discover:o="render",prefetch:c="none",relative:d,reloadDocument:u,replace:m,state:g,target:f,to:b,preventScrollReset:y,viewTransition:v}=t,w=(0,r.A)(t,l),{basename:j}=e.useContext(Z),N="string"===typeof b&&ct.test(b),k=!1;if("string"===typeof b&&N&&(a=b,ot))try{let e=new URL(window.location.href),t=b.startsWith("//")?new URL(e.protocol+b):new URL(b),n=M(t.pathname,j);t.origin===e.origin&&null!=n?b=n+t.search+t.hash:k=!0}catch(Nd){p(!1,'<Link to="'.concat(b,'"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.'))}let A=function(t){let{relative:n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};h(re(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:s}=e.useContext(Z),{hash:a,pathname:i,search:o}=ce(t,{relative:n}),l=i;return"/"!==r&&(l="/"===i?r:z([r,i])),s.createHref({pathname:l,search:o,hash:a})}(b,{relative:d}),[S,E,C]=function(t,n){let r=e.useContext(Qe),[s,a]=e.useState(!1),[i,o]=e.useState(!1),{onFocus:l,onBlur:c,onMouseEnter:d,onMouseLeave:u,onTouchStart:m}=n,h=e.useRef(null);e.useEffect(()=>{if("render"===t&&o(!0),"viewport"===t){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return h.current&&e.observe(h.current),()=>{e.disconnect()}}},[t]),e.useEffect(()=>{if(s){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[s]);let p=()=>{a(!0)},g=()=>{a(!1),o(!1)};return r?"intent"!==t?[i,h,{}]:[i,h,{onFocus:Ze(l,p),onBlur:Ze(c,g),onMouseEnter:Ze(d,p),onMouseLeave:Ze(u,g),onTouchStart:Ze(m,p)}]:[!1,h,{}]}(c,w),T=function(t){let{target:n,replace:r,state:s,preventScrollReset:a,relative:i,viewTransition:o}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},l=oe(),c=se(),d=ce(t,{relative:i});return e.useCallback(e=>{if(function(e,t){return 0===e.button&&(!t||"_self"===t)&&!function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e)}(e,n)){e.preventDefault();let n=void 0!==r?r:x(c)===x(d);l(t,{replace:n,state:s,preventScrollReset:a,relative:i,viewTransition:o})}},[c,l,d,r,s,n,t,a,i,o])}(b,{replace:m,state:g,target:f,preventScrollReset:y,relative:d,viewTransition:v});let P=e.createElement("a",(0,s.A)((0,s.A)((0,s.A)({},w),C),{},{href:a||A,onClick:k||u?i:function(e){i&&i(e),e.defaultPrevented||T(e)},ref:it(n,E),target:f,"data-discover":N||"render"!==o?void 0:"true"}));return S&&!N?e.createElement(e.Fragment,null,P,e.createElement(tt,{page:A})):P});dt.displayName="Link",e.forwardRef(function(t,n){let{"aria-current":a="page",caseSensitive:i=!1,className:o="",end:l=!1,style:d,to:u,viewTransition:m,children:p}=t,g=(0,r.A)(t,c),f=ce(u,{relative:g.relative}),x=se(),b=e.useContext(J),{navigator:y,basename:v}=e.useContext(Z),w=null!=b&&function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.useContext($);h(null!=r,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:s}=ht("useViewTransitionState"),a=ce(t,{relative:n.relative});if(!r.isTransitioning)return!1;let i=M(r.currentLocation.pathname,s)||r.currentLocation.pathname,o=M(r.nextLocation.pathname,s)||r.nextLocation.pathname;return null!=D(a.pathname,o)||null!=D(a.pathname,i)}(f)&&!0===m,j=y.encodeLocation?y.encodeLocation(f).pathname:f.pathname,N=x.pathname,k=b&&b.navigation&&b.navigation.location?b.navigation.location.pathname:null;i||(N=N.toLowerCase(),k=k?k.toLowerCase():null,j=j.toLowerCase()),k&&v&&(k=M(k,v)||k);const A="/"!==j&&j.endsWith("/")?j.length-1:j.length;let S,E=N===j||!l&&N.startsWith(j)&&"/"===N.charAt(A),C=null!=k&&(k===j||!l&&k.startsWith(j)&&"/"===k.charAt(j.length)),T={isActive:E,isPending:C,isTransitioning:w},P=E?a:void 0;S="function"===typeof o?o(T):[o,E?"active":null,C?"pending":null,w?"transitioning":null].filter(
2Boolean).join(" ");let _="function"===typeof d?d(T):d;return e.createElement(dt,(0,s.A)((0,s.A)({},g),{},{"aria-current":P,className:S,ref:n,style:_,to:u,viewTransition:m}),"function"===typeof p?p(T):p)}).displayName="NavLink";var ut=e.forwardRef((t,n)=>{let{discover:a="render",fetcherKey:i,navigate:o,reloadDocument:l,replace:c,state:u,method:m=Ce,action:p,onSubmit:g,relative:f,preventScrollReset:b,viewTransition:y}=t,v=(0,r.A)(t,d),w=xt(),j=function(t){let{relative:n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{basename:r}=e.useContext(Z),a=e.useContext(te);h(a,"useFormAction must be used inside a RouteContext");let[i]=a.matches.slice(-1),o=(0,s.A)({},ce(t||".",{relative:n})),l=se();if(null==t){o.search=l.search;let e=new URLSearchParams(o.search),t=e.getAll("index");if(t.some(e=>""===e)){e.delete("index"),t.filter(e=>e).forEach(t=>e.append("index",t));let n=e.toString();o.search=n?"?".concat(n):""}}t&&"."!==t||!i.route.index||(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index");"/"!==r&&(o.pathname="/"===o.pathname?r:z([r,o.pathname]));return x(o)}(p,{relative:f}),N="get"===m.toLowerCase()?"get":"post",k="string"===typeof p&&ct.test(p);return e.createElement("form",(0,s.A)((0,s.A)({ref:n,method:N,action:j,onSubmit:l?g:e=>{if(g&&g(e),e.defaultPrevented)return;e.preventDefault();let t=e.nativeEvent.submitter,n=(null===t||void 0===t?void 0:t.getAttribute("formmethod"))||m;w(t||e.currentTarget,{fetcherKey:i,method:n,navigate:o,replace:c,state:u,relative:f,preventScrollReset:b,viewTransition:y})}},v),{},{"data-discover":k||"render"!==a?void 0:"true"}))});function mt(e){return"".concat(e," must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.")}function ht(t){let n=e.useContext(K);return h(n,mt(t)),n}function pt(t){p("undefined"!==typeof URLSearchParams,"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let n=e.useRef(_e(t)),r=e.useRef(!1),s=se(),a=e.useMemo(()=>function(e,t){let n=_e(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}(s.search,r.current?null:n.current),[s.search]),i=oe(),o=e.useCallback((e,t)=>{const n=_e("function"===typeof e?e(a):e);r.current=!0,i("?"+n,t)},[i,a]);return[a,o]}ut.displayName="Form";var gt=0,ft=()=>"__".concat(String(++gt),"__");function xt(){let{router:t}=ht("useSubmit"),{basename:n}=e.useContext(Z),r=ye("useRouteId");return e.useCallback(async function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{action:a,method:i,encType:o,formData:l,body:c}=Le(e,n);if(!1===s.navigate){let e=s.fetcherKey||ft();await t.fetch(e,r,s.action||a,{preventScrollReset:s.preventScrollReset,formData:l,body:c,formMethod:s.method||i,formEncType:s.encType||o,flushSync:s.flushSync})}else await t.navigate(s.action||a,{preventScrollReset:s.preventScrollReset,formData:l,body:c,formMethod:s.method||i,formEncType:s.encType||o,replace:s.replace,state:s.state,fromRouteId:r,flushSync:s.flushSync,viewTransition:s.viewTransition})},[t,n,r])}new TextEncoder;var bt=n(362),yt=n(791),vt=n(472);const wt="https://api.cc.email/v3",jt={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_DEBUG:"true",REACT_APP_EMAILJS_PUBLIC_KEY:"your-emailjs-public-key",REACT_APP_EMAILJS_SERVICE_ID:"your-emailjs-service-id",REACT_APP_EMAILJS_TEMPLATE_ID:"your-emailjs-template-id",REACT_APP_ENVIRONMENT:"development",REACT_APP_FIREBASE_API_KEY:"AIzaSyCldlZuqyf25VFuTgRkQH5lVo-ohxE9P6E",REACT_APP_FIREBASE_APP_ID:"1:462477660480:web:cf4338dd149dec6670eaa5",REACT_APP_FIREBASE_AUTH_DOMAIN:"the-apn.firebaseapp.com",REACT_APP_FIREBASE_MESSAGING_SENDER_ID:"462477660480",REACT_APP_FIREBASE_PROJECT_ID:"the-apn",REACT_APP_FIREBASE_STORAGE_BUCKET:"the-apn.firebasestorage.app",REACT_APP_LINKEDIN_CLIENT_ID:"your-linkedin-client-id",REACT_APP_PAYPAL_CLIENT_ID:"AdMd2uVTb0FcGkk2mFpxkMVcDCCC-a3plmioVusIdWjNP3IX48gijhJomgPpg9vBZEmhirZ4odOX38p7",REACT_APP_PAYPAL_CLIENT_ID_LIVE:"AVxmacawl8XsTAt73wWVAZLbojvCkdYAWijaO6E4juw3iAZNEk6Ddk_k6DKo7qLLpdVS6rQa_PjYlMUi",REACT_APP_STRIPE_PUBLISHABLE_KEY:"pk_live_51Kr8J3Ec8kNP7Yp7Tu6erT0Ti9b2qUuacRAPc8kfvjV7nxACrPfmoeGuU8wkIJIOptmFCoCkqW2rAPbAc35Zu2Kg00T0uBJJAv"}.REACT_APP_CONSTANT_CONTACT_ACCESS_TOKEN,Nt=()=>({Authorization:"Bearer ".concat(jt),"Content-Type":"application/json","Cache-Control":"no-cache"}),kt={ALL_MEMBERS:"all_members",TIER_1:"tier_1_members",TIER_2:"tier_2_members",TIER_3:"tier_3_members",TIER_4:"tier_4_members",TIER_V:"tier_v_members",NEWSLETTER:"newsletter_subscribers",EVENT_UPDATES:"event_updates",JOB_ALERTS:"job_alerts",PROJECT_ALERTS:"project_alerts"},At=async e=>{try{const t={email_address:{address:e.email,permission_to_send:"implicit"},first_name:e.firstName||"",last_name:e.lastName||"",job_title:e.jobTitle||"",company_name:e.company||"",phone_numbers:e.phone?[{phone_number:e.phone,kind:"work"}]:[],custom_fields:[{custom_field_id:"membership_tier",value:e.membershipTier||""},{custom_field_id:"member_since",value:e.memberSince||""},{custom_field_id:"chapter",value:e.chapter||""}],list_memberships:e.lists||[kt.ALL_MEMBERS]},n=await fetch("".concat(wt,"/contacts"),{method:"POST",headers:Nt(),body:JSON.stringify(t)});if(!n.ok)throw new Error("Constant Contact API error: ".concat(n.status));return await n.json()}catch(t){throw console.error("Error adding contact to Constant Contact:",t),t}},St=async e=>{try{const t={name:e.name,email_campaign_activities:[{format_type:5,from_name:"Accelerated Professionals Network",from_email:"[email protected]",reply_to_email:"[email protected]",subject:e.subject,html_content:e.htmlContent,contact_list_ids:e.listIds||[kt.ALL_MEMBERS]}]},n=await fetch("".concat(wt,"/emails"),{method:"POST",headers:Nt(),body:JSON.stringify(t)});if(!n.ok)throw new Error("Error creating campaign: ".concat(n.status));return await n.json()}catch(t){throw console.error("Error creating email campaign:",t),t}},Et=async e=>{try{const t=await fetch("".concat(wt,"/emails/activities/").concat(e,"/schedules"),{method:"POST",headers:Nt(),body:JSON.stringify({sc
2heduled_date:(new Date).toISOString()})});if(!t.ok)throw new Error("Error sending campaign: ".concat(t.status));return await t.json()}catch(t){throw console.error("Error sending email campaign:",t),t}},Ct=async e=>{try{const t={email:e.email,firstName:e.firstName,lastName:e.lastName,jobTitle:e.jobTitle,company:e.company,phone:e.phone,membershipTier:e.membershipTier,memberSince:e.memberSince,chapter:e.chapter,lists:[kt.ALL_MEMBERS,"tier1"===e.membershipTier?kt.TIER_1:"tier2"===e.membershipTier?kt.TIER_2:"tier3"===e.membershipTier?kt.TIER_3:"tier4"===e.membershipTier?kt.TIER_4:"tierUSV"===e.membershipTier?kt.TIER_V:kt.ALL_MEMBERS].filter(Boolean)};return await At(t)}catch(t){throw console.error("Error syncing member to Constant Contact:",t),t}},Tt=async function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;try{const r='\n <div style="font-family: Arial, sans-serif; max-width: 600px; margin: 0 auto;">\n <div style="background-color: #3d67ad; color: white; padding: 20px; text-align: center;">\n <h1>Accelerated Professionals Network</h1>\n </div>\n <div style="padding: 20px;">\n <h2>'.concat(e,'</h2>\n <div style="line-height: 1.6;">').concat(t.replace(/\n/g,"<br>"),"</div>\n ").concat(n?'\n <div style="text-align: center; margin: 30px 0;">\n <a href="'.concat(n,'" style="background-color: #3d67ad; color: white; padding: 12px 24px; text-decoration: none; border-radius: 5px; display: inline-block;">\n Learn More\n </a>\n </div>\n '):"",'\n </div>\n <div style="background-color: #f5f5f5; padding: 15px; text-align: center; font-size: 12px; color: #666;">\n <p>You received this email because you are a member of APN.</p>\n <p>\xa9 Accelerated Professionals Network | All rights reserved.</p>\n </div>\n </div>\n '),s=await St({name:"APN Announcement: ".concat(e),subject:"APN Announcement: ".concat(e),htmlContent:r,listIds:[kt.ALL_MEMBERS]}),a=await Et(s.campaign_id);return{success:!0,campaignId:s.campaign_id,result:a}}catch(r){throw console.error("Error sending announcement via Constant Contact:",r),r}},Pt={suspiciousUserAgents:[/bot/i,/crawler/i,/spider/i,/scraper/i,/headless/i,/phantom/i,/selenium/i,/puppeteer/i,/playwright/i,/automated/i],maxActionsPerMinute:30,maxFailedLogins:5,minTimeBetweenActions:100,maxFormSubmissionSpeed:2e3,requiredFeatures:["localStorage","sessionStorage","indexedDB","WebGL","canvas"]};const _t=new class{constructor(){this.userActions=new Map,this.suspiciousUsers=new Set,this.blockedUsers=new Set}trackAction(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=Date.now();this.userActions.has(e)||this.userActions.set(e,{actions:[],firstAction:r,lastAction:r,actionCount:0,failedLogins:0,suspiciousScore:0});const s=this.userActions.get(e);s.actions.push({type:t,timestamp:r,metadata:n}),s.lastAction=r,s.actionCount++,this.analyzeBehavior(e)}analyzeBehavior(e){const t=this.userActions.get(e);if(!t)return;let n=0;const r=t.actions.filter(e=>Date.now()-e.timestamp<6e4);r.length>Pt.maxActionsPerMinute&&(n+=30);const s=r.slice(1).map((e,t)=>e.timestamp-r[t].timestamp),a=s.reduce((e,t)=>e+t,0)/s.length;a<Pt.minTimeBetweenActions&&(n+=25),t.failedLogins>Pt.maxFailedLogins&&(n+=40),t.suspiciousScore=n,n>50&&this.suspiciousUsers.add(e),n>80&&(this.blockedUsers.add(e),this.flagUserAsBot(e,n))}async flagUserAsBot(e,t){try{await(0,vt.updateDoc)((0,vt.doc)(yt.db,"users",e),{botDetection:{flagged:!0,suspiciousScore:t,flaggedAt:(0,vt.serverTimestamp)(),reason:"Automated behavior detected"},status:"suspended"})}catch(n){console.error("Error flagging user as bot:",n)}}isUserBlocked(e){return this.blockedUsers.has(e)}isUserSuspicious(e){return this.suspiciousUsers.has(e)}getUserSuspiciousScore(e){const t=this.userActions.get(e);return t?t.suspiciousScore:0}},It=()=>{const e={userAgent:navigator.userAgent||"",isHeadless:!1,hasRequiredFeatures:!0,suspiciousUserAgent:!1,webDriver:!1,phantom:!1,hasMouseMovement:!1,hasKeyboardInput
2:!1,screenResolution:"".concat(window.screen.width||0,"x").concat(window.screen.height||0),timezone:Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC",language:navigator.language||"en-US",cookiesEnabled:navigator.cookieEnabled||!1,javaEnabled:!!navigator.javaEnabled&&navigator.javaEnabled()};e.isHeadless=!!(!window.outerHeight||!window.outerWidth||navigator.webdriver||window.navigator.webdriver||window.callPhantom||window._phantom||window.phantom),e.suspiciousUserAgent=Pt.suspiciousUserAgents.some(e=>e.test(navigator.userAgent||"")),e.webDriver=!!(navigator.webdriver||window.navigator.webdriver||document.documentElement&&document.documentElement.getAttribute("webdriver")),e.phantom=!(!window.callPhantom&&!window._phantom),e.hasRequiredFeatures=!!(window.localStorage&&window.sessionStorage&&window.indexedDB&&window.WebSocket&&document.createElement);e.suspiciousResolution=["0x0","1x1","800x600"].includes(e.screenResolution);try{e.hasRequiredFeatures=Pt.requiredFeatures.every(e=>{switch(e){case"localStorage":return"undefined"!==typeof Storage&&!!window.localStorage;case"sessionStorage":return"undefined"!==typeof Storage&&!!window.sessionStorage;case"indexedDB":return!!window.indexedDB;case"WebGL":try{return!(!window.WebGLRenderingContext||!document.createElement("canvas").getContext("webgl"))}catch(Nd){return!1}case"canvas":try{return!!document.createElement("canvas").getContext}catch(Nd){return!1}default:return!0}})}catch(Nd){e.hasRequiredFeatures=!1}return e},Dt=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;const t=It(),n=Rt(t),r={isBot:n>70,botScore:n,checks:t,timestamp:(new Date).toISOString(),userId:e};return e&&_t.trackAction(e,"bot_detection_check",r),r},Rt=e=>{let t=0;return e.isHeadless&&(t+=40),e.suspiciousUserAgent&&(t+=30),e.webDriver&&(t+=35),e.phantom&&(t+=40),e.hasRequiredFeatures||(t+=25),Math.min(t,100)},Lt=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=e&&e.length>10;return t&&_t.trackAction(t,"captcha_verification",{success:n,response:(null===e||void 0===e?void 0:e.substring(0,10))+"..."}),{success:n,score:n?.9:.1,timestamp:(new Date).toISOString()}},Mt=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(_t.trackAction(e,t?"login_success":"login_failed",n),!t){const t=_t.userActions.get(e);t&&t.failedLogins++}},Ot=async e=>{if(_t.isUserBlocked(e))throw new Error("User has been blocked due to suspicious activity")};const Ft=new class{constructor(){this.interactions=new Map,this.setupEventListeners()}setupEventListeners(){document.addEventListener("mousemove",e=>{this.recordInteraction("mouse_move",{x:e.clientX,y:e.clientY})}),document.addEventListener("click",e=>{this.recordInteraction("click",{x:e.clientX,y:e.clientY,target:e.target.tagName})}),document.addEventListener("keydown",e=>{this.recordInteraction("keydown",{key:e.key,code:e.code})}),document.addEventListener("scroll",()=>{this.recordInteraction("scroll",{scrollY:window.scrollY})}),document.addEventListener("focus",e=>{this.recordInteraction("focus",{target:e.target.tagName})},!0)}recordInteraction(e,t){const n=this.getCurrentUserId();if(!n)return;this.interactions.has(n)||this.interactions.set(n,[]);const r=this.interactions.get(n);r.push({type:e,data:t,timestamp:Date.now()}),r.length>100&&r.shift()}getCurrentUserId(){return window.currentUserId||null}getHumanScore(e){const t=this.interactions.get(e)||[];if(0===t.length)return 0;let n=0;const r=Date.now(),s=t.filter(e=>r-e.timestamp<3e5);n+=10*new Set(s.map(e=>e.type)).size;s.filter(e=>"mouse_move"===e.type).length>10&&(n+=20);s.filter(e=>"keydown"===e.type).length>5&&(n+=15);return s.filter(e=>"scroll"===e.type).length>3&&(n+=10),Math.min(n,100)}isHumanBehavior(e){return this.getHumanScore(e)>30}},Ut=e=>{window.currentUserId=e},Bt={TIER1:{id:"tier1",name:"Tier 1",price:75,priceId:"price_tier1_annual",description:"Analysts & Associates with less than three years of experience (also referred to as recent undergraduates).",features:[],duration:"annual"},TIER2:{id:"tier2",name:"Tier 2",price:125,priceId:"price_tier2_annual",description:"Analysts & Associates with more than three years of experience.",features:[],duration:"annual"},TIER3:{id:"tier3",name:"Tier 3",price:175,priceId:"price_tier3_annual",description:"Managers, VP's, Directors, and Managing Directors.",features:[],duration:"annual"},TIER4:{id:"tier4",name:"Tier 4",price:225,priceId:"price_tier4_annual",description:"C-suite Executives, Principals, Partners, and Business Owners.",features:[],duration:"annual"},TIERUSV:{id:"tierUSV",name:"Tier USV",price:75,priceId:"price_tierUSV_annual",description:"US Veterans, regardless of seniority level.",features:[],duration:"annual"}},zt={EARLYBIRD2025:{type:"percentage",value:100,description:"Early Adopter Free Membership",validUntil:"2025-12-31",maxUses:100,membershipOnly:!0,badge:"founding-member"},FOUNDING2025:{type:"percentage",value:100,description:"Founding Member Free Access",validUntil:"2025-12-31",maxUses:50,membershipOnly:!0,badge:"founding-member"},TESTER2025:{type:"percentage",value:100,description:"Beta Tester Free Membership",validUntil:"2025-12-31",maxUses:25,membershipOnly:!0,badge:"founding-member"},FREEEVENT:{type:"percentage",value:100,description:"Free Event Access",validUntil:"2025-12-31",maxUses:1e3,eventOnly:!0},ADMIN100:{type:"percentage",value:100,description:"Admin Free Access",validUntil:"2025-12-31",maxUses:999},ADMIN10:{type:"percentage",value:10,description:"10% admin discount",validUntil:"2026-12-31",maxUses:null,membershipOnly:!1,eventOnly:!0},SPONSORS25:{type:"percentage",value:25,description:"25% sponsor discount",validUntil:"2026-12-31",maxUses:null,membershipOnly:!1,eventOnly:!0},RELAUNCH20:{type:"percentage",value:20,description:"20% event special discount",validUntil:"2026-12-31",maxUses:null,membershipOnly:!1,eventOnly:!0}},Vt=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"membership";try{const n=qt(e,t);if(n.valid)return n;const r="https://us-central1-the-apn.cloudfunctions.net/validateDiscountCodeEndpoint",s=await fetch(r,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:e.toUpperCase(),type:t})}),a=await s.json();return s.ok?{valid:!0,discount:a.discount,discountAmount:a.discountAmount,discountType:a.discountType}:{valid:!1,error:a.error||"Invalid discount code"}}catch(n){return console.error("Error validating discount code, falling back to client-side validation:",n),qt(e,t)}},qt=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"membership";const n=zt[e.toUpperCase()];if(!n)return{valid:!1,error:"Invalid discount code"};
2if(n.membershipOnly&&"membership"!==t)return{valid:!1,error:"This discount code is only valid for memberships"};if(n.eventOnly&&"event"!==t)return{valid:!1,error:"This discount code is only valid for events"};return new Date>new Date(n.validUntil)?{valid:!1,error:"Discount code has expired"}:{valid:!0,discount:n,discountAmount:n.value,discountType:n.type}},Wt=(e,t,n)=>"percentage"===n?e*(1-t/100):"fixed"===n?Math.max(0,e-t):e,Ht=["caroline burnham","caroline agouras","nicholas agouras","nick agouras","helix agouras"];function Gt(e,t,n,r){let s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"signup";const a=(e||"").trim().toLowerCase(),i="".concat(t||""," ").concat(n||""," ").concat(r||"").toLowerCase();if(a.endsWith("@the-apn.com"))throw console.warn("[SECURITY] signup rejected:",{check:"A-".concat(s),email:a,name:i,timestamp:(new Date).toISOString()}),new Error("This email domain is reserved for APN staff. Please sign up with your business email.");if(Ht.some(e=>i.includes(e)))throw console.warn("[SECURITY] signup rejected:",{check:"B-".concat(s),email:a,name:i,timestamp:(new Date).toISOString()}),new Error("This name cannot be used for registration. Please contact APN staff directly if you believe this is an error.")}const Yt={GUEST:"guest",PENDING:"pending",MEMBER:"member",VIP_MEMBER:"vip_member",ADMIN:"admin",SUPER_ADMIN:"super_admin",CHAPTER_PRESIDENT:"chapter_president",AMBASSADOR:"ambassador"},Kt={[Yt.GUEST]:["view_public_content","register_account"],[Yt.PENDING]:["view_public_content","view_pending_status"],[Yt.MEMBER]:["view_public_content","view_member_content","access_member_directory","join_groups","post_in_groups","register_for_events","apply_to_jobs","apply_to_projects"],[Yt.VIP_MEMBER]:["view_public_content","view_member_content","view_vip_content","access_member_directory","join_groups","post_in_groups","create_groups","register_for_events","apply_to_jobs","apply_to_projects","post_jobs","post_projects"],[Yt.CHAPTER_PRESIDENT]:["view_public_content","view_member_content","view_vip_content","access_member_directory","join_groups","post_in_groups","create_groups","moderate_groups","register_for_events","create_events","manage_chapter_events","apply_to_jobs","apply_to_projects","post_jobs","post_projects"],[Yt.ADMIN]:["view_public_content","view_member_content","view_vip_content","view_admin_content","access_member_directory","manage_users","approve_members","join_groups","post_in_groups","create_groups","moderate_groups","delete_groups","register_for_events","create_events","manage_all_events","apply_to_jobs","apply_to_projects","post_jobs","post_projects","moderate_content","access_analytics"],[Yt.SUPER_ADMIN]:["all_permissions"]},Jt=async function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;try{var r;let c={isBot:!1,botScore:0};try{c=await Dt()}catch(s){console.warn("Bot detection skipped:",s.message)}if(c.isBot&&c.botScore>80)throw new Error("Automated access detected. Please try again from a regular browser.");if(n)try{(await Lt(n)).success||console.warn("CAPTCHA verification failed, proceeding anyway")}catch(a){console.warn("CAPTCHA check skipped:",a.message)}const d=(await(0,bt.x9)(yt.j2,e,t)).user;try{await Ot(d.uid)}catch(i){console.warn("Bot block check skipped:",i.message)}const u=await(0,vt.x7)((0,vt.doc)(yt.db,"users",d.uid)),m=u.exists()?u.data():null,h="[email protected]"===e.toLowerCase()||"[email protected]"===e.toLowerCase();if(!m){if(h){const t={uid:d.uid,email:e.toLowerCase(),displayName:d.displayName||"Admin",role:"admin",status:"approved",memberSince:(0,vt.serverTimestamp)(),createdAt:(0,vt.serverTimestamp)(),updatedAt:(0,vt.serverTimestamp)(),loginCount:1,lastLogin:(0,vt.serverTimestamp)()};return await(0,vt.BN)((0,vt.doc)(yt.db,"users",d.uid),t),{user:d,userData:t,requiresAdditionalVerification:!1}}throw await(0,bt.CI)(yt.j2),new Error("Account not found. Please register first.")}if("approved"!==m.status&&!h){if("pending"===m.status)throw await(0,bt.CI)(yt.j2),new Error("Your account is pending approval. You will receive an email once approved.");
2if("suspended"===m.status)throw await(0,bt.CI)(yt.j2),new Error("Your account has been suspended. Please contact support.");throw await(0,bt.CI)(yt.j2),new Error("Account access denied. Please contact support.")}if(null!==(r=m.botDetection)&&void 0!==r&&r.flagged&&!h)throw await(0,bt.CI)(yt.j2),new Error("Account has been flagged for review. Please contact support.");try{Mt(d.uid,!0,{botScore:c.botScore,captchaUsed:!!n})}catch(o){console.warn("Login tracking skipped:",o.message)}try{await(0,vt.updateDoc)((0,vt.doc)(yt.db,"users",d.uid),{lastLogin:(0,vt.serverTimestamp)(),loginCount:(m.loginCount||0)+1})}catch(l){console.warn("Login count update skipped:",l.message)}return{user:d,userData:m,requiresAdditionalVerification:!1}}catch(c){try{if("auth/user-not-found"!==c.code){const t="temp_".concat(e.replace("@","_").replace(".","_"));Mt(t,!1,{error:c.message,email:e})}}catch(o){}throw c}},$t=async function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};try{const o=await Dt();if(o.isBot&&o.botScore>80)throw new Error("Automated registration detected. Please verify you are human.");if(t){if(!(await Lt(t)).success)throw new Error("CAPTCHA verification failed. Please try again.")}if(!e.email||"string"!==typeof e.email)throw new Error("Valid email is required for registration.");const l=e.email.trim().toLowerCase();if(console.log("\ud83d\udd0d Registration attempt for email:",l),Gt(l,e.firstName,e.lastName,e.displayName,"register"),e.discountCode&&String(e.discountCode).trim()){const t=String(e.discountCode).trim().toUpperCase();if(!zt[t])throw console.warn("[SECURITY] signup rejected:",{check:"C",email:l,code:t,timestamp:(new Date).toISOString()}),new Error("Invalid discount code. Please click 'Apply' to validate your code, or leave the field blank.")}const c=(0,vt.query)((0,vt.collection)(yt.db,"users"),(0,vt.where)("email","==",l)),d=await(0,vt.getDocs)(c);if(console.log("\ud83d\udd0d Firestore check - existing users found:",d.size),!d.empty)throw console.log("\u274c User exists in Firestore"),new Error("An account with this email already exists.");let u;console.log("\u2705 Email not found in Firestore, proceeding to Firebase Auth...");try{console.log("\ud83d\udd0d Attempting to create Firebase Auth user..."),u=await(0,bt.eJ)(yt.j2,l,e.password),console.log("\u2705 Firebase Auth user created successfully")}catch(a){if(console.log("\u274c Firebase Auth error:",a.code,a.message),"auth/email-already-in-use"!==a.code)throw a;if(!d.empty)throw console.log("\ud83d\udd0d User exists in both Auth and Firestore"),new Error("An account with this email already exists. Please try logging in instead.");console.log("\ud83d\udd0d Orphaned auth user detected - exists in Auth but not Firestore"),console.log("\ud83d\udd27 Attempting to sign in to existing auth user and create Firestore profile...");try{const t=await(0,bt.x9)(yt.j2,l,e.password);console.log("\u2705 Successfully signed in to existing auth user"),u=t}catch(i){throw console.log("\u274c Failed to sign in to existing auth user:",i.message),new Error("This email exists in Firebase Auth but the password doesn't match. Please try logging in or use password reset. If you believe this is an error, please contact support.")}}const m=u.user;await(0,bt.r7)(m,{displayName:"".concat(e.firstName," ").concat(e.lastName)});const h=e=>{if(!e||"object"!==typeof e)return{};const t={};for(const[n,r]of Object.entries(e))void 0!==r&&null!==r&&("object"!==typeof r||Array.isArray(r)?t[n]=r:t[n]=h(r));return t},p=!1,g=(0,s.A)((0,s.A)({},e),{},{uid:m.uid,email:l,role:p?Yt.MEMBER:Yt.PENDING,status:p?"approved":"pending",memberSince:p?(0,vt.serverTimestamp)():null,createdAt:(0,vt.serverTimestamp)(),updatedAt:(0,vt.serverTimestamp)(),loginCount:0,botDetection:{registrationBotScore:o.botScore||0,registrationChecks:h(o.checks||{}),flagged:!1},securityFlags:{requiresAdditionalVerification:(o.botScore||0)>30,lastSecurityCheck:(0,vt.serverTimestamp)()}});if(delete g.password,await(0,vt.BN)((0,vt.doc)(yt.db,"users",m.uid),g),!p)try{const{notifyAdminsNewUser:t}=await Promise.resolve().then(n.bind(n,823));await t(e.displayName||"".concat(e.firstName," ").concat(e.lastName),l)}catch(a){console.error("Error notifying admins about new user:",a)}return p||r.keepSession||await(0,bt.CI)(yt.j2),{success:!0,message:p?"Registration successful! Welc
2ome to APN!":"Registration successful! Your account is pending approval.",userId:m.uid,autoApproved:p}}catch(a){throw a}},Qt=(e,t)=>{if(!e||!t)return!1;const n=Kt[e]||[];return!!n.includes("all_permissions")||n.includes(t)},Xt=(e,t)=>t.some(t=>Qt(e,t)),Zt=(e,t)=>{const n={[Yt.GUEST]:0,[Yt.PENDING]:1,[Yt.MEMBER]:2,[Yt.VIP_MEMBER]:3,[Yt.CHAPTER_PRESIDENT]:4,[Yt.ADMIN]:5,[Yt.SUPER_ADMIN]:6};return(n[e]||0)>=(n[t]||0)},en=async()=>{try{return await(0,bt.CI)(yt.j2),sessionStorage.clear(),{success:!0}}catch(e){throw e}},tn=async e=>{try{var t;if(!e)return{valid:!1,reason:"No user session"};const n=await(0,vt.x7)((0,vt.doc)(yt.db,"users",e.uid)),r=n.exists()?n.data():null;return r?"suspended"===r.status?{valid:!1,reason:"Account suspended. Please contact support."}:null!==(t=r.botDetection)&&void 0!==t&&t.flagged?{valid:!1,reason:"Account flagged for suspicious activity"}:{valid:!0,userData:r,requiresAdditionalVerification:!1}:{valid:!0,userData:null,requiresAdditionalVerification:!1}}catch(n){return console.warn("Session verification error (non-blocking):",n.message),{valid:!0,userData:null,requiresAdditionalVerification:!1}}};var nn=n(579);const rn=(0,e.createContext)();function sn(){return(0,e.useContext)(rn)}function an(t){let{children:n}=t;const[r,a]=(0,e.useState)(null),[i,o]=(0,e.useState)(null),[l,c]=(0,e.useState)(null),[d,u]=(0,e.useState)(!0),[m,h]=(0,e.useState)(null),[p,g]=(0,e.useState)(null),[f,x]=(0,e.useState)(!1),[b,y]=(0,e.useState)({});async function v(e){try{const t=await(0,vt.x7)((0,vt.doc)(yt.db,"users",e));t.exists()&&o((0,s.A)({id:t.id},t.data()));const n=await(0,vt.x7)((0,vt.doc)(yt.db,"memberships",e));n.exists()&&c((0,s.A)({id:n.id},n.data()))}catch(m){console.error("Error fetching user data:",m)}}async function w(){try{await en(),a(null),o(null),c(null),g(null),x(!1),y({}),h(null)}catch(m){throw console.error("Error signing out:",m),m}}function j(e){return Zt(null===i||void 0===i?void 0:i.role,e)}(0,e.useEffect)(()=>{const e=(0,bt.hg)(yt.j2,async e=>{if(a(e),e)try{Ut(e.uid),await v(e.uid),tn(e).then(e=>{if(!e.valid){const t=e.reason||"";t.includes("suspended")||t.includes("flagged")?(console.warn("Account issue detected:",t),(0,bt.CI)(yt.j2),h(t)):console.info("Session note:",t)}}).catch(e=>{console.warn("Session verification skipped:",e.message)})}catch(m){console.error("Error fetching user data:",m),o(null),c(null)}else Ut(null),o(null),c(null),g(null),x(!1),y({}),h(null);u(!1)});return e},[]);const N={currentUser:r,userProfile:i,membership:l,loading:d,error:m,signup:async function(e,t,n,r){let a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};try{const i=(0,s.A)((0,s.A)({},n),{},{email:e,password:t}),o=await $t(i,r,a);return Ct((0,s.A)((0,s.A)({},n),{},{email:e,memberSince:(new Date).toISOString()})).catch(e=>console.warn("CC sync skipped:",e.message)),o}catch(m){throw console.error("Error signing up:",m),h(m.message),m}},login:async function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;try{const r=await Jt(e,t,n);return a(r.user),o(r.userData),x(r.requiresAdditionalVerification),await v(r.user.uid),r}catch(m){throw console.error("Error signing in:",m),h(m.message),m}},loginWithGoogle:async function(){try{const t=new bt.HF;t.addScope("email"),t.addScope("profile");const n=await(0,bt.df)(yt.j2,t);if(!n.user.email)throw new Error("Unable to retrieve email from Google account. Please try again or use email signup.");if(!(await(0,vt.x7)((0,vt.doc)(yt.db,"users",n.user.uid))).exists()){const t=(n.user.displayName||"").split(" "),r=t[0]||"",s=t.slice(1).join(" ")||"";try{Gt(n.user.email,r,s,n.user.displayName||"","google")}catch(e){try{await(0,bt.CI)(yt.j2)}catch(uc){}try{await(0,bt.hG)(n.user)}catch(uc){}throw e}await(0,vt.BN)((0,vt.doc)(yt.db,"users",n.user.uid),{displayName:n.user.displayName||"",firstName:r,lastName:s,email:n.user.email,photoURL:n.user.photoURL||"",role:"pending",status:"pending",memberSince:null,createdAt:(0,vt.serverTimestamp)(),updatedAt:(0,vt.serverTimestamp)(),loginCount:0,company:"",jobTitle:"",phone:"",linkedinUrl:"",aboutMe:""})}return await v(n.user.uid),n}catch(m){throw console.error("Error signing in with Google:",m),"auth/popup-closed-by-user"===m.code?new Error("Google sign-in was cancelled. Please try again."):"auth/popup-blocked"===m.code?new Error("Pop-up was blocked by your browser. Please allow pop-ups and try again."):"auth/cancelled-popup-request"===m.code?new Error("Another sign-in attempt is in progress. Please wait and try again."):new Error("Failed to sign in with Google. Please try again or use email signup.")}},logout:w,resetPassword:function(e){return(0,bt.J1)(yt.j2,e)},updateUserProfile:async function(e,t){try{if(t.firstName||t.lastName||t.dis
2playName){const r=t.firstName||(null===i||void 0===i?void 0:i.firstName)||"",s=t.lastName||(null===i||void 0===i?void 0:i.lastName)||"",a=t.displayName||(null===i||void 0===i?void 0:i.displayName)||"",o=t.email||(null===i||void 0===i?void 0:i.email)||"";try{Gt(o,r,s,a,"profile-edit")}catch(n){throw console.warn("[SECURITY] profile edit rejected:",{check:"B-profile-edit",userId:e,timestamp:(new Date).toISOString()}),new Error("This name cannot be used. Please contact APN staff directly if you believe this is an error.")}}return await(0,vt.updateDoc)((0,vt.doc)(yt.db,"users",e),(0,s.A)((0,s.A)({},t),{},{updatedAt:(0,vt.serverTimestamp)()})),await v(e),!0}catch(m){throw console.error("Error updating user profile:",m),m}},fetchUserData:v,isActiveMember:function(){var e;if(!l)return!1;const t=new Date,n=null===(e=l.endDate)||void 0===e?void 0:e.toDate();return"active"===l.status&&n&&n>t},hasRole:j,performSecurityCheck:async function(){try{const e=await Dt(null===r||void 0===r?void 0:r.uid);if(g(e),r){const e=await tn(r);if(!e.valid)throw await w(),new Error(e.reason);x(e.requiresAdditionalVerification)}return e}catch(m){throw console.error("Security check failed:",m),m}},checkPermission:function(e){return Qt(null===i||void 0===i?void 0:i.role,e)},checkAnyPermission:function(e){return Xt(null===i||void 0===i?void 0:i.role,e)},checkRole:j,isAdmin:function(){return j(Yt.ADMIN)},isSuperAdmin:function(){return j(Yt.SUPER_ADMIN)},checkHumanBehavior:function(){return!!r&&(e=r.uid,Ft.isHumanBehavior(e));var e},getHumanScore:function(){return r?(e=r.uid,Ft.getHumanScore(e)):0;var e},botDetectionResult:p,requiresAdditionalVerification:f,securityFlags:b,USER_ROLES:Yt};return(0,nn.jsx)(rn.Provider,{value:N,children:!d&&n})}const on={TIER1:{id:"tier1",name:"Tier 1",price:75,priceId:"price_tier1_annual",description:"Analysts & Associates with less than three years of experience (also referred to as recent undergraduates).",features:[],duration:"annual"},TIER2:{id:"tier2",name:"Tier 2",price:125,priceId:"price_tier2_annual",description:"Analysts & Associates with more than three years of experience.",features:[],duration:"annual"},TIER3:{id:"tier3",name:"Tier 3",price:175,priceId:"price_tier3_annual",description:"Managers, VP's, Directors, and Managing Directors.",features:[],duration:"annual"},TIER4:{id:"tier4",name:"Tier 4",price:225,priceId:"price_tier4_annual",description:"C-suite Executives, Principals, Partners, and Business Owners.",features:[],duration:"annual"},TIERUSV:{id:"tierUSV",name:"Tier USV",price:75,priceId:"price_tierUSV_annual",description:"US Veterans, regardless of seniority level.",features:[],duration:"annual"}},ln=(0,e.createContext)(),cn=t=>{let{children:n}=t;const[r,s]=(0,e.useState)(on),[a,i]=(0,e.useState)(!1);(0,e.useEffect)(()=>{console.log("MembershipProvider: Initializing tiers"),console.log("Available tiers:",Object.keys(on)),s(on),i(!0)},[]);const o={membershipTiers:r,isLoaded:a,getTier:e=>r[e],getAllTiers:()=>r,getTierKeys:()=>Object.keys(r)};return(0,nn.jsx)(ln.Provider,{value:o,children:n})},dn=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"smooth";window.scrollTo({top:0,left:0,behavior:e})},un=function(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const r=se();(0,e.useEffect)(()=>{dn(t?"smooth":"auto")},[r.pathname,t,...n])},mn=e=>{const t=(e||"").trim();return t.length>200?"".concat(t.slice(0,200),"\u2026"):t},hn=(e,t)=>{const n=(0,vt.collection)(yt.db,"conversations"),r=(0,vt.query)(n,(0,vt.where)("participants","array-contains",e));return(0,vt.aQ)(r,e=>{const n=e.docs.map(e=>(0,s.A)({id:e.id},e.data()));n.sort((e,t)=>{var n,r;const s=null!==(n=e.lastMessageAt)&&void 0!==n&&n.toMillis?e.lastMessageAt.toMillis():0;return(null!==(r=t.lastMessageAt)&&void 0!==r&&r.toMillis?t.lastMessageAt.toMillis():0)-s}),t(n)})};var pn=n(823);const gn=()=>{const{currentUser:t}=sn(),[n,r]=(0,e.useState)([]),[a,i]=(0,e.useState)(0),[o,l]=(0,e.useState)(!1),[c,d]=(0,e.useState)(!1),u=(0,e.useRef)(null);(0,e.useEffect)(()=>
2{if(t){m(),h();const e=setInterval(()=>{h()},3e4);return()=>clearInterval(e)}},[t]),(0,e.useEffect)(()=>{const e=e=>{u.current&&!u.current.contains(e.target)&&l(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);const m=async()=>{if(t)try{d(!0);const e=await(0,pn.Ss)(t.uid,10);r(e)}catch(e){console.error("Error loading notifications:",e)}finally{d(!1)}},h=async()=>{if(t)try{const e=await(0,pn.ul)(t.uid);i(e)}catch(e){console.error("Error loading unread count:",e)}},p=e=>{if(!e)return"";const t=new Date,n=e.toDate?e.toDate():new Date(e),r=Math.floor((t-n)/6e4);if(r<1)return"Just now";if(r<60)return"".concat(r,"m ago");const s=Math.floor(r/60);if(s<24)return"".concat(s,"h ago");const a=Math.floor(s/24);return a<7?"".concat(a,"d ago"):n.toLocaleDateString()};return t?(0,nn.jsxs)("div",{className:"relative",ref:u,children:[(0,nn.jsxs)("button",{onClick:()=>{l(!o),o||m()},className:"relative p-2 text-gray-600 hover:text-gray-900 focus:outline-none focus:ring-2 focus:ring-apn-blue rounded-full",children:[(0,nn.jsx)("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9"})}),a>0&&(0,nn.jsx)("span",{className:"absolute -top-1 -right-1 bg-red-500 text-white text-xs rounded-full h-5 w-5 flex items-center justify-center",children:a>99?"99+":a})]}),o&&(0,nn.jsxs)("div",{className:"absolute right-0 mt-2 w-80 bg-white rounded-lg shadow-lg border border-gray-200 z-50",children:[(0,nn.jsxs)("div",{className:"px-4 py-3 border-b border-gray-200 flex justify-between items-center",children:[(0,nn.jsx)("h3",{className:"text-lg font-medium text-gray-900",children:"Notifications"}),a>0&&(0,nn.jsx)("button",{onClick:async()=>{try{await(0,pn.he)(t.uid),i(0),r(e=>e.map(e=>(0,s.A)((0,s.A)({},e),{},{read:!0})))}catch(e){console.error("Error marking all as read:",e)}},className:"text-sm text-apn-blue hover:text-blue-700",children:"Mark all read"})]}),(0,nn.jsx)("div",{className:"max-h-96 overflow-y-auto",children:c?(0,nn.jsxs)("div",{className:"p-4 text-center text-gray-500",children:[(0,nn.jsx)("div",{className:"animate-spin rounded-full h-6 w-6 border-t-2 border-b-2 border-apn-blue mx-auto"}),(0,nn.jsx)("p",{className:"mt-2",children:"Loading notifications..."})]}):0===n.length?(0,nn.jsxs)("div",{className:"p-4 text-center text-gray-500",children:[(0,nn.jsx)("svg",{className:"w-12 h-12 mx-auto mb-2 text-gray-300",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9"})}),(0,nn.jsx)("p",{children:"No notifications yet"})]}):n.map(e=>(0,nn.jsx)("div",{onClick:()=>(async e=>{try{var t,n,a;e.read||(await(0,pn.bA)(e.id),i(e=>Math.max(0,e-1)),r(t=>t.map(t=>t.id===e.id?(0,s.A)((0,s.A)({},t),{},{read:!0}):t)));let o=e.actionUrl;if(!o&&null!==(t=e.data)&&void 0!==t&&t.postingId&&null!==(n=e.data)&&void 0!==n&&n.postingType){const t="project"===e.data.postingType?"projects":"jobs";o="/".concat(t,"/").concat(e.data.postingId)}!o&&null!==(a=e.data)&&void 0!==a&&a.conversationId&&(o="/messages/".concat(e.data.conversationId)),o&&(window.location.href=o)}catch(o){console.error("Error handling notification click:",o)}})(e),className:"p-4 border-b border-gray-100 cursor-pointer hover:bg-gray-50 transition-colors ".concat(e.read?"":"bg-blue-50"),children:(0,nn.jsxs)("div",{className:"flex items-start space-x-3",children:[(0,nn.jsx)("div",{className:"flex-shrink-0 w-2 h-2 rounded-full mt-2 ".concat(e.read?"bg-gray-300":"bg-apn-blue")}),(0,nn.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,nn.jsx)("p",{className:"text-sm font-medium ".concat(e.read?"text-gray-600":"text-gray-900"),children:e.title}),(0,nn.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:e.message}),(0,nn.jsx)("p",{className:"text-xs text-gray-400 mt-1",children:p(e.createdAt)})]})]})},e.id))}),n.length>0&&(0,nn.jsx)("div",{className:"px-4 py-3 border-t border-gray-200 text-center",children:(0,nn.jsx)("button",{className:"text-sm text-apn-blue hover:text-blue-700",children:"View all notifications"})})]})]}):null},fn=(0,e.forwardRef)((t,n)=>{let{isLoggedIn:r,onLogout:s,onHeightChange:a}=t;const{hasRole:i,loading:o,currentUser:l}=sn(),[c,d]=(0,e.useState)(!1),[u,m]=(0,e.useState)(!1),[h,p]=(0,e.useState)(0),[g,f]=(0,e.useState)(!1),x=(0,e.useRef)(null),b=(0,e.useRef)(null),y=!o&&i("admin");(0,e.useEffect)(()=>{const e=()=>{window.scrollY>10?f(!0):f(!1)};return window.addEventListener("scroll",e),()=>{window.removeEventListener("scroll",e)}},[]),(0,e.useEffect)(()=>
2{if(b.current&&a){const e=new ResizeObserver(e=>{for(let t of e)a(t.target.offsetHeight)});return e.observe(b.current),()=>{e.disconnect()}}},[a]),(0,e.useEffect)(()=>{n&&(n.current=b.current)},[n]),(0,e.useEffect)(()=>{if(!r||!l)return void p(0);const e=hn(l.uid,e=>{const t=e.reduce((e,t)=>{var n;return e+((null===(n=t.unread)||void 0===n?void 0:n[l.uid])||0)},0);p(t)});return()=>e()},[r,l]);const v=()=>{m(!u)};return(0,nn.jsxs)("header",{ref:b,className:"bg-white shadow-md ".concat(g?"fixed top-0 left-0 right-0 z-50 animate-slideDown":""),children:[(0,nn.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:(0,nn.jsxs)("div",{className:"flex justify-between h-16",children:[(0,nn.jsxs)("div",{className:"flex",children:[(0,nn.jsx)("div",{className:"flex-shrink-0 flex items-center",children:(0,nn.jsx)(dt,{to:"/",className:"flex items-center",children:(0,nn.jsx)("img",{src:"".concat("","/apn-logos/APN-blue (1).png"),alt:"APN Logo",className:"h-8"})})}),(0,nn.jsxs)("nav",{className:"hidden sm:ml-6 sm:flex sm:items-center sm:space-x-6",children:[(0,nn.jsxs)("div",{className:"relative flex items-center h-16",ref:x,onMouseEnter:()=>{m(!0)},onMouseLeave:()=>{m(!1)},children:[(0,nn.jsxs)("button",{type:"button",onClick:v,className:"nav-link inline-flex items-center px-1 pt-1 border-b-2 border-transparent hover:border-apn-blue hover:text-apn-blue",children:["About Us",(0,nn.jsx)("svg",{className:"ml-2 h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),(0,nn.jsx)("div",{className:"absolute z-10 top-16 w-48 rounded-md shadow-lg bg-white ring-1 ring-black ring-opacity-5 transition-opacity duration-150 ".concat(u?"opacity-100":"opacity-0 invisible"),children:(0,nn.jsxs)("div",{className:"py-1",children:[(0,nn.jsx)(dt,{to:"/about/our-story",className:"block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100",children:"Our Story"}),(0,nn.jsx)(dt,{to:"/about/membership",className:"block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100",children:"Membership Information"}),(0,nn.jsx)(dt,{to:"/about/sponsorship",className:"block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100",children:"Sponsorship"}),(0,nn.jsx)(dt,{to:"/about/additional-services",className:"block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100",children:"Additional Services"}),(0,nn.jsx)(dt,{to:"/about/contact",className:"block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100",children:"Contact Us"})]})})]}),(0,nn.jsx)("div",{className:"flex items-center h-16",children:(0,nn.jsx)(dt,{to:"/events",className:"nav-link inline-flex items-center px-1 pt-1 border-b-2 border-transparent hover:border-apn-blue hover:text-apn-blue",children:"Events"})}),(0,nn.jsx)("div",{className:"flex items-center h-16",children:(0,nn.jsx)(dt,{to:"/news",className:"nav-link inline-flex items-center px-1 pt-1 border-b-2 border-transparent hover:border-apn-blue hover:text-apn-blue",children:"News"})}),r?(0,nn.jsxs)(nn.Fragment,{children:[(0,nn.jsx)("div",{className:"flex items-center h-16",children:(0,nn.jsx)(dt,{to:"/directory",className:"nav-link inline-flex items-center px-1 pt-1 border-b-2 border-transparent hover:border-apn-blue hover:text-apn-blue",children:"Member Directory"})}),(0,nn.jsx)("div",{className:"flex items-center h-16",children:(0,nn.jsx)(dt,{to:"/groups",className:"nav-link inline-flex items-center px-1 pt-1 border-b-2 border-transparent hover:border-apn-blue hover:text-apn-blue",children:"Groups"})}),(0,nn.jsx)("div",{className:"flex items-center h-16",children:(0,nn.jsx)(dt,{to:"/jobs",className:"nav-link inline-flex items-center px-1 pt-1 border-b-2 border-transparent hover:border-apn-blue hover:text-apn-blue",children:"Job Board"})}),(0,nn.jsx)("div",{className:"flex items-center h-16",children:(0,nn.jsx)(dt,{to:"/projects",className:"nav-link inline-flex items-center px-1 pt-1 border-b-2 border-transparent hover:border-apn-blue hover:text-apn-blue",children:"Project Board"})}),(0,nn.jsx)("div",{className:"flex items-center h-16",children:(0,nn.jsx)(dt,{to:"/my-postings",className:"nav-link inline-flex items-center px-1 pt-1 border-b-2 border-transparent hover:border-apn-blue hover:text-apn-blue",children:"My Postings"})}),(0,nn.jsx)("div",{className:"flex items-center h-16",children:(0,nn.jsxs)(dt,{to:"/messages",className:"nav-link relative inline-flex items-center px-1 pt-1 border-b-2 border-transparent hover:border-apn-blue hover:text-apn-blue",children:["Messages",h>0&&(0,nn.jsx)("span",{className:"absolute -top-0.5 -right-3 bg-red-500 text-white text-xs font-semibold rounded-full h-5 min-w-[1.25rem] px-1 flex items-center justify-center",children:h>99?"99+":h})]})})]}):null]})]}),(0,nn.jsx)("div",{className:"hidden sm:ml-6 sm:flex sm:items-center",children:r?(0,nn.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,nn.jsx)(gn,{}),y&&(0,nn.jsx)(dt,{to:"/admin",className:"nav-link text-red-600 font-medium",children:"Admin Dashboard"}),(0,nn.jsx)(dt,{to:"/profile",className:"nav-link",children:"Profile"}),(0,nn.jsx)("button",{onClick:s,className:"btn-secondary",children:"Logout"})]}):(0,nn.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,nn.jsx)(dt,{to:"/login",className:"nav-link",children:"Login"}),(0,nn.jsx)(dt,{to:"/register",className:"btn-primary",children:"Register"})]})}),(0,nn.jsx)("div",{className:"flex items-center sm:hidden",children:(0,nn.jsxs)("button",{onClick:()=>{d(!c)},className:"inline-flex items-center justify-center p-2 rounded-md text-gray-400 hover:text-apn-blue hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-apn-blue",children:[(0,nn.jsx)("span",{className:"sr-only",children:"Open main menu"}),c?(0,nn.jsx)("svg",{className:"block h-6 w-6",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 18L18 6M6 6l12 12"})}):(0,nn.jsx)("svg",{className:"block h-6 w-6",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M4 6h16M4 12h16M4 18h16"})})]})})]})}),c&&(0,nn.jsx)("div",{className:"sm:hidden",children:(0,nn.jsxs)("div",{className:"pt-2 pb-3 space-y-1",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("button",{onClick:v,className:"nav-link block pl-3 pr-4 py-2 border-l-4 border-transparent text-base font-medium",children:"About Us"}),u&&(0,nn.jsxs)("div",{className:"pl-6",children:[(0,nn.jsx)(dt,{to:"/about/our-story",className:"block pl-3 pr-4 py-2 border-l-4 border-transparent text-base font-medium text-gray-600 hover:bg-gray-50 hover:border-gray-300 hover:text-gray-800",children:"Our Story"}),(0,nn.jsx)(dt,{to:"/about/membership",className:"block pl-3 pr-4 py-2 border-l-4 border-transparent text-base font-medium text-gray-600 hover:bg-gray-50 hover:border-gray-300 hover:text-gray-800",children:"Membership Information"}),(0,nn.jsx)(dt,{to:"/about/sponsorship",className:"block pl-3 pr-4 py-2 border-l-4 border-transparent text-base font-medium text-gray-600 hover:bg-gray-50 hover:border-gray-300 hover:text-gray-800",children:"Sponsorship"}),(0,nn.jsx)(dt,{to:"/about/additional-services",className:"block pl-3 pr-4 py-2 border-l-4 border-transparent text-base font-medium text-gray-600 hover:bg-gray-50 hover:border-gray-300 hover:text-gray-800",children:"Additional Services"}),(0,nn.jsx)(dt,{to:"/about/contact",className:"block pl-3 pr-4 py-2 border-l-4 border-transparent text-base font-medium text-gray-600 hover:bg-gray-50 hover:border-gray-300 hover:text-gray-800",children:"Contact Us"})]})]}),(0,nn.jsx)(dt,{to:"/events",className:"nav-link block pl-3 pr-4 py-2 border-l-4 border-transparent text-base font-medium",children:"Events"}),(0,nn.jsx)(dt,{to:"/news",className:"nav-link block pl-3 pr-4 py-2 border-l-4 border-transparent text-base font-medium",children:"News"}),r?(0,nn.jsxs)(nn.Fragment,{children:[(0,nn.jsx)(dt,{to:"/directory",className:"nav-link block pl-3 pr-4 py-2 border-l-4 border-transparent text-base font-medium",children:"Member Directory"}),(0,nn.jsx)(dt,{to:"/groups",className:"nav-link block pl-3 pr-4 py-2 border-l-4 border-transparent text-base font-medium",children:"Groups"}),(0,nn.jsx)(dt,{to:"/jobs",className:"nav-link block pl-3 pr-4 py-2 border-l-4 border-transparent text-base font-medium",children:"Job Board"}),(0,nn.jsx)(dt,{to:"/projects",className:"nav-link block pl-3 pr-4 py-2 border-l-4 border-transparent text-base font-medium",children:"Project Board"}),(0,nn.jsx)(dt,{to:"/my-postings",className:"nav-link block pl-3 pr-4 py-2 border-l-4 border-transparent text-base font-medium",children:"My Postings"}),(0,nn.jsxs)(dt,{to:"/messages",className:"nav-link flex items-center gap-2 pl-3 pr-4 py-2 border-l-4 border-transparent text-base font-medium",children:[(0,nn.jsx)("span",{children:"Messages"}),h>0&&(0,nn.jsx)("span",{className:"bg-red-500 text-white text-xs font-semibold rounded-full h-5 min-w-[1.25rem] px-1 flex items-center justify-center",children:h>99?"99+":h})]}),(0,nn.jsx)(dt,{to:"/profile",className:"nav-link block pl-3 pr-4 py-2 border-l-4 border-transparent text-base font-medium",children:"Profile"}),(0,nn.jsx)("button",{onClick:s,className:"w-full text-left nav-link block pl-3 pr-4 py-2 border-l-4 border-transparent text-base font-medium",children:"Logout"})]}):(0,nn.jsxs)(nn.Fragment,{children:[(0,nn.jsx)(dt,{to:"/login",className:"nav-link block pl-3 pr-4 py-2 border-l-4 border-transparent text-base font-medium",children:"Login"}),(0,nn.jsx)(dt,{to:"/register",className:"nav-link block pl-3 pr-4 py-2 border-l-4 border-transparent text-base font-medium",children:"Register"})]})]})})]})}),xn=fn,bn=()=>(0,nn.jsx)("footer",{className:"bg-apn-blue text-white",children:(0,nn.jsxs)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12",children:[(0,nn.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-8",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("h3",{className:"text-lg font-semibold mb-4",children:"About APN"}),(0,nn.jsx)("p",{className:"text-gray-100 text-sm",children:"Accelerated Professionals Network is a community of finance professionals collaborating to create a more seamless M&A transaction process."})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("h3",{className:"text-lg font-semibold mb-4",children:"Qu
2ick Links"}),(0,nn.jsxs)("ul",{className:"space-y-2 text-sm",children:[(0,nn.jsx)("li",{children:(0,nn.jsx)(dt,{to:"/about/our-story",className:"text-gray-100 hover:text-white transition-colors",children:"Our Story"})}),(0,nn.jsx)("li",{children:(0,nn.jsx)(dt,{to:"/about/membership",className:"text-gray-100 hover:text-white transition-colors",children:"Membership Information"})}),(0,nn.jsx)("li",{children:(0,nn.jsx)(dt,{to:"/events",className:"text-gray-100 hover:text-white transition-colors",children:"Events"})}),(0,nn.jsx)("li",{children:(0,nn.jsx)(dt,{to:"/news",className:"text-gray-100 hover:text-white transition-colors",children:"News"})})]})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("h3",{className:"text-lg font-semibold mb-4",children:"Inside APN"}),(0,nn.jsxs)("ul",{className:"space-y-2 text-sm",children:[(0,nn.jsx)("li",{children:(0,nn.jsx)(dt,{to:"/events",className:"text-gray-100 hover:text-white transition-colors",children:"Events"})}),(0,nn.jsx)("li",{children:(0,nn.jsx)(dt,{to:"/events",className:"text-gray-100 hover:text-white transition-colors",children:"In-Person"})}),(0,nn.jsx)("li",{children:(0,nn.jsx)(dt,{to:"/events",className:"text-gray-100 hover:text-white transition-colors",children:"Virtual"})})]})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("h3",{className:"text-lg font-semibold mb-4",children:"Connect"}),(0,nn.jsxs)("ul",{className:"space-y-2 text-sm mb-4",children:[(0,nn.jsxs)("li",{className:"text-gray-100",children:[(0,nn.jsx)("strong",{children:"Caroline Burnham"})," \u2014 Founder & CEO",(0,nn.jsx)("br",{}),(0,nn.jsx)("a",{href:"mailto:[email protected]",className:"hover:text-white transition-colors",children:"[email protected]"}),(0,nn.jsx)("br",{}),(0,nn.jsx)("a",{href:"tel:+17248316105",className:"hover:text-white transition-colors",children:"(724) 831-6105"})]}),(0,nn.jsxs)("li",{className:"text-gray-100",children:[(0,nn.jsx)("strong",{children:"Nicholas Agouras"})," \u2014 CTO & Head of AI & Software Development",(0,nn.jsx)("br",{}),(0,nn.jsx)("a",{href:"mailto:[email protected]",className:"hover:text-white transition-colors",children:"[email protected]"}),(0,nn.jsx)("br",{}),(0,nn.jsx)("a",{href:"tel:+12034602492",className:"hover:text-white transition-colors",children:"(203) 460-2492"})]})]}),(0,nn.jsxs)("div",{className:"flex space-x-4",children:[(0,nn.jsx)("a",{href:"https://www.linkedin.com/company/accelerated-professionals-network/",target:"_blank",rel:"noopener noreferrer",className:"text-gray-100 hover:text-white transition-colors",children:(0,nn.jsx)("svg",{className:"h-6 w-6",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,nn.jsx)("path",{d:"M19 0h-14c-2.761 0-5 2.239-5 5v14c0 2.761 2.239 5 5 5h14c2.762 0 5-2.239 5-5v-14c0-2.761-2.238-5-5-5zm-11 19h-3v-11h3v11zm-1.5-12.268c-.966 0-1.75-.79-1.75-1.764s.784-1.764 1.75-1.764 1.75.79 1.75 1.764-.783 1.764-1.75 1.764zm13.5 12.268h-3v-5.604c0-3.368-4-3.113-4 0v5.604h-3v-11h3v1.765c1.396-2.586 7-2.777 7 2.476v6.759z"})})}),(0,nn.jsx)("a",{href:"https://www.instagram.com/the_apn_/",target:"_blank",rel:"noopener noreferrer",className:"text-gray-100 hover:text-white transition-colors",children:(0,nn.jsx)("svg",{className:"h-6 w-6",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,nn.jsx)("path",{fillRule:"evenodd",d:"M12.315 2c2.43 0 2.784.013 3.808.06 1.064.049 1.791.218 2.427.465a4.902 4.902 0 011.772 1.153 4.902 4.902 0 011.153 1.772c.247.636.416 1.363.465 2.427.048 1.067.06 1.407.06 4.123v.08c0 2.643-.012 2.987-.06 4.043-.049 1.064-.218 1.791-.465 2.427a4.902 4.902 0 01-1.153 1.772 4.902 4.902 0 01-1.772 1.153c-.636.247-1.363.416-2.427.465-1.067.048-1.407.06-4.123.06h-.08c-2.643 0-2.987-.012-4.043-.06-1.064-.049-1.791-.218-2.427-.465a4.902 4.902 0 01-1.772-1.153 4.902 4.902 0 01-1.153-1.772c-.247-.636-.416-1.363-.465-2.427-.047-1.024-.06-1.379-.06-3.808v-.63c0-2.43.013-2.784.06-3.808.049-1.064.218-1.791.465-2.427a4.902 4.902 0 011.153-1.772A4.902 4.902 0 015.45 2.525c.636-.247 1.363-.416 2.427-.465C8.901 2.013 9.256 2 11.685 2h.63zm-.081 1.802h-.468c-2.456 0-2.784.011-3.807.058-.975.045-1.504.207-1.857.344-.467.182-.8.398-1.15.748-.35.35-.566.683-.748 1.15-.137.353-.3.882-.344 1.857-.047 1.023-.058
21.351-.058 3.807v.468c0 2.456.011 2.784.058 3.807.045.975.207 1.504.344 1.857.182.466.399.8.748 1.15.35.35.683.566 1.15.748.353.137.882.3 1.857.344 1.054.048 1.37.058 4.041.058h.08c2.597 0 2.917-.01 3.96-.058.976-.045 1.505-.207 1.858-.344.466-.182.8-.398 1.15-.748.35-.35.566-.683.748-1.15.137-.353.3-.882.344-1.857.048-1.055.058-1.37.058-4.041v-.08c0-2.597-.01-2.917-.058-3.96-.045-.976-.207-1.505-.344-1.858a3.097 3.097 0 00-.748-1.15 3.098 3.098 0 00-1.15-.748c-.353-.137-.882-.3-1.857-.344-1.023-.047-1.351-.058-3.807-.058zM12 6.865a5.135 5.135 0 110 10.27 5.135 5.135 0 010-10.27zm0 1.802a3.333 3.333 0 100 6.666 3.333 3.333 0 000-6.666zm5.338-3.205a1.2 1.2 0 110 2.4 1.2 1.2 0 010-2.4z",clipRule:"evenodd"})})})]})]})]}),(0,nn.jsx)("div",{className:"mt-8 pt-8 border-t border-gray-100 border-opacity-20 text-center text-sm text-gray-100",children:(0,nn.jsx)("p",{children:"\xa9 Accelerated Professionals Network | All rights reserved."})})]})}),yn=t=>{let{threshold:n=300,className:r="",position:s="bottom-right",size:a="medium"}=t;const[i,o]=(0,e.useState)(!1);(0,e.useEffect)(()=>{const e=()=>{o(window.scrollY>n)};return window.addEventListener("scroll",e),()=>window.removeEventListener("scroll",e)},[n]);return i?(0,nn.jsx)("button",{onClick:()=>{dn("smooth")},className:"\n fixed ".concat({"bottom-right":"bottom-6 right-6","bottom-left":"bottom-6 left-6","bottom-center":"bottom-6 left-1/2 transform -translate-x-1/2","top-right":"top-6 right-6","top-left":"top-6 left-6"}[s]," ").concat({small:"w-10 h-10",medium:"w-12 h-12",large:"w-14 h-14"}[a],"\n bg-apn-blue hover:bg-blue-700 text-white rounded-full shadow-lg\n flex items-center justify-center transition-all duration-300\n hover:scale-110 focus:outline-none focus:ring-2 focus:ring-apn-blue focus:ring-offset-2\n z-50 ").concat(r,"\n "),title:"Scroll to top","aria-label":"Scroll to top",children:(0,nn.jsx)("svg",{className:{small:"w-4 h-4",medium:"w-5 h-5",large:"w-6 h-6"}[a],fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M5 10l7-7m0 0l7 7m-7-7v18"})})}):null};function vn(e){let{children:t,requireApproval:n=!1,adminOnly:r=!1,requireRole:s=null,requireActiveMembership:a=!1}=e;const{currentUser:i,userProfile:o,loading:l}=sn(),c=se();if(l)return(0,nn.jsx)("div",{className:"flex justify-center items-center h-screen",children:(0,nn.jsx)("div",{className:"animate-spin rounded-full h-12 w-12 border-t-2 border-b-2 border-apn-blue"})});if(!i)return(0,nn.jsx)(Ne,{to:"/login",state:{from:c},replace:!0});if(n&&"approved"!==(null===o||void 0===o?void 0:o.status))return(0,nn.jsx)(Ne,{to:"/pending-approval"});if(a&&"admin"!==(null===o||void 0===o?void 0:o.role)){const e=null===o||void 0===o?void 0:o.membershipStatus;if("cancelled"===e||"payment_failed"===e||"expired"===e)return(0,nn.jsx)(Ne,{to:"/membership/renew",replace:!0})}return r&&!["admin","super_admin"].includes(null===o||void 0===o?void 0:o.role)?(0,nn.jsx)(Ne,{to:"/dashboard"}):s&&(null===o||void 0===o?void 0:o.role)!==s?(0,nn.jsx)("div",{className:"flex justify-center items-center h-screen",children:(0,nn.jsxs)("div",{className:"text-center",children:[(0,nn.jsx)("h2",{className:"text-2xl font-bold text-gray-900 mb-4",children:"Access Denied"}),(0,nn.jsx)("p",{className:"text-gray-600 mb-4",children:"You don't have permission to access this page."}),(0,nn.jsxs)("p",{className:"text-sm text-gray-500",children:["Required role: ",s]}),(0,nn.jsx)("button",{onClick:()=>window.history.back(),className:"mt-4 bg-apn-blue text-white px-4 py-2 rounded hover:bg-blue-700",children:"Go Back"})]})}):t}var wn=n(193);function jn(){const{currentUser:t,userProfile:n,logout:r}=sn(),[s,a]=(0,e.useState)([]),[i,o]=(0,e.useState)(!1),l=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];a(n=>[...n,{message:e,success:t,timestamp:(new Date).toLocaleTimeString()}])};return(0,nn.jsx)("div",{className:"max-w-4xl mx-auto p-6",children:(0,nn.jsxs)("div",{className:"bg-white shadow rounded-lg",children:[(0,nn.jsxs)("div",{className:"px-6 py-4 border-b border-gray-200",children:[(0,nn.jsx)("h2",{className:"text-2xl font-bold text-gray-900",children:"Firebase Backend Test"}),(0,nn.jsx)("p",{className:"mt-2 text-gray-600",children:"Test the Firebase backend integration and verify all services are working correctly."})]}),(0,nn.jsxs)("div",{className:"p-6",children:[t&&(0,nn.jsxs)("div",{className:"mb-6 p-4 bg-blue-50 rounded-lg",children:[(0,nn.jsx)("h3",{className:"text-lg font-semibold text-blue-900 mb-2",children:"Current User"}),(0,nn.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 text-sm",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("span",{className:"font-medium",children:"Email:"})," ",t.email]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("span",{className:"font-medium",children:"UID:"})," ",t.uid]}),n&&(0,nn.jsxs)(nn.Fragment,{children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("span",{className:"font-medium",children:"Display Name:"})," ",n.displayName]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("span",{className:"font-medium",children:"Status:"}),(0,nn.jsx)("span",{className:"ml-2 px-2 py-1 rounded text-xs ".concat("approved"===n.status?"bg-green-100 text-green-800":"bg-yellow-100 text-yellow-800"),children:n.status})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("span",{className:"font-medium",children:"Role:"})," ",n.role]}
2),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("span",{className:"font-medium",children:"Company:"})," ",n.company]})]})]})]}),(0,nn.jsxs)("div",{className:"flex space-x-4 mb-6",children:[(0,nn.jsx)("button",{onClick:async()=>{o(!0),a([]);try{if(l("\ud83d\ude80 Starting comprehensive Firebase backend test..."),!t)return void l("\u274c Authentication: No user logged in",!1);l("\u2705 Authentication: User is logged in"),l("\u2705 User ID: ".concat(t.uid)),l("\u2705 Email: ".concat(t.email)),n?(l("\u2705 User Profile: Profile data loaded"),l("\u2705 Display Name: ".concat(n.displayName)),l("\u2705 Status: ".concat(n.status)),l("\u2705 Role: ".concat(n.role)),l("\u2705 Company: ".concat(n.company))):l("\u274c User Profile: No profile data",!1);try{const[e,t,n]=await Promise.all([(0,wn.zA)(5),(0,wn.JQ)(5),(0,wn.kQ)(5)]);l("\u2705 Data Reading: Found ".concat(e.length," jobs")),l("\u2705 Data Reading: Found ".concat(t.length," projects")),l("\u2705 Data Reading: Found ".concat(n.length," events"))}catch(e){l("\u274c Data Reading: ".concat(e.message),!1)}if("approved"===(null===n||void 0===n?void 0:n.status))try{const e={title:"Test Job - Firebase Integration",company:"Test Company",location:"Remote",description:"This is a test job created to verify Firebase integration.",jobType:"Full-time",workType:"Remote",salary:"$50,000 - $70,000",requirements:["Test requirement 1","Test requirement 2"],benefits:["Health insurance","Remote work"]},n=await(0,wn._S)(e,t.uid);l("\u2705 Job Creation: Successfully created job with ID: ".concat(n))}catch(e){l("\u274c Job Creation: ".concat(e.message),!1)}else l("\u26a0\ufe0f Job Creation: Skipped (requires approved status)");if("approved"===(null===n||void 0===n?void 0:n.status))try{const e={title:"Test Project - Firebase Integration",description:"This is a test project created to verify Firebase integration.",budgetRange:"$1,000 - $5,000",timeline:"1-3 months",skills:["JavaScript","React","Firebase"],projectType:"One-time",urgency:"Medium",deliverables:["Working application","Documentation"]},n=await(0,wn.createProject)(e,t.uid);l("\u2705 Project Creation: Successfully created project with ID: ".concat(n))}catch(e){l("\u274c Project Creation: ".concat(e.message),!1)}else l("\u26a0\ufe0f Project Creation: Skipped (requires approved status)");if("approved"===(null===n||void 0===n?void 0:n.status))try{const e={title:"Test Forum Post - Firebase Integration",content:"This is a test forum post to verify Firebase integration.",category:"General Discussion"},n=await(0,wn.mU)(e,t.uid);l("\u2705 Forum Post Creation: Successfully created post with ID: ".concat(n))}catch(e){l("\u274c Forum Post Creation: ".concat(e.message),!1)}else l("\u26a0\ufe0f Forum Post Creation: Skipped (requires approved status)");if("approved"===(null===n||void 0===n?void 0:n.status))try{const e={name:"Test Group - Firebase Integration",description:"This is a test group created to verify Firebase integration.",category:"Technology",isPrivate:!1},n=await(0,wn.wj)(e,t.uid);l("\u2705 Group Creation: Successfully created group with ID: ".concat(n))}catch(e){l("\u274c Group Creation: ".concat(e.message),!1)}else l("\u26a0\ufe0f Group Creation: Skipped (requires approved status)");if("admin"===(null===n||void 0===n?void 0:n.role))try{const e={title:"Test Event - Firebase Integration",description:"This is a test event created to verify Firebase integration.",startDate:new Date(Date.now()+6048e5),endDate:new Date(Date.now()+6048e5+72e5),location:"Virtual Event Platform",isVirtual:!0,maxAttendees:100,eventType:"Workshop",pricing:{member:0,nonMember:25,sponsorDiscount:10}},t=await(0,wn.lh)(e);l("\u2705 Event Creation: Successfully created event with ID: ".concat(t))}catch(e){l("\u274c Event Creation: ".concat(e.message),!1)}else l("\u26a0\ufe0f Event Creation: Skipped (requires admin role)");if("admin"===(null===n||void 0===n?void 0:n.role))try{const e=await(0,wn.P5)();l("\u2705 Analytics: Retrieved platform statistics"),l("\u2705 Analytics: ".concat(e.totalUsers," total users")),l("\u2705 Analytics: ".concat(e.activeMembers," active members")),l("\u2705 Analytics: ".concat(e.pendingMembers," pending members"))}catch(e){l("\u274c Analytics: ".concat(e.message),!1)}else l("\u26a0\ufe0f Analytics: Skipped (requires admin role)");try{const e=await(0,wn.Nt)(5);l("\u2705 Forum Data: Retrieved ".concat(e.length," forum posts"))}catch(e){l("\u274c Forum Data: ".concat(e.message),!1)}try{const e=await(0,wn.f)(5);l("\u2705 Groups Data: Retrieved ".concat(e.length," groups"))}catch(e){l("\u274c Groups Data: ".concat(e.message),!1)}l("\ud83c\udf89 Comprehensive Firebase backend test completed!"),l("\ud83d\udcca Check your Firebase console to verify all data was created correctly.")}catch(e){l("\u274c General Error: ".concat(e.message),!1)}finally{o(!1)}},disabled:i,className:"bg-apn-blue text-white px-6 py-2 rounded-md hover:bg-blue-700 disabled:opacity-50 disabled:cursor-not-allowed",children:i?"Running Tests...":"Run Firebase Tests"}),t&&(0,nn.jsx)("button",{onClick:async()=>{try{await r(),l("\u2705 Logout: Successfully logged out")}catch(e){l("\u274c Logout Error: ".concat(e.message),!1)}},className:"bg-red-600 text-white px-6 py-2 rounded-md hover:bg-red-700",children:"Logout"})]}),s.length>0&&(0,nn.jsxs)("div",{className:"bg-gray-50 rounded-lg p-4",children:[(0,nn.jsx)("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Test Results"}),(0,nn.jsx)("div",{className:"space-y-2 max-h-96 overflow-y-auto",children:s.map((e,t)=>(0,nn.jsxs)("div",{className:"flex items-start space-x-2 text-sm ".concat(e.success?"text-green-700":"text-red-700"),children:[(0,nn.jsx)("span",{className:"text-xs text-gray-500 mt-0.5 min-w-[60px]",children:e.timestamp}),(0,nn.jsx)("span",{className:"flex-1",children:e.message})]},t))})]}),(0,nn.jsxs)("div",{className:"mt-8 p-4 bg-yellow-50 rounded-lg",children:[(0,nn.jsx)("h3",{className:"text-lg font-semibold text-yellow-900 mb-2",children:"Instructions"}),(0,nn.jsxs)("ul",{className:"text-sm text-yellow-800 space-y-1",children:[(0,nn.jsx)("li",{children:"\u2022 Make sure you're logged in to run the full test suite"}),(0,nn.jsx)("li",{children:"\u2022 The test will create sample data in your Firebase database"}),(0,nn.jsx)("li",{children:"\u2022 Event creation requires admin role"}),(0,nn.jsx)("li",{children:"\u2022 Check your Firebase console to verify data was created"}),(0,nn.jsx)("li",{children:"\u2022 You can safely delete test data after verification"})]})]})]})]})})}function Nn(){const[t,n]=(0,e.useState)({firebase:"checking",auth:"checking",firestore:"checking",storage:"checking"}),[r,a]=(0,e.useState)(null),[i,o]=(0,e.useState)(null);(0,e.useEffect)(()=>
2{l()},[]);const l=async()=>{try{n(e=>(0,s.A)((0,s.A)({},e),{},{firebase:"testing"}));const i={apiKey:"AIzaSyCldlZuqyf25VFuTgRkQH5lVo-ohxE9P6E",authDomain:"the-apn.firebaseapp.com",projectId:"the-apn",storageBucket:"the-apn.firebasestorage.app",messagingSenderId:"462477660480",appId:"1:462477660480:web:cf4338dd149dec6670eaa5"};a(i);if(!Object.values(i).every(e=>e&&"your-api-key-here"!==e&&"your-sender-id"!==e&&"your-app-id"!==e))throw new Error("Firebase configuration not properly set. Please update your .env file.");n(e=>(0,s.A)((0,s.A)({},e),{},{firebase:"connected"})),n(e=>(0,s.A)((0,s.A)({},e),{},{auth:"testing"}));try{if(!yt.j2)throw new Error("Auth not initialized");n(e=>(0,s.A)((0,s.A)({},e),{},{auth:"connected"}))}catch(e){console.error("Auth test failed:",e),n(e=>(0,s.A)((0,s.A)({},e),{},{auth:"error"}))}n(e=>(0,s.A)((0,s.A)({},e),{},{firestore:"testing"}));try{if(!yt.db)throw new Error("Firestore not initialized");n(e=>(0,s.A)((0,s.A)({},e),{},{firestore:"connected"}))}catch(t){console.error("Firestore test failed:",t),n(e=>(0,s.A)((0,s.A)({},e),{},{firestore:"error"}))}n(e=>(0,s.A)((0,s.A)({},e),{},{storage:"testing"}));try{if(!yt.IG)throw new Error("Storage not initialized");n(e=>(0,s.A)((0,s.A)({},e),{},{storage:"connected"}))}catch(r){console.error("Storage test failed:",r),n(e=>(0,s.A)((0,s.A)({},e),{},{storage:"error"}))}}catch(i){console.error("Firebase connection test failed:",i),o(i.message),n({firebase:"error",auth:"error",firestore:"error",storage:"error"})}},c=e=>{switch(e){case"connected":return"Connected";case"testing":return"Testing...";case"checking":return"Checking...";case"error":return"Error";default:return"Unknown"}},d=e=>{switch(e){case"connected":return"text-green-600";case"testing":case"checking":return"text-yellow-600";case"error":return"text-red-600";default:return"text-gray-600"}},u=Object.values(t).every(e=>"connected"===e),m=Object.values(t).some(e=>"error"===e);return(0,nn.jsx)("div",{className:"max-w-4xl mx-auto p-6",children:(0,nn.jsxs)("div",{className:"bg-white shadow rounded-lg",children:[(0,nn.jsxs)("div",{className:"px-6 py-4 border-b border-gray-200",children:[(0,nn.jsx)("h2",{className:"text-2xl font-bold text-gray-900",children:"Firebase Connection Test"}),(0,nn.jsx)("p",{className:"mt-2 text-gray-600",children:"Test your Firebase configuration and connection status."})]}),(0,nn.jsxs)("div",{className:"p-6",children:[(0,nn.jsx)("div",{className:"p-4 rounded-lg mb-6 ".concat(u?"bg-green-50 border border-green-200":m?"bg-red-50 border border-red-200":"bg-yellow-50 border border-yellow-200"),children:(0,nn.jsxs)("div",{className:"flex items-center",children:[(0,nn.jsx)("span",{className:"text-2xl mr-3",children:u?"\ud83c\udf89":m?"\u26a0\ufe0f":"\ud83d\udd04"}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("h3",{className:"text-lg font-semibold ".concat(u?"text-green-800":m?"text-red-800":"text-yellow-800"),children:u?"All Services Connected!":m?"Connection Issues Detected":"Testing Connections..."}),(0,nn.jsx)("p",{className:"text-sm ".concat(u?"text-green-700":m?"text-red-700":"text-yellow-700"),children:u?"Your Firebase backend is ready to use.":m?"Please check your Firebase configuration.":"Please wait while we test your connections."})]})]})}),(0,nn.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-6",children:[(0,nn.jsx)("div",{className:"bg-gray-50 p-4 rounded-lg",children:(0,nn.jsxs)("div",{className:"flex items-center justify-between",children:[(0,nn.jsx)("span",{className:"font-medium text-gray-900",children:"Firebase Core"}),(0,nn.jsx)("span",{className:"text-sm font-medium ".concat(d(t.firebase)),children:c(t.firebase)})]})}),(0,nn.jsx)("div",{className:"bg-gray-50 p-4 rounded-lg",children:(0,nn.jsxs)("div",{className:"flex items-center justify-between",children:[(0,nn.jsx)("span",{className:"font-medium text-gray-900",children:"Authentication"}),(0,nn.jsx)("span",{className:"text-sm font-medium ".concat(d(t.auth)),children:c(t.auth)})]})}),(0,nn.jsx)("div",{className:"bg-gray-50 p-4 rounded-lg",children:(0,nn.jsxs)("div",{className:"flex items-center justify-between",children:[(0,nn.jsx)("span",{className:"font-medium text-gray-900",children:"Firestore Database"}),(0,nn.jsx)("span",{className:"text-sm font-medium ".concat(d(t.firestore)),children:c(t.firestore)})]})}),(0,nn.jsx)("div",{className:"bg-gray-50 p-4 rounded-lg",children:(0,nn.jsxs)("div",{className:"flex items-center justify-between",children:[(0,nn.jsx)("span",{className:"font-medium text-gray-900",children:"Cloud Storage"}),(0,nn.jsx)("span",{className:"text-sm font-medium ".concat(d(t.storage)),children:c(t.storage)})]})})]}),r&&(0,nn.jsxs)("div",{className:"bg-gray-50 p-4 rounded-lg mb-6",children:[(0,nn.jsx)("h3",{className:"text-lg font-medium text-gray-900 mb-3",children:"Configuration Details"}),(0,nn.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 text-sm",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("span",{className:"font-medium text-gray-700",children:"Project ID:"}),(0,nn.jsx)("span",{className:"ml-2 text-gray-600",children:r.projectId})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("span",{className:"font-medium text-gray-700",children:"Auth Domain:"}),(0,nn.jsx)("span",{className:"ml-2 text-gray-600",children:r.authDomain})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("span",{className:"font-medium text-gray-700",children:"Storage Bucket:"}),(0,nn.jsx)("span",{className:"ml-2 text-gray-600",children:r.storageBucket})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("span",{className:"font-medium text-gray-700",children:"API Key:"}),(0,nn.jsx)("span",{className:"ml-2 text-gray-600",children:r.apiKey?"".concat(r.a
2piKey.substring(0,10),"..."):"Not set"})]})]})]}),i&&(0,nn.jsxs)("div",{className:"bg-red-50 border border-red-200 p-4 rounded-lg mb-6",children:[(0,nn.jsx)("h3",{className:"text-lg font-medium text-red-800 mb-2",children:"Error Details"}),(0,nn.jsx)("p",{className:"text-red-700 text-sm",children:i})]}),u&&(0,nn.jsxs)("div",{className:"bg-green-50 border border-green-200 p-4 rounded-lg",children:[(0,nn.jsx)("h3",{className:"text-lg font-medium text-green-800 mb-3",children:"Next Steps"}),(0,nn.jsxs)("div",{className:"text-green-700 text-sm space-y-2",children:[(0,nn.jsx)("p",{children:"\u2705 Your Firebase backend is properly configured!"}),(0,nn.jsx)("p",{children:(0,nn.jsx)("strong",{children:"What you can do now:"})}),(0,nn.jsxs)("p",{className:"ml-4",children:["\u2022 Test the full backend: ",(0,nn.jsx)("a",{href:"/firebase-test",className:"underline",children:"Run Firebase Tests"})]}),(0,nn.jsxs)("p",{className:"ml-4",children:["\u2022 Create an account: ",(0,nn.jsx)("a",{href:"/signup",className:"underline",children:"Sign Up"})]}),(0,nn.jsx)("p",{className:"ml-4",children:"\u2022 Deploy security rules: npm run deploy-rules"}),(0,nn.jsx)("p",{className:"ml-4",children:"\u2022 Set up sample data: npm run setup-firebase"})]})]}),(0,nn.jsx)("div",{className:"mt-6 flex justify-center",children:(0,nn.jsx)("button",{onClick:l,className:"px-6 py-2 bg-apn-blue text-white rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500",children:"Test Connection Again"})})]})]})})}function kn(){const{currentUser:e,userProfile:t,membership:n,loading:r,hasRole:s,isActiveMember:a}=sn();return(0,nn.jsxs)("div",{className:"max-w-4xl mx-auto p-6 bg-white shadow rounded-lg",children:[(0,nn.jsx)("h2",{className:"text-2xl font-bold mb-6",children:"\ud83d\udd0d Authentication Debug Info"}),(0,nn.jsxs)("div",{className:"space-y-4",children:[(0,nn.jsxs)("div",{className:"bg-gray-50 p-4 rounded",children:[(0,nn.jsx)("h3",{className:"font-bold text-lg mb-2",children:"Loading State:"}),(0,nn.jsx)("p",{children:r?"\u23f3 Loading...":"\u2705 Loaded"})]}),(0,nn.jsxs)("div",{className:"bg-gray-50 p-4 rounded",children:[(0,nn.jsx)("h3",{className:"font-bold text-lg mb-2",children:"Current User (Firebase Auth):"}),(0,nn.jsx)("pre",{className:"text-sm overflow-auto",children:JSON.stringify(e?{uid:e.uid,email:e.email,displayName:e.displayName}:null,null,2)})]}),(0,nn.jsxs)("div",{className:"bg-gray-50 p-4 rounded",children:[(0,nn.jsx)("h3",{className:"font-bold text-lg mb-2",children:"User Profile (Firestore):"}),(0,nn.jsx)("pre",{className:"text-sm overflow-auto",children:JSON.stringify(t,null,2)})]}),(0,nn.jsxs)("div",{className:"bg-gray-50 p-4 rounded",children:[(0,nn.jsx)("h3",{className:"font-bold text-lg mb-2",children:"Membership Data:"}),(0,nn.jsx)("pre",{className:"text-sm overflow-auto",children:JSON.stringify(n,null,2)})]}),(0,nn.jsxs)("div",{className:"bg-gray-50 p-4 rounded",children:[(0,nn.jsx)("h3",{className:"font-bold text-lg mb-2",children:"Role Checks:"}),(0,nn.jsxs)("div",{className:"space-y-2",children:[(0,nn.jsxs)("p",{children:["hasRole('admin'): ",s("admin")?"\u2705 TRUE":"\u274c FALSE"]}),(0,nn.jsxs)("p",{children:["hasRole('member'): ",s("member")?"\u2705 TRUE":"\u274c FALSE"]}),(0,nn.jsxs)("p",{children:["isActiveMember(): ",a()?"\u2705 TRUE":"\u274c FALSE"]})]})]}),(0,nn.jsxs)("div",{className:"bg-gray-50 p-4 rounded",children:[(0,nn.jsx)("h3",{className:"font-bold text-lg mb-2",children:"Expected vs Actual:"}),(0,nn.jsxs)("div",{className:"space-y-2",children:[(0,nn.jsxs)("p",{children:[(0,nn.jsx)("strong",{children:"Expected role:"}),' "admin"']}),(0,nn.jsxs)("p",{children:[(0,nn.jsx)("strong",{children:"Actual role:"}),' "',null===t||void 0===t?void 0:t.role,'"']}),(0,nn.jsxs)("p",{children:[(0,nn.jsx)("strong",{children:"Expected membershipTier:"}),' "admin"']}),(0,nn.jsxs)("p",{children:[(0,nn.jsx)("strong",{children:"Actual membershipTier:"}),' "',null===t||void 0===t?void 0:t.membershipTier,'"']}),(0,nn.jsxs)("p",{children:[(0,nn.jsx)("strong",{children:"Expected status:"}),' "approved"']}),(0,nn.jsxs)("p",{children:[(0,nn.jsx)("strong",{children:"Actual status:"}),' "',null===t||void 0===t?void 0:t.status,'"']})]})]})]})]})}const An=()=>{const[t,n]=(0,e.useState)(""),[r,s]=(0,e.useState)(!1);return(0,nn.jsxs)("div",{className:"p-6 max-w-2xl mx-auto",children:[(0,nn.jsx)("h2",{className:"text-2xl font-bold mb-4",children:"Payment Function Test"}),(0,nn.jsx)("button",{onClick:async()=>{s(!0),n("Testing...");try{const e="http://127.0.0.1:5001/the-apn/us-central1/createCheckoutSession",t=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:"test-user-id",priceId:"price_tier1_annual",tierKey:"TIER1",discountCode:null,successUrl:"".concat(window.location.origin,"/membership/success"),cancelUrl:"".concat(window.location.origin,"/membership/cancel")})});if(console.log("Response status:",t.status),console.log("Response headers:",t.headers),!t.ok){const e=await t.text();return void n("Error: ".concat(t.status," - ").concat(e))}const r=await t.json();n("Success: ".concat(JSON.stringify(r,null,2)))}catch(e){console.error("Test error:",e),n("Error: ".concat(e.message))}finally{s(!1)}},disabled:r,className:"bg-blue-500 text-white px-4 py-2 rounded hover:bg-blue-600 disabled:opacity-50",children:r?"Testing...":"Test Firebase Function"}),t&&(0,nn.jsxs)("div",{className:"mt-4 p-4 bg-gray-100 rounded",children:[(0,nn.jsx)("h3",{className:"font-bold mb-2",children:"Result:"}),(0,nn.jsx)("pre",{className:"whitespace-pre-wrap text-sm",children:t})]})]})},Sn=()=>{var t;const[n,r]=(0,e.useState)("FOUNDING2025"),[s,a]=(0,e.useState)(null),[i,o]=(0,e.useState)(!1),[l,c]=(0,e.useState)("");return(0,nn.jsxs)("div",{className:"max-w-md mx-auto p-6 bg-white rounded-lg shadow-lg",children:[(0,nn.jsx)("h2",{className:"text-xl font-bold mb-4",children:"Discount Code Test"}),(0,nn.jsxs)("div",{className:"space-y-4",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Test Discount Code:"}),(0,nn.jsx)("input",{type:"text",value:n,onChange:e=>r(e.target.value),className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",placeholder:"Enter discount code"})]}),(0,nn.jsx)("button",{onClick:async()=>{o(!0),c(""),a(null);try{console.log("Testing discount code:",n);const e=await Vt(n);console.log("Validation result:",e),a(e)}catch(e){console.error("Validation error:",e),c(e.message||"Unknown error occurred")}finally{o(!1)}},disabled:i||!n.trim(),className:"w-full px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 disabled:bg-gray-400 disabled:cursor-not-allowed",children:i?"Testing...":"Test Validation"}),l&&(0,nn.jsxs)("div",{className:"p-3 bg-red-100 border border-red-400 text-red-700 rounded",children:[(0,nn.jsx)("strong",{children:"Error:"})," ",l]}),s&&(0,nn.jsxs)("div",{className:"p-3 rounded border ".concat(s.valid?"bg-green-100 border-green-400 text-green-700":"bg-red-100 border-red-400 text-red-700"),children:[(0,nn.jsx)("div",{className:"font-semibold mb-2",children:s.valid?"\u2705 Valid Code":"\u274c Invalid Code"}),s.valid?(0,nn.jsxs)("div",{className:"text-sm space-y-1",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("strong",{children:"Discount:"})," ",s.discountAmount,"% off"]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("strong",{children:"Type:"})," ",s.discountType]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("strong",{children:"Description:"})," ",null===(t=s.discount)||void 0===t?void 0:t.description]})]}):(0,nn.jsxs)("div",{className:"text-sm",children:[(0,nn.jsx)("strong",{children:"Error:"})," ",s.error]})]}),(0,nn.jsxs)("div",{className:"text-xs text-gray-500 space-y-1",children:[(0,nn.jsx)("div",{children:(0,nn.jsx)("strong",{children:"Available codes:"})}),(0,nn.jsx)("div",{children:"\u2022 FOUNDING2025 (100% off)"}),(0,nn.jsx)("div",{children:"\u2022 EARLYBIRD2025 (100% off)"}),(0,nn.jsx)("div",{children:"\u2022 TESTER2025 (100% off)"})]})]})]})};function En(){var t,n;const[r,s]=(0,e.useState)(""),[a,i]=(0,e.useState)(""),[o,l]=(0,e.useState)(""),[c,d]=(0,e.useState)(!1),{login:u,loginWithGoogle:m}=sn(),h=oe(),p=(null===(t=se().state)||void 0===t||null===(n=t.from)||void 0===n?void 0:n.pathname)||"/dashboard";return(0,nn.jsxs)("div",{className:"min-h-screen bg-gray-50",children:[(0,nn.jsx)("header",{className:"bg-white shadow-sm",children:(0,nn.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:(0,nn.jsxs)("div",{className:"flex justify-between h-16 items-center",children:[(0,nn.jsx)("div",{className:"flex-shrink-0",children:(0,nn.jsx)(dt,{to:"/",className:"flex items-center",children:(0,nn.jsx)("img",{src:"/apn-logos/APN-blue (1).png",alt:"APN Logo",className:"h-8"})})}),(0,nn.jsx)("div",{children:(0,nn.jsx)(dt,{to:"/register",className:"text-apn-blue hover:text-blue-700 font-medium",children:"Need an account? Become a Member"})})]})})}),(0,nn.jsx)("div",{className:"flex items-center justify-center py-12 px-4 sm:px-6 lg:px-8",children:(0,nn.jsxs)("div",{className:"max-w-md w-full space-y-8",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("img",{className:"mx-auto h-16 w-auto",src:"/apn-logos/APN-Tag-SQ-blue.png",alt:"APN Logo"}),(0,nn.jsx)("h2",{className:"mt-6 text-center text-3xl font-extrabold text-gray-900",children:"Sign in to your account"}),(0,nn.jsx)("p",{className:"mt-2 text-center text-sm text-gray-600",children:"Welcome back to the Accelerated Professionals Network"})]}),o&&(0,nn.jsx)("div",{className:"bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded relative",role:"alert",children:(0,nn.jsx)("span",{className:"block sm:inline",children:o})}),(0,nn.jsxs)("form",{className:"mt-8 space-y-6",onSubmit:async function(e){e.preventDefault();try{l(""),d(!0),await u(r,a),h(p,{replace:!0})}catch(o){l(function(e){const t=(null===e||void 0===e?void 0:e.code)||"",n=(null===e||void 0===e?void 0:e.message)||"";switch(t){case"auth/user-not-found":return"No account found with this email address. Please check your email or create an account.";case"auth/wrong-password":case"auth/invalid-credential":return"Incorrect password. Please try again or reset your password.";case"auth/invalid-email":return"Please enter a valid email address.";case"auth/user-disabled":return"This account has been disabled. Please contact support.";case"auth/too-many-requests":return"Too many failed login attempts. Please try again later or reset your password.";case"auth/network-request-failed":return"Network error. Please check your internet connection and try again.";default:return n.includes("pending approval")||n.includes("suspended")?"Your account is pending approval or has been suspended. Please contact [email protected] for assistance.":n.includes("Automated access")||n.includes("bot")?"Security check failed. Please refresh the page and try again.":n.includes("CAPTCHA")?"Additional verification required. Please complete the security check.":n.includes("flagged")?"Your account has been flagged for review. Please contact [email protected].":"Failed to log in. Please check your credentials and try again."}}(o)),console.error("Login error:",o.code,o.message)}finally{d(!1)}},children:[(0,nn.jsxs)("div",{className:"rounded-md shadow-sm -space-y-px",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"email-address",className:"sr-only",children:"Email address"}),(0,nn.jsx)("input",{id:"email-address",name:"email",type:"email",autoComplete:"email",required:!0,value:r,onChange:e=>s(e.target.value),className:"appearance-none rounded-none relative block w-full px-3 py-2 border border-gray-300 placeholder-gray-500 text-gray-900 rounded-t-md focus:outline-none focus:ring-apn-blue focus:border-apn-blue focus:z-10 sm:text-sm",placeholder:"Email address"})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"password",className:"sr-only",children:"Password"}),(0,nn.jsx)("input",{id:"password",name:"password",type:"password",autoComplete:"current-password",required:!0,value:a,onChange:e=>i(e.target.value),className:"appearance-none rounded-none relative block w-full px-3 py-2 border border-gray-300 placeholder-gray-500 text-gray-900 rounded-b-md focus:outline-none focus:ring-apn-blue focus:border-apn-blue focus:z-10 sm:text-sm",placeholder:"Password"})]})]}),(0,nn.jsx)("div",{className:"flex items-center justify-between",children:(0,nn.jsx)("div",{className:"text-sm",children:(0,nn.jsx)(dt,{to:"/forgot-password",className:"font-medium text-apn-blue hover:text-apn-dark-blue",children:"Forgot your password?"})})}),(0,nn.jsx)("div",{children:(0,nn.jsx)("button",{type:"submit",disabled:c,
2className:"group relative w-full flex justify-center py-2 px-4 border border-transparent text-sm font-medium rounded-md text-white bg-apn-blue hover:bg-apn-dark-blue focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-apn-blue",children:c?"Signing in...":"Sign in"})}),(0,nn.jsxs)("div",{className:"mt-6",children:[(0,nn.jsxs)("div",{className:"relative",children:[(0,nn.jsx)("div",{className:"absolute inset-0 flex items-center",children:(0,nn.jsx)("div",{className:"w-full border-t border-gray-300"})}),(0,nn.jsx)("div",{className:"relative flex justify-center text-sm",children:(0,nn.jsx)("span",{className:"px-2 bg-gray-50 text-gray-500",children:"Or continue with"})})]}),(0,nn.jsx)("div",{className:"mt-6",children:(0,nn.jsxs)("button",{type:"button",onClick:async function(){try{l(""),d(!0),await m(),h(p,{replace:!0})}catch(o){const t=(null===o||void 0===o?void 0:o.message)||"";t.includes("cancelled")||t.includes("popup-closed")?l("Google sign-in was cancelled. Please try again."):t.includes("popup-blocked")||t.includes("Pop-up")?l("Pop-up was blocked by your browser. Please allow pop-ups for this site."):l("Failed to sign in with Google. Please try again or use email login."),console.error("Google login error:",o)}finally{d(!1)}},disabled:c,className:"w-full flex justify-center py-2 px-4 border border-gray-300 rounded-md shadow-sm bg-white text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-apn-blue",children:[(0,nn.jsx)("svg",{className:"h-5 w-5 mr-2",viewBox:"0 0 24 24",children:(0,nn.jsxs)("g",{transform:"matrix(1, 0, 0, 1, 27.009001, -39.238998)",children:[(0,nn.jsx)("path",{fill:"#4285F4",d:"M -3.264 51.509 C -3.264 50.719 -3.334 49.969 -3.454 49.239 L -14.754 49.239 L -14.754 53.749 L -8.284 53.749 C -8.574 55.229 -9.424 56.479 -10.684 57.329 L -10.684 60.329 L -6.824 60.329 C -4.564 58.239 -3.264 55.159 -3.264 51.509 Z"}),(0,nn.jsx)("path",{fill:"#34A853",d:"M -14.754 63.239 C -11.514 63.239 -8.804 62.159 -6.824 60.329 L -10.684 57.329 C -11.764 58.049 -13.134 58.489 -14.754 58.489 C -17.884 58.489 -20.534 56.379 -21.484 53.529 L -25.464 53.529 L -25.464 56.619 C -23.494 60.539 -19.444 63.239 -14.754 63.239 Z"}),(0,nn.jsx)("path",{fill:"#FBBC05",d:"M -21.484 53.529 C -21.734 52.809 -21.864 52.039 -21.864 51.239 C -21.864 50.439 -21.724 49.669 -21.484 48.949 L -21.484 45.859 L -25.464 45.859 C -26.284 47.479 -26.754 49.299 -26.754 51.239 C -26.754 53.179 -26.284 54.999 -25.464 56.619 L -21.484 53.529 Z"}),(0,nn.jsx)("path",{fill:"#EA4335",d:"M -14.754 43.989 C -12.984 43.989 -11.404 44.599 -10.154 45.789 L -6.734 42.369 C -8.804 40.429 -11.514 39.239 -14.754 39.239 C -19.444 39.239 -23.494 41.939 -25.464 45.859 L -21.484 48.949 C -20.534 46.099 -17.884 43.989 -14.754 43.989 Z"})]})}),"Google"]})})]})]}),(0,nn.jsx)("div",{className:"text-center mt-4",children:(0,nn.jsxs)("p",{className:"text-sm text-gray-600",children:["Don't have an account?"," ",(0,nn.jsx)(dt,{to:"/register",className:"font-medium text-apn-blue hover:text-apn-dark-blue",children:"Become a Member"})]})})]})})]})}const Cn=()=>{const[t,n]=(0,e.useState)(""),[r,s]=(0,e.useState)(""),[a,i]=(0,e.useState)(""),[o,l]=(0,e.useState)(!1),{resetPassword:c}=sn();return(0,nn.jsxs)("div",{className:"bg-gray-50 min-h-screen flex flex-col",children:[(0,nn.jsx)("header",{className:"bg-white shadow-sm",children:(0,nn.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:(0,nn.jsxs)("div",{className:"flex justify-between h-16 items-center",children:[(0,nn.jsx)("div",{className:"flex-shrink-0",children:(0,nn.jsx)(dt,{to:"/",className:"flex items-center",children:(0,nn.jsx)("img",{src:"".concat("","/apn-logos/APN-blue (1).png"),alt:"APN Logo",className:"h-8"})})}),(0,nn.jsxs)("div",{className:"flex space-x-4",children:[(0,nn.jsx)(dt,{to:"/login",className:"text-apn-blue hover:text-blue-700",children:"Back to Sign In"}),(0,nn.jsx)(dt,{to:"/register",className:"text-apn-blue hover:text-blue-700",children:"Create Account"})]})]})})}),(0,nn.jsx)("div",{className:"flex-grow flex items-center justify-center py-12 px-4 sm:px-6 lg:px-8",children:(0,nn.jsxs)("div",{className:"max-w-md w-full space-y-8",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("div",{className:"flex justify-center",children:(0,nn.jsx)("img",{src:"".concat("","/apn-logos/APN-Tag-SQ-blue.png"),alt:"APN Logo",className:"h-24"})}),(0,nn.jsx)("h2",{className:"mt-6 text-center text-3xl font-extrabold text-gray-900",children:"Reset your password"}),(0,nn.jsx)("p",{className:"mt-2 text-center text-sm text-gray-600",children:"Enter your email address and we'll send you a link to reset your password."})]}),r&&(0,nn.jsx)("div",{className:"bg-green-100 border border-green-400 text-green-700 px-4 py-3 rounded",children:(0,nn.jsxs)("div",{className:"flex",children:[(0,nn.jsx)("svg",{className:"w-5 h-5 text-green-400 mr-2",fill:"
2currentColor",viewBox:"0 0 20 20",children:(0,nn.jsx)("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"})}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("p",{className:"font-medium",children:"Email sent!"}),(0,nn.jsx)("p",{className:"text-sm",children:r})]})]})}),a&&(0,nn.jsx)("div",{className:"bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded",children:(0,nn.jsxs)("div",{className:"flex",children:[(0,nn.jsx)("svg",{className:"w-5 h-5 text-red-400 mr-2",fill:"currentColor",viewBox:"0 0 20 20",children:(0,nn.jsx)("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z",clipRule:"evenodd"})}),(0,nn.jsx)("p",{children:a})]})}),(0,nn.jsxs)("form",{className:"mt-8 space-y-6",onSubmit:async e=>{if(e.preventDefault(),t)try{s(""),i(""),l(!0),await c(t),s("Check your inbox for password reset instructions")}catch(a){switch(console.error("Password reset error:",a),a.code){case"auth/user-not-found":i("No account found with this email address");break;case"auth/invalid-email":i("Please enter a valid email address");break;case"auth/too-many-requests":i("Too many password reset attempts. Please try again later");break;default:i("Failed to send password reset email. Please try again")}}finally{l(!1)}else i("Please enter your email address")},children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"email",className:"block text-sm font-medium text-gray-700 mb-1",children:"Email address"}),(0,nn.jsx)("input",{id:"email",name:"email",type:"email",autoComplete:"email",required:!0,value:t,onChange:e=>n(e.target.value),className:"appearance-none relative block w-full px-3 py-2 border border-gray-300 placeholder-gray-500 text-gray-900 rounded-md focus:outline-none focus:ring-apn-blue focus:border-apn-blue focus:z-10 sm:text-sm",placeholder:"Enter your email address"})]}),(0,nn.jsx)("div",{children:(0,nn.jsx)("button",{type:"submit",disabled:o,className:"group relative w-full flex justify-center py-2 px-4 border border-transparent text-sm font-medium rounded-md text-white bg-apn-blue hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-apn-blue disabled:bg-gray-400 disabled:cursor-not-allowed",children:o?(0,nn.jsxs)("div",{className:"flex items-center",children:[(0,nn.jsxs)("svg",{className:"animate-spin -ml-1 mr-3 h-5 w-5 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[(0,nn.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,nn.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"Sending..."]}):"Send reset email"})}),(0,nn.jsx)("div",{className:"text-center",children:(0,nn.jsxs)("p",{className:"text-sm text-gray-600",children:["Remember your password?"," ",(0,nn.jsx)(dt,{to:"/login",className:"font-medium text-apn-blue hover:text-blue-700",children:"Sign in"})]})})]}),(0,nn.jsx)("div",{className:"mt-6 bg-blue-50 border border-blue-200 rounded-md p-4",children:(0,nn.jsxs)("div",{className:"flex",children:[(0,nn.jsx)("svg",{className:"w-5 h-5 text-blue-400 mr-2",fill:"currentColor",viewBox:"0 0 20 20",children:(0,nn.jsx)("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 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z",clipRule:"evenodd"})}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("h3",{className:"text-sm font-medium text-blue-800",children:"Need help?"}),(0,nn.jsx)("div",{className:"mt-2 text-sm text-blue-700",children:(0,nn.jsxs)("ul",{className:"list-disc list-inside space-y-1",children:[(0,nn.jsx)("li",{children:"Check your spam/junk folder for the reset email"}),(0,nn.jsx)("li",{children:"Make sure you're using the email address associated with your account"}),(0,nn.jsx)("li",{children:"Contact support at [email protected] if you continue having issues"})]})})]})]})})]})})]})},Tn={siteName:"The APN - Accelerated Professionals Network",siteUrl:"https://the-apn.com",defaultTitle:"The APN | Accelerated Professionals Network | #1 Professional Network",defaultDescription:"The APN (Accelerated Professionals Network) - The premier accelerated professional network connecting finance professionals worldwide. Join the leading professional network for accelerated career growth.",defaultKeywords:["the apn","accelerated professionals network","accelerated professionals","professional network","accelerated","professional","network","the accelerated professionals network","apn network","apn professionals","finance professionals network","investment banking careers","M&A professionals","private equity network","corporate finance jobs","financial services networking","finance career development","investment banking community","financial professionals association","finance networking events"],author:"Accelerated Professionals Network",twitterHandle:"@the_apn_",linkedinUrl:"https://www.linkedin.com/company/accelerated-professionals-network",
2instagramUrl:"https://www.instagram.com/the_apn_/",logo:"/apn-logos/APN-Tag-SQ-blue.png",favicon:"/favicon.ico"},Pn={home:{title:"The APN | #1 Accelerated Professionals Network | Professional Network",description:"The APN - The premier accelerated professionals network. Join the leading professional network connecting accelerated professionals worldwide. The top choice for professional networking and accelerated career growth.",keywords:["the apn","accelerated professionals network","accelerated professionals","professional network","accelerated","professional","network","the accelerated professionals network","apn network","apn professionals","apn community","best professional network","top professional network","premier professional network","exclusive professional network","accelerated career growth","professional networking platform","finance professionals network","investment banking community","M&A professionals","private equity network","finance careers"],type:"website"},about:{title:"About APN - Leading Finance Professionals Network | Our Story & Mission",description:"Learn about the Accelerated Professionals Network, the premier community connecting finance professionals across investment banking, M&A, private equity, and corporate finance sectors.",keywords:["about APN","finance professionals community","investment banking network","professional development"],type:"website"},membership:{title:"Join APN - Finance Professionals Membership | Exclusive Benefits & Networking",description:"Become an APN member and unlock exclusive access to finance job opportunities, networking events, professional development, and a community of 1000+ finance professionals.",keywords:["finance membership","professional networking","investment banking membership","finance career benefits"],type:"website"},events:{title:"Finance Networking Events | APN Professional Development & Industry Conferences",description:"Attend exclusive finance networking events, workshops, and conferences. Connect with investment banking, M&A, and private equity professionals at APN events.",keywords:["finance events","networking events","investment banking conferences","professional development workshops"],type:"website"},jobs:{title:"Finance Jobs Board | Investment Banking, M&A & Private Equity Careers | APN",description:"Discover exclusive finance job opportunities in investment banking, M&A, private equity, and corporate finance. Access hidden job market through APN professional network.",keywords:["finance jobs","investment banking jobs","M&A careers","private equity positions","corporate finance opportunities"],type:"website"},projects:{title:"Finance Projects Board | Consulting & Freelance Opportunities | APN",description:"Find high-value finance consulting projects and freelance opportunities. Connect with clients seeking M&A, valuation, financial modeling, and due diligence expertise.",keywords:["finance consulting","financial modeling projects","M&A consulting","valuation projects","due diligence"],type:"website"},directory:{title:"Finance Professionals Directory | Connect with Investment Banking & M&A Experts",description:"Browse our directory of verified finance professionals including investment bankers, M&A advisors, private equity professionals, and corporate finance experts.",keywords:["finance professionals directory","investment banking experts","M&A advisors","finance networking"],type:"website"},groups:{title:"Finance Professional Groups | Industry-Specific Communities | APN",description:"Join specialized finance professional groups for investment banking, private equity, M&A, corporate finance, and more. Engage in industry discussions and knowledge sharing.",keywords:["finance groups","professional communities","investment banking groups","industry networking"],type:"website"}},_n=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n={"@context":"https://schema.org","@type":e};switch(e){case"Organization":return(0,s.A)((0,s.A)({},n),{},{name:Tn.siteName,url:Tn.siteUrl,logo:"".concat(Tn.siteUrl).concat(Tn.logo),description:Tn.defaultDescription,sameAs:[Tn.linkedinUrl,Tn.instagramUrl],contactPoint:{"@type":"ContactPoint",contactType:"customer service",availableLanguage:"English"}
2,foundingDate:"2020",industry:"Financial Services",numberOfEmployees:"10-50"},t);case"WebSite":return(0,s.A)((0,s.A)({},n),{},{name:Tn.siteName,url:Tn.siteUrl,description:Tn.defaultDescription,publisher:{"@type":"Organization",name:Tn.siteName},potentialAction:{"@type":"SearchAction",target:"".concat(Tn.siteUrl,"/search?q={search_term_string}"),"query-input":"required name=search_term_string"}},t);case"JobPosting":return(0,s.A)((0,s.A)({},n),{},{title:t.title,description:t.description,hiringOrganization:{"@type":"Organization",name:t.company,sameAs:t.companyUrl},jobLocation:{"@type":"Place",address:{"@type":"PostalAddress",addressLocality:t.location}},employmentType:t.jobType,datePosted:t.datePosted,validThrough:t.validThrough,baseSalary:t.salary?{"@type":"MonetaryAmount",currency:"USD",value:{"@type":"QuantitativeValue",value:t.salary,unitText:"YEAR"}}:void 0},t);case"Event":return(0,s.A)((0,s.A)({},n),{},{name:t.title,description:t.description,startDate:t.startDate,endDate:t.endDate,location:{"@type":t.isVirtual?"VirtualLocation":"Place",name:t.location,address:t.isVirtual?void 0:{"@type":"PostalAddress",addressLocality:t.city,addressRegion:t.state},url:t.isVirtual?t.virtualUrl:void 0},organizer:{"@type":"Organization",name:Tn.siteName,url:Tn.siteUrl},offers:t.ticketPrice?{"@type":"Offer",price:t.ticketPrice,priceCurrency:"USD",availability:"https://schema.org/InStock"}:void 0},t);case"Article":return(0,s.A)((0,s.A)({},n),{},{headline:t.title,description:t.excerpt,author:{"@type":"Person",name:t.author},publisher:{"@type":"Organization",name:Tn.siteName,logo:{"@type":"ImageObject",url:"".concat(Tn.siteUrl).concat(Tn.logo)}},datePublished:t.publishedAt,dateModified:t.updatedAt||t.publishedAt,image:t.image?"".concat(Tn.siteUrl).concat(t.image):void 0,mainEntityOfPage:{"@type":"WebPage","@id":"".concat(Tn.siteUrl,"/news/").concat(t.slug)}},t);default:return n}},In=function(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const n=(0,s.A)((0,s.A)({},Pn.home),t);document.title=n.title;const r=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!t)return;const r=n?'meta[property="'.concat(e,'"]'):'meta[name="'.concat(e,'"]');let s=document.querySelector(r);s||(s=document.createElement("meta"),n?s.setAttribute("property",e):s.setAttribute("name",e),document.head.appendChild(s)),s.setAttribute("content",t)};r("description",n.description),r("keywords",null===(e=n.keywords)||void 0===e?void 0:e.join(", ")),r("author",Tn.author),r("robots","index, follow"),r("og:title",n.title,!0),r("og:description",n.description,!0),r("og:type",n.type||"website",!0),r("og:url","".concat(Tn.siteUrl).concat(n.path||""),!0),r("og:site_name",Tn.siteName,!0),r("og:image","".concat(Tn.siteUrl).concat(n.image||Tn.logo),!0),r("twitter:card","summary_large_image"),r("twitter:site",Tn.twitterHandle),r("twitter:title",n.title),r("twitter:description",n.description),r("twitter:image","".concat(Tn.siteUrl).concat(n.image||Tn.logo)),r("linkedin:owner",Tn.linkedinUrl)},Dn=e=>{const t=document.querySelector('script[type="application/ld+json"][data-dynamic="true"]');t&&t.remove();const n=document.createElement("script");n.type="application/ld+json",n.setAttribute("data-dynamic","true"),n.textContent=JSON.stringify(e),document.head.appendChild(n)},Rn=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=document.querySelector('link[rel="canonical"]');t||(t=document.createElement("link"),t.rel="canonical",document.head.appendChild(t)),t.href="".concat(Tn.siteUrl).concat(e)},Ln=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const n=se();(0,e.useEffect)(()=>{const e=Mn(n.pathname),r=(0,s.A)((0,s.A)((0,s.A)({},e),t),{},{path:n.pathname});if(In(r),Rn(n.pathname),r.structuredData)Dn(r.structuredData);else{const e=_n("Organization");Dn(e)}},[n.pathname,t])},Mn=e=>"/"===e||"/home"===e?Pn.home:e.startsWith("/about")?Pn.about:e.includes("membership")?Pn.membership:e.startsWith("/events")?Pn.events:e.startsWith("/jobs")?Pn.jobs:e.startsWith("/projects")?Pn.projects:e.startsWith("/directory")||e.startsWith("/members")?Pn.directory:e.startsWith("/groups")?Pn.groups:Pn.home,On=async()=>{try{console.log("\ud83d\udd0d Debugging events in Firebase...");const e=await(0,wn.kQ)(50,!1);console.log("\ud83d\udcca Total events found:",e.length),e.length>0?(console.log("\ud83d\udccb Event structure analysis:"),e.forEach((e,t)=>{console.log("\n--- Event ".concat(t+1," ---")),console.log("ID:",e.i
2d),console.log("Title:",e.title),console.log("Has imageUrl:",!!e.imageUrl),console.log("Has image:",!!e.image),console.log("imageUrl value:",e.imageUrl),console.log("image value:",e.image),console.log("All fields:",Object.keys(e)),console.log("Start Date:",e.startDate),console.log("Location:",e.location)})):console.log("\u274c No events found in Firebase");const t=await(0,wn.kQ)(20,!0);return console.log("\n\ud83d\udd2e Upcoming events found:",t.length),t.length>0&&(console.log("\ud83d\udccb Upcoming events details:"),t.forEach((e,t)=>{console.log("\n--- Upcoming Event ".concat(t+1," ---")),console.log("ID:",e.id),console.log("Title:",e.title),console.log("Start Date:",e.startDate),console.log("Image URL:",e.imageUrl),console.log("Image field:",e.image)})),{allEvents:e,upcomingEvents:t}}catch(e){return console.error("\u274c Error debugging events:",e),{allEvents:[],upcomingEvents:[]}}};window.debugEventsInFirebase=On,window.updateEventsWithDefaultImages=async()=>{try{console.log("\ud83d\udd27 Updating events with default images...");const{updateEvent:e}=await Promise.resolve().then(n.bind(n,193)),t=await(0,wn.kQ)(50,!1);let r=0;for(const n of t)n.imageUrl||n.image||(console.log('\ud83d\udcdd Updating event "'.concat(n.title,'" with default image...')),await e(n.id,{imageUrl:"/apn-logos/APN-blue (1).png"}),r++);return console.log("\u2705 Updated ".concat(r," events with default images")),r}catch(e){return console.error("\u274c Error updating events:",e),0}};const Fn=()=>{const{currentUser:t}=sn(),n=!!t,[r,s]=(0,e.useState)([]),[a,i]=(0,e.useState)(!0);Ln({structuredData:[_n("Organization"),_n("WebSite")]}),(0,e.useEffect)(()=>{(async()=>{try{i(!0),await On();const e=(await(0,wn.kQ)(20,!0)).slice(0,3).map(e=>{var t;return console.log("\ud83d\uddbc\ufe0f Event image data:",{id:e.id,title:e.title,imageUrl:e.imageUrl,image:e.image,allFields:Object.keys(e)}),{id:e.id,title:e.title,image:e.imageUrl||e.image||"/apn-logos/APN-blue (1).png",date:null!==(t=e.startDate)&&void 0!==t&&t.toDate?e.startDate.toDate():new Date(e.startDate),location:e.location}});s(e)}catch(e){console.error("Error loading upcoming events for homepage:",e),s([])}finally{i(!1)}})()},[]);return(0,nn.jsxs)("div",{children:[(0,nn.jsx)("section",{className:"bg-apn-blue text-white py-16",children:(0,nn.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:(0,nn.jsxs)("div",{className:"text-center",children:[(0,nn.jsx)("div",{className:"flex justify-center mb-6",children:(0,nn.jsx)("img",{src:"".concat("","/apn-logos/APN-Tag-white.jpg"),alt:"APN Logo",className:"h-24"})}),(0,nn.jsx)("h1",{className:"text-4xl font-bold mb-4",children:"Accelerated Professionals Network"}),(0,nn.jsx)("p",{className:"text-xl mb-8",children:"A community of finance professionals collaborating to create a more seamless M&A transaction process."}),(0,nn.jsxs)("div",{className:"flex justify-center space-x-4",children:[(0,nn.jsx)(dt,{to:"/about/membership",className:"btn-primary bg-white text-apn-blue hover:bg-gray-100",children:"Join APN"}),(0,nn.jsx)(dt,{to:"/events",className:"btn-secondary bg-transparent text-white border-white hover:bg-apn-light-blue hover:border-transparent",children:"Upcoming Events"})]})]})})}),!n&&(0,nn.jsx)("section",{className:"bg-gray-100 py-8",children:(0,nn.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:(0,nn.jsxs)("div",{className:"text-center",children:[(0,nn.jsx)("h2",{className:"text-2xl font-bold mb-4",children:"Membership Tiers"}),(0,nn.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-5 gap-4",children:[(0,nn.jsxs)("div",{className:"bg-white p-4 rounded shadow",children:[(0,nn.jsx)("h3",{className:"font-bold text-lg",children:"Tier 1"}),(0,nn.jsx)("p",{className:"text-apn-blue font-bold",children:"$75/year"}),(0,nn.jsx)(dt,{to:"/about/membership",className:"text-sm text-apn-blue hover:underline",children:"Learn More"})]}),(0,nn.jsxs)("div",{className:"bg-white p-4 rounded shadow",children:[(0,nn.jsx)("h3",{className:"font-bold text-lg",children:"Tier 2"}),(0,nn.jsx)("p",{className:"text-apn-blue font-bold",children:"$125/year"}),(0,nn.jsx)(dt,{to:"/about/membership",className:"text-sm text-apn-blue hover:underline",children:"Learn More"})]}),(0,nn.jsxs)("div",{className:"bg-white p-4 rounded shadow",children:[(0,nn.jsx)("h3",{className:"font-bold text-lg",children:"Tier 3"}),(0,nn.jsx)("p",{className:"text-apn-blue font-bold",children:"$175/year"}),(0,nn.jsx)(dt,{to:"/about/membership",className:"text-sm text-apn-blue hover:underline",children:"Learn More"})]}),(0,nn.jsxs)("div",{className:"bg-white p-4 rounded shadow",children:[(0,nn.jsx)("h3",{className:"font-bold text-lg",children:"Tier 4"}),(0,nn.jsx)("p",{className:"text-apn-blue font-bold",children:"$225/year"}),(0,nn.jsx)(dt,{to:"/about/membership",className:"text-sm text-apn-blue hover:underline",children:"Learn More"})]}),(0,nn.jsxs)("div",{className:"bg-white p-4 rounded shadow",children:[(0,nn.jsx)("h3",{className:"font-bold text-lg",children:"Tier Vet"}),(0,nn.jsx)("p",{className:"text-apn-blue font-bold",children:"$75/year"}),(0,nn.jsx)("p",{className:"text-xs text-gray-500",children:"For protected veterans"}),(0,nn.jsx)(dt,{to:"/about/membership",className:"text-sm text-apn-blue hover:underline",children:"Learn More"})]})]})]})})}),(0,nn.jsx)("section",{className:"py-12",children:(0,nn.jsxs)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[(0,nn.jsx)("h2",{className:"text-2xl font-bold mb-6",children:"Upcoming Events"}),a?(0,nn.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[1,2,3].map(e=>(0,nn.jsxs)("div",{className:"bg-white rounded-lg shadow overflow-hidden animate-pulse",children:[(0,nn.jsx)("div",{className:"h-48 bg-gray-200"}),(0,nn.jsxs)("div",{className:"p-4",children:[(0,nn.jsx)("div",{className:"h-4 bg-gray-200 rounded mb-2"}),(0,nn.jsx)("div",{className:"h-3 bg-gray-200 rounded mb-2 w-3/4"}),(0,nn.jsx)("div",{className:"h-3 bg-gray-200 rounded w-1/2"})]})]},e))}):r.length>0?(0,nn.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:r.map(e=>(0,nn.jsxs)("div",{className:"bg-white rounded-lg shadow overflow-hidden",children:[(0,nn.jsx)(dt,{to:"/events/".concat(e.id),className:"block h-48 bg-white relative overflow-hidden",children:(0,nn.jsx)("div",{className:"h-full w-full overflow-hidden flex items-center justify-center bg-white",children:(0,nn.jsx)("img",{src:e.image?e.image.startsWith("http")?e.image:"".concat("").concat(e.image):"".concat("","/apn-logos/APN-blue (1).png"),alt:e.title,className:"h-full w-full object-contain transition-transform duration-300 hover:scale-105",onError:e=>{e.target.onerror=null,e.target.src="".concat("","/apn-logos/APN-blue (1).png")}})})}),(0,nn.jsxs)("div",{className:"p-4",children:[(0,nn.jsx)("h3",{className:"font-bold text-lg mb-2",children:e.title}),(0,nn.jsxs)("p",{className:"text-gray-600 mb-2",children:[e.date instanceof Date?e.date.toLocaleDateString("en-US",{weekday:"long",year:"numeric",month:"long",day:"numeric"}):e.date," \u2022 ",e.location]}),(0,nn.jsx)(dt,{to:"/events/".concat(e.id),className:"text-apn-blue hover:underline",children:"View Details"})]})]},e.id))}):(0,nn.jsxs)("div",{className:"text-center py-8",children:[(0,nn.jsx)("p",{className:"text-gray-600 mb-4",children:"No upcoming events at this time."}),(0,nn.jsx)(dt,{to:"/events",className:"text-apn-blue hover:underline",children:"View all events"})]}),!a&&r.length>0&&(0,nn.jsx)("div",{className:"mt-6 text-center",children:(0,nn.jsx)(dt,{to:"/events",className:"btn-primary",children:"View All Events"})})]})}),(0,nn.jsx)("section",{className:"py-12 bg-gray-50",children:(0,nn.jsxs)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[(0,nn.jsx)("h2",{className:"text-2xl font-bold mb-6",children:"Latest News"}),(0,nn.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[{id:2,title:"APN Q1 NEWSLETTER",image:"/images/news/q1-newsletter-full.png",category:"News",excerpt:"Check out our Q1 newsletter for the latest updates and industry insights."}].map(e=>(0,nn.jsxs)("div",{className:"bg-white rounded-lg shadow overflow-hidden",children:[(0,nn.jsx)(dt,{to:"/news/".concat(e.id),className:"block h-48 bg-white relative overflow-hidden",children:(0,nn.jsx)("div",{className:"h-full w-full overflow-hidden flex items-center justify-center bg-white",children:(0,nn.jsx)("img",{src:"".concat("").concat(e.image),alt:e.title,className:"h-full w-full object-contain transition-transform duration-300 hover:scale-105",onError:e=>{e.target.onerror=null,e.target.src="".concat("","/apn-logos/APN-blue (1).png")}})})}),(0,nn.jsxs)("div",{className:"p-4",children:[(0,nn.jsx)("span",{className:"inline-block bg-apn-blue text-white text-xs px-2 py-1 rounded mb-2",children:e.category}),(0,nn.jsx)("h3",{className:"font-bold text-lg mb-2",children:e.title}),(0,nn.jsx)("p",{className:"text-gray-600 mb-2",children:e.excerpt}),(0,nn.jsx)(dt,{to:"/news/".concat(e.id),className:"text-apn-blue hover:underline",children:"Read More"})]})]},e.id))}),(0,nn.jsx)("div",{className:"mt-6 text-center",children:(0,nn.jsx)(dt,{to:"/news",className:"btn-primary",children:"View All News"})})]})}),!1,(0,nn.jsx)("section",{className:"bg-apn-blue text-white py-12",children:(0,nn.jsxs)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 text-center",children:[(0,nn.jsx)("div",{className:"flex justify-center mb-6",children:(0,nn.jsx)("img",{src:"".concat("","/apn-logos/APN-Tag-SQ-white.jpg"),alt:"APN Logo Square",className:"h-20"})}),(0,nn.jsx)("h2",{className:"text-3xl font-bold mb-4",children:"Ready to Join the Network?"}),(0,nn.jsx)("p",{className:"text-xl mb-8 max-w-3xl mx-auto",children:"Connect with finance professionals, access exclusive resources, and accelerate your career with APN."}),(0,nn.jsx)(dt,{to:"/register",className:"btn-primary bg-white text-apn-blue hover:bg-gray-100",children:"Become a Member Today"})]})}),(0,nn.jsx)("section",{className:"py-12",children:(0,nn.jsxs)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[(0,nn.jsx)("h2",{className:"text-2xl font-bold mb-6 text-center",children:"Member Benefits"}),(0,nn.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-8",children:[(0,nn.jsxs)("div",{className:"bg-white p-6 rounded-lg shadow text-center",children:[(0,nn.jsx)("div",{className:"text-apn-blue mb-4",children:(0,nn.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-12 w-12 mx-auto",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2
20 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z"})})}),(0,nn.jsx)("h3",{className:"text-xl font-bold mb-2",children:"Networking"}),(0,nn.jsx)("p",{className:"text-gray-600",children:"Connect with finance professionals across various sectors including private equity, investment banking, accounting, and more."})]}),(0,nn.jsxs)("div",{className:"bg-white p-6 rounded-lg shadow text-center",children:[(0,nn.jsx)("div",{className:"text-apn-blue mb-4",children:(0,nn.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-12 w-12 mx-auto",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 13.255A23.931 23.931 0 0112 15c-3.183 0-6.22-.62-9-1.745M16 6V4a2 2 0 00-2-2h-4a2 2 0 00-2 2v2m4 6h.01M5 20h14a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})})}),(0,nn.jsx)("h3",{className:"text-xl font-bold mb-2",children:"Job Opportunities"}),(0,nn.jsx)("p",{className:"text-gray-600",children:"Access exclusive job postings and career opportunities through our dedicated job board for finance professionals."})]}),(0,nn.jsxs)("div",{className:"bg-white p-6 rounded-lg shadow text-center",children:[(0,nn.jsx)("div",{className:"text-apn-blue mb-4",children:(0,nn.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-12 w-12 mx-auto",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})})}),(0,nn.jsx)("h3",{className:"text-xl font-bold mb-2",children:"Events"}),(0,nn.jsx)("p",{className:"text-gray-600",children:"Attend exclusive networking events, workshops, and conferences designed for finance professionals."})]})]})]})})]})},Un=()=>{const{userProfile:t,currentUser:n,isAdmin:r}=sn(),s=(new Date).toISOString().slice(0,10),a=n?"apn_profile_banner_dismissed_".concat(n.uid,"_").concat(s):null,[i,o]=(0,e.useState)(()=>{try{return!!a&&"1"===localStorage.getItem(a)}catch(Nd){return!1}}),l="function"===typeof r?r():r,c="approved"===(null===t||void 0===t?void 0:t.status)||"member"===(null===t||void 0===t?void 0:t.role);if(!t||l||!c)return null;if((e=>{if(!e)return!1;if(e.profileCompleted)return!0;const t=e.jobTitle||e.title,n=e.aboutMe||e.bio;return Boolean(t&&e.company&&n&&e.city&&e.state)})(t)||i)return null;return(0,nn.jsxs)("div",{className:"mb-6 rounded-lg border border-apn-blue bg-blue-50 p-4 sm:flex sm:items-center sm:justify-between",children:[(0,nn.jsxs)("div",{className:"flex items-start sm:items-center",children:[(0,nn.jsx)("svg",{className:"h-6 w-6 text-apn-blue flex-shrink-0 mt-0.5 sm:mt-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"})}),(0,nn.jsxs)("div",{className:"ml-3",children:[(0,nn.jsx)("p",{className:"text-sm font-semibold text-apn-dark-blue",children:"Finish setting up your profile"}),(0,nn.jsx)("p",{className:"text-sm text-gray-600",children:"Add your title, company and a short bio so other members can find and connect with you in the directory."})]})]}),(0,nn.jsxs)("div",{className:"mt-3 sm:mt-0 sm:ml-4 flex items-center gap-2 flex-shrink-0",children:[(0,nn.jsx)(dt,{to:"/profile/complete",className:"inline-flex items-center px-4 py-2 rounded-md bg-apn-blue text-white text-sm font-medium hover:bg-apn-dark-blue",children:"Complete profile"}),(0,nn.jsx)("button",{onClick:()=>{try{a&&localStorage.setItem(a,"1")}catch(Nd){}o(!0)},"aria-label":"Dismiss reminder",className:"p-2 text-gray-400 hover:text-gray-600",children:(0,nn.jsx)("svg",{className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 18L18 6M6 6l12 12"})})})]})]})},Bn=e=>{if(!e)return null;if("function"===typeof e.toDate)return e.toDate();if("number"===typeof e.seconds)return new Date(1e3*e.seconds);const t=new Date(e);return isNaN(t.getTime())?null:t},zn=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n=Bn(e);return n?n.toLocaleDateString():t};function Vn(){var t;const{currentUser:n,userProfile:r,membership:a,isActiveMember:i,hasRole:o}=sn(),[l,c]=(oe(),(0,e.useState)([])),[d,u]=(0,e.useState)([]),[m,h]=(0,e.useState)([]),[,p]=(0,e.useState)([]),[g,f]=(0,e.useState)([]),[x,b]=(0,e.useState)([]),[y,v]=(0,e.useState)(!0),[w,j]=(0,e.useState)(null),N=o("admin");return(0,e.useEffect)(()=>{!async function(){try{v(!0),j(null),console.log("Fetching dashboard data...");const[t,n,r]=await Promise.all([(0,wn.zA)(5).catch(e=>(console.error("Error fetching jobs:",e),[])),(0,wn.JQ)(5).catch(e=>(console.error("Error fetching projects:",e),[])),(0,wn.kQ)(5,!0).catch(e=>(console.error("Error fetching events:",e),[]))]);if(console.log("Fetched data:",{jobs:t,projects:n,events:r}),c(t),u(n),h(r),N||i())try{const[e,t]=await Promise.all([(0,wn.f)(10).catch(e=>(console.error("Error fetching groups:",e),[])),(0,wn.GE)(5,null,N).catch(e=>(console.error("Error fetching articles:",e),[]))]);if(console.log("Fetched additional data:",{groups:e,articles:t}),p(e),b(t),N&&e.length>0){const t=await Promise.all(e.slice(0,5).map(async e=>{try{var t;const n=await(0,wn.PJ)(e.id),r=n.filter(e=>{var t,n;return((null===(t=e.createdAt)||void 0===t||null===(n=t.toDate)||void 0===n?void 0:n.call(t))||new Date(0))>new Date(Date.now()-864e5)});return(0,s.A)((0,s.A)({},e),{},{recentPostCount:r.length,lastActivity:n.length>0?null===(t=n[0])||void 0===t?void 0:t.createdAt:null})}catch(n){return console.error("Error fetching posts for group ".concat(e.id,":"),n),(0,s.A)((0,s.A)({},e),{},{recentPostCount:0,lastActivity:null})}}));f(t.filter(e=>e.recentPostCount>0))}}catch(e){console.error("Error fetching additional data:",e)}}catch(w){console.error("Error fetching dashboard data:",w),j(w.message)}finally{v(!1)}}()},[N,i]),y?(0,nn.jsx)("div",{className:"flex justify-center items-center h-screen",children:(0,nn.jsx)("div",{className:"animate-spin rounded-full h-12 w-12 border-t-2 border-b-2 border-apn-blue"})}):(0,nn.jsxs)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:[(0,nn.jsx)(Un,{}),(0,nn.jsxs)("div",{className:"mb-8",children:[(0,nn.jsxs)("h1",{className:"text-3xl font-bold text-gray-900",children:["Welcome back, ",(null===r||void 0===r?void 0:r.displayName)||(null===n||void 0===n?void 0:n.displayName)||"admin","!"]}),(0,nn.jsx)("p",{className:"mt-2 text-gray-600",children:"Here's what's happening in your professional network."}),w&&(0,nn.jsx)("div",{className:"mt-4 bg-yellow-50 border border-yellow-200 rounded-md p-4",children:(0,nn.jsxs)("p",{className:"text-yellow-800",children:["Some data may not be available: ",w]})})]}),N&&(0,nn.jsxs)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-6 mb-8",children:[(0,nn.jsx)("h2",{className:"text-xl font-bold text-blue-900 mb-4",children:"Admin Controls"}),(0,nn.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-6 gap-4",children:[(0,nn.jsxs)(dt,{to:"/admin/news-management",className:"flex flex-col items-center p-3 bg-white border border-blue-200 rounded-lg hover:bg-blue-50 transition-colors",children:[(0,nn.jsx)("svg",{className:"w-6 h-6 text-blue-600 mb-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M19 20H5a2 2 0 01-2-2V6a2 2 0 012-2h10a2 2 0 012 2v1m2 13a2 2 0 01-2-2V7m2 13a2 2 0 002-2V9.5a2 2 0 00-2-2h-2m-4-3H9M7 16h6M7 8h6v4H7V8z"})}),(0,nn.jsx)("span",{className:"text-xs font-medium text-blue-900",children:"News"})]}),(0,nn.jsxs)(dt,{to:"/admin/groups",className:"flex flex-col items-center p-3 bg-white border border-blue-200 rounded-lg hover:bg-blue-50 transition-colors",children:[(0,nn.jsx)("svg",{className:"w-6 h-6 text-blue-600 mb-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2
20 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z"})}),(0,nn.jsx)("span",{className:"text-xs font-medium text-blue-900",children:"Groups"})]}),(0,nn.jsxs)(dt,{to:"/admin/seed-data",className:"flex flex-col items-center p-3 bg-white border border-blue-200 rounded-lg hover:bg-blue-50 transition-colors",children:[(0,nn.jsx)("svg",{className:"w-6 h-6 text-blue-600 mb-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M4 7v10c0 2.21 3.582 4 8 4s8-1.79 8-4V7M4 7c0 2.21 3.582 4 8 4s8-1.79 8-4M4 7c0-2.21 3.582-4 8-4s8 1.79 8 4m0 5c0 2.21-3.582 4-8 4s-8-1.79-8-4"})}),(0,nn.jsx)("span",{className:"text-xs font-medium text-blue-900",children:"Data"})]}),(0,nn.jsxs)(dt,{to:"/admin/user-management",className:"flex flex-col items-center p-3 bg-white border border-blue-200 rounded-lg hover:bg-blue-50 transition-colors",children:[(0,nn.jsx)("svg",{className:"w-6 h-6 text-blue-600 mb-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 4.354a4 4 0 110 5.292M15 21H3v-1a6 6 0 0112 0v1zm0 0h6v-1a6 6 0 00-9-5.197m13.5-9a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0z"})}),(0,nn.jsx)("span",{className:"text-xs font-medium text-blue-900",children:"Users"})]}),(0,nn.jsxs)(dt,{to:"/admin/migrate-events",className:"flex flex-col items-center p-3 bg-white border border-blue-200 rounded-lg hover:bg-blue-50 transition-colors",children:[(0,nn.jsx)("svg",{className:"w-6 h-6 text-blue-600 mb-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})}),(0,nn.jsx)("span",{className:"text-xs font-medium text-blue-900",children:"Events"})]}),(0,nn.jsxs)(dt,{to:"/admin/testing",className:"flex flex-col items-center p-3 bg-white border border-blue-200 rounded-lg hover:bg-blue-50 transition-colors",children:[(0,nn.jsx)("svg",{className:"w-6 h-6 text-blue-600 mb-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M9.663 17h4.673M12 3v1m6.364 1.636l-.707.707M21 12h-1M4 12H3m3.343-5.657l-.707-.707m2.828 9.9a5 5 0 117.072 0l-.548.547A3.374 3.374 0 0014 18.469V19a2 2 0 11-4 0v-.531c0-.895-.356-1.754-.988-2.386l-.548-.547z"})}),(0,nn.jsx)("span",{className:"text-xs font-medium text-blue-900",children:"Testing"})]})]})]}),(0,nn.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6 mb-8",children:[(0,nn.jsxs)("div",{className:"bg-white overflow-hidden shadow rounded-lg",children:[(0,nn.jsx)("div",{className:"p-5",children:(0,nn.jsxs)("div",{className:"flex items-center",children:[(0,nn.jsx)("div",{className:"flex-shrink-0",children:(0,nn.jsx)("div",{className:"w-8 h-8 rounded-full flex items-center justify-center ".concat(i()?"bg-green-100":"bg-yellow-100"),children:(0,nn.jsx)("svg",{className:"w-5 h-5 ".concat(i()?"text-green-600":"text-yellow-600"),fill:"currentColor",viewBox:"0 0 20 20",children:(0,nn.jsx)("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"})})})}),(0,nn.jsx)("div",{className:"ml-5 w-0 flex-1",children:(0,nn.jsxs)("dl",{children:[(0,nn.jsx)("dt",{className:"text-sm font-medium text-gray-500 truncate",children:"Membership Status"}),(0,nn.jsx)("dd",{className:"text-lg font-medium text-gray-900",children:(null===r||void 0===r?void 0:r.membershipTier)||(i()?(null===a||void 0===a?void 0:a.tier)||"Active":"Pending")})]})})]})}),(0,nn.jsx)("div",{className:"bg-gray-50 px-5 py-3",children:(0,nn.jsx)("div",{className:"text-sm",children:i()?(0,nn.jsxs)("span",{className:"text-green-600",children:["Active until ",null===(t=Bn(null===a||void 0===a?void 0:a.endDate))||void 0===t?void 0:t.toLocaleDateString()]}):(0,nn.jsx)(dt,{to:"/register",className:"font-medium text-apn-blue hover:text-apn-dark-blue",children:"View membership options"})})})]}),(0,nn.jsxs)("div",{className:"bg-white overflow-hidden shadow rounded-lg",children:[(0,nn.jsx)("div",{className:"p-5",children:(0,nn.jsxs)("div",{className:"flex items-center",children:[(0,nn.jsx)("div",{className:"flex-shrink-0",children:(0,nn.jsx)("div",{className:"w-8 h-8 rounded-full flex items-center justify-center ".concat("approved"===(null===r||void 0===r?void 0:r.status)?"bg-green-100":"bg-yellow-100"),children:(0,nn.jsx)("svg",{className:"w-5 h-5 ".concat("approved"===(null===r||void 0===r?void 0:r.status)?"text-green-600":"text-yellow-600"),fill:"currentColor",viewBox:"0 0 20 20",children:(0,nn.jsx)("path",{fillRule:"evenodd",d:"M10 9a3 3 0 100-6 3 3 0 000 6zm-7 9a7 7 0 1114 0H3z",clipRule:"evenodd"})})})}),(0,nn.jsx)("div",{className:"ml-5 w-0 flex-1",children:(0,nn.jsxs)("dl",{children:[(0,nn.jsx)("dt",{className:"text-sm font-medium text-gray-500 truncate",children:"Profile Status"}),(0,nn.jsx)("dd",{className:"text-lg font-medium text-gray-900",children:"approved"===(null===r||void 0===r?void 0:r.status)?"Approved":"Pending Review"})]})})]})}),(0,nn.jsx)("div",{className:"bg-gray-50 px-5 py-3",children:(0,nn.jsx)("div",{className:"text-sm",children:(0,nn.jsx)(dt,{to:"/profile",className:"font-medium text-apn-blue hover:text-apn-dark-blue",children:"View profile"})})})]}),(0,nn.jsxs)("div",{className:"bg-white overflow-hidden shadow rounded-lg",children:[(0,nn.jsx)("div",{className:"p-5",children:(0,nn.jsxs)("div",{className:"flex items-center",children:[(0,nn.jsx)("div",{className:"flex-shrink-0",children:(0,nn.jsx)("div",{className:"w-8 h-8 bg-blue-100 rounded-full flex items-center justify-center",children:(0,nn.jsx)("svg",{className:"w-5 h-5 text-blue-600",fill:"currentColor",viewBox:"0 0 20 20",children:(0,nn.jsx)("path",{d:"M13 6a3 3 0 11-6 0 3 3 0 016 0zM18 8a2 2 0 11-4 0 2 2
20 014 0zM14 15a4 4 0 00-8 0v3h8v-3z"})})})}),(0,nn.jsx)("div",{className:"ml-5 w-0 flex-1",children:(0,nn.jsxs)("dl",{children:[(0,nn.jsx)("dt",{className:"text-sm font-medium text-gray-500 truncate",children:"Network Activity"}),(0,nn.jsx)("dd",{className:"text-lg font-medium text-gray-900",children:"Active"})]})})]})}),(0,nn.jsx)("div",{className:"bg-gray-50 px-5 py-3",children:(0,nn.jsx)("div",{className:"text-sm",children:(0,nn.jsx)(dt,{to:"/directory",className:"font-medium text-apn-blue hover:text-apn-dark-blue",children:"Browse directory"})})})]})]}),(0,nn.jsx)("div",{className:"bg-white shadow rounded-lg mb-8",children:(0,nn.jsxs)("div",{className:"px-4 py-5 sm:p-6",children:[(0,nn.jsx)("h3",{className:"text-lg leading-6 font-medium text-gray-900 mb-4",children:"Quick Actions"}),(0,nn.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-4",children:[(0,nn.jsxs)(dt,{to:"/jobs/create",className:"flex flex-col items-center p-4 border border-gray-200 rounded-lg hover:bg-gray-50 transition-colors",children:[(0,nn.jsx)("svg",{className:"w-8 h-8 text-apn-blue mb-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 6v6m0 0v6m0-6h6m-6 0H6"})}),(0,nn.jsx)("span",{className:"text-sm font-medium text-gray-900",children:"Post Job"})]}),(0,nn.jsxs)(dt,{to:"/projects/create",className:"flex flex-col items-center p-4 border border-gray-200 rounded-lg hover:bg-gray-50 transition-colors",children:[(0,nn.jsx)("svg",{className:"w-8 h-8 text-apn-blue mb-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10"})}),(0,nn.jsx)("span",{className:"text-sm font-medium text-gray-900",children:"Post Project"})]}),N&&(0,nn.jsxs)(dt,{to:"/admin/events/create",className:"flex flex-col items-center p-4 border border-gray-200 rounded-lg hover:bg-gray-50 transition-colors",children:[(0,nn.jsx)("svg",{className:"w-8 h-8 text-green-600 mb-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})}),(0,nn.jsx)("span",{className:"text-sm font-medium text-gray-900",children:"Post Event"})]}),N&&(0,nn.jsxs)(dt,{to:"/admin/news-management",className:"flex flex-col items-center p-4 border border-gray-200 rounded-lg hover:bg-gray-50 transition-colors",children:[(0,nn.jsx)("svg",{className:"w-8 h-8 text-purple-600 mb-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M19 20H5a2 2 0 01-2-2V6a2 2 0 012-2h10a2 2 0 012 2v1m2 13a2 2 0 01-2-2V7m2 13a2 2 0 002-2V9.5a2 2 0 00-2-2h-2m-4-3H9M7 16h6M7 8h6v4H7V8z"})}),(0,nn.jsx)("span",{className:"text-sm font-medium text-gray-900",children:"Post News"})]}),(0,nn.jsxs)(dt,{to:"/events",className:"flex flex-col items-center p-4 border border-gray-200 rounded-lg hover:bg-gray-50 transition-colors",children:[(0,nn.jsx)("svg",{className:"w-8 h-8 text-apn-blue mb-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})}),(0,nn.jsx)("span",{className:"text-sm font-medium text-gray-900",children:"View Events"})]}),(0,nn.jsxs)(dt,{to:"/groups",className:"flex flex-col items-center p-4 border border-gray-200 rounded-lg hover:bg-gray-50 transition-colors",children:[(0,nn.jsx)("svg",{className:"w-8 h-8 text-apn-blue mb-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.25
25-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})}),(0,nn.jsx)("span",{className:"text-sm font-medium text-gray-900",children:"Groups"})]})]})]})}),(0,nn.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-8",children:[(0,nn.jsx)("div",{className:"bg-white shadow rounded-lg",children:(0,nn.jsxs)("div",{className:"px-4 py-5 sm:p-6",children:[(0,nn.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,nn.jsx)("h3",{className:"text-lg leading-6 font-medium text-gray-900",children:"Recent Jobs"}),(0,nn.jsx)(dt,{to:"/jobs",className:"text-sm font-medium text-apn-blue hover:text-apn-dark-blue",children:"View all"})]}),(0,nn.jsx)("div",{className:"space-y-3",children:l.length>0?l.map(e=>(0,nn.jsxs)(dt,{to:"/jobs/".concat(e.id),className:"block border-l-4 border-apn-blue pl-4 hover:bg-gray-50 rounded-r-md p-2 transition-colors",children:[(0,nn.jsx)("h4",{className:"text-sm font-medium text-gray-900",children:e.title}),(0,nn.jsx)("p",{className:"text-sm text-gray-600",children:e.company}),(0,nn.jsx)("p",{className:"text-xs text-gray-500",children:e.location})]},e.id)):(0,nn.jsx)("p",{className:"text-sm text-gray-500",children:"No recent jobs available."})})]})}),(0,nn.jsx)("div",{className:"bg-white shadow rounded-lg",children:(0,nn.jsxs)("div",{className:"px-4 py-5 sm:p-6",children:[(0,nn.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,nn.jsx)("h3",{className:"text-lg leading-6 font-medium text-gray-900",children:"Recent Projects"}),(0,nn.jsx)(dt,{to:"/projects",className:"text-sm font-medium text-apn-blue hover:text-apn-dark-blue",children:"View all"})]}),(0,nn.jsx)("div",{className:"space-y-3",children:d.length>0?d.map(e=>(0,nn.jsxs)(dt,{to:"/projects/".concat(e.id),className:"block border-l-4 border-green-500 pl-4 hover:bg-gray-50 rounded-r-md p-2 transition-colors",children:[(0,nn.jsx)("h4",{className:"text-sm font-medium text-gray-900",children:e.title}),(0,nn.jsx)("p",{className:"text-sm text-gray-600",children:e.budgetRange}),(0,nn.jsx)("p",{className:"text-xs text-gray-500",children:e.timeline})]},e.id)):(0,nn.jsx)("p",{className:"text-sm text-gray-500",children:"No recent projects available."})})]})}),(0,nn.jsx)("div",{className:"bg-white shadow rounded-lg",children:(0,nn.jsxs)("div",{className:"px-4 py-5 sm:p-6",children:[(0,nn.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,nn.jsx)("h3",{className:"text-lg leading-6 font-medium text-gray-900",children:"Upcoming Events"}),(0,nn.jsx)(dt,{to:"/events",className:"text-sm font-medium text-apn-blue hover:text-apn-dark-blue",children:"View all"})]}),(0,nn.jsx)("div",{className:"space-y-3",children:m.length>0?m.map(e=>{var t,n,r;return(0,nn.jsxs)(dt,{to:"/events/".concat(e.id),className:"block border-l-4 border-purple-500 pl-4 hover:bg-gray-50 rounded-r-md p-2 transition-colors",children:[(0,nn.jsx)("h4",{className:"text-sm font-medium text-gray-900",children:e.title}),(0,nn.jsx)("p",{className:"text-sm text-gray-600",children:e.location}),(0,nn.jsx)("p",{className:"text-xs text-gray-500",children:(null===(t=e.startDate)||void 0===t||null===(n=t.toDate)||void 0===n||null===(r=n.call(t))||void 0===r?void 0:r.toLocaleDateString())||"Date TBD"})]},e.id)}):(0,nn.jsx)("p",{className:"text-sm text-gray-500",children:"No upcoming events."})})]})})]}),N&&(0,nn.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8 mt-8",children:[(0,nn.jsx)("div",{className:"bg-white shadow rounded-lg",children:(0,nn.jsxs)("div",{className:"px-4 py-5 sm:p-6",children:[(0,nn.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,nn.jsx)("h3",{className:"text-lg leading-6 font-medium text-gray-900",children:"Groups with Recent Activity"}),(0,nn.jsx)(dt,{to:"/admin/groups",className:"text-sm font-medium text-apn-blue hover:text-apn-dark-blue",children:"Manage all"})]}),(0,nn.jsx)("div",{className:"space-y-3",children:g.length>0?g.map(e=>(0,nn.jsxs)(dt,{to:"/groups/".concat(e.id),className:"block border-l-4 border-orange-500 pl-4 hover:bg-gray-50 rounded-r-md p-2 transition-colors",children:[(0,nn.jsx)("h4",{className:"text-sm font-medium text-gray-900",children:e.name}),(0,nn.jsxs)("p",{className:"text-sm text-gray-600",children:[e.recentPostCount," new posts"]}),(0,nn.jsxs)("p",{className:"text-xs text-gray-500",children:[e.memberCount," members"]})]},e.id)):(0,nn.jsx)("p",{className:"text-sm text-gray-500",children:"No recent group activity."})})]})}),(0,nn.jsx)("div",{className:"bg-white shadow rounded-lg",children:(0,nn.jsxs)("div",{className:"px-4 py-5 sm:p-6",children:[(0,nn.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,nn.jsx)("h3",{className:"text-lg leading-6 font-medium text-gray-900",children:"Recent News Articles"}),(0,nn.jsx)(dt,{to:"/admin/news-management",className:"text-sm font-medium text-apn-blue hover:text-apn-dark-blue",children:"Manage news"})]}),(0,nn.jsx)("div",{className:"space-y-3",children:x.length>0?x.map(e=>{var t,n,r;return(0,nn.jsxs)(dt,{to:"/news/".concat(e.id),className:"block border-l-4 border-red-500 pl-4 hover:bg-gray-50 rounded-r-md p-2 transition-colors",children:[(0,nn.jsx)("h4",{className:"text-sm font-medium text-gray-900",children:e.title}),(0,nn.jsx)("p",{className:"text-sm text-gray-600",children:e.category}),(0,nn.jsx)("p",{className:"text-xs text-gray-500",children:(null===(t=e.publishedAt)||void 0===t||null===(n=t.toDate)||void 0===n||null===(r=n.call(t))||void 0===r?void 0:r.toLocaleDateString())||e.date})]},e.id)}):(0,nn.jsx)("p",{className:"text-sm text-gray-500",children:"No recent articles."})})]})})]})]})}function qn(){const{currentUser:t,userProfile:n,logout:r}=sn(),s=se(),[a,i]=(0,e.useState)(null);(0,e.useEffect)(()=>{var e;null!==(e=s.state)&&void 0!==e&&e.userData&&i(s.state.userData)},[s.state]);return(0,nn.jsxs)("div",{className:"min-h-screen bg-gray-50 flex flex-col justify-center py-12 sm:px-6 lg:px-8",children:[(0,nn.jsxs)("div",{className:"sm:mx-auto sm:w-full sm:max-w-md",children:[(0,nn.jsx)("img",{className:"mx-auto h-12 w-auto",src:"/apn-logos/APN-Tag-blue.png",alt:"APN Logo"}),(0,nn.jsx)("h2",{className:"mt-6 text-center text-3xl font-extrabold text-gray-900",children:"Account Pending Approval"})]}),(0,nn.jsx)("div",{className:"mt-8 sm:mx-auto sm:w-full sm:max-w-md",children:(0,nn.jsx)("div",{className:"bg-white py-8 px-4 shadow sm:rounded-lg sm:px-10",children:(0,nn.jsxs)("div",{className:"text-center",children:[(0,nn.jsx)("div",{className:"mx-auto flex items-center justify-center h-12 w-12 rounded-full bg-yellow-100",children:(0,nn.jsx)("svg",{className:"h-6 w-6 text-yellow-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L3.732 16.5c-.77.833.192 2.5 1.732 2.5z"})})}),(0,nn.jsx)("h3",{className:"mt-4 text-lg font-medium text-gray-900",children:"Thank y
2ou for registering!"}),(0,nn.jsxs)("div",{className:"mt-4 text-sm text-gray-600",children:[(0,nn.jsx)("p",{className:"mb-4",children:"Your account has been created successfully. However, it's currently pending approval from our administrators."}),(0,nn.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded-md p-4 mb-4",children:(0,nn.jsxs)("div",{className:"text-left",children:[(0,nn.jsx)("h4",{className:"font-medium text-blue-900 mb-2",children:"Account Details:"}),(0,nn.jsxs)("ul",{className:"space-y-1 text-blue-800",children:[(0,nn.jsxs)("li",{children:[(0,nn.jsx)("strong",{children:"Name:"})," ",(null===n||void 0===n?void 0:n.displayName)||(null===a||void 0===a?void 0:a.displayName)||"Not available"]}),(0,nn.jsxs)("li",{children:[(0,nn.jsx)("strong",{children:"Email:"})," ",(null===t||void 0===t?void 0:t.email)||(null===a||void 0===a?void 0:a.email)||"Not available"]}),(0,nn.jsxs)("li",{children:[(0,nn.jsx)("strong",{children:"Company:"})," ",(null===n||void 0===n?void 0:n.company)||(null===a||void 0===a?void 0:a.company)||"Not provided"]}),(0,nn.jsxs)("li",{children:[(0,nn.jsx)("strong",{children:"Status:"})," ",(0,nn.jsx)("span",{className:"capitalize",children:(null===n||void 0===n?void 0:n.status)||"pending"})]})]})]})}),(0,nn.jsx)("p",{className:"mb-4",children:"You'll receive an email notification once your account has been approved. This typically takes 1-2 business days."}),(0,nn.jsxs)("div",{className:"bg-gray-50 border border-gray-200 rounded-md p-4 mb-4",children:[(0,nn.jsx)("h4",{className:"font-medium text-gray-900 mb-2",children:"What happens next?"}),(0,nn.jsxs)("ul",{className:"text-left text-gray-700 space-y-1 text-sm",children:[(0,nn.jsx)("li",{children:"\u2022 Our team will review your application"}),(0,nn.jsx)("li",{children:"\u2022 You'll receive an email when approved"}),(0,nn.jsx)("li",{children:"\u2022 Once approved, you can access all member features"}),(0,nn.jsx)("li",{children:"\u2022 You can then choose a membership tier"})]})]}),(0,nn.jsxs)("p",{className:"text-xs text-gray-500",children:["If you have any questions, please contact us at"," ",(0,nn.jsx)("a",{href:"mailto:[email protected]",className:"text-apn-blue hover:text-apn-dark-blue",children:"[email protected]"})]})]}),(0,nn.jsx)("div",{className:"mt-6",children:(0,nn.jsx)("button",{onClick:async()=>{try{await r()}catch(e){console.error("Error logging out:",e)}},className:"w-full flex justify-center py-2 px-4 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-apn-blue hover:bg-apn-dark-blue focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-apn-blue",children:"Sign Out"})})]})})})]})}const Wn={_origin:"https://api.emailjs.com"},Hn=(e,t,n)=>{if(!e)throw"The public key is required. Visit https://dashboard.emailjs.com/admin/account";if(!t)throw"The service ID is required. Visit https://dashboard.emailjs.com/admin";if(!n)throw"The template ID is required. Visit https://dashboard.emailjs.com/admin/templates";return!0};class Gn{constructor(e){this.status=e?e.status:0,this.text=e?e.responseText:"Network Error"}}const Yn=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return new Promise((r,s)=>{const a=new XMLHttpRequest;a.addEventListener("load",e=>{let{target:t}=e;const n=new Gn(t);200===n.status||"OK"===n.text?r(n):s(n)}),a.addEventListener("error",e=>{let{target:t}=e;s(new Gn(t))}),a.open("POST",Wn._origin+e,!0),Object.keys(n).forEach(e=>{a.setRequestHeader(e,n[e])}),a.send(t)})},Kn=(e,t,n,r)=>{const s=r||Wn._userID;Hn(s,e,t);const a={lib_version:"3.12.1",user_id:s,service_id:e,template_id:t,template_params:n};return Yn("/api/v1.0/email/send",JSON.stringify(a),{"Content-type":"application/json"})},Jn="announcement",$n=async(e,t)=>{try{const n=await Kn("your-emailjs-service-id",e,t,"your-emailjs-public-key");return console.log("Email sent successfully:",n),n}catch(n){throw console.error("Error sending email:",n),n}},Qn=t=>{let{onClose:r,onSuccess:a}=t;const{hasRole:i}=sn(),[o,l]=(0,e.useState)({title:"",message:"",actionUrl:"",includeActionButton:!1,emailService:"emailjs"}),[c,d]=(0,e.useState)(!1),[u,m]=(0,e.useState)(!1),h=i("admin"),p=async e=>{if(e.preventDefault(),h){d(!0);try{let e;e="constantcontact"===o.emailService?await Tt(o.title,o.message,o.includeActionButton?o.actionUrl:null):await async function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;try{const{getAllUsers:i}=await Promise.resolve().then(n.bind(n,193)),o=(await i(1e3)).filter(e=>"approved"===e.status&&e.email);if(0===o.length)throw new Error("No approved members found to send announcement to");const l={from_name:"APN Team",subject:"APN Announcement: ".concat(e),announcement_title:e,announcement_message:t,action_url:r||"",action_button:r?'<a href="'.concat(r,'" style="background-color: #3d67ad; color: white; padding: 12px 24px; text-decoration: none; border-radius: 5px;">Learn More</a>'):""},c=10,d=[];for(let e=0;e<o.length;e+=c){const t=o.slice(e,e+c);for(const e of t)try{const t=(0,s.A)((0,s.A)({},l),{},{to_email:e.email,to_name:e.firstName||"Member"}),n=await $n(Jn,t);d.push({success:!0,email:e.email,result:n}),await new Promise(e=>setTimeout(e,200))}catch(a){console.error("Error sending announcement to ".concat(e.email,":"),a),d.push({success:!1,email:e.email,error:a.message})}e+c<o.length&&await new Promise(e=>setTimeout(e,2e3))}const{addDoc:u,collection:m,serverTimestamp:h}=await Promise.resolve().then(n.bind(n,472)),{db:p}=await Promise.resolve().then(n.bind(n,791));return await u(m(p,"announcements"),{title:e,message:t,actionUrl:r,sentAt:h(),recipientCount:o.length,successCount:d.filter(e=>e.success).length,failureCount:d.filter(e=>!e.success).length}),{success:!0,totalRecipients:o.length,successCount:d.filter(e=>e.success).length,failureCount:d.filter(e=>!e.success).length,results:d}}catch(a){throw console.error("Error sending announcement:",a),a}}(o.title,o.message,o.includeActionButton?o.actionUrl:null),await(0,pn.zW)(o.title,o.message,o.includeActionButton?o.actionUrl:null);const t="constantcontact"===o.emailService?"Announcement sent successfully via Constant Contact and in-app notifications!":"Announcement sent successfully to ".concat(e.successCount," members via email and in-app notifications!");alert(t),a&&a(e),r&&r()}catch(t){console.error("Error sending announcement:",t),alert("Error sending announcement. Please try again.")}finally{d(!1)}}},g=e=>{const{name:t,value:n,type:r,checked:a}=e.target;l(e=>(0,s.A)((0,s.A)({},e),{},{[t]:"checkbox"===r?a:n}))};return h?(0,nn.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:(0,nn.jsxs)("div",{className:"bg-white rounded-lg p-6 w-full max-w-2xl max-h-[90vh] overflow-y-auto",children:[(0,nn.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,nn.jsx)("h2",{className:"text-2xl font-bold text-gray-900",children:"Send Announcement"}),(0,nn.jsx)("button",{onClick:r,className:"text-gray-400 hover:text-gray-600",children:(0,nn.jsx)("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 18L18 6M6 6l12 12"})})})]}),u?(0,nn.jsxs)("div",{children:[(0,nn.jsx)("h3",{className:"text-lg font-medium text-gray-900 mb-4",children:"Preview"}),(0,nn.jsxs)("div",{className:"border border-gray-200 rounded-lg p-4 bg-gray-50",children:[(0,nn.jsx)("div",{className:"bg-apn-blue text-white p-4 rounded-t-lg",children:(0,nn.jsx)("h1",{className:"text-xl font-bold",children:"Accelerated Professionals Network"})}),(0,nn.jsxs)("div",{className:"bg-white p-6 rounded-b-lg",children:[(0,nn.jsx)("h2",{className:"text-xl font-bold text-gray-900 mb-4",children:o.title}),(0,nn.jsx)("div",{className:"text-gray-700 whitespace-pre-wrap mb-4",children:o.message}),o.includeActionButton&&o.actionUrl&&(0,nn.jsx)("div",{className:"text-center",children:(0,nn.jsx)("a",{href:o.actionUrl,className:"inline-block bg-apn-blue text-white py-3 px-6 rounded-lg text-decoration-none",target:"_blank",rel:"noopener noreferrer",children:"Learn More"})})]})]}),(0,nn.jsxs)("div",{className:"flex space-x-3 mt-6",children:[(0,nn.jsx)("button",{onClick:()=>m(!1),className:"flex-1 bg-gray-300 text-gray-700 py-2 px-4 roun
2ded-lg hover:bg-gray-400 transition duration-200",children:"Back to Edit"}),(0,nn.jsx)("button",{onClick:p,disabled:c,className:"flex-1 bg-apn-blue text-white py-2 px-4 rounded-lg hover:bg-blue-700 transition duration-200 disabled:opacity-50 disabled:cursor-not-allowed",children:c?"Sending...":"Send Announcement"})]})]}):(0,nn.jsxs)("form",{onSubmit:p,className:"space-y-6",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Announcement Title *"}),(0,nn.jsx)("input",{type:"text",name:"title",required:!0,value:o.title,onChange:g,placeholder:"Enter announcement title",className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue"})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Message *"}),(0,nn.jsx)("textarea",{name:"message",required:!0,rows:6,value:o.message,onChange:g,placeholder:"Enter your announcement message...",className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue"})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Email Service"}),(0,nn.jsxs)("select",{name:"emailService",value:o.emailService,onChange:g,className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue",children:[(0,nn.jsx)("option",{value:"emailjs",children:"EmailJS (Development)"}),(0,nn.jsx)("option",{value:"constantcontact",children:"Constant Contact (Production)"})]}),(0,nn.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"constantcontact"===o.emailService?"Professional email marketing with analytics and deliverability":"Simple email service for development and testing"})]}),(0,nn.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,nn.jsx)("input",{type:"checkbox",id:"includeActionButton",name:"includeActionButton",checked:o.includeActionButton,onChange:g,className:"h-4 w-4 text-apn-blue focus:ring-apn-blue border-gray-300 rounded"}),(0,nn.jsx)("label",{htmlFor:"includeActionButton",className:"text-sm font-medium text-gray-700",children:"Include action button"})]}),o.includeActionButton&&(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Action URL"}),(0,nn.jsx)("input",{type:"url",name:"actionUrl",value:o.actionUrl,onChange:g,placeholder:"https://example.com",className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue"})]}),(0,nn.jsx)("div",{className:"bg-yellow-50 border border-yellow-200 rounded-md p-4",children:(0,nn.jsxs)("div",{className:"flex",children:[(0,nn.jsx)("svg",{className:"w-5 h-5 text-yellow-400 mr-2",fill:"currentColor",viewBox:"0 0 20 20",children:(0,nn.jsx)("path",{fillRule:"evenodd",d:"M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z",clipRule:"evenodd"})}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("h3",{className:"text-sm font-medium text-yellow-800",children:"Important"}),(0,nn.jsx)("p",{className:"text-sm text-yellow-700 mt-1",children:"This announcement will be sent to all approved members via email. Please review carefully before sending."})]})]})}),(0,nn.jsxs)("div",{className:"flex space-x-3",children:[(0,nn.jsx)("button",{type:"button",onClick:()=>m(!0),className:"flex-1 bg-gray-300 text-gray-700 py-2 px-4 rounded-lg hover:bg-gray-400 transition duration-200",children:"Preview"}),(0,nn.jsx)("button",{type:"submit",disabled:c,className:"flex-1 bg-apn-blue text-white py-2 px-4 rounded-lg hover:bg-blue-700 transition duration-200 disabled:opacity-50 disabled:cursor-not-allowed",children:c?(0,nn.jsxs)(nn.Fragment,{children:[(0,nn.jsxs)("svg",{className:"animate-spin -ml-1 mr-3 h-5 w-5 text-white inline",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[(0,nn.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,nn.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"Sending..."]}):"Send Announcement"})]})]})]})}):(0,nn.jsxs)("div",{className:"text-center py-12",children:[(0,nn.jsx)("h2",{className:"text-2xl font-bold text-gray-900",children:"Access Denied"}),(0,nn.jsx)("p",{className:"text-gray-600",children:"You don't have permission to send announcements."})]})},Xn="clients",Zn=e=>{if(!e)return!0;const t=e.toDate?e.toDate():new Date(e);return new Date>t},er=e=>{if(!e)return{expired:!0,display:"Expired"};const t=(e.toDate?e.toDate():new Date(e))-new Date;if(t<=0)return{expired:!0,display:"Expired",ms:0};const n=Math.floor(t/36e5),r=Math.floor(t%36e5/6e4),s=Math.floor(t%6e4/1e3);return{expired:!1,hours:n,minutes:r,seconds:s,ms:t,display:"".concat(n,"h ").concat(r,"m ").concat(s,"s")}},tr=async e=>{try{var t;const n=(0,vt.doc)((0,vt.collection)(yt.db,Xn)),r=(()=>{const e="ABCDEFGHJKLMNPQRSTUVWXYZ23456789";let t="";for(let n=0;n<6;n++)t+=e.charAt(Math.floor(32*Math.random()));return t})(),a={id:n.id,companyName:e.companyName||"",contactName:e.contactName||"",contactEmail:(null===(t=e.contactEmail)||void 0===t?void 0:t.toLowerCase())||"",contactPhone:e.contactPhone||"",industry:e.industry||"",website:e.currentWebsite||"",accessCode:r,accessEnabled:!1,requireDeposit:!1,depositPaid:!1,depositAmount:5,depositDate:null,stripePaymentIntentId:null,timerExpiresAt:null,timerHours:48,timerExtensions:[],projectStatus:"pending_deposit",sitePreviewUrl:e.sitePreviewUrl||"",projectNotes:e.projectNotes||"",projectType:e.projectType||"website",servicesRequested:e.servicesRequested||[],createdAt:(0,vt.serverTimestamp)(),updatedAt:(0,vt.serverTimestamp)(),createdBy:e.createdBy||"admin",demoDate:e.demoDate||vt.Dc.now(),lastAccessedAt:null};return await(0,vt.BN)(n,a),(0,s.A)((0,s.A)({id:n.id},a),{},{accessCode:r})}catch(n){throw console.error("Error creating client:",n),n}},nr=async e=>{try{const t=(0,vt.doc)(yt.db,Xn,e),n=await(0,vt.x7)(t);return n.exists()?(0,s.A)({id:n.id},n.data()):null}catch(t){throw console.error("Error getting client:",t),t}},rr=async(e,t)=>{try{const n=(0,vt.doc)(yt.db,Xn,e);return await(0,vt.updateDoc)(n,(0,s.A)((0,s.A)({},t),{},{updatedAt:(0,vt.serverTimestamp)()})),!0}catch(n){throw console.error("Error updating client:",n),n}},sr=async e=>{try{return await rr(e,{accessEnabled:!1,projectStatus:"expired"}),!0}catch(t){throw console.error("Error expiring client access:",t),t}},ar=async()=>{try{const e=await async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:50;try{const t=(0,vt.query)((0,vt.collection)(yt.db,Xn),(0,vt.orderBy)("createdAt","desc"),(0,vt.limit)(e));return(await(0,vt.getDocs)(t)).docs.map(e=>(0,s.A)({id:e.id},e.data()))}catch(t){throw console.error("Error getting all clients:",t),t}}(200),t=new Date;return{total:e.length,active:e.filter(e=>"active"===e.projectStatus||"in_progress"===e.projectStatus).length,pendingDeposit:e.filter(e=>"pending_deposit"===e.projectStatus).length,expired:e.filter(e=>"expired"===e.projectStatus).length,completed:e.filter(e=>"completed"===e.projectStatus).length,depositsPaid:e.filter(e=>e.depositPaid).length,totalRevenue:e.filter(e=>e.depositPaid).reduce((e,t)=>
2e+(t.depositAmount||5),0),expiringWithin24h:e.filter(e=>{if(!e.timerExpiresAt||"expired"===e.projectStatus)return!1;const n=(e.timerExpiresAt.toDate?e.timerExpiresAt.toDate():new Date(e.timerExpiresAt))-t;return n>0&&n<864e5}).length}}catch(e){return console.error("Error getting client stats:",e),{total:0,active:0,pendingDeposit:0,expired:0,completed:0,depositsPaid:0,totalRevenue:0,expiringWithin24h:0}}},ir={pending:{text:"Pending",color:"bg-gray-100 text-gray-800"},approved:{text:"Approved",color:"bg-blue-100 text-blue-800"},deposit_paid:{text:"Deposit Paid",color:"bg-green-100 text-green-800"},active:{text:"Active",color:"bg-green-100 text-green-800"},expired:{text:"Expired",color:"bg-red-100 text-red-800"},converted:{text:"Converted",color:"bg-purple-100 text-purple-800"},pending_deposit:{text:"Pending Deposit",color:"bg-yellow-100 text-yellow-800"},in_progress:{text:"In Progress",color:"bg-blue-100 text-blue-800"},review:{text:"Under Review",color:"bg-purple-100 text-purple-800"},completed:{text:"Completed",color:"bg-green-100 text-green-800"}},or=[{key:1,label:"Site Quality"},{key:2,label:"Content Accuracy"},{key:3,label:"Ready for Outreach"}],lr=e=>{if(!e||e.expired)return"text-gray-400";const t=e.hours+e.minutes/60;return t>24?"text-green-600":t>6?"text-yellow-600":"text-red-600"},cr=e=>{if(!e||e.expired)return"bg-gray-100";const t=e.hours+e.minutes/60;return t>24?"bg-green-50":t>6?"bg-yellow-50":"bg-red-50"};function dr(){const[t,n]=(0,e.useState)([]),[r,a]=(0,e.useState)(null),[i,o]=(0,e.useState)(!0),[l,c]=(0,e.useState)(!1),[d,u]=(0,e.useState)(null),[m,h]=(0,e.useState)(24),[p,g]=(0,e.useState)(""),[f,x]=(0,e.useState)(!1),[b,y]=(0,e.useState)(null),[v,w]=(0,e.useState)({}),[j,N]=(0,e.useState)({companyName:"",contactName:"",contactEmail:"",contactPhone:"",industry:"",currentWebsite:"",projectType:"website",servicesRequested:[],projectNotes:"",sitePreviewUrl:""}),k=(0,e.useCallback)(async()=>{try{const e=await ar();a(e)}catch(e){console.error("Error loading stats:",e)}},[]);(0,e.useEffect)(()=>{const e=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100;const n=(0,vt.query)((0,vt.collection)(yt.db,Xn),(0,vt.orderBy)("createdAt","desc"),(0,vt.limit)(t));return(0,vt.aQ)(n,t=>{const n=t.docs.map(e=>(0,s.A)({id:e.id},e.data()));e(n)},e=>{console.error("Error subscribing to clients:",e)})}(e=>{n(e),o(!1)});return k(),()=>e()},[k]);const A=(0,e.useCallback)(()=>{k()},[k]);(0,e.useEffect)(()=>{const e=()=>{const e={};t.forEach(t=>{t.timerExpiresAt&&!Zn(t.timerExpiresAt)&&(e[t.id]=er(t.timerExpiresAt))}),w(e)};e();const n=setInterval(e,1e3);return()=>clearInterval(n)},[t]);const S=async e=>{y(e.id);try{await(async e=>{try{const t=await nr(e);if(!t)throw new Error("Client not found");return await rr(e,{accessEnabled:!t.accessEnabled}),!t.accessEnabled}catch(t){throw console.error("Error toggling client access:",t),t}})(e.id),A()}catch(t){alert("Error toggling access: "+t.message)}finally{y(null)}},E=async(e,t,n)=>{y(e.id+"-approval");try{await async function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";try{const s={["approvalBox".concat(t)]:n};if(n){const a=await nr(e);if(!a)throw new Error("Client not found");const i=1===t?n:!!a.approvalBox1,o=2===t?n:!!a.approvalBox2,l=3===t?n:!!a.approvalBox3;i&&o&&l&&(s.status="approved",s.approvedAt=(0,vt.serverTimestamp)(),s.approvedBy=r)}return await rr(e,s),!0}catch(s){throw console.error("Error updating approval box:",s),s}}(e.id,t,n),A()}catch(r){alert("Error updating approval: "+r.message)}finally{y(null)}},C=async e=>{const t=prompt("Enter the site preview URL:",e.sitePreviewUrl||"");if(null!==t)try{await(async(e,t)=>{try{return await rr(e,{sitePreviewUrl:t}),!0}catch(n){throw console.error("Error updating preview URL:",n),n}})(e.id,t),A()}catch(n){alert("Error: "+n.message)}},T=async e=>{if(window.confirm('Delete client "'.concat(e.companyName,'"? This cannot be undone.')))try{await(async e=>{try{return await(0,vt.kd)((0,vt.doc)(yt.db,Xn,e)),!0}catch(t){throw console.error("Error deleting client:",t),t}})(e.id),A()}catch(t){alert("Error: "+t.message)}};return i?(0,nn.jsx)("div",{className:"text-center py-12",children:(0,nn.jsx)("div",{className:"animate-spin rounded-full h-8 w-8 border-t-2 border-b-2 border-apn-blue mx-auto"})}):(0,nn.jsxs)("div",{className:"space-y-6",children:[r&&(0,nn.jsx)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[{label:"Total Clients",value:r.total,color:"text-gray-900"},{label:"Active",value:r.active,color:"text-green-600"},{label:"Pending Deposit",value:r.pendingDeposit,color:"text-yellow-600"},{label:"Expiring < 24h",value:r.expiringWithin24h,color:"text-red-600"}].map(e=>(0,nn.jsxs)("div",{className:"bg-white rounded-lg shadow p-4 text-center",children:[(0,nn.jsx)("div",{className:"text-2xl font-bold ".concat(e.color),children:e.value}),(0,nn.jsx)("div",{className:"text-xs text-gray-500 mt-1",children:e.label})]},e.label))}),(0,nn.jsxs)("div",{className:"flex items-center justify-between",children:[(0,nn.jsx)("h3",{className:"text-lg font-medium text-gray-900",children:"Prospect Clients"}),(0,nn.jsx)("button",{onClick:()=>c(!l),className:"px-4 py-2 bg-apn-blue text-white rounded-lg hover:bg-apn-dark-blue transition-colors text-sm font-medium",children:l?"Cancel":"+ Add Client"})]}),l&&(0,nn.jsxs)("div",{className:"bg-white rounded-lg shadow p-6",children:[(0,nn.jsx)("h4",{className:"font-semibold text-gray-900 mb-4",children:"New Client (Post-Demo)"}),(0,nn.jsxs)("form",{onSubmit:async e=>{e.preventDefault(),y("create");try{const e=await tr(j);alert("Client created!\nAccess Code: ".concat(e.accessCode,"\nShare this with the client after their demo.")),c(!1),N({companyName:"",contactName:"",contactEmail:"",contactPhone:"",industry:"",currentWebsite:"",projectType:"website",servicesRequested:[],projectNotes:"",sitePreviewUrl:""}),A()}catch(t){alert("Error creating client: "+t.message)}finally{y(null)}},className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,nn.jsx)("input",{required:!0,placeholder:"Company Name *",value:j.companyName,onChange:e=>N(t=>(0,s.A)((0,s.A)({},t),{},{companyName:e.target.value})),className:"px-3 py-2 border border-gray-300 rounded-md text-sm"}),(0,nn.jsx)("input",{required:!0,placeholder:"Contact Name *",value:j.contactName,onChange:e=>N(t=>(0,s.A)((0,s.A)({},t),{},{contactName:e.target.value})),className:"px-3 py-2 border border-gray-300 rounded-md text-sm"}),(0,nn.jsx)("input",{required:!0,type:"email",placeholder:"Contact Email *",value:j.contactEmail,onChange:e=>N(t=>(0,s.A)((0,s.A)({},t),{},{contactEmail:e.target.value})),className:"px-3 py-2 border border-gray-300 rounded-md text-sm"}),(0,nn.jsx)("input",{placeholder:"Phone",value:j.contactPhone,onChange:e=>N(t=>(0,s.A)((0,s.A)({},t),{},{contactPhone:e.target.value})),className:"px-3 py-2 border border-gray-300 rounded-md text-sm"}),(0,nn.jsx)("input",{placeholder:"Industry",value:j.industry,onChange:e=>N(t=>(0,s.A)((0,s.A)({},t),{},{industry:e.target.value})),className:"px-3 py-2 border border-gray-300 rounded-md text-sm"}),(0,nn.jsx)("input",{placeholder:"Current Website URL",value:j.currentWebsite,onChange:e=>N(t=>(0,s.A)((0,s.A)({},t),{},{currentWebsite:e.target.value})),className:"px-3 py-2 border border-gray-300 rounded-md text-sm"}
2),(0,nn.jsxs)("select",{value:j.projectType,onChange:e=>N(t=>(0,s.A)((0,s.A)({},t),{},{projectType:e.target.value})),className:"px-3 py-2 border border-gray-300 rounded-md text-sm",children:[(0,nn.jsx)("option",{value:"website",children:"Website Development"}),(0,nn.jsx)("option",{value:"ai_integration",children:"AI Integration"}),(0,nn.jsx)("option",{value:"both",children:"Website + AI"})]}),(0,nn.jsx)("input",{placeholder:"Site Preview URL (optional)",value:j.sitePreviewUrl,onChange:e=>N(t=>(0,s.A)((0,s.A)({},t),{},{sitePreviewUrl:e.target.value})),className:"px-3 py-2 border border-gray-300 rounded-md text-sm"}),(0,nn.jsxs)("div",{className:"md:col-span-2",children:[(0,nn.jsx)("label",{className:"block text-xs text-gray-500 mb-1",children:"Services Requested"}),(0,nn.jsx)("div",{className:"flex flex-wrap gap-2",children:["Website Development","AI Integration","Marketing Consulting","Business Development","E-commerce","CRM Integration"].map(e=>(0,nn.jsxs)("label",{className:"inline-flex items-center text-sm",children:[(0,nn.jsx)("input",{type:"checkbox",checked:j.servicesRequested.includes(e),onChange:t=>{N(n=>(0,s.A)((0,s.A)({},n),{},{servicesRequested:t.target.checked?[...n.servicesRequested,e]:n.servicesRequested.filter(t=>t!==e)}))},className:"mr-1"}),e]},e))})]}),(0,nn.jsx)("div",{className:"md:col-span-2",children:(0,nn.jsx)("textarea",{placeholder:"Project Notes",value:j.projectNotes,onChange:e=>N(t=>(0,s.A)((0,s.A)({},t),{},{projectNotes:e.target.value})),rows:3,className:"w-full px-3 py-2 border border-gray-300 rounded-md text-sm"})}),(0,nn.jsx)("div",{className:"md:col-span-2 flex justify-end",children:(0,nn.jsx)("button",{type:"submit",disabled:"create"===b,className:"px-6 py-2 bg-green-600 text-white rounded-lg hover:bg-green-700 text-sm font-medium disabled:opacity-50",children:"create"===b?"Creating...":"Create Client & Generate Access Code"})})]})]}),(0,nn.jsx)("div",{className:"bg-white rounded-lg shadow overflow-hidden",children:(0,nn.jsx)("div",{className:"overflow-x-auto",children:(0,nn.jsxs)("table",{className:"min-w-full divide-y divide-gray-200",children:[(0,nn.jsx)("thead",{className:"bg-gray-50",children:(0,nn.jsxs)("tr",{children:[(0,nn.jsx)("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase",children:"Company"}),(0,nn.jsx)("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase",children:"Contact"}),(0,nn.jsx)("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase",children:"Approval"}),(0,nn.jsx)("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase",children:"Status"}),(0,nn.jsx)("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase",children:"Deposit"}),(0,nn.jsx)("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase",children:"Timer"}),(0,nn.jsx)("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase",children:"Access"}),(0,nn.jsx)("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase",children:"Actions"})]})}),(0,nn.jsx)("tbody",{className:"divide-y divide-gray-200",children:0===t.length?(0,nn.jsx)("tr",{children:(0,nn.jsx)("td",{colSpan:8,className:"px-4 py-8 text-center text-gray-500",children:"No clients yet. Add one after a demo."})}):t.map(e=>{const t=e.status||e.projectStatus||"pending",n=ir[t]||ir.pending,r=v[e.id],s=!r||r.expired,a=e.approvalBox1&&e.approvalBox2&&e.approvalBox3;return(0,nn.jsxs)("tr",{className:"hover:bg-gray-50",children:[(0,nn.jsxs)("td",{className:"px-4 py-3",children:[(0,nn.jsx)("div",{className:"text-sm font-medium text-gray-900",children:e.companyName}),(0,nn.jsx)("div",{className:"text-xs text-gray-500",children:e.industry}),e.previewUrl&&(0,nn.jsx)("a",{href:e.previewUrl,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-apn-blue hover:underline",children:"Preview \u2197"})]}),(0,nn.jsxs)("td",{className:"px-4 py-3",children:[(0,nn.jsx)("div",{className:"text-sm text-gray-900",children:e.contactName}),(0,nn.jsx)("div",{className:"text-xs text-gray-500",children:e.contactEmail}),(0,nn.jsxs)("div",{className:"text-xs font-mono text-apn-blue mt-0.5",children:["Code: ",e.accessCode]})]}),(0,nn.jsx)("td",{className:"px-4 py-3",children:(0,nn.jsxs)("div",{className:"space-y-1",children:[or.map(t=>(0,nn.jsxs)("label",{className:"flex items-center space-x-1 cursor-pointer",children:[(0,nn.jsx)("input",{type:"checkbox",checked:!!e["approvalBox".concat(t.key)],onChange:n=>E(e,t.key,n.target.checked),disabled:b===e.id+"-approval",className:"rounded border-gray-300 text-apn-blue focus:ring-apn-blue h-3.5 w-3.5"}),(0,nn.jsx)("span",{className:"text-xs text-gray-600",children:t.label})]},t.key)),a&&(0,nn.jsx)("span",{className:"text-xs text-green-600 font-medium",children:"\u2713 Approved"})]})}),(0,nn.jsx)("td",{className:"px-4 py-3",children:(0,nn.jsx)("span",{className:"text-xs font-medium rounded-full px-2 py-1 ".concat(n.color),children:n.text})}),(0,nn.jsxs)("td",{className:"px-4 py-3",children:[(0,nn.jsxs)("label",{className:"flex items-center space-x-1 cursor-pointer mb-1",children:[(0,nn.jsx)("input",{type:"checkbox",checked:!!e.requireDeposit,onChange:()=>(async e=>{y(e.id+"-deposit");try{await rr(e.id,{requireDeposit:!e.requireDeposit}),A()}catch(t){alert("Error toggling deposit requirement: "+t.message)}finally{y(null)}})(e),disabled:b===e.id+"-deposit",className:"rounded border-gray-300 text-apn-blue focus:ring-apn-blue h-3.5 w-3.5"}),(0,nn.jsx)("span",{className:"text-xs text-gray-600",children:"Require $5"})]}),e.requireDeposit&&(e.depositPaid?(0,nn.jsx)("span",{className:"text-xs text-green-600 font-medium",children:"$5 Paid \u2713"}):(0,nn.jsx)("span",{className:"text-xs text-yellow-600 font-medium",children:"Awaiting payment"})),!e.requireDeposit&&(0,nn.jsx)("span",{className:"text-xs text-gray-400 font-medium",children:"No deposit needed"})]}),(0,nn.jsx)("td",{className:"px-4 py-3",children:e.timerExpiresAt?s?(0,nn.jsx)("span",{className:"text-xs font-medium px-2 py-1 rounded ".concat(cr(r)," ").concat(lr(r)),children:"Expired"}):(0,nn.jsx)("span",{className:"text-xs font-mono font-medium px-2 py-1 rounded ".concat(cr(r)," ").concat(lr(r)),children:null===r||void 0===r?void 0:r.display}):(0,nn.jsx)("span",{className:"text-xs text-gray-400",children:"Not started"})}),(0,nn.jsx)("td",{className:"px-4 py-3",children:(0,nn.jsx)("button",{onClick:()=>S(e),disabled:b===e.id,className:"text-xs font-medium px-2 py-1 rounded ".concat(e.accessEnabled?"bg-green-100 text-green-700 hover:bg-green-200":"bg-red-100 text-red-700 hover:bg-red-200"),children:e.accessEnabled?"ON":"OFF"})}),(0,nn.jsx)("td",{className:"px-4 py-3",children:(0,nn.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,nn.jsx)("button",{onClick:()=>{u(e),x(!0)},className:"text-xs px-2 py-1 bg-blue-50 text-blue-700 rounded hover:bg-blue-100",title:"Extend Timer",children:"\u23f1 Extend"}),(0,nn.jsx)("button",{onClick:()=>C(e),className:"text-xs px-2 py-1 bg-gray-50 text-gray-700 rounded hover:bg-gray-100",title:"Set Preview URL",children:"\ud83d\udd17 URL"}),(0,nn.jsx)("button",{onClick:()=>T(e),className:"text-xs px-2 py-1 bg-red-50 text-red-700 rounded hover:bg-red-100",title:"Delete",children:"\u2715"})]})})]},e.id)})})]})})}),f&&d&&(0,nn.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:(0,nn.jsxs)("div",{className:"bg-white rounded-lg shadow-xl p-6 w-full max-w-md mx-4",children:[(0,nn.jsxs)("h4",{className:"text-lg font-semibold text-gray-900 mb-4",children:["Extend Timer \u2014 ",d.companyName]}),(0,nn.jsxs)("div",{className:"space-y-4",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{className:"block text-sm text-gray-600 mb-1",children:"Additional Hours"}),(0,nn.jsxs)("div",{className:"flex space-x-2",children:[[12,24,48,72].map(e=>(0,nn.jsxs)("button",{onClick:()=>h(e),className:"px-3 py-1 rounded text-sm ".concat(m===e?"bg-apn-blue text-white":"bg-gray-100 text-gray-700"),children:[e,"h"]},e)),(0,nn.jsx)("input",{type:"number",min:1,max:720,value:m,onChange:e=>h(parseInt(e.target.value)||24),className:"w-20 px-2 py-1 border border-gray-300 rounded text-sm"})]})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{className:"block text-sm text-gray-600 mb-1",children:"Reason (optional)"}),(0,nn.jsx)("input",{value:p,onChange:e=>g(e.target.value),placeholder:"e.g., Client requested more review time",className:"w-full px-3 py-2 border border-gray-300 rounded-md text-sm"})]}),(0,nn.jsxs)("div",{className:"flex justify-end space-x-3 pt-2",children:[(0,nn.jsx)("button",{onClick:()=>{x(!1),u(null)},className:"px-4 py-2 text-gray-600 hover:text-gray-800 text-sm",children:"Cancel"}),(0,nn.jsx)("button",{onClick:async()=>
2{if(d){y("extend");try{await async function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";try{var r;const s=await nr(e);if(!s)throw new Error("Client not found");const a=null!==(r=s.timerExpiresAt)&&void 0!==r&&r.toDate?s.timerExpiresAt.toDate():new Date(s.timerExpiresAt),i=a>new Date?a:new Date,o=vt.Dc.fromDate(new Date(i.getTime()+60*t*60*1e3)),l={extendedAt:(new Date).toISOString(),additionalHours:t,reason:n,previousExpiry:a.toISOString(),newExpiry:o.toDate().toISOString()};return await rr(e,{timerExpiresAt:o,timerExtensions:[...s.timerExtensions||[],l],accessEnabled:!0,projectStatus:"expired"===s.projectStatus?"active":s.projectStatus}),{newExpiry:o,extension:l}}catch(s){throw console.error("Error extending timer:",s),s}}(d.id,m,p),x(!1),h(24),g(""),A()}catch(e){alert("Error extending timer: "+e.message)}finally{y(null)}}},disabled:"extend"===b,className:"px-4 py-2 bg-apn-blue text-white rounded-lg hover:bg-apn-dark-blue text-sm disabled:opacity-50",children:"extend"===b?"Extending...":"Extend by ".concat(m,"h")})]})]})]})})]})}const ur="https://apn-demos.vercel.app",mr=[{id:"prs1",name:"Sergio's Pizza",phone:"(203) 967-4200",status:"PHONE_VERIFIED",demoSlug:"/sergio-s-pizza-restaurant",outreach:"Not contacted",dossier:"Family-owned pizzeria. Decades in Stamford. No website currently. Good Google reviews.",timeline:[{date:"2026-03-28",event:"Demo site generated"},{date:"2026-03-29",event:"Phone verified via lookup"}]},{id:"prs2",name:"Magic Scissors",phone:"(203) 487-0118",status:"PHONE_VERIFIED",demoSlug:"/magic-scissors-beauty-salon",outreach:"Not contacted",dossier:"Beauty salon with solid local following. Booking handled by phone only. Prime for booking widget.",timeline:[{date:"2026-03-28",event:"Demo site generated"},{date:"2026-03-29",event:"Phone verified via lookup"}]},{id:"prs3",name:"Ginter Heating",phone:"(203) 329-0211",status:"PHONE_VERIFIED",demoSlug:"/ginter-heating-a-c",outreach:"Not contacted",dossier:"HVAC company. Seasonal demand spikes. High emergency call volume - phone agent would pay for itself fast.",timeline:[{date:"2026-03-28",event:"Demo site generated"},{date:"2026-03-29",event:"Phone verified via lookup"}]}],hr=[{id:"ld1",name:"A to Z Property Maintenance",owner:"Daimeon Baity",tierInterest:"Starter",status:"warm",demoSlug:"/a-to-z-property-maintenance-llc",contractStatus:"Draft",paymentStatus:"Unpaid",paymentLink:"https://buy.stripe.com/placeholder_ato_z",notes:"Warm lead. Responded positive on text, waiting on confirmation to send contract."},{id:"ld2",name:"Amore Cucina & Bar",owner:"Amore Cucina & Bar",tierInterest:"Professional",status:"live_pitch",demoSlug:"/amore-cucina-bar",contractStatus:"Not sent",paymentStatus:"Unpaid",paymentLink:"https://buy.stripe.com/placeholder_amore",notes:"Live pitch scheduled 4/1. Awaiting callback to finalize time."}],pr=[{id:"cl1",name:"Minute Man Land Services",owner:"Jordan Grant",status:"contract_sent",contractStatus:"Sent - awaiting signature",paid:!1,stripeCustomerId:"cus_UFHQSJFD2NSLhY",retainerLink:"https://buy.stripe.com/00w6oHbG8feN3lo4n68so01",liveSite:"",domain:"minutemenlandscaping.com",emailAccounts:[],monthlyCost:18,monthlyRevenue:79,changeRequests:[],comments:[{author:"Nicholas",date:"2026-03-30",text:"Retainer link sent via text. Follow up tomorrow."}],payments:[]},{id:"cl2",name:"ROOTZ Salon and Spa",owner:"Margaret & Latisha",status:"contract_sent",contractStatus:"Sent - awaiting signature",paid:!1,stripeCustomerId:"cus_UH9DNtjGSQ6mhS",retainerLink:"https://buy.stripe.com/6oU5kDaC4c2B4psg5O8so00",liveSite:"",domain:"",emailAccounts:[],monthlyCost:18,monthlyRevenue:199,changeRequests:[],comments:[{author:"Caroline",date:"2026-03-29",text:"Both owners on board. Waiting on retainer payment."}],payments:[]}],gr=[{key:"contract_sent",label:"Contract Sent"},{key:"retainer_paid",label:"Retainer Paid"},{key:"domain_setup",label:"Domain Setup"},{key:"photos_gathered",label:"Photos Gathered"},{key:"site_polished",label:"Site Polished"},{key:"client_review",label:"Client Review"},{key:"live",label:"Live"},{key:"completion_paid",label:"Completion Paid"},{key:"monthly_active",label:"Monthly Active"}],fr={red:"bg-red-100 text-red-700 border-red-200",yellow:"bg-yellow-100 text-yellow-700 border-yellow-200",green:"bg-green-100 text-green-700 border-green-200",blue:"bg-blue-100 text-apn-blue border-blue-200",purple:"bg-purple-100 text-purple-700 border-purple-200",gray:"bg-gray-100 text-gray-600 border-gray-200"},xr=e=>{let{kind:t="gray",children:n}=e;return(0,nn.jsx)("span",{className:"inline-block px-2.5 py-1 rounded-full text-xs font-semibold border whitespace-nowrap ".concat(fr[t]||fr.gray),children:n})},br=t=>{let{text:n,label:r="Copy"}=t;const[s,a]=(0,e.useState)(!1);return(0,nn.jsx)("button",{onClick:async e=>{e.stopPropagation();try{await navigator.clipboard.writeText(n),a(!0),setTimeout(()=>a(!1),1500)}catch(t){console.error("Copy failed:",t)}},className:"px-3 py-1.5 rounded-md text-xs font-medium border transition-colors whitespace-nowrap ".concat(s?"bg-green-50 text-green-700 border-green-200":"bg-white text-gray-700 border-gray-300 hover:bg-gray-50"),children:s?"Copied!":r})},yr=e=>{let{children:t,onClick:n,variant:r="primary"}=e;const s={primary:"bg-apn-blue text-white border-apn-blue hover:bg-apn-dark-blue",secondary:"bg-white text-gray-700 border-gray-300 hover:bg-gray-50",success:"bg-green-600 text-white border-green-600 hover:bg-green-700",warning:"bg-yellow-500 text-white border-yellow-500 hover:bg-yellow-600"};return(0,nn.jsx)("button",{onClick:e=>{e.stopPropagation(),n&&n()},className:"px-3.5 py-2 rounded-md text-xs font-semibold border transition-colors whitespace-nowrap ".concat(s[r]||s.primary),children:t})},vr=e=>{let{children:t}=e;return(0,nn.jsx)("div",{className:"text-xs font-bold text-apn-gray uppercase tracking-wider mb-2",children:t})};function wr(){const[t,n]=(0,e.useState)(null);return(0,nn.jsxs)("div",{children:[(0,nn.jsxs)("div",{className:"mb-5",children:[(0,nn.jsx)("h2",{className:"text-xl font-bold text-gray-900 m-0",children:"Prospects"}),(0,nn.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:"Pre-contact targets. Phone verified and demo site ready."})]}),(0,nn.jsx)("div",{className:"flex flex-col gap-3",children:mr.map(e=>{const r=t===e.id,s="".concat(ur).concat(e.demoSlug);return(0,nn.jsxs)("div",{onClick:()=>n(r?null:e.id),className:"bg-white border border-gray-200 rounded-lg shadow-sm p-4 cursor-pointer hover:border-apn-light-blue transition-colors",children:[(0,nn.jsxs)("div",{className:"flex flex-wrap gap-3 justify-between items-start",children:[(0,nn.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,nn.jsx)("div",{className:"text-base font-semibold text-gray-900",children:e.name}),(0,nn.jsx)("div",{className:"text-sm text-gray-500 mt-0.5",children:e.phone})]}),(0,nn.jsxs)("div",{className:"flex gap-2 flex-wrap items-center",children:[(0,nn.jsx)(xr,{kind:"green",children:e.status}),(0,nn.jsx)(xr,{kind:"gray",children:e.outreach})]})]}),(0,nn.jsx)("div",{className:"mt-3",children:(0,nn.jsx)("a",{href:s,target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),className:"text-xs text-apn-blue hover:text-apn-dark-blue hover:underline",children:e.demoSlug})}),(0,nn.jsxs)("div",{className:"mt-3 flex gap-2 flex-wrap",children:[(0,nn.jsx)(yr,{variant:"primary",onClick:()=>alert("Demo link sent: "+s),children:"Send Demo Link"}),(0,nn.jsx)(yr,{variant:"secondary",onClick:()=>alert("Generating contract for "+e.name),children:"Generate Contract"}),(0,nn.jsx)(yr,{variant:"warning",onClick:()=>alert("Creating payment link for "+e.name),children:"Create Payment Link"})]}),r&&(0,nn.jsxs)("div",{className:"mt-4 pt-4 border-t border-gray-200 grid gap-4 md:grid-cols-2",children:[(0,nn.jsxs)("div",{className:"bg-gray-50 rounded-lg p-3.5 border border-gray-200",children:[(0,nn.jsx)(vr,{children:"Dossier"}),(0,nn.jsx)("p",{className:"text-sm text-gray-700 leading-relaxed m-0",children:e.dossier})]}),(0,nn.jsxs)("div",{className:"bg-gray-50 rounded-lg p-3.5 border border-gray-200",children:[(0,nn.jsx)(vr,{children:"Timeline"}),e.timeline.map((e,t)=>(0,nn.jsxs)("div",{className:"text-xs text-gray-700 mb-1.5",children:[(0,nn.jsx)("span",{className:"text-gray-500",children:e.date})," \u2014 ",e.event]},t))]}),(0,nn.jsxs)("div",{className:"md:col-span-2 bg-gray-50 rounded-lg p-3.5 border border-gray-200",children:[(0,nn.jsx)(vr,{children:"Demo Site Preview"}),(0,nn.jsx)("div",{className:"border border-gray-300 rounded-md overflow-hidden h-96 bg-white",children:(0,nn.jsx)("iframe",{src:s,title:"".concat(e.name," demo"),className:"w-full h-full border-0"})})]})]})]},e.id)})})]})}function jr(){const[t,n]=(0,e.useState)(null);return(0,nn.jsxs)("div",{children:[(0,nn.jsxs)("div",{className:"mb-5",children:[(0,nn.jsx)("h2",{className:"text-xl font-bold text-gray-900 m-0",children:"Leads"}),(0,nn.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:"Interested prospects \u2014 pre-payment."})]}),(0,nn.jsx)("div",{className:"flex flex-col gap-3",children:hr.map(e=>{const r=t===e.id,s="".concat(ur).concat(e.demoSlug),a="warm"===e.status?"yellow":"purple",i="warm"===e.status?"Warm":"Live Pitch";return(0,nn.jsxs)("div",{onClick:()=>n(r?null:e.id),className:"bg-white border border-gray-200 rounded-lg shadow-sm p-4 cursor-pointer hover:border-apn-light-blue transition-colors",children:[(0,nn.jsxs)("div",{className:"flex flex-wrap gap-3 justify-between items-start",children:[(0,nn.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,nn.jsx)("div",{className:"text-base font-semibold text-gray-900",children:e.name}),(0,nn.jsxs)("div",{className:"text-sm text-gray-500 mt-0.5",children:[e.owner," \xb7 ",e.tierInterest]})]}),(0,nn.jsxs)("div",{className:"flex gap-2 flex-wrap items-center",children:[(0,nn.jsx)(xr,{kind:a,children:i}),(0,nn.jsxs)(xr,{kind:"Not sent"===e.contractStatus?"red":"yellow",children:["Contract: ",e.contractStatus]}),(0,nn.jsx)(xr,{kind:"red",children:e.paymentStatus})]})]}),(0,nn.jsx)("div",{className:"mt-3",children:(0,nn.jsx)("a",{href:s,target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),className:"text-xs text-apn-blue hover:text-apn-dark-blue hover:underline",children:e.demoSlug})}),(0,nn.jsxs)("div",{className:"mt-3 px-3 py-2.5 bg-gray-50 rounded-lg border border-gray-200 flex gap-2.5 items-center flex-wrap",children:[(0,nn.jsx)("span",{className:"text-xs text-apn-gray font-semibold uppercase tracking-wide",children:"Retainer Link"}),(0,nn.jsx)("code",{className:"text-xs text-apn-blue flex-1 min-w-0 truncate",children:e.paymentLink}),(0,nn.jsx)(br,{text:e.paymentLink})]}),(0,nn.jsxs)("div",{className:"mt-3 flex gap-2 flex-wrap",children:[(0,nn.jsx)(yr,{variant:"primary",onClick:()=>alert("Sending contract to "+e.name),children:"Send Contract"}),(0,nn.jsx)(yr,{variant:"warning",onClick:()=>alert("Sending retainer link to "+e.name),children:"Send Retainer Link"}),(0,nn.jsx)(yr,{variant:"secondary",onClick:()=>alert("Scheduling Zoom with "+e.name),children:"Schedule Zoom"})]}),r&&(0,nn.jsxs)("div",{className:"mt-4 pt-4 border-t border-gray-200",children:[(0,nn.jsx)(vr,{children:"Notes"}),(0,nn.jsx)("p",{className:"text-sm text-gray-700 leading-relaxed mt-0 mb-4",children:e.notes}),(0,nn.jsx)(vr,{children:"Site Preview"}),(0,nn.jsx)("div",{className:"border border-gray-300 rounded-md overflow-hidden h-96 bg-white",children:(0,nn.jsx)("iframe",{src:s,title:"".concat(e.name," preview"),className:"w-full h-full border-0"})})]})]},e.id)})})]})}function Nr(){const[t,n]=(0,e.useState)(null),[r,a]=(0,e.useState)(""),[i,o]=(0,e.useState)(pr.reduce((e,t)=>
2(0,s.A)((0,s.A)({},e),{},{[t.id]:t.comments}),{}));if(t){const e=pr.find(e=>e.id===t);if(!e)return n(null),null;const l=gr.findIndex(t=>t.key===e.status),c=e.monthlyRevenue-e.monthlyCost,d=e.monthlyRevenue>0?Math.round(c/e.monthlyRevenue*100):0,u=()=>{if(!r.trim())return;const t={author:"You",date:(new Date).toISOString().slice(0,10),text:r.trim()};o(n=>(0,s.A)((0,s.A)({},n),{},{[e.id]:[...n[e.id]||[],t]})),a("")};return(0,nn.jsxs)("div",{children:[(0,nn.jsx)("button",{onClick:()=>n(null),className:"mb-5 px-3.5 py-2 bg-white border border-gray-300 rounded-md text-sm text-gray-700 hover:bg-gray-50",children:"\u2190 Back to Clients"}),(0,nn.jsxs)("div",{className:"mb-5",children:[(0,nn.jsx)("h2",{className:"text-2xl font-bold text-gray-900 m-0",children:e.name}),(0,nn.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:e.owner})]}),(0,nn.jsxs)("div",{className:"flex gap-2 flex-wrap mb-6",children:[(0,nn.jsx)(xr,{kind:e.paid?"green":"red",children:e.paid?"PAID":"NOT PAID"}),(0,nn.jsxs)(xr,{kind:"yellow",children:["Contract: ",e.contractStatus]}),(0,nn.jsxs)(xr,{kind:"blue",children:["Stripe: ",e.stripeCustomerId]})]}),(0,nn.jsxs)("div",{className:"bg-white border border-gray-200 rounded-lg shadow-sm p-5 mb-4 overflow-x-auto",children:[(0,nn.jsx)(vr,{children:"Pipeline"}),(0,nn.jsx)("div",{className:"flex gap-2 min-w-max",children:gr.map((e,t)=>{const n=t===l?"bg-apn-blue text-white border-apn-blue":t<l?"bg-green-50 text-green-700 border-green-200":"bg-gray-50 text-gray-500 border-gray-200";return(0,nn.jsxs)("div",{className:"flex-none px-3 py-2 rounded-md text-xs font-semibold border whitespace-nowrap ".concat(n),children:[t+1,". ",e.label]},e.key)})})]}),(0,nn.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3 mb-4",children:[(0,nn.jsxs)("div",{className:"bg-white border border-gray-200 border-t-4 border-t-red-400 rounded-lg shadow-sm p-4",children:[(0,nn.jsx)("div",{className:"text-xs text-apn-gray font-bold uppercase tracking-wider",children:"Monthly Cost"}),(0,nn.jsxs)("div",{className:"text-2xl font-bold text-gray-900 mt-1",children:["$",e.monthlyCost]})]}),(0,nn.jsxs)("div",{className:"bg-white border border-gray-200 border-t-4 border-t-apn-blue rounded-lg shadow-sm p-4",children:[(0,nn.jsx)("div",{className:"text-xs text-apn-gray font-bold uppercase tracking-wider",children:"Revenue"}),(0,nn.jsxs)("div",{className:"text-2xl font-bold text-gray-900 mt-1",children:["$",e.monthlyRevenue]})]}),(0,nn.jsxs)("div",{className:"bg-white border border-gray-200 border-t-4 border-t-green-500 rounded-lg shadow-sm p-4",children:[(0,nn.jsx)("div",{className:"text-xs text-apn-gray font-bold uppercase tracking-wider",children:"Profit"}),(0,nn.jsxs)("div",{className:"text-2xl font-bold text-gray-900 mt-1",children:["$",c]})]}),(0,nn.jsxs)("div",{className:"bg-white border border-gray-200 border-t-4 border-t-purple-500 rounded-lg shadow-sm p-4",children:[(0,nn.jsx)("div",{className:"text-xs text-apn-gray font-bold uppercase tracking-wider",children:"Margin"}),(0,nn.jsxs)("div",{className:"text-2xl font-bold text-gray-900 mt-1",children:[d,"%"]})]})]}),(0,nn.jsxs)("div",{className:"bg-white border border-gray-200 rounded-lg shadow-sm p-4 mb-4",children:[(0,nn.jsx)(vr,{children:"Retainer Payment Link"}),(0,nn.jsxs)("div",{className:"flex gap-2.5 items-center flex-wrap",children:[(0,nn.jsx)("code",{className:"text-xs text-apn-blue flex-1 min-w-0 truncate",children:e.retainerLink}),(0,nn.jsx)(br,{text:e.retainerLink}),(0,nn.jsx)("a",{href:e.retainerLink,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-apn-blue hover:text-apn-dark-blue font-semibold",children:"Open \u2192"})]})]}),(0,nn.jsxs)("div",{className:"grid gap-3 md:grid-cols-3 mb-4",children:[(0,nn.jsxs)("div",{className:"bg-white border border-gray-200 rounded-lg shadow-sm p-4",children:[(0,nn.jsx)(vr,{children:"Live Site"}),(0,nn.jsx)("div",{className:"text-sm text-gray-700",children:e.liveSite||"Not deployed yet"})]}),(0,nn.jsxs)("div",{className:"bg-white border border-gray-200 rounded-lg shadow-sm p-4",children:[(0,nn.jsx)(vr,{children:"Domain"}),(0,nn.jsx)("div",{className:"text-sm text-gray-700",children:e.domain||"Not purchased"})]}),(0,nn.jsxs)("div",{className:"bg-white border border-gray-200 rounded-lg shadow-sm p-4",children:[(0,nn.jsx)(vr,{children:"Email Accounts"}),(0,nn.jsx)("div",{className:"text-sm text-gray-700",children:e.emailAccounts.length?e.emailAccounts.join(", "):"None provisioned"})]})]}),(0,nn.jsxs)("div",{className:"bg-white border border-gray-200 rounded-lg shadow-sm p-4 mb-4",children:[(0,nn.jsx)(vr,{children:"Payments"}),0===e.payments.length?(0,nn.jsx)("div",{className:"text-sm text-gray-400",children:"No payments recorded yet."}):e.payments.map((e,t)=>(0,nn.jsxs)("div",{className:"text-sm text-gray-700 py-1.5 border-b border-gray-100 last:border-0",children:[e.date," \u2014 $",e.amount," \u2014 ",e.note]},t))]}),(0,nn.jsxs)("div",{className:"bg-white border border-gray-200 rounded-lg shadow-sm p-4 mb-4",children:[(0,nn.jsx)(vr,{children:"Change Requests"}),0===e.changeRequests.length?(0,nn.jsx)("div",{className:"text-sm text-gray-400",children:"No change requests."}):e.changeRequests.map((e,t)=>(0,nn.jsxs)("div",{className:"text-sm text-gray-700 py-1.5",children:["\u2022 ",e]},t))]}),(0,nn.jsxs)("div",{className:"bg-white border border-gray-200 rounded-lg shadow-sm p-4",children:[(0,nn.jsx)(vr,{children:"Comments"}),(0,nn.jsx)("div",{className:"mb-3",children:(i[e.id]||[]).map((e,t)=>(0,nn.jsxs)("div",{className:"py-2.5 border-b border-gray-100 last:border-0",children:[(0,nn.jsxs)("div",{className:"text-xs text-gray-500 mb-1",children:[(0,nn.jsx)("strong",{className:"text-gray-900",children:e.author})," \xb7 ",e.date]}),(0,nn.jsx)("div",{className:"text-sm text-gray-700",children:e.text})]},t))}),(0,nn.jsxs)("div",{className:"flex gap-2 flex-wrap",children:[(0,nn.jsx)("input",{value:r,onChange:e=>a(e.target.value),placeholder:"Add a comment...",className:"flex-1 min-w-[220px] px-3 py-2.5 bg-white border border-gray-300 rounded-md text-sm text-gray-900 focus:outline-none focus:ring-2 focus:ring-apn-light-blue focus:border-apn-blue"}),(0,nn.jsx)(yr,{variant:"primary",onClick:u,children:"Post"})]})]})]})}return(0,nn.jsxs)("div",{children:[(0,nn.jsxs)("div",{className:"mb-5",children:[(0,nn.jsx)("h2",{className:"text-xl font-bold text-gray-900 m-0",children:"Clients"}),(0,nn.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:"Full lifecycle dashboard for signed / active clients."})]}),(0,nn.jsx)("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:pr.map(e=>{const t=e.monthlyRevenue-e.monthlyCost,r=gr.find(t=>t.key===e.status);return(0,nn.jsxs)("div",{onClick:()=>n(e.id),className:"bg-white border border-gray-200 rounded-lg shadow-sm p-4 cursor-pointer hover:shadow-md hover:border-apn-light-blue transition-all border-l-4 ".concat(e.paid?"border-l-green-500":"border-l-red-400"),children:[(0,nn.jsxs)("div",{className:"flex justify-between items-start gap-2.5 mb-2.5",children:[(0,nn.jsxs)("div",{className:"min-w-0",children:[(0,nn.jsx)("div",{className:"text-base font-semibold text-gray-900",children:e.name}),(0,nn.jsx)("div",{className:"text-xs text-gray-500 mt-0.5",children:e.owner})]}),(0,nn.jsx)(xr,{kind:e.paid?"green":"red",children:e.paid?"PAID":"NOT PAID"})]}),(0,nn.jsx)("div",{className:"flex gap-1.5 flex-wrap mb-2.5",children:(0,nn.jsx)(xr,{kind:"yellow",children:(null===r||void 0===r?void 0:r.label)||e.status})}),(0,nn.jsxs)("div",{className:"flex gap-3 text-xs text-gray-500",children:[(0,nn.jsxs)("span",{children:["Rev: ",(0,nn.jsxs)("strong",{className:"text-gray-900",children:["$",e.monthlyRevenue]})]}),(0,nn.jsxs)("span",{children:["Cost: ",(0,nn.jsxs)("strong",{className:"text-gray-900",children:["$",e.monthlyCost]})]}),(0,nn.jsxs)("span",{children:["Profit: ",(0,nn.jsxs)("strong",{className:"text-green-600",children:["$",t]})]})]})]},e.id)})})]})}function kr(){const[t,n]=(0,e.useState)("prospects"),r=[{key:"prospects",label:"Prospects",count:mr.length},{key:"leads",label:"Leads",count:hr.length},{key:"clients",label:"Clients",count:pr.length}];return(0,nn.jsx)("div",{className:"min-h-screen bg-gray-50 py-6 px-4",children:(0,nn.jsxs)("div",{className:"max-w-7xl mx-auto",children:[(0,nn.jsxs)("div",{className:"mb-6",children:[(0,nn.jsx)("h1",{className:"text-3xl font-bold text-gray-900 m-0",children:"Client Portal"}),(0,nn.jsx)("p",{className:"text-sm text-gray-600 mt-1.5",children:"Unified prospect \u2192 lead \u2192 client lifecycle for Nicholas & Caroline."})]}),(0,nn.jsx)("div",{className:"flex gap-1 bg-white border border-gray-200 rounded-lg shadow-sm p-1 mb-6 overflow-x-auto",children:r.map(e=>{const r=t===e.key;return(0,nn.jsxs)("button",{onClick:()=>n(e.key),className:"flex-1 min-w-[110px] px-4 py-2.5 rounded-md text-xs font-bold uppercase tracking-wider transition-colors ".concat(r?"bg-apn-blue text-white":"bg-transparent text-gray-500 hover:text-apn-blue hover:bg-blue-50"),children:[e.label," ",(0,nn.jsxs)("span",{className:"opacity-70 font-medium",children:["(",e.count,")"]})]},e.key)})}),"prospects"===t&&(0,nn.jsx)(wr,{}),"leads"===t&&(0,nn.jsx)(jr,{}),"clients"===t&&(0,nn.jsx)(Nr,{})]})})}const Ar={"security-agent":["Pending Approvals","All Users"],"payment-agent":["Client Management"],"monitoring-agent":["Overview"],"marketing-agent":["Content Management","LinkedIn Integration"],"onboarding-agent":["Client Management","Pending Approvals"],"directory-scraping-agent":["Agency Pipeline"],"website-qa-agent":[],"new-business-filing-agent":["Agency Pipeline"],"contact-enrichment-agent":["Agency Pipeline","LinkedIn Integration"]};async function Sr(e,t){await(0,vt.updateDoc)((0,vt.doc)(yt.db,"agent_registry",e),{enabled:t})}function Er(e){if(!e)return"never";const t=e.toDate?e.toDate():new Date(e),n=Math.floor((Date.now()-t.getTime())/1e3);if(n<60)return"".concat(n,"s ago");const r=Math.floor(n/60);if(r<60)return"".concat(r,"m ago");const s=Math.floor(r/60);if(s<24)return"".concat(s,"h ago");const a=Math.floor(s/24);return"".concat(a,"d ago")}const Cr={critical:{border:"border-red-500",bg:"bg-red-50",text:"text-red-700",dot:"bg-red-500",badge:"bg-red-100 text-red-800"},warning:{border:"border-yellow-500",bg:"bg-yellow-50",text:"text-yellow-700",dot:"bg-yellow-500",badge:"bg-yellow-100 text-yellow-800"},info:{border:"border-gray-300",bg:"bg-gray-50",text:"text-gray-600",dot:"bg-gray-400",badge:"bg-gray-100 text-gray-700"}},Tr={active:"bg-green-100 text-green-800",paused:"bg-yellow-100 text-yellow-800",error:"bg-red-100 text-red-800",not_implemented:"bg-gray-100 text-gray-500"},Pr={security:"bg-red-50 text-red-700 border border-red-200",payment:"bg-green-50 text-green-700 border border-green-200",monitoring:"bg-blue-50 text-blue-700 border border-blue-200",marketing:"bg-purple-50 text-purple-700 border border-purple-200",onboarding:"bg-indigo-50 text-indigo-700 border border-indigo-200",prospecting:"bg-orange-50 text-orange-700 border border-orange-200",qa:"bg-teal-50 text-teal-700 border border-teal-200",enrichment:"bg-cyan-50 text-cyan-700 border border-cyan-200"};function _r(){const[t,n]=(0,e.useState)([]),[r,a]=(0,e.useState)([]),[i,o]=(0,e.useState)([]),[l,c]=(0,e.useState)(null),[d,u]=(0,e.useState)([]),[m,h]=(0,e.useState)(null),[p,g]=(0,e.useState)("all"),[f,x]=(0,e.useState)("all"),[b,y]=(0,e.useState)("7d");(0,e.useEffect)(()=>{const e=[];e.push(function(e){const t=(0,vt.query)((0,vt.collection)(yt.db,"agent_registry"));return(0,vt.aQ)(t,t=>{const n=t.docs.map(e=>(0,s.A)({id:e.id},e.data()));e(n)})}(n)),e.push(function(e){let t,{unreadOnly:n=!1,limit:r=50}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t=n?(0,vt.query)((0,vt.collection)(yt.db,"agent_alerts"),(0,vt.where)("read","==",!1),(0,vt.orderBy)("createdAt","desc"),(0,vt.limit)(r)):(0,vt.query)((0,vt.collection)(yt.db,"agent_alerts"),(0,vt.orderBy)("createdAt","desc"),(0,vt.limit)(r)),(0,vt.aQ)(t,t=>{const n=t.docs.map(e=>(0,s.A)({id:e.id},e.data()));e(n)})}(a,{unreadOnly:!1,limit:50}));let t=null;return"24h"===b?t=new Date(Date.now()-864e5):"7d"===b?t=new Date(Date.now()-6048e5):"30d"===b&&(t=new Date(Date.now()-2592e6)),e.push(function(e){let{agentId:t=null,severity:n=null,since:r=null,limit:a=100}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=[(0,vt.orderBy)("timestamp","desc"),(0,vt.limit)(a)];t&&(i=[(0,vt.where)("agentId","==",t),...i]),n&&(i=[(0,vt.where)("severity","==",n),...i]),r&&(i=[(0,vt.where)("timestamp",">=",vt.Dc.fromDate(r)),...i]);const o=(0,vt.query)((0,vt.collection)(yt.db,"agent_events"),...i);return(0,vt.aQ)(o,t=>{const n=t.docs.map(e=>(0,s.A)({id:e.id},e.data()));e(n)})}(o,{agentId:"all"===p?null:p,severity:"all"===f?null:f,since:t,limit:100})),()=>
2e.forEach(e=>e())},[p,f,b]),(0,e.useEffect)(()=>{if(!l)return;const e=function(e){let{agentId:t=null,limit:n=50}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=[(0,vt.orderBy)("timestamp","desc"),(0,vt.limit)(n)];t&&(r=[(0,vt.where)("agentId","==",t),...r]);const a=(0,vt.query)((0,vt.collection)(yt.db,"agent_actions"),...r);return(0,vt.aQ)(a,t=>{const n=t.docs.map(e=>(0,s.A)({id:e.id},e.data()));e(n)})}(u,{agentId:l.id,limit:10});return e},[l]);const v=r.filter(e=>!e.read),w=[...r].sort((e,t)=>"critical"===e.severity&&"critical"!==t.severity?-1:"critical"===t.severity&&"critical"!==e.severity?1:!e.read&&t.read?-1:e.read&&!t.read?1:0);return(0,nn.jsxs)("div",{className:"space-y-8",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("h2",{className:"text-xl font-semibold text-gray-900 mb-4",children:"Agent Registry"}),(0,nn.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:t.sort((e,t)=>"active"===e.status?-1:1).map(e=>(0,nn.jsxs)("div",{className:"bg-white shadow rounded-lg p-5 border border-gray-200",children:[(0,nn.jsxs)("div",{className:"flex items-start justify-between mb-2",children:[(0,nn.jsx)("h3",{className:"text-lg font-semibold text-gray-900",children:e.name}),(0,nn.jsx)("span",{className:"px-2 py-0.5 rounded-full text-xs font-medium ".concat(Tr[e.status]||Tr.not_implemented),children:e.status})]}),(0,nn.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,nn.jsx)("span",{className:"px-2 py-0.5 rounded text-xs font-medium ".concat(Pr[e.type]||"bg-gray-100 text-gray-600"),children:e.type}),e.version&&"0.0.0"!==e.version&&(0,nn.jsxs)("span",{className:"text-xs text-gray-400",children:["v",e.version]})]}),(0,nn.jsx)("p",{className:"text-sm text-gray-600 mb-3 line-clamp-2",children:e.description}),Ar[e.id]&&Ar[e.id].length>0&&(0,nn.jsxs)("p",{className:"text-xs text-gray-400 mb-3",children:["Manages: ",Ar[e.id].join(", ")]}),"not_implemented"!==e.status&&(0,nn.jsxs)("div",{className:"flex items-center gap-3 mb-3 text-xs",children:[e.criticalCount7d>0&&(0,nn.jsxs)("span",{className:"text-red-600 font-semibold",children:[e.criticalCount7d," critical"]}),e.warningCount7d>0&&(0,nn.jsxs)("span",{className:"text-yellow-600 font-semibold",children:[e.warningCount7d," warning"]}),e.infoCount7d>0&&(0,nn.jsxs)("span",{className:"text-gray-500",children:[e.infoCount7d," info"]}),(0,nn.jsxs)("span",{className:"text-gray-400",children:["(",e.totalEventsAllTime||0," total)"]})]}),e.lastEventAt&&(0,nn.jsxs)("p",{className:"text-xs text-gray-400 mb-3",children:["Last event: ",Er(e.lastEventAt)]}),(0,nn.jsxs)("div",{className:"flex items-center justify-between pt-3 border-t border-gray-100",children:["not_implemented"!==e.status?(0,nn.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer",children:[(0,nn.jsx)("input",{type:"checkbox",checked:!1!==e.enabled,onChange:t=>Sr(e.id,t.target.checked),className:"rounded border-gray-300 text-apn-blue focus:ring-apn-blue"}),(0,nn.jsx)("span",{className:"text-xs text-gray-500",children:"Enabled"})]}):(0,nn.jsx)("span",{className:"text-xs text-gray-400 italic",children:"Not yet built"}),(0,nn.jsx)("button",{onClick:()=>c(e),className:"text-xs text-apn-blue hover:text-apn-dark-blue font-medium",children:"View details"})]})]},e.id))})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,nn.jsx)("h2",{className:"text-xl font-semibold text-gray-900",children:"Alerts"}),v.length>0&&(0,nn.jsx)("span",{className:"bg-red-500 text-white text-xs rounded-full h-5 min-w-[1.25rem] px-1.5 flex items-center justify-center",children:v.length})]}),0===w.length?(0,nn.jsx)("div",{className:"bg-white shadow rounded-lg p-6 text-center text-gray-400",children:"No alerts yet. Alerts will appear here when agents detect issues."}):(0,nn.jsx)("div",{className:"space-y-2 max-h-96 overflow-y-auto",children:w.map(e=>{const t=Cr[e.severity]||Cr.info;return(0,nn.jsx)("div",{className:"bg-white shadow rounded-lg p-4 border-l-4 ".concat(t.border," ").concat(e.read?"opacity-60":""),children:(0,nn.jsxs)("div",{className:"flex items-start justify-between",children:[(0,nn.jsxs)("div",{className:"flex-1",children:[(0,nn.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,nn.jsx)("span",{className:"px-1.5 py-0.5 rounded text-xs font-medium ".concat(t.badge),children:e.severity}),(0,nn.jsx)("span",{className:"text-xs text-gray-400",children:e.agentId}),(0,nn.jsx)("span",{className:"text-xs text-gray-400",children:Er(e.createdAt)})]}),(0,nn.jsx)("p",{className:"text-sm font-medium text-gray-900",children:e.title}),(0,nn.jsx)("p",{className:"text-xs text-gray-600 mt-1",children:e.summary})]}),!e.read&&(0,nn.jsx)("button",{onClick:()=>async function(e){await(0,vt.updateDoc)((0,vt.doc)(yt.db,"agent_alerts",e),{read:!0,readBy:"admin",readAt:(0,vt.serverTimestamp)()})}(e.id),className:"ml-3 text-xs text-apn-blue hover:text-apn-dark-blue whitespace-nowrap",children:"Mark read"})]})},e.id)})})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("h2",{className:"text-xl font-semibold text-gray-900 mb-4",children:"Recent Events"}),(0,nn.jsxs)("div",{className:"flex flex-wrap gap-3 mb-4",children:[(0,nn.jsxs)("select",{value:p,onChange:e=>g(e.target.value),className:"rounded-md border-gray-300 text-sm shadow-sm focus:border-apn-blue focus:ring-apn-blue",children:[(0,nn.jsx)("option",{value:"all",children:"All Agents"}),t.map(e=>(0,nn.jsx)("option",{value:e.id,children:e.name},e.id))]}),(0,nn.jsxs)("select",{value:f,onChange:e=>x(e.target.value),className:"rounded-md border-gray-300 text-sm shadow-sm focus:border-apn-blue focus:ring-apn-blue",children:[(0,nn.jsx)("option",{value:"all",children:"All Severities"}),(0,nn.jsx)("option",{value:"critical",children:"Critical"}),(0,nn.jsx)("option",{value:"warning",children:"Warning"}),(0,nn.jsx)("option",{value:"info",children:"Info"})]}),(0,nn.jsxs)("select",{value:b,onChange:e=>y(e.target.value),className:"rounded-md border-gray-300 text-sm shadow-sm focus:border-apn-blue focus:ring-apn-blue",children:[(0,nn.jsx)("option",{value:"24h",children:"Last 24h"}),(0,nn.jsx)("option",{value:"7d",children:"Last 7 days"}),(0,nn.jsx)("option",{value:"30d",children:"Last 30 days"}),(0,nn.jsx)("option",{value:"all",children:"All time"})]})]}),0===i.length?(0,nn.jsx)("div",{className:"bg-white shadow rounded-lg p-6 text-center text-gray-400",children:"No events match the current filters."}):(0,nn.jsxs)("div",{className:"bg-white shadow rounded-lg overflow-hidden",children:[(0,nn.jsxs)("table",{className:"min-w-full divide-y divide-gray-200",children:[(0,nn.jsx)("thead",{className:"bg-gray-50",children:(0,nn.jsxs)("tr",{children:[(0,nn.jsx)("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase",children:"Time"}),(0,nn.jsx)("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase",children:"Agent"}),(0,nn.jsx)("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase",children:"Sev"}),(0,nn.jsx)("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase",children:"Title"}),(0,nn.jsx)("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase",children:"Summary"})]})}),(0,nn.jsx)("tbody",{className:"divide-y divide-gray-200",children:i.map(e=>{const t=Cr[e.severity]||Cr.info;return(0,nn.jsxs)("tr",{className:"hover:bg-gray-50 cursor-pointer",onClick:()=>h(m===e.id?null:e.id),children:[(0,nn.jsx)("td",{className:"px-4 py-3 text-xs text-gray-500 whitespace-nowrap",children:Er(e.timestamp)}),(0,nn.jsx)("td",{className:"px-4 py-3 text-xs text-gray-600",children:e.agentId}),(0,nn.jsx)("td",{className:"px-4 py-3",children:(0,nn.jsx)("span",{className:"inline-block w-2 h-2 rounded-full ".concat(t.dot)})}),(0,nn.jsx)("td",{className:"px-4 py-3 text-sm font-medium text-gray-900",children:e.title}),(0,nn.jsx)("td",{className:"px-4 py-3 text-xs text-gray-600 max-w-xs truncate",children:e.summary})]},e.id)})})]}),m&&(()=>{const e=i.find(e=>e.id===m);return e?(0,nn.jsxs)("div",{className:"bg-gray-50 border-t border-gray-200 p-4",children:[(0,nn.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,nn.jsx)("h4",{className:"text-sm font-medium text-gray-900",children:"Event Details"}),!e.resolved&&(0,nn.jsx)("button",{onClick:t=>{t.stopPropagation(),async function(e){await(0,vt.updateDoc)((0,vt.doc)(yt.db,"agent_events",e),{resolved:!0,resolvedBy:"admin",resolvedAt:(0,vt.serverTimestamp)()})}(e.id)},className:"text-xs text-apn-blue hover:text-apn-dark-blue",children:"Mark resolved"})]}),(0,nn.jsx)("pre",{className:"text-xs text-gray-600 bg-white rounded p-3 overflow-auto max-h-48 border",children:JSON.stringify(e.details||{},null,2)}),e.targetCollection&&(0,nn.jsxs)("p",{className:"text-xs text-gray-400 mt-2",children:["Target: ",e.targetCollection,"/",e.targetDocId]})]}):null})()]})]}),l&&(0,nn.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4",onClick:()=>c(null),children:(0,nn.jsx)("div",{className:"bg-white rounded-lg shadow-xl max-w-2xl w-full max-h-[90vh] overflow-y-auto",onClick:e=>e.stopPropagation(),children:(0,nn.jsxs)("div",{className:"p-6",children:[(0,nn.jsxs)("div",{className:"flex items-start justify-between mb-4",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("h3",{className:"text-xl font-bold text-gray-900",children:l.name}),(0,nn.jsxs)("div",{className:"flex items-center gap-2 mt-1",children:[(0,nn.jsx)("span",{className:"px-2 py-0.5 rounded text-xs font-medium ".concat(Pr[l.type]||"bg-gray-100"),children:l.type}),(0,nn.jsx)("span",{className:"px-2 py-0.5 rounded-full text-xs font-medium ".concat(Tr[l.status]),children:l.status}),l.version&&(0,nn.jsxs)("span",{className:"text-xs text-gray-400",children:["v",l.version]})]})]}),(0,nn.jsx)("button",{onClick:()=>c(null),className:"text-gray-400 hover:text-gray-600 text-2xl leading-none",children:"\xd7"})]}),(0,nn.jsx)("p",{className:"text-sm text-gray-600 mb-4",children:l.description}),Ar[l.id]&&Ar[l.id].length>0&&(0,nn.jsxs)("p",{className:"text-sm text-gray-500 mb-4",children:[(0,nn.jsx)("span",{className:"font-medium",children:"Manages:"}
2)," ",Ar[l.id].join(", ")]}),(0,nn.jsxs)("div",{className:"grid grid-cols-3 gap-4 mb-6",children:[(0,nn.jsxs)("div",{className:"bg-gray-50 rounded-lg p-3 text-center",children:[(0,nn.jsx)("p",{className:"text-2xl font-bold text-gray-900",children:l.totalEventsAllTime||0}),(0,nn.jsx)("p",{className:"text-xs text-gray-500",children:"Total Events"})]}),(0,nn.jsxs)("div",{className:"bg-gray-50 rounded-lg p-3 text-center",children:[(0,nn.jsx)("p",{className:"text-2xl font-bold text-gray-900",children:l.eventCount7d||0}),(0,nn.jsx)("p",{className:"text-xs text-gray-500",children:"Last 7 Days"})]}),(0,nn.jsxs)("div",{className:"bg-gray-50 rounded-lg p-3 text-center",children:[(0,nn.jsx)("p",{className:"text-2xl font-bold text-red-600",children:l.criticalCount7d||0}),(0,nn.jsx)("p",{className:"text-xs text-gray-500",children:"Critical (7d)"})]})]}),l.lastEventAt&&(0,nn.jsxs)("p",{className:"text-xs text-gray-400 mb-4",children:["Last event: ",Er(l.lastEventAt)]}),"not_implemented"!==l.status&&(0,nn.jsx)("div",{className:"flex items-center gap-3 mb-6",children:(0,nn.jsx)("button",{onClick:()=>Sr(l.id,!l.enabled),className:"px-4 py-2 rounded-md text-sm font-medium ".concat(l.enabled?"bg-yellow-100 text-yellow-800 hover:bg-yellow-200":"bg-green-100 text-green-800 hover:bg-green-200"),children:l.enabled?"Pause Agent":"Resume Agent"})}),(0,nn.jsxs)("div",{className:"mb-6",children:[(0,nn.jsx)("h4",{className:"text-sm font-semibold text-gray-700 mb-2",children:"Recent Events"}),0===i.filter(e=>e.agentId===l.id).length?(0,nn.jsx)("p",{className:"text-xs text-gray-400",children:"No events yet"}):(0,nn.jsx)("div",{className:"space-y-2 max-h-48 overflow-y-auto",children:i.filter(e=>e.agentId===l.id).slice(0,20).map(e=>{const t=Cr[e.severity]||Cr.info;return(0,nn.jsxs)("div",{className:"text-xs p-2 rounded ".concat(t.bg),children:[(0,nn.jsxs)("span",{className:"font-medium ".concat(t.text),children:["[",e.severity,"]"]})," ",(0,nn.jsx)("span",{className:"text-gray-700",children:e.title})," ",(0,nn.jsx)("span",{className:"text-gray-400",children:Er(e.timestamp)})]},e.id)})})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("h4",{className:"text-sm font-semibold text-gray-700 mb-2",children:"Recent Actions"}),0===d.length?(0,nn.jsx)("p",{className:"text-xs text-gray-400",children:"No actions taken yet"}):(0,nn.jsx)("div",{className:"space-y-2 max-h-48 overflow-y-auto",children:d.map(e=>(0,nn.jsxs)("div",{className:"text-xs p-2 rounded bg-gray-50 border border-gray-100",children:[(0,nn.jsx)("span",{className:"font-medium text-gray-700",children:e.actionType})," ",(0,nn.jsxs)("span",{className:"text-gray-500",children:["on ",e.targetCollection,"/",e.targetDocId]})," ",(0,nn.jsx)("span",{className:e.success?"text-green-600":"text-red-600",children:e.success?"OK":"FAILED"})," ",(0,nn.jsx)("span",{className:"text-gray-400",children:Er(e.timestamp)})]},e.id))})]})]})})})]})}function Ir(){var t,n,r,a,i,o,l;const{hasRole:c,userProfile:d}=sn(),u=oe();console.log("\ud83d\udd0d Admin Dashboard - User Profile:",d),console.log("\ud83d\udd0d Admin Dashboard - Has Admin Role:",c("admin"));const[m,h]=(0,e.useState)([]),[p,g]=(0,e.useState)(null),[f,x]=(0,e.useState)([]),[b,y]=(0,e.useState)(null),[v,w]=(0,e.useState)(!1),[j,N]=(0,e.useState)(!0),[k,A]=(0,e.useState)("overview"),[S,E]=(0,e.useState)(!1),C=c("admin");if((0,e.useEffect)(()=>{console.log("\ud83d\udd0d AdminDashboard useEffect - isAdmin:",C),C&&async function(){try{console.log("\ud83d\udd0d Fetching admin data...");const e=await(0,wn.jS)();console.log("\ud83d\udd0d Total users in database:",e);const[t,n,r,s,a]=await Promise.all([(0,wn.A)().catch(e=>(console.error("\u274c Error fetching pending users:",e),[])),(0,wn.P5)().catch(e=>(console.error("\u274c Error fetching analytics:",e),{activeMembers:0,pendingMembers:0,totalEvents:0,totalGroups:0})),(0,wn.getAllUsers)(100).catch(e=>(console.error("\u274c Error fetching all users:",e),[])),(0,wn.Ft)().catch(e=>(console.error("\u274c Error fetching revenue summary:",e),null)),(0,wn.l9)().catch(()=>!1)]);console.log("\ud83d\udd0d Admin data fetched:",{pending:t.length,stats:n,users:r.length,userCount:e}),h(t),g(n),x(r),y(s),w(a)}catch(e){console.error("\u274c Error fetching admin data:",e)}finally{N(!1)}}()},[C]),!C)return(0,nn.jsx)("div",{className:"max-w-4xl mx-auto p-6",children:(0,nn.jsx)("div",{className:"bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded",children:"You don't have permission to access the admin dashboard."})});return j?(0,nn.jsx)("div",{className:"flex justify-center items-center h-screen",children:(0,nn.jsx)("div",{className:"animate-spin rounded-full h-12 w-12 border-t-2 border-b-2 border-apn-blue"})}):(0,nn.jsxs)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:[(0,nn.jsxs)("div",{className:"mb-8",children:[(0,nn.jsx)("h1",{className:"text-3xl font-bold text-gray-900",children:"Admin Dashboard \ud83d\udd27"}),(0,nn.jsx)("p",{className:"mt-2 text-gray-600",children:"Manage users, content, and monitor platform activity. LinkedIn Integration Added!"}),m.length>0&&(0,nn.jsx)("div",{className:"mt-4 bg-yellow-50 border border-yellow-200 rounded-md p-4",children:(0,nn.jsxs)("div",{className:"flex items-center",children:[(0,nn.jsx)("div",{className:"flex-shrink-0",children:(0,nn.jsx)("svg",{className:"h-5 w-5 text-yellow-400",viewBox:"0 0 20 20",fill:"currentColor",children:(0,nn.jsx)("path",{fillRule:"evenodd",d:"M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z",clipRule:"evenodd"})})}),(0,nn.jsxs)("div",{className:"ml-3",children:[(0,nn.jsxs)("h3",{className:"text-sm font-medium text-yellow-800",children:[m.length," User",m.length>
21?"s":""," Awaiting Approval"]}),(0,nn.jsx)("div",{className:"mt-2 text-sm text-yellow-700",children:(0,nn.jsxs)("p",{children:["New user registrations need your attention."," ",(0,nn.jsx)("button",{onClick:()=>A("pending"),className:"font-medium underline text-yellow-800 hover:text-yellow-600",children:"Review pending users"})]})})]})]})}),(0,nn.jsxs)("div",{className:"mt-2 text-sm text-blue-600",children:["Debug: Admin Role = ",c("admin")?"YES":"NO"," | User: ",(null===d||void 0===d?void 0:d.email)||"Not loaded"]}),(0,nn.jsxs)("div",{className:"mt-1 text-sm text-gray-600",children:["Users Loaded: ",f.length," | Pending: ",m.length," | Loading: ",j?"YES":"NO"]})]}),(0,nn.jsx)("div",{className:"border-b border-gray-200 mb-8",children:(0,nn.jsx)("nav",{className:"-mb-px flex space-x-8",children:[{id:"overview",name:"Overview"},{id:"pending",name:"Pending Approvals",count:m.length},{id:"users",name:"All Users"},{id:"content",name:"Content Management"},{id:"clients",name:"Client Management \ud83d\udcbc"},{id:"pipeline",name:"Agency Pipeline \ud83c\udfe2"},{id:"linkedin",name:"LinkedIn Integration \ud83d\udd17"},{id:"agents",name:"AI Agents"}].map(e=>(console.log("\ud83d\udd0d Rendering tab:",e.name),(0,nn.jsx)("button",{onClick:()=>{console.log("\ud83d\udd0d Tab clicked:",e.id),A(e.id)},className:"py-2 px-1 border-b-2 font-medium text-sm relative ".concat(k===e.id?"border-apn-blue text-apn-blue":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"),children:(0,nn.jsxs)("span",{className:"flex items-center space-x-2",children:[(0,nn.jsx)("span",{children:e.name}),e.count>0&&(0,nn.jsx)("span",{className:"bg-red-500 text-white text-xs rounded-full h-5 w-5 flex items-center justify-center",children:e.count>99?"99+":e.count})]})},e.id)))})}),"overview"===k&&(0,nn.jsxs)("div",{className:"space-y-8",children:[(0,nn.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-6",children:[(0,nn.jsxs)("div",{className:"bg-white shadow rounded-lg p-5 border-l-4 border-green-500",children:[(0,nn.jsx)("div",{className:"text-sm text-gray-500",children:"Total Revenue (funded)"}),(0,nn.jsxs)("div",{className:"text-2xl font-bold text-green-700",children:["$",(null!==(t=null===b||void 0===b?void 0:b.totalRevenue)&&void 0!==t?t:0).toFixed(2)]}),(0,nn.jsx)("div",{className:"text-xs text-gray-400 mt-1",children:"Memberships + events"})]}),(0,nn.jsxs)("div",{className:"bg-white shadow rounded-lg p-5 border-l-4 border-[#3d67ad]",children:[(0,nn.jsx)("div",{className:"text-sm text-gray-500",children:"Membership Revenue"}),(0,nn.jsxs)("div",{className:"text-2xl font-bold text-gray-900",children:["$",(null!==(n=null===b||void 0===b?void 0:b.membershipRevenue)&&void 0!==n?n:0).toFixed(2)]}),(0,nn.jsxs)("div",{className:"text-xs text-gray-400 mt-1",children:[null!==(r=null===b||void 0===b?void 0:b.paidMembers)&&void 0!==r?r:0," paid member",1===(null!==(a=null===b||void 0===b?void 0:b.paidMembers)&&void 0!==a?a:0)?"":"s"]})]}),(0,nn.jsxs)("div",{className:"bg-white shadow rounded-lg p-5 border-l-4 border-purple-500",children:[(0,nn.jsx)("div",{className:"text-sm text-gray-500",children:"Event Revenue"}),(0,nn.jsxs)("div",{className:"text-2xl font-bold text-gray-900",children:["$",(null!==(i=null===b||void 0===b?void 0:b.eventRevenue)&&void 0!==i?i:0).toFixed(2)]}),(0,nn.jsxs)("div",{className:"text-xs text-gray-400 mt-1",children:[null!==(o=null===b||void 0===b?void 0:b.paidEventRegistrations)&&void 0!==o?o:0," paid registration",1===(null!==(l=null===b||void 0===b?void 0:b.paidEventRegistrations)&&void 0!==l?l:0)?"":"s"]})]}),(0,nn.jsxs)("div",{className:"bg-white shadow rounded-lg p-5 border-l-4 border-orange-400",children:[(0,nn.jsx)("div",{className:"text-sm text-gray-500",children:"Demo / Sample Content"}),(0,nn.jsx)("div",{className:"text-lg font-bold text-gray-900 mb-2",children:v?"Hidden":"Showing"}),(0,nn.jsx)("button",{onClick:async()=>{const e=!v;try{await(0,wn.L0)(e),w(e)}catch(t){console.error("Error toggling demo content:",t),alert("Failed to update demo content visibility.")}},className:"text-sm px-3 py-1 rounded text-white ".concat(v?"bg-green-600 hover:bg-green-700":"bg-orange-500 hover:bg-orange-600"),children:v?"Show demo content":"Hide demo content"}),(0,nn.jsx)("div",{className:"text-xs text-gray-400 mt-1",children:"Seed members & groups"})]})]}),(0,nn.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6",children:[(0,nn.jsx)("div",{className:"bg-white overflow-hidden shadow rounded-lg",children:(0,nn.jsx)("div",{className:"p-5",children:(0,nn.jsxs)("div",{className:"flex items-center",children:[(0,nn.jsx)("div",{className:"flex-shrink-0",children:(0,nn.jsx)("div",{className:"w-8 h-8 bg-blue-100 rounded-full flex items-center justify-center",children:(0,nn.jsx)("svg",{className:"w-5 h-5 text-blue-600",fill:"currentColor",viewBox:"0 0 20 20",children:(0,nn.jsx)("path",{d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})})})}),(0,nn.jsx)("div",{className:"ml-5 w-0 flex-1",children:(0,nn.jsxs)("dl",{children:[(0,nn.jsx)("dt",{className:"text-sm font-medium text-gray-500 truncate",children:"Total Users"}),(0,nn.jsx)("dd",{className:"text-lg font-medium text-gray-900",children:(null===p||void 0===p?void 0:p.totalUsers)||0})]})})]})})}),(0,nn.jsx)("div",{className:"bg-white overflow-hidden shadow rounded-lg",children:(0,nn.jsx)("div",{className:"p-5",children:(0,nn.jsxs)("div",{className:"flex items-center",children:[(0,nn.jsx)("div",{className:"flex-shrink-0",children:(0,nn.jsx)("div",{className:"w-8 h-8 bg-green-100 rounded-full flex items-center justify-center",children:(0,nn.jsx)("svg",{className:"w-5 h-5 text-green-600",fill:"currentColor",viewBox:"0 0 20 20",children:(0,nn.jsx)("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"})})})}),(0,nn.jsx)("div",{className:"ml-5 w-0 flex-1",children:(0,nn.jsxs)("dl",{children:[(0,nn.jsx)("dt",{className:"text-sm font-medium text-gray-500 truncate",children:"Active Members"}),(0,nn.jsx)("dd",{className:"text-lg font-medium text-gray-900",children:(null===p||void 0===p?void 0:p.activeMembers)||0})]})})]})})}),(0,nn.jsx)("div",{className:"bg-white overflow-hidden shadow rounded-lg",children:(0,nn.jsx)("div",{className:"p-5",children:(0,nn.jsxs)("div",{className:"flex items-center",children:[(0,nn.jsx)("div",{className:"flex-shrink-0",children:(0,nn.jsx)("div",{className:"w-8 h-8 bg-yellow-100 rounded-full flex items-center justify-center",children:(0,nn.jsx)("svg",{className:"w-5 h-5 text-yellow-600",fill:"currentColor",viewBox:"0 0 20 20",children:(0,nn.jsx)("path",{fillRule:"evenodd",d:"M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z",clipRule:"evenodd"})})})}),(0,nn.jsx)("div",{className:"ml-5 w-0 flex-1",children:(0,nn.jsxs)("dl",{children:[(0,nn.jsx)("dt",{className:"text-sm font-medium text-gray-500 truncate",children:"Pending Approval"}),(0,nn.jsx)("dd",{className:"text-lg font-medium text-gray-900",children:(null===p||void 0===p?void 0:p.pendingMembers)||0})]})})]})})}),(0,nn.jsx)("div",{className:"bg-white overflow-hidden shadow rounded-lg",children:(0,nn.jsx)("div",{className:"p-5",children:(0,nn.jsxs)("div",{className:"flex items-center",children:[(0,nn.jsx)("div",{className:"flex-shrink-0",children:(0,nn.jsx)("div",{className:"w-8 h-8 bg-purple-100 rounded-full flex items-center justify-center",children:(0,nn.jsx)("svg",{className:"w-5 h-5 text-purple-600",fill:"currentColor",viewBox:"0 0 20 20",children:(0,nn.jsx)("path",{fillRule:"evenodd",d:"M6 2a1 1 0 00-1 1v1H4a2 2 0 00-2 2v10a2 2 0 002 2h12a2 2 0 002-2V6a2 2 0 00-2-2h-1V3a1 1 0 10-2 0v1H7V3a1 1 0 00-1-1zm0 5a1 1 0 000 2h8a1 1 0 100-2H6z",clipRule:"evenodd"})})})}),(0,nn.jsx)("div",{className:"ml-5 w-0 flex-1",children:(0,nn.jsxs)("dl",{children:[(0,nn.jsx)("dt",{className:"text-sm font-medium text-gray-500 truncate",children:"Total Events"}),(0,nn.jsx)("dd",{className:"text-lg font-medium text-gray-900",children:(null===p||void 0===p?void 0:p.totalEvents)||0})]})})]})})})]}),(0,nn.jsxs)("div",{className:"bg-white shadow rounded-lg",children:[(0,nn.jsx)("div",{className:"px-6 py-4 border-b border-gray-200",children:(0,nn.jsx)("h3",{className:"text-lg font-medium text-gray-900",children:"Platform Statistics"})}),(0,nn.jsx)("div",{className:"p-6",children:(0,nn.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("h4",{className:"text-sm font-medium text-gray-900 mb-4",children:"Content Overview"}),(0,nn.jsxs)("div",{className:"space-y-3",children:[(0,nn.jsxs)("div",{className:"flex justify-between",children:[(0,nn.jsx)("span",{className:"text-sm text-gray-600",children:"Total Jobs"}),(0,nn.jsx)("span",{className:"text-sm font-medium",children:(null===p||void 0===p?void 0:p.totalJobs)||0})]}),(0,nn.jsxs)("div",{className:"flex justify-between",children:[(0,nn.jsx)("span",{className:"text-sm text-gray-600",children:"Total Projects"}),(0,nn.jsx)("span",{className:"text-sm font-medium",children:(null===p||void 0===p?void 0:p.totalProjects)||0})]}),(0,nn.jsxs)("div",{className:"flex justify-between",children:[(0,nn.jsx)("span",{className:"text-sm text-gray-600",children:"Total Events"}),(0,nn.jsx)("span",{className:"text-sm font-medium",children:(null===p||void 0===p?void 0:p.totalEvents)||0})]})]})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("h4",{className:"text-sm font-medium text-gray-900 mb-4",children:"User Breakdown"}),(0,nn.jsxs)("div",{className:"space-y-3",children:[(0,nn.jsxs)("div",{className:"flex justify-between",children:[(0,nn.jsx)("span",{className:"text-sm text-gray-600",children:"Real Users"}),(0,nn.jsx)("span",{className:"text-sm font-medium text-green-600",children:f.filter(e=>!e.isSeeded).length})]}),(0,nn.jsxs)("div",{className:"flex justify-between",children:[(0,nn.jsx)("span",{className:"text-sm text-gray-600",children:"Seeded (Sample)"}),(0,nn.jsx)("span",{className:"text-sm font-medium text-orange-500",children:f.filter(e=>e.isSeeded).length})]}),(0,nn.jsxs)("div",{className:"flex justify-between",children:[(0,nn.jsx)("span",{className:"text-sm text-gray-600",children:"Pending Approval"}),(0,nn.jsx)("span",{className:"text-sm font-medium text-yellow-600",children:(null===p||void 0===p?void 0:p.pendingMembers)||0})]}),(0,nn.jsxs)("div",{className:"flex justify-between",children:[(0,nn.jsx)("span",{className:"text-sm text-gray-600",children:"Approved Members"}),(0,nn.jsx)("span",{className:"text-sm font-medium text-green-600",children:(null===p||void 0===p?void 0:p.activeMembers)||0})]})]})]})]})})]})]}),"pending"===k&&(0,nn.jsxs)("div",{className:"bg-white shadow rounded-lg",children:[(0,nn.jsx)("div",{className:"px-6 py-4 border-b border-gray-200",children:(0,nn.jsxs)("h3",{className:"text-lg font-medium text-gray-900",children:["Pending User Approvals (",m.length,")"]})}),(0,nn.jsx)("div",{className:"overflow-hidden",children:0===m.length?(0,nn.jsx)("div",{className:"p-6 text-center text-gray-500",children:"No pending approvals at this time."}):(0,nn.jsx)("div",{className:"overflow-x-auto",children:(0,nn.jsxs)("table",{className:"min-w-full divide-y divide-gray-200",children:[(0,nn.jsx)("thead",{className:"bg-gray-50",children:(0,nn.jsxs)("tr",{children:[(0,nn.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"User"}),(0,nn.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Company"}),(0,nn.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Job Title"}),(0,nn.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Applied"}),(0,nn.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Actions"})]})}),(0,nn.jsx)("tbody",{className:"bg-white divide-y divide-gray-200",children:m.map(e=>{var t,n,r,a,i;return(0,nn.jsxs)("tr",{children:[(0,nn.jsx)("td",{className:"px-6 py-4 whitespace-nowrap",children:(0,nn.jsxs)("div",{className:"flex items-center",children:[(0,nn.jsx)("div",{className:"h-10 w-10 flex-shrink-0",children:(0,nn.jsx)("div",{className:"h-10 w-10 rounded-full bg-gray-300 flex items-center justify-center",children:(0,nn.jsx)("span",{className:"text-sm font-medium text-gray-700",children:(null===(t=e.displayName)||void 0===t?void 0:t.charAt(0))||(null===(n=e.email)||void 0===n?void 0:n.charAt(0))})})}),(0,nn.jsxs)("div",{className:"ml-4",children:[(0,nn.jsx)("div",{className:"text-sm font-medium text-gray-900",children:e.displayName}),(0,nn.jsx)("div",{className:"text-sm text-gray-500",children:e.email})]})]})}),(0,nn.jsx)("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-900",children:e.company}),(0,nn.jsx)("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-900",children:e.jobTitle}),(0,nn.jsx)("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:(null===(r=e.createdAt)||void 0===r||null===(a=r.toDate)||void 0===a||null===(i=a.call(r))||void 0===i?void 0:i.toLocaleDateString())||"Unknown"}),(0,nn.jsxs)("td",{className:"px-6 py-4 whitespace-nowrap text-sm font-medium",children:[(0,nn.jsx)("button",{onClick:()=>(async e=>{try{await(0,wn.LB)(e),h(t=>t.filter(t=>t.id!==e)),g(e=>(0,s.A)((0,s.A)({},e),{},{activeMembers:e.activeMembers+1,pendingMembers:e.pendingMembers-1}))}catch(t){console.error("Error approving user:",t),alert("Failed to approve user. Please try again.")}})(e.id),className:"text-green-600 hover:text-green-900 mr-4",children:"Approve"}),(0,nn.jsx)("button",{onClick:()=>(async e=>{if(window.confirm("Reject this registration? They will not be able to access member areas."))try{await(0,wn.l)(e),h(t=>t.filter(t=>t.id!==e)),g(e=>(0,s.A)((0,s.A)({},e),{},{pendingMembers:Math.max(0,((null===e||void 0===e?void 0:e.pendingMembers)||0)-1)}))}catch(t){console.error("Error rejecting user:",t),alert("Failed to reject user. Please try again.")}})(e.id),className:"text-red-600 hover:text-red-900",children:"Reject"})]})]},e.id)})})]})})})]}),"users"===k&&(()=>{const e=f.filter(e=>!e.isSeeded),t=f.filter(e=>e.isSeeded);return(0,nn.jsxs)("div",{className:"space-y-6",children:[(0,nn.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[(0,nn.jsxs)("div",{className:"bg-white shadow rounded-lg p-4 border-l-4 border-[#3d67ad]",children:[(0,nn.jsx)("div",{className:"text-sm text-gray-500",children:"Total Users"}),(0,nn.jsx)("div",{className:"text-2xl font-bold text-gray-900",children:f.length})]}),(0,nn.jsxs)("div",{className:"bg-white shadow rounded-lg p-4 border-l-4 border-green-500",children:[(0,nn.jsx)("div",{className:"text-sm text-gray-500",children:"Real Users"}),(0,nn.jsx)("div",{className:"text-2xl font-bold text-green-700",children:e.length})]}),(0,nn.jsxs)("div",{className:"bg-white shadow rounded-lg p-4 border-l-4 border-orange-400",children:[(0,nn.jsx)("div",{className:"text-sm text-gray-500",children:"Seeded (Sample)"}),(0,nn.jsx)("div",{className:"text-2xl font-bold text-orange-600",children:t.length})]})]}),(0,nn.jsxs)("div",{className:"bg-white shadow rounded-lg",children:[(0,nn.jsx)("div",{className:"px-6 py-4 border-b border-gray-200 flex items-center justify-between",children:(0,nn.jsxs)("h3",{className:"text-lg font-medium text-gray-900 flex items-center",children:[(0,nn.jsx)("span",{className:"w-3 h-3 bg-green-500 rounded-full mr-2"}),"Real Users (",e.length,")"]})}),(0,nn.jsx)("div",{className:"overflow-x-auto",children:(0,nn.jsxs)("table",{className:"min-w-full divide-y divide-gray-200",children:[(0,nn.jsx)("thead",{className:"bg-gray-50",children:(0,nn.jsxs)("tr",{children:[(0,nn.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"User"}),(0,nn.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Status"}),(0,nn.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Role"}),(0,nn.jsx)("th",{className:"px-6 py-
23 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Paid"}),(0,nn.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Tier"}),(0,nn.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Joined"}),(0,nn.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Actions"})]})}),(0,nn.jsx)("tbody",{className:"bg-white divide-y divide-gray-200",children:0===e.length?(0,nn.jsx)("tr",{children:(0,nn.jsx)("td",{colSpan:"7",className:"px-6 py-8 text-center text-gray-400",children:"No real users yet"})}):e.map(e=>{var t,n,r,s,a,i;return(0,nn.jsxs)("tr",{children:[(0,nn.jsx)("td",{className:"px-6 py-4 whitespace-nowrap",children:(0,nn.jsxs)("div",{className:"flex items-center",children:[(0,nn.jsx)("div",{className:"h-10 w-10 rounded-full bg-[#3d67ad] flex items-center justify-center flex-shrink-0",children:(0,nn.jsx)("span",{className:"text-sm font-medium text-white",children:(null===(t=e.displayName)||void 0===t?void 0:t.charAt(0))||(null===(n=e.firstName)||void 0===n?void 0:n.charAt(0))||(null===(r=e.email)||void 0===r?void 0:r.charAt(0))})}),(0,nn.jsxs)("div",{className:"ml-4",children:[(0,nn.jsx)("div",{className:"text-sm font-medium text-gray-900",children:e.displayName||"".concat(e.firstName||""," ").concat(e.lastName||"").trim()}),(0,nn.jsx)("div",{className:"text-sm text-gray-500",children:e.email})]})]})}),(0,nn.jsx)("td",{className:"px-6 py-4 whitespace-nowrap",children:(0,nn.jsx)("span",{className:"inline-flex px-2 py-1 text-xs font-semibold rounded-full ".concat("approved"===e.status?"bg-green-100 text-green-800":"bg-yellow-100 text-yellow-800"),children:e.status})}),(0,nn.jsx)("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-900",children:e.role}),(0,nn.jsx)("td",{className:"px-6 py-4 whitespace-nowrap",children:(0,nn.jsx)("span",{className:"inline-flex px-2 py-1 text-xs font-semibold rounded-full ".concat("paid"===e.paymentStatus?"bg-green-100 text-green-800":"bg-gray-100 text-gray-600"),children:"paid"===e.paymentStatus?"Paid":"Unpaid"})}),(0,nn.jsx)("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-900",children:e.membershipTier||e.selectedTier||"\u2014"}),(0,nn.jsx)("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:(null===(s=e.createdAt)||void 0===s||null===(a=s.toDate)||void 0===a||null===(i=a.call(s))||void 0===i?void 0:i.toLocaleDateString())||"Unknown"}),(0,nn.jsx)("td",{className:"px-6 py-4 whitespace-nowrap text-sm",children:(0,nn.jsx)("button",{onClick:()=>(async e=>{const t=e.displayName||e.email||"this user";if(window.confirm("Permanently delete ".concat(t,"? This removes their profile and member access, and cannot be undone.")))try{await(0,wn.wC)(e.id),x(t=>t.filter(t=>t.id!==e.id))}catch(n){console.error("Error deleting user:",n),alert("Failed to delete user. Please try again.")}})(e),className:"text-red-600 hover:text-red-800 font-medium",children:"Terminate"})})]},e.id)})})]})})]}),t.length>0&&(0,nn.jsxs)("div",{className:"bg-white shadow rounded-lg border border-orange-200",children:[(0,nn.jsxs)("div",{className:"px-6 py-4 border-b border-orange-200 bg-orange-50 flex items-center justify-between",children:[(0,nn.jsxs)("h3",{className:"text-lg font-medium text-orange-800 flex items-center",children:[(0,nn.jsx)("span",{className:"w-3 h-3 bg-orange-400 rounded-full mr-2"}),"Seeded / Sample Users (",t.length,")",(0,nn.jsx)("span",{className:"ml-2 text-xs bg-orange-200 text-orange-700 px-2 py-0.5 rounded-full",children:"Demo Only"})]}),(0,nn.jsx)("button",{onClick:()=>u("/admin/seed-data"),className:"text-sm text-orange-600 hover:text-orange-800 underline",children:"Manage Seeded Data \u2192"})]}),(0,nn.jsx)("div",{className:"overflow-x-auto",children:(0,nn.jsxs)("table",{className:"min-w-full divide-y divide-gray-200",children:[(0,nn.jsx)("thead",{className:"bg-orange-50",children:(0,nn.jsxs)("tr",{children:[(0,nn.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-orange-600 uppercase tracking-wider",children:"User"}),(0,nn.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-orange-600 uppercase tracking-wider",children:"Company"}),(0,nn.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-orange-600 uppercase tracking-wider",children:"Title"}),(0,nn.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-orange-600 uppercase tracking-wider",children:"Tier"})]})}),(0,nn.jsx)("tbody",{className:"bg-white divide-y divide-gray-200",children:t.map(e=>{var t,n;return(0,nn.jsxs)("tr",{className:"bg-orange-50/30",children:[(0,nn.jsx)("td",{className:"px-6 py-4 whitespace-nowrap",children:(0,nn.jsxs)("div",{className:"flex items-center",children:[(0,nn.jsx)("div",{className:"h-10 w-10 rounded-full bg-orange-300 flex items-center justify-center flex-shrink-0",children:(0,nn.jsxs)("span",{className:"text-sm font-medium text-orange-800",children:[null===(t=e.firstName)||void 0===t?void 0:t.charAt(0),null===(n=e.lastName)||void 0===n?void 0:n.charAt(0)]})}),(0,nn.jsxs)("div",{className:"ml-4",children:[(0,nn.jsx)("div",{className:"text-sm font-medium text-gray-900",children:e.displayName||"".concat(e.firstName," ").concat(e.lastName)}),(0,nn.jsx)("div",{className:"text-sm text-gray-400",children:e.email})]})]})}),(0,nn.jsx)("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-700",children:e.company}),(0,nn.jsx)("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-700",children:e.jobTitle}),(0,nn.jsx)("td",{className:"px-6 py-4 whitespace-nowrap",children:(0,nn.jsx)("span",{className:"inline-flex px-2 py-1 text-xs font-semibold rounded-full bg-orange-100 text-orange-700",children:e.membershipTier})})]},e.id)})})]})})]})]})})(),"content"===k&&(0,nn.jsx)("div",{className:"space-y-6",children:(0,nn.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[(0,nn.jsxs)("div",{className:"bg-white shadow rounded-lg p-6",children:[(0,nn.jsx)("h3",{className:"text-lg font-medium text-gray-900 mb-4",children:"Qu
2ick Actions"}),(0,nn.jsxs)("div",{className:"space-y-3",children:[(0,nn.jsx)("button",{onClick:()=>{u("/admin/events/create")},className:"w-full text-left px-4 py-2 text-sm text-apn-blue hover:bg-blue-50 rounded transition-colors",children:"Create Event"}),(0,nn.jsx)("button",{onClick:()=>{u("/admin/groups")},className:"w-full text-left px-4 py-2 text-sm text-apn-blue hover:bg-blue-50 rounded transition-colors",children:"Manage Groups"}),(0,nn.jsx)("button",{onClick:()=>u("/admin/users"),className:"w-full text-left px-4 py-2 text-sm text-red-600 hover:bg-red-50 rounded transition-colors",children:"\ud83d\udc65 Manage Users"}),(0,nn.jsx)("button",{onClick:()=>u("/admin/postings"),className:"w-full text-left px-4 py-2 text-sm text-orange-600 hover:bg-orange-50 rounded transition-colors",children:"\ud83d\udccb Manage Postings"}),(0,nn.jsx)("button",{onClick:()=>u("/admin/seo"),className:"w-full text-left px-4 py-2 text-sm text-green-600 hover:bg-green-50 rounded transition-colors",children:"\ud83d\udd0d SEO Management"}),(0,nn.jsx)("button",{onClick:()=>u("/admin/export"),className:"w-full text-left px-4 py-2 text-sm text-purple-600 hover:bg-purple-50 rounded transition-colors",children:"\ud83d\udcca Export Users"}),(0,nn.jsx)("button",{onClick:()=>{E(!0)},className:"w-full text-left px-4 py-2 text-sm text-apn-blue hover:bg-blue-50 rounded transition-colors",children:"Send Announcement"}),(0,nn.jsx)("button",{onClick:()=>u("/admin/campaigns"),className:"w-full text-left px-4 py-2 text-sm text-purple-600 hover:bg-purple-50 rounded transition-colors font-medium",children:"\ud83d\udce7 Campaign Dashboard (AI)"}),(0,nn.jsx)("button",{onClick:()=>{u("/admin/seed-data")},className:"w-full text-left px-4 py-2 text-sm text-green-600 hover:bg-green-50 rounded transition-colors",children:"Create Sample Data"}),(0,nn.jsx)("button",{onClick:()=>u("/admin/event-cleanup"),className:"w-full text-left px-4 py-2 text-sm text-orange-600 hover:bg-orange-50 rounded transition-colors",children:"\ud83d\uddd1\ufe0f Clean Test Events"}),(0,nn.jsx)("hr",{className:"my-2"}),(0,nn.jsx)("button",{onClick:()=>u("/admin/client-portal"),className:"w-full text-left px-4 py-2 text-sm text-apn-blue hover:bg-blue-50 rounded transition-colors font-medium",children:"\ud83c\udfe2 Client Portal"}),(0,nn.jsx)("hr",{className:"my-2"}),(0,nn.jsx)("button",{onClick:()=>u("/linkedin/groups"),className:"w-full text-left px-4 py-2 text-sm text-blue-600 hover:bg-blue-50 rounded transition-colors",children:"LinkedIn Groups"}),(0,nn.jsx)("button",{onClick:()=>u("/linkedin/graduates"),className:"w-full text-left px-4 py-2 text-sm text-blue-600 hover:bg-blue-50 rounded transition-colors",children:"Graduate Sourcing"})]})]}),(0,nn.jsxs)("div",{className:"bg-white shadow rounded-lg p-6",children:[(0,nn.jsx)("h3",{className:"text-lg font-medium text-gray-900 mb-4",children:"Content Stats"}),(0,nn.jsxs)("div",{className:"space-y-3",children:[(0,nn.jsxs)("div",{className:"flex justify-between",children:[(0,nn.jsx)("span",{className:"text-sm text-gray-600",children:"Active Jobs"}),(0,nn.jsx)("span",{className:"text-sm font-medium",children:(null===p||void 0===p?void 0:p.totalJobs)||0})]}),(0,nn.jsxs)("div",{className:"flex justify-between",children:[(0,nn.jsx)("span",{className:"text-sm text-gray-600",children:"Active Projects"}),(0,nn.jsx)("span",{className:"text-sm font-medium",children:(null===p||void 0===p?void 0:p.totalProjects)||0})]}),(0,nn.jsxs)("div",{className:"flex justify-between",children:[(0,nn.jsx)("span",{className:"text-sm text-gray-600",children:"Upcoming Events"}),(0,nn.jsx)("span",{className:"text-sm font-medium",children:(null===p||void 0===p?void 0:p.totalEvents)||0})]})]})]}),(0,nn.jsxs)("div",{className:"bg-white shadow rounded-lg p-6",children:[(0,nn.jsx)("h3",{className:"text-lg font-medium text-gray-900 mb-4",children:"System Health"}),(0,nn.jsxs)("div",{className:"space-y-3",children:[(0,nn.jsxs)("div",{className:"flex items-center",children:[(0,nn.jsx)("div",{className:"w-2 h-2 bg-green-400 rounded-full mr-2"}),(0,nn.jsx)("span",{className:"text-sm text-gray-600",children:"Database: Online"})]}),(0,nn.jsxs)("div",{className:"flex items-center",children:[(0,nn.jsx)("div",{className:"w-2 h-2 bg-green-400 rounded-full mr-2"}),(0,nn.jsx)("span",{className:"text-sm text-gray-600",children:"Authentication: Online"})]}),(0,nn.jsxs)("div",{className:"flex items-center",children:[(0,nn.jsx)("div",{className:"w-2 h-2 bg-green-400 rounded-full mr-2"}),(0,nn.jsx)("span",{className:"text-sm text-gray-600",children:"Storage: Online"})]})]})]})]})}),"clients"===k&&(0,nn.jsx)(dr,{}),"pipeline"===k&&(0,nn.jsx)(kr,{}),"linkedin"===k&&(0,nn.jsxs)("div",{className:"space-y-6",children:[(0,nn.jsxs)("div",{className:"bg-white shadow rounded-lg p-6",children:[(0,nn.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("h3",{className:"text-lg font-medium text-gray-900",children:"LinkedIn Integration"}),(0,nn.jsx)("p",{className:"text-sm text-gray-600 mt-1",children:"Manage LinkedIn professional groups and graduate sourcing for talent acquisition"})]}),(0,nn.jsxs)("div",{className:"flex items-center",children:[(0,nn.jsx)("div",{className:"w-2 h-2 bg-yellow-400 rounded-full mr-2"}),(0,nn.jsx)("span",{className:"text-sm text-gray-600",children:"Demo Mode"})]})]}),(0,nn.jsx)("div",{className:"bg-yellow-50 border border-yellow-200 rounded-lg p-4 mb-6",children:(0,nn.jsxs)("div",{className:"flex",children:[(0,nn.jsx)("div",{className:"flex-shrink-0",children:(0,nn.jsx)("svg",{className:"h-5 w-5 text-yellow-400",fill:"currentColor",viewBox:"0 0 20 20",children:(0,nn.jsx)("path",{fillRule:"evenodd",d:"M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z",clipRule:"evenodd"})})}),(0,nn.jsxs)("div",{className:"ml-3",children:[(0,nn.jsx)("h3",{className:"text-sm font-medium text-yellow-800",children:"Configuration Required"}),(0,nn.jsx)("p",{className:"mt-1 text-sm text-yellow-700",children:"LinkedIn integration requires API configuration and approval from LinkedIn. Current interface shows planned features for talent sourcing and professional networking."})]})]})}),(0,nn.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[(0,nn.jsxs)("div",{className:"border border-gray-200 rounded-lg p-4",children:[(0,nn.jsxs)("div",{className:"flex items-center mb-3",children:[(0,nn.jsx)("svg",{className:"h-6 w-6 text-blue-600 mr-2",fill:"
2currentColor",viewBox:"0 0 24 24",children:(0,nn.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"})}),(0,nn.jsx)("h4",{className:"text-md font-medium text-gray-900",children:"Professional Groups"})]}),(0,nn.jsx)("p",{className:"text-sm text-gray-600 mb-4",children:"Access and manage LinkedIn professional groups for networking and talent sourcing."}),(0,nn.jsx)("button",{onClick:()=>u("/linkedin/groups"),className:"w-full bg-blue-600 text-white px-4 py-2 rounded hover:bg-blue-700 transition-colors",children:"Manage Groups"})]}),(0,nn.jsxs)("div",{className:"border border-gray-200 rounded-lg p-4",children:[(0,nn.jsxs)("div",{className:"flex items-center mb-3",children:[(0,nn.jsx)("svg",{className:"h-6 w-6 text-green-600 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4.354a4 4 0 110 5.292M15 21H3v-1a6 6 0 0112 0v1zm0 0h6v-1a6 6 0 00-9-5.197m13.5-9a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0z"})}),(0,nn.jsx)("h4",{className:"text-md font-medium text-gray-900",children:"Graduate Sourcing"})]}),(0,nn.jsx)("p",{className:"text-sm text-gray-600 mb-4",children:"Search and connect with recent finance graduates for talent acquisition."}),(0,nn.jsx)("button",{onClick:()=>u("/linkedin/graduates"),className:"w-full bg-green-600 text-white px-4 py-2 rounded hover:bg-green-700 transition-colors",children:"Source Graduates"})]})]})]}),(0,nn.jsxs)("div",{className:"bg-white shadow rounded-lg p-6",children:[(0,nn.jsx)("h3",{className:"text-lg font-medium text-gray-900 mb-4",children:"LinkedIn Integration Stats"}),(0,nn.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[(0,nn.jsxs)("div",{className:"text-center",children:[(0,nn.jsx)("div",{className:"text-2xl font-bold text-blue-600",children:"12"}),(0,nn.jsx)("div",{className:"text-sm text-gray-600",children:"Professional Groups"})]}),(0,nn.jsxs)("div",{className:"text-center",children:[(0,nn.jsx)("div",{className:"text-2xl font-bold text-green-600",children:"150+"}),(0,nn.jsx)("div",{className:"text-sm text-gray-600",children:"Recent Graduates"})]}),(0,nn.jsxs)("div",{className:"text-center",children:[(0,nn.jsx)("div",{className:"text-2xl font-bold text-purple-600",children:"25k+"}),(0,nn.jsx)("div",{className:"text-sm text-gray-600",children:"Network Reach"})]})]})]})]}),"agents"===k&&(0,nn.jsx)(_r,{}),S&&(0,nn.jsx)(Qn,{onClose:()=>E(!1),onSuccess:e=>{console.log("Announcement sent successfully:",e),E(!1)}})]})}const Dr=()=>{const{hasRole:t,currentUser:n}=sn(),[r,a]=(0,e.useState)([]),[i,o]=(0,e.useState)(!0),[l,c]=(0,e.useState)(!1),[d,u]=(0,e.useState)(null),[m,h]=(0,e.useState)({name:"",description:"",category:"professional",isPrivate:!1,maxMembers:null}),p=t("admin");(0,e.useEffect)(()=>{p&&g()},[p]);const g=async()=>{try{const e=await(0,wn.GX)();a(e)}catch(e){console.error("Error loading groups:",e)}finally{o(!1)}};return p?i?(0,nn.jsx)("div",{className:"flex justify-center items-center min-h-screen",children:(0,nn.jsx)("div",{className:"animate-spin rounded-full h-12 w-12 border-t-2 border-b-2 border-apn-blue"})}):(0,nn.jsxs)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:[(0,nn.jsxs)("div",{className:"mb-8",children:[(0,nn.jsx)("h1",{className:"text-3xl font-bold text-gray-900",children:"Groups Management"}),(0,nn.jsx)("p",{className:"text-gray-600",children:"Create, edit, and manage community groups"})]}),(0,nn.jsx)("div",{className:"mb-6",children:(0,nn.jsx)("button",{onClick:()=>c(!0),className:"bg-apn-blue text-white px-4 py-2 rounded-lg hover:bg-blue-700 transition duration-200",children:"Create New Group"})}),l&&(0,nn.jsxs)("div",{className:"bg-white rounded-lg shadow-lg p-6 mb-8",children:[(0,nn.jsx)("h2",{className:"text-xl font-bold mb-4",children:"Create New Group"}),(0,nn.jsxs)("form",{onSubmit:async e=>{e.preventDefault();try{const e=(0,s.A)((0,s.A)({},m),{},{createdAt:new Date,memberCount:0,isActive:!0});await(0,wn.wj)(e,null===n||void 0===n?void 0:n.uid),h({name:"",description:"",category:"professional",isPrivate:!1,maxMembers:null}),c(!1),g(),alert("Group created successfully!")}catch(t){console.error("Error creating group:",t),alert("Error creating group. Please try again.")}},children:[(0,nn.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Group Name *"}),(0,nn.jsx)("input",{type:"text",required:!0,value:m.name,onChange:e=>h((0,s.A)((0,s.A)({},m),{},{name:e.target.value})),className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue"})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Category"}),(0,nn.jsxs)("select",{value:m.category,onChange:e=>h((0,s.A)((0,s.A)({},m),{},{category:e.target.value})),className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue",children:[(0,nn.jsx)("option",{value:"professional",children:"Professional"}),(0,nn.jsx)("option",{value:"industry",children:"Industry Specific"}),(0,nn.jsx)("option",{value:"location",children:"Location Based"}),(0,nn.jsx)("option",{value:"interest",children:"Special Interest"})]})]})]}),(0,nn.jsxs)("div",{className:"mt-4",children:[(0,nn.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Description *"}),(0,nn.jsx)("textarea",{required:!0,rows:3,value:m.description,onChange:e=>h((0,s.A)((0,s.A)({},m),{},{description:e.target.value})),className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue"})]}),(0,nn.jsxs)("div",{className:"mt-4 flex items-center space-x-4",children:[(0,nn.jsxs)("label",{className:"flex items-center",children:[(0,nn.jsx)("input",{type:"checkbox",checked:m.isPrivate,onChange:e=>h((0,s.A)((0,s.A)({},m),{},{isPrivate:e.target.checked})),className:"mr-2"}),"Private Group"]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{className:"block text-sm font-medium text-gray-700",children:"Max Members (optional)"}),(0,nn.jsx)("input",{type:"number",min:"1",value:m.maxMembers||"",onChange:e=>h((0,s.A)((0,s.A)({},m),{},{maxMembers:e.target.value?parseInt(e.target.value):null})),className:"w-24 px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue"})]})]}),(0,nn.jsxs)("div",{className:"mt-6 flex space-x-3",children:[(0,nn.jsx)("button",{type:"submit",className:"bg-apn-blue text-white px-4 py-2 rounded-lg hover:bg-blue-700 transition duration-200",children:"Create Group"}),(0,nn.jsx)("button",{type:"button",onClick:()=>c(!1),className:"bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition duration-200",children:"Cancel"})]})]})]}),(0,nn.jsxs)("div",{className:"bg-white rounded-lg shadow",children:[(0,nn.jsx)("div",{className:"px-6 py-4 border-b border-gray-200",children:(0,nn.jsxs)("h2",{className:"text-lg font-medium text-gray-900",children:["All Groups (",r.length,")"]})}),0===r.length?(0,nn.jsx)("div",{className:"p-6 text-center text-gray-500",children:"No groups foun
2d. Create your first group to get started."}):(0,nn.jsx)("div",{className:"divide-y divide-gray-200",children:r.map(e=>(0,nn.jsx)("div",{className:"p-6",children:(0,nn.jsxs)("div",{className:"flex items-center justify-between",children:[(0,nn.jsxs)("div",{className:"flex-1",children:[(0,nn.jsx)("h3",{className:"text-lg font-medium text-gray-900",children:e.name}),(0,nn.jsx)("p",{className:"text-gray-600 mt-1",children:e.description}),(0,nn.jsxs)("div",{className:"mt-2 flex items-center space-x-4 text-sm text-gray-500",children:[(0,nn.jsxs)("span",{children:["Category: ",e.category]}),(0,nn.jsxs)("span",{children:["Members: ",e.memberCount||0]}),e.isPrivate&&(0,nn.jsx)("span",{className:"text-red-600",children:"Private"}),e.maxMembers&&(0,nn.jsxs)("span",{children:["Max: ",e.maxMembers]})]})]}),(0,nn.jsxs)("div",{className:"flex space-x-2",children:[(0,nn.jsx)("button",{onClick:()=>u(e),className:"text-apn-blue hover:text-blue-700",children:"Edit"}),(0,nn.jsx)("button",{onClick:()=>(async(e,t)=>{if(window.confirm('Are you sure you want to delete "'.concat(t,'"? This action cannot be undone.')))try{await(0,wn.Ni)(e),g(),alert("Group deleted successfully!")}catch(n){console.error("Error deleting group:",n),alert("Error deleting group. Please try again.")}})(e.id,e.name),className:"text-red-600 hover:text-red-800",children:"Delete"})]})]})},e.id))})]}),d&&(0,nn.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:(0,nn.jsxs)("div",{className:"bg-white rounded-lg p-6 w-full max-w-md",children:[(0,nn.jsx)("h2",{className:"text-xl font-bold mb-4",children:"Edit Group"}),(0,nn.jsxs)("form",{onSubmit:e=>{e.preventDefault();const t=new FormData(e.target),n={name:t.get("name"),description:t.get("description"),category:t.get("category"),isPrivate:"on"===t.get("isPrivate"),maxMembers:t.get("maxMembers")?parseInt(t.get("maxMembers")):null};(async(e,t)=>{try{await(0,wn.vW)(e,t),g(),u(null),alert("Group updated successfully!")}catch(n){console.error("Error updating group:",n),alert("Error updating group. Please try again.")}})(d.id,n)},children:[(0,nn.jsxs)("div",{className:"space-y-4",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Group Name"}),(0,nn.jsx)("input",{type:"text",name:"name",defaultValue:d.name,required:!0,className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue"})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Description"}),(0,nn.jsx)("textarea",{name:"description",defaultValue:d.description,required:!0,rows:3,className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue"})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Category"}),(0,nn.jsxs)("select",{name:"category",defaultValue:d.category,className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue",children:[(0,nn.jsx)("option",{value:"professional",children:"Professional"}),(0,nn.jsx)("option",{value:"industry",children:"Industry Specific"}),(0,nn.jsx)("option",{value:"location",children:"Location Based"}),(0,nn.jsx)("option",{value:"interest",children:"Special Interest"})]})]}),(0,nn.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,nn.jsxs)("label",{className:"flex items-center",children:[(0,nn.jsx)("input",{type:"checkbox",name:"isPrivate",defaultChecked:d.isPrivate,className:"mr-2"}),"Private Group"]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{className:"block text-sm font-medium text-gray-700",children:"Max Members"}),(0,nn.jsx)("input",{type:"number",name:"maxMembers",min:"1",defaultValue:d.maxMembers||"",className:"w-24 px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue"})]})]})]}),(0,nn.jsxs)("div",{className:"mt-6 flex space-x-3",children:[(0,nn.jsx)("button",{type:"submit",className:"bg-apn-blue text-white px-4 py-2 rounded-lg hover:bg-blue-700 transition duration-200",children:"Update Group"}),(0,nn.jsx)("button",{type:"button",onClick:()=>u(null),className:"bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition duration-200",children:"Cancel"})]})]})]})})]}):(0,nn.jsxs)("div",{className:"text-center py-12",children:[(0,nn.jsx)("h2",{className:"text-2xl font-bold text-gray-900",children:"Access Denied"}),(0,nn.jsx)("p",{className:"text-gray-600",children:"You don't have permission to access this page."})]})};var Rr=n(217);const Lr=()=>{var t;const{id:n}=le(),{hasRole:r,currentUser:a}=sn(),[i,o]=(0,e.useState)(null),[l,c]=(0,e.useState)([]),[d,u]=(0,e.useState)([]),[m,h]=(0,e.useState)(!0),[p,g]=(0,e.useState)("overview"),f=r("admin"),x=null===i||void 0===i||null===(t=i.moderators)||void 0===t?void 0:t.includes(null===a||void 0===a?void 0:a.uid),b=f||x;(0,e.useEffect)(()=>{n&&y()},[n]);const y=async()=>{try{h(!0);const[e,t,r]=await Promise.all([(0,wn.getGroupById)(n),(0,wn.Nk)(n),(0,wn.PJ)(n)]);o(e),c(t||[]),u(r||[])}catch(e){console.error("Error loading group data:",e)}finally{h(!1)}};return b?m?(0,nn.jsx)("div",{className:"flex justify-center items-center min-h-screen",children:(0,nn.jsx)("div",{className:"animate-spin rounded-full h-12 w-12 border-t-2 border-b-2 border-apn-blue"})}):i?(0,nn.jsxs)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:[(0,nn.jsx)("div",{className:"mb-8",children:(0,nn.jsxs)("div",{className:"flex items-center justify-between",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("h1",{className:"text-3xl font-bold text-gray-900",children:"Group Administration"}),(0,nn.jsxs)("p",{className:"text-gray-600 mt-1",children:["Managing: ",i.name]})]}),(0,nn.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,nn.jsx)("span",{className:"px-3 py-1 rounded-full text-sm ".concat(i.isActive?"bg-green-100 text-green-800":"bg-red-100 text-red-800"),children:i.isActive?"Active":"Inactive"}),i.isPrivate&&(0,nn.jsx)("span",{className:"px-3 py-1 rounded-full text-sm bg-yellow-100 text-yellow-800",children:"Private"})]})]})}),(0,nn.jsx)("div",{className:"border-b border-gray-200 mb-6",children:(0,nn.jsx)("nav",{className:"-mb-px flex space-x-8",children:[{id:"overview",name:"Overview"},{id:"members",name:"Members (".concat(l.length,")")},{id:"posts",name:"Posts (".concat(d.length,")")},{id:"settings",name:"Settings"}].map(e=>(0,nn.jsx)("button",{onClick:()=>g(e.id),className:"py-2 px-1 border-b-2 font-medium text-sm ".concat(p===e.id?"border-apn-blue text-apn-blue":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"),children:e.name},e.id))})}
2),"overview"===p&&(0,nn.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[(0,nn.jsxs)("div",{className:"bg-white rounded-lg shadow p-6",children:[(0,nn.jsx)("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"Group Stats"}),(0,nn.jsxs)("div",{className:"space-y-2",children:[(0,nn.jsxs)("div",{className:"flex justify-between",children:[(0,nn.jsx)("span",{className:"text-gray-600",children:"Total Members"}),(0,nn.jsx)("span",{className:"font-medium",children:l.length})]}),(0,nn.jsxs)("div",{className:"flex justify-between",children:[(0,nn.jsx)("span",{className:"text-gray-600",children:"Total Posts"}),(0,nn.jsx)("span",{className:"font-medium",children:d.length})]}),(0,nn.jsxs)("div",{className:"flex justify-between",children:[(0,nn.jsx)("span",{className:"text-gray-600",children:"Created"}),(0,nn.jsx)("span",{className:"font-medium",children:i.createdAt?new Date(1e3*i.createdAt.seconds).toLocaleDateString():"N/A"})]})]})]}),(0,nn.jsxs)("div",{className:"bg-white rounded-lg shadow p-6",children:[(0,nn.jsx)("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"Recent Activity"}),(0,nn.jsxs)("div",{className:"space-y-2 text-sm text-gray-600",children:[(0,nn.jsx)("p",{children:"\u2022 New member joined 2 hours ago"}),(0,nn.jsx)("p",{children:"\u2022 Post created 1 day ago"}),(0,nn.jsx)("p",{children:"\u2022 Member removed 3 days ago"})]})]}),(0,nn.jsxs)("div",{className:"bg-white rounded-lg shadow p-6",children:[(0,nn.jsx)("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"Quick Actions"}),(0,nn.jsxs)("div",{className:"space-y-2",children:[(0,nn.jsx)("button",{className:"w-full text-left px-3 py-2 text-sm text-apn-blue hover:bg-blue-50 rounded",children:"Send Group Message"}),(0,nn.jsx)("button",{className:"w-full text-left px-3 py-2 text-sm text-apn-blue hover:bg-blue-50 rounded",children:"Export Member List"}),(0,nn.jsx)("button",{className:"w-full text-left px-3 py-2 text-sm text-red-600 hover:bg-red-50 rounded",children:"Archive Group"})]})]})]}),"members"===p&&(0,nn.jsxs)("div",{className:"bg-white rounded-lg shadow",children:[(0,nn.jsx)("div",{className:"px-6 py-4 border-b border-gray-200",children:(0,nn.jsx)("h3",{className:"text-lg font-medium text-gray-900",children:"Group Members"})}),(0,nn.jsx)("div",{className:"divide-y divide-gray-200",children:0===l.length?(0,nn.jsx)("div",{className:"p-6 text-center text-gray-500",children:"No members in this group yet."}):l.map(e=>(0,nn.jsxs)("div",{className:"p-6 flex items-center justify-between",children:[(0,nn.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,nn.jsx)("div",{className:"w-10 h-10 bg-gray-300 rounded-full flex items-center justify-center",children:(0,nn.jsx)("span",{className:"text-sm font-medium text-gray-700",children:e.name?e.name.charAt(0).toUpperCase():"U"})}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("p",{className:"text-sm font-medium text-gray-900",children:e.name||"Unknown User"}),(0,nn.jsx)("p",{className:"text-sm text-gray-500",children:e.email}),(0,nn.jsxs)("p",{className:"text-xs text-gray-400",children:["Joined: ",e.joinedAt?new Date(e.joinedAt).toLocaleDateString():"N/A"]})]})]}),(0,nn.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,nn.jsx)("span",{className:"px-2 py-1 text-xs rounded-full ".concat("moderator"===e.role?"bg-blue-100 text-blue-800":"bg-gray-100 text-gray-800"),children:e.role||"Member"}),(0,nn.jsx)("button",{onClick:()=>(async(e,t)=>{if(window.confirm("Are you sure you want to remove ".concat(t," from this group? This action cannot be undone.")))try{await(0,wn.JW)(n,e),c(t=>t.filter(t=>t.userId!==e)),(0,Rr.oc)("".concat(t," has been removed from the group."))}catch(r){(0,Rr.H4)(r,{context:{component:"GroupAdmin",action:"removeMember",groupId:n,userId:e}})}})(e.userId,e.name),className:"text-red-600 hover:text-red-800 text-sm",children:"Remove"})]})]},e.userId))})]}),"posts"===p&&(0,nn.jsxs)("div",{className:"bg-white rounded-lg shadow",children:[(0,nn.jsx)("div",{className:"px-6 py-4 border-b border-gray-200",children:(0,nn.jsx)("h3",{className:"text-lg font-medium text-gray-900",children:"Group Posts"})}),(0,nn.jsx)("div",{className:"divide-y divide-gray-200",children:0===d.length?(0,nn.jsx)("div",{className:"p-6 text-center text-gray-500",children:"No posts in this group yet."}):d.map(e=>{var t,r;return(0,nn.jsx)("div",{className:"p-6",children:(0,nn.jsxs)("div",{className:"flex items-start justify-between",children:[(0,nn.jsxs)("div",{className:"flex-1",children:[(0,nn.jsx)("h4",{className:"text-lg font-medium text-gray-900",children:e.title}),(0,nn.jsx)("p",{className:"text-gray-600 mt-1",children:e.content}),(0,nn.jsxs)("div",{className:"flex items-center space-x-4 mt-2 text-sm text-gray-500",children:[(0,nn.jsxs)("span",{children:["By: ",e.authorName]}),(0,nn.jsx)("span",{children:"\u2022"}),(0,nn.jsx)("span",{children:e.createdAt?new Date(1e3*e.createdAt.seconds).toLocaleDateString():"N/A"}),(0,nn.jsx)("span",{children:"\u2022"}),(0,nn.jsxs)("span",{children:[(null===(t=e.likes)||void 0===t?void 0:t.length)||0," likes"]}
2),(0,nn.jsx)("span",{children:"\u2022"}),(0,nn.jsxs)("span",{children:[(null===(r=e.replies)||void 0===r?void 0:r.length)||0," replies"]})]})]}),(0,nn.jsx)("button",{onClick:()=>(async(e,t)=>{if(window.confirm('Are you sure you want to delete the post "'.concat(t,'"? This action cannot be undone.')))try{await(0,wn.xX)(e),u(t=>t.filter(t=>t.id!==e)),(0,Rr.oc)("Post deleted successfully.")}catch(r){(0,Rr.H4)(r,{context:{component:"GroupAdmin",action:"deletePost",groupId:n,postId:e}})}})(e.id,e.title),className:"text-red-600 hover:text-red-800 text-sm ml-4",children:"Delete"})]})},e.id)})})]}),"settings"===p&&(0,nn.jsxs)("div",{className:"bg-white rounded-lg shadow p-6",children:[(0,nn.jsx)("h3",{className:"text-lg font-medium text-gray-900 mb-6",children:"Group Settings"}),(0,nn.jsxs)("form",{onSubmit:e=>{e.preventDefault();const t=new FormData(e.target);(async e=>{try{await(0,wn.vW)(n,e),o(t=>(0,s.A)((0,s.A)({},t),e)),(0,Rr.oc)("Group settings updated successfully.")}catch(t){(0,Rr.H4)(t,{context:{component:"GroupAdmin",action:"updateGroupSettings",groupId:n}})}})({name:t.get("name"),description:t.get("description"),isPrivate:"on"===t.get("isPrivate"),isActive:"on"===t.get("isActive")})},children:[(0,nn.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Group Name"}),(0,nn.jsx)("input",{type:"text",name:"name",defaultValue:i.name,className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue"})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Category"}),(0,nn.jsxs)("select",{name:"category",defaultValue:i.category,className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue",children:[(0,nn.jsx)("option",{value:"professional",children:"Professional"}),(0,nn.jsx)("option",{value:"industry",children:"Industry Specific"}),(0,nn.jsx)("option",{value:"location",children:"Location Based"}),(0,nn.jsx)("option",{value:"interest",children:"Special Interest"})]})]})]}),(0,nn.jsxs)("div",{className:"mt-6",children:[(0,nn.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Description"}),(0,nn.jsx)("textarea",{name:"description",rows:4,defaultValue:i.description,className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue"})]}),(0,nn.jsxs)("div",{className:"mt-6 space-y-4",children:[(0,nn.jsxs)("div",{className:"flex items-center",children:[(0,nn.jsx)("input",{type:"checkbox",id:"isPrivate",name:"isPrivate",defaultChecked:i.isPrivate,className:"h-4 w-4 text-apn-blue focus:ring-apn-blue border-gray-300 rounded"}),(0,nn.jsx)("label",{htmlFor:"isPrivate",className:"ml-2 text-sm text-gray-700",children:"Private Group (requires approval to join)"})]}),(0,nn.jsxs)("div",{className:"flex items-center",children:[(0,nn.jsx)("input",{type:"checkbox",id:"isActive",name:"isActive",defaultChecked:i.isActive,className:"h-4 w-4 text-apn-blue focus:ring-apn-blue border-gray-300 rounded"}),(0,nn.jsx)("label",{htmlFor:"isActive",className:"ml-2 text-sm text-gray-700",children:"Active Group (visible to members)"})]})]}),(0,nn.jsx)("div",{className:"mt-8",children:(0,nn.jsx)("button",{type:"submit",className:"bg-apn-blue text-white px-6 py-2 rounded-lg hover:bg-blue-700 transition duration-200",children:"Save Settings"})})]})]})]}):(0,nn.jsx)("div",{className:"max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:(0,nn.jsxs)("div",{className:"text-center",children:[(0,nn.jsx)("h2",{className:"text-2xl font-bold text-gray-900",children:"Group Not Found"}),(0,nn.jsx)("p",{className:"text-gray-600 mt-2",children:"The group you're looking for doesn't exist."})]})}):(0,nn.jsx)("div",{className:"max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:(0,nn.jsxs)("div",{className:"text-center",children:[(0,nn.jsx)("h2",{className:"text-2xl font-bold text-gray-900",children:"Access Denied"}),(0,nn.jsx)("p",{className:"text-gray-600 mt-2",children:"You don't have permission to manage this group."})]})})},Mr=["id"],Or=["id"],Fr=[{id:"seeded-user-1",firstName:"Marcus",lastName:"Thompson",displayName:"Marcus Thompson",email:"[email protected]",company:"J.P. Morgan",jobTitle:"Vice President, Investment Banking",bio:"Seasoned IB professional with 8+ years in tech M&A. Previously at Lazard. Georgetown MBA.",location:"New York, NY",linkedinUrl:"",website:"",status:"approved",role:"member",membershipTier:"professional",profileVisibility:"members",showEventRegistrations:!0,emailNotifications:!0,eventReminders:!0,newsletterSubscription:!0,isSeeded:!0},{id:"seeded-user-2",firstName:"Priya",lastName:"Sharma",displayName:"Priya Sharma",email:"[email protected]",company:"Blackstone",jobTitle:"Associate, Private Equity",bio:"PE associate focused on healthcare and consumer sectors. Former analyst at Morgan Stanley. Wharton alum.",location:"New York, NY",linkedinUrl:"",website:"",status:"approved",role:"member",membershipTier:"professional",profileVisibility:"members",showEventRegistrations:!0,emailNotifications:!0,eventReminders:!0,newsletterSubscription:!0,isSeeded:!0},{id:"seeded-user-3",firstName:"David",lastName:"Chen",displayName:"David Chen",email:"[email protected]",company:"Deloitte",jobTitle:"Senior Manager, M&A Adv
2isory",bio:"M&A advisory lead specializing in cross-border transactions. CFA charterholder. 10+ years in deal advisory.",location:"Chicago, IL",linkedinUrl:"",website:"",status:"approved",role:"member",membershipTier:"executive",profileVisibility:"members",showEventRegistrations:!0,emailNotifications:!0,eventReminders:!0,newsletterSubscription:!0,isSeeded:!0},{id:"seeded-user-4",firstName:"Jasmine",lastName:"Williams",displayName:"Jasmine Williams",email:"[email protected]",company:"Goldman Sachs",jobTitle:"Analyst, Equity Research",bio:"Equity research analyst covering fintech and payments. Howard University grad. Passionate about diversity in finance.",location:"San Francisco, CA",linkedinUrl:"",website:"",status:"approved",role:"member",membershipTier:"standard",profileVisibility:"members",showEventRegistrations:!0,emailNotifications:!0,eventReminders:!0,newsletterSubscription:!0,isSeeded:!0},{id:"seeded-user-5",firstName:"Robert",lastName:"Martinez",displayName:"Robert Martinez",email:"[email protected]",company:"Evercore",jobTitle:"Director, Restructuring",bio:"Restructuring expert with 12+ years advising distressed companies. Army veteran. Columbia Law & MBA.",location:"Dallas, TX",linkedinUrl:"",website:"",status:"approved",role:"member",membershipTier:"professional",profileVisibility:"members",showEventRegistrations:!0,emailNotifications:!0,eventReminders:!0,newsletterSubscription:!0,isSeeded:!0}],Ur=[{id:"1",name:"Investment Banking Professionals",description:"A community for investment banking analysts, associates, and VPs to share insights, network, and discuss industry trends.",category:"professional",memberCount:5,isPrivate:!1,isActive:!0,members:["seeded-user-1","seeded-user-2","seeded-user-3","seeded-user-4","seeded-user-5"],moderators:["seeded-user-1"],tags:["investment-banking","finance","networking"],isSeeded:!0},{id:"2",name:"Private Equity Network",description:"Connect with PE professionals, discuss deal flow, and share market insights.",category:"professional",memberCount:3,isPrivate:!0,isActive:!0,members:["seeded-user-2","seeded-user-3","seeded-user-5"],moderators:["seeded-user-2"],tags:["private-equity","deals","networking"],isSeeded:!0},{id:"3",name:"M&A Specialists",description:"For professionals involved in mergers and acquisitions. Share deal experiences and best practices.",category:"professional",memberCount:4,isPrivate:!1,isActive:!0,members:["seeded-user-1","seeded-user-3","seeded-user-4","seeded-user-5"],moderators:["seeded-user-3"],tags:["mergers","acquisitions","deals"],isSeeded:!0},{id:"4",name:"New York Finance Professionals",description:"Local networking group for finance professionals in the New York area.",category:"location",memberCount:3,isPrivate:!1,isActive:!0,members:["seeded-user-1","seeded-user-2","seeded-user-4"],moderators:["seeded-user-1"],tags:["new-york","local","networking"],isSeeded:!0},{id:"5",name:"Veterans in Finance",description:"Supporting military veterans transitioning to and advancing in finance careers.",category:"interest",memberCount:2,isPrivate:!1,isActive:!0,members:["seeded-user-5","seeded-user-3"],moderators:["seeded-user-5"],tags:["veterans","military","career-transition"],isSeeded:!0}],Br=[{id:"seeded-post-1",groupId:"1",title:"Market Outlook for Q1 2026",content:"What are everyone's thoughts on the market outlook heading into Q1? The tech IPO pipeline looks strong \u2014 seeing several unicorns gearing up. Anyone tracking the fintech valuations closely?",authorId:"seeded-user-1",authorName:"Marcus Thompson",likes:["seeded-user-2","seeded-user-4"],likeCount:2,commentCount:2,views:18,replies:[],isSeeded:!0},{id:"seeded-post-2",groupId:"1",title:"Best Practices for Client Presentations",content:"Looking for advice on creating compelling pitch decks. We've been using a new framework that ties valuation narratives to market comps more effectively. What tools and frameworks do you all use?",authorId:"seeded-user-4",authorName:"Jasmine Williams",likes:["seeded-user-1","seeded-user-3","seeded-user-5"],likeCount:3,commentCount:1,views:24,replies:[],isSeeded:!0},{id:"seeded-post-3",groupId:"2",title:"Deal Sourcing in Healthcare PE",content:"We've been seeing strong deal flow in healthcare services, especially behavioral health platforms. Anyone else noticing consolidation plays in this space? Would love to compare notes.",authorId:"seeded-user-2",authorName:"Priya Sharma",likes:["seeded-user-3"],likeCount:1,commentCount:1,views:12,replies:[],isSeeded:!0},{id:"seeded-post-4",groupId:"3",title:"Cross-Border M&A: Navigating Regulatory Hurdles",content:"Just closed a complex cross-border deal between a US acquirer and a European target. The regulatory landscape has shifted significantly. Happy to share lessons learned if there's interest.",authorId:"seeded-user-3",authorName:"David Chen",likes:["seeded-user-1","seeded-user-5"],likeCount:2,commentCount:2,views:31,replies:[],isSeeded:!0}],zr=[{postId:"seeded-post-1",content:"Great points, Marcus. We're seeing similar trends on the equity research side. Fintech valuations are compressing but deal volume is actually picking up.",authorId:"seeded-user-4",authorName:"Jasmine Williams",likes:["seeded-user-1"],likeCount:1,isSeeded:!0},{postId:"seeded-post-1",content:"Agree \u2014 the IPO window is opening back up. We had two mandates come in just last week. Definitely feels like momentum is building.",authorId:"seeded-user-3",authorName:"David Chen",likes:["seeded-user-1","seeded-user-2"],likeCount:2,isSeeded:!0},{postId:"seeded-post-2",content:"We switched to a market-comp-first approach last year and it made a huge difference with clients. Happy to share our template if anyone's interested \u2014 DM me.",authorId:"seeded-user-1",authorName:"Marcus Thompson",likes:["seeded-user-4"],likeCount:1,isSeeded:!0},{postId:"seeded-post-3",content:"Behavioral health is definitely hot right now. We're tracking 3-4 platform opportunities in that space. The multiples have been surprisingly resilient.",authorId:"seeded-user-5",authorName:"Robert Martinez",likes:["seeded-user-2"],likeCount:1,isSeeded:!0},{postId:"seeded-post-4",content:"Would love to hear more about the regulatory side, David. We ran into CFIUS issues on our last cross-border deal and it nearly killed the timeline.",authorId:"seeded-user-1",authorName:"Marcus Thompson",likes:["seeded-user-3","seeded-user-5"],likeCount:2,isSeeded:!0},{postId:"seeded-post-4",content:"This is extremely relevant. The EU's new foreign subsidies regulation is adding another layer of complexity. Definitely interested in your takeaways.",authorId:"seeded-user-2",authorName:"Priya Sharma",likes:["seeded-user-3"],likeCount:1,isSeeded:!0}],Vr=[{title:"Investment Banking Analyst \u2014 TMT Coverage",company:"Goldman Sachs",location:"New York, NY",type:"Full-time",experience:"Entry Level",salary:"$150,000 - $180,000",description:"Join our TMT Investment Banking division as an Analyst. You will work on M&A transactions, IPOs, and other corporate finance activities for technology, media, and telecom clients.",requirements:["Bachelor's degree in Finance, Economics, or related field","Strong analytical and quantitative skills","Proficiency in Excel and PowerPoint","Excellent communication skills"],benefits:["Competitive salary and bonus","Health insurance","401(k) matching","Professional development opportunities"],postedBy:"seeded-user-4",postedByName:"Jasmine Williams",applications:[{userId:"seeded-user-1",name:"Marcus Thompson",appliedAt:"2026-02-15T10:00:00Z",status:"pending"}],views:42,status:"active",isActive:!0,isSeeded:!0},{title:"Private Equity Associate \u2014 Healthcare",company:"Blackstone",location:"New York, NY",type:"Full-time",experience:"Mid Level",salary:"$200,000 - $275,000",description:"Seeking an experienced Associate to join our Healthcare Private Equity team. Focus on deal sourcing, due diligence, and portfolio company management in healthcare services and life sciences.",requirements:["MBA or 3+ years investment banking experience","Strong financial modeling skills","Experience with LBO analysis","Healthcare sector knowledge preferred"],benefits:["Competitive compensation package","Carried interest participation","Comprehensive benef
2its","Travel opportunities"],postedBy:"seeded-user-2",postedByName:"Priya Sharma",applications:[],views:67,status:"active",isActive:!0,isSeeded:!0},{title:"Restructuring Director",company:"Evercore",location:"Dallas, TX",type:"Full-time",experience:"Senior Level",salary:"$300,000 - $400,000",description:"Lead restructuring engagements for distressed middle-market companies. Manage client relationships, oversee financial analysis, and drive deal execution across various industries.",requirements:["8+ years restructuring or distressed advisory experience","CFA, CPA, or CIRA certification preferred","Strong leadership and client management skills","Experience with Chapter 11 and out-of-court restructurings"],benefits:["Industry-leading compensation","Performance bonuses","Full benefits package","Flexible work arrangements"],postedBy:"seeded-user-5",postedByName:"Robert Martinez",applications:[{userId:"seeded-user-3",name:"David Chen",appliedAt:"2026-02-20T14:30:00Z",status:"pending"}],views:35,status:"active",isActive:!0,isSeeded:!0}],qr=[{title:"Tax Advisory Needed",company:"Mid-Market Private Company",duration:"3-5 weeks",type:"Contract",description:"Seeking an experienced tax advisory professional to assist with corporate tax planning, compliance review, and strategic tax optimization for a mid-market company undergoing restructuring. Must have deep knowledge of federal and state tax regulations.",requirements:["CPA or JD with tax specialization","Corporate tax planning experience","Restructuring or M&A tax knowledge","Available to start within 2 weeks"],skills:["Tax Advisory","Corporate Tax","Tax Planning","Compliance"],postedBy:"seeded-user-1",postedByName:"Marcus Thompson",applications:[{userId:"seeded-user-3",name:"David Chen",appliedAt:"2026-02-10T09:00:00Z",status:"accepted"}],views:28,status:"active",isActive:!0,isSeeded:!0},{title:"Directors & Officers Insurance Needed",company:"Growth-Stage Technology Company",duration:"2-4 weeks",type:"Contract",description:"Looking for an insurance advisory professional to evaluate and secure Directors & Officers (D&O) liability insurance for a growth-stage technology company preparing for its next funding round. Need comprehensive coverage analysis and broker recommendations.",requirements:["D&O insurance expertise","Experience with tech/startup companies","Broker relationships preferred","Understanding of venture-backed company needs"],skills:["D&O Insurance","Risk Management","Insurance Advisory","Corporate Governance"],postedBy:"seeded-user-2",postedByName:"Priya Sharma",applications:[{userId:"seeded-user-5",name:"Robert Martinez",appliedAt:"2026-02-18T11:00:00Z",status:"pending"}],views:41,status:"active",isActive:!0,isSeeded:!0},{title:"Investment Banking Advisory Needed",company:"Confidential",duration:"6-10 weeks",type:"Contract",description:"Seeking an experienced investment banking advisor to support a sell-side M&A process for a mid-market company in the professional services sector. Need assistance with valuation, marketing materials, buyer outreach, and deal negotiation.",requirements:["Investment banking or M&A advisory experience","Professional services sector knowledge","Sell-side transaction experience","Strong financial modeling and presentation skills"],skills:["Investment Banking","M&A Advisory","Valuation","Deal Execution"],postedBy:"seeded-user-3",postedByName:"David Chen",applications:[],views:19,status:"active",isActive:!0,isSeeded:!0}],Wr=async()=>{try{console.log("Starting database seeding..."),console.log("Creating sample users...");for(const e of Fr){const{id:t}=e,n=(0,r.A)(e,Mr);await(0,vt.BN)((0,vt.doc)(yt.db,"users",t),(0,s.A)((0,s.A)({},n),{},{uid:t,createdAt:new Date("2025-06-15"),updatedAt:new Date,memberSince:new Date("2025-06-15")})),console.log("Created user: ".concat(e.displayName," (").concat(t,")"))}console.log("Creating sample groups...");for(const e of Ur){try{await(0,vt.kd)((0,vt.doc)(yt.db,"groups",e.id))}catch(Nd){}await(0,vt.BN)((0,vt.doc)(yt.db,"groups",e.id),(0,s.A)((0,s.A)({},e),{},{createdAt:new Date("2025-07-01"),updatedAt:new Date})),console.log("Created group: ".concat(e.name))}console.log("Creating sample group posts...");for(const e of Br){const{id:t}=e,n=(0,r.A)(e,Or);await(0,vt.BN)((0,vt.doc)(yt.db,"groupPosts",t),(0,s.A)((0,s.A)({},n),{},{createdAt:new Date("2026-02-10"),updatedAt:new Date})),console.log("Created post: ".concat(e.title))}console.log("Creating sample group comments...");for(const e of zr)await(0,vt.addDoc)((0,vt.collection)(yt.db,"groupComments"),(0,s.A)((0,s.A)({},e),{},{createdAt:new Date("2026-02-12"),updatedAt:new Date})),console.log("Created comment on post: ".concat(e.postId));console.log("Creating sample jobs...");
2for(const e of Vr)await(0,vt.addDoc)((0,vt.collection)(yt.db,"jobs"),(0,s.A)((0,s.A)({},e),{},{postedDate:new Date("2026-02-01"),createdAt:new Date("2026-02-01"),updatedAt:new Date})),console.log("Created job: ".concat(e.title));console.log("Creating sample projects...");for(const e of qr)await(0,vt.addDoc)((0,vt.collection)(yt.db,"projects"),(0,s.A)((0,s.A)({},e),{},{postedDate:new Date("2026-02-05"),createdAt:new Date("2026-02-05"),updatedAt:new Date})),console.log("Created project: ".concat(e.title));return console.log("Database seeding completed successfully!"),{success:!0,users:Fr.length,jobs:Vr.length,projects:qr.length,posts:Br.length,comments:zr.length}}catch(e){throw console.error("Error seeding database:",e),e}},Hr=async()=>{try{console.log("Clearing all seeded data...");let e={users:0,groups:0,posts:0,comments:0,jobs:0,projects:0};for(const o of Fr)try{await(0,vt.kd)((0,vt.doc)(yt.db,"users",o.id)),e.users++}catch(Nd){}for(const o of Ur)try{await(0,vt.kd)((0,vt.doc)(yt.db,"groups",o.id)),e.groups++}catch(Nd){}for(const o of Br)try{await(0,vt.kd)((0,vt.doc)(yt.db,"groupPosts",o.id)),e.posts++}catch(Nd){}const t=(0,vt.query)((0,vt.collection)(yt.db,"groupComments"),(0,vt.where)("isSeeded","==",!0)),n=await(0,vt.getDocs)(t);for(const o of n.docs)await(0,vt.kd)(o.ref),e.comments++;const r=(0,vt.query)((0,vt.collection)(yt.db,"jobs"),(0,vt.where)("isSeeded","==",!0)),s=await(0,vt.getDocs)(r);for(const o of s.docs)await(0,vt.kd)(o.ref),e.jobs++;const a=(0,vt.query)((0,vt.collection)(yt.db,"projects"),(0,vt.where)("isSeeded","==",!0)),i=await(0,vt.getDocs)(a);for(const o of i.docs)await(0,vt.kd)(o.ref),e.projects++;return console.log("Seeded data cleared:",e),e}catch(e){throw console.error("Error clearing seeded data:",e),e}},Gr=()=>{const{hasRole:t}=sn(),[n,r]=(0,e.useState)(!1),[s,a]=(0,e.useState)(""),[i,o]=(0,e.useState)(""),l=t("admin");return l?(0,nn.jsx)("div",{className:"max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:(0,nn.jsxs)("div",{className:"bg-white rounded-lg shadow p-6",children:[(0,nn.jsx)("h1",{className:"text-2xl font-bold text-gray-900 mb-2",children:"Database Seeder"}),(0,nn.jsxs)("p",{className:"text-gray-500 mb-6",children:["Create or remove sample data to demonstrate site capabilities. All seeded data is tracked with an ",(0,nn.jsx)("code",{className:"bg-gray-100 px-1 rounded text-sm",children:"isSeeded"})," flag and clearly separated from real users in the admin dashboard."]}),(0,nn.jsxs)("div",{className:"mb-6",children:[(0,nn.jsx)("h3",{className:"text-sm font-semibold text-gray-700 uppercase tracking-wide mb-3",children:"What Gets Created"}),(0,nn.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[(0,nn.jsxs)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3",children:[(0,nn.jsxs)("div",{className:"flex items-center mb-1",children:[(0,nn.jsx)("span",{className:"text-lg mr-2",children:"\ud83d\udc64"}),(0,nn.jsxs)("span",{className:"font-medium text-blue-900",children:[Fr.length," Sample Users"]})]}),(0,nn.jsx)("ul",{className:"text-xs text-blue-700 space-y-0.5 ml-7",children:Fr.map(e=>(0,nn.jsxs)("li",{children:[e.displayName," \u2014 ",e.jobTitle,", ",e.company]},e.id))})]}),(0,nn.jsxs)("div",{className:"bg-green-50 border border-green-200 rounded-lg p-3",children:[(0,nn.jsxs)("div",{className:"flex items-center mb-1",children:[(0,nn.jsx)("span",{className:"text-lg mr-2",children:"\ud83d\udcbc"}),(0,nn.jsxs)("span",{className:"font-medium text-green-900",children:[Vr.length," Job Postings"]})]}),(0,nn.jsx)("ul",{className:"text-xs text-green-700 space-y-0.5 ml-7",children:Vr.map((e,t)=>(0,nn.jsxs)("li",{children:[e.title," \u2014 ",e.company]},t))})]}),(0,nn.jsxs)("div",{className:"bg-purple-50 border border-purple-200 rounded-lg p-3",children:[(0,nn.jsxs)("div",{className:"flex items-center mb-1",children:[(0,nn.jsx)("span",{className:"text-lg mr-2",children:"\ud83d\udccb"}),(0,nn.jsxs)("span",{className:"font-medium text-purple-900",children:[qr.length," Project Postings"]})]}),(0,nn.jsx)("ul",{className:"text-xs text-purple-700 space-y-0.5 ml-7",children:qr.map((e,t)=>(0,nn.jsx)("li",{children:e.title},t))})]}),(0,nn.jsxs)("div",{className:"bg-orange-50 border border-orange-200 rounded-lg p-3",children:[(0,nn.jsxs)("div",{className:"flex items-center mb-1",children:[(0,nn.jsx)("span",{className:"text-lg mr-2",children:"\ud83d\udcac"}),(0,nn.jsxs)("span",{className:"font-medium text-orange-900",children:[Br.length," Group Posts + ",zr.length," Comments"]})]}),(0,nn.jsx)("p",{className:"text-xs text-orange-700 ml-7",children:"Discussions with likes, replies, and user interactions across groups"})]})]})]}),(0,nn.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,nn.jsx)("button",{onClick:async()=>
2{if(l){r(!0),a("seed"),o("Creating sample data...");try{const e=await Wr();o("\u2705 Sample data created successfully! ".concat(e.users," users, ").concat(e.jobs," jobs, ").concat(e.projects," projects, ").concat(e.posts," posts, ").concat(e.comments," comments."))}catch(e){console.error("Error seeding data:",e),o("\u274c Error creating sample data: ".concat(e.message||e.code||"Unknown error"))}finally{r(!1),a("")}}},disabled:n,className:"bg-[#3d67ad] text-white px-6 py-3 rounded-lg hover:bg-blue-700 transition duration-200 disabled:opacity-50 disabled:cursor-not-allowed flex items-center",children:n&&"seed"===s?(0,nn.jsxs)(nn.Fragment,{children:[(0,nn.jsxs)("svg",{className:"animate-spin -ml-1 mr-3 h-5 w-5 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[(0,nn.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,nn.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"Creating..."]}):"\ud83c\udf31 Seed Sample Data"}),(0,nn.jsx)("button",{onClick:async()=>{if(l&&window.confirm("Are you sure you want to remove ALL seeded/sample data? This cannot be undone.")){r(!0),a("clear"),o("Removing seeded data...");try{const e=await Hr();o("\u2705 Seeded data removed: ".concat(e.users," users, ").concat(e.groups," groups, ").concat(e.posts," posts, ").concat(e.comments," comments, ").concat(e.jobs," jobs, ").concat(e.projects," projects."))}catch(e){console.error("Error clearing seeded data:",e),o("\u274c Error removing seeded data: ".concat(e.message||"Unknown error"))}finally{r(!1),a("")}}},disabled:n,className:"bg-red-600 text-white px-6 py-3 rounded-lg hover:bg-red-700 transition duration-200 disabled:opacity-50 disabled:cursor-not-allowed flex items-center",children:n&&"clear"===s?(0,nn.jsxs)(nn.Fragment,{children:[(0,nn.jsxs)("svg",{className:"animate-spin -ml-1 mr-3 h-5 w-5 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[(0,nn.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,nn.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"Removing..."]}):"\ud83d\uddd1\ufe0f Remove All Seeded Data"})]}),i&&(0,nn.jsx)("div",{className:"mt-6 p-4 rounded-md ".concat(i.includes("\u2705")?"bg-green-50 text-green-800 border border-green-200":"bg-red-50 text-red-800 border border-red-200"),children:i}),i.includes("created successfully")&&(0,nn.jsxs)("div",{className:"mt-6 bg-blue-50 border border-blue-200 rounded-md p-4",children:[(0,nn.jsx)("h3",{className:"text-sm font-medium text-blue-800 mb-2",children:"Next Steps:"}),(0,nn.jsxs)("ul",{className:"text-sm text-blue-700 space-y-1",children:[(0,nn.jsxs)("li",{children:["\u2022 Visit ",(0,nn.jsx)("a",{href:"/directory",className:"underline font-medium",children:"/directory"})," to see sample member profiles"]}),(0,nn.jsxs)("li",{children:["\u2022 Visit ",(0,nn.jsx)("a",{href:"/groups",className:"underline font-medium",children:"/groups"})," to see groups with discussions"]}),(0,nn.jsxs)("li",{children:["\u2022 Visit ",(0,nn.jsx)("a",{href:"/jobs",className:"underline font-medium",children:"/jobs"})," to see job postings with applications"]}),(0,nn.jsxs)("li",{children:["\u2022 Visit ",(0,nn.jsx)("a",{href:"/projects",className:"underline font-medium",children:"/projects"})," to see project postings"]}),(0,nn.jsxs)("li",{children:["\u2022 Visit ",(0,nn.jsx)("a",{href:"/admin",className:"underline font-medium",children:"/admin"})," \u2192 All Users tab to see seeded vs real tracking"]})]})]})]})}):(0,nn.jsx)("div",{className:"max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:(0,nn.jsxs)("div",{className:"text-center",children:[(0,nn.jsx)("h2",{className:"text-2xl font-bold text-gray-900",children:"Access Denied"}),(0,nn.jsx)("p",{className:"text-gray-600 mt-2",children:"You don't have permission to access this tool."})]})})},Yr=()=>{var t,n,r;const{hasRole:s}=sn(),[a,i]=(0,e.useState)(""),[o,l]=(0,e.useState)(null),[c,d]=(0,e.useState)(!1),[u,m]=(0,e.useState)("");if(!s("admin"))return(0,nn.jsx)("div",{className:"max-w-4xl mx-auto p-6",children:(0,nn.jsx)("div",{className:"bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded",children:"You don't have permission to access user management."})});return(0,nn.jsx)("div",{className:"max-w-4xl mx-auto p-6",children:(0,nn.jsxs)("div",{className:"bg-white rounded-lg shadow-lg p-6",children:[(0,nn.jsx)("h1",{className:"text-2xl font-bold text-gray-900 mb-6",children:"User Management"}),(0,nn.jsx)("form",{onSubmit:async e=>{if(e.preventDefault(),a.trim()){d(!0),m(""),l(null);try{const e=await(0,wn.Gs)(a.trim());e?(l(e),m("User found: ".concat(e.displayName||e.firstName+" "+e.lastName))):m("No user found with that email address")}catch(t){console.error("Error searching for user:",t),m("Error searching for user: "+t.message)}finally{d(!1)}}else m("Please enter an email address")},className:"mb-6",children:(0,nn.jsxs)("div",{className:"flex gap-4",children:[(0,nn.jsxs)("div",{className:"flex-1",children:[(0,nn.jsx)("label",{htmlFor:"email",className:"block text-sm font-medium text-gray-700 mb-2",children:"Search User by Email"}),(0,nn.jsx)("input",{type:"email",id:"email",value:a,onChange:e=>i(e.target.value),placeholder:"Enter email address",className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue",disabled:c})]}),(0,nn.jsx)("div",{className:"flex items-end",children:(0,nn.jsx)("button",{type:"submit",disabled:c,
2className:"px-4 py-2 bg-apn-blue text-white rounded-md hover:bg-blue-700 disabled:bg-gray-400 disabled:cursor-not-allowed",children:c?"Searching...":"Search"})})]})}),u&&(0,nn.jsx)("div",{className:"p-4 rounded-md mb-6 ".concat(u.includes("\u2705")?"bg-green-100 text-green-700":u.includes("\u274c")?"bg-red-100 text-red-700":"bg-blue-100 text-blue-700"),children:u}),o&&(0,nn.jsxs)("div",{className:"bg-gray-50 p-6 rounded-lg mb-6",children:[(0,nn.jsx)("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:"User Details"}),(0,nn.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsxs)("p",{children:[(0,nn.jsx)("strong",{children:"Email:"})," ",o.email]}),(0,nn.jsxs)("p",{children:[(0,nn.jsx)("strong",{children:"Name:"})," ",o.displayName||"".concat(o.firstName," ").concat(o.lastName)]}),(0,nn.jsxs)("p",{children:[(0,nn.jsx)("strong",{children:"Status:"})," ",o.status||"pending"]}),(0,nn.jsxs)("p",{children:[(0,nn.jsx)("strong",{children:"Role:"})," ",o.role||"member"]})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsxs)("p",{children:[(0,nn.jsx)("strong",{children:"Company:"})," ",o.company||"N/A"]}),(0,nn.jsxs)("p",{children:[(0,nn.jsx)("strong",{children:"Job Title:"})," ",o.jobTitle||"N/A"]}),(0,nn.jsxs)("p",{children:[(0,nn.jsx)("strong",{children:"Created:"})," ",(null===(t=o.createdAt)||void 0===t||null===(n=t.toDate)||void 0===n||null===(r=n.call(t))||void 0===r?void 0:r.toLocaleDateString())||"N/A"]}),(0,nn.jsxs)("p",{children:[(0,nn.jsx)("strong",{children:"User ID:"})," ",o.id]})]})]}),(0,nn.jsxs)("div",{className:"mt-6 pt-4 border-t border-gray-200",children:[(0,nn.jsx)("button",{onClick:async()=>{if(!o)return;if(window.confirm("Are you sure you want to delete user ".concat(o.email,"? This action cannot be undone."))){d(!0),m("");try{await(0,wn.wC)(o.id),m("\u2705 User ".concat(o.email," has been deleted from Firestore. You may also need to delete them from Firebase Authentication manually.")),l(null),i("")}catch(e){console.error("Error deleting user:",e),m("\u274c Error deleting user: "+e.message)}finally{d(!1)}}},disabled:c,className:"px-4 py-2 bg-red-600 text-white rounded-md hover:bg-red-700 disabled:bg-gray-400 disabled:cursor-not-allowed",children:c?"Deleting...":"Delete User from Firestore"}),(0,nn.jsx)("p",{className:"text-sm text-gray-500 mt-2",children:"\u26a0\ufe0f This will delete the user from Firestore database. You may also need to delete them from Firebase Authentication manually."})]})]}),(0,nn.jsxs)("div",{className:"bg-yellow-50 p-4 rounded-lg",children:[(0,nn.jsx)("h4",{className:"font-semibold text-yellow-800 mb-2",children:"Instructions:"}),(0,nn.jsxs)("ol",{className:"list-decimal list-inside text-sm text-yellow-700 space-y-1",children:[(0,nn.jsx)("li",{children:"Search for a user by their email address"}),(0,nn.jsx)("li",{children:"Review the user details carefully"}),(0,nn.jsx)("li",{children:'Click "Delete User from Firestore" to remove them from the database'}),(0,nn.jsx)("li",{children:"Manually delete the user from Firebase Authentication Console if needed"}),(0,nn.jsx)("li",{children:"The user will then be able to create a new account with the same email"})]})]})]})})},Kr=()=>{const{hasRole:t}=sn(),[r,s]=(0,e.useState)(!1),[a,i]=(0,e.useState)([]),[o,l]=(0,e.useState)("");if(!t("admin"))return(0,nn.jsx)("div",{className:"max-w-4xl mx-auto p-6",children:(0,nn.jsx)("div",{className:"bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded",children:"You don't have permission to access user export."})});return(0,nn.jsx)("div",{className:"max-w-6xl mx-auto p-6",children:(0,nn.jsxs)("div",{className:"bg-white rounded-lg shadow-lg p-6",children:[(0,nn.jsx)("h1",{className:"text-2xl font-bold text-gray-900 mb-6",children:"User Export & Management"}),(0,nn.jsxs)("div",{className:"mb-8",children:[(0,nn.jsx)("h2",{className:"text-xl font-semibold text-gray-900 mb-4",children:"Load User Data"}),(0,nn.jsxs)("div",{className:"bg-gray-50 p-4 rounded-lg",children:[(0,nn.jsx)("p",{className:"text-gray-700 mb-4",children:"Load all users from the database to export or manage their accounts."}),(0,nn.jsx)("button",{onClick:async()=>{try{s(!0),l("Loading all users...");const e=await(0,wn.getAllUsers)(1e3);i(e),console.log("\ud83d\udd0d All users in Firestore:"),e.forEach((e,t)=>{console.log("".concat(t+1,". Email: ").concat(e.email,", Status: ").concat(e.status,", Role: ").concat(e.role))}),l("\u2705 Loaded ".concat(e.length," users successfully! Check console for details."))}catch(e){console.error("Error loading users:",e),l("\u274c Error loading users: "+e.message)}finally{s(!1)}},disabled:r,className:"px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 disabled:bg-gray-400 disabled:cursor-not-allowed",children:r?"Loading...":"Load All Users (".concat(a.length," loaded)")})]})]}),o&&(0,nn.jsx)("div",{className:"p-4 rounded-md mb-6 whitespace-pre-line ".concat(o.includes("\u2705")?"bg-green-100 text-green-700":o.includes("\u274c")?"bg-red-100 text-red-700":o.includes("\u26a0\ufe0f")?"bg-yellow-100 text-yellow-700":"bg-blue-100 text-blue-700"),
2children:o}),a.length>0&&(0,nn.jsxs)("div",{className:"mb-8",children:[(0,nn.jsx)("h2",{className:"text-xl font-semibold text-gray-900 mb-4",children:"Export User Data"}),(0,nn.jsxs)("div",{className:"bg-gray-50 p-4 rounded-lg",children:[(0,nn.jsx)("p",{className:"text-gray-700 mb-4",children:"Export user data for communication and membership management."}),(0,nn.jsxs)("div",{className:"flex space-x-4",children:[(0,nn.jsx)("button",{onClick:()=>{if(0===a.length)return void l("\u274c No users to export. Please load users first.");const e=a.map(e=>[e.email||"",e.firstName||"",e.lastName||"",e.displayName||"",e.company||"",e.jobTitle||"",e.phone||"",e.linkedinUrl||"",e.status||"pending",e.role||"member",e.memberSince?new Date(1e3*e.memberSince.seconds).toLocaleDateString():"",e.createdAt?new Date(1e3*e.createdAt.seconds).toLocaleDateString():"",e.lastLoginAt?new Date(1e3*e.lastLoginAt.seconds).toLocaleDateString():"Never"]),t=[["Email","First Name","Last Name","Display Name","Company","Job Title","Phone","LinkedIn URL","Status","Role","Member Since","Created At","Last Login"].join(","),...e.map(e=>e.map(e=>'"'.concat(e,'"')).join(","))].join("\n"),n=new Blob([t],{type:"text/csv"}),r=URL.createObjectURL(n),s=document.createElement("a");s.href=r,s.download="APN_Users_Export_".concat((new Date).toISOString().split("T")[0],".csv"),document.body.appendChild(s),s.click(),document.body.removeChild(s),URL.revokeObjectURL(r),l("\u2705 Exported ".concat(a.length," users to CSV file!"))},className:"px-4 py-2 bg-green-600 text-white rounded-md hover:bg-green-700",children:"\ud83d\udcc4 Export to CSV"}),(0,nn.jsx)("button",{onClick:async()=>{if(0!==a.length)try{const e=await n.e(238).then(n.bind(n,238)),t=e.utils.book_new(),r=a.map(e=>({Email:e.email||"","First Name":e.firstName||"","Last Name":e.lastName||"","Display Name":e.displayName||"",Company:e.company||"","Job Title":e.jobTitle||"",Phone:e.phone||"","LinkedIn URL":e.linkedinUrl||"",Status:e.status||"pending",Role:e.role||"member","Member Since":e.memberSince?new Date(1e3*e.memberSince.seconds).toLocaleDateString():"","Created At":e.createdAt?new Date(1e3*e.createdAt.seconds).toLocaleDateString():"","Last Login":e.lastLoginAt?new Date(1e3*e.lastLoginAt.seconds).toLocaleDateString():"Never","About Me":e.aboutMe||""})),s=e.utils.json_to_sheet(r);e.utils.book_append_sheet(t,s,"APN Users");const i=Object.keys(r[0]||{}).map(e=>({wch:Math.max(e.length,15)}));s["!cols"]=i;const o="APN_Users_Export_".concat((new Date).toISOString().split("T")[0],".xlsx");e.writeFile(t,o),l("\u2705 Exported ".concat(a.length," users to Excel file!"))}catch(e){console.error("Error exporting to Excel:",e),l("\u274c Error exporting to Excel. CSV export is still available.")}else l("\u274c No users to export. Please load users first.")},className:"px-4 py-2 bg-green-600 text-white rounded-md hover:bg-green-700",children:"\ud83d\udcca Export to Excel"})]})]})]}),a.length>0&&(0,nn.jsxs)("div",{className:"mb-8",children:[(0,nn.jsx)("h2",{className:"text-xl font-semibold text-gray-900 mb-4",children:"User Management"}),(0,nn.jsxs)("div",{className:"bg-yellow-50 p-4 rounded-lg",children:[(0,nn.jsxs)("p",{className:"text-yellow-800 mb-4",children:["\u26a0\ufe0f ",(0,nn.jsx)("strong",{children:"Clear Login Sessions:"})," Force all users to log in again."]}),(0,nn.jsx)("button",{onClick:async()=>{if(window.confirm("\u26a0\ufe0f WARNING: This will clear login sessions for ALL ".concat(a.length," users. They will need to log in again.\n\nAre you sure you want to proceed?")))try{s(!0),l("Clearing user login sessions..."),l('\n \u26a0\ufe0f To clear all user login sessions:\n \n 1. Go to Firebase Console: https://console.firebase.google.com/project/the-apn/authentication/users\n 2. Use the "Revoke refresh tokens" option for bulk operations\n 3. Or use Firebase Admin SDK to revoke tokens programmatically\n \n Alternative: Users can be notified to log out and log back in.\n ')}catch(e){console.error("Error clearing logins:",e),l("\u274c Error clearing login sessions: "+e.message)}finally{s(!1)}},disabled:r,className:"px-4 py-2 bg-red-600 text-white rounded-md hover:bg-red-700 disabled:bg-gray-400 disabled:cursor-not-allowed",children:"\ud83d\udd04 Clear All Login Sessions"})]})]}),(0,nn.jsxs)("div",{className:"mb-8",children:[(0,nn.jsx)("h2",{className:"text-xl font-semibold text-gray-900 mb-4",children:"Registration Issues"}),(0,nn.jsxs)("div",{className:"bg-red-50 p-4 rounded-lg",children:[(0,nn.jsxs)("p",{className:"text-red-800 mb
2-4",children:["\ud83d\udd0d ",(0,nn.jsx)("strong",{children:"Check for Orphaned Auth Users:"})," Find users in Firebase Auth but not in Firestore."]}),(0,nn.jsx)("button",{onClick:()=>{l('\n\ud83d\udd0d ORPHANED AUTH USERS DETECTED:\n\nThe emails "[email protected]" and "[email protected]" exist in Firebase Auth but not in Firestore.\n\n\ud83d\udd27 TO FIX THIS:\n1. Go to Firebase Console: https://console.firebase.google.com/project/the-apn/authentication/users\n2. Find users with these emails:\n - [email protected]\n - [email protected]\n3. Click the 3-dots menu \u2192 Delete user for each\n4. Then try registering again\n\nOR\n\nUse completely different email addresses for registration like:\n- [email protected]\n- [email protected]\n- [email protected]\n\nThis mismatch happens when Firebase Auth users exist but their Firestore documents were deleted.\n ')},className:"px-4 py-2 bg-red-600 text-white rounded-md hover:bg-red-700",children:"\ud83d\udd0d Check [email protected] Issue"})]})]}),a.length>0&&(0,nn.jsxs)("div",{className:"mb-8",children:[(0,nn.jsx)("h2",{className:"text-xl font-semibold text-gray-900 mb-4",children:"User Summary"}),(0,nn.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[(0,nn.jsxs)("div",{className:"bg-blue-50 p-4 rounded-lg",children:[(0,nn.jsx)("h3",{className:"text-lg font-semibold text-blue-900",children:"Total Users"}),(0,nn.jsx)("p",{className:"text-3xl font-bold text-blue-600",children:a.length})]}),(0,nn.jsxs)("div",{className:"bg-green-50 p-4 rounded-lg",children:[(0,nn.jsx)("h3",{className:"text-lg font-semibold text-green-900",children:"Approved Members"}),(0,nn.jsx)("p",{className:"text-3xl font-bold text-green-600",children:a.filter(e=>"approved"===e.status).length})]}),(0,nn.jsxs)("div",{className:"bg-yellow-50 p-4 rounded-lg",children:[(0,nn.jsx)("h3",{className:"text-lg font-semibold text-yellow-900",children:"Pending Approval"}),(0,nn.jsx)("p",{className:"text-3xl font-bold text-yellow-600",children:a.filter(e=>"pending"===e.status).length})]})]})]}),(0,nn.jsxs)("div",{className:"bg-blue-50 p-4 rounded-lg",children:[(0,nn.jsx)("h4",{className:"font-semibold text-blue-800 mb-2",children:"Next Steps:"}),(0,nn.jsxs)("ol",{className:"list-decimal list-inside text-sm text-blue-700 space-y-1",children:[(0,nn.jsx)("li",{children:"Load all users to see current member list"}),(0,nn.jsx)("li",{children:"Export user data to CSV or Excel for communication"}),(0,nn.jsx)("li",{children:"Use exported data to send membership upgrade emails"}),(0,nn.jsx)("li",{children:"Clear login sessions if needed to force re-authentication"}),(0,nn.jsx)("li",{children:"Monitor user activity and membership status"})]})]})]})})},Jr=[{url:"/",changefreq:"daily",priority:"1.0",lastmod:(new Date).toISOString()},{url:"/about",changefreq:"monthly",priority:"0.8",lastmod:(new Date).toISOString()},{url:"/about/membership",changefreq:"weekly",priority:"0.9",lastmod:(new Date).toISOString()},{url:"/about/sponsorship",changefreq:"monthly",priority:"0.7",lastmod:(new Date).toISOString()},{url:"/about/contact",changefreq:"monthly",priority:"0.6",lastmod:(new Date).toISOString()},{url:"/events",changefreq:"daily",priority:"0.9",lastmod:(new Date).toISOString()},{url:"/jobs",changefreq:"daily",priority:"0.9",lastmod:(new Date).toISOString()},{url:"/projects",changefreq:"daily",priority:"0.8",lastmod:(new Date).toISOString()},{url:"/directory",changefreq:"weekly",priority:"0.8",lastmod:(new Date).toISOString()},{url:"/groups",changefreq:"weekly",priority:"0.8",lastmod:(new Date).toISOString()},{url:"/news",changefreq:"daily",priority:"0.7",lastmod:(new Date).toISOString()},{url:"/login",changefreq:"monthly",priority:"0.5",lastmod:(new Date).toISOString()},{url:"/signup",changefreq:"monthly",priority:"0.6",lastmod:(new Date).toISOString()}],$r=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{events:t=[],jobs:n=[],projects:r=[],articles:s=[],users:a=[]}=e;let i='<?xml version="1.0" encoding="UTF-8"?>\n<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"\n xmlns:image="http://www.google.com/schemas/sitemap-image/1.1"\n xmlns:news="http://www.google.com/schemas/sitemap-news/0.9">';
2return Jr.forEach(e=>{i+="\n <url>\n <loc>".concat(Tn.siteUrl).concat(e.url,"</loc>\n <lastmod>").concat(e.lastmod,"</lastmod>\n <changefreq>").concat(e.changefreq,"</changefreq>\n <priority>").concat(e.priority,"</priority>\n </url>")}),t.forEach(e=>{var t;(i+="\n <url>\n <loc>".concat(Tn.siteUrl,"/events/").concat(e.id,"</loc>\n <lastmod>").concat(e.updatedAt||e.createdAt,"</lastmod>\n <changefreq>weekly</changefreq>\n <priority>0.8</priority>"),e.image)&&(i+="\n <image:image>\n <image:loc>".concat(Tn.siteUrl).concat(e.image,"</image:loc>\n <image:title>").concat(e.title,"</image:title>\n <image:caption>").concat(null===(t=e.description)||void 0===t?void 0:t.substring(0,100),"...</image:caption>\n </image:image>"));i+="\n </url>"}),n.forEach(e=>{i+="\n <url>\n <loc>".concat(Tn.siteUrl,"/jobs/").concat(e.id,"</loc>\n <lastmod>").concat(e.updatedAt||e.postedDate,"</lastmod>\n <changefreq>weekly</changefreq>\n <priority>0.8</priority>\n </url>")}),r.forEach(e=>{i+="\n <url>\n <loc>".concat(Tn.siteUrl,"/projects/").concat(e.id,"</loc>\n <lastmod>").concat(e.updatedAt||e.postedDate,"</lastmod>\n <changefreq>weekly</changefreq>\n <priority>0.7</priority>\n </url>")}),s.forEach(e=>{var t;(i+="\n <url>\n <loc>".concat(Tn.siteUrl,"/news/").concat(e.slug||e.id,"</loc>\n <lastmod>").concat(e.updatedAt||e.publishedAt,"</lastmod>\n <changefreq>monthly</changefreq>\n <priority>0.6</priority>"),e.image)&&(i+="\n <image:image>\n <image:loc>".concat(Tn.siteUrl).concat(e.image,"</image:loc>\n <image:title>").concat(e.title,"</image:title>\n <image:caption>").concat(null===(t=e.excerpt)||void 0===t?void 0:t.substring(0,100),"...</image:caption>\n </image:image>"));new Date(e.publishedAt)>new Date(Date.now()-2592e5)&&(i+="\n <news:news>\n <news:publication>\n <news:name>".concat(Tn.siteName,"</news:name>\n <news:language>en</news:language>\n </news:publication>\n <news:publication_date>").concat(e.publishedAt,"</news:publication_date>\n <news:title>").concat(e.title,"</news:title>\n <news:keywords>").concat(e.category||"finance,professional,networking","</news:keywords>\n </news:news>")),i+="\n </url>"}),a.filter(e=>
2"approved"===e.status&&!1!==e.isPublic).forEach(e=>{i+="\n <url>\n <loc>".concat(Tn.siteUrl,"/directory/").concat(e.id,"</loc>\n <lastmod>").concat(e.updatedAt||e.createdAt,"</lastmod>\n <changefreq>monthly</changefreq>\n <priority>0.5</priority>\n </url>")}),i+="\n</urlset>",i},Qr=()=>"# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nAllow: /\n\n# Disallow admin and private areas\nDisallow: /admin/\nDisallow: /dashboard/\nDisallow: /profile/edit\nDisallow: /api/\nDisallow: /test/\n\n# Allow important pages\nAllow: /events/\nAllow: /jobs/\nAllow: /projects/\nAllow: /news/\nAllow: /directory/\nAllow: /groups/\nAllow: /about/\n\n# Sitemap location\nSitemap: ".concat(Tn.siteUrl,"/sitemap.xml\n\n# Crawl delay (be respectful)\nCrawl-delay: 1"),Xr=()=>{const{hasRole:t}=sn(),[n,r]=(0,e.useState)(!1),[s,a]=(0,e.useState)(""),[i,o]=(0,e.useState)(""),[l,c]=(0,e.useState)({}),[d,u]=(0,e.useState)(""),m=t("admin");(0,e.useEffect)(()=>{m&&(h(),o(Qr()))},[m]);const h=async()=>{try{r(!0);const[e,t,n,s,a]=await Promise.all([(0,wn.getAllUsers)(1e3).catch(()=>[]),(0,wn.kQ)(1e3).catch(()=>[]),(0,wn.zA)(1e3).catch(()=>[]),(0,wn.JQ)(1e3).catch(()=>[]),(0,wn.GE)(1e3).catch(()=>[])]);c({totalPages:13,userProfiles:e.filter(e=>"approved"===e.status).length,events:t.length,jobs:n.length,projects:s.length,articles:a.length,totalDynamicPages:e.length+t.length+n.length+s.length+a.length})}catch(e){console.error("Error loading SEO stats:",e)}finally{r(!1)}};return m?(0,nn.jsx)("div",{className:"max-w-6xl mx-auto p-6",children:(0,nn.jsxs)("div",{className:"bg-white rounded-lg shadow-lg p-6",children:[(0,nn.jsx)("h1",{className:"text-2xl font-bold text-gray-900 mb-6",children:"SEO Management"}),(0,nn.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6 mb-8",children:[(0,nn.jsxs)("div",{className:"bg-blue-50 p-4 rounded-lg",children:[(0,nn.jsx)("h3",{className:"text-lg font-semibold text-blue-900 mb-2",children:"Total Pages"}),(0,nn.jsx)("p",{className:"text-3xl font-bold text-blue-600",children:l.totalPages+(l.totalDynamicPages||0)}),(0,nn.jsxs)("p",{className:"text-sm text-blue-700",children:[l.totalPages," static + ",l.totalDynamicPages||0," dynamic"]})]}),(0,nn.jsxs)("div",{className:"bg-green-50 p-4 rounded-lg",children:[(0,nn.jsx)("h3",{className:"text-lg font-semibold text-green-900 mb-2",children:"Indexed Content"}),(0,nn.jsxs)("div",{className:"text-sm text-green-700 space-y-1",children:[(0,nn.jsxs)("p",{children:["\ud83d\udc65 ",l.userProfiles||0," User Profiles"]}),(0,nn.jsxs)("p",{children:["\ud83d\udcc5 ",l.events||0," Events"]}),(0,nn.jsxs)("p",{children:["\ud83d\udcbc ",l.jobs||0," Jobs"]}),(0,nn.jsxs)("p",{children:["\ud83d\ude80 ",l.projects||0," Projects"]}),(0,nn.jsxs)("p",{children:["\ud83d\udcf0 ",l.articles||0," Articles"]})]})]}),(0,nn.jsxs)("div",{className:"bg-purple-50 p-4 rounded-lg",children:[(0,nn.jsx)("h3",{className:"text-lg font-semibold text-purple-900 mb-2",children:"SEO Health"}),(0,nn.jsxs)("div",{className:"text-sm text-purple-700 space-y-1",children:[(0,nn.jsx)("p",{children:"\u2705 Meta Tags: Optimized"}),(0,nn.jsx)("p",{children:"\u2705 Structured Data: Active"}),(0,nn.jsx)("p",{children:"\u2705 Open Graph: Configured"}),(0,nn.jsx)("p",{children:"\u2705 Canonical URLs: Set"}),(0,nn.jsx)("p",{children:"\u2705 Mobile Friendly: Yes"})]})]})]}),d&&(0,nn.jsx)("div",{className:"p-4 rounded-md mb-6 ".concat(d.includes("\u2705")?"bg-green-100 text-green-700":d.includes("\u274c")?"bg-red-100 text-red-700":"bg-blue-100 text-blue-700"),children:d}),(0,nn.jsxs)("div",{className:"mb-8",children:[(0,nn.jsx)("h2",{className:"text-xl font-semibold text-gray-900 mb-4",children:"Sitemap Generation"}),(0,nn.jsxs)("div",{className:"bg-gray-50 p-4 rounded-lg",children:[(0,nn.jsx)("p",{className:"text-gray-700 mb-4",children:"Generate an XML sitemap for search engines to better crawl and index your website."}),(0,nn.jsxs)("div",{className:"flex space-x-4",children:[(0,nn.jsx)("button",{onClick:async()=>{try{r(!0),u("Generating sitemap...");const[e,t,n,s,i]=await Promise.all([(0,wn.getAllUsers)(1e3).catch(()=>[]),(0,wn.kQ)(1e3).catch(()=>[]),(0,wn.zA)(1e3).catch(()=>[]),(0,wn.JQ)(1e3).catch(()=>[]),(0,wn.GE)(1e3).catch(()=>[])]),o=await $r({users:e.filter(e=>"approved"===e.status),events:t,jobs:n,projects:s,articles:i});a(o),u("\u2705 Sitemap generated successfully! Copy the content below and save as sitemap.xml in your public folder.")}catch(e){console.error("Error generating sitemap:",e),u("\u274c Error generating sitemap: "+e.message)}finally{r(!1)}},disabled:n,className:"px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 disabled:bg-gray-400 disabled:cursor-not-allowed",children:n?"Generating...":"Generate Sitemap"}),s&&(0,nn.jsx)("button",{onClick:()=>{const e=new Blob([s],{type:"application/xml"}),t=URL.createObjectURL(e),n=document.createElement("a");n.href=t,n.download="sitemap.xml",document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(t)},className:"px-4 py-2 bg-green-600 text-white rounded-md hover:bg-green-700",children:"Download sitemap.xml"})]})]})]}),(0,nn.jsxs)("div",{className:"mb-8",children:[(0,nn.jsx)("h2",{className:"text-xl font-semibold text-gray-900 mb-4",children:"Robots.txt"}),(0,nn.jsxs)("div",{className:"bg-gray-50 p-4 rounded-lg",children:[(0,nn.jsx)("p",{className:"text-gray-700 mb-4",children:"Download the robots.txt file to control how search engines crawl your site."}),(0,nn.jsx)("button",{onClick:()=>{const e=new Blob([i],{type:"text/plain"}),t=URL.createObjectURL(e),n=document.createElement("a");n.href=t,n.download="robots.txt",document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(t)},className:"px-4 py-2 bg-purple-600 text-white rounded-md hover:bg-purple-700",children:"Download robots.txt"})]})]}),(0,nn.jsxs)("div",{className:"mb-8",children:[(0,nn.jsx)("h2",{className:"text-xl font-semibold text-gray-900 mb-4",children:"SEO Optimization Tips"}),(0,nn.jsx)("div",{className:"bg-yellow-50 p-4 rounded-lg",children:(0,nn.jsxs)("ul",{className:"list-disc list-inside text-yellow-800 space-y-2",children:[(0,nn.jsx)("li",{children:"Submit your sitemap to Google Search Console and Bing Webmaster Tools"}),(0,nn.jsx)("li",{children:"Regularly update content to keep search engines engaged"}),(0,nn.jsx)("li",{children:"Optimize page loading speeds for better rankings"}),(0,nn.jsx)("li",{children:"Ensure all images have descriptive alt text"}),(0,nn.jsx)("li",{children:"Use internal linking to help search engines understand site structure"}),(0,nn.jsx)("li",{children:"Monitor your site's performance with Google Analytics"}),(0,nn.jsx)("li",{children:"Create high-quality, relevant content for your target keywords"})]})})]}),s&&(0,nn.jsxs)("div",{className:"mb-8",children:[(0,nn.jsx)("h2",{className:"text-xl font-semibold text-gray-900 mb-4",children:"Generated Sitemap"}),(0,nn.jsx)("textarea",{value:s,readOnly:!0,className:"w-full h-64 p-3 border border-gray-300 rounded-md font-mono text-sm",placeholder:"Generated sitemap will appear here..."})]})]})}):(0,nn.jsx)("div",{className:"max-w-4xl mx-auto p-6",children:(0,nn.jsx)("div",{className:"bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded",children:"You don't have permission to access SEO management."})})},Zr=()=>{const{hasRole:t}=sn(),[n,r]=(0,e.useState)([]),[s,a]=(0,e.useState)(!0),[i,o]=(0,e.useState)(null),l=t("admin");(0,e.useEffect)(()=>{c()},[]);const c=async()=>{try{a(!0);const e=await(0,wn.GX)();r(e),console.log("Loaded groups:",e)}catch(i){console.error("Error loading groups:",i),o(i.message)}finally{a(!1)}};return l?(0,nn.jsx)("div",{className:"max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:(0,nn.jsxs)("div",{className:"bg-white rounded-lg shadow p-6",children:[(0,nn.jsx)("h1",{className:"text-2xl font-bold text-gray-900 mb-6",children:"Debug: Groups in Database"}),(0,nn.jsx)("button",{onClick:c,className:"mb-6 bg-apn-blue text-white px-4 py-2 rounded hover:bg-blue-700",children:"Refresh Groups"}),s&&(0,nn.jsxs)("div",{className:"text-center py-4",children:[(0,nn.jsx)("div",{className:"animate-spin rounded-full h-8 w-8 border-t-2 border-b-2 border-apn-blue mx-auto"}),(0,nn.jsx)("p",{className:"mt-2",children:"Loading groups..."})]}),i&&(0,nn.jsxs)("div",{className:"bg-red-50 border border-red-200 rounded-md p-4 mb-6",children:[(0,nn.jsx)("h3",{className:"text-red-800 font-medium",children:"Error:"}),(0,nn.jsx)("p",{className:"text-red-700",children:i})]}),!s&&!i&&(0,nn.jsxs)("div",{children:[(0,nn.jsxs)("h2",{className:"text-lg font-semibold mb-4",children:["Found ",n.length," groups in database:"]}),0===n.length?(0,nn.jsxs)("div",{className:"bg-yellow-50 border border-yellow-200 rounded-md p-4",children:[(0,nn.jsx)("p",{className:"text-yellow-800",children:"No groups foun
2d in database!"}),(0,nn.jsx)("p",{className:"text-yellow-700 text-sm mt-1",children:"Try running the sample data seeder again."})]}):(0,nn.jsx)("div",{className:"overflow-x-auto",children:(0,nn.jsxs)("table",{className:"min-w-full divide-y divide-gray-200",children:[(0,nn.jsx)("thead",{className:"bg-gray-50",children:(0,nn.jsxs)("tr",{children:[(0,nn.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"ID"}),(0,nn.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Name"}),(0,nn.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Members"}),(0,nn.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Active"}),(0,nn.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Actions"})]})}),(0,nn.jsx)("tbody",{className:"bg-white divide-y divide-gray-200",children:n.map(e=>(0,nn.jsxs)("tr",{children:[(0,nn.jsx)("td",{className:"px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900",children:e.id}),(0,nn.jsx)("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-900",children:e.name}),(0,nn.jsx)("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:e.memberCount||0}),(0,nn.jsx)("td",{className:"px-6 py-4 whitespace-nowrap",children:(0,nn.jsx)("span",{className:"px-2 inline-flex text-xs leading-5 font-semibold rounded-full ".concat(e.isActive?"bg-green-100 text-green-800":"bg-red-100 text-red-800"),children:e.isActive?"Active":"Inactive"})}),(0,nn.jsxs)("td",{className:"px-6 py-4 whitespace-nowrap text-sm font-medium",children:[(0,nn.jsx)("a",{href:"/groups/".concat(e.id),className:"text-apn-blue hover:text-blue-700 mr-4",target:"_blank",rel:"noopener noreferrer",children:"View"}),(0,nn.jsx)("a",{href:"/groups/".concat(e.id,"/admin"),className:"text-green-600 hover:text-green-700",target:"_blank",rel:"noopener noreferrer",children:"Admin"})]})]},e.id))})]})}),(0,nn.jsxs)("div",{className:"mt-6 bg-blue-50 border border-blue-200 rounded-md p-4",children:[(0,nn.jsx)("h3",{className:"text-blue-800 font-medium mb-2",children:"Debug Info:"}),(0,nn.jsx)("pre",{className:"text-xs text-blue-700 overflow-x-auto",children:JSON.stringify(n,null,2)})]})]})]})}):(0,nn.jsx)("div",{className:"max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:(0,nn.jsxs)("div",{className:"text-center",children:[(0,nn.jsx)("h2",{className:"text-2xl font-bold text-gray-900",children:"Access Denied"}),(0,nn.jsx)("p",{className:"text-gray-600 mt-2",children:"You don't have permission to access this debug tool."})]})})},es=()=>{const{currentUser:t,hasRole:n}=sn(),[r,s]=(0,e.useState)(""),[a,i]=(0,e.useState)(!1);return n("admin")?(0,nn.jsx)("div",{className:"max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:(0,nn.jsxs)("div",{className:"bg-white rounded-lg shadow p-6",children:[(0,nn.jsx)("h1",{className:"text-2xl font-bold text-gray-900 mb-6",children:"Firebase Connection Test"}),(0,nn.jsx)("button",{onClick:async()=>{i(!0),s("Testing Firebase connection...\n\n");
2try{s(e=>e+"\u2705 Authentication: ".concat(t?"Logged in as "+t.email:"Not logged in","\n")),s(e=>e+"\u2705 User Role: ".concat(n("admin")?"Admin":"Regular user","\n\n")),s(e=>e+"\ud83d\udccb Testing groups collection access...\n");const e=(0,vt.collection)(yt.db,"groups"),r=await(0,vt.getDocs)(e);s(e=>e+"\u2705 Groups collection: Found ".concat(r.size," documents\n")),s(e=>e+"\n\ud83d\udccb Groups found:\n"),r.forEach(e=>{const t=e.data();s(n=>n+' - ID: "'.concat(e.id,'" | Name: "').concat(t.name,'" | Members: ').concat(t.memberCount||0,"\n"))}),s(e=>e+'\n\ud83d\udccb Testing specific group access (ID: "1")...\n');const a=(0,vt.doc)(yt.db,"groups","1"),i=await(0,vt.x7)(a);if(i.exists()){const e=i.data();s(t=>t+'\u2705 Group 1: "'.concat(e.name,'" with ').concat(e.memberCount||0," members\n"))}else s(e=>e+"\u274c Group 1: Document does not exist\n");s(e=>e+"\n\ud83d\udccb Testing group posts collection...\n");const o=(0,vt.collection)(yt.db,"groupPosts"),l=await(0,vt.getDocs)(o);s(e=>e+"\u2705 Group posts: Found ".concat(l.size," documents\n")),s(e=>e+"\n\ud83c\udf89 All tests completed successfully!")}catch(e){s(t=>t+"\n\u274c Error: ".concat(e.message,"\n")),s(t=>t+"\u274c Error code: ".concat(e.code,"\n")),console.error("Firebase test error:",e)}finally{i(!1)}},disabled:a,className:"mb-6 bg-apn-blue text-white px-4 py-2 rounded hover:bg-blue-700 disabled:opacity-50",children:a?"Testing...":"Test Firebase Connection"}),r&&(0,nn.jsxs)("div",{className:"bg-gray-50 border border-gray-200 rounded-md p-4",children:[(0,nn.jsx)("h3",{className:"text-lg font-medium mb-2",children:"Test Results:"}),(0,nn.jsx)("pre",{className:"text-sm text-gray-700 whitespace-pre-wrap font-mono",children:r})]})]})}):(0,nn.jsx)("div",{className:"max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:(0,nn.jsxs)("div",{className:"text-center",children:[(0,nn.jsx)("h2",{className:"text-2xl font-bold text-gray-900",children:"Access Denied"}),(0,nn.jsx)("p",{className:"text-gray-600 mt-2",children:"You don't have permission to access this debug tool."})]})})},ts=[{id:101,title:"APN CHICAGO IS BACK!",image:"/images/events/chicago-event-2023.png",date:"November 14, 2023",time:"5:30 PM - 7:30 PM CST",location:"District Brew Yards in West Town, Chicago",address:"417 N Ashland Ave, Chicago, IL 60622",price:"$100.00 - $150.00",featured:!0,description:"Join us for our Chicago networking event at District Brew Yards! Connect with finance professionals from across the industry and expand your network in a relaxed and engaging environment.",longDescription:"\n <p>APN CHICAGO IS BACK! Join us for an evening of networking, connections, and opportunities at District Brew Yards in West Town.</p>\n\n <p>This exclusive event brings together finance professionals from across Chicago's vibrant financial sector. Whether you're in investment banking, private equity, wealth management, or any other finance specialty, this is your chance to expand your network and forge valuable connections.</p>\n\n <p>The evening will include:</p>\n <ul>\n <li>Networking with finance professionals across all levels</li>\n <li>Complimentary appetizers and drinks</li>\n <li>Brief remarks from industry leaders</li>\n <li>Opportunities to connect with potential mentors and collaborators</li>\n </ul>\n\n <p>Don't miss this opportunity to be part of Chicago's premier finance networking community!</p>\n ",eventType:"in-person",isPast:!0,originalImageUrl:"https://the-apn.com/wp-content/uploads/2023/10/APN-Chicago-Event.png"},{id:102,title:"APN NY IS BACK!",image:"/images/events/ny-event-2023.png",date:"November 7, 2023",time:"6:30 PM - 8:30 PM EST",location:"Printers Alley, New York",address:"215 W 40th Street, New York, NY 10018",price:"$100.00 - $150.00",featured:!0,description:"Join us for our New York networking event at Printers Alley! Connect with finance professionals from across the industry and expand your network in a relaxed and engaging environment.",longDescription:"\n <p>APN NY IS BACK! Join us for an evening of networking, connections, and opportunities at Printers Alley in the heart of Manhattan.</p>\n\n <p>This exclusive event brings together finance professionals from across New York's vibrant financial sector. Whether you're in investment banking, private equity, wealth management, or any other finance specialty, this is your chance to expand your network and forge valuable connections.</p>\n\n <p>The evening will include:</p>\n <ul>\n <li>Networking with finance professionals across all levels</li>\n <li>Complimentary appetizers and drinks</li>\n <li>Brief remarks from industry leaders</li>\n <li>Opportunities to connect with potential mentors and collaborators</li>\n </ul>\n\n <p>Don't miss this opportunity to be part of New York's premier finance networking community!</p>\n ",eventType:"in-person",isPast:!0,originalImageUrl:"https://the-apn.com/w
2p-content/uploads/2023/10/APN-NY-Event_new.png"},{id:103,title:"APN One Year Celebration",image:"/images/events/one-year-celebration.jpg",date:"May 23, 2023",time:"6:00 PM - 8:00 PM EST",location:"Printers Alley, New York",address:"215 W 40th Street, New York, NY 10018",price:"$5.00 - $125.00",featured:!0,description:"Please join us for Accelerated Professional Networks' one year anniversary event at Printers Alley! All are welcome, including non-members. Come enjoy drinks and great conversation as we continue to build out our professional networks.",longDescription:"\n <p>Please join us for Accelerated Professional Networks' one year anniversary event at Printers Alley! All are welcome, including non-members. Come enjoy drinks and great conversation as we continue to build out our professional networks. Hope to see you there!</p>\n\n <p>By registering for this event you agree to our terms and conditions.</p>\n ",eventType:"in-person",isPast:!0,originalImageUrl:"https://the-apn.com/wp-content/uploads/2023/05/APN-Printers-Alley-May-23rd.jpg"},{id:104,title:"APN's First Annual Holiday Event!",image:"/images/events/holiday-event-2022.jpg",date:"December 13, 2022",time:"6:30 PM - 8:30 PM EST",location:"VERSA Canopy, New York",address:"218 W 35th St, New York, NY 10001",price:"$24.00 - $200.00",featured:!1,description:"Join APN for our first annual Holiday Party at VERSA Canopy! Private Equity gets in free (email for discount code). Come join us to celebrate our first year as APN, a year of successful dealmaking, and make new connections!",longDescription:"\n <p>Join APN for our first annual Holiday Party at VERSA Canopy on Tuesday, December 13th from 6:30-8:30! Private Equity gets in free (email [email protected] for discount code). Come join us to celebrate our first year as APN, a year of successful dealmaking, and make new connections! We hope to see you there!</p>\n ",eventType:"in-person",isPast:!0,originalImageUrl:"https://the-apn.com/wp-content/uploads/2022/11/FINAL-HOLIDAY-GRAPHIC.jpg"},{id:105,title:"Fall Kickoff Event!",image:"/images/events/fall-kickoff-2022.png",date:"October 11, 2022",time:"6:30 PM - 8:30 PM EDT",location:"Clinton Hall, New York",address:"16 W 36th St, New York, NY 10018",price:"$24.00 - $125.00",featured:!1,description:"Come join APN for our Fall Kickoff event at Clinton Hall on W. 36th Street to network with likeminded junior M&A professionals!",longDescription:"\n <p>Come join APN for our Fall Kickoff event at Clinton Hall on W. 36th Street Tuesday, October 11th from 6:30-8:30 to network with likeminded junior M&A professionals! Hope to see you there!</p>\n\n <p>Accelerated Professionals Network is a community of finance professionals collaborating to create a more seamless M&A transaction process. Catering to junior professionals (non-partners), APN encourages those in the financial industry to begin building their networks early in their careers resulting in more transparency into the full life cycle of a deal, an increase in the potential for expedited career growth and development, and greater access to resources as they continue to advance within their roles/organizations.</p>\n ",eventType:"in-person",isPast:!0,originalImageUrl:"https://the-apn.com/wp-content/uploads/2022/09/APN-Clinton-Hal.png"},{id:106,title:"APN End of Summer Bash!",image:"/images/events/summer-bash-2022.jpeg",date:"August 9, 2022",time:"6:30 PM - 8:30 PM",location:"The Perfect Pint, New York",address:"203 E 45th St, New York, NY 10017",price:"$24.00 - $175.00",featured:!1,description:"Please join us for the Accelerated Professionals Network's End of Summer Bash IN PERSON once again at the Perfect Pint!",longDescription:"\n <p>Please join us for the Accelerated Professionals Network's End of Summer Bash IN PERSON once again at the Perfect Pint! All are welcome, including non-members. Come enjoy drinks, food, great conversation and warm weather as we continue to build out our networks and create a more seamless M&A deal cycle!</p>\n ",eventType:"in-person",isPast:!0,originalImageUrl:"https://the-apn.com/w
2p-content/uploads/2022/04/the-perfect-pint-midtown-east.jpeg"},{id:107,title:"APN Launch",image:"/images/events/apn-launch-2022.jpg",date:"April 26, 2022",time:"6:30 PM - 8:30 PM",location:"Printers Alley, New York",address:"215 W 40th Street, New York, NY 10018",price:"$5.00 - $125.00",featured:!1,description:"Please join us for Accelerated Professional Networks' first IN PERSON event at Printers Alley!",longDescription:"\n <p>Please join us for Accelerated Professional Networks' first IN PERSON event at Printers Alley! All are welcome, including non-members. Come enjoy drinks and great conversation as we continue to build out our networks. Hope to see you there!</p>\n\n <p>By registering for this event you agree to our terms and conditions.</p>\n ",eventType:"in-person",isPast:!0,originalImageUrl:"https://the-apn.com/wp-content/uploads/2022/04/events.jpg"},{id:108,title:"Bi Monthly National Networking Group - May 2022",image:"/images/events/virtual-networking-event-logo.jpeg",date:"May 17, 2022",time:"6:00 PM - 7:00 PM EDT",location:"Virtual Event",address:"Online",price:"Free",featured:!1,description:"Join us for our bi-monthly virtual networking event to connect with professionals across the country!",longDescription:"\n <p>Join us for our bi-monthly virtual networking event to connect with professionals across the country! This is a great opportunity to expand your network beyond your local area and connect with like-minded professionals in the M&A space.</p>\n\n <p>This event is free for all members and non-members. We hope to see you there!</p>\n ",eventType:"virtual",isPast:!0,originalImageUrl:"/apn-logos/virtual-networking-event-logo-photo.jpeg"},{id:109,title:"Bi Monthly National Networking Group - July 2022",image:"/images/events/virtual-networking-event-logo.jpeg",date:"July 19, 2022",time:"6:00 PM - 7:00 PM EDT",location:"Virtual Event",address:"Online",price:"Free",featured:!1,description:"Join us for our bi-monthly virtual networking event to connect with professionals across the country!",longDescription:"\n <p>Join us for our bi-monthly virtual networking event to connect with professionals across the country! This is a great opportunity to expand your network beyond your local area and connect with like-minded professionals in the M&A space.</p>\n\n <p>This event is free for all members and non-members. We hope to see you there!</p>\n ",eventType:"virtual",isPast:!0,originalImageUrl:"/apn-logos/virtual-networking-event-logo-photo.jpeg"},{id:110,title:"Bi Monthly National Networking Group - September 2022",image:"/images/events/virtual-networking-event-logo.jpeg",date:"September 20, 2022",time:"6:00 PM - 7:00 PM EDT",location:"Virtual Event",address:"Online",price:"Free",featured:!1,description:"Join us for our bi-monthly virtual networking event to connect with professionals across the country!",longDescription:"\n <p>Join us for our bi-monthly virtual networking event to connect with professionals across the country! This is a great opportunity to expand your network beyond your local area and connect with like-minded professionals in the M&A space.</p>\n\n <p>This event is free for all members and non-members. We hope to see you there!</p>\n ",eventType:"virtual",isPast:!0,originalImageUrl:"/apn-logos/virtual-networking-event-logo-photo.jpeg"},{id:111,title:"Bi Monthly National Networking Group - November 2022",image:"/images/events/virtual-networking-event-logo.jpeg",date:"November 15, 2022",time:"6:00 PM - 7:00 PM EST",location:"Virtual Event",address:"Online",price:"Free",featured:!1,description:"Join us for our bi-monthly virtual networking event to connect with professionals across the country!",longDescription:"\n <p>Join us for our bi-monthly virtual networking event to connect with professionals across the country! This is a great opportunity to expand your network beyond your local area and connect with like-minded professionals in the M&A space.</p>\n\n <p>This event is free for all members and non-members. We hope to see you there!</p>\n ",eventType:"virtual",isPast:!0,originalImageUrl:"/apn-logos/virtual-networking-event-logo-photo.jpeg"},{id:112,title:"Excel Mastery for Finance Professionals",image:"/images/events/event-placeholder.png",date:"January 25, 2025",time:"2:00 PM - 4:00 PM",location:"Virtual Workshop (Zoom)",address:"Online",price:"$25.00 - $40.00",featured:!0,description:"Master advanced Excel techniques specifically designed for finance professionals. Learn financial modeling, data analysis, and automation.",eventType:"virtual",category:"education",virtualPlatform:"Zoom",isPast:!0}
2,{id:113,title:"Financial Modeling Fundamentals",image:"/images/events/event-placeholder.png",date:"February 15, 2025",time:"1:00 PM - 5:00 PM",location:"Virtual Workshop (Microsoft Teams)",address:"Online",price:"$75.00 - $100.00",featured:!0,description:"Learn the fundamentals of financial modeling from industry experts. Build DCF models, comparable analysis, and more.",eventType:"virtual",category:"education",virtualPlatform:"Microsoft Teams",isPast:!0},{id:114,title:"APN CHICAGO IS BACK!",image:"/images/events/event-placeholder.png",date:"May 15, 2025",time:"6:00 PM - 9:00 PM",location:"District Brew Yards in West Town, Chicago",address:"417 N Ashland Ave, Chicago, IL 60622",price:"$100.00 - $150.00",featured:!0,description:"Join us for our Chicago networking event at District Brew Yards! Connect with finance professionals from across the industry and expand your network in a relaxed and engaging environment.",eventType:"in-person",isPast:!0},{id:115,title:"APN NY IS BACK!",image:"/images/events/event-placeholder.png",date:"June 10, 2025",time:"7:00 PM - 10:00 PM",location:"Printers Alley, New York",address:"215 W 40th St, New York, NY 10018",price:"$100.00 - $150.00",featured:!0,description:"Join us for our New York networking event at Printers Alley! Connect with finance professionals from across the industry and expand your network.",eventType:"in-person",isPast:!0}],ns=[{id:6,title:"APN Virtual Investment Strategies Summit",image:"/images/events/event-placeholder.png",date:"November 4, 2025",time:"1:00 PM - 3:30 PM",location:"Virtual Event (Microsoft Teams)",address:"Online",price:"$50.00 - $75.00",featured:!1,description:"Join us for our virtual investment strategies summit featuring expert panels and networking opportunities. Learn about the latest investment trends and strategies from industry leaders.",comments:[{id:1,userId:7,userName:"Robert Kim",userImage:"/images/profiles/robert-kim.jpg",userTitle:"Investment Analyst",userCompany:"Fidelity Investments",text:"Will the sessions be recorded for those who can't attend the entire event?",timestamp:"2025-10-20T13:15:00Z",likes:4,replies:[]}],reactions:{like:8,celebrate:2,support:1,insightful:12,curious:6},longDescription:"\n <p>APN Virtual Investment Strategies Summit! Join us for an engaging online event featuring expert panels, interactive discussions, and virtual networking opportunities focu
2sed on investment strategies.</p>\n\n <p>This virtual summit brings together finance professionals and investment experts from across the country. Whether you're in investment banking, private equity, wealth management, or any other finance specialty, this is your chance to gain valuable insights from industry leaders.</p>\n\n <p>The event will include:</p>\n <ul>\n <li>Expert panel discussions on current investment trends</li>\n <li>Interactive Q&A sessions with industry leaders</li>\n <li>Virtual networking breakout rooms</li>\n <li>Digital resource materials for all attendees</li>\n </ul>\n\n <p>Don't miss this opportunity to learn and connect from the comfort of your home or office!</p>\n ",ticketTypes:[{id:"member",name:"Member Registration",price:50,description:"For current APN members",memberOnly:!0},{id:"non-member",name:"Non-Member Registration",price:75,description:"For non-members",memberOnly:!1}],sponsors:[{id:1,name:"Goldman Sachs",level:"Gold",attendeeLimit:15,additionalAttendeeDiscount:50},{id:4,name:"BlackRock",level:"Silver",attendeeLimit:8,additionalAttendeeDiscount:25},{id:5,name:"Citi",level:"Bronze",attendeeLimit:5,additionalAttendeeDiscount:15}],attendees:[],accessDates:{basic:"2025-10-28T00:00:00Z",bronze:"2025-10-21T00:00:00Z",silver:"2025-10-16T00:00:00Z",gold:"2025-10-14T00:00:00Z"},eventType:"virtual",virtualPlatform:"Microsoft Teams",virtualLink:"https://teams.microsoft.com/l/meetup-join/example"},{id:5,title:"APN Fall Finance Mixer",image:"/images/events/event-placeholder.png",date:"October 14, 2025",time:"6:30 PM - 9:30 PM",location:"The Standard Club, Chicago",address:"320 S Plymouth Ct, Chicago, IL 60604",price:"$100.00 - $150.00",featured:!0,description:"Join us for our fall networking event at The Standard Club in Chicago! Connect with finance professionals from across the Midwest and enjoy an evening of networking in this historic venue.",longDescription:"\n <p>APN Fall Finance Mixer! Join us for an evening of networking, connections, and opportunities at The Standard Club, one of Chicago's most prestigious venues.</p>\n\n <p>This exclusive event brings together finance professionals from across the Midwest. Whether you're in investment banking, private equity, wealth management, or any other finance specialty, this is your chance to expand your network and forge valuable connections.</p>\n\n <p>The event will include:</p>\n <ul>\n <li>Networking with finance professionals across all levels</li>\n <li>Gourmet appetizers and premium open bar</li>\n <li>Brief remarks from industry leaders</li>\n <li>Opportunities to connect with potential mentors and collaborators</li>\n </ul>\n\n <p>Don't miss this opportunity to be part of Chicago's premier finance networking community!</p>\n ",ticketTypes:[{id:"member",name:"Member Registration",price:100,description:"For current APN members",memberOnly:!0},{id:"non-member",name:"Non-Member Registration",price:150,description:"For non-members",memberOnly:!1}],sponsors:[{id:1,name:"Goldman Sachs",level:"Gold",attendeeLimit:12,additionalAttendeeDiscount:50},{id:2,name:"JP Morgan",level:"Silver",attendeeLimit:8,additionalAttendeeDiscount:25},{id:3,name:"Bank of America",level:"Bronze",attendeeLimit:5,additionalAttendeeDiscount:15}],attendees:[],accessDates:{basic:"2025-10-07T00:00:00Z",bronze:"2025-09-30T00:00:00Z",silver:"2025-09-25T00:00:00Z",gold:"2025-09-23T00:00:00Z"},eventType:"in-person"}],rs=[...ns,...ts],ss=e=>rs.find(t=>t.id===parseInt(e)),as=()=>ns.sort((e,t)=>new Date(e.date)-new Date(t.date)),is=()=>ts.sort((e,t)=>new Date(t.date)-new Date(e.date)),os=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"12:00 PM";try{const n="".concat(e," ").concat(t),r=new Date(n);return isNaN(r.getTime())?new Date(e):r}catch(n){return console.error("Error parsing date:",e,t,n),new Date}},ls=e=>{var t;const n=os(e.date,e.time);let r=n;return r=e.endTime?os(e.date,e.endTime):new Date(n.getTime()+72e5),{title:e.title||"",description:e.description||"",longDescription:e.longDescription||e.description||"",startDate:n,endDate:r,location:e.location||"",address:e.address||"",isVirtual:"virtual"===e.eventType||(null===(t=e.location)||void 0===t?void 0:t.toLowerCase().includes("virtual"))||!1,virtualPlatform:e.virtualPlatform||(e.isVirtual?"Zoom":""),virtualLink:e.virtualLink||"",maxAttendees:e.maxAttendees||100,eventType:e.eventType||"Networking",featured:e.featured||!1,image:e.image||"/images/events/event-placeholder.png",pricing:{member:e.memberPrice||0,nonMember:e.nonMemberPrice||25,sponsorDiscount:e.sponsorDiscount||10},ticketTypes:e.ticketTypes||[{id:"member",name:"Member",price:e.memberPrice||0,description:"For APN members",memberOnly:!0},{id:"non-member",name:"Non-Member",price:e.nonMemberPrice||25,description:"For non-members",memberOnly:!1}],sponsors:e.sponsors||[],registrationDeadline:e.registrationDeadline?new Date(e.registrationDeadline):new Date(n.getTime()-864e5),accessDates:e.accessDates||{basic:new Date(n.getTime()-6048e5).toISOString(),bronze:new Date(n.getTime()-12096e5).toISOString(),silver:new Date(n.getTime()-18144e5).toISOString(),gold:new Date(n.getTime()-24192e5).toISOString()},agenda:e.agenda||"",speakers:e.speakers||[],requirements:e.requirements||"",attendees:e.attendees||[],registrations:[],status:"active",createdAt:(0,vt.serverTimestamp)(),updatedAt:(0,vt.serverTimestamp)(),originalId:e.id}},cs=async()=>{try{console.log("\ud83d\uddd1\ufe0f Clearing existing events...");const e=(0,vt.collection)(yt.db,"events"),t=await(0,vt.getDocs)(e),n=t.docs.map(e=>(0,vt.kd)(e.ref));return await Promise.all(n),console.log("\u2705 Cleared ".concat(t.size," existing events")),t.size}catch(e){throw console.error("\u274c Error clearing events:",e),e}},ds=async()=>{try{console.log("\ud83d\udcc5 Migrating upcoming events...");const t=(0,vt.collection)(yt.db,"events");let n=0,r=0;for(const s of ns)try{const e=ls(s);await(0,vt.addDoc)(t,e),console.log("\u2705 Migrated upcoming event: ".concat(s.title)),n++}catch(e){console.error("\u274c Error migrating event ".concat(s.title,":"),e),r++}return console.log("\ud83d\udcca Upcoming events migration complete: ".concat(n," success, ").concat(r," errors")),{successCount:n,errorCount:r}}catch(e){throw console.error("\u274c Error migrating upcoming events:",e),e}},us=async()=>{try{console.log("\ud83d\udcda Migrating past events...");const t=(0,vt.collection)(yt.db,"events");let n=0,r=0;const s=is();for(const a of s)try{const e=ls(a);e.status="completed",await(0,vt.addDoc)(t,e),console.log("\u2705 Migrated past event: ".concat(a.title)),n++}catch(e){console.error("\u274c Error migrating event ".concat(a.title,":"),e),r++}return console.log("\ud83d\udcca Past events migration complete: ".concat(n," success, ").concat(r," errors")),{successCount:n,errorCount:r}}catch(e){throw console.error("\u274c Error migrating past events:",e),e}},ms=()=>{const{hasRole:t}=sn(),[n,r]=(0,e.useState)(!1),[s,a]=(0,e.useState)(null),[i,o]=(0,e.useState)("");if(!t("admin"))return(0,nn.jsx)("div",{className:"max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:(0,nn.jsx)("div",{className:"bg-red-50 border border-red-200 rounded-md p-4",children:(0,nn.jsx)("p",{className:"text-red-800",children:"Access denied. Admin privileges required."})})});const l=async e=>{r(!0),o(""),a(null);try{let t;switch(e){case"full":t=await async function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];try{console.log("\ud83d\ude80 Starting events migration...");let t=0;e&&(t=await cs());const n=await ds(),r=await us(),s=n.successCount+r.successCount,a=n.errorCount+r.errorCount;return console.log("\ud83c\udf89 Events migration complete!"),console.log("\ud83d\udcca Summary: ".concat(s," events migrated, ").
2concat(a," errors, ").concat(t," cleared")),{cleared:t,migrated:s,errors:a,upcoming:n,past:r}}catch(i){throw console.error("\u274c Events migration failed:",i),i}}(!0);break;case"upcoming":t=await ds();break;case"past":t=await us();break;case"clear":t={cleared:await cs(),migrated:0,errors:0};break;default:throw new Error("Invalid migration type")}a(t)}catch(t){console.error("Migration error:",t),o(t.message||"Migration failed")}finally{r(!1)}};return(0,nn.jsx)("div",{className:"max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:(0,nn.jsxs)("div",{className:"bg-white rounded-lg shadow p-6",children:[(0,nn.jsx)("h1",{className:"text-2xl font-bold text-gray-900 mb-6",children:"Events Migration Tool"}),(0,nn.jsxs)("div",{className:"mb-6",children:[(0,nn.jsx)("p",{className:"text-gray-600 mb-4",children:"This tool migrates event data from static files to Firebase. Choose the migration type below:"}),(0,nn.jsx)("div",{className:"bg-yellow-50 border border-yellow-200 rounded-md p-4 mb-6",children:(0,nn.jsxs)("div",{className:"flex",children:[(0,nn.jsx)("svg",{className:"w-5 h-5 text-yellow-400 mr-2",fill:"currentColor",viewBox:"0 0 20 20",children:(0,nn.jsx)("path",{fillRule:"evenodd",d:"M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z",clipRule:"evenodd"})}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("h3",{className:"text-sm font-medium text-yellow-800",children:"Warning"}),(0,nn.jsx)("p",{className:"text-sm text-yellow-700 mt-1",children:"Full migration will clear all existing events in Firebase. Make sure you have a backup if needed."})]})]})})]}),(0,nn.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-6",children:[(0,nn.jsx)("button",{onClick:()=>l("full"),disabled:n,className:"bg-blue-600 text-white px-6 py-3 rounded-lg hover:bg-blue-700 transition duration-200 disabled:opacity-50 disabled:cursor-not-allowed",children:n?"Migrating...":"Full Migration (Clear + All Events)"}),(0,nn.jsx)("button",{onClick:()=>l("upcoming"),disabled:n,className:"bg-green-600 text-white px-6 py-3 rounded-lg hover:bg-green-700 transition duration-200 disabled:opacity-50 disabled:cursor-not-allowed",children:n?"Migrating...":"Migrate Upcoming Events Only"}),(0,nn.jsx)("button",{onClick:()=>l("past"),disabled:n,className:"bg-purple-600 text-white px-6 py-3 rounded-lg hover:bg-purple-700 transition duration-200 disabled:opacity-50 disabled:cursor-not-allowed",children:n?"Migrating...":"Migrate Past Events Only"}),(0,nn.jsx)("button",{onClick:()=>l("clear"),disabled:n,className:"bg-red-600 text-white px-6 py-3 rounded-lg hover:bg-red-700 transition duration-200 disabled:opacity-50 disabled:cursor-not-allowed",children:n?"Clearing...":"Clear All Events"})]}),i&&(0,nn.jsx)("div",{className:"mb-6 p-4 bg-red-50 border border-red-200 rounded-md",children:(0,nn.jsxs)("p",{className:"text-red-800",children:["\u274c Error: ",i]})}),s&&(0,nn.jsxs)("div",{className:"mb-6 p-4 bg-green-50 border border-green-200 rounded-md",children:[(0,nn.jsx)("h3",{className:"text-lg font-semibold text-green-800 mb-2",children:"Migration Results"}),(0,nn.jsxs)("div",{className:"text-green-700",children:[void 0!==s.cleared&&(0,nn.jsxs)("p",{children:["\ud83d\uddd1\ufe0f Cleared: ",s.cleared," events"]}),void 0!==s.migrated&&(0,nn.jsxs)("p",{children:["\u2705 Migrated: ",s.migrated," events"]}),void 0!==s.errors&&s.errors>0&&(0,nn.jsxs)("p",{children:["\u274c Errors: ",s.errors]}),s.upcoming&&(0,nn.jsxs)("p",{children:["\ud83d\udcc5 Upcoming: ",s.upcoming.successCount," success, ",s.upcoming.errorCount," errors"]}),s.past&&(0,nn.jsxs)("p",{children:["\ud83d\udcda Past: ",s.past.successCount," success, ",s.past.errorCount," errors"]})]})]}),(0,nn.jsxs)("div",{className:"bg-blue-50 border border-blue-200 rounded-md p-4",children:[(0,nn.jsx)("h3",{className:"text-sm font-medium text-blue-800 mb-2",children:"Next Steps After Migration:"}),(0,nn.jsxs)("ol",{className:"text-sm text-blue-700 space-y-1 list-decimal list-inside",children:[(0,nn.jsx)("li",{children:"Check the Events page to verify data loaded correctly"}),(0,nn.jsx)("li",{children:"Test event detail pages and registration functionality"}),(0,nn.jsx)("li",{children:"Update the Events page to use Firebase data instead of static files"}),(0,nn.jsx)("li",{children:"Test admin event creation and management features"})]})]})]})})},hs=()=>{const{isAdmin:t}=sn(),[n,r]=(0,e.useState)(!1),[s,a]=(0,e.useState)("");return t()?(0,nn.jsx)("div",{className:"min-h-screen bg-gray-50 py-8",children:(0,nn.jsx)("div",{className:"max-w-4xl mx-auto px-4 sm:px-6 lg:px-8",children:(0,nn.jsxs)("div",{className:"bg-white rounded-lg shadow p-6",children:[(0,nn.jsx)("h1",{className:"text-2xl font-bold text-gray-900 mb-6",children:"Event Cleanup Tool"}),s&&(0,nn.jsx)("div",{className:"p-4 rounded-lg mb-6 ".concat(s.includes("\u2705")?"bg-green-50 text-green-800":s.includes("\u274c")?"bg-red-50 text-red-800":"bg-blue-50 text-blue-800"),children:s}),(0,nn.jsxs)("div",{className:"space-y-6",children:[(0,nn.jsxs)("div",{className:"border border-gray-200 rounded-lg p-6",children:[(0,nn.jsx)("h2",{className:"text-lg font-semibold text-gray-900 mb-3",children:"Clear Test Events"}),(0,nn.jsx)("p",{className:"text-gray-600 mb-4",children:"Remove all test events from 2025-2026. This will keep all real past events from 2022-2023."}),(0,nn.jsx)("button",{onClick:async()=>
2{if(t()){if(window.confirm("Are you sure you want to delete all test events (2025-2026)? This cannot be undone.")){r(!0),a("\ud83d\uddd1\ufe0f Clearing test events...");try{const e=await(async()=>{try{console.log("\ud83d\uddd1\ufe0f Clearing test events...");const e=(0,vt.collection)(yt.db,"events"),t=await(0,vt.getDocs)(e),n=[3,4,5,6,7,8],r=[];return t.docs.forEach(e=>{const t=e.data();(n.includes(t.id)||t.date&&(t.date.includes("2025")||t.date.includes("2026")))&&(r.push((0,vt.kd)(e.ref)),console.log("\ud83d\uddd1\ufe0f Deleting test event: ".concat(t.title)))}),await Promise.all(r),console.log("\u2705 Cleared ".concat(r.length," test events")),r.length}catch(e){throw console.error("\u274c Error clearing test events:",e),e}})();a("\u2705 Successfully deleted ".concat(e," test events!"))}catch(e){console.error("Error clearing test events:",e),a("\u274c Error: ".concat(e.message))}finally{r(!1)}}}else a("\u274c Admin access required")},disabled:n,className:"bg-orange-600 text-white px-4 py-2 rounded-lg hover:bg-orange-700 disabled:opacity-50",children:n?"Clearing...":"Clear Test Events"})]}),(0,nn.jsxs)("div",{className:"border border-red-200 rounded-lg p-6 bg-red-50",children:[(0,nn.jsx)("h2",{className:"text-lg font-semibold text-red-900 mb-3",children:"\u26a0\ufe0f Clear All Events"}),(0,nn.jsxs)("p",{className:"text-red-700 mb-4",children:[(0,nn.jsx)("strong",{children:"DANGER:"})," This will delete ALL events including past events. Only use this for a complete reset."]}),(0,nn.jsx)("button",{onClick:async()=>{if(t()){if(window.confirm("\u26a0\ufe0f WARNING: This will delete ALL events including past events. Are you absolutely sure?")){r(!0),a("\ud83d\uddd1\ufe0f Clearing all events...");try{const e=await cs();a("\u2705 Successfully deleted ".concat(e," events!"))}catch(e){console.error("Error clearing all events:",e),a("\u274c Error: ".concat(e.message))}finally{r(!1)}}}else a("\u274c Admin access required")},disabled:n,className:"bg-red-600 text-white px-4 py-2 rounded-lg hover:bg-red-700 disabled:opacity-50",children:n?"Clearing...":"Clear All Events"})]})]}),(0,nn.jsxs)("div",{className:"mt-8 p-4 bg-blue-50 rounded-lg",children:[(0,nn.jsx)("h3",{className:"font-semibold text-blue-900 mb-2",children:"Instructions:"}),(0,nn.jsxs)("ol",{className:"list-decimal list-inside text-blue-800 space-y-1",children:[(0,nn.jsx)("li",{children:'Use "Clear Test Events" to remove only the 2025-2026 placeholder events'}),(0,nn.jsx)("li",{children:"This will keep all real past events from the original APN website"}),(0,nn.jsx)("li",{children:"After clearing, you can add new real upcoming events through the admin interface"}),(0,nn.jsx)("li",{children:'Only use "Clear All Events" if you want to start completely fresh'})]})]})]})})}):(0,nn.jsx)("div",{className:"min-h-screen bg-gray-50 py-8",children:(0,nn.jsx)("div",{className:"max-w-4xl mx-auto px-4 sm:px-6 lg:px-8",children:(0,nn.jsxs)("div",{className:"bg-white rounded-lg shadow p-6",children:[(0,nn.jsx)("h1",{className:"text-2xl font-bold text-red-600 mb-4",children:"Access Denied"}),(0,nn.jsx)("p",{children:"You need admin privileges to access this page."})]})})})},ps=[{id:1,title:"APN Q1 NEWSLETTER",image:"/images/news/q1-newsletter.png",date:"April 15, 2022",author:"Caroline Burnham",category:"News",featured:!0,excerpt:"Check out our Q1 newsletter with updates on recent events and upcoming opportunities.",content:'\n <div class="news-content">\n <h2 class="text-2xl font-bold mb-4">WE ARE LIVE!</h2>\n <p class="mb-4">We are proud to announce that our website is now accessible to all prospective members of APN. Current features that we have rolled out include the membership and event registration pages, in addition to articles that detail updates about our members, general network announcements, and notifications about new events.</p>\n \n <h2 class="text-2xl font-bold mb-4">Join us for our first IN-PERSON event!</h2>\n <p class="mb-6">APN is excited to be hosting our first event at Printers Alley on Tuesday, April 12th from 6:30-8:30pm. Check out the Events page to register.</p>\n \n <h2 class="text-2xl font-bold mb-4">
2MEMBERSHIP</h2>\n <p class="mb-6">Prospective members can now register to become an official part of the Accelerated Professionals Network. Membership will be on a tiered system, so make sure to register for the correct one! All details are on the Membership page. Feel free to contact Cara with any questions.</p>\n \n <h2 class="text-2xl font-bold mb-4">Recommended Business Books</h2>\n <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-6">\n <div class="bg-gray-100 p-4 rounded-lg">\n <h3 class="font-bold mb-2">Rich Dad Poor Dad</h3>\n <p>A classic personal finance book that teaches important lessons about money and investing.</p>\n </div>\n <div class="bg-gray-100 p-4 rounded-lg">\n <h3 class="font-bold mb-2">How to Win Friends and Influence People</h3>\n <p>Dale Carnegie\'s timeless advice on building relationships and effective communication.</p>\n </div>\n </div>\n </div>\n ',featured:!0,status:"published"},{id:2,title:"APN Network Growth Update",image:"/images/news/network-growth.png",date:"June 20, 2022",author:"APN Team",category:"News",excerpt:"Our network continues to grow with new members joining from top financial institutions.",content:'\n <div class="news-content">\n <h2 class="text-2xl font-bold mb-4">Network Expansion</h2>\n <p class="mb-4">We\'re excited to share that APN has welcomed over 200 new members in the past quarter, representing professionals from leading financial institutions including Goldman Sachs, Morgan Stanley, BlackRock, and many others.</p>\n \n <h2 class="text-2xl font-bold mb-4">New Features</h2>\n <p class="mb-4">Based on member feedback, we\'ve launched several new features including enhanced networking tools, industry-specific groups, and improved event management capabilities.</p>\n \n <h2 class="text-2xl font-bold mb-4">Upcoming Events</h2>\n <p class="mb-4">Mark your calendars for our upcoming events in Chicago, New York, and our first virtual networking session.</p>\n </div>\n ',featured:!1,status:"published"},{id:3,title:"Industry Insights: M&A Trends 2022",image:"/images/news/ma-trends.png",date:"August 10, 2022",author:"Michael Chen",category:"Feature",excerpt:"An in-depth analysis of current M&A trends and what they mean for finance professionals.",content:'\n <div class="news-content">\n <h2 class="text-2xl font-bold mb-4">M&A Market Overview</h2>\n <p class="mb-4">The M&A market in 2022 has shown resilience despite economic uncertainties. Deal volumes remain strong across key sectors including technology, healthcare, and financial services.</p>\n \n <h2 class="text-2xl font-bold mb-4">Key Trends</h2>\n <ul class="list-disc list-inside mb-4">\n <li>Increased focus on ESG considerations in deal structuring</li>\n <li>Rise of special purpose acquisition companies (SPACs)</li>\n <li>Cross-border transactions gaining momentum</li>\n <li>Technology-driven due diligence processes</li>\n </ul>\n \n <h2 class="text-2xl font-bold mb-4">Career Implications</h2>\n <p class="mb-4">These trends present new opportunities for finance professionals to develop specialized skills in ESG analysis, technology integration, and cross-border regulatory compliance.</p>\n </div>\n ',featured:!0,status:"published"},{id:4,title:"APN Chicago Event Recap",image:"/images/news/chicago-recap.png",date:"September 15, 2022",author:"Sarah Johnson",category:"Events",excerpt:"Highlights from our successful Chicago networking event with over 150 attendees.",content:'\n <div class="news-content">\n <h2 class="text-2xl font-bold mb-4">Event Success</h2>\n <p class="mb-4">Our Chicago networking event was a tremendous success, bringing together over 150 finance professionals from across the Midwest region.</p>\n \n <h2 class="text-2xl font-bold mb-4">Key Highlights</h2>\n <ul class="list-disc list-inside mb-4">\n <li>Panel discussion on "Future of Investment Banking"</li>\n <li>Networking sessions with industry leaders</li>\n <li>Career development workshops</li>\n <li>New member welcome reception</li>\n </ul>\n \n <h2 class="text-2xl font-bold mb-4">Thank You</h2>\n <p class="mb-4">Special thanks to our sponsors Goldman Sachs, BlackRock, and Citi for making this event possible.</p>\n </div>\n ',featured:!1,status:"published"}],gs=e=>{const t=(e=>{try{return new Date(e)}catch(t){return console.error("Error parsing date:",e,t),new Date}})(e.date);return{title:e.title||"",excerpt:e.excerpt||"",content:e.content||"",author:e.author||"APN Team",category:e.category||"News",image:e.image||"/images/news/default-news.png",featured:e.featured||!1,status:e.status||"published",views:0,likes:0,comments:[],slug:e.title.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,""),tags:e.tags||[],metaDescription:e.excerpt||"",publishedAt:t,createdAt:(0,vt.serverTimestamp)(),updatedAt:(0,vt.serverTimestamp)(),originalId:e.id}},fs=async()=>{try{console.log("\ud83d\uddd1\ufe0f Clearing existing articles...");const e=(0,vt.collection)(yt.db,"articles"),t=await(0,vt.getDocs)(e),n=t.docs.map(e=>(0,vt.kd)(e.ref));return await Promise.all(n),console.log("\u2705 Cleared ".concat(t.size," existing articles")),t.size}catch(e){throw console.error("\u274c Error clearing articles:",e),e}},xs=async()=>{try{console.log("\ud83d\udcf0 Migrating news articles...");const t=(0,vt.collection)(yt.db,"articles");let n=0,r=0;for(const s of ps)try{const e=gs(s);await(0,vt.addDoc)(t,e),console.log("\u2705 Migrated article: ".concat(s.title)),n++}catch(e){console.error("\u274c Error migrating article ".concat(s.title,":"),e),r++}return console.log("\ud83d\udcca News migration complete: ".concat(n," success, ").concat(r," errors")),{successCount:n,errorCount:r}}catch(e){throw console.error("\u274c Error migrating news articles:",e),e}},bs=()=>{const{hasRole:t}=sn(),[n,r]=(0,e.useState)(!1),[s,a]=(0,e.useState)(null),[i,o]=(0,e.useState)("");if(!t("admin"))return(0,nn.jsx)("div",{className:"max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:(0,nn.jsx)("div",{className:"bg-red-50 border border-red-200 rounded-md p-4",children:(0,nn.jsx)("p",{className:"text-red-800",children:"Access denied. Admin privileges required."})})});const l=async e=>{r(!0),o(""),a(null);try{let t;switch(e){case"full":t=await async function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];try{console.log("\ud83d\ude80 Starting news migration...");let t=0;e&&(t=await fs());const n=await xs();return console.log("\ud83c\udf89 News migration complete!"),console.log("\ud83d\udcca Summary: ".concat(n.successCount," articles migrated, ").
2concat(n.errorCount," errors, ").concat(t," cleared")),{cleared:t,migrated:n.successCount,errors:n.errorCount}}catch(i){throw console.error("\u274c News migration failed:",i),i}}(!0);break;case"articles":t=await xs();break;case"clear":t={cleared:await fs(),migrated:0,errors:0};break;default:throw new Error("Invalid migration type")}a(t)}catch(t){console.error("Migration error:",t),o(t.message||"Migration failed")}finally{r(!1)}};return(0,nn.jsx)("div",{className:"max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:(0,nn.jsxs)("div",{className:"bg-white rounded-lg shadow p-6",children:[(0,nn.jsx)("h1",{className:"text-2xl font-bold text-gray-900 mb-6",children:"News Migration Tool"}),(0,nn.jsxs)("div",{className:"mb-6",children:[(0,nn.jsx)("p",{className:"text-gray-600 mb-4",children:"This tool migrates news articles from static data to Firebase. Choose the migration type below:"}),(0,nn.jsx)("div",{className:"bg-yellow-50 border border-yellow-200 rounded-md p-4 mb-6",children:(0,nn.jsxs)("div",{className:"flex",children:[(0,nn.jsx)("svg",{className:"w-5 h-5 text-yellow-400 mr-2",fill:"currentColor",viewBox:"0 0 20 20",children:(0,nn.jsx)("path",{fillRule:"evenodd",d:"M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z",clipRule:"evenodd"})}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("h3",{className:"text-sm font-medium text-yellow-800",children:"Warning"}),(0,nn.jsx)("p",{className:"text-sm text-yellow-700 mt-1",children:"Full migration will clear all existing articles in Firebase. Make sure you have a backup if needed."})]})]})})]}),(0,nn.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 mb-6",children:[(0,nn.jsx)("button",{onClick:()=>l("full"),disabled:n,className:"bg-blue-600 text-white px-6 py-3 rounded-lg hover:bg-blue-700 transition duration-200 disabled:opacity-50 disabled:cursor-not-allowed",children:n?"Migrating...":"Full Migration (Clear + All Articles)"}),(0,nn.jsx)("button",{onClick:()=>l("articles"),disabled:n,className:"bg-green-600 text-white px-6 py-3 rounded-lg hover:bg-green-700 transition duration-200 disabled:opacity-50 disabled:cursor-not-allowed",children:n?"Migrating...":"Migrate Articles Only"}),(0,nn.jsx)("button",{onClick:()=>l("clear"),disabled:n,className:"bg-red-600 text-white px-6 py-3 rounded-lg hover:bg-red-700 transition duration-200 disabled:opacity-50 disabled:cursor-not-allowed",children:n?"Clearing...":"Clear All Articles"})]}),i&&(0,nn.jsx)("div",{className:"mb-6 p-4 bg-red-50 border border-red-200 rounded-md",children:(0,nn.jsxs)("p",{className:"text-red-800",children:["\u274c Error: ",i]})}),s&&(0,nn.jsxs)("div",{className:"mb-6 p-4 bg-green-50 border border-green-200 rounded-md",children:[(0,nn.jsx)("h3",{className:"text-lg font-semibold text-green-800 mb-2",children:"Migration Results"}),(0,nn.jsxs)("div",{className:"text-green-700",children:[void 0!==s.cleared&&(0,nn.jsxs)("p",{children:["\ud83d\uddd1\ufe0f Cleared: ",s.cleared," articles"]}),void 0!==s.migrated&&(0,nn.jsxs)("p",{children:["\u2705 Migrated: ",s.migrated," articles"]}),void 0!==s.errors&&s.errors>0&&(0,nn.jsxs)("p",{children:["\u274c Errors: ",s.errors]})]})]}),(0,nn.jsxs)("div",{className:"bg-blue-50 border border-blue-200 rounded-md p-4",children:[(0,nn.jsx)("h3",{className:"text-sm font-medium text-blue-800 mb-2",children:"Sample Articles Included:"}),(0,nn.jsxs)("ul",{className:"text-sm text-blue-700 space-y-1 list-disc list-inside",children:[(0,nn.jsx)("li",{children:"APN Q1 Newsletter"}),(0,nn.jsx)("li",{children:"Network Growth Update"}),(0,nn.jsx)("li",{children:"Industry Insights: M&A Trends 2022"}),(0,nn.jsx)("li",{children:"APN Chicago Event Recap"})]}),(0,nn.jsx)("h3",{className:"text-sm font-medium text-blue-800 mb-2 mt-4",children:"Next Steps After Migration:"}),(0,nn.jsxs)("ol",{className:"text-sm text-blue-700 space-y-1 list-decimal list-inside",children:[(0,nn.jsx)("li",{children:"Check the News page to verify data loaded correctly"}),(0,nn.jsx)("li",{children:"Test news article detail pages"}),(0,nn.jsx)("li",{children:"Update the News page to use Firebase data instead of static files"}),(0,nn.jsx)("li",{children:"Test admin article creation and management features"})]})]})]})})},ys=e=>{const{title:t,excerpt:n,articleUrl:r}=e,s=("".concat(t,"\n\n").concat(n,"\n\n#APN #Finance #Professionals #Networking"),"https://www.linkedin.com/sharing/share-offsite/?url=".concat(encodeURIComponent(r),"&title=").concat(encodeURIComponent(t),"&summary=").concat(encodeURIComponent(n)));return window.open(s,"linkedin-share","width=600,height=400,scrollbars=yes,resizable=yes")},vs=()=>{const{hasRole:t}=sn(),[n,r]=(0,e.useState)([]),[a,i]=(0,e.useState)(!0),[o,l]=(0,e.useState)(!1),[c,d]=(0,e.useState)(null),[u,m]=(0,e.useState)(null),[h,p]=(0,e.useState)([]),[g,f]=(0,e.useState)({title:"",excerpt:"",content:"",category:"News",author:"",image:"",featured:!1,status:"published",postToLinkedIn:!1}),x=t("admin");(0,e.useEffect)(()=>{x&&b()},[x]);const b=async()=>{try{i(!0);const e=await(0,wn.GE)(50,null,!0);r(e),console.log("Loaded articles for admin:",e)}catch(e){console.error("Error loading articles:",e)}finally{i(!1)}},y=async e=>{try{const t=await(0,wn.fz)(e);p(t)}catch(t){console.error("Error loading comments:",t)}};return x?a?(0,nn.jsx)("div",{className:"flex justify-center items-center min-h-screen",children:(0,nn.jsx)("div",{className:"animate-spin rounded-full h-12 w-12 border-t-2 border-b-2 border-apn-blue"})}):(0,nn.jsxs)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:[(0,nn.jsxs)("div",{className:"mb-8",children:[(0,nn.jsx)("h1",{className:"text-3xl font-bold text-gray-900",children:"News Management"}),(0,nn.jsx)("p",{className:"mt-2 text-gray-600",children:"Manage news articles and comments"})]}),(0,nn.jsxs)("div",{className:"mb-6 flex space-x-4",children:[(0,nn.jsx)("button",{onClick:()=>{l(!o),d(null),f({title:"",excerpt:"",content:"",category:"News",author:"",image:"",featured:!1,status:"published",postToLinkedIn:!1})},className:"bg-apn-blue text-white px-4 py-2 rounded-md hover:bg-blue-700 transition-colors",children:o?"Cancel":"Create New Art
2icle"}),(0,nn.jsx)("button",{onClick:b,className:"bg-gray-600 text-white px-4 py-2 rounded-md hover:bg-gray-700 transition-colors",children:"Refresh"})]}),o&&(0,nn.jsxs)("div",{className:"bg-white shadow rounded-lg p-6 mb-8",children:[(0,nn.jsx)("h2",{className:"text-xl font-bold mb-4",children:c?"Edit Article":"Create New Article"}),(0,nn.jsxs)("form",{onSubmit:async e=>{e.preventDefault();try{const e=(0,s.A)((0,s.A)({},g),{},{publishedAt:(0,vt.serverTimestamp)(),likeCount:0,commentCount:0,views:0});let n;if(c?(await(0,wn.iZ)(c.id,e),n=c.id):n=await(0,wn.N6)(e),g.postToLinkedIn&&"published"===g.status)try{const e="".concat(window.location.origin,"/news/").concat(n),t={title:g.title,excerpt:g.excerpt,articleUrl:e,imageUrl:g.image?"".concat(window.location.origin).concat(g.image):null};ys(t),alert("Article saved and LinkedIn share dialog opened!")}catch(t){console.error("Error posting to LinkedIn:",t),alert("Article saved successfully, but LinkedIn posting failed. You can manually share the article.")}f({title:"",excerpt:"",content:"",category:"News",author:"",image:"",featured:!1,status:"published",postToLinkedIn:!1}),l(!1),d(null),await b()}catch(n){console.error("Error saving article:",n),alert("Error saving article. Please try again.")}},className:"space-y-4",children:[(0,nn.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Title *"}),(0,nn.jsx)("input",{type:"text",value:g.title,onChange:e=>f((0,s.A)((0,s.A)({},g),{},{title:e.target.value})),className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue",required:!0})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Author *"}),(0,nn.jsx)("input",{type:"text",value:g.author,onChange:e=>f((0,s.A)((0,s.A)({},g),{},{author:e.target.value})),className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue",required:!0})]})]}),(0,nn.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Category"}),(0,nn.jsxs)("select",{value:g.category,onChange:e=>f((0,s.A)((0,s.A)({},g),{},{category:e.target.value})),className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue",children:[(0,nn.jsx)("option",{value:"News",children:"News"}),(0,nn.jsx)("option",{value:"Feature",children:"Feature"}),(0,nn.jsx)("option",{value:"Announcement",children:"Announcement"})]})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Status"}),(0,nn.jsxs)("select",{value:g.status,onChange:e=>f((0,s.A)((0,s.A)({},g),{},{status:e.target.value})),className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue",children:[(0,nn.jsx)("option",{value:"published",children:"Published"}),(0,nn.jsx)("option",{value:"draft",children:"Draft"})]})]}),(0,nn.jsxs)("div",{className:"flex flex-col space-y-2",children:[(0,nn.jsxs)("label",{className:"flex items-center",children:[(0,nn.jsx)("input",{type:"checkbox",checked:g.featured,onChange:e=>f((0,s.A)((0,s.A)({},g),{},{featured:e.target.checked})),className:"mr-2"}),(0,nn.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Featured Article"})]}),(0,nn.jsxs)("label",{className:"flex items-center",children:[(0,nn.jsx)("input",{type:"checkbox",checked:g.postToLinkedIn,onChange:e=>f((0,s.A)((0,s.A)({},g),{},{postToLinkedIn:e.target.checked})),className:"mr-2"}),(0,nn.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Share on LinkedIn"})]})]})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Image URL"}),(0,nn.jsx)("input",{type:"text",value:g.image,onChange:e=>f((0,s.A)((0,s.A)({},g),{},{image:e.target.value})),className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue",placeholder:"/images/news/article-image.jpg"})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Excerpt *"}),(0,nn.jsx)("textarea",{value:g.excerpt,onChange:e=>f((0,s.A)((0,s.A)({},g),{},{excerpt:e.target.value})),className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue",rows:"3",required:!0})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Content *"}),(0,nn.jsx)("textarea",{value:g.content,onChange:e=>f((0,s.A)((0,s.A)({},g),{},{content:e.target.value})),className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue",rows:"10",required:!0})]}),(0,nn.jsxs)("div",{className:"flex space-x-4",children:[(0,nn.jsx)("button",{type:"submit",className:"bg-apn-blue text-white px-6 py-2 rounded-md hover:bg-blue-700 transition-colors",children:c?"Update Article":"Create Article"}),(0,nn.jsx)("button",{type:"button",onClick:()=>{l(!1),d(null)},className:"bg-gray-600 text-white px-6 py-2 rounded-md hover:bg-gray-700 transition-colors",children:"Cancel"})]})]})]}),(0,nn.jsxs)("div",{className:"bg-white shadow rounded-lg overflow-hidden",children:[(0,nn.jsx)("div",{className:"px-6 py-4 border-b border-gray-200",children:(0,nn.jsxs)("h2",{className:"text-lg font-medium text-gray-900",children:["Articles (",n.length,")"]})}),(0,nn.jsx)("div",{className:"overflow-x-auto",children:(0,nn.jsxs)("table",{className:"min-w-full divide-y divide-gray-200",children:[(0,nn.jsx)("thead",{className:"bg-gray-50",children:(0,nn.jsxs)("tr",{children:[(0,nn.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Article"}),(0,nn.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Category"}),(0,nn.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Status"}),(0,nn.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Stats"}),(0,nn.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Actions"})]})}),(0,nn.jsx)("tbody",{className:"bg-white divide-y divide-gray-200",children:n.map(e=>{var t,n,r;return(0,nn.jsxs)("tr",{children:[(0,nn.jsx)("td",{className:"px-6 py-4 whitespace-nowrap",children:(0,nn.jsx)("div",{className:"flex items-center",children:(0,nn.jsxs)("div",{children:[(0,nn.jsx)("div",{className:"text-sm font-medium text-gray-900",children:e.title}),(0,nn.jsxs)("div",{className:"text-sm text-gray-500",children:["By ",e.author," \u2022 ",(null===(t=e.publishedAt)||void 0===t||null===(n=t.toDate)||void 0===n||null===(r=n.call(t))||void 0===r?void 0:r.toLocaleDateString())||e.date]})]})})}),(0,nn.jsxs)("td",{className:"px-6 py-4 whitespace-nowrap",children:[(0,nn.jsx)("span",{className:"inline-flex px-2 py-1 text-xs font-semibold rounded-full ".concat("Feature"===e.category?"bg-purple-100 text-purple-800":"News"===e.category?"bg-blue-100 text-blue-800":"bg-green-100 text-green-800"),children:e.category}),e.featured&&(0,nn.jsx)("span",{className:"ml-2 inline-flex px-2 py-1 text-xs font-semibold rounded-full bg-yellow-100 text-yellow-800",children:"Featured"})]}),(0,nn.jsx)("td",{className:"px-6 py-4 whitespace-nowrap",children:(0,nn.jsx)("span",{className:"inline-flex px-2 py-1 text-xs font-semibold rounded-full ".concat("published"===e.status?"bg-green-100 text-green-800":"bg-gray-100 text-gray-800"),children:e.status})}),(0,nn.jsxs)("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:[(0,nn.jsxs)("div",{children:["Views: ",e.views||0]}),(0,nn.jsxs)("div",{children:["Likes: ",e.likeCount||0]}),(0,nn.jsxs)("div",{children:["Comments: ",e.commentCount||0]})]}),(0,nn.jsxs)("td",{className:"px-6 py-4 whitespace-nowrap text-sm font-medium space-x-2",children:[(0,nn.jsx)("button",{onClick:()=>(e=>{d(e),f({title:e.title||"",excerpt:e.excerpt||"",content:e.content||"",category:e.category||"News",author:e.author||"",image:e.image||"",featured:e.featured||!1,status:e.status||"published",postToLinkedIn:!1}),l(!0)})(e),className:"text-apn-blue hover:text-blue-700",children:"Edit"}),(0,nn.jsxs)("button",{onClick:()=>(async e=>{m(e),await y(e.id)})(e),className:"text-green-600 hover:text-green-700",children:["Comments (",e.commentCount||0,")"]}),(0,nn.jsx)("button",{onClick:()=>(async e=>{if(window.confirm("Are you sure you want to delete this article? This will also delete all c
2omments and cannot be undone."))try{await(0,wn.a)(e),await b(),(0,Rr.oc)("Article deleted successfully.")}catch(t){(0,Rr.H4)(t,{context:{component:"NewsManagement",action:"deleteArticle",articleId:e}})}})(e.id),className:"text-red-600 hover:text-red-700",children:"Delete"})]})]},e.id)})})]})})]}),u&&(0,nn.jsx)("div",{className:"fixed inset-0 bg-gray-600 bg-opacity-50 overflow-y-auto h-full w-full z-50",children:(0,nn.jsx)("div",{className:"relative top-20 mx-auto p-5 border w-11/12 md:w-3/4 lg:w-1/2 shadow-lg rounded-md bg-white",children:(0,nn.jsxs)("div",{className:"mt-3",children:[(0,nn.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,nn.jsxs)("h3",{className:"text-lg font-medium text-gray-900",children:['Comments for "',u.title,'"']}),(0,nn.jsx)("button",{onClick:()=>m(null),className:"text-gray-400 hover:text-gray-600",children:"\u2715"})]}),(0,nn.jsx)("div",{className:"max-h-96 overflow-y-auto",children:h.length>0?(0,nn.jsx)("div",{className:"space-y-4",children:h.map(e=>{var t,n,r;return(0,nn.jsxs)("div",{className:"border-b border-gray-200 pb-4",children:[(0,nn.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("span",{className:"font-medium text-gray-900",children:e.authorName}),(0,nn.jsx)("span",{className:"text-sm text-gray-500 ml-2",children:(null===(t=e.createdAt)||void 0===t||null===(n=t.toDate)||void 0===n||null===(r=n.call(t))||void 0===r?void 0:r.toLocaleDateString())||"Recently"})]}),(0,nn.jsx)("button",{onClick:()=>(async(e,t)=>{if(window.confirm("Are you sure you want to delete this comment? This action cannot be undone."))try{await(0,wn.Xf)(e,t),await y(u.id),(0,Rr.oc)("Comment deleted successfully.")}catch(n){(0,Rr.H4)(n,{context:{component:"NewsManagement",action:"deleteComment",commentId:e,articleId:t}})}})(e.id,u.id),className:"text-red-600 hover:text-red-800 text-sm",children:"Delete"})]}),(0,nn.jsx)("p",{className:"text-gray-700",children:e.content}),(0,nn.jsxs)("div",{className:"text-sm text-gray-500 mt-1",children:["Likes: ",e.likeCount||0]})]},e.id)})}):(0,nn.jsx)("p",{className:"text-gray-500 text-center py-8",children:"No comments yet."})})]})})})]}):(0,nn.jsx)("div",{className:"max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:(0,nn.jsx)("div",{className:"bg-red-50 border border-red-200 rounded-md p-4",children:(0,nn.jsx)("p",{className:"text-red-800",children:"Access denied. Admin privileges required."})})})},ws=()=>{const{hasRole:t,currentUser:n,userProfile:r}=sn(),[a,i]=(0,e.useState)({}),o=(t("admin"),(e,t,n)=>{i(r=>(0,s.A)((0,s.A)({},r),{},{["".concat(e,"-").concat(t)]:n}))}),l=e=>{switch(e){case"pass":return"text-green-600 bg-green-100";case"fail":return"text-red-600 bg-red-100";case"warning":return"text-yellow-600 bg-yellow-100";default:return"text-gray-600 bg-gray-100"}},c=e=>{switch(e){case"pass":return"\u2705";case"fail":return"\u274c";case"warning":return"\u26a0\ufe0f";default:return"\u23f3"}};return(0,nn.jsx)("div",{className:"max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:(0,nn.jsxs)("div",{className:"bg-white rounded-lg shadow p-6",children:[(0,nn.jsx)("h1",{className:"text-2xl font-bold text-gray-900 mb-6",children:"\ud83e\uddea APN Site Testing Dashboard"}),(0,nn.jsxs)("div",{className:"mb-8 p-4 bg-blue-50 border border-blue-200 rounded-md",children:[(0,nn.jsx)("h2",{className:"text-lg font-semibold text-blue-900 mb-2",children:"Current User Status"}),(0,nn.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 text-sm",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("span",{className:"font-medium text-blue-800",children:"Email:"}),(0,nn.jsx)("span",{className:"ml-2 text-blue-700",children:(null===n||void 0===n?void 0:n.email)||"Not logged in"})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("span",{className:"font-medium text-blue-800",children:"Role:"}),(0,nn.jsx)("span",{className:"ml-2 text-blue-700",children:(null===r||void 0===r?void 0:r.role)||"None"})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("span",{className:"font-medium text-blue-800",children:"Status:"}),(0,nn.jsx)("span",{className:"ml-2 text-blue-700",children:(null===r||void 0===r?void 0:r.status)||"None"})]})]})]}),(0,nn.jsxs)("div",{className:"mb-8",children:[(0,nn.jsx)("h2",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Qu
2ick Actions"}),(0,nn.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[(0,nn.jsx)(dt,{to:"/admin-setup",className:"bg-purple-600 text-white px-4 py-2 rounded-lg hover:bg-purple-700 transition duration-200 text-center text-sm",children:"Admin Setup Guide"}),(0,nn.jsx)(dt,{to:"/admin/migrate-events",className:"bg-blue-600 text-white px-4 py-2 rounded-lg hover:bg-blue-700 transition duration-200 text-center text-sm",children:"Migrate Events"}),(0,nn.jsx)(dt,{to:"/admin/migrate-news",className:"bg-green-600 text-white px-4 py-2 rounded-lg hover:bg-green-700 transition duration-200 text-center text-sm",children:"Migrate News"}),(0,nn.jsx)(dt,{to:"/admin/seed-data",className:"bg-orange-600 text-white px-4 py-2 rounded-lg hover:bg-orange-700 transition duration-200 text-center text-sm",children:"Seed Data"})]})]}),(0,nn.jsx)("div",{className:"space-y-8",children:[{id:"authentication",title:"\ud83d\udd10 Authentication & User Management",tests:[{id:"login",name:"Login Functionality",url:"/login",status:"pending"},{id:"signup",name:"User Registration",url:"/signup",status:"pending"},{id:"admin-approval",name:"Admin Approval Process",url:"/admin/approval",status:"pending"},{id:"profile",name:"User Profile Management",url:"/profile",status:"pending"}]},{id:"navigation",title:"\ud83e\udded Navigation & Routing",tests:[{id:"home",name:"Home Page",url:"/",status:"pending"},{id:"about",name:"About Pages",url:"/about/our-story",status:"pending"},{id:"events",name:"Events Page",url:"/events",status:"pending"},{id:"news",name:"News Page",url:"/news",status:"pending"},{id:"education",name:"Education Pages",url:"/education/workshops",status:"pending"}]},{id:"member-features",title:"\ud83d\udc65 Member Features (Requires Login)",tests:[{id:"directory",name:"Member Directory",url:"/directory",status:"pending"},{id:"groups",name:"Groups System",url:"/groups",status:"pending"},{id:"job-board",name:"Job Board",url:"/jobs",status:"pending"},{id:"project-board",name:"Project Board",url:"/projects",status:"pending"},{id:"dashboard",name:"Member Dashboard",url:"/dashboard",status:"pending"}]},{id:"admin-features",title:"\u2699\ufe0f Admin Features (Admin Only)",tests:[{id:"admin-dashboard",name:"Admin Dashboard",url:"/admin",status:"pending"},{id:"data-seeder",name:"Data Seeding",url:"/admin/seed-data",status:"pending"},{id:"events-migration",name:"Events Migration",url:"/admin/migrate-events",status:"pending"},{id:"news-migration",name:"News Migration",url:"/admin/migrate-news",status:"pending"},{id:"firebase-test",name:"Firebase Testing",url:"/admin/test-firebase",status:"pending"}]},{id:"data-integration",title:"\ud83d\udd25 Firebase Data Integration",tests:[{id:"events-firebase",name:"Events from Firebase",url:"/events",status:"pending"},{id:"news-firebase",name:"News from Firebase",url:"/news",status:"pending"},{id:"groups-firebase",name:"Groups from Firebase",url:"/groups",status:"pending"},{id:"jobs-firebase",name:"Jobs from Firebase",url:"/jobs",status:"pending"},{id:"projects-firebase",name:"Projects from Firebase",url:"/projects",status:"pending"}]}].map(e=>(0,nn.jsxs)("div",{className:"border border-gray-200 rounded-lg p-6",children:[(0,nn.jsx)("h2",{className:"text-xl font-semibold text-gray-900 mb-4",children:e.title}),(0,nn.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:e.tests.map(t=>{const n=(r=e.id,s=t.id,a["".concat(r,"-").concat(s)]||"pending");var r,s;return(0,nn.jsxs)("div",{className:"border border-gray-200 rounded-lg p-4",children:[(0,nn.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,nn.jsx)("h3",{className:"font-medium text-gray-900",children:t.name}),(0,nn.jsxs)("span",{className:"px-2 py-1 rounded-full text-xs ".concat(l(n)),children:[c(n)," ",n]})]}),(0,nn.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,nn.jsx)(dt,{to:t.url,className:"text-blue-600 hover:text-blue-800 text-sm underline",target:"_blank",rel:"noopener noreferrer",children:"Test Page"}),(0,nn.jsxs)("div",{className:"flex space-x-1",children:[(0,nn.jsx)("button",{onClick:()=>o(e.id,t.id,"pass"),className:"px-2 py-1 bg-green-100 text-green-700 rounded text-xs hover:bg-green-200",children:"\u2705 Pass"}),(0,nn.jsx)("button",{onClick:()=>o(e.id,t.id,"fail"),className:"px-2 py-1 bg-red-100 text-red-700 rounded text-xs hover:bg-red-200",children:"\u274c Fail"}),(0,nn.jsx)("button",{onClick:()=>
2o(e.id,t.id,"warning"),className:"px-2 py-1 bg-yellow-100 text-yellow-700 rounded text-xs hover:bg-yellow-200",children:"\u26a0\ufe0f Issue"})]})]})]},t.id)})})]},e.id))}),(0,nn.jsxs)("div",{className:"mt-8 bg-gray-50 border border-gray-200 rounded-md p-6",children:[(0,nn.jsx)("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Testing Instructions"}),(0,nn.jsxs)("ol",{className:"list-decimal list-inside space-y-2 text-gray-700",children:[(0,nn.jsx)("li",{children:"Start by setting up admin credentials using the Admin Setup Guide"}),(0,nn.jsx)("li",{children:"Run the Events and News migrations to populate Firebase with data"}),(0,nn.jsx)("li",{children:'Test each page by clicking "Test Page" and verify functionality'}),(0,nn.jsx)("li",{children:"Mark each test as Pass (\u2705), Fail (\u274c), or Issue (\u26a0\ufe0f) based on results"}),(0,nn.jsx)("li",{children:"For member features, ensure you're logged in with an approved account"}),(0,nn.jsx)("li",{children:"For admin features, ensure you have admin role privileges"}),(0,nn.jsx)("li",{children:'Check that Firebase data loads correctly (look for "\ud83d\udd25 Live Data" indicators)'}),(0,nn.jsx)("li",{children:"Test navigation, forms, and user interactions on each page"})]})]})]})})},js=()=>{const{currentUser:t,hasRole:n}=sn(),[r,s]=(0,e.useState)(!1),[a,i]=(0,e.useState)(""),o=n("admin"),l={title:"APN's Grand ReLaunch Event!",description:"Join APN for our Grand ReOpening event for an evening of networking!",longDescription:"\n <p>APN's Grand ReLaunch Event! Join us for an exciting evening of networking, connections, and opportunities as we officially relaunch the Accelerated Professionals Network.</p>\n \n <p>This special event marks a new chapter for APN, bringing together finance professionals from across the industry. Whether you're in investment banking, private equity, wealth management, or any other finance specialty, this is your chance to connect with like-minded professionals and be part of our growing community.</p>\n \n <p>The event will include:</p>\n <ul>\n <li>Welcome reception with cocktails and appetizers</li>\n <li>Networking opportunities with industry professionals</li>\n <li>Presentation on APN's vision and upcoming initiatives</li>\n <li>Interactive discussions and Q&A sessions</li>\n <li>Business card exchange and connection facilitation</li>\n </ul>\n \n <p>Don't miss this opportunity to be part of APN's exciting new beginning!</p>\n ",date:"Wednesday, October 8, 2025 at 6:00 PM",time:"6:00 PM - 9:00 PM",startDate:new Date("2025-10-08T18:00:00-04:00"),endDate:new Date("2025-10-08T21:00:00-04:00"),location:"Jack Doyle's",address:"240 W 35th, New York, NY 10001",image:"/images/events/grand-relaunch-event.jpg",featured:!0,eventType:"in-person",maxAttendees:150,pricing:{member:125,nonMember:160},ticketTypes:[{id:"member",name:"Member Registration",price:125,description:"For current APN members",memberOnly:!0},{id:"non-member",name:"Non-Member Registration",price:160,description:"For non-members",memberOnly:!1}],sponsors:[{id:1,name:"Goldman Sachs",level:"Gold",attendeeLimit:10,additionalAttendeeDiscount:50},{id:2,name:"JP Morgan",level:"Silver",attendeeLimit:6,additionalAttendeeDiscount:25},{id:3,name:"Bank of America",level:"Bronze",attendeeLimit:4,additionalAttendeeDiscount:15}],attendees:[],registrations:[],accessDates:{basic:"2025-10-01T00:00:00Z",bronze:"2025-09-24T00:00:00Z",silver:"2025-09-17T00:00:00Z",gold:"2025-09-10T00:00:00Z"},registrationDeadline:new Date("2025-10-07T23:59:59-04:00"),comments:[],reactions:{like:15,celebrate:8,support:5,insightful:3,curious:12},slug:"grand-relaunch-event",tags:["networking","relaunch","finance","professionals","nyc"],status:"published",isVirtual:!1,requiresApproval:!1};return t?o?(0,nn.jsx)("div",{className:"max-w-4xl mx-auto px-4 py-8",children:(0,nn.jsxs)("div",{className:"bg-white rounded-lg shadow-lg p-6",children:[(0,nn.jsx)("h1",{className:"text-2xl font-bold text-gray-900 mb-6",children:"Create Grand ReLaunch Event"}),(0,nn.jsxs)("div",{className:"mb-6",children:[(0,nn.jsx)("h2",{className:"text-lg font-semibold text-gray-800 mb
2-3",children:"Event Details Preview:"}),(0,nn.jsxs)("div",{className:"bg-gray-50 rounded-lg p-4 space-y-2",children:[(0,nn.jsxs)("p",{children:[(0,nn.jsx)("strong",{children:"Title:"})," ",l.title]}),(0,nn.jsxs)("p",{children:[(0,nn.jsx)("strong",{children:"Date:"})," ",l.date]}),(0,nn.jsxs)("p",{children:[(0,nn.jsx)("strong",{children:"Time:"})," ",l.time]}),(0,nn.jsxs)("p",{children:[(0,nn.jsx)("strong",{children:"Location:"})," ",l.location]}),(0,nn.jsxs)("p",{children:[(0,nn.jsx)("strong",{children:"Address:"})," ",l.address]}),(0,nn.jsxs)("p",{children:[(0,nn.jsx)("strong",{children:"Pricing:"})," Member $125, Non-Member $160 (Sponsors use discount codes)"]}),(0,nn.jsxs)("p",{children:[(0,nn.jsx)("strong",{children:"Max Attendees:"})," ",l.maxAttendees]})]})]}),(0,nn.jsx)("button",{onClick:async()=>{if(o){s(!0),i("\ud83d\ude80 Creating Grand ReLaunch Event...");try{const e=await(0,wn.lh)(l);i("\u2705 Grand ReLaunch Event created successfully!\n \nEvent ID: ".concat(e,"\nTitle: ").concat(l.title,"\nDate: ").concat(l.date,"\nLocation: ").concat(l.location,"\nPricing: Member $125, Non-Member $160 (Sponsors use discount codes)\n\nThe event is now live and should display proper price ranges and time!"))}catch(e){console.error("Error creating event:",e),i("\u274c Error creating event: ".concat(e.message||e.code||"Unknown error","\n\nIf this is a permission error, the Firebase security rules may be blocking the operation."))}finally{s(!1)}}else i("\u274c Admin access required")},disabled:r,className:"w-full py-3 px-6 rounded-lg font-semibold text-white transition duration-200 ".concat(r?"bg-gray-400 cursor-not-allowed":"bg-apn-blue hover:bg-blue-700"),children:r?"Creating Event...":"Create Grand ReLaunch Event"}),a&&(0,nn.jsx)("div",{className:"mt-6 p-4 rounded-lg ".concat(a.includes("\u2705")?"bg-green-50 border border-green-200 text-green-800":a.includes("\u274c")?"bg-red-50 border border-red-200 text-red-800":"bg-blue-50 border border-blue-200 text-blue-800"),children:(0,nn.jsx)("pre",{className:"whitespace-pre-wrap font-mono text-sm",children:a})})]})}):(0,nn.jsx)("div",{className:"max-w-4xl mx-auto px-4 py-8",children:(0,nn.jsxs)("div",{className:"bg-red-50 border border-red-200 rounded-lg p-6",children:[(0,nn.jsx)("h2",{className:"text-xl font-bold text-red-800 mb-2",children:"Admin Access Required"}),(0,nn.jsx)("p",{className:"text-red-600",children:"You need admin privileges to create events."})]})}):(0,nn.jsx)("div",{className:"max-w-4xl mx-auto px-4 py-8",children:(0,nn.jsxs)("div",{className:"bg-red-50 border border-red-200 rounded-lg p-6",children:[(0,nn.jsx)("h2",{className:"text-xl font-bold text-red-800 mb-2",children:"Access Denied"}),(0,nn.jsx)("p",{className:"text-red-600",children:"Please log in to access admin tools."})]})})};function Ns(){const{currentUser:t,hasRole:n}=sn(),[r,a]=(0,e.useState)([]),[i,o]=(0,e.useState)(!1),[l,c]=(0,e.useState)(""),d=n("admin")||n("owner");(0,e.useEffect)(()=>{d&&u()},[d]);const u=async()=>{try{o(!0),console.log("\ud83d\udccb Loading events from database...");const e=(0,vt.collection)(yt.db,"events"),t=await(0,vt.getDocs)(e),n=[];t.forEach(e=>{const t=(0,s.A)({id:e.id},e.data());n.push(t)}),a(n),c("Found ".concat(n.length," events in database")),console.log("\ud83d\udcc5 Events loaded:",n)}catch(e){console.error("\u274c Error loading events:",e),c("Error loading events: "+e.message)}finally{o(!1)}};return t?d?(0,nn.jsx)("div",{className:"min-h-screen bg-gray-50 py-8",children:(0,nn.jsx)("div",{className:"max-w-6xl mx-auto px-4 sm:px-6 lg:px-8",children:(0,nn.jsxs)("div",{className:"bg-white rounded-lg shadow-lg p-6",children:[(0,nn.jsx)("h1",{className:"text-3xl font-bold text-gray-900 mb-6",children:"Database Cleanup Tool"}),(0,nn.jsxs)("div",{className:"mb-6 p-4 bg-yellow-50 border border-yellow-200 rounded-lg",children:[(0,nn.jsx)("h3",{className:"text-lg font-semibold text-yellow-800 mb-2",children:"\u26a0\ufe0f Important Warning"}),(0,nn.jsxs)("p",{className:"text-yellow-700",children:["This database is shared between ",(0,nn.jsx)("strong",{children:"the-apn.web.app"})," and ",(0,nn.jsx)("strong",{children:"the-apn.com"}),". Any changes made here will affect BOTH sites immediately."]})]}),l&&(0,nn.jsx)("div",{className:"mb-4 p-3 bg-blue-50 border border-blue-200 rounded-lg",children:(0,nn.jsx)("p",{className:"text-blue-800",children:l})}),(0,nn.jsxs)("div",{className:"mb-6 flex gap-4",children:[(0,nn.jsx)("button",{onClick:u,disabled:i,className:"bg-blue-600 text-white px-4 py-2 rounded hover:bg-blue-700 disabled:opacity-50",children:i?"Loading...":"Refresh Events"}),(0,nn.jsx)("button",{onClick:async()=>{const e=r.filter(e=>e.title&&(e.title.toLowerCase().includes("test")||e.title.toLowerCase().includes("testing")||"Testing 123"===e.title));if(0!==e.length){if(window.confirm("Delete ".concat(e.length," test events?\n\nEvents to delete:\n").concat(e.map(e=>"\u2022 ".concat(e.title)).join("\n"),"\n\nThis will affect BOTH:\n\u2022 the-apn.web.app\n\u2022 the-apn.com\n\nThis action cannot be undone.")))try{o(!0);for(const t of e)console.log("\ud83d\uddd1\ufe0f Deleting test event: ".concat(t.title," (ID: ").concat(t.id,")")),await(0,vt.kd)((0,vt.doc)(yt.db,"events",t.id));c("\u2705 Deleted ".concat(e.length," test events")),await u()}catch(t){console.error("\u274c Error deleting test events:",t),c("Error deleting test events: "+t.message)}finally{o(!1)}}else c("\u2139\ufe0f No test events found")},disabled:i,className:"bg-red-600 text-white px-4 py-2 rounded hover:bg-red-700 disabled:opacity-50",children:"Delete All Test Events"})]}),(0,nn.jsxs)("div",{className:"space-y-4",children:[(0,nn.jsxs)("h2",{className:"text-xl font-semibold text-gray-900",children:["Events in Database (",r.length,")"]}),0===r.length?(0,nn.jsx)("p",{className:"text-gray-500",children:"No events found"}):(0,nn.jsx)("div",{className:"grid gap-4",children:r.map(e=>(0,nn.jsx)("div",{className:"border border-gray-200 rounded-lg p-4",children:(0,nn.jsxs)("div",{className:"flex justify-between items-start",children:[(0,nn.jsxs)("div",{className:"flex-1",children:[(0,nn.jsx)("h3",{className:"font-semibold text-gray-900",children:e.title}),(0,nn.jsxs)("p",{className:"text-sm text-gray-600",children:["ID: ",e.id]}),(0,nn.jsxs)("p",{className:"text-sm text-gray-600",children:["Date: ",e.date]}),e.pricing&&(0,nn.jsxs)("div",{className:"text-sm text-gray-600",children:["Pricing:",void 0!==e.pricing.member&&" Member: $".concat(e.pricing.member),void 0!==e.pricing.nonMember&&" | Non-Member: $".concat(e.pricing.nonMember),void 0!==e.pricing.sponsor&&" | Sponsor: $".concat(e.pricing.sponsor," \u26a0\ufe0f")
2]})]}),(0,nn.jsxs)("div",{className:"flex gap-2 ml-4",children:[e.pricing&&void 0!==e.pricing.sponsor&&(0,nn.jsx)("button",{onClick:()=>(async(e,t)=>{if(window.confirm('Remove sponsor pricing from "'.concat(t,'"?\n\nThis will affect BOTH:\n\u2022 the-apn.web.app\n\u2022 the-apn.com')))try{o(!0),console.log("\ud83d\udd27 Removing sponsor pricing from: ".concat(t));const n=r.find(t=>t.id===e);if(n&&n.pricing&&void 0!==n.pricing.sponsor){const r={member:n.pricing.member,nonMember:n.pricing.nonMember};await(0,vt.updateDoc)((0,vt.doc)(yt.db,"events",e),{pricing:r}),c("\u2705 Removed sponsor pricing from: ".concat(t)),await u()}else c('\u2139\ufe0f Event "'.concat(t,"\" doesn't have sponsor pricing"))}catch(n){console.error("\u274c Error updating event:",n),c("Error updating event: "+n.message)}finally{o(!1)}})(e.id,e.title),disabled:i,className:"bg-orange-600 text-white px-3 py-1 rounded text-sm hover:bg-orange-700 disabled:opacity-50",children:"Remove Sponsor Pricing"}),(0,nn.jsx)("button",{onClick:()=>(async(e,t)=>{if(window.confirm('Are you sure you want to delete "'.concat(t,'"?\n\nThis will affect BOTH:\n\u2022 the-apn.web.app\n\u2022 the-apn.com\n\nThis action cannot be undone.')))try{o(!0),console.log("\ud83d\uddd1\ufe0f Deleting event: ".concat(t," (ID: ").concat(e,")")),await(0,vt.kd)((0,vt.doc)(yt.db,"events",e)),c("\u2705 Deleted event: ".concat(t)),await u()}catch(n){console.error("\u274c Error deleting event:",n),c("Error deleting event: "+n.message)}finally{o(!1)}})(e.id,e.title),disabled:i,className:"bg-red-600 text-white px-3 py-1 rounded text-sm hover:bg-red-700 disabled:opacity-50",children:"Delete"})]})]})},e.id))})]})]})})}):(0,nn.jsx)("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center",children:(0,nn.jsxs)("div",{className:"text-center",children:[(0,nn.jsx)("h1",{className:"text-2xl font-bold text-gray-900 mb-4",children:"Admin Access Required"}),(0,nn.jsx)("p",{className:"text-gray-600",children:"You need admin privileges to access this page."})]})}):(0,nn.jsx)("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center",children:(0,nn.jsxs)("div",{className:"text-center",children:[(0,nn.jsx)("h1",{className:"text-2xl font-bold text-gray-900 mb-4",children:"Access Denied"}),(0,nn.jsx)("p",{className:"text-gray-600",children:"Please log in to access this page."})]})})}const ks=()=>{const{currentUser:t,isAdmin:n}=sn(),[r,s]=(0,e.useState)([]),[a,i]=(0,e.useState)([]),[o,l]=(0,e.useState)(!0),[c,d]=(0,e.useState)("jobs"),[u,m]=(0,e.useState)("all"),[h,p]=(0,e.useState)("");if((0,e.useEffect)(()=>{g()},[]),!t||!n()&&!["[email protected]","[email protected]"].includes(t.email))return(0,nn.jsx)("div",{className:"max-w-4xl mx-auto px-4 py-8",children:(0,nn.jsxs)("div",{className:"bg-red-50 border border-red-200 rounded-md p-4",children:[(0,nn.jsx)("h3",{className:"text-red-800 font-medium",children:"Access Denied"}),(0,nn.jsx)("p",{className:"text-red-700",children:"You don't have permission to access this page."})]})});const g=async()=>{try{l(!0),console.log("Loading dashboard data...");let n=[];try{n=await(0,wn.S$)(100),console.log("Jobs loaded from Firebase:",n.length)}catch(e){console.error("Error loading jobs:",e),n=[]}let r=[];try{r=await(0,wn.cf)(100),console.log("Projects loaded from Firebase:",r.length)}catch(t){console.error("Error loading projects:",t),r=[]}s(n),i(r)}catch(n){console.error("Error loading dashboard data:",n),s([]),i([])}finally{l(!1)}},f=async(e,n,r)=>{try{"closed"===r?"job"===n?await(0,wn.Ao)(e,t.uid):await(0,wn.ay)(e,t.uid):"archived"===r&&("job"===n?await(0,wn.wf)(e,t.uid):await(0,wn.Im)(e,t.uid)),g()}catch(s){console.error("Error updating status:",s),alert("Failed to update status. Please try again.")}},x=e=>{if(!e)return"N/A";return(e.toDate?e.toDate():new Date(e)).toLocaleDateString()},b=e=>e.filter(e=>{const t="all"===u||(e.status||"active")===u,n=(e.title||"").toLowerCase().includes(h.toLowerCase())||(e.company||e.client||"").toLowerCase().includes(h.toLowerCase());return t&&n}),y=b("jobs"===c?r:a);return o?(0,nn.jsx)("div",{className:"flex justify-center items-center min-h-screen",children:(0,nn.jsxs)("div",{className:"text-center",children:[(0,nn.jsx)("div",{className:"animate-spin rounded-full h-12 w-12 border-t-2 border-b-2 border-apn-blue mx-auto mb-4"}),(0,nn.jsx)("p",{children:"Loading dashboard data..."})]})}):(0,nn.jsxs)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:[(0,nn.jsxs)("div",{className:"mb-8",children:[(0,nn.jsx)("h1",{className:"text-3xl font-bold text-gray-900",children:"Postings Dashboard"}),(0,nn.jsx)("p",{className:"text-gray-600 mt-2",children:"Manage all job and project postings"})]}),(0,nn.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-6 mb-8",children:[(0,nn.jsx)("div",{className:"bg-white overflow-hidden shadow rounded-lg",children:(0,nn.jsx)("div",{className:"p-5",children:(0,nn.jsxs)("div",{className:"flex items-center",children:[(0,nn.jsx)("div",{className:"flex-shrink-0",children:(0,nn.jsx)("div",{className:"w-8 h-8 bg-green-500 rounded-md flex items-center justify-center",children:(0,nn.jsx)("span",{className:"text-white font-bold",children:"J"})})}),(0,nn.jsx)("div",{className:"ml-5 w-0 flex-1",children:(0,nn.jsxs)("dl",{children:[(0,nn.jsx)("dt",{className:"text-sm font-medium text-gray-500 truncate",children:"Active Jobs"}),(0,nn.jsx)("dd",{className:"text-lg font-medium text-gray-900",children:r.filter(e=>"active"===(e.status||"active")).length})]})})]})})}),(0,nn.jsx)("div",{className:"bg-white overflow-hidden shadow rounded-lg",children:(0,nn.jsx)("div",{className:"p-5",children:(0,nn.jsxs)("div",{className:"flex items-center",children:[(0,nn.jsx)("div",{className:"flex-shrink-0",children:(0,nn.jsx)("div",{className:"w-8 h-8 bg-blue-500 rounded-md flex items-center justify-center",children:(0,nn.jsx)("span",{className:"text-white font-bold",children:"P"})})}),(0,nn.jsx)("div",{className:"ml-5 w-0 flex-1",children:(0,nn.jsxs)("dl",{children:[(0,nn.jsx)("dt",{className:"text-sm font-medium text-gray-500 truncate",children:"Active Projects"}),(0,nn.jsx)("dd",{className:"text-lg font-medium text-gray-900",children:a.filter(e=>"active"===(e.status||"active")).length})]})})]})})}),(0,nn.jsx)("div",{className:"bg-white overflow-hidden shadow rounded-lg",children:(0,nn.jsx)("div",{className:"p-5",children:(0,nn.jsxs)("div",{className:"flex items-center",children:[(0,nn.jsx)("div",{className:"flex-shrink-0",children:(0,nn.jsx)("div",{className:"w-8 h-8 bg-yellow-500 rounded-md flex items-center justify-center",children:(0,nn.jsx)("span",{className:"text-white font-bold",children:"C"})})}),(0,nn.jsx)("div",{className:"ml-5 w-0 flex-1",children:(0,nn.jsxs)("dl",{children:[(0,nn.jsx)("dt",{className:"text-sm font-medium text-gray-500 truncate",children:"Closed (This Week)"}),(0,nn.jsx)("dd",{className:"text-lg font-medium text-gray-900",children:[...r,...a].filter(e=>"closed"===e.status).length})]})})]})})}),(0,nn.jsx)("div",{className:"bg-white overflow-hidden shadow rounded-lg",children:(0,nn.jsx)("div",{className:"p-5",children:(0,nn.jsxs)("div",{className:"flex items-center",children:[(0,nn.jsx)("div",{className:"flex-shrink-0",children:(0,nn.jsx)("div",{className:"w-8 h-8 bg-gray-500 rounded-md flex items-center justify-center",children:(0,nn.jsx)("span",{className:"text-white font-bold",children:"A"})})}),(0,nn.jsx)("div",{className:"ml-5 w-0 flex-1",children:(0,nn.jsxs)("dl",{children:[(0,nn.jsx)("dt",{className:"text-sm font-medium text-gray-500 truncate",children:"Archived"}),(0,nn.jsx)("dd",{className:"text-lg font-medium text-gray-900",children:[...r,...a].filter(e=>"archived"===e.status).length})]})})]})})})]}),(0,nn.jsxs)("div",{className:"mb-6",children:[(0,nn.jsx)("button",{onClick:async()=>{try{const e=await(async()=>{try{const e=new Date;e.setDate(e.getDate()-7);
2const t=(0,vt.query)((0,vt.collection)(yt.db,"jobs"),(0,vt.where)("status","==","closed"),(0,vt.where)("closedAt","<=",e)),n=(await(0,vt.getDocs)(t)).docs.map(e=>(0,vt.updateDoc)((0,vt.doc)(yt.db,"jobs",e.id),{status:"archived",archivedAt:(0,vt.serverTimestamp)(),updatedAt:(0,vt.serverTimestamp)()})),r=(0,vt.query)((0,vt.collection)(yt.db,"projects"),(0,vt.where)("status","==","closed"),(0,vt.where)("closedAt","<=",e)),s=(await(0,vt.getDocs)(r)).docs.map(e=>(0,vt.updateDoc)((0,vt.doc)(yt.db,"projects",e.id),{status:"archived",archivedAt:(0,vt.serverTimestamp)(),updatedAt:(0,vt.serverTimestamp)()}));return await Promise.all([...n,...s]),console.log("Archived ".concat(n.length," jobs and ").concat(s.length," projects")),{archivedJobs:n.length,archivedProjects:s.length}}catch(e){throw console.error("Error archiving old postings:",e),e}})();alert("Archive process completed. Archived ".concat(e.archivedJobs," jobs and ").concat(e.archivedProjects," projects.")),g()}catch(e){console.error("Error running archive process:",e),alert("Failed to run archive process. Please try again.")}},className:"bg-blue-600 text-white px-4 py-2 rounded hover:bg-blue-700 transition duration-200",children:"Run Archive Process"}),(0,nn.jsx)("p",{className:"text-sm text-gray-600 mt-1",children:"Archives jobs/projects that have been closed for more than 1 week"})]}),(0,nn.jsx)("div",{className:"border-b border-gray-200 mb-6",children:(0,nn.jsxs)("nav",{className:"-mb-px flex space-x-8",children:[(0,nn.jsxs)("button",{onClick:()=>d("jobs"),className:"py-2 px-1 border-b-2 font-medium text-sm ".concat("jobs"===c?"border-apn-blue text-apn-blue":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"),children:["Jobs (",r.length,")"]}),(0,nn.jsxs)("button",{onClick:()=>d("projects"),className:"py-2 px-1 border-b-2 font-medium text-sm ".concat("projects"===c?"border-apn-blue text-apn-blue":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"),children:["Projects (",a.length,")"]})]})}),(0,nn.jsxs)("div",{className:"mb-6 flex flex-wrap gap-4",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Status"}),(0,nn.jsxs)("select",{value:u,onChange:e=>m(e.target.value),className:"border border-gray-300 rounded-md px-3 py-2 text-sm",children:[(0,nn.jsx)("option",{value:"all",children:"All Statuses"}),(0,nn.jsx)("option",{value:"active",children:"Active"}),(0,nn.jsx)("option",{value:"closed",children:"Closed"}),(0,nn.jsx)("option",{value:"archived",children:"Archived"})]})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Search"}),(0,nn.jsx)("input",{type:"text",value:h,onChange:e=>p(e.target.value),placeholder:"Search by title or company...",className:"border border-gray-300 rounded-md px-3 py-2 text-sm w-64"})]})]}),(0,nn.jsxs)("div",{className:"bg-white shadow overflow-hidden sm:rounded-md",children:[(0,nn.jsx)("div",{className:"overflow-x-auto",children:(0,nn.jsxs)("table",{className:"min-w-full divide-y divide-gray-200",children:[(0,nn.jsx)("thead",{className:"bg-gray-50",children:(0,nn.jsxs)("tr",{children:[(0,nn.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Title"}),(0,nn.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"jobs"===c?"Company":"Client"}),(0,nn.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Status"}),(0,nn.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Posted Date"}),(0,nn.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Actions"})]})}),(0,nn.jsx)("tbody",{className:"bg-white divide-y divide-gray-200",children:y.map(e=>{return(0,nn.jsxs)("tr",{children:[(0,nn.jsxs)("td",{className:"px-6 py-4 whitespace-nowrap",children:[(0,nn.jsx)("div",{className:"text-sm font-medium text-gray-900",children:e.title}),(0,nn.jsx)("div",{className:"text-sm text-gray-500",children:e.location})]}),(0,nn.jsx)("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-900",children:e.company||e.client||"N/A"}),(0,nn.jsx)("td",{className:"px-6 py-4 whitespace-nowrap",children:(t=e.status,(0,nn.jsx)("span",{className:"px-2 py-1 rounded-full text-xs font-medium ".concat({active:"bg-green-100 text-green-800",closed:"bg-yellow-100 text-yellow-800",archived:"bg-gray-100 text-gray-800"}[t]||"bg-gray-100 text-gray-800"),children:t||"active"}))}),(0,nn.jsx)("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-900",children:x(e.postedDate)}),(0,nn.jsxs)("td",{className:"px-6 py-4 whitespace-nowrap text-sm font-medium space-x-2",children:["active"===(e.status||"active")&&(0,nn.jsx)("button",{onClick:()=>f(e.id,c.slice(0,-1),"closed"),className:"text-yellow-600 hover:text-yellow-900",children:"Mark Filled"}),"closed"===(e.status||"active")&&(0,nn.jsx)("button",{onClick:()=>f(e.id,c.slice(0,-1),"archived"),className:"text-gray-600 hover:text-gray-900",children:"Archive"}),(0,nn.jsx)("button",{onClick:()=>(async(e,t,n)=>{if(window.confirm('Are you sure you want to permanently delete "'.concat(n,'"? This action cannot be undone.')))try{"job"===t?await(0,wn.XX)(e):await(0,wn.xx)(e),g(),alert("".concat("job"===t?"Job":"Project"," deleted successfully!"))}catch(r){console.error("Error deleting:",r),alert("Failed to delete. Please try again.")}})(e.id,c.slice(0,-1),e.title),className:"text-red-600 hover:text-red-900",children:"Delete"})]})]},e.id);var t})})]})}),0===y.length&&(0,nn.jsxs)("div",{className:"text-center py-8 text-gray-500",children:["No ",c," found matching your criteria."]})]})]})};var As=n(395);const Ss=(0,As.Uz)(),Es=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=(0,As.Qg)(Ss,"generateCampaignContent");return(await n({campaignType:e,customPrompt:t.customPrompt||null,targetEventId:t.targetEventId||null})).data},Cs=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=(0,As.Qg)(Ss,"importCSVContacts");return(await n({contacts:e,listId:t})).data},Ts=async e=>{const t=(0,As.Qg)(Ss,"createCampaign");return(await t(e)).data},Ps=async()=>{const e=(0,As.Qg)(Ss,"getCampaignStats");return(await e()).data},_s=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=await Es(e,t);if(!n.success)throw new Error("Failed to generate content");return{content:n.content,campaignType:e}},Is=e=>{const t=e.trim().split("\n"),n=t[0].split(",").map(e=>e.trim().toLowerCase());return t.slice(1).map(e=>{const t=e.split(",").map(e=>e.trim().replace(/^"|"$/g,"")),r={};
2return n.forEach((e,n)=>{const s=t[n]||"";if(e.includes("email"))r.email=s;else if(e.includes("first")&&e.includes("name"))r.firstName=s;else if(e.includes("last")&&e.includes("name"))r.lastName=s;else if("name"!==e||r.firstName)e.includes("company")||e.includes("organization")?r.company=s:e.includes("title")||e.includes("position")?r.jobTitle=s:e.includes("phone")&&(r.phone=s);else{const e=s.split(" ");r.firstName=e[0],r.lastName=e.slice(1).join(" ")}}),r}).filter(e=>e.email)},Ds="https://the-apn.web.app",Rs=[{id:"weekly_digest",name:"Weekly Digest",icon:"\ud83d\udcf0",desc:"Roundup of events, jobs, projects & news"},{id:"event_promo",name:"Event Promotion",icon:"\ud83c\udf89",desc:"Promote an upcoming event"},{id:"new_jobs_alert",name:"New Jobs Alert",icon:"\ud83d\udcbc",desc:"Alert about new job postings"},{id:"re_engagement",name:"Re-engagement",icon:"\ud83d\udd04",desc:"Win back inactive contacts"},{id:"welcome_drip",name:"Welcome Series",icon:"\ud83d\udc4b",desc:"Onboard new members"},{id:"custom",name:"Custom Campaign",icon:"\u270d\ufe0f",desc:"Write your own topic for Claude"}];function Ls(){const{hasRole:t}=sn(),n=t("admin"),[r,a]=(0,e.useState)("create"),[i,o]=(0,e.useState)(null),[l,c]=(0,e.useState)(""),[d,u]=(0,e.useState)(""),[m,h]=(0,e.useState)(""),[p,g]=(0,e.useState)(""),[f,x]=(0,e.useState)(""),[b,y]=(0,e.useState)(null),[v,w]=(0,e.useState)(!1),[j,N]=(0,e.useState)(!1),[k,A]=(0,e.useState)(null),[S,E]=(0,e.useState)("claude-assist"),[C,T]=(0,e.useState)([]),[P,_]=(0,e.useState)([]),[I,D]=(0,e.useState)(!1),[R,L]=(0,e.useState)(null),[M,O]=(0,e.useState)(""),[F,U]=(0,e.useState)(null),[B,z]=(0,e.useState)(!1),[V,q]=(0,e.useState)(!1),W=(0,e.useRef)(null);function H(e){if(!b)return"Loading site data...";const t=b.events.map(e=>"- ".concat(e.title||"Untitled"," | ").concat(e.date||"TBD"," | ").concat(e.location||"TBD"," | ").concat(Ds,"/events/").concat(e.id)).join("\n")||"None",n=b.jobs.map(e=>"- ".concat(e.title||"Untitled"," at ").concat(e.company||"Company"," | ").concat(e.location||"Remote"," | ").concat(Ds,"/jobs/").concat(e.id)).join("\n")||"None",r=b.projects.map(e=>"- ".concat(e.title||"Untitled"," | Budget: ").concat(e.budgetRange||"TBD"," | ").concat(Ds,"/projects/").concat(e.id)).join("\n")||"None",s=b.articles.map(e=>"- ".concat(e.title||"Untitled"," | ").concat(Ds,"/news/").concat(e.id)).join("\n")||"None",a={weekly_digest:"Generate a weekly digest newsletter for APN members. Include sections for upcoming events, new jobs, active projects, and recent news. Each item should link to its page.",event_promo:'Generate an event promotion email for the next upcoming APN event. Create urgency, highlight key details, include a prominent "Register Now" button.',new_jobs_alert:"Generate a job alert email highlighting new positions on the APN job board.",re_engagement:"Generate a re-engagement email for contacts who haven't been active. Show what they're missing.",welcome_drip:"Generate a welcome email for new APN members. Walk them through Events, Job Board, Project Board, Groups, and Directory.",custom:"Generate an email campaign about: ".concat(l||"[Enter topic above]")};return"You are the content writer for Accelerated Professionals Network (APN), a premier professional network for finance & business professionals.\n\nBRAND: Professional but approachable. Color #3d67ad (blue) + white. Website: ".concat(Ds,"\nFORMAT: Inline CSS, max-width 600px, Arial font. CTA buttons: bg #3d67ad, white text, rounded, padding 12px 24px.\nInclude LinkedIn (https://www.linkedin.com/company/accelerated-professionals-network) and Instagram (@the_apn_) links.\n\nLIVE DATA:\nEvents (").concat(b.events.length,"):\n").concat(t,"\n\nJobs (").concat(b.jobs.length,"):\n").concat(n,"\n\nProjects (").concat(b.projects.length,"):\n").concat(r,"\n\nArticles (").concat(b.articles.length,"):\n").concat(s,"\n\nMembers: ").concat(b.stats.totalMembers,"\n\nTASK: ").concat(a[e.id],'\n\nReturn JSON: {"subject": "...", "html": "<div>complete email HTML</div>", "previewText": "..."}')}if((0,e.useEffect)(()=>{n&&(async function(){try{var e;const[t,n,r,a,i]=await Promise.all([(0,vt.getDocs)((0,vt.query)((0,vt.collection)(yt.db,"events"),(0,vt.orderBy)("date","desc"),(0,vt.limit)(5))).catch(()=>({docs:[]}
2)),(0,vt.getDocs)((0,vt.query)((0,vt.collection)(yt.db,"jobs"),(0,vt.orderBy)("postedDate","desc"),(0,vt.limit)(5))).catch(()=>({docs:[]})),(0,vt.getDocs)((0,vt.query)((0,vt.collection)(yt.db,"projects"),(0,vt.orderBy)("postedDate","desc"),(0,vt.limit)(5))).catch(()=>({docs:[]})),(0,vt.getDocs)((0,vt.query)((0,vt.collection)(yt.db,"articles"),(0,vt.orderBy)("publishedAt","desc"),(0,vt.limit)(3))).catch(()=>({docs:[]})),(0,vt.getDocs)((0,vt.collection)(yt.db,"users")).catch(()=>({docs:[],size:0}))]);y({events:t.docs.map(e=>(0,s.A)({id:e.id},e.data())),jobs:n.docs.map(e=>(0,s.A)({id:e.id},e.data())),projects:r.docs.map(e=>(0,s.A)({id:e.id},e.data())),articles:a.docs.map(e=>(0,s.A)({id:e.id},e.data())),stats:{totalMembers:i.size||(null===(e=i.docs)||void 0===e?void 0:e.length)||0}})}catch(t){console.error("Error fetching site data:",t)}}(),async function(){try{const e=await Ps();e.success&&T(e.campaigns||[])}catch(e){}}())},[n]),!n)return(0,nn.jsx)("div",{className:"max-w-4xl mx-auto p-6",children:(0,nn.jsx)("div",{className:"bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded",children:"Admin access required."})});return(0,nn.jsxs)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:[(0,nn.jsxs)("div",{className:"mb-8",children:[(0,nn.jsx)("h1",{className:"text-3xl font-bold text-gray-900",children:"\ud83d\udce7 Campaign Dashboard"}),(0,nn.jsx)("p",{className:"mt-2 text-gray-600",children:"Create AI-powered email campaigns \u2022 Powered by Claude + Constant Contact"})]}),(0,nn.jsx)("div",{className:"border-b border-gray-200 mb-8",children:(0,nn.jsx)("nav",{className:"-mb-px flex space-x-8",children:[{id:"create",name:"\u270d\ufe0f Create Campaign"},{id:"import",name:"\ud83d\udcc1 Import Contacts"},{id:"history",name:"\ud83d\udcca History"}].map(e=>(0,nn.jsx)("button",{onClick:()=>a(e.id),className:"py-4 px-1 border-b-2 font-medium text-sm transition-colors ".concat(r===e.id?"border-[#3d67ad] text-[#3d67ad]":"border-transparent text-gray-500 hover:text-gray-700"),children:e.name},e.id))})}),"create"===r&&(0,nn.jsxs)("div",{className:"space-y-8",children:[(0,nn.jsxs)("div",{className:"flex items-center gap-4 bg-gray-50 p-4 rounded-lg",children:[(0,nn.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Mode:"}),(0,nn.jsx)("button",{onClick:()=>E("claude-assist"),className:"px-4 py-2 rounded-lg text-sm font-medium transition-colors ".concat("claude-assist"===S?"bg-[#3d67ad] text-white":"bg-white text-gray-700 border"),children:"\ud83e\udde0 Claude Assist (Your $200 Subscription)"}),(0,nn.jsx)("button",{onClick:()=>E("auto-api"),className:"px-4 py-2 rounded-lg text-sm font-medium transition-colors ".concat("auto-api"===S?"bg-[#3d67ad] text-white":"bg-white text-gray-700 border"),children:"\u26a1 Auto-Generate (API)"})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("h2",{className:"text-lg font-semibold text-gray-900 mb-4",children:"1. Choose Campaign Type"}),(0,nn.jsx)("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-4",children:Rs.map(e=>(0,nn.jsxs)("button",{onClick:()=>function(e){o(e),h(""),g(""),x(""),A(null),q(!1),"claude-assist"===S&&u(H(e))}(e),className:"p-4 rounded-lg border-2 text-left transition-all ".concat((null===i||void 0===i?void 0:i.id)===e.id?"border-[#3d67ad] bg-blue-50":"border-gray-200 hover:border-gray-300"),children:[(0,nn.jsx)("div",{className:"text-2xl mb-2",children:e.icon}),(0,nn.jsx)("div",{className:"font-medium text-gray-900",children:e.name}),(0,nn.jsx)("div",{className:"text-sm text-gray-500 mt-1",children:e.desc})]},e.id))})]}),"custom"===(null===i||void 0===i?void 0:i.id)&&(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Custom Topic / Prompt"}),(0,nn.jsx)("textarea",{value:l,onChange:e=>{c(e.target.value),"claude-assist"===S&&u(H(i))},rows:3,className:"w-full border rounded-lg p-3 text-sm",placeholder:"e.g., Announce our Spring Networking Mixer on April 15th at The Standard Hotel..."})]}),i&&"claude-assist"===S&&(0,nn.jsxs)("div",{className:"space-y-6",children:[(0,nn.jsx)("h2",{className:"text-lg font-semibold text-gray-900",children:"2. Copy Prompt \u2192 Paste in Claude \u2192 Paste Result Back"}),(0,nn.jsxs)("div",{className:"bg-gray-50 rounded-lg p-4",children:[(0,nn.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,nn.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"\ud83d\udccb Step A: Your AI Prompt (auto-generated
2with live site data)"}),(0,nn.jsxs)("div",{className:"flex gap-2",children:[(0,nn.jsx)("button",{onClick:async function(){try{await navigator.clipboard.writeText(d)}catch(t){var e;null===(e=W.current)||void 0===e||e.select(),document.execCommand("copy")}q(!0),setTimeout(()=>q(!1),3e3)},className:"px-4 py-2 rounded-lg text-sm font-medium transition-colors ".concat(V?"bg-green-500 text-white":"bg-[#3d67ad] text-white hover:bg-blue-700"),children:V?"\u2705 Copied!":"\ud83d\udccb Copy Prompt"}),(0,nn.jsx)("button",{onClick:()=>window.open("https://claude.ai/new","_blank"),className:"px-4 py-2 bg-orange-500 text-white rounded-lg text-sm font-medium hover:bg-orange-600",children:"\ud83d\udd17 Open Claude"})]})]}),(0,nn.jsx)("textarea",{ref:W,readOnly:!0,value:d,rows:6,className:"w-full border rounded-lg p-3 text-xs font-mono bg-white"})]}),(0,nn.jsxs)("div",{className:"bg-gray-50 rounded-lg p-4",children:[(0,nn.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,nn.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"\ud83d\udce5 Step B: Paste Claude's Response Here"}),(0,nn.jsx)("button",{onClick:function(){try{const e=m.match(/\{[\s\S]*\}/);if(e){const t=JSON.parse(e[0]);x(t.subject||""),g(t.html||"")}else g(m),x("APN ".concat((null===i||void 0===i?void 0:i.name)||"Update"))}catch(e){g(m),x("APN ".concat((null===i||void 0===i?void 0:i.name)||"Update"))}},disabled:!m,className:"px-4 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50",children:"\ud83d\udd0d Parse & Preview"})]}),(0,nn.jsx)("textarea",{value:m,onChange:e=>h(e.target.value),rows:6,className:"w-full border rounded-lg p-3 text-xs font-mono",placeholder:"Paste Claude's entire JSON response here..."})]})]}),i&&"auto-api"===S&&(0,nn.jsxs)("div",{children:[(0,nn.jsx)("h2",{className:"text-lg font-semibold text-gray-900 mb-4",children:"2. Auto-Generate with Claude API"}),(0,nn.jsx)("button",{onClick:async function(){if(i){w(!0);try{const e=await _s(i.id,{customPrompt:l});x(e.content.subject||""),g(e.content.html||"")}catch(e){alert("API error: ".concat(e.message,'\nTry "Claude Assist" mode instead.'))}finally{w(!1)}}},disabled:v,className:"px-6 py-3 bg-[#3d67ad] text-white rounded-lg font-medium hover:bg-blue-700 disabled:opacity-50",children:v?"\u23f3 Generating with Claude...":"\u26a1 Generate Campaign Content"}),(0,nn.jsx)("p",{className:"text-xs text-gray-500 mt-2",children:"Uses your Anthropic API key (set in Firebase). Costs ~$0.01-0.05 per generation."})]}),p&&(0,nn.jsxs)("div",{className:"space-y-4",children:[(0,nn.jsx)("h2",{className:"text-lg font-semibold text-gray-900",children:"3. Preview & Edit"}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Subject Line"}),(0,nn.jsx)("input",{type:"text",value:f,onChange:e=>x(e.target.value),className:"w-full border rounded-lg p-3"})]}),(0,nn.jsxs)("div",{className:"border rounded-lg overflow-hidden",children:[(0,nn.jsx)("div",{className:"bg-gray-100 px-4 py-2 text-sm font-medium text-gray-600",children:"Email Preview"}),(0,nn.jsx)("div",{className:"p-4 bg-white max-h-[500px] overflow-y-auto",dangerouslySetInnerHTML:{__html:p}})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Edit HTML (optional)"}),(0,nn.jsx)("textarea",{value:p,onChange:e=>g(e.target.value),rows:6,className:"w-full border rounded-lg p-3 text-xs font-mono"})]}),(0,nn.jsxs)("div",{className:"flex items-center gap-4",children:[(0,nn.jsx)("button",{onClick:async function(){if(!p||!f)return alert("Generate content first");
2if(window.confirm("Create this campaign as a draft in Constant Contact?")){N(!0);try{await Ts({name:"APN - ".concat((null===i||void 0===i?void 0:i.name)||"Campaign"," - ").concat((new Date).toLocaleDateString()),subject:f,htmlContent:p,listIds:[],sendNow:!1}),A({ok:!0,msg:"\u2705 Campaign created as draft in Constant Contact! Review & send from your CC dashboard."})}catch(e){A({ok:!1,msg:"\u274c ".concat(e.message)})}finally{N(!1)}}},disabled:j,className:"px-6 py-3 bg-green-600 text-white rounded-lg font-medium hover:bg-green-700 disabled:opacity-50",children:j?"\u23f3 Creating Campaign...":"\ud83d\ude80 Create Draft in Constant Contact"}),(0,nn.jsx)("span",{className:"text-sm text-gray-500",children:"Creates as draft \u2014 you review & send from CC"})]}),k&&(0,nn.jsx)("div",{className:"p-4 rounded-lg ".concat(k.ok?"bg-green-50 text-green-800 border border-green-200":"bg-red-50 text-red-800 border border-red-200"),children:k.msg})]})]}),"import"===r&&(0,nn.jsxs)("div",{className:"space-y-6",children:[(0,nn.jsxs)("div",{className:"bg-white shadow rounded-lg p-6",children:[(0,nn.jsx)("h2",{className:"text-xl font-semibold text-gray-900 mb-4",children:"\ud83d\udcc1 Import CSV Contacts to Constant Contact"}),(0,nn.jsx)("p",{className:"text-gray-600 mb-6",children:"Upload your CSV file with contacts. The system will parse email, first name, last name, company, title, and phone columns automatically."}),(0,nn.jsxs)("div",{className:"space-y-4",children:[(0,nn.jsx)("input",{type:"file",accept:".csv",onChange:function(e){const t=e.target.files[0];if(!t)return;L(null);const n=new FileReader;n.onload=e=>_(Is(e.target.result)),n.readAsText(t)},className:"block w-full text-sm text-gray-500 file:mr-4 file:py-2 file:px-4 file:rounded-lg file:border-0 file:text-sm file:font-semibold file:bg-[#3d67ad] file:text-white hover:file:bg-blue-700"}),P.length>0&&(0,nn.jsxs)("div",{children:[(0,nn.jsxs)("p",{className:"text-sm font-medium text-gray-700 mb-2",children:["Preview (",P.length," contacts found):"]}),(0,nn.jsxs)("div",{className:"max-h-64 overflow-y-auto border rounded-lg",children:[(0,nn.jsxs)("table",{className:"min-w-full divide-y divide-gray-200 text-sm",children:[(0,nn.jsx)("thead",{className:"bg-gray-50",children:(0,nn.jsxs)("tr",{children:[(0,nn.jsx)("th",{className:"px-4 py-2 text-left",children:"Email"}),(0,nn.jsx)("th",{className:"px-4 py-2 text-left",children:"First"}),(0,nn.jsx)("th",{className:"px-4 py-2 text-left",children:"Last"}),(0,nn.jsx)("th",{className:"px-4 py-2 text-left",children:"Company"})]})}),(0,nn.jsx)("tbody",{className:"divide-y divide-gray-200",children:P.slice(0,20).map((e,t)=>(0,nn.jsxs)("tr",{children:[(0,nn.jsx)("td",{className:"px-4 py-2",children:e.email}),(0,nn.jsx)("td",{className:"px-4 py-2",children:e.firstName}),(0,nn.jsx)("td",{className:"px-4 py-2",children:e.lastName}),(0,nn.jsx)("td",{className:"px-4 py-2",children:e.company||"-"})]},t))})]}),P.length>20&&(0,nn.jsxs)("p",{className:"p-3 text-center text-gray-500 text-sm",children:["...and ",P.length-20," more"]})]}),(0,nn.jsx)("button",{onClick:async function(){if(!P.length)return alert("No valid contacts in CSV");if(window.confirm("Import ".concat(P.length," contacts to Constant Contact?"))){D(!0);try{const e=await Cs(P);L({ok:!0,msg:"\u2705 Imported ".concat(e.imported||P.length," contacts!")})}catch(e){L({ok:!1,msg:"\u274c ".concat(e.message)})}finally{D(!1)}}},disabled:I,className:"mt-4 px-6 py-3 bg-green-600 text-white rounded-lg font-medium hover:bg-green-700 disabled:opacity-50",children:I?"\u23f3 Importing ".concat(P.length," contacts..."):"\ud83d\ude80 Import ".concat(P.length," Contacts to CC")})]}),R&&(0,nn.jsx)("div",{className:"p-4 rounded-lg ".concat(R.ok?"bg-green-50 text-green-800 border border-green-200":"bg-red-50 text-red-800 border border-red-200"),children:R.msg})]})]}),(0,nn.jsxs)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-4",children:[(0,nn.jsx)("h3",{className:"font-medium text-blue-900 mb-2",children:"CSV Format Tips"}),(0,nn.jsxs)("ul",{className:"text-sm text-blue-800 space-y-1 list-disc list-inside",children:[(0,nn.jsxs)("li",{children:["Must have an ",(0,nn.jsx)("strong",{children:"email"})," column (required)"]}),(0,nn.jsx)("li",{children:"Supports: first name, last name, company, title/position, phone"}),(0,nn.jsx)("li",{children:"Column headers are auto-detected (case-insensitive)"}),(0,nn.jsx)("li",{children:"Contacts without valid emails are skipped"}),(0,nn.jsx)("li",{children:"Duplicates are handled by Constant Contact (upserts)"})]})]})]}),"history"===r&&(0,nn.jsxs)("div",{className:"bg-white shadow rounded-lg p-6",children:[(0,nn.jsx)("h2",{className:"text-xl font-semibold text-gray-900 mb-4",children:"\ud83d\udcca Campaign History"}),0===C.length?(0,nn.jsx)("p",{className:"text-gray-500",children:"No campaigns sent yet. Create your first campaign above!"}):(0,nn.jsx)("div",{className:"overflow-x-auto",children:(0,nn.jsxs)("table",{className:"min-w-full divide-y divide-gray-200 text-sm",children:[(0,nn.jsx)("thead",{className:"bg-gray-50",children:(0,nn.jsxs)("tr",{children:[(0,nn.jsx)("th",{className:"px-4 py-3 text-left font-medium text-gray-500",children:"Name"}),(0,nn.jsx)("th",{className:"px-4 py-3 text-left font-medium text-gray-500",children:"Date"}),(0,nn.jsx)("th",{className:"px-4 py-3 text-left font-medium text-gray-500",children:"Status"}),(0,nn.jsx)("th",{className:"px-4 py-3 text-left font-medium text-gray-500",children:"Opens"})]})}),(0,nn.jsx)("tbody",{className:"divide-y divide-gray-200",children:C.map((e,t)=>(0,nn.jsxs)("tr",{children:[(0,nn.jsx)("td",{className:"px-4 py-3",children:e.name||"Campaign"}),(0,nn.jsx)("td",{className:"px-4 py-3",children:e.sentAt?new Date(e.sentAt).toLocaleDateString():"-"}),(0,nn.jsx)("td",{className:"px-4 py-3",children:(0,nn.jsx)("span",{className:"px-2 py-1 rounded-full text-xs ".concat("sent"===e.status?"bg-green-100 text-green-800":"bg-yellow-100 text-yellow-800"),children:e.status||"draft"})}),(0,nn.jsx)("td",{className:"px-4 py-3",children:e.opens||"-"})]},t))})]})})]})]})}const Ms={starter:{name:"Starter",monthly:79,color:"#4ADE80",services:["website"]},professional:{name:"Professional",monthly:199,color:"#60A5FA",services:["website","chatbot","analytics","reviews"]},premium:{name:"Premium",monthly:399,color:"#A78BFA",services:["website","chatbot","analytics","reviews","phone","booking","seo","lead-nurture"]},enterprise:{name:"Enterprise",monthly:0,color:"#FBBF24",services:["website","chatbot","analytics","reviews","phone","booking","seo","lead-nurture","custom"]}},Os={website:"Website",chatbot:"AI Chatbot",phone:"Phone Agent",reviews:"Reviews",booking:"Booking",analytics:"Analytics",seo:"Full SEO","lead-nurture":"Lead Nurture",custom:"Custom AI"},Fs=[{name:"Minutemen Land Services",owner:"Jordan Grant",phone:"(203) 247-7744",address:"377 Highland Ave, Norwalk, CT",tier:"starter",status:"contract_sent",siteUrl:"https://apn-demos.vercel.app/minutemen-land-services",domain:"minutemenlandscaping.com",domainStatus:"available",setupPaid:!1,monthlyActive:!1,services:{website:!0,chatbot:!1,phone:!1,reviews:!1,booking:!1,analytics:!1,seo:!1,"lead-nurture":!1},notes:"Wants AI upgrade after site delivers. Founded 1978.",hubspotId:"315540040406",retellAgentId:"",chatbotId:""},{name:"A to Z Property Maintenance",owner:"Daimeon Baity",phone:"(203) 775-9174",address:"Brookfield, CT",tier:"starter",status:"interested",siteUrl:"https://apn-demos.vercel.app/a-to-z-property-maintenance-llc",domain:"",domainStatus:"",setupPaid:!1,monthlyActive:!1,services:{website:!0,chatbot:!1,phone:!1,reviews:!1,booking:!1,analytics:!1,seo:!1,"lead-nurture":!1},notes:"Showed interest. Email outreach pending.",hubspotId:"315578519252",retellAgentId:"",chatbotId:""}],Us={contract_sent:{label:"Contract Sent",bg:"#FBBF2420",color:"#FBBF24"},interested:{label:"Interested",bg:"#60A5FA20",color:"#60A5FA"},active:{label:"Active",bg:"#4ADE8020",color:"#4ADE80"},onboarding:{label:"Onboarding",bg:"#A78BFA20",color:"#A78BFA"},paused:{label:"Paused",bg:"#F8717120",color:"#F87171"}};function Bs(){const[t,n]=(0,e.useState)([]),[r,a]=(0,e.useState)(null),[i,o]=(0,e.useState)("overview"),[l,c]=(0,e.useState)(!1),[d,u]=(0,e.useState)(!0),m=(0,e.useCallback)(async()=>{try{u(!0);let e=await(0,wn.kZ)();if(0===e.length){for(const e of Fs)await(0,wn.rN)(e);e=await(0,wn.kZ)()}n(e)}catch(e){console.error("Failed to load agency clients:",e),n(Fs.map((e,t)=>(0,s.A)((0,s.A)({},e),{},{id:"seed-".concat(t)})))}finally{u(!1)}},[]);(0,e.useEffect)(()=>{m()},[m]);const h=t.filter(e=>e.monthlyActive).reduce((e,t)=>
2{var n;return e+((null===(n=Ms[t.tier])||void 0===n?void 0:n.monthly)||0)},0),p=t.filter(e=>"active"===e.status).length,g=t.filter(e=>["contract_sent","interested","onboarding"].includes(e.status)).length;if(d)return(0,nn.jsx)("div",{style:{padding:"64px",textAlign:"center",color:"#6b7280"},children:(0,nn.jsx)("div",{style:{fontSize:"18px",fontWeight:"500"},children:"Loading agency clients..."})});if(r){var f,x,b;const e=t.find(e=>e.id===r);if(!e)return a(null),null;const i=Ms[e.tier],o=(null===i||void 0===i?void 0:i.services)||[];return(0,nn.jsxs)("div",{style:{padding:"32px",maxWidth:"1200px",margin:"0 auto"},children:[(0,nn.jsx)("button",{onClick:()=>a(null),style:{background:"none",border:"1px solid #d1d5db",borderRadius:"8px",padding:"8px 16px",cursor:"pointer",marginBottom:"24px",fontSize:"14px",color:"#374151"},children:"\u2190 Back to All Clients"}),(0,nn.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",marginBottom:"32px"},children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("h1",{style:{fontSize:"28px",fontWeight:"700",color:"#111827",marginBottom:"4px"},children:e.name}),(0,nn.jsxs)("p",{style:{color:"#6b7280",fontSize:"15px"},children:[e.owner," \xb7 ",e.phone," \xb7 ",e.address]})]}),(0,nn.jsx)("span",{style:{padding:"6px 16px",borderRadius:"100px",fontSize:"13px",fontWeight:"600",background:null===(f=Us[e.status])||void 0===f?void 0:f.bg,color:null===(x=Us[e.status])||void 0===x?void 0:x.color},children:null===(b=Us[e.status])||void 0===b?void 0:b.label})]}),(0,nn.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr 1fr 1fr",gap:"16px",marginBottom:"32px"},children:[(0,nn.jsxs)("div",{style:{background:"#f0fdf4",border:"1px solid #bbf7d0",borderRadius:"12px",padding:"20px",textAlign:"center"},children:[(0,nn.jsx)("div",{style:{fontSize:"12px",color:"#16a34a",fontWeight:"600",letterSpacing:".06em",textTransform:"uppercase",marginBottom:"4px"},children:"Tier"}),(0,nn.jsx)("div",{style:{fontSize:"20px",fontWeight:"700",color:"#111827"},children:null===i||void 0===i?void 0:i.name})]}),(0,nn.jsxs)("div",{style:{background:"#eff6ff",border:"1px solid #bfdbfe",borderRadius:"12px",padding:"20px",textAlign:"center"},children:[(0,nn.jsx)("div",{style:{fontSize:"12px",color:"#2563eb",fontWeight:"600",letterSpacing:".06em",textTransform:"uppercase",marginBottom:"4px"},children:"Monthly"}),(0,nn.jsxs)("div",{style:{fontSize:"20px",fontWeight:"700",color:"#111827"},children:["$",null===i||void 0===i?void 0:i.monthly,"/mo"]})]}),(0,nn.jsxs)("div",{style:{background:"#faf5ff",border:"1px solid #e9d5ff",borderRadius:"12px",padding:"20px",textAlign:"center"},children:[(0,nn.jsx)("div",{style:{fontSize:"12px",color:"#7c3aed",fontWeight:"600",letterSpacing:".06em",textTransform:"uppercase",marginBottom:"4px"},children:"Setup"}),(0,nn.jsx)("div",{style:{fontSize:"20px",fontWeight:"700",color:"#111827"},children:e.setupPaid?"Paid":"Pending"})]}),(0,nn.jsxs)("div",{style:{background:"#fefce8",border:"1px solid #fef08a",borderRadius:"12px",padding:"20px",textAlign:"center"},children:[(0,nn.jsx)("div",{style:{fontSize:"12px",color:"#ca8a04",fontWeight:"600",letterSpacing:".06em",textTransform:"uppercase",marginBottom:"4px"},children:"Domain"}),(0,nn.jsx)("div",{style:{fontSize:"14px",fontWeight:"600",color:"#111827"},children:e.domain||"Not set"})]})]}),(0,nn.jsxs)("div",{style:{background:"#fff",border:"1px solid #e5e7eb",borderRadius:"12px",padding:"24px",marginBottom:"24px"},children:[(0,nn.jsx)("h2",{style:{fontSize:"18px",fontWeight:"600",marginBottom:"16px",color:"#111827"},children:"Website"}),(0,nn.jsxs)("div",{style:{display:"flex",gap:"12px",alignItems:"center",marginBottom:"16px"},children:[(0,nn.jsx)("a",{href:e.siteUrl,target:"_blank",rel:"noopener noreferrer",style:{color:"#2563eb",fontSize:"14px"},children:e.siteUrl}),(0,nn.jsx)("button",{style:{background:"#111827",color:"#fff",border:"none",borderRadius:"8px",padding:"8px 20px",fontSize:"13px",fontWeight:"500",cursor:"pointer"},children:"Deploy to Vercel"}),e.domain&&(0,nn.jsx)("button",{style:{background:"#4f46e5",color:"#fff",border:"none",borderRadius:"8px",padding:"8px 20px",fontSize:"13px",fontWeight:"500",cursor:"pointer"},children:"Connect Domain"})]}),(0,nn.jsx)("div",{style:{border:"1px solid #e5e7eb",borderRadius:"8px",overflow:"hidden",height:"400px"},children:(0,nn.jsx)("iframe",{src:e.siteUrl,title:"Site Preview",style:{width:"100%",height:"100%",border:"none"}})})]}),(0,nn.jsxs)("div",{style:{background:"#fff",border:"1px solid #e5e7eb",borderRadius:"12px",padding:"24px",marginBottom:"24px"},children:[(0,nn.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"16
2px"},children:[(0,nn.jsx)("h2",{style:{fontSize:"18px",fontWeight:"600",color:"#111827"},children:"AI Services"}),(0,nn.jsxs)("select",{value:e.tier,onChange:r=>(async(e,r)=>{var a;const i=t.find(t=>t.id===e);if(!i)return;const o=(null===(a=Ms[r])||void 0===a?void 0:a.services)||[],l={};Object.keys(Os).forEach(e=>{l[e]=o.includes(e)&&i.services[e]||!1});try{await(0,wn.sP)(e,r),await(0,wn.u8)(e,{services:l}),n(t=>t.map(t=>t.id===e?(0,s.A)((0,s.A)({},t),{},{tier:r,services:l}):t))}catch(c){console.error("Failed to change tier:",c)}})(e.id,r.target.value),style:{padding:"8px 16px",borderRadius:"8px",border:"1px solid #d1d5db",fontSize:"14px",fontWeight:"500"},children:[(0,nn.jsx)("option",{value:"starter",children:"Starter \u2014 $79/mo"}),(0,nn.jsx)("option",{value:"professional",children:"Professional \u2014 $199/mo"}),(0,nn.jsx)("option",{value:"premium",children:"Premium \u2014 $399/mo"}),(0,nn.jsx)("option",{value:"enterprise",children:"Enterprise \u2014 Custom"})]})]}),(0,nn.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(200px, 1fr))",gap:"12px"},children:Object.entries(Os).map(r=>{let[a,i]=r;const l=o.includes(a),c=e.services[a];return(0,nn.jsxs)("div",{style:{padding:"16px",borderRadius:"10px",border:"1px solid ".concat(c?"#4ADE8040":"#e5e7eb"),background:c?"#f0fdf4":l?"#fff":"#f9fafb",opacity:l?1:.5,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("div",{style:{fontSize:"14px",fontWeight:"500",color:"#111827"},children:i}),(0,nn.jsx)("div",{style:{fontSize:"12px",color:l?"#16a34a":"#9ca3af"},children:l?c?"Active":"Available":"Upgrade required"})]}),l&&(0,nn.jsx)("button",{onClick:()=>(async(e,r)=>{var a;const i=t.find(t=>t.id===e);if(!i)return;if(!((null===(a=Ms[i.tier])||void 0===a?void 0:a.services)||[]).includes(r))return void alert("".concat(Os[r]," requires upgrading to a higher tier."));const o=!i.services[r];try{await(0,wn.Y9)(e,r,o),n(t=>t.map(t=>t.id===e?(0,s.A)((0,s.A)({},t),{},{services:(0,s.A)((0,s.A)({},t.services),{},{[r]:o})}):t))}catch(l){console.error("Failed to toggle service:",l)}})(e.id,a),style:{width:"44px",height:"24px",borderRadius:"12px",border:"none",cursor:"pointer",background:c?"#4ADE80":"#d1d5db",position:"relative",transition:"background .2s"},children:(0,nn.jsx)("div",{style:{width:"20px",height:"20px",borderRadius:"10px",background:"#fff",position:"absolute",top:"2px",transition:"left .2s",left:c?"22px":"2px",boxShadow:"0 1px 3px rgba(0,0,0,.2)"}})})]},a)})})]}),(0,nn.jsxs)("div",{style:{background:"#fff",border:"1px solid #e5e7eb",borderRadius:"12px",padding:"24px"},children:[(0,nn.jsx)("h2",{style:{fontSize:"18px",fontWeight:"600",marginBottom:"12px",color:"#111827"},children:"Notes"}),(0,nn.jsx)("p",{style:{color:"#4b5563",fontSize:"14px",lineHeight:"1.7"},children:e.notes})]})]})}return(0,nn.jsxs)("div",{style:{padding:"32px",maxWidth:"1200px",margin:"0 auto"},children:[(0,nn.jsx)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"32px"},children:(0,nn.jsxs)("div",{children:[(0,nn.jsx)("h1",{style:{fontSize:"28px",fontWeight:"700",color:"#111827"},children:"Agency Clients"}),(0,nn.jsx)("p",{style:{color:"#6b7280",fontSize:"15px",marginTop:"4px"},children:"Manage web design clients and AI services"})]})}),(0,nn.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gap:"16px",marginBottom:"32px"},children:[(0,nn.jsxs)("div",{style:{background:"#fff",border:"1px solid #e5e7eb",borderRadius:"12px",padding:"20px",borderTop:"3px solid #4ADE80"},children:[(0,nn.jsx)("div",{style:{fontSize:"12px",color:"#6b7280",fontWeight:"600",letterSpacing:".06em",textTransform:"uppercase",marginBottom:"4px"},children:"Active Clients"}),(0,nn.jsx)("div",{style:{fontSize:"28px",fontWeight:"700",color:"#111827"},children:p})]}),(0,nn.jsxs)("div",{style:{background:"#fff",border:"1px solid #e5e7eb",borderRadius:"12px",padding:"20px",borderTop:"3px solid #60A5FA"},children:[(0,nn.jsx)("div",{style:{fontSize:"12px",color:"#6b7280",fontWeight:"600",letterSpacing:".06em",textTransform:"uppercase",marginBottom:"4px"},children:"In Pipeline"}),(0,nn.jsx)("div",{style:{fontSize:"28px",fontWeight:"700",color:"#111827"},children:g})]}),(0,nn.jsxs)("div",{style:{background:"#fff",border:"1px solid #e5e7eb",borderRadius:"12px",padding:"20px",borderTop:"3px solid #FBBF24"},children:[(0,nn.jsx)("div",{style:{fontSize:"12px",color:"#6b7280",fontWeight:"600",letterSpacing:".06em",textTransform:"uppercase",marginBottom:"4px"},children:"Monthly Revenue"}),(0,nn.jsxs)("div",{style:{fontSize:"28px",fontWeight:"700",color:"#111827"},children:["$",h]})]}),(0,nn.jsxs)("div",{style:{background:"#fff",border:"1px solid #e5e7eb",borderRadius:"12px",padding:"20px",borderTop:"3px solid #A78BFA"},children:[(0,nn.jsx)("div",{style:{fontSize:"12px",color:"#6b7280",fontWeight:"600",letterSpacing:".06em",textTransform:"uppercase",marginBottom:"4px"},children:"Total Clients"}),(0,nn.jsx)("div",{style:{fontSize:"28px",fontWeight:"700",color:"#111827"},children:t.length})]})]}),(0,nn.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(400px, 1fr))",gap:"16px",marginBottom:"32px"},children:t.map(e=>{var t,n,r;const s=Ms[e.tier];return(0,nn.jsxs)("div",{onClick:()=>a(e.id),style:{background:"#fff",border:"1px solid #e5e7eb",borderRadius:"12px",padding:"24px",cursor:"pointer",transition:"all .2s",borderLeft:"4px solid ".concat(null===s||void 0===s?void 0:s.color)},onMouseOver:e=>e.currentTarget.style.boxShadow="0 4px 20px rgba(0,0,0,.08)",onMouseOut:e=>e.currentTarget.style.boxShadow="none",children:[(0,nn.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",marginBottom:"12px"},children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("div",{style:{fontSize:"18px",fontWeight:"600",color:"#111827"},children:e.name}),(0,nn.jsxs)("div",{style:{fontSize:"14px",color:"#6b7280"},children:[e.owner," \xb7 ",e.phone]}
2)]}),(0,nn.jsx)("span",{style:{padding:"4px 12px",borderRadius:"100px",fontSize:"12px",fontWeight:"600",background:null===(t=Us[e.status])||void 0===t?void 0:t.bg,color:null===(n=Us[e.status])||void 0===n?void 0:n.color},children:null===(r=Us[e.status])||void 0===r?void 0:r.label})]}),(0,nn.jsxs)("div",{style:{display:"flex",gap:"8px",marginBottom:"12px"},children:[(0,nn.jsx)("span",{style:{padding:"3px 10px",borderRadius:"6px",fontSize:"12px",fontWeight:"500",background:"".concat(null===s||void 0===s?void 0:s.color,"20"),color:null===s||void 0===s?void 0:s.color},children:null===s||void 0===s?void 0:s.name}),(0,nn.jsxs)("span",{style:{padding:"3px 10px",borderRadius:"6px",fontSize:"12px",background:"#f3f4f6",color:"#6b7280"},children:["$",null===s||void 0===s?void 0:s.monthly,"/mo"]})]}),(0,nn.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:"6px"},children:Object.entries(e.services).map(e=>{let[t,n]=e;return(0,nn.jsx)("span",{style:{padding:"2px 8px",borderRadius:"4px",fontSize:"11px",fontWeight:"500",background:n?"#4ADE8015":"#f3f4f6",color:n?"#16a34a":"#9ca3af",border:"1px solid ".concat(n?"#4ADE8030":"#e5e7eb")},children:Os[t]||t},t)})})]},e.id)})}),(0,nn.jsx)("h2",{style:{fontSize:"20px",fontWeight:"600",color:"#111827",marginBottom:"16px",paddingBottom:"12px",borderBottom:"1px solid #e5e7eb"},children:"AI Agent Manager"}),(0,nn.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:"16px"},children:[(0,nn.jsxs)("div",{style:{background:"#fff",border:"1px solid #e5e7eb",borderRadius:"12px",padding:"20px"},children:[(0,nn.jsx)("div",{style:{fontSize:"14px",fontWeight:"600",color:"#111827",marginBottom:"12px"},children:"Chatbots"}),t.map(e=>(0,nn.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"8px 0",borderBottom:"1px solid #f3f4f6",fontSize:"13px"},children:[(0,nn.jsx)("span",{style:{color:"#374151"},children:e.name}),(0,nn.jsx)("span",{style:{width:"8px",height:"8px",borderRadius:"50%",background:e.services.chatbot?"#4ADE80":"#d1d5db"}})]},e.id))]}),(0,nn.jsxs)("div",{style:{background:"#fff",border:"1px solid #e5e7eb",borderRadius:"12px",padding:"20px"},children:[(0,nn.jsx)("div",{style:{fontSize:"14px",fontWeight:"600",color:"#111827",marginBottom:"12px"},children:"Phone Agents"}),t.map(e=>(0,nn.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"8px 0",borderBottom:"1px solid #f3f4f6",fontSize:"13px"},children:[(0,nn.jsx)("span",{style:{color:"#374151"},children:e.name}),(0,nn.jsx)("span",{style:{width:"8px",height:"8px",borderRadius:"50%",background:e.services.phone?"#4ADE80":"#d1d5db"}})]},e.id))]}),(0,nn.jsxs)("div",{style:{background:"#fff",border:"1px solid #e5e7eb",borderRadius:"12px",padding:"20px"},children:[(0,nn.jsx)("div",{style:{fontSize:"14px",fontWeight:"600",color:"#111827",marginBottom:"12px"},children:"Review Systems"}),t.map(e=>(0,nn.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"8px 0",borderBottom:"1px solid #f3f4f6",fontSize:"13px"},children:[(0,nn.jsx)("span",{style:{color:"#374151"},children:e.name}),(0,nn.jsx)("span",{style:{width:"8px",height:"8px",borderRadius:"50%",background:e.services.reviews?"#4ADE80":"#d1d5db"}})]},e.id))]})]})]})}const zs={PHONE_VERIFIED:{label:"Phone Verified",bg:"#4ADE8025",color:"#16a34a",border:"#4ADE80"},PHONE_UNCONFIRMED:{label:"Unconfirmed",bg:"#FBBF2425",color:"#ca8a04",border:"#FBBF24"},NEEDS_ALT_CONTACT:{label:"Dead Phone",bg:"#F8717125",color:"#dc2626",border:"#F87171"},REMOVED:{label:"Removed",bg:"#9ca3af20",color:"#6b7280",border:"#9ca3af"}},Vs=[{id:"p1",business:"Minutemen Land Services",owner:"Jordan Grant",phone:"+12032477744",phoneDisplay:"(203) 247-7744",industry:"Landscaping",verifyStatus:"PHONE_VERIFIED",demoSite:"https://apn-demos.vercel.app/minutemen-land-services",town:"Norwalk",wave:1,notes:"Retainer sent 3/30, NOT PAID",overdue:!0},{id:"p2",business:"A to Z Property Maintenance",owner:"Daimeon Baity",phone:"+12037759174",phoneDisplay:"(203) 775-9174",industry:"Property Maintenance",verifyStatus:"PHONE_VERIFIED",demoSite:"https://apn-demos.vercel.app/a-to-z-property-maintenance-llc",town:"Brookfield",wave:1,notes:"",overdue:!1},{id:"p3",business:"Elite Gutter Solutions",owner:"Marcus Webb",phone:"+12034459988",phoneDis
2play:"(203) 445-9988",industry:"Gutters",verifyStatus:"PHONE_UNCONFIRMED",demoSite:"https://apn-demos.vercel.app/elite-gutter-solutions",town:"Stamford",wave:1,notes:"No answer 3x, try again",overdue:!1},{id:"p4",business:"Premier Paving CT",owner:"Dave Kowalski",phone:"+12036781234",phoneDisplay:"(203) 678-1234",industry:"Paving",verifyStatus:"PHONE_VERIFIED",demoSite:"https://apn-demos.vercel.app/premier-paving-ct",town:"Danbury",wave:1,notes:"",overdue:!1},{id:"p5",business:"Tri-State Roofing",owner:"Anthony Russo",phone:"+12039995544",phoneDisplay:"(203) 999-5544",industry:"Roofing",verifyStatus:"NEEDS_ALT_CONTACT",demoSite:"https://apn-demos.vercel.app/tri-state-roofing",town:"Bridgeport",wave:2,notes:"Number disconnected",overdue:!1},{id:"p6",business:"Clean Cut Lawn Care",owner:"Tyler Morgan",phone:"+12038871122",phoneDisplay:"(203) 887-1122",industry:"Lawn Care",verifyStatus:"PHONE_UNCONFIRMED",demoSite:"https://apn-demos.vercel.app/clean-cut-lawn-care",town:"Milford",wave:2,notes:"Voicemail left",overdue:!1},{id:"p7",business:"CT Deck Builders",owner:"Brian Sullivan",phone:"+12035563300",phoneDis
2play:"(203) 556-3300",industry:"Decks",verifyStatus:"PHONE_VERIFIED",demoSite:"https://apn-demos.vercel.app/ct-deck-builders",town:"Fairfield",wave:2,notes:"",overdue:!1}],qs={currentWave:2,totalWaves:5,townsDone:["Norwalk","Stamford","Bridgeport","Danbury","Brookfield","Fairfield","Milford"],townsRemaining:["New Haven","Hartford","Waterbury","Greenwich","Westport","Shelton","Trumbull","Monroe"],newThisWeek:4},Ws={starter:{name:"Starter",monthly:79,color:"#4ADE80"},professional:{name:"Professional",monthly:199,color:"#60A5FA"},premium:{name:"Premium",monthly:399,color:"#A78BFA"}};function Hs(){const[t,n]=(0,e.useState)(Vs),[r,a]=(0,e.useState)([]),[i,o]=(0,e.useState)(!0),[l,c]=(0,e.useState)(new Date),d=(0,e.useCallback)(async()=>{try{o(!0);const e=await(0,wn.kZ)();a(e)}catch(e){console.error("Failed to load clients:",e),a([])}finally{o(!1),c(new Date)}},[]);(0,e.useEffect)(()=>{d()},[d]);const u=t.filter(e=>"PHONE_VERIFIED"===e.verifyStatus),m=t.filter(e=>"PHONE_UNCONFIRMED"===e.verifyStatus),h=t.filter(e=>"NEEDS_ALT_CONTACT"===e.verifyStatus),p=t.filter(e=>e.overdue),g=t.filter(e=>"REMOVED"!==e.verifyStatus),f=r.filter(e=>e.monthlyActive).reduce((e,t)=>{var n;return e+((null===(n=Ws[t.tier])||void 0===n?void 0:n.monthly)||0)},0),x=79*g.length;return i?(0,nn.jsx)("div",{style:{padding:"40px 16px",textAlign:"center",color:"#6b7280"},children:(0,nn.jsx)("div",{style:{fontSize:"18px",fontWeight:"500"},children:"Loading pipeline..."})}):(0,nn.jsxs)("div",{style:{padding:"16px",maxWidth:"1200px",margin:"0 auto"},children:[(0,nn.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",justifyContent:"space-between",alignItems:"center",marginBottom:"20px",gap:"12px"},children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("h1",{style:{fontSize:"24px",fontWeight:"700",color:"#111827",margin:0},children:"Agency Pipeline"}),(0,nn.jsxs)("p",{style:{color:"#6b7280",fontSize:"13px",marginTop:"4px"},children:["Last refreshed: ",l.toLocaleTimeString()]})]}),(0,nn.jsx)("button",{onClick:()=>{d(),n([...Vs])},style:{background:"#111827",color:"#fff",border:"none",borderRadius:"8px",padding:"10px 20px",fontSize:"14px",fontWeight:"600",cursor:"pointer"},children:"Refresh"})]}),(0,nn.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(140px, 1fr))",gap:"10px",marginBottom:"24px"},children:[{label:"Total Prospects",value:g.length,color:"#111827",topColor:"#6b7280"},{label:"Phone Verified",value:u.length,color:"#16a34a",topColor:"#4ADE80"},{label:"Unconfirmed",value:m.length,color:"#ca8a04",topColor:"#FBBF24"},{label:"Current MRR",value:"$".concat(f),color:"#2563eb",topColor:"#60A5FA"},{label:"Pipeline Value",value:"$".concat(x),color:"#7c3aed",topColor:"#A78BFA"}].map(e=>(0,nn.jsxs)("div",{style:{background:"#fff",border:"1px solid #e5e7eb",borderRadius:"10px",padding:"14px",borderTop:"3px solid ".concat(e.topColor),textAlign:"center"},children:[(0,nn.jsx)("div",{style:{fontSize:"11px",color:"#6b7280",fontWeight:"600",textTransform:"uppercase",letterSpacing:".05em",marginBottom:"4px"},children:e.label}),(0,nn.jsx)("div",{style:{fontSize:"22px",fontWeight:"700",color:e.color},children:e.value})]},e.label))}),(p.length>0||u.length>0||m.length>0)&&(0,nn.jsxs)("div",{style:{background:"#fef2f2",border:"2px solid #fca5a5",borderRadius:"12px",padding:"20px",marginBottom:"24px"},children:[(0,nn.jsx)("h2",{style:{fontSize:"18px",fontWeight:"700",color:"#dc2626",margin:"0 0 16px 0"},children:"NEEDS ATTENTION"}),p.length>0&&(0,nn.jsxs)("div",{style:{marginBottom:"16px"},children:[(0,nn.jsxs)("div",{style:{fontSize:"13px",fontWeight:"700",color:"#991b1b",textTransform:"uppercase",letterSpacing:".05em",marginBottom:"8px"},children:["Overdue Payments (",p.length,")"]}),p.map(e=>(0,nn.jsxs)("div",{style:{background:"#fff",borderRadius:"8px",padding:"12px 16px",marginBottom:"6px",border:"1px solid #fca5a5",display:"flex",flexWrap:"wrap",justifyContent:"space-between",alignItems:"center",gap:"8px"},children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("span",{style:{fontWeight:"600",color:"#111827"},children:e.owner}),(0,nn.jsxs)("span",{style:{color:"#dc2626",fontSize:"13px"},children:[" -- ",e.notes]})]}),(0,nn.jsx)("a",{href:"tel:".concat(e.phone),style:{background:"#dc2626",color:"#fff",padding:"6px 14px",borderRadius:"6px",fontSize:"13px",fontWeight:"600",textDecoration:"none"},children:"Call Now"})]},e.id))]}),u.length>
20&&(0,nn.jsxs)("div",{style:{marginBottom:"16px"},children:[(0,nn.jsxs)("div",{style:{fontSize:"13px",fontWeight:"700",color:"#16a34a",textTransform:"uppercase",letterSpacing:".05em",marginBottom:"8px"},children:["Phone Verified - Ready for Outreach (",u.length,")"]}),u.filter(e=>!e.overdue).map(e=>(0,nn.jsxs)("div",{style:{background:"#fff",borderRadius:"8px",padding:"10px 14px",marginBottom:"4px",border:"1px solid #bbf7d0",display:"flex",flexWrap:"wrap",justifyContent:"space-between",alignItems:"center",gap:"8px"},children:[(0,nn.jsxs)("div",{style:{fontSize:"14px"},children:[(0,nn.jsx)("span",{style:{fontWeight:"600",color:"#111827"},children:e.business}),(0,nn.jsxs)("span",{style:{color:"#6b7280"},children:[" -- ",e.owner]})]}),(0,nn.jsx)("a",{href:"tel:".concat(e.phone),style:{color:"#16a34a",fontWeight:"600",fontSize:"13px",textDecoration:"none"},children:e.phoneDisplay})]},e.id))]}),m.length>0&&(0,nn.jsx)("div",{children:(0,nn.jsxs)("div",{style:{fontSize:"13px",fontWeight:"700",color:"#ca8a04",textTransform:"uppercase",letterSpacing:".05em",marginBottom:"8px"},children:["Phone Unconfirmed - Retry Needed (",m.length,")"]})})]}),(0,nn.jsx)("h2",{style:{fontSize:"20px",fontWeight:"700",color:"#111827",margin:"0 0 16px 0",paddingBottom:"10px",borderBottom:"2px solid #e5e7eb"},children:"Prospect Pipeline"}),(0,nn.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(320px, 1fr))",gap:"14px",marginBottom:"32px"},children:t.filter(e=>"REMOVED"!==e.verifyStatus).map(e=>{const r=zs[e.verifyStatus];return(0,nn.jsxs)("div",{style:{background:"#fff",borderRadius:"12px",padding:"18px",border:"1px solid #e5e7eb",borderLeft:"5px solid ".concat(r.border),boxShadow:"0 1px 3px rgba(0,0,0,.04)"},children:[(0,nn.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",justifyContent:"space-between",alignItems:"flex-start",gap:"8px",marginBottom:"10px"},children:[(0,nn.jsx)("div",{style:{fontSize:"16px",fontWeight:"700",color:"#111827"},children:e.business}),(0,nn.jsx)("span",{style:{padding:"3px 10px",borderRadius:"100px",fontSize:"11px",fontWeight:"600",background:r.bg,color:r.color,whiteSpace:"nowrap"},children:r.label})]}),(0,nn.jsx)("div",{style:{fontSize:"14px",color:"#374151",marginBottom:"4px"},children:e.owner}),(0,nn.jsx)("a",{href:"tel:".concat(e.phone),style:{display:"inline-block",fontSize:"14px",color:"#2563eb",fontWeight:"600",textDecoration:"none",marginBottom:"6px"},children:e.phoneDisplay}),(0,nn.jsxs)("div",{style:{fontSize:"13px",color:"#6b7280",marginBottom:"8px"},children:[e.industry," -- ",e.town]}),e.notes&&(0,nn.jsx)("div",{style:{fontSize:"12px",color:e.overdue?"#dc2626":"#6b7280",fontWeight:e.overdue?"600":"400",background:e.overdue?"#fef2f2":"#f9fafb",padding:"6px 10px",borderRadius:"6px",marginBottom:"10px"},children:e.notes}),(0,nn.jsx)("a",{href:e.demoSite,target:"_blank",rel:"noopener noreferrer",style:{display:"inline-block",fontSize:"12px",color:"#7c3aed",marginBottom:"12px",textDecoration:"none"},children:"View Demo Site"}),(0,nn.jsxs)("div",{style:{display:"flex",gap:"8px",flexWrap:"wrap"},children:[(0,nn.jsx)("button",{onClick:()=>{return t=e.id,n(e=>e.map(e=>e.id===t?(0,s.A)((0,s.A)({},e),{},{notes:(e.notes?e.notes+" | ":"")+"INTERESTED "+(new Date).toLocaleDateString()}):e)),void alert("Marked as interested!");var t},style:{flex:"1 1 auto",background:"#4ADE80",color:"#fff",border:"none",borderRadius:"8px",padding:"8px 12px",fontSize:"13px",fontWeight:"600",cursor:"pointer",minWidth:"120px"},children:"Mark Interested"}),(0,nn.jsx)("button",{onClick:()=>(e=>{const n=t.find(t=>t.id===e);n&&alert("Follow-up queued for ".concat(n.business," (").concat(n.owner,")"))})(e.id),style:{flex:"1 1 auto",background:"#2563eb",color:"#fff",border:"none",borderRadius:"8px",padding:"8px 12px",fontSize:"13px",fontWeight:"600",cursor:"pointer",minWidth:"120px"},children:"Send Follow-up"})]})]},e.id)})}),(0,nn.jsx)("h2",{style:{fontSize:"20px",fontWeight:"700",color:"#111827",margin:"0 0 16px 0",paddingBottom:"10px",borderBottom:"2px solid #e5e7eb"},children:"Client Status"}),(0,nn.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(320px, 1fr))",gap:"14px",marginBottom:"32px"},children:[(0,nn.jsxs)("div",{style:{background:"#fff",border:"1px solid #e5e7eb",borderRadius:"12px",padding:"18px"},children:[(0,nn.jsx)("div",{style:{fontSize:"15px",fontWeight:"700",color:"#111827",marginBottom:"14px"},children:"Active Clients"}),0===r.filter(e=>"active"===e.status||e.monthlyActive).length&&(0,nn.jsx)("div",{style:{color:"#9ca3af",fontSize:"13px"},children:"No active clients yet"}),r.filter(e=>"active"===e.status||e.monthlyActive).map(e=>{const t=Ws[e.tier];return(0,nn.jsxs)("div",{style:{padding:"12px",borderRadius:"8px",border:"1px solid ".concat((null===t||void 0===t?void 0:t.color)||"#e5e7eb","20"),background:"".concat((null===t||void 0===t?void 0:t.color)||"#f3f4f6","08"),marginBottom:"8px"},children:[(0,nn.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"4px"},children:[(0,nn.jsx)("span",{style:{fontWeight:"600",fontSize:"14px",color:"#111827"},children:e.name}),(0,nn.jsxs)("span",{style:{fontSize:"12px",fontWeight:"600",color:(null===t||void 0===t?void 0:t.color)||"#6b7280"},children:[null===t||void 0===t?void 0:t.name," -- $",null===t||void 0===t?void 0:t.monthly,"/mo"]})]}),(0,nn.jsx)("div",{style:{fontSize:"13px",color:"#6b7280"},children:e.owner}),e.phone&&(0,nn.jsx)("a",{href:"tel:".concat(e.phone.replace(/[^\d+]/g,"")),style:{fontSize:"13px",color:"#2563eb",textDecoration:"none"},children:e.phone})]},e.id)})]}),(0,nn.jsxs)("div",{style:{background:"#fff",border:"1px solid #e5e7eb",borderRadius:"12px",padding:"18px"},children:[(0,nn.jsx)("div",{style:{fontSize:"15px",fontWeight:"700",color:"#111827",marginBottom:"14px"},children:"Warm Leads"}),0===r.filter(e=>["interested","contract_sent","onboarding"].includes(e.status)).length&&(0,nn.jsx)("div",{style:{color:"#9ca3af",fontSize:"13px"},children:"No warm leads in CRM"}),r.filter(e=>["interested","contract_sent","onboarding"].includes(e.status)).map(e=>(0,nn.jsxs)("div",{style:{padding:"12px",borderRadius:"8px",border:"1px solid #FBBF2430",background:"#FBBF2408",marginBottom:"8px"},children:[(0,nn.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"4px"},children:[(0,nn.jsx)("span",{style:{fontWeight:"600",fontSize:"14px",color:"#111827"},children:e.name}),(0,nn.jsx)("span",{style:{padding:"2px 8px",borderRadius:"100px",fontSize:"11px",fontWeight:"600",background:"contract_sent"===e.status?"#FBBF2420":"#60A5FA20",color:"contract_sent"===e.status?"#ca8a04":"#2563eb"},children:"contract_sent"===e.status?"Contract Sent":"interested"===e.status?"Interested":"Onboarding"})]}),(0,nn.jsx)("div",{style:{fontSize:"13px",color:"#6b7280"},children:e.owner}),e.phone&&(0,nn.jsx)("a",{href:"tel:".concat(e.phone.replace(/[^\d+]/g,"")),style:{fontSize:"13px",color:"#2563eb",textDecoration:"none"},children:e.phone})]},e.id))]})]}),(0,nn.jsx)("h2",{style:{fontSize:"20px",fontWeight:"700",color:"#111827",margin:"0 0 16px 0",paddingBottom:"10px",borderBottom:"2px s
2olid #e5e7eb"},children:"Scraper Progress"}),(0,nn.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(280px, 1fr))",gap:"14px",marginBottom:"32px"},children:[(0,nn.jsxs)("div",{style:{background:"#fff",border:"1px solid #e5e7eb",borderRadius:"12px",padding:"18px"},children:[(0,nn.jsx)("div",{style:{fontSize:"15px",fontWeight:"700",color:"#111827",marginBottom:"12px"},children:"Wave Progress"}),(0,nn.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:"8px"},children:[(0,nn.jsx)("span",{style:{fontSize:"13px",color:"#6b7280"},children:"Current Wave"}),(0,nn.jsxs)("span",{style:{fontSize:"14px",fontWeight:"700",color:"#111827"},children:[qs.currentWave," / ",qs.totalWaves]})]}),(0,nn.jsx)("div",{style:{background:"#e5e7eb",borderRadius:"4px",height:"8px",marginBottom:"14px"},children:(0,nn.jsx)("div",{style:{background:"#4ADE80",borderRadius:"4px",height:"8px",width:"".concat(qs.currentWave/qs.totalWaves*100,"%")}})}),(0,nn.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:"4px"},children:[(0,nn.jsx)("span",{style:{fontSize:"13px",color:"#6b7280"},children:"Towns Done"}),(0,nn.jsx)("span",{style:{fontSize:"14px",fontWeight:"600",color:"#16a34a"},children:qs.townsDone.length})]}),(0,nn.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:"4px"},children:[(0,nn.jsx)("span",{style:{fontSize:"13px",color:"#6b7280"},children:"Towns Remaining"}),(0,nn.jsx)("span",{style:{fontSize:"14px",fontWeight:"600",color:"#ca8a04"},children:qs.townsRemaining.length})]}),(0,nn.jsxs)("div",{style:{display:"flex",justifyContent:"space-between"},children:[(0,nn.jsx)("span",{style:{fontSize:"13px",color:"#6b7280"},children:"New This Week"}),(0,nn.jsx)("span",{style:{fontSize:"14px",fontWeight:"600",color:"#2563eb"},children:qs.newThisWeek})]})]}),(0,nn.jsxs)("div",{style:{background:"#fff",border:"1px solid #e5e7eb",borderRadius:"12px",padding:"18px"},children:[(0,nn.jsx)("div",{style:{fontSize:"15px",fontWeight:"700",color:"#111827",marginBottom:"12px"},children:"Towns Completed"}),(0,nn.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:"6px"},children:qs.townsDone.map(e=>(0,nn.jsx)("span",{style:{padding:"4px 10px",borderRadius:"6px",fontSize:"12px",fontWeight:"500",background:"#f0fdf4",color:"#16a34a",border:"1px solid #bbf7d0"},children:e},e))}),(0,nn.jsx)("div",{style:{fontSize:"13px",fontWeight:"600",color:"#6b7280",marginTop:"14px",marginBottom:"6px"},children:"Remaining"}),(0,nn.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:"6px"},children:qs.townsRemaining.map(e=>(0,nn.jsx)("span",{style:{padding:"4px 10px",borderRadius:"6px",fontSize:"12px",fontWeight:"500",background:"#f9fafb",color:"#9ca3af",border:"1px solid #e5e7eb"},children:e},e))})]}),(0,nn.jsxs)("div",{style:{background:"#fff",border:"1px solid #e5e7eb",borderRadius:"12px",padding:"18px"},children:[(0,nn.jsx)("div",{style:{fontSize:"15px",fontWeight:"700",color:"#111827",marginBottom:"12px"},children:"Pipeline Summary"}),(0,nn.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",padding:"8px 0",borderBottom:"1px solid #f3f4f6"},children:[(0,nn.jsx)("span",{style:{fontSize:"13px",color:"#6b7280"},children:"Total in Pipeline"}),(0,nn.jsx)("span",{style:{fontSize:"14px",fontWeight:"700",color:"#111827"},children:g.length})]}),(0,nn.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",padding:"8px 0",borderBottom:"1px solid #f3f4f6"},children:[(0,nn.jsx)("span",{style:{fontSize:"13px",color:"#16a34a"},children:"Phone Verified"}),(0,nn.jsx)("span",{style:{fontSize:"14px",fontWeight:"600",color:"#16a34a"},children:u.length})]}),(0,nn.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",padding:"8px 0",borderBottom:"1px solid #f3f4f6"},children:[(0,nn.jsx)("span",{style:{fontSize:"13px",color:"#ca8a04"},children:"Unconfirmed"}),(0,nn.jsx)("span",{style:{fontSize:"14px",fontWeight:"600",color:"#ca8a04"},children:m.length})]}),(0,nn.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",padding:"8px 0",borderBottom:"1px solid #f3f4f6"},children:[(0,nn.jsx)("span",{style:{fontSize:"13px",color:"#dc2626"},children:"Dead Phone"}),(0,nn.jsx)("span",{style:{fontSize:"14px",fontWeight:"600",color:"#dc2626"},children:h.length})]}),(0,nn.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",padding:"8px 0"},children:[(0,nn.jsx)("span",{style:{fontSize:"13px",color:"#dc2626",fontWeight:"600"},children:"Overdue Payment"}),(0,nn.jsx)("span",{style:{fontSize:"14px",fontWeight:"700",color:"#dc2626"},children:p.length})]})]})]})]})}"".concat(window.location.origin,"/auth/linkedin/callback");const Gs={"finance-professionals":{id:"finance-professionals-network",name:"Finance Professionals Network",description:"Connect with finance professionals across all industries",category:"Professional",memberCount:15e3,linkedinUrl:"https://www.linkedin.com/groups/finance-professionals-network",
2isActive:!0},"recent-graduates":{id:"finance-recent-graduates",name:"Finance Recent Graduates",description:"New graduates in finance seeking opportunities and mentorship",category:"Graduate",memberCount:8500,linkedinUrl:"https://www.linkedin.com/groups/finance-recent-graduates",isActive:!0},"investment-banking":{id:"investment-banking-professionals",name:"Investment Banking Professionals",description:"Investment banking analysts, associates, and VPs",category:"Specialty",memberCount:12e3,linkedinUrl:"https://www.linkedin.com/groups/investment-banking-professionals",isActive:!0},"corporate-finance":{id:"corporate-finance-network",name:"Corporate Finance Network",description:"Corporate finance professionals and FP&A specialists",category:"Specialty",memberCount:9800,linkedinUrl:"https://www.linkedin.com/groups/corporate-finance-network",isActive:!0},"accounting-professionals":{id:"accounting-professionals-network",name:"Accounting Professionals Network",description:"CPAs, accounting managers, and finance professionals",category:"Professional",memberCount:18500,linkedinUrl:"https://www.linkedin.com/groups/accounting-professionals-network",isActive:!0}},Ys={education:{degrees:["Bachelor","Master","MBA"],majors:["Finance","Accounting","Economics","Business Administration","Mathematics","Statistics","Data Science"],graduationYears:[2023,2024,2025]},experience:{maxYears:2,relevantInternships:["Investment Banking","Corporate Finance","Accounting","Financial Analysis","Consulting"]},skills:["Financial Modeling","Excel","PowerPoint","SQL","Python","R","Tableau","Financial Analysis","Valuation"]},Ks=()=>new Promise((e,t)=>{t(new Error("LinkedIn integration is not configured. Please contact your administrator."))}),Js=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{const t=(0,s.A)((0,s.A)({},Ys),e),n=[{id:"grad-001",name:"Sarah Johnson",degree:"Bachelor of Finance",university:"University of Pennsylvania",graduationYear:2024,location:"New York, NY",skills:["Financial Modeling","Excel","PowerPoint"],internships:["Goldman Sachs - Investment Banking Intern"],linkedinUrl:"https://linkedin.com/in/sarah-johnson-finance",isAvailable:!0,preferredRoles:["Investment Banking Analyst","Corporate Finance Analyst"]},{id:"grad-002",name:"Michael Chen",degree:"Master of Business Administration",university:"Northwestern Kellogg",graduationYear:2024,location:"Chicago, IL",skills:["Financial Analysis","SQL","Python","Valuation"],internships:["McKinsey & Company - Business Analyst Intern"],linkedinUrl:"https://linkedin.com/in/michael-chen-mba",isAvailable:!0,preferredRoles:["Corporate Development","Strategy & Operations"]},{id:"grad-003",name:"Emily Rodriguez",degree:"Bachelor of Accounting",university:"University of Texas at Austin",graduationYear:2024,location:"Austin, TX",skills:["Financial Reporting","Excel","QuickBooks","Tableau"],internships:["PwC - Audit Intern","Dell - Finance Intern"],linkedinUrl:"https://linkedin.com/in/emily-rodriguez-cpa",isAvailable:!0,preferredRoles:["Staff Accountant","Financial Analyst"]}].filter(t=>!(e.location&&!t.location.toLowerCase().includes(e.location.toLowerCase()))&&((!e.graduationYear||t.graduationYear===e.graduationYear)&&!(e.skills&&!e.skills.some(e=>t.skills.includes(e)))));return{graduates:n,totalCount:n.length,searchCriteria:t}}catch(t){throw console.error("Error searching recent graduates:",t),t}},$s=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{const n=Gs[e];if(!n)throw new Error("LinkedIn group not found");return{groupInfo:n,members:[{id:"member-001",name:"David Kim",headline:"Senior Financial Analyst at Microsoft",location:"Seattle, WA",experience:"3 years",skills:["Financial Planning","Budget Analysis","Excel"],linkedinUrl:"https://linkedin.com/in/david-kim-finance",groupRole:"Member",joinDate:"2023-01-15"},{id:"member-002",name:"Lisa Wang",headline:"Investment Banking Associate at JPMorgan Chase",location:"New York, NY",experience:"2 years",skills:["M&A","Financial Modeling","Valuation"],linkedinUrl:"https://linkedin.com/in/lisa-wang-ib",groupRole:"Active Member",joinDate:"2022-08-20"}],totalMembers:n.memberCount,filters:t}}catch(n){throw console.error("Error fetching LinkedIn group members:",n),n}},Qs=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];try{await Ks();const e=t.map(async e=>{const t=Gs[e];return t?{groupId:e,groupName:t.name,shared:!0,shareUrl:"".concat(t.linkedinUrl,"/share"),timestamp:(new Date).toISOString()}:null});return(await Promise.all(e)).filter(e=>null!==e)}catch(n){throw console.error("Error sharing to LinkedIn groups:",n),n}},Xs=()=>{const{currentUser:t,hasRole:n}=sn(),[r,s]=(0,e.useState)(null),[a,i]=(0,e.useState)([]),[o,l]=(0,e.useState)(!1),[c,d]=(0,e.useState)(""),[u,m]=(0,e.useState)(!1);if(!n("admin"))return(0,nn.jsx)("div",{className:"flex justify-center items-center h-screen",children:(0,nn.jsxs)("div",{className:"text-center",children:[(0,nn.jsx)("h2",{className:"text-2xl font-bold text-gray-900 mb-4",children:"Access Denied"}),(0,nn.jsx)("p",{className:"text-gray-600 mb-4",children:"LinkedIn integration is only available to administrators."}),(0,nn.jsx)("p",{className:"text-sm text-gray-500",children:"This feature is used for internal talent sourcing and professional networking."}),(0,nn.jsx)("button",{onClick:()=>window.history.back(),className:"mt-4 bg-apn-blue text-white px-4 py-2 rounded hover:bg-blue-700",children:"Go Back"})]})});const h={Professional:Object.values(Gs).filter(e=>"Professional"===e.category),Graduate:Object.values(Gs).filter(e=>"Graduate"===e.category),Specialty:Object.values(Gs).filter(e=>"Specialty"===e.category)};return(0,nn.jsxs)("div",{className:"bg-white",children:[(0,nn.jsx)("div",{className:"bg-apn-blue text-white py-8",children:(0,nn.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:(0,nn.jsxs)("div",{className:"text-center",children:[(0,nn.jsx)("h1",{className:"text-3xl font-bold",children:"LinkedIn Professional Groups"}),(0,nn.jsx)("p",{className:"mt-2 text-lg",children:"Connect with finance professionals and source talent"})]})})}),(0,nn.jsxs)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:[(0,nn.jsx)("div",{className:"mb-6 bg-yellow-50 border border-yellow-200 rounded-lg p-4",children:(0,nn.jsxs)("div",{className:"flex",children:[(0,nn.jsx)("div",{className:"flex-shrink-0",children:(0,nn.jsx)("svg",{className:"h-5 w-5 text-yellow-400",fill:"currentColor",viewBox:"0 0 20 20",children:(0,nn.jsx)("path",{fillRule:"evenodd",d:"M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z",clipRule:"evenodd"})})}),(0,nn.jsxs)("div",{className:"ml-3",children:[(0,nn.jsx)("h3",{className:"text-sm font-medium text-yellow-800",children:"Demo Mode"}),(0,nn.jsx)("p",{className:"mt-1 text-sm text-yellow-700",children:"LinkedIn integration is in demo mode. Full functionality requires LinkedIn API configuration and approval. This interface shows the planned features for talent sourcing and professional networking."})]})]})}),(0,nn.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-8",children:[(0,nn.jsx)("div",{className:"lg:col-span-1",children:(0,nn.jsxs)("div",{className:"bg-white shadow rounded-lg p-6",children:[(0,nn.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,nn.jsx)("h2",{className:"text-lg font-semibold text-gray-900",children:"APN LinkedIn Groups"}),(0,nn.jsx)("button",{onClick:()=>m(!0),className:"text-sm bg-apn-blue text-white px-3 py-1 rounded hover:bg-blue-700",children:"Share Content"})]}),Object.entries(h).map(e=>{let[t,n]=e;return(0,nn.jsxs)("div",{className:"mb-6",children:[(0,nn.jsx)("h3",{className:"text-sm font-medium text-gray-500 uppercase tracking-wide mb-3",children:t}),(0,nn.jsx)("div",{className:"space-y-2",children:n.map(e=>(0,nn.jsx)("button",{onClick:()=>(async e=>{l(!0);try{const t=await $s(e);s(t.groupInfo),i(t.members)}catch(t){console.error("Error loading group members:",t),alert("LinkedIn integration is not fully configured. This is a demo interface showing available groups.")}finally{l(!1)}})(e.id),className:"w-full text-left p-3 rounded-lg border transition-colors ".concat((null===r||void 0===r?void 0:r.id)===e.id?"border-apn-blue bg-blue-50":"border-gray-200 hover:border-gray-300 hover:bg-gray-50"),children:(0,nn.jsxs)("div",{className:"flex justify-between items-start",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("h4",{className:"font-medium text-gray-900 text-sm",children:e.name}),(0,nn.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:e.description})]}),(0,nn.jsxs)("span",{className:"text-xs text-gray-400",children:[(e.memberCount/1e3).toFixed(1),"k"]})]})},e.id))})]},t)}),(0,nn.jsx)("div",{className:"mt-6 pt-4 border-t border-gray-200",children:(0,nn.jsxs)("a",{href:"https://www.linkedin.com/company/accelerated-professionals-network/about/?viewAsMember=true",target:"_blank",rel:"noopener noreferrer",className:"flex items-center text-sm text-apn-blue hover:text-blue-700",children:[(0,nn.jsx)("svg",{className:"w-4 h-4 mr-2",fill:"
2currentColor",viewBox:"0 0 24 24",children:(0,nn.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"})}),"Follow APN on LinkedIn"]})})]})}),(0,nn.jsx)("div",{className:"lg:col-span-2",children:r?(0,nn.jsxs)("div",{className:"bg-white shadow rounded-lg",children:[(0,nn.jsx)("div",{className:"p-6 border-b border-gray-200",children:(0,nn.jsxs)("div",{className:"flex justify-between items-start",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("h2",{className:"text-xl font-bold text-gray-900",children:r.name}),(0,nn.jsx)("p",{className:"text-gray-600 mt-1",children:r.description}),(0,nn.jsxs)("div",{className:"flex items-center mt-2 text-sm text-gray-500",children:[(0,nn.jsxs)("span",{children:[r.memberCount.toLocaleString()," members"]}),(0,nn.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,nn.jsx)("span",{className:"capitalize",children:r.category})]})]}),(0,nn.jsx)("a",{href:r.linkedinUrl,target:"_blank",rel:"noopener noreferrer",className:"bg-apn-blue text-white px-4 py-2 rounded hover:bg-blue-700 transition-colors",children:"View on LinkedIn"})]})}),(0,nn.jsxs)("div",{className:"p-6",children:[(0,nn.jsx)("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Recent Members"}),o?(0,nn.jsx)("div",{className:"flex justify-center py-8",children:(0,nn.jsx)("div",{className:"animate-spin rounded-full h-8 w-8 border-t-2 border-b-2 border-apn-blue"})}):(0,nn.jsx)("div",{className:"space-y-4",children:a.map(e=>(0,nn.jsxs)("div",{className:"flex items-center justify-between p-4 border border-gray-200 rounded-lg",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("h4",{className:"font-medium text-gray-900",children:e.name}),(0,nn.jsx)("p",{className:"text-sm text-gray-600",children:e.headline}),(0,nn.jsxs)("div",{className:"flex items-center mt-1 text-xs text-gray-500",children:[(0,nn.jsx)("span",{children:e.location}),(0,nn.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,nn.jsxs)("span",{children:[e.experience," experience"]})]})]}),(0,nn.jsx)("div",{className:"flex space-x-2",children:(0,nn.jsx)("a",{href:e.linkedinUrl,target:"_blank",rel:"noopener noreferrer",className:"text-apn-blue hover:text-blue-700 text-sm",children:"View Profile"})})]},e.id))})]})]}):(0,nn.jsxs)("div",{className:"bg-white shadow rounded-lg p-8 text-center",children:[(0,nn.jsx)("div",{className:"w-16 h-16 mx-auto mb-4 bg-gray-100 rounded-full flex items-center justify-center",children:(0,nn.jsx)("svg",{className:"w-8 h-8 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z"})})}),(0,nn.jsx)("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"Select a LinkedIn Group"}),(0,nn.jsx)("p",{className:"text-gray-600",children:"Choose a group from the left to view members and networking opportunities."})]})})]})]}),u&&(0,nn.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:(0,nn.jsxs)("div",{className:"bg-white rounded-lg p-6 max-w-md w-full mx-4",children:[(0,nn.jsx)("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Share to LinkedIn Groups"}),(0,nn.jsx)("textarea",{value:c,onChange:e=>d(e.target.value),placeholder:"What would you like to share with the groups?",className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue",rows:"4"}),(0,nn.jsxs)("div",{className:"flex justify-end space-x-3 mt-4",children:[(0,nn.jsx)("button",{onClick:()=>m(!1),className:"px-4 py-2 border border-gray-300 rounded-md text-gray-700 hover:bg-gray-50",children:"Cancel"}),(0,nn.jsx)("button",{onClick:()=>(async e=>{try{const t=await Qs(c,e);console.log("Shared to groups:",t),m(!1),d(""),alert("Content sharing simulated successfully! LinkedIn integration requires API configuration.")}catch(t){console.error("Error sharing to groups:",t),alert("LinkedIn integration is not fully configured. This is a demo interface.")}})(["finance-professionals","recent-graduates"]),className:"px-4 py-2 bg-apn-blue text-white rounded-md hover:bg-blue-700",disabled:!c.trim(),children:"Share"})]})]})})]})},Zs=()=>{const{currentUser:t,hasRole:n}=sn(),[r,a]=(0,e.useState)([]),[i,o]=(0,e.useState)(!1),[l,c]=(0,e.useState)({location:"",graduationYear:2024,skills:[],degree:""}),[d,u]=(0,e.useState)([]);(0,e.useEffect)(()=>{n("admin")&&m()},[n]);const m=async()=>{o(!0);try{const e=await Js(l);a(e.graduates)}catch(e){console.error("Error searching graduates:",e)}finally{o(!1)}},h=(e,t)=>{c(n=>(0,s.A)((0,s.A)({},n),{},{[e]:t}))},p=e=>{if(0!==d.length)switch(e){case"export":const e=r.filter(e=>d.includes(e.id));console.log("Exporting graduates:",e),alert("Exporting ".concat(e.length," graduate profiles..."));break;case"invite":console.log("Inviting graduates to APN:",d),alert("Sending APN invitations to ".concat(d.length," graduates..."));break;case"share":console.log("Sharing opportunities with graduates:",d),alert("Sharing opportunities with ".concat(d.length," graduates..."))}else alert("Please select graduates first.")};return n("admin")?(0,nn.jsxs)("div",{className:"bg-white",children:[(0,nn.jsx)("div",{className:"bg-apn-blue text-white py-8",children:(0,nn.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:(0,nn.jsxs)("div",{className:"text-center",children:[(0,nn.jsx)("h1",{className:"text-3xl font-bold",children:"Graduate Sourcing"}),(0,nn.jsx)("p",{className:"mt-2 text-lg",children:"Find and connect with recent finance graduates"})]})})}),(0,nn.jsxs)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:[(0,nn.jsx)("div",{className:"mb-6 bg-yellow-50 border border-yellow-200 rounded-lg p-4",children:(0,nn.jsxs)("div",{className:"flex",children:[(0,nn.jsx)("div",{className:"flex-shrink-0",children:(0,nn.jsx)("svg",{className:"h-5 w-5 text-yellow-400",fill:"currentColor",viewBox:"0 0 20 20",children:(0,nn.jsx)("path",{fillRule:"evenodd",d:"M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z",clipRule:"evenodd"})})}),(0,nn.jsxs)("div",{className:"ml-3",children:[(0,nn.jsx)("h3",{className:"text-sm font-medium text-yellow-800",children:"Demo Mode"}),(0,nn.jsx)("p",{className:"mt-1 text-sm text-yellow-700",children:"Graduate sourcing is in demo mode. Full functionality requires LinkedIn API configuration and approval. This interface shows the planned features for talent acquisition and recruitment."})]})]})}),(0,nn.jsxs)("div",{className:"bg-white shadow rounded-lg p-6 mb-8",children:[(0,nn.jsx)("h2",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Search Criteria"}),(0,nn.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4 mb-4",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Location"}),(0,nn.jsx)("input",{type:"text",value:l.location,onChange:e=>h("location",e.target.value),placeholder:"e.g., New York, NY",className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue"})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Graduation Year"}),(0,nn.jsx)("select",{value:l.graduationYear,onChange:e=>h("graduationYear",parseInt(e.target.value)),className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue",children:Ys.education.graduationYears.map(e=>(0,nn.jsx)("option",{value:e,children:e},e))})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Degree"}),(0,nn.jsxs)("select",{value:l.degree,onChange:e=>h("degree",e.target.value),className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue",children:[(0,nn.jsx)("option",{value:"",children:"All Degrees"}),Ys.education.degrees.map(e=>(0,nn.jsx)("option",{value:e,children:e},e))]})]}),(0,nn.jsx)("div",{className:"flex items-end",children:(0,nn.jsx)("button",{onClick:m,className:"w-full bg-apn-blue text-white px-4 py-2 rounded-md hover:bg-blue-700 transition-colors",children:"Search"})})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Required Skills"}),(0,nn.jsx)("div",{className:"flex flex-wrap gap-2",children:Ys.skills.map(e=>(0,nn.jsx)("button",{onClick:()=>(e=>{c(t=>(0,s.A)((0,s.A)({},t),{},{skills:t.skills.includes(e)?t.skills.filter(t=>t!==e):[...t.skills,e]}))})(e),className:"px-3 py-1 rounded-full text-sm transition-colors ".concat(l.skills.includes(e)?"bg-apn-blue text-white":"bg-gray-100 text-gray-700 hover:bg-gray-200"),children:e},e))})]})]}),d.length>0&&(0,nn.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-4 mb-6",children:(0,nn.jsxs)("div",{className:"flex items-center justify-between",children:[(0,nn.jsxs)("span",{className:"text-sm text-blue-800",children:[d.length," graduate(s) selected"]}),(0,nn.jsxs)("div",{className:"flex space-x-2",children:[(0,nn.jsx)("button",{onClick:()=>p("export"),className:"text-sm bg-white text-blue-800 px-3 py-1 rounded border border-blue-300 hover:bg-blue-50",children:"Export"}),(0,nn.jsx)("button",{onClick:()=>p("invite"),className:"text-sm bg-white text-blue-800 px-3 py-1 rounded border border-blue-300 hover:bg-blue-50",children:"Invite to APN"}),(0,nn.jsx)("button",{onClick:()=>p("share"),className:"text-sm bg-blue-600 text-white px-3 py-1 rounded hover:bg-blue-700",children:"Share Opportunities"})]})]})}),(0,nn.jsxs)("div",{className:"bg-white shadow rounded-lg",children:[(0,nn.jsx)("div",{className:"px-6 py-4 border-b border-gray-200",children:(0,nn.jsxs)("div",{className:"flex justify-between items-center",children:[(0,nn.jsxs)("h2",{className:"text-lg font-semibold text-gray-900",children:["Recent Graduates (",r.length,")"]}),(0,nn.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,nn.jsx)("button",{onClick:()=>u(r.map(e=>e.id)),className:"text-sm text-apn-blue hover:text-blue-700",children:"Select All"}),(0,nn.jsx)("button",{onClick:()=>u([]),className:"text-sm text-gray-500 hover:text-gray-700",children:"Clear"})]})]})}),(0,nn.jsx)("div",{className:"p-6",children:i?(0,nn.jsx)("div",{className:"flex justify-center py-8",children:(0,nn.jsx)("div",{className:"animate-spin rounded-full h-8 w-8 border-t-2 border-b-2 border-apn-blue"})}):r.length>0?(0,nn.jsx)("div",{className:"space-y-4",children:r.map(e=>(0,nn.jsx)("div",{className:"border rounded-lg p-4 transition-colors ".concat(d.includes(e.id)?"border-apn-blue bg-blue-50":"border-gray-200 hover:border-gray-300"),children:(0,nn.jsxs)("div",{className:"flex items-start justify-between",children:[(0,nn.jsxs)("div",{className:"flex items-start space-x-3",children:[(0,nn.jsx)("input",{type:"checkbox",checked:d.includes(e.id),onChange:()=>{return t=e.id,void u(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t]);var t},className:"mt-1 h-4 w-4 text-apn-blue focus:ring-apn-blue border-gray-300 rounded"}),(0,nn.jsxs)("div",{className:"flex-1",children:[(0,nn.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,nn.jsx)("h3",{className:"font-medium text-gray-900",children:e.name}),(0,nn.jsx)("span",{className:"inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-green-100 text-green-800",children:"Available"})]}),(0,nn.jsxs)("p",{className:"text-sm text-gray-600 mt-1",children:[e.degree," \u2022 ",e.university," \u2022 Class of ",e.graduationYear]}),(0,nn.jsx)("p",{className:"text-sm text-gray-500",children:e.location}),(0,nn.jsx)("div",{className:"mt-2",children:(0,nn.jsx)("div",{className:"flex flex-wrap gap-1",children:e.skills.map(e=>(0,nn.jsx)("span",{className:"inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-gray-100 text-gray-800",children:e},e))})}),e.internships.length>0&&(0,nn.jsxs)("div",{className:"mt-2",children:[(0,nn.jsx)("p",{className:"text-xs text-gray-500",children:"Previous Experience:"}),(0,nn.jsx)("p",{className:"text-sm text-gray-700",children:e.internships.join(", ")})]}),(0,nn.jsxs)("div",{className:"mt-2",children:[(0,nn.jsx)("p",{className:"text-xs text-gray-500",children:"Interested in:"}),(0,nn.jsx)("p",{className:"text-sm text-gray-700",children:e.preferredRoles.join(", ")})]})]})]}),(0,nn.jsx)("div",{className:"flex space-x-2",children:(0,nn.jsx)("a",{href:e.linkedinUrl,target:"_blank",rel:"noopener noreferrer",className:"text-sm bg-apn-blue text-white px-3 py-1 rounded hover:bg-blue-700",children:"View LinkedIn"})})]})},e.id))}):(0,nn.jsxs)("div",{className:"text-center py-8",children:[(0,nn.jsx)("div",{className:"w-16 h-16 mx-auto mb-4 bg-gray-100 rounded-full flex items-center justify-center",children:(0,nn.jsx)("svg",{className:"w-8 h-8 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.746 0 3.332.477 4.5 1.253v13C19.832 18.477 18.246 18 16.5 18c-1.746 0-3.332.477-4.5 1.253"})})}),(0,nn.jsx)("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"No graduates found"}),(0,nn.jsx)("p",{className:"text-gray-600",children:"Try adjusting your search criteria to find more candidates."})]})})]})]})]}):(0,nn.jsx)("div",{className:"flex justify-center items-center h-screen",children:(0,nn.jsxs)("div",{className:"text-center",children:[(0,nn.jsx)("h2",{className:"text-2xl font-bold text-gray-900 mb-4",children:"Access Denied"}),(0,nn.jsx)("p",{className:"text-gray-600 mb-4",children:"Graduate sourcing is only available to administrators."}),(0,nn.jsx)("p",{className:"text-sm text-gray-500",children:"This feature is used for internal talent acquisition and recruitment."}),(0,nn.jsx)("button",{onClick:()=>window.history.back(),className:"mt-4 bg-apn-blue text-white px-4 py-2 rounded hover:bg-blue-700",children:"Go Back"})]})})};function ea(){const{currentUser:t}=sn(),n=oe(),[r,a]=(0,e.useState)(!1),[i,o]=(0,e.useState)(""),[l,c]=(0,e.useState)({title:"",company:"",location:"",jobType:"Full-time",workType:"On-site",salary:"",description:"",requirements:"",benefits:"",applicationDeadline:"",contactEmail:"",externalUrl:""}),d=e=>{const{name:t,value:n}=e.target;c(e=>(0,s.A)((0,s.A)({},e),{},{[t]:n}))};return(0,nn.jsx)("div",{className:"max-w-4xl mx-auto p-6",children:(0,nn.jsxs)("div",{className:"bg-white shadow rounded-lg",children:[(0,nn.jsxs)("div",{className:"px-6 py-4 border-b border-gray-200",children:[(0,nn.jsx)("h2",{className:"text-2xl font-bold text-gray-900",children:"Post a New Job"}),(0,nn.jsx)("p",{className:"mt-2 text-gray-600",children:"Share job opportunities with the APN community."})]}),(0,nn.jsxs)("form",{onSubmit:async e=>{e.preventDefault(),a(!0),o("");try{const e=(0,s.A)((0,s.A)({},l),{},{requirements:l.requirements.split("\n").filter(e=>
2e.trim()),benefits:l.benefits.split("\n").filter(e=>e.trim()),applicationDeadline:l.applicationDeadline?new Date(l.applicationDeadline):null,contactEmail:l.contactEmail||t.email}),r=await(0,wn._S)(e,t.uid);n("/jobs/".concat(r))}catch(i){o("Failed to create job posting. Please try again."),console.error("Error creating job:",i)}finally{a(!1)}},className:"p-6 space-y-6",children:[i&&(0,nn.jsx)("div",{className:"bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded",children:i}),(0,nn.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"title",className:"block text-sm font-medium text-gray-700",children:"Job Title *"}),(0,nn.jsx)("input",{type:"text",id:"title",name:"title",required:!0,value:l.title,onChange:d,className:"mt-1 block w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-apn-blue focus:border-apn-blue",placeholder:"e.g., Senior Financial Analyst"})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"company",className:"block text-sm font-medium text-gray-700",children:"Company *"}),(0,nn.jsx)("input",{type:"text",id:"company",name:"company",required:!0,value:l.company,onChange:d,className:"mt-1 block w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-apn-blue focus:border-apn-blue",placeholder:"Company name"})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"location",className:"block text-sm font-medium text-gray-700",children:"Location *"}),(0,nn.jsx)("input",{type:"text",id:"location",name:"location",required:!0,value:l.location,onChange:d,className:"mt-1 block w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-apn-blue focus:border-apn-blue",placeholder:"e.g., New York, NY or Remote"})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"salary",className:"block text-sm font-medium text-gray-700",children:"Salary Range"}),(0,nn.jsx)("input",{type:"text",id:"salary",name:"salary",value:l.salary,onChange:d,className:"mt-1 block w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-apn-blue focus:border-apn-blue",placeholder:"e.g., $80,000 - $120,000"})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"jobType",className:"block text-sm font-medium text-gray-700",children:"Job Type *"}),(0,nn.jsxs)("select",{id:"jobType",name:"jobType",required:!0,value:l.jobType,onChange:d,className:"mt-1 block w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-apn-blue focus:border-apn-blue",children:[(0,nn.jsx)("option",{value:"Full-time",children:"Full-time"}),(0,nn.jsx)("option",{value:"Part-time",children:"Part-time"}),(0,nn.jsx)("option",{value:"Contract",children:"Contract"}),(0,nn.jsx)("option",{value:"Temporary",children:"Temporary"}),(0,nn.jsx)("option",{value:"Internship",children:"Internship"})]})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"workType",className:"block text-sm font-medium text-gray-700",children:"Work Type *"}),(0,nn.jsxs)("select",{id:"workType",name:"workType",required:!0,value:l.workType,onChange:d,className:"mt-1 block w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-apn-blue focus:border-apn-blue",children:[(0,nn.jsx)("option",{value:"On-site",children:"On-site"}),(0,nn.jsx)("option",{value:"Remote",children:"Remote"}),(0,nn.jsx)("option",{value:"Hybrid",children:"Hybrid"})]})]})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"description",className:"block text-sm font-medium text-gray-700",children:"Job Description *"}),(0,nn.jsx)("textarea",{id:"description",name:"description",required:!0,rows:"6",value:l.description,onChange:d,className:"mt-1 block w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-apn-blue focus:border-apn-blue",placeholder:"Describe the role, responsibilities, and what you're looking for..."})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"requirements",className:"block text-sm font-medium text-gray-700",children:"Requirements"}),(0,nn.jsx)("textarea",{id:"requirements",name:"requirements",rows:"4",value:l.requirements,onChange:d,className:"mt-1 block w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-apn-blue focus:border-apn-blue",placeholder:"Enter each requirement on a new line..."}),(0,nn.jsx)("p",{className:"mt-1 text-sm text-gray-500",children:"Enter each requirement on a separate line"})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"benefits",className:"block text-sm font-medium text-gray-700",children:"Benefits"}
2),(0,nn.jsx)("textarea",{id:"benefits",name:"benefits",rows:"4",value:l.benefits,onChange:d,className:"mt-1 block w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-apn-blue focus:border-apn-blue",placeholder:"Enter each benefit on a new line..."}),(0,nn.jsx)("p",{className:"mt-1 text-sm text-gray-500",children:"Enter each benefit on a separate line"})]}),(0,nn.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"contactEmail",className:"block text-sm font-medium text-gray-700",children:"Contact Email"}),(0,nn.jsx)("input",{type:"email",id:"contactEmail",name:"contactEmail",value:l.contactEmail,onChange:d,className:"mt-1 block w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-apn-blue focus:border-apn-blue",placeholder:"Leave blank to use your email"})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"applicationDeadline",className:"block text-sm font-medium text-gray-700",children:"Application Deadline"}),(0,nn.jsx)("input",{type:"date",id:"applicationDeadline",name:"applicationDeadline",value:l.applicationDeadline,onChange:d,className:"mt-1 block w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-apn-blue focus:border-apn-blue"})]})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"externalUrl",className:"block text-sm font-medium text-gray-700",children:"External Application URL"}),(0,nn.jsx)("input",{type:"url",id:"externalUrl",name:"externalUrl",value:l.externalUrl,onChange:d,className:"mt-1 block w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-apn-blue focus:border-apn-blue",placeholder:"https://company.com/careers/job-id"}),(0,nn.jsx)("p",{className:"mt-1 text-sm text-gray-500",children:"Optional: Link to external application page"})]}),(0,nn.jsxs)("div",{className:"flex justify-end space-x-4",children:[(0,nn.jsx)("button",{type:"button",onClick:()=>n("/jobs"),className:"px-6 py-2 border border-gray-300 rounded-md text-gray-700 hover:bg-gray-50",children:"Cancel"}),(0,nn.jsx)("button",{type:"submit",disabled:r,className:"px-6 py-2 bg-apn-blue text-white rounded-md hover:bg-blue-700 disabled:opacity-50",children:r?"Posting...":"Post Job"})]})]})]})})}function ta(){const{currentUser:t}=sn(),n=oe(),[r,a]=(0,e.useState)(!1),[i,o]=(0,e.useState)(""),[l,c]=(0,e.useState)({title:"",description:"",budgetRange:"",timeline:"",skills:"",projectType:"One-time",urgency:"Medium",deliverables:"",contactEmail:"",externalUrl:""}),d=e=>{const{name:t,value:n}=e.target;c(e=>(0,s.A)((0,s.A)({},e),{},{[t]:n}))};return(0,nn.jsx)("div",{className:"max-w-4xl mx-auto p-6",children:(0,nn.jsxs)("div",{className:"bg-white shadow rounded-lg",children:[(0,nn.jsxs)("div",{className:"px-6 py-4 border-b border-gray-200",children:[(0,nn.jsx)("h2",{className:"text-2xl font-bold text-gray-900",children:"Post a New Project"}),(0,nn.jsx)("p",{className:"mt-2 text-gray-600",children:"Find talented professionals for your project needs."})]}),(0,nn.jsxs)("form",{onSubmit:async e=>{e.preventDefault(),a(!0),o("");try{const e=(0,s.A)((0,s.A)({},l),{},{skills:l.skills.split(",").map(e=>e.trim()).filter(e=>e),deliverables:l.deliverables.split("\n").filter(e=>e.trim()),contactEmail:l.contactEmail||t.email}),r=await(0,wn.createProject)(e,t.uid);n("/projects/".concat(r))}catch(i){o("Failed to create project posting. Please try again."),console.error("Error creating project:",i)}finally{a(!1)}},className:"p-6 space-y-6",children:[i&&(0,nn.jsx)("div",{className:"bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded",children:i}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"title",className:"block text-sm font-medium text-gray-700",children:"Project Title *"}),(0,nn.jsx)("input",{type:"text",id:"title",name:"title",required:!0,value:l.title,onChange:d,className:"mt-1 block w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-apn-blue focus:border-apn-blue",placeholder:"e.g., Financial Model Development for Startup"})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"description",className:"block text-sm font-medium text-gray-700",children:"Project Description *"}),(0,nn.jsx)("textarea",{id:"description",name:"description",required:!0,rows:"6",value:l.description,onChange:d,className:"mt-1 block w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-apn-blue focus:border-apn-blue",placeholder:"Describe your project, goals, and what you're looking for..."})]}),(0,nn.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"budgetRange",className:"block text-sm font-medium text-gray-700",children:"Budget Range *"}),(0,nn.jsxs)("select",{id:"budgetRange",name:"budgetRange",required:!0,value:l.budgetRange,onChange:d,className:"mt-1 block w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-apn-blue focus:border-apn-blue",children:[(0,nn.jsx)("option",{value:"",children:"Select budget range"}),(0,nn.jsx)("option",{value:"Under $1,000",children:"Under $1,000"}),(0,nn.jsx)("option",{value:"$1,000 - $5,000",children:"$1,000 - $5,000"}),(0,nn.jsx)("option",{value:"$5,000 - $10,000",children:"$5,000 - $10,000"}),(0,nn.jsx)("option",{value:"$10,000 - $25,000",children:"$10,000 - $25,000"}),(0,nn.jsx)("option",{value:"$25,000 - $50,000",children:"$25,000 - $50,000"}),(0,nn.jsx)("option",{value:"$50,000+",children:"$50,000+"}),(0,nn.jsx)("option",{value:"To be discussed",children:"To be discussed"})]})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"timeline",className:"block text-sm font-medium text-gray-700",children:"Timeline *"}),(0,nn.jsxs)("select",{id:"timeline",name:"timeline",required:!0,value:l.timeline,onChange:d,className:"mt-1 block w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-apn-blue focus:border-apn-blue",children:[(0,nn.jsx)("option",{value:"",children:"Select timeline"}),(0,nn.jsx)("option",{value:"Less than 1 month",children:"Less than 1 month"}),(0,nn.jsx)("option",{value:"1-3 months",children:"1-3 months"}),(0,nn.jsx)("option",{value:"3-6 months",children:"3-6 months"}),(0,nn.jsx)("option",{value:"6-12 months",children:"6-12 months"}),(0,nn.jsx)("option",{value:"More than 1 year",children:"More than 1 year"}),(0,nn.jsx)("option",{value:"Ongoing",children:"Ongoing"})]})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"projectType",className:"block text-sm font-medium text-gray-700",children:"Project Type *"}),(0,nn.jsxs)("select",{id:"projectType",name:"projectType",required:!0,value:l.projectType,onCh
2ange:d,className:"mt-1 block w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-apn-blue focus:border-apn-blue",children:[(0,nn.jsx)("option",{value:"One-time",children:"One-time project"}),(0,nn.jsx)("option",{value:"Ongoing",children:"Ongoing work"}),(0,nn.jsx)("option",{value:"Contract",children:"Contract position"}),(0,nn.jsx)("option",{value:"Consulting",children:"Consulting engagement"})]})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"urgency",className:"block text-sm font-medium text-gray-700",children:"Urgency Level *"}),(0,nn.jsxs)("select",{id:"urgency",name:"urgency",required:!0,value:l.urgency,onChange:d,className:"mt-1 block w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-apn-blue focus:border-apn-blue",children:[(0,nn.jsx)("option",{value:"Low",children:"Low - Flexible timeline"}),(0,nn.jsx)("option",{value:"Medium",children:"Medium - Standard timeline"}),(0,nn.jsx)("option",{value:"High",children:"High - Need to start soon"}),(0,nn.jsx)("option",{value:"Urgent",children:"Urgent - Need to start immediately"})]})]})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"skills",className:"block text-sm font-medium text-gray-700",children:"Skills Required *"}),(0,nn.jsx)("input",{type:"text",id:"skills",name:"skills",required:!0,value:l.skills,onChange:d,className:"mt-1 block w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-apn-blue focus:border-apn-blue",placeholder:"e.g., Financial Modeling, Excel, Python, Data Analysis"}),(0,nn.jsx)("p",{className:"mt-1 text-sm text-gray-500",children:"Separate skills with commas"})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"deliverables",className:"block text-sm font-medium text-gray-700",children:"Expected Deliverables"}),(0,nn.jsx)("textarea",{id:"deliverables",name:"deliverables",rows:"4",value:l.deliverables,onChange:d,className:"mt-1 block w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-apn-blue focus:border-apn-blue",placeholder:"Enter each deliverable on a new line..."}),(0,nn.jsx)("p",{className:"mt-1 text-sm text-gray-500",children:"Enter each deliverable on a separate line"})]}),(0,nn.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"contactEmail",className:"block text-sm font-medium text-gray-700",children:"Contact Email"}),(0,nn.jsx)("input",{type:"email",id:"contactEmail",name:"contactEmail",value:l.contactEmail,onChange:d,className:"mt-1 block w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-apn-blue focus:border-apn-blue",placeholder:"Leave blank to use your email"})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"externalUrl",className:"block text-sm font-medium text-gray-700",children:"External Project URL"}),(0,nn.jsx)("input",{type:"url",id:"externalUrl",name:"externalUrl",value:l.externalUrl,onChange:d,className:"mt-1 block w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-apn-blue focus:border-apn-blue",placeholder:"https://company.com/project-details"})]})]}),(0,nn.jsxs)("div",{className:"flex justify-end space-x-4",children:[(0,nn.jsx)("button",{type:"button",onClick:()=>n("/projects"),className:"px-6 py-2 border border-gray-300 rounded-md text-gray-700 hover:bg-gray-50",children:"Cancel"}),(0,nn.jsx)("button",{type:"submit",disabled:r,className:"px-6 py-2 bg-apn-blue text-white rounded-md hover:bg-blue-700 disabled:opacity-50",children:r?"Posting...":"Post Project"})]})]})]})})}var na=n(972);(0,na.loadStripe)("pk_live_51Kr8J3Ec8kNP7Yp7Tu6erT0Ti9b2qUuacRAPc8kfvjV7nxACrPfmoeGuU8wkIJIOptmFCoCkqW2rAPbAc35Zu2Kg00T0uBJJAv");const ra={clientId:"AdMd2uVTb0FcGkk2mFpxkMVcDCCC-a3plmioVusIdWjNP3IX48gijhJomgPpg9vBZEmhirZ4odOX38p7",currency:"USD",intent:"capture"},sa=async function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;try{if(!Bt[t.toUpperCase()])throw new Error("Invalid membership tier");const e=(0,As.Qg)(yt.Cn,"createCheckoutSession"),r=(await e({tierKey:t,discountCode:n,successUrl:"".concat(window.location.origin,"/membership/success"),cancelUrl:"".concat(window.location.origin,"/membership/cancel")})).data;if(!r.id)throw new Error("No session ID received from payment service");return r}catch(a){var r,s;if(console.error("Error creating checkout session:",a),"functions/unauthenticated"===a.code)throw new Error("Please sign in to proceed with payment.");if("functions/permission-denied"===a.code)throw new Error("Account validation failed. Please contact support.");if(null!==(r=a.message)&&void 0!==r&&r.includes("Failed to fetch")||null!==(s=a.message)&&void 0!==s&&s.includes("internal"))throw new Error("Payment processing is currently being set up. Please try again in a few minutes or contact support.");throw a}},aa=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;
2if(!t)return{finalPrice:e,discountAmount:0};if(t.includes("-")&&n){const t=10*e/100,r=e-t;return{finalPrice:Math.max(r,0),discountAmount:t,discountPercentage:10,discountDescription:"Referral Discount (".concat(n.name||"Member",")"),referrerInfo:n}}const r=zt[t.toUpperCase()];if(!r)return{finalPrice:e,discountAmount:0};const s=r.value||0,a=e*s/100,i=e-a;return{finalPrice:Math.max(i,0),discountAmount:a,discountPercentage:s,discountDescription:r.description}},ia=async function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;try{const r=Bt[t.toUpperCase()];if(!r)throw new Error("Invalid membership tier");console.log("Creating PayPal order with data:",{userId:e,tierKey:t,discountCode:n});let s=r.price,a=0;if(n){const e=aa(s,n);s=e.finalPrice,a=e.discountAmount}const i=await fetch("https://us-central1-the-apn.cloudfunctions.net/createPayPalOrder",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:e,tierKey:t,discountCode:n,successUrl:"".concat(window.location.origin,"/membership/success?paypal=true&tier=").concat(t),cancelUrl:"".concat(window.location.origin,"/membership/cancel")})});if(!i.ok){let e="Failed to create PayPal order";try{e=(await i.json()).error||e}catch(Nd){e="PayPal service error (".concat(i.status,")")}throw new Error(e)}const o=await i.json();return console.log("PayPal order created:",o),o.id}catch(r){throw console.error("Error creating PayPal order:",r),r}},oa=async(e,t,n)=>{try{n.toUpperCase();const r={userId:t,tier:n,status:"active",startDate:new Date,endDate:new Date(Date.now()+31536e6),paypalOrderId:e.id,paymentMethod:"paypal",paymentHistory:[{orderId:e.id,amount:parseFloat(e.purchase_units[0].amount.value),currency:e.purchase_units[0].amount.currency_code,status:"completed",paymentMethod:"paypal",timestamp:new Date}]};return await(0,wn.$9)(t,r),{success:!0,membershipData:r}}catch(r){throw console.error("Error handling PayPal approval:",r),r}},la=e=>(console.error("PayPal payment error:",e),{success:!1,error:e.message||"PayPal payment failed"}),ca=((0,na.loadStripe)("pk_live_51Kr8J3Ec8kNP7Yp7Tu6erT0Ti9b2qUuacRAPc8kfvjV7nxACrPfmoeGuU8wkIJIOptmFCoCkqW2rAPbAc35Zu2Kg00T0uBJJAv"),{NETWORKING:{member:25,nonMember:50},WORKSHOP:{member:75,nonMember:150},CONFERENCE:{member:200,nonMember:400},VIRTUAL:{member:15,nonMember:30}}),da=async e=>{try{const n=await(0,wn.lh)(e);if(console.log("\u2705 Event created in Firestore with ID:",n),e.enablePayments&&e.pricing){console.log("\ud83d\udd04 Creating Stripe products for event...");try{const t=await ua(n,e);console.log("\u2705 Stripe products created:",t),await ma(n,t),console.log("\u2705 Event updated with Stripe data")}catch(t){console.warn("\u26a0\ufe0f Stripe integration failed, but event was created:",t)}}return n}catch(n){throw console.error("\u274c Error creating event with payment integration:",n),n}},ua=async(e,t)=>{try{const n="https://us-central1-the-apn.cloudfunctions.net/createEventProducts",r=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({eventId:e,eventTitle:t.title,eventDescription:t.description,pricing:t.pricing})});if(!r.ok){const e=await r.text();throw new Error("Failed to create Stripe products: ".concat(e))}return await r.json()}catch(n){throw console.error("Error creating Stripe products:",n),n}},ma=async(e,t)=>{try{const{updateDoc:r,doc:s}=await Promise.resolve().then(n.bind(n,472)),{db:a}=await Promise.resolve().then(n.bind(n,791));await r(s(a,"events",e),{stripeProducts:t,paymentIntegrationEnabled:!0,updatedAt:new Date})}catch(r){throw console.error("Error updating event with Stripe data:",r),r}};var ha=n(147);function pa(){const{currentUser:t,hasRole:n}=sn(),r=oe(),{id:a}=le(),[i,o]=(0,e.useState)(!1),[l,c]=(0,e.useState)(""),[d,u]=(0,e.useState)(null),[m,h]=(0,e.useState)(""),[p,g]=(0,e.useState)(!1),[f,x]=(0,e.useState)(!1),[b,y]=(0,e.useState)({title:"",description:"",startDate:"",startTime:"",endDate:"",endTime:"",location:"",isVirtual:!1,virtualLink:"",maxAttendees:"",eventType:"Networking",memberPrice:"",nonMemberPrice:"",registrationDeadline:"",agenda:"",speakers:"",requirements:"",enablePayments:!0,paymentMethods:["stripe","paypal"],imageUrl:""});(0,e.useEffect)(()=>{a&&(x(!0),v())},[a]);const v=async()=>{try{o(!0);const l=await(0,wn.getEventById)(a);if(l){var e,t,n,r,s,i,d,u,m,h,p,g,f,x;const a=null!==(e=l.startDate)&&void 0!==e&&e.toDate?l.startDate.toDate():new Date(l.startDate),o=null!==(t=l.endDate)&&void 0!==t&&t.toDate?l.endDate.toDate():new Date(l.endDate),c=null!==(n=l.registrationDeadline)&&void 0!==n&&n.toDate?l.registrationDeadline.toDate():null;y({title:l.title||"",description:l.description||"",startDate:a.toISOString().split("T")[0],startTime:a.toTimeStr
2ing().slice(0,5),endDate:o.toISOString().split("T")[0],endTime:o.toTimeString().slice(0,5),location:l.location||"",isVirtual:l.isVirtual||!1,virtualLink:l.virtualLink||"",maxAttendees:(null===(r=l.maxAttendees)||void 0===r?void 0:r.toString())||"",eventType:l.eventType||"Networking",memberPrice:(null===(s=l.pricing)||void 0===s||null===(i=s.member)||void 0===i?void 0:i.toString())||(null===(d=l.ticketTypes)||void 0===d||null===(u=d.member)||void 0===u||null===(m=u.price)||void 0===m?void 0:m.toString())||"",nonMemberPrice:(null===(h=l.pricing)||void 0===h||null===(p=h.nonMember)||void 0===p?void 0:p.toString())||(null===(g=l.ticketTypes)||void 0===g||null===(f=g.nonMember)||void 0===f||null===(x=f.price)||void 0===x?void 0:x.toString())||"",registrationDeadline:c?c.toISOString().split("T")[0]:"",agenda:Array.isArray(l.agenda)?l.agenda.join("\n"):l.agenda||"",speakers:Array.isArray(l.speakers)?l.speakers.join("\n"):l.speakers||"",requirements:Array.isArray(l.requirements)?l.requirements.join("\n"):l.requirements||"",enablePayments:!1!==l.enablePayments,paymentMethods:l.paymentMethods||["stripe","paypal"],imageUrl:l.imageUrl||""})}}catch(l){console.error("Error loading event data:",l),c("Failed to load event data")}finally{o(!1)}};if((0,e.useEffect)(()=>{if(!f&&b.eventType&&ca[b.eventType.toUpperCase()]){const e=ca[b.eventType.toUpperCase()];y(t=>(0,s.A)((0,s.A)({},t),{},{memberPrice:e.member.toString(),nonMemberPrice:e.nonMember.toString()}))}},[b.eventType,f]),!n("admin"))return(0,nn.jsx)("div",{className:"max-w-4xl mx-auto p-6",children:(0,nn.jsx)("div",{className:"bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded",children:"You don't have permission to create events. Only administrators can create events."})});const w=e=>{const{name:t,value:n,type:r,checked:a}=e.target;y(e=>(0,s.A)((0,s.A)({},e),{},{[t]:"checkbox"===r?a:n}))};return(0,nn.jsx)("div",{className:"max-w-4xl mx-auto p-6",children:(0,nn.jsxs)("div",{className:"bg-white shadow rounded-lg",children:[(0,nn.jsxs)("div",{className:"px-6 py-4 border-b border-gray-200",children:[(0,nn.jsx)("h2",{className:"text-2xl font-bold text-gray-900",children:f?"Edit Event":"Create New Event"}),(0,nn.jsx)("p",{className:"mt-2 text-gray-600",children:f?"Update event details and settings.":"Create and manage events for the APN community."})]}),(0,nn.jsxs)("form",{onSubmit:async e=>{e.preventDefault(),o(!0),c("");try{const e=new Date("".concat(b.startDate,"T").concat(b.startTime)),n=new Date("".concat(b.endDate,"T").concat(b.endTime)),s=e=>e.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0}),i=(e=>e.toLocaleDateString("en-US",{weekday:"long",year:"numeric",month:"long",day:"numeric"}))(e),u="".concat(s(e)," - ").concat(s(n));let m=b.imageUrl||"/apn-logos/APN-blue (1).png";d&&(console.log("\ud83d\udce4 Uploading new image..."),m=await(async e=>{if(!e)return null;g(!0);try{const n=(0,ha.c7)(),r=Date.now(),s="events/".concat(r,"_").concat(e.name),a=(0,ha.KR)(n,s);console.log("\ud83d\udce4 Uploading image to:",s),console.log("\ud83d\udd04 Current user:",null===t||void 0===t?void 0:t.uid),console.log("\ud83d\udd04 User email:",null===t||void 0===t?void 0:t.email);const i=await(0,ha.D)(a,e),o=await(0,ha.qk)(i.ref);return console.log("\u2705 Image uploaded successfully:",o),o}catch(l){throw console.error("\u274c Error uploading image:",l),console.error("\u274c Error code:",l.code),console.error("\u274c Error message:",l.message),new Error("Failed to upload image: ".concat(l.message))}finally{g(!1)}})(d),console.log("\u2705 Image uploaded, URL:",m));const h=b.memberPrice?"$".concat(parseFloat(b.memberPrice).toFixed(2)):"Free",p={title:b.title,description:b.description,startDate:e,endDate:n,date:i,time:u,price:h,location:b.location,isVirtual:b.isVirtual,virtualLink:b.virtualLink,maxAttendees:b.maxAttendees?parseInt(b.maxAttendees):null,eventType:b.eventType,imageUrl:m,pricing:{member:b.memberPrice?parseFloat(b.memberPrice):0,nonMember:b.nonMemberPrice?parseFloat(b.nonMemberPrice):0},registrationDeadline:b.registrationDeadline?new Date(b.registrationDeadline):null,agenda:b.agenda.split("\n").filter(e=>e.trim()),speakers:b.speakers.split("\n").filter(e=>e.trim()),requirements:b.requirements.split("\n").filter(e=>e.trim()),enablePayments:b.enablePayments,paymentMethods:b.paymentMethods,createdBy:t.uid,attendeeList:{enabled:!0,exportFormats:["excel","csv"],includePaymentInfo:!0,autoEmailReminders:!0,customFields:["dietary_restrictions","accessibility_needs","company_
2size"]},paymentIntegration:{stripe:{enabled:b.enablePayments&&b.paymentMethods.includes("stripe"),autoCreateProducts:!0,webhookEnabled:!0,autoRefunds:!0},paypal:{enabled:b.enablePayments&&b.paymentMethods.includes("paypal"),autoCreateProducts:!0,webhookEnabled:!0,autoRefunds:!0}},notifications:{newRegistration:!0,paymentReceived:!0,eventReminders:!0,attendeeUpdates:!0,adminAlerts:!0},eventSettings:{allowWaitlist:!0,sendCalendarInvites:!0,recordSession:b.isVirtual,breakoutRooms:b.isVirtual,networkingTime:!0}};if(e>=n)return c("End date must be after start date"),void o(!1);let x;if(f)await(0,wn.updateEvent)(a,p),x=a,alert("\u2705 Event Updated Successfully!\n\nTitle: ".concat(b.title,"\n\nThe event has been updated with your changes."));else{x=b.enablePayments?await da(p):await(0,wn.lh)(p);const e="\u2705 Event Created Successfully!\n\nEvent ID: ".concat(x,"\nTitle: ").concat(b.title,"\n\n\ud83d\udd27 Automatic Setup Completed:\n").concat(b.enablePayments?"\u2705 Payment integration (Stripe/PayPal) configured":"\u26a0\ufe0f Payment integration disabled","\n\u2705 Attendee list management enabled\n\u2705 Excel/CSV export ready\n\u2705 Email notifications activated\n\u2705 Calendar integration prepared\n\n\ud83d\udcca Next Steps:\n\u2022 Review event details\n\u2022 Test registration process\n\u2022 Monitor attendee registrations\n\u2022 Export attendee lists when needed");alert(e)}r("/events/".concat(x))}catch(l){const t=l.message||"Failed to ".concat(f?"update":"create"," event. Please try again.");c("Event ".concat(f?"Update":"Creation"," Failed: ").concat(t)),console.error("Error ".concat(f?"updating":"creating"," event:"),l)}finally{o(!1)}},className:"p-6 space-y-6",children:[l&&(0,nn.jsx)("div",{className:"bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded",children:l}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"title",className:"block text-sm font-medium text-gray-700",children:"Event Title *"}),(0,nn.jsx)("input",{type:"text",id:"title",name:"title",required:!0,value:b.title,onChange:w,className:"mt-1 block w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-apn-blue focus:border-apn-blue",placeholder:"e.g., APN Annual Networking Event"})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"description",className:"block text-sm font-medium text-gray-700",children:"Event Description *"}),(0,nn.jsx)("textarea",{id:"description",name:"description",required:!0,rows:"4",value:b.description,onChange:w,className:"mt-1 block w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-apn-blue focus:border-apn-blue",placeholder:"Describe the event, its purpose, and what attendees can expect..."})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Event Image"}),(0,nn.jsxs)("div",{className:"mb-4",children:[(0,nn.jsx)("label",{htmlFor:"imageFile",className:"block text-sm font-medium text-gray-600 mb-2",children:"Upload Image File"}),(0,nn.jsx)("input",{type:"file",id:"imageFile",accept:"image/*",onChange:e=>{const t=e.target.files[0];if(t){if(!t.type.startsWith("image/"))return void c("Please select a valid image file");if(t.size>5242880)return void c("Image file must be less than 5MB");u(t),c("");const e=new FileReader;e.onload=e=>{h(e.target.result)},e.readAsDataURL(t)}},className:"block w-full text-sm text-gray-500 file:mr-4 file:py-2 file:px-4 file:rounded-full file:border-0 file:text-sm file:font-semibold file:bg-apn-blue file:text-white hover:file:bg-blue-700"}),(0,nn.jsx)("p",{className:"mt-1 text-sm text-gray-500",children:"Upload an image file (JPG, PNG, GIF). Max size: 5MB."})]}),m&&(0,nn.jsxs)("div",{className:"mb-4",children:[(0,nn.jsx)("label",{className:"block text-sm font-medium text-gray-600 mb-2",children:"Image Preview"}),(0,nn.jsx)("img",{src:m,alt:"Event preview",className:"w-full max-w-md h-48 object-cover rounded-lg border border-gray-300"})]}),(0,nn.jsxs)("div",{className:"flex items-center my-4",children:[(0,nn.jsx)("div",{className:"flex-grow border-t border-gray-300"}),(0,nn.jsx)("span",{className:"px-3 text-sm text-gray-500 bg-white",children:"OR"}),(0,nn.jsx)("div",{className:"flex-grow border-t border-gray-300"})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"imageUrl",className:"block text-sm font-medium text-gray-600 mb-2",children:"Image URL"}),(0,nn.jsx)("input",{type:"text",id:"imageUrl",name:"imageUrl",value:b.imageUrl,onChange:w,className:"mt-1 block w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-apn-blue focus:border-apn-blue",placeholder:"https://example.com/event-image.jpg"}),(0,nn.jsx)("p",{className:"mt-1 text-sm text-gray-500",children:"Or provide a URL to an existing image. If both file and URL are provided, the uploaded file will be used."})]}),!d&&!b.imageUrl&&(0,nn.jsx)("div",{className:"mt-2 p-3 bg-blue-50 border border-blue-200 rounded-md",children:(0,nn.jsx)("p",{className:"text-sm text-blue-700",children:"\ud83d\udcf7 No image selected. The APN logo will be used as the default event image."})})]}),(0,nn.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"startDate",className:"block text-sm font-medium text-gray-700",children:"Start Date *"}),(0,nn.jsx)("input",{type:"date",id:"startDate",name:"startDate",required:!0,value:b.startDate,onChange:w,className:"mt-1 block w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-apn-blue focus:border-apn-blue"})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"startTime",className:"block text-sm font-medium text-gray-700",children:"Start Time *"}),(0,nn.jsx)("input",{type:"time",id:"startTime",name:"startTime",required:!0,value:b.startTime,onChange:w,className:"mt-1 block w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-apn-blue focus:border-apn-blue"})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"endDate",className:"block text-sm font-medium text-gray-700",children:"End Date *"}),(0,nn.jsx)("input",{type:"date",id:"endDate",name:"endDate",required:!0,value:b.endDate,onChange:w,className:"mt-1 block w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-apn-blue focus:border-apn-blue"})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"endTime",className:"block text-sm font-medium text-gray-700",children:"End Time *"}),(0,nn.jsx)("input",{type:"time",id:"endTime",name:"endTime",required:!0,value:b.endTime,onChange:w,className:"mt-1 block w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-apn-blue focus:border-apn-blue"})]})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsxs)("div",{className:"flex items-center mb-4",children:[(0,nn.jsx)("input",{type:"checkbox",id:"isVirtual",name:"isVirtual",checked:b.isVirtual,onChange:w,className:"h-4 w-4 text-apn-blue focus:ring-apn-blue border-gray-300 rounded"}),(0,nn.jsx)("label",{htmlFor:"isVirtual",className:"ml-2 block text-sm text-gray-900",children:"This is a virtual event"})]}),b.isVirtual?(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"virtualLink",className:"block text-sm font-medium text-gray-700",children:"Virtual Event Link *"}),(0,nn.jsx)("input",{type:"url",id:"virtualLink",name:"virtualLink",required:b.
2isVirtual,value:b.virtualLink,onChange:w,className:"mt-1 block w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-apn-blue focus:border-apn-blue",placeholder:"https://zoom.us/j/..."})]}):(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"location",className:"block text-sm font-medium text-gray-700",children:"Event Location *"}),(0,nn.jsx)("input",{type:"text",id:"location",name:"location",required:!b.isVirtual,value:b.location,onChange:w,className:"mt-1 block w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-apn-blue focus:border-apn-blue",placeholder:"e.g., 123 Main St, New York, NY 10001"})]})]}),(0,nn.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"eventType",className:"block text-sm font-medium text-gray-700",children:"Event Type *"}),(0,nn.jsxs)("select",{id:"eventType",name:"eventType",required:!0,value:b.eventType,onChange:w,className:"mt-1 block w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-apn-blue focus:border-apn-blue",children:[(0,nn.jsx)("option",{value:"Networking",children:"Networking"}),(0,nn.jsx)("option",{value:"Workshop",children:"Workshop"}),(0,nn.jsx)("option",{value:"Seminar",children:"Seminar"}),(0,nn.jsx)("option",{value:"Conference",children:"Conference"}),(0,nn.jsx)("option",{value:"Social",children:"Social Event"}),(0,nn.jsx)("option",{value:"Training",children:"Training"}),(0,nn.jsx)("option",{value:"Other",children:"Other"})]})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"maxAttendees",className:"block text-sm font-medium text-gray-700",children:"Maximum Attendees"}),(0,nn.jsx)("input",{type:"number",id:"maxAttendees",name:"maxAttendees",min:"1",value:b.maxAttendees,onChange:w,className:"mt-1 block w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-apn-blue focus:border-apn-blue",placeholder:"Leave blank for unlimited"})]})]}),b.eventType&&ca[b.eventType.toUpperCase()]&&(0,nn.jsxs)("div",{className:"bg-blue-50 border border-blue-200 rounded-md p-4",children:[(0,nn.jsxs)("h4",{className:"text-sm font-medium text-blue-900 mb-2",children:["Suggested Pricing for ",b.eventType," Events"]}),(0,nn.jsxs)("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("span",{className:"text-blue-700",children:"Member: "}),(0,nn.jsxs)("span",{className:"font-medium",children:["$",ca[b.eventType.toUpperCase()].member]})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("span",{className:"text-blue-700",children:"Non-Member: "}),(0,nn.jsxs)("span",{className:"font-medium",children:["$",ca[b.eventType.toUpperCase()].nonMember]})]})]}),(0,nn.jsx)("p",{className:"text-xs text-blue-600 mt-2",children:"Prices have been auto-populated based on event type. You can modify them as needed."})]}),(0,nn.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"memberPrice",className:"block text-sm font-medium text-gray-700",children:"Member Price ($)"}),(0,nn.jsx)("input",{type:"number",id:"memberPrice",name:"memberPrice",min:"0",step:"0.01",value:b.memberPrice,onChange:w,className:"mt-1 block w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-apn-blue focus:border-apn-blue",placeholder:"0.00"})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"nonMemberPrice",className:"block text-sm font-medium text-gray-700",children:"Non-Member Price ($)"}),(0,nn.jsx)("input",{type:"number",id:"nonMemberPrice",name:"nonMemberPrice",min:"0",step:"0.01",value:b.nonMemberPrice,onChange:w,className:"mt-1 block w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-apn-blue focus:border-apn-blue",placeholder:"0.00"})]})]}),(0,nn.jsxs)("div",{className:"space-y-4",children:[(0,nn.jsxs)("div",{className:"flex items-center",children:[(0,nn.jsx)("input",{type:"checkbox",id:"enablePayments",name:"enablePayments",checked:b.enablePayments,onChange:w,className:"h-4 w-4 text-apn-blue focus:ring-apn-blue border-gray-300 rounded"}),(0,nn.jsx)("label",{htmlFor:"enablePayments",className:"ml-2 block text-sm text-gray-900",children:"Enable automatic payment processing (Stripe & PayPal)"})]}),b.enablePayments&&(0,nn.jsxs)("div",{className:"ml-6 space-y-2",children:[(0,nn.jsx)("p",{className:"text-sm text-gray-600",children:"When enabled, Stripe products and prices will be automatically created for this event, allowing seamless payment processing without manual setup."}),(0,nn.jsxs)("div",{className:"flex space-x-4",children:[(0,nn.jsxs)("label",{className:"flex items-center",children:[(0,nn.jsx)("input",{type:"checkbox",checked:b.paymentMethods.includes("stripe"),onChange:e=>{const t=e.target.checked?[...b.paymentMethods,"stripe"]:b.paymentMethods.filter(e=>"stripe"!==e);y(e=>(0,s.A)((0,s.A)({},e),{},{paymentMethods:t}))},className:"h-4 w-4 text-apn-blue focus:ring-apn-blue border-gray-300 rounded"}),(0,nn.jsx)("span",{className:"ml-2 text-sm text-gray-700",children:"Stripe (Credit Cards)"})]}),(0,nn.jsxs)("label",{className:"flex items-center",children:[(0,nn.jsx)("input",{type:"checkbox",checked:b.paymentMethods.includes("paypal"),onChange:e=>{const t=e.target.checked?[...b.paymentMethods,"paypal"]:b.paymentMethods.filter(e=>"paypal"!==e);y(e=>(0,s.A)((0,s.A)({},e),{},{paymentMethods:t}))},className:"h-4 w-4 text-apn-blue focus:ring-apn-blue border-gray-300 rounded"}),(0,nn.jsx)("span",{className:"ml-2 text-sm text-gray-700",children:"PayPal"})]})]})]})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"registrationDeadline",className:"block text-sm font-medium text-gray-700",children:"Registration Deadline"}),(0,nn.jsx)("input",{type:"date",id:"registrationDeadline",name:"registrationDeadline",value:b.registrationDeadline,onChange:w,className:"mt-1 block w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-apn-blue focus:border-apn-blue"})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"agenda",className:"block text-sm font-medium text-gray-700",children:"Event Agenda"}),(0,nn.jsx)("textarea",{id:"agenda",name:"agenda",rows:"4",value:b.agenda,onChange:w,className:"mt-1 block w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-apn-blue focus:border-apn-blue",placeholder:"Enter each agenda item on a new line..."}),(0,nn.jsx)("p",{className:"mt-1 text-sm text-gray-500",children:"Enter each agenda item on a separate line"})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"speakers",className:"block text-sm font-medium text-gray-700",children:"Speakers"}),(0,nn.jsx)("textarea",{id:"speakers",name:"speakers",rows:"3",value:b.speakers,onChange:w,className:"mt-1 block w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-apn-blue focus:border-apn-blue",placeholder:"Enter each speaker on a new line..."}),(0,nn.jsx)("p",{className:"mt-1 text-sm text-gray-500",children:"Enter each speaker on a separate line"})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"requirements",className:"block text-sm font-medium text-gray-700",children:"Requirements/Prerequisites"}),(0,nn.jsx)("textarea",{id:"requirements",name:"requirements",rows:"3",value:b.requirements,onChange:w,className:"mt-1 block w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-apn-blue focus:border-apn-blue",placeholder:"Enter any requirements or prerequisites..."})]}),(0,nn.jsxs)("div",{className:"flex justify-end space-x-4",children:[(0,nn.jsx)("button",{type:"button",onClick:()=>r("/events"),className:"px-6 py-2 border border-gray-300 rounded-md text-gray-700 hover:bg-gray-50",children:"Cancel"}),(0,nn.jsx)("button",{type:"submit",disabled:i||p,className:"px-6 py-2 bg-apn-blue text-white rounded-md hover:bg-blue-700 disabled:opacity-50",children:p?"Uploading Image...":i?"Creating...":"Create Event"})]})]})]})})}const ga=()=>{const[t,n]=(0,e.useState)(!1),r="[email protected]",s="AdminAPN2024!Secure",a="APN Administrator",i=e=>{navigator.clipboard.writeText(e)};return(0,nn.jsx)("div",{className:"max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:(0,nn.jsxs)("div",{className:"bg-white rounded-lg shadow p-6",children:[(0,nn.jsx)("h1",{className:"text-2xl font-bold text-gray-900 mb-6",children:"\ud83d\udd10 Admin Setup Guide"}),(0,nn.jsxs)("div",{className:"space-y-6",children:[(0,nn.jsxs)("div",{className:"bg-blue-50 border border-blue-200 rounded-md p-6",children:[(0,nn.jsx)("h2",{className:"text-lg font-semibold text-blue-900 mb-4",children:"Step 1: Admin Account Credentials"}),(0,nn.jsxs)("div",{className:"space-y-3",children:[(0,nn.jsxs)("div",{className:"flex items-center justify-between",children:[(0,nn.jsx)("span",{className:"font-medium text-blue-800",children:"Email:"}),(0,nn.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,nn.jsx)("code",{className:"bg-blue-100 px-2 py-1 rounded text-blue-900",children:r}),(0,nn.jsx)("button",{onClick:()=>i(r),className:"text-blue-600 hover:text-blue-800 text-sm",children:"Copy"})]})]}),(0,nn.jsxs)("div",{className:"flex items-center justify-between",children:[(0,nn.jsx)("span",{className:"font-medium text-blue-800",children:"Password:"}),(0,nn.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,nn.jsx)("code",{className:"bg-blue-100 px-2 py-1 rounded text-blue-900",children:t?s:"\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022"}),(0,nn.jsx)("button",{onClick:()=>n(!t),className:"text-blue-600 hover:text-blue-800 text-sm",children:t?"Hide":"Show"}),(0,nn.jsx)("button",{onClick:()=>i(s),className:"text-blue-600 hover:text-blue-800 text-sm",children:"Copy"})]})]}),(0,nn.jsxs)("div",{className:"flex items-center justify-between",children:[(0,nn.jsx)("span",{className:"font-medium text-blue-800",children:"Name:"}),(0,nn.jsx)("code",{className:"bg-blue-100 px-2 py-1 rounded text-blue-900",children:a})]})]})]}),(0,nn.jsxs)("div",{className:"bg-green-50 border border-green-200 rounded-md p-6",children:[(0,nn.jsx)("h2",{className:"text-lg font-semibold text-green-900 mb-4",children:"Step 2: Setup Instru
2ctions"}),(0,nn.jsxs)("ol",{className:"list-decimal list-inside space-y-2 text-green-800",children:[(0,nn.jsxs)("li",{children:[(0,nn.jsx)(dt,{to:"/register",className:"text-green-600 hover:text-green-800 underline",children:"Go to the registration page"})," and create an account with the credentials above"]}),(0,nn.jsx)("li",{children:"After signup, you'll be redirected to a pending approval page"}),(0,nn.jsxs)("li",{children:[(0,nn.jsx)(dt,{to:"/admin/approval",className:"text-green-600 hover:text-green-800 underline",children:"Go to the admin approval page"}),' and click "Approve Admin Account"']}),(0,nn.jsx)("li",{children:"Refresh the page or sign out and sign back in"}),(0,nn.jsx)("li",{children:"You should now have full admin access!"})]})]}),(0,nn.jsxs)("div",{className:"bg-yellow-50 border border-yellow-200 rounded-md p-6",children:[(0,nn.jsx)("h2",{className:"text-lg font-semibold text-yellow-900 mb-4",children:"Step 3: Quick Actions"}),(0,nn.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,nn.jsx)(dt,{to:"/register",className:"bg-blue-600 text-white px-4 py-2 rounded-lg hover:bg-blue-700 transition duration-200 text-center",children:"Create Admin Account"}),(0,nn.jsx)(dt,{to:"/login",className:"bg-green-600 text-white px-4 py-2 rounded-lg hover:bg-green-700 transition duration-200 text-center",children:"Login to Existing Account"}),(0,nn.jsx)(dt,{to:"/admin/approval",className:"bg-purple-600 text-white px-4 py-2 rounded-lg hover:bg-purple-700 transition duration-200 text-center",children:"Approve Admin Status"}),(0,nn.jsx)(dt,{to:"/admin/seed-data",className:"bg-orange-600 text-white px-4 py-2 rounded-lg hover:bg-orange-700 transition duration-200 text-center",children:"Seed Sample Data"})]})]}),(0,nn.jsxs)("div",{className:"bg-gray-50 border border-gray-200 rounded-md p-6",children:[(0,nn.jsx)("h2",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Step 4: Test Admin Features"}),(0,nn.jsx)("p",{className:"text-gray-700 mb-4",children:"Once you have admin access, test these features:"}),(0,nn.jsxs)("ul",{className:"list-disc list-inside space-y-1 text-gray-700",children:[(0,nn.jsx)("li",{children:"Admin Dashboard - View analytics and manage users"}),(0,nn.jsx)("li",{children:"Groups Management - Create and manage groups"}),(0,nn.jsx)("li",{children:"User Approval - Approve pending member accounts"}),(0,nn.jsx)("li",{children:"Data Seeding - Create sample data for testing"}),(0,nn.jsx)("li",{children:"Firebase Testing - Test database connections"})]})]})]})]})})};function fa(){const t=oe(),[n,r]=(0,e.useState)(""),[a,i]=(0,e.useState)(""),[o,l]=(0,e.useState)(""),[c,d]=(0,e.useState)(!1);return(0,nn.jsxs)("div",{className:"min-h-screen bg-gray-50 flex flex-col justify-center py-12 sm:px-6 lg:px-8",children:[(0,nn.jsxs)("div",{className:"sm:mx-auto sm:w-full sm:max-w-md",children:[(0,nn.jsx)(dt,{to:"/",className:"flex justify-center",children:(0,nn.jsx)("img",{src:"".concat("","/apn-logos/APN-Tag-blue.png"),alt:"APN Logo",className:"h-16"})}),(0,nn.jsx)("h2",{className:"mt-6 text-center text-3xl font-bold text-gray-900",children:"Client Portal"}),(0,nn.jsx)("p",{className:"mt-2 text-center text-sm text-gray-600",children:"Access your site preview and project status"})]}),(0,nn.jsx)("div",{className:"mt-8 sm:mx-auto sm:w-full sm:max-w-md",children:(0,nn.jsxs)("div",{className:"bg-white py-8 px-4 shadow-lg sm:rounded-lg sm:px-10",children:[o&&(0,nn.jsx)("div",{className:"mb-4 bg-red-50 border border-red-200 text-red-700 px-4 py-3 rounded-lg text-sm",children:o}),(0,nn.jsxs)("form",{onSubmit:async e=>{e.preventDefault(),l(""),d(!0);try{if(!n||!a)return l("Please enter both your email and access code."),void d(!1);const e=await(async(e,t)=>{try{const n=(0,vt.query)((0,vt.collection)(yt.db,Xn),(0,vt.where)("contactEmail","==",e.toLowerCase()),(0,vt.where)("accessCode","==",t.toUpperCase()),(0,vt.limit)(1)),r=await(0,vt.getDocs)(n);if(r.empty)return null;const a=r.docs[0];return(0,s.A)({id:a.id},a.data())}catch(o){throw console.error("Error authenticating client:",o),o}})(n.trim(),a.trim());if(!e)return l("Invalid email or access code. Please check your credentials and try again."),void d(!1);if(!e.accessEnabled)return l("Your access has been temporarily disabled. Please contact our team."),void d(!1);await(async e=>{try{await rr(e,{lastAccessedAt:(0,vt.serverTimestamp)()})}catch(o){console.error("Error recording access:",o)}})(e.id),sessionStorage.setItem("clientSession",JSON.stringify({id:e.id,companyName:e.companyName,contactEmail:e.contactEmail,accessCode:e.accessCode,loginAt:(new Date).toISOString()})),t("/client/dashboard")}catch(r){console.error("Client login error:",r),l("An error occurred. Please try again.")}finally{d(!1)}},className:"space-y-6",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"email",className:"block text-sm font-medium text-gray-700",children:"Email Address"}),(0,nn.jsx)("input",{id:"email",type:"email",required:!0,value:n,onChange:e=>r(e.target.value),className:"mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm placeholder-gray-400 focus:outline-none focus:ring-apn-blue focus:border-apn-blue",placeholder:"[email protected]"})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"accessCode",className:"block text-sm font-medium text-gray-700",children:"Access Code"}),(0,nn.jsx)("input",{id:"accessCode",type:"text",required:!0,value:a,onChange:e=>i(e.target.value.toUpperCase()),maxLength:6,className:"mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm placeholder-gray-400 focus:outline-none focus:ring-apn-blue focus:border-apn-blue font-mono text-lg tracking-widest text-center",placeholder:"ABC123"}),(0,nn.jsx)("p",{className:"mt-1 text-xs text-gray-500",children:"6-character code provided after your demo"})]}
2),(0,nn.jsx)("button",{type:"submit",disabled:c,className:"w-full flex justify-center py-2 px-4 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-apn-blue hover:bg-apn-dark-blue focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-apn-blue disabled:opacity-50 disabled:cursor-not-allowed",children:c?(0,nn.jsxs)("svg",{className:"animate-spin h-5 w-5 text-white",fill:"none",viewBox:"0 0 24 24",children:[(0,nn.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,nn.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}):"Sign In to Portal"})]}),(0,nn.jsx)("div",{className:"mt-6 border-t border-gray-200 pt-6",children:(0,nn.jsxs)("p",{className:"text-center text-xs text-gray-500",children:["Don't have an access code?"," ",(0,nn.jsx)(dt,{to:"/about/contact",className:"text-apn-blue hover:underline font-medium",children:"Contact us"})," ","to schedule a demo."]})})]})})]})}const xa={pending_deposit:{text:"Pending Deposit",color:"bg-yellow-100 text-yellow-800"},active:{text:"Active",color:"bg-green-100 text-green-800"},in_progress:{text:"In Progress",color:"bg-blue-100 text-blue-800"},review:{text:"Under Review",color:"bg-purple-100 text-purple-800"},completed:{text:"Completed",color:"bg-green-100 text-green-800"},expired:{text:"Expired",color:"bg-red-100 text-red-800"}};function ba(){var t;const n=oe(),[r,a]=(0,e.useState)(null),[i,o]=(0,e.useState)(!0),[l,c]=(0,e.useState)(null),[d,u]=(0,e.useState)(!1),m=(0,e.useCallback)(()=>{try{const e=sessionStorage.getItem("clientSession");return e?JSON.parse(e):null}catch(e){return null}},[]);(0,e.useEffect)(()=>{const e=m();if(null===e||void 0===e||!e.id)return void n("/client/login");(async()=>{try{const t=await nr(e.id);if(!t)return sessionStorage.removeItem("clientSession"),void n("/client/login");t.requireDeposit&&t.depositPaid&&Zn(t.timerExpiresAt)&&"expired"!==t.projectStatus&&await sr(t.id),a(t)}catch(t){console.error("Error loading client:",t)}finally{o(!1)}})()},[n,m]),(0,e.useEffect)(()=>{if(null===r||void 0===r||!r.timerExpiresAt)return;const e=()=>{const e=er(r.timerExpiresAt);c(e),e.expired&&"expired"!==r.projectStatus&&(sr(r.id),a(e=>(0,s.A)((0,s.A)({},e),{},{projectStatus:"expired",accessEnabled:!1})))};e();const t=setInterval(e,1e3);return()=>clearInterval(t)},[null===r||void 0===r?void 0:r.timerExpiresAt,null===r||void 0===r?void 0:r.id,null===r||void 0===r?void 0:r.projectStatus]);if(i)return(0,nn.jsx)("div",{className:"flex justify-center items-center h-screen",children:(0,nn.jsx)("div",{className:"animate-spin rounded-full h-12 w-12 border-t-2 border-b-2 border-apn-blue"})});if(!r)return(0,nn.jsx)("div",{className:"min-h-screen flex items-center justify-center",children:(0,nn.jsxs)("div",{className:"text-center",children:[(0,nn.jsx)("h2",{className:"text-2xl font-bold text-gray-900 mb-4",children:"Session Expired"}),(0,nn.jsx)(dt,{to:"/client/login",className:"text-apn-blue hover:underline",children:"Return to login"})]})});const h=xa[r.projectStatus]||xa.active,p=!!r.requireDeposit,g=!!r.depositPaid,f=p&&!g,x=p&&g&&("expired"===r.projectStatus||(null===l||void 0===l?void 0:l.expired));return(0,nn.jsxs)("div",{className:"min-h-screen bg-gray-50",children:[(0,nn.jsx)("header",{className:"bg-white shadow-sm",children:(0,nn.jsxs)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-4 flex items-center justify-between",children:[(0,nn.jsxs)("div",{className:"flex items-center",children:[(0,nn.jsx)(dt,{to:"/",children:(0,nn.jsx)("img",{src:"".concat("","/apn-logos/APN-Tag-blue.png"),alt:"APN Logo",className:"h-10"})}),(0,nn.jsx)("span",{className:"ml-4 text-lg font-semibold text-gray-700",children:"Client Portal"})]}),(0,nn.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,nn.jsx)("span",{className:"text-sm text-gray-600",children:r.companyName}),(0,nn.jsx)("button",{onClick:()=>{sessionStorage.removeItem("clientSession"),n("/client/login")},className:"text-sm text-red-600 hover:text-red-800 font-medium",children:"Logout"})]})]})}),(0,nn.jsxs)("main",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:[f&&(0,nn.jsxs)("div",{className:"mb-6 bg-yellow-50 border border-yellow-200 rounded-lg p-6 text-center",children:[(0,nn.jsx)("svg",{className:"h-12 w-12 text-yellow-500 mx-auto mb-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),(0,nn.jsx)("h3",{className:"text-lg font-bold text-yellow-800 mb
2-2",children:"Complete Your $5 Deposit"}),(0,nn.jsx)("p",{className:"text-yellow-700 mb-4",children:"A $5 refundable deposit is required to activate your 48-hour site preview. This amount is applied toward any plan you choose."}),(0,nn.jsx)(dt,{to:"/client/deposit/".concat(r.id),className:"inline-flex items-center px-6 py-3 bg-apn-blue text-white rounded-lg hover:bg-apn-dark-blue transition-colors font-medium",children:"Pay $5 Deposit & Activate Preview"})]}),p&&g&&!x&&l&&(0,nn.jsx)("div",{className:"mb-6 rounded-lg p-4 ".concat(l.hours<6?"bg-red-50 border border-red-200":l.hours<24?"bg-yellow-50 border border-yellow-200":"bg-green-50 border border-green-200"),children:(0,nn.jsxs)("div",{className:"flex items-center justify-between",children:[(0,nn.jsxs)("div",{className:"flex items-center",children:[(0,nn.jsx)("svg",{className:"h-6 w-6 mr-2 text-gray-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})}),(0,nn.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Preview Access Time Remaining"})]}),(0,nn.jsxs)("div",{className:"flex space-x-2 font-mono text-2xl font-bold",children:[(0,nn.jsxs)("div",{className:"bg-white rounded px-3 py-1 shadow-sm",children:[(0,nn.jsx)("span",{className:"text-gray-900",children:String(l.hours).padStart(2,"0")}),(0,nn.jsx)("span",{className:"text-xs text-gray-500 block text-center",children:"HRS"})]}),(0,nn.jsx)("span",{className:"text-gray-400 self-start pt-1",children:":"}),(0,nn.jsxs)("div",{className:"bg-white rounded px-3 py-1 shadow-sm",children:[(0,nn.jsx)("span",{className:"text-gray-900",children:String(l.minutes).padStart(2,"0")}),(0,nn.jsx)("span",{className:"text-xs text-gray-500 block text-center",children:"MIN"})]}),(0,nn.jsx)("span",{className:"text-gray-400 self-start pt-1",children:":"}),(0,nn.jsxs)("div",{className:"bg-white rounded px-3 py-1 shadow-sm",children:[(0,nn.jsx)("span",{className:"text-gray-900",children:String(l.seconds).padStart(2,"0")}),(0,nn.jsx)("span",{className:"text-xs text-gray-500 block text-center",children:"SEC"})]})]})]})}),x&&(0,nn.jsxs)("div",{className:"mb-6 bg-red-50 border border-red-200 rounded-lg p-6 text-center",children:[(0,nn.jsx)("svg",{className:"h-12 w-12 text-red-400 mx-auto mb-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})}),(0,nn.jsx)("h3",{className:"text-lg font-bold text-red-800 mb-2",children:"Preview Access Expired"}),(0,nn.jsx)("p",{className:"text-red-700 mb-4",children:"Your 48-hour preview window has ended. Contact our team to extend your access or discuss next steps."}),(0,nn.jsx)(dt,{to:"/about/contact",className:"inline-flex items-center px-4 py-2 bg-apn-blue text-white rounded-lg hover:bg-apn-dark-blue transition-colors",children:"Contact Us to Continue"})]}),(0,nn.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6 mb-8",children:[(0,nn.jsxs)("div",{className:"bg-white rounded-lg shadow p-6",children:[(0,nn.jsx)("h3",{className:"text-sm font-medium text-gray-500 mb-1",children:"Project Status"}),(0,nn.jsx)("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-sm font-medium ".concat(h.color),children:h.text})]}),(0,nn.jsxs)("div",{className:"bg-white rounded-lg shadow p-6",children:[(0,nn.jsx)("h3",{className:"text-sm font-medium text-gray-500 mb-1",children:"Company"}),(0,nn.jsx)("p",{className:"text-lg font-semibold text-gray-900",children:r.companyName})]}),(0,nn.jsxs)("div",{className:"bg-white rounded-lg shadow p-6",children:[(0,nn.jsx)("h3",{className:"text-sm font-medium text-gray-500 mb-1",children:"Project Type"}),(0,nn.jsx)("p",{className:"text-lg font-semibold text-gray-900 capitalize",children:"both"===r.projectType?"Website + AI Integration":"ai_integration"===r.projectType?"AI Integration":"Website Development"})]})]}),(null===(t=r.servicesRequested)||void 0===t?void 0:t.length)>0&&(0,nn.jsxs)("div",{className:"bg-white rounded-lg shadow p-6 mb-8",children:[(0,nn.jsx)("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Services Requested"}),(0,nn.jsx)("div",{className:"flex flex-wrap gap-2",children:r.servicesRequested.map(e=>(0,nn.jsx)("span",{className:"px-3 py-1 bg-apn-blue bg-opacity-10 text-apn-blue rounded-full text-sm font-medium",children:e},e))})]}),(r.sitePreviewUrl||r.previewUrl)&&!x&&!f&&(0,nn.jsxs)("div",{className:"bg-white rounded-lg shadow overflow-hidden mb-8",children:[(0,nn.jsxs)("div",{className:"p-6 border-b border-gray-200 flex items-center justify-between",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("h3",{className:"text-lg font-semibold text-gray-900",children:"Your Site Preview"}),(0,nn.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:"Live preview of your project in progress"})]}),(0,nn.jsxs)("div",{className:"flex space-x-3",children:[(0,nn.jsx)("button",{onClick:()=>u(!d),className:"px-4 py-2 bg-apn-blue text-white rounded-lg hover:bg-apn-dark-blue transition-colors text-sm",children:d?"Hide Preview":"Show Preview"}),(0,nn.jsx)("a",{href:r.sitePreviewUrl||r.previewUrl,target:"_blank",rel:"noopener noreferrer",className:"px-4 py-2 border border-gray-300 rounded-lg hover:bg-gray-50 transition-colors text-sm text-gray-700",children:"Open in New Tab \u2197"})]})]}),d&&(0,nn.jsx)("div",{className:"w-full",style:{height:"70vh"},children:(0,nn.jsx)("iframe",{src:r.sitePreviewUrl||r.previewUrl,title:"Site Preview",className:"w-full h-full border-0",sandbox:"allow-scripts allow-same-origin allow-popups"})})]}),r.projectNotes&&(0,nn.jsxs)("div",{className:"bg-white rounded-lg shadow p-6 mb-8",children:[(0,nn.jsx)("h3",{className:"text-lg font-semibold text-gray-900 mb-3",children:"Project Notes"}),(0,nn.jsx)("div",{className:"prose prose-sm max-w-none text-gray-700 whitespace-pre-wrap",children:r.projectNotes})]}),!x&&!f&&!r.tier&&(0,nn.jsxs)("div",{className:"bg-white rounded-lg shadow p-6 mb-8",children:[(0,nn.jsx)("h3",{className:"text-lg font-semibold text-gray-900 mb-2",children:"Choose Your Plan"}),(0,nn.jsx)("p",{className:"text-sm text-gray-500 mb-6",children:p&&g?"Your $5 deposit is applied toward any plan. Choose the package that fits your business.":"Select the package that fits your business needs."}),(0,nn.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:[{key:"starter",name:"Starter",price:"$79",period:"/mo",features:["Single-page site","Mobile responsive","Contact form","SEO basics"]},{key:"professional",name:"Professional",price:"$199",period:"/mo",popular:!0,features:["Up to 5 pages","Custom design","Google Analytics","Blog integration"]},{key:"premium",name:"Premium",price:"$399",period:"/mo",features:["Up to 10 pages","AI chatbot integration","Booking system","Priority support"]},{key:"enterprise",name:"Enterprise",price:"$799",period:"/mo",features:["Unlimited pages","Custom integrations","E-commerce","Dedicated manager"]}].map(e=>(0,nn.jsxs)("div",{className:"border rounded-lg p-4 relative ".concat(e.popular?"border-apn-blue ring-2 ring-apn-blue ring-opacity-50":"border-gray-200"),children:[e.popular&&(0,nn.jsx)("span",{className:"absolute -top-3 left-1/2 -translate-x-1/2 bg-apn-blue text-white text-xs font-bold px-3 py-0.5 rounded-full",children:"Most Popular"}),(0,nn.jsx)("h4",{className:"text-lg font-bold text-gray-900 mt-1",children:e.name}),(0,nn.jsxs)("p",{className:"text-2xl font-bold text-apn-blue my-2",children:[e.price,(0,nn.jsx)("span",{className:"text-sm font-normal text-gray-500",children:e.period})]}),(0,nn.jsx)("ul",{className:"text-sm text-gray-600 space-y-1 mb-4",children:e.features.map(e=>(0,nn.jsxs)("li",{className:"flex items-start",children:[(0,nn.jsx)("svg",{className:"h-4 w-4 text-green-500 mr-1.5 mt-0.5 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M5 13l4 4L19 7"})}),e]},e))}),(0,nn.jsx)(dt,{to:"/about/contact",className:"block text-center py-2 px-3 rounded-lg text-sm font-medium transition-colors ".concat(e.popular?"bg-apn-blue text-white hover:bg-apn-dark-blue":"border border-apn-blue text-apn-blue hover:bg-blue-50"),children:"Get Started"})]},e.key))})]}),r.tier&&(0,nn.jsxs)("div",{className:"bg-green-50 border border-green-200 rounded-lg p-6 mb-8",children:[(0,nn.jsx)("h3",{className:"text-lg font-semibold text-green-800 mb-1",children:"Your Plan"}),(0,nn.jsx)("p",{className:"text-green-700 capitalize text-2xl font-bold",children:r.tier})]}),(0,nn.jsxs)("div",{className:"bg-apn-blue rounded-lg p-8 text-center text-white",children:[(0,nn.jsx)("h3",{className:"text-xl font-bold mb-2",children:"Have Questions About Your Project?"}),(0,nn.jsx)("p",{className:"text-blue-100 mb-4",children:"Our team is here to help. Reach out anytime."}),(0,nn.jsx)(dt,{to:"/about/contact",className:"inline-flex items-center px-6 py-3 bg-white text-apn-blue rounded-lg hover:bg-gray-100 transition-colors font-medium",children:"Contact Our Team"})]})]})]})}function ya(){const{id:t}=le(),n=oe(),[r,s]=(0,e.useState)(null),[a,i]=(0,e.useState)(!0),[o,l]=(0,e.useState)(!1),[c,d]=(0,e.useState)("");(0,e.useEffect)(()=>{t&&(async()=>{try{const e=await nr(t);if(!e)return d("Client record not found."),void i(!1);if(e.depositPaid)return void n("/client/login");s(e)}catch(e){console.error("Error loading client:",e),d("Could not load your information.")}finally{i(!1)}})()},[t,n]);return a?(0,nn.jsx)("div",{className:"flex justify-center items-center h-screen",children:(0,nn.jsx)("div",{className:"animate-spin rounded-full h-12 w-12 border-t-2 border-b-2 border-apn-blue"})}):(0,nn.jsx)("div",{className:"min-h-screen bg-gray-50 flex flex-col justify-center py-12 px-4",children:(0,nn.jsxs)("div",{className:"sm:mx-auto sm:w-full sm:max-w-lg",children:[(0,nn.jsx)(dt,{to:"/",className:"flex justify-center mb-6",children:(0,nn.jsx)("img",{src:"".concat("","/apn-logos/APN-Tag-blue.png"),alt:"APN Logo",className:"h-16"})}),(0,nn.jsxs)("div",{className:"bg-white shadow-lg rounded-lg overflow-hidden",children:[(0,nn.jsxs)("div",{className:"bg-apn-blue text-white p-6 text-center",children:[(0,nn.jsx)("h2",{className:"text-2xl font-bold",children:"Activate Your Site Preview"}),(0,nn.jsx)("p",{className:"text-blue-100 mt-1",children:"Complete a $5 deposit to access your preview"})]}),(0,nn.jsxs)("div",{className:"p-8",children:[c&&(0,nn.jsx)("div",{className:"mb-6 bg-red-50 border border-red-200 text-red-700 px-4 py-3 rounded-lg text-sm",children:c}),r?(0,nn.jsxs)(nn.Fragment,{children:[(0,nn.jsxs)("div",{className:"mb-6 space-y-3",children:[(0,nn.jsxs)("div",{className:"flex justify-between text-sm",children:[(0,nn.jsx)("span",{className:"text-gray-600",children:"Company"}),(0,nn.jsx)("span",{className:"font-medium text-gray-900",children:r.companyName})]}),(0,nn.jsxs)("div",{className:"flex justify-between text-sm",children:[(0,nn.jsx)("span",{className:"text-gray-600",children:"Contact"}),(0,nn.jsx)("span",{className:"font-medium text-gray-900",children:r.contactName})]}),(0,nn.jsxs)("div",{className:"flex justify-between text-sm",children:[(0,nn.jsx)("span",{className:"text-gray-600",children:"Email"}),(0,nn.jsx)("span",{className:"font-medium text-gray-900",children:r.contactEmail})]}),(0,nn.jsx)("hr",{className:"border-gray-200"}),(0,nn.jsxs)("div",{className:"flex justify-between",children:[(0,nn.jsx)("span",{className:"text-gray-900 font-semibold",children:"Preview Deposit"}),(0,nn.jsx)("span",{className:"text-2xl font-bold text-apn-blue",children:"$5.00"})]})]}),(0,nn.jsxs)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-4 mb-6",children:[(0,nn.jsx)("h4",{className:"text-sm font-semibold text-blue-800 mb-2",children:"What you get:"}),(0,nn.jsxs)("ul",{className:"text-sm text-blue-700 space-y-1",children:[(0,nn.jsxs)("li",{className:"flex items-center",children:[(0,nn.jsx)("svg",{className:"h-4 w-4 text-blue-500 mr-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M5 13l4 4L19 7"})}),"48-hour access to your live site preview"]}),(0,nn.jsxs)("li",{className:"flex items-center",children:[(0,nn.jsx)("svg",{className:"h-4 w-4 text-blue-500 mr-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M5 13l4 4L19 7"})}),"Real-time project status tracking"]}),(0,nn.jsxs)("li",{className:"flex items-center",children:[(0,nn.jsx)("svg",{className:"h-4 w-4 text-blue-500 mr-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M5 13l4 4L19 7"})}),"Deposit applied toward final project cost"]})]})]}),(0,nn.jsx)("button",{onClick:async()=>
2{l(!0),d("");try{const e=await fetch("https://us-central1-the-apn.cloudfunctions.net/createClientDepositSession",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({clientId:r.id,email:r.contactEmail,companyName:r.companyName,successUrl:"".concat(window.location.origin,"/client/deposit/").concat(r.id,"/success"),cancelUrl:"".concat(window.location.origin,"/client/deposit/").concat(r.id)})}),t=await e.json();t.url?window.location.href=t.url:d("Could not create checkout session. Please try again.")}catch(e){console.error("Deposit error:",e),d("An error occurred processing your deposit. Please try again.")}finally{l(!1)}},disabled:o,className:"w-full py-3 px-4 bg-apn-blue text-white font-semibold rounded-lg hover:bg-apn-dark-blue transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center",children:o?(0,nn.jsxs)(nn.Fragment,{children:[(0,nn.jsxs)("svg",{className:"animate-spin h-5 w-5 mr-2",fill:"none",viewBox:"0 0 24 24",children:[(0,nn.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,nn.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),"Processing..."]}):"Pay $5 Deposit & Activate Preview"}),(0,nn.jsx)("p",{className:"mt-4 text-xs text-gray-500 text-center",children:"Secure payment processed by Stripe. Your deposit will be applied to your final project cost."})]}):(0,nn.jsx)("p",{className:"text-center text-gray-600",children:"Client record not found. Please contact our team."})]})]})]})})}function va(){const{id:t}=le(),[n,r]=(0,e.useState)(null),[a,i]=(0,e.useState)(!0);return(0,e.useEffect)(()=>{t&&(async()=>{try{const e=await nr(t);if(e&&!e.depositPaid){const n=new URLSearchParams(window.location.search).get("session_id")||"manual";await(async(e,t)=>{try{const n=vt.Dc.fromDate(new Date(Date.now()+1728e5));return await rr(e,{depositPaid:!0,depositDate:(0,vt.serverTimestamp)(),stripePaymentIntentId:t,accessEnabled:!0,projectStatus:"active",timerExpiresAt:n}),{timerExpiresAt:n}}catch(n){throw console.error("Error activating client:",n),n}})(t,n),r((0,s.A)((0,s.A)({},e),{},{depositPaid:!0,accessEnabled:!0}))}else r(e)}catch(e){console.error("Activation error:",e)}finally{i(!1)}})()},[t]),a?(0,nn.jsx)("div",{className:"flex justify-center items-center h-screen",children:(0,nn.jsxs)("div",{className:"text-center",children:[(0,nn.jsx)("div",{className:"animate-spin rounded-full h-12 w-12 border-t-2 border-b-2 border-apn-blue mx-auto mb-4"}),(0,nn.jsx)("p",{className:"text-gray-600",children:"Activating your preview access..."})]})}):(0,nn.jsx)("div",{className:"min-h-screen bg-gray-50 flex flex-col justify-center py-12 px-4",children:(0,nn.jsx)("div",{className:"sm:mx-auto sm:w-full sm:max-w-lg text-center",children:(0,nn.jsxs)("div",{className:"bg-white shadow-lg rounded-lg p-8",children:[(0,nn.jsx)("div",{className:"w-16 h-16 bg-green-100 rounded-full flex items-center justify-center mx-auto mb-4",children:(0,nn.jsx)("svg",{className:"h-8 w-8 text-green-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M5 13l4 4L19 7"})})}),(0,nn.jsx)("h2",{className:"text-2xl font-bold text-gray-900 mb-2",children:"Deposit Received!"}),(0,nn.jsx)("p",{className:"text-gray-600 mb-6",children:"Your $5 deposit has been processed successfully. Your 48-hour preview access is now active."}),n&&(0,nn.jsxs)("div",{className:"bg-gray-50 rounded-lg p-4 mb-6 text-left space-y-2",children:[(0,nn.jsxs)("div",{className:"flex justify-between text-sm",children:[(0,nn.jsx)("span",{className:"text-gray-600",children:"Company"}),(0,nn.jsx)("span",{className:"font-medium",children:n.companyName})]}),(0,nn.jsxs)("div",{className:"flex justify-between text-sm",children:[(0,nn.jsx)("span",{className:"text-gray-600",children:"Access Code"}),(0,nn.jsx)("span",{className:"font-mono font-bold text-apn-blue tracking-wider",children:n.accessCode})]}),(0,nn.jsxs)("div",{className:"flex justify-between text-sm",children:[(0,nn.jsx)("span",{className:"text-gray-600",children:"Email"}),(0,nn.jsx)("span",{className:"font-medium",children:n.contactEmail})]})]}),(0,nn.jsxs)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-4 mb-6 text-sm text-left",children:[(0,nn.jsx)("p",{className:"text-blue-800 font-semibold mb-1",children:"Your login credentials:"}),(0,nn.jsxs)("p",{className:"text-blue-700",children:["Use your email (",(0,nn.jsx)("strong",{children:null===n||void 0===n?void 0:n.contactEmail}),") and access code (",(0,nn.jsx)("strong",{className:"font-mono",children:null===n||void 0===n?void 0:n.accessCode}),") to log in at any time during your 48-hour window."]})]}),(0,nn.jsx)(dt,{to:"/client/login",className:"inline-flex items-center px-6 py-3 bg-apn-blue text-white font-semibold rounded-lg hover:bg-apn-dark-blue transition-colors",children:"Go to Client Portal"})]})})})}const wa=()=>(0,nn.jsxs)("div",{className:"bg-white",children:[(0,nn.jsx)("div",{className:"bg-apn-blue text-white py-12",children:(0,nn.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:(0,nn.jsxs)("div",{className:"text-center",children:[(0,nn.jsx)("div",{className:"flex justify-center mb-4",children:(0,nn.jsx)("img",{src:"".concat("","/apn-logos/APN-Tag-white.jpg"),alt:"APN Logo",className:"h-16"})}),(0,nn.jsx)("h1",{className:"text-3xl font-bold",children:"Our Story"})]})})}),(0,nn.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12",children:(0,nn.jsxs)("div",{className:"prose prose-lg mx-auto max-w-5xl",children:[(0,nn.jsx)("p",{className:"text-xl mb-8 leading-relaxed",children:"Accelerated Professionals Network is a community of finance professionals collaborating to create a more seamless M&A transaction process. Catering to junior professionals (non-partners), APN encourages those in the financial industry to begin building their networks early in their careers resulting in more transparency into the full life cycle of a deal, an increase in the potential for expedited career growth and development, and greater access to resources as they continue to advance within their roles/organizations."}),(0,nn.jsx)("p",{className:"text-xl mb-8 leading-relaxed",children:"APN Founder, Caroline Burnham, noticed most financial industry conferences and events were predominantly attended by Partners, Principals, and other seasoned, senior level personnel. Observing this, she found there was a significant divide within the industry and immediately recognized
2why: with deals on the line, it is difficult for firms to justify the risk, expense, and exposure of sending those other than their most accomplished, senior level resources, to these events. This represents an endless catch 22 cycle for emerging financial industry professionals, hoping to break the barrier to entry, and elevate their careers through networking with other well-connected professionals. Unfortunately, promising junior level talent are often precluded from participating in the very network which could increase such career development opportunities. APN was formed to address this need, to fill the networking gap between knowledge and wisdom, education and technology, energy and instinct, mentor and rising talent, and to provide a much-needed platform for motivated and likeminded contemporaries within the deal cycle, to connect with one another."}),(0,nn.jsx)("h2",{className:"text-3xl font-bold mt-12 mb-6",children:"Who We Welcome"}),(0,nn.jsx)("p",{className:"text-xl mb-6 leading-relaxed",children:"APN welcomes the following professionals from the fields of finance and deal making:"}),(0,nn.jsxs)("ul",{className:"list-disc pl-8 mb-12 text-xl space-y-2",children:[(0,nn.jsx)("li",{children:"Investment Banking"}),(0,nn.jsx)("li",{children:"Private Equity"}),(0,nn.jsx)("li",{children:"Private Family Offices"}),(0,nn.jsx)("li",{children:"Real Estate & Development"}),(0,nn.jsx)("li",{children:"Accounting"}),(0,nn.jsx)("li",{children:"Tax Services"}),(0,nn.jsx)("li",{children:"Insurances"}),(0,nn.jsx)("li",{children:"Wealth Management/Financial Planning and Advising"}),(0,nn.jsx)("li",{children:"Law"}),(0,nn.jsx)("li",{children:"Venture Capital"}),(0,nn.jsx)("li",{children:"Business Advising & Strategy"}),(0,nn.jsx)("li",{children:"Tech"}),(0,nn.jsx)("li",{children:"Independent Consulting"}),(0,nn.jsx)("li",{children:"Debt/Credit Providers"}),(0,nn.jsx)("li",{children:"Management Consulting"}),(0,nn.jsx)("li",{children:"Capital Markets"}),(0,nn.jsx)("li",{children:"Any other services that may be involved in a transaction"})]}),(0,nn.jsxs)("div",{className:"mt-16 mb-12",children:[(0,nn.jsx)("h2",{className:"text-3xl font-bold mb-8",children:"Our Team"}),(0,nn.jsxs)("div",{className:"md:flex items-start mb-16",children:[(0,nn.jsxs)("div",{className:"md:w-1/3 mb-6 md:mb-0 md:pr-8",children:[(0,nn.jsx)("img",{src:"/apn-logos/caroline-header-photo.jpeg",alt:"Caroline Burnham",className:"rounded-lg shadow-md w-full"}),(0,nn.jsxs)("div",{className:"mt-4",children:[(0,nn.jsx)("h3",{className:"text-2xl font-bold text-gray-900",children:"Caroline Burnham"}),(0,nn.jsx)("p",{className:"text-apn-blue font-semibold",children:"Founder & CEO"}),(0,nn.jsx)("p",{className:"text-sm text-gray-600 mt-1",children:"[email protected]"}),(0,nn.jsx)("p",{className:"text-sm text-gray-600",children:"(724) 831-6105"})]})]}),(0,nn.jsxs)("div",{className:"md:w-2/3",children:[(0,nn.jsx)("p",{className:"text-xl mb-6 leading-relaxed",children:"Caroline Burnham is the founder of APN and currently serves as the Director and Head of Business Development and Marketing at Ellenoff Grossman and Schole LLP [EGS], a New York City-based law firm specializing in Corporate/Securities, Taxation and Real Estate, Litigation, Intellectual Property, Labor and Employment, Bankruptcy, and Immigration law. She maintains active engagement with industry leaders at conferences, events, and panels, cultivating strategic relationships and advancing opportunities across the mergers and acquisitions and transaction advisory landscape."}),(0,nn.jsx)("p",{className:"text-xl mb-6 leading-relaxed",children:"Leveraging a wealth of expertise, Caroline collaborates with trusted advisors, investors, and corporations, both public and private, to provide legal advisory services related to mergers, acquisitions, divestitures, restructurings, financings, corporate tax matters, estate and gift tax, insurance placement, and litigation support. She leads the firm's client acquisition and cultivation efforts by designing and executing targeted go-to market strategies."}),(0,nn.jsx)("p",{className:"text-xl mb-6 leading-relaxed",children:"Prior to joining EGS, Caroline developed her networking and business development skills at Marshall and Stevens, a full-service valuation firm serving the financial services sector. Preceding in her role at Marshall and Stevens, Caroline began her business development career at SourceScrub, where she was responsible for engaging with industry leaders across the Northeast and European markets."}),(0,nn.jsx)("p",{className:"text-xl mb-6 leading-relaxed",children:"In addition to her professional achievements, she has a strong commitment to philanthropy. She has served as an Advisory Board Member, Marketing Committee Member, and Chairman of the Financial Reform Committee for TEACH, a nonprofit organization dedicated to the education and support of hospital
2ized children."})]})]})]}),(0,nn.jsxs)("div",{className:"mt-16 text-center",children:[(0,nn.jsx)("h3",{className:"text-2xl font-bold mb-6",children:"Connect With Us"}),(0,nn.jsxs)("div",{className:"flex justify-center space-x-8",children:[(0,nn.jsx)("a",{href:"https://www.instagram.com/the_apn_/",target:"_blank",rel:"noopener noreferrer",className:"text-apn-blue hover:text-apn-light-blue transition-colors",children:(0,nn.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-10 w-10",fill:"currentColor",viewBox:"0 0 24 24",children:(0,nn.jsx)("path",{d:"M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zm0-2.163c-3.259 0-3.667.014-4.947.072-4.358.2-6.78 2.618-6.98 6.98-.059 1.281-.073 1.689-.073 4.948 0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98 1.281.058 1.689.072 4.948.072 3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98-1.281-.059-1.69-.073-4.949-.073zm0 5.838c-3.403 0-6.162 2.759-6.162 6.162s2.759 6.163 6.162 6.163 6.162-2.759 6.162-6.163c0-3.403-2.759-6.162-6.162-6.162zm0 10.162c-2.209 0-4-1.79-4-4 0-2.209 1.791-4 4-4s4 1.791 4 4c0 2.21-1.791 4-4 4zm6.406-11.845c-.796 0-1.441.645-1.441 1.44s.645 1.44 1.441 1.44c.795 0 1.439-.645 1.439-1.44s-.644-1.44-1.439-1.44z"})})}),(0,nn.jsx)("a",{href:"https://www.linkedin.com/company/accelerated-professionals-network/?viewAsMember=true",target:"_blank",rel:"noopener noreferrer",className:"text-apn-blue hover:text-apn-light-blue transition-colors",children:(0,nn.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-10 w-10",fill:"currentColor",viewBox:"0 0 24 24",children:(0,nn.jsx)("path",{d:"M19 0h-14c-2.761 0-5 2.239-5 5v14c0 2.761 2.239 5 5 5h14c2.762 0 5-2.239 5-5v-14c0-2.761-2.238-5-5-5zm-11 19h-3v-11h3v11zm-1.5-12.268c-.966 0-1.75-.79-1.75-1.764s.784-1.764 1.75-1.764 1.75.79 1.75 1.764-.783 1.764-1.75 1.764zm13.5 12.268h-3v-5.604c0-3.368-4-3.113-4 0v5.604h-3v-11h3v1.765c1.396-2.586 7-2.777 7 2.476v6.759z"})})})]})]})]})}),(0,nn.jsx)("section",{className:"bg-apn-blue text-white py-12",children:(0,nn.jsxs)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 text-center",children:[(0,nn.jsx)("div",{className:"flex justify-center mb-6",children:(0,nn.jsx)("img",{src:"".concat("","/apn-logos/APN-Tag-SQ-white.jpg"),alt:"APN Logo Square",className:"h-20"})}),(0,nn.jsx)("h2",{className:"text-3xl font-bold mb-4",children:"Ready to Join the Network?"}),(0,nn.jsx)("p",{className:"text-xl mb-8 max-w-3xl mx-auto",children:"Connect with finance professionals, access exclusive resources, and accelerate your career with APN."}),(0,nn.jsx)(dt,{to:"/about/membership",className:"btn-primary bg-white text-apn-blue hover:bg-gray-100",children:"Become a Member Today"})]})})]}),ja=()=>{const t=oe();(0,e.useEffect)(()=>{console.log("MembershipInfo: Redirecting to registration page"),t("/register",{replace:!0})},[t]);return(0,nn.jsxs)("div",{className:"bg-white",children:[(0,nn.jsx)("div",{className:"bg-apn-blue text-white py-12",children:(0,nn.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:(0,nn.jsxs)("div",{className:"text-center",children:[(0,nn.jsx)("div",{className:"flex justify-center mb-4",children:(0,nn.jsx)("img",{src:"".concat("","/apn-logos/APN-Tag-white.jpg"),alt:"APN Logo",className:"h-16"})}),(0,nn.jsx)("h1",{className:"text-3xl font-bold",children:"Membership Information"})]})})}),(0,nn.jsx)("section",{className:"py-12",children:(0,nn.jsxs)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[(0,nn.jsxs)("div",{className:"text-center mb-12",children:[(0,nn.jsx)("h2",{className:"text-3xl font-bold text-gray-900 mb-4",children:"Accelerate your Career with APN"}),(0,nn.jsx)("p",{className:"text-lg text-gray-600 max-w-3xl mx-auto",children:"We are glad you are considering membership with APN! Becoming a member of APN will grant you access to a variety of features including member forums, groups, job boards, project inquiry boards, member directories, and more."})]}),(0,nn.jsxs)("div",{className:"mb-12",children:[(0,nn.jsx)("p",{className:"text-lg text-gray-600 mb-4",children:'Membership with APN is on a "Tier" system. Your Tier will not prevent you from attending or accessing APN events. Please make sure you are signing up for the correct tier as registration is monitored, evaluated, and approved by APN staff.'}),(0,nn.jsx)("p",{className:"text-lg text-gray-600",children:"If your exact role is not listed, please choose the one closest to your current title. If you are an Independent Contractor or currently between roles, please choose the title that you are applying to jobs for or the closest to your seniority level. Should you have any questions, please email [email protected]."})]}),(0,nn.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8",children:[{id:1,name:"Tier 1",price:"$75.00 per Year",description:"Analysts & Associates with less than three years of experience (also referred to as recent undergraduates)."},{id:2,name:"Tier 2",price:"$125.00 per Year",description:"Analysts & Associates with more than three years of experience."},{id:3,name:"Tier 3",price:"$175.00 per Year",description:"Managers, VP's, Directors, and Managing Directors."},{id:4,name:"Tier 4",price:"$225.00 per Year",description:"C-suite Executives, Principals, Partners, and Business Owners."},{id:5,name:"Tier USV",price:"$75.00 per Year",description:"US Veterans, regardless of seniority level."}].map(e=>(0,nn.jsxs)("div",{className:"bg-white rounded-lg shadow-lg overflow-hidden border border-gray-200",children:[(0,nn.jsxs)("div",{className:"bg-apn-blue text-white p-6",children:[(0,nn.jsx)("h3",{className:"text-2xl font-bold",children:e.name}),(0,nn.jsx)("p",{className:"text-xl mt-2",children:e.price})]}),(0,nn.jsxs)("div",{className:"p-6",children:[(0,nn.jsx)("p",{className:"text-gray-600 mb-6",children:e.description}),(0,nn.jsx)(dt,{to:"/register",className:"block w-full bg-apn-blue text-white text-center py-2 px-4 roun
2ded hover:bg-blue-700 transition duration-200",children:"Select"})]})]},e.id))})]})}),(0,nn.jsx)("section",{className:"bg-apn-blue text-white py-12",children:(0,nn.jsxs)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 text-center",children:[(0,nn.jsx)("div",{className:"flex justify-center mb-6",children:(0,nn.jsx)("img",{src:"".concat("","/apn-logos/APN-Tag-SQ-white.jpg"),alt:"APN Logo Square",className:"h-20"})}),(0,nn.jsx)("h2",{className:"text-3xl font-bold mb-4",children:"Ready to Join the Network?"}),(0,nn.jsx)("p",{className:"text-xl mb-8 max-w-3xl mx-auto",children:"Connect with finance professionals, access exclusive resources, and accelerate your career with APN."}),(0,nn.jsx)(dt,{to:"/register",className:"btn-primary bg-white text-apn-blue hover:bg-gray-100",children:"Become a Member Today"})]})})]})},Na=t=>{let{onDiscountApplied:n,onDiscountRemoved:r,originalPrice:s,disabled:a=!1}=t;const[i,o]=(0,e.useState)(""),[l,c]=(0,e.useState)(!1),[d,u]=(0,e.useState)(null),[m,h]=(0,e.useState)(""),p=async()=>{if(i.trim()){c(!0),h("");try{const e=await Vt(i.trim());if(e.valid){const t=Wt(s,e.discountAmount,e.discountType),r={code:i.trim().toUpperCase(),discount:e.discount,discountAmount:e.discountAmount,discountType:e.discountType,originalPrice:s,discountedPrice:t,savings:s-t};u(r),n(r),h("")}else h(e.error),u(null)}catch(m){console.error("Error applying discount:",m),h("Failed to validate discount code"),u(null)}finally{c(!1)}}else h("Please enter a discount code")},g=()=>{o(""),u(null),h(""),r()};return d?(0,nn.jsx)("div",{className:"bg-green-50 border border-green-200 rounded-lg p-4",children:(0,nn.jsxs)("div",{className:"flex items-center justify-between",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsxs)("div",{className:"flex items-center",children:[(0,nn.jsx)("svg",{className:"w-5 h-5 text-green-500 mr-2",fill:"currentColor",viewBox:"0 0 20 20",children:(0,nn.jsx)("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"})}),(0,nn.jsxs)("span",{className:"text-green-800 font-medium",children:["Discount Applied: ",d.code]})]}),(0,nn.jsx)("p",{className:"text-green-700 text-sm mt-1",children:d.discount.description}),(0,nn.jsxs)("div",{className:"text-green-800 text-sm mt-2",children:[(0,nn.jsxs)("span",{className:"line-through",children:["$",d.originalPrice]}),(0,nn.jsxs)("span",{className:"ml-2 font-bold text-lg",children:["$",0===d.discountedPrice?"FREE":d.discountedPrice.toFixed(2)]}),d.savings>0&&(0,nn.jsxs)("span",{className:"ml-2 text-green-600",children:["(Save $",d.savings.toFixed(2),")"]})]})]}),(0,nn.jsx)("button",{onClick:g,className:"text-green-600 hover:text-green-800 text-sm underline",disabled:a,children:"Remove"})]})}):(0,nn.jsxs)("div",{className:"space-y-3",children:[(0,nn.jsxs)("div",{className:"flex space-x-2",children:[(0,nn.jsx)("div",{className:"flex-1",children:(0,nn.jsx)("input",{type:"text",value:i,onChange:e=>o(e.target.value.toUpperCase()),onKeyPress:e=>{"Enter"===e.key&&p()},placeholder:"Enter discount code",className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue focus:border-transparent",disabled:a||l})}),(0,nn.jsx)("button",{onClick:p,disabled:a||l||!i.trim(),className:"px-4 py-2 bg-apn-blue text-white rounded-md hover:bg-blue-700 disabled:bg-gray-400 disabled:cursor-not-allowed transition-colors",children:l?"Validating...":"Apply"})]}),m&&(0,nn.jsxs)("div",{className:"text-red-600 text-sm flex items-center",children:[(0,nn.jsx)("svg",{className:"w-4 h-4 mr-1",fill:"currentColor",viewBox:"0 0 20 20",children:(0,nn.jsx)("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 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z",clipRule:"evenodd"})}),m]}),(0,nn.jsx)("div",{className:"text-xs text-gray-500",children:(0,nn.jsx)("p",{children:"Have a discount code? Enter it above to apply to your membership."})})]})},ka=()=>{var t;const{currentUser:n,userProfile:r}=sn(),[s,a]=(0,e.useState)(!1),[i,o]=(0,e.useState)(null),[l,c]=(0,e.useState)(null),d=r&&!r.membershipTier,u=[{id:"tier1",name:"Tier 1",price:75,description:"Analysts & Associates with less than three years of experience (also referred to as recent undergraduates).",stripeKey:"BASIC"},{id:"tier2",name:"Tier 2",price:125,description:"Analysts & Associates with more than three years of experience.",stripeKey:"PROFESSIONAL"},{id:"tier3",name:"Tier 3",price:175,description:"Managers, VP's, Directors, and Managing Directors.",stripeKey:"PREMIUM"},{id:"tier4",name:"Tier 4",price:225,description:"C-suite Executives, Principals, Partners, and Business Owners.",stripeKey:"EXECUTIVE"},{id:"tierUSV",name:"Tier USV",price:75,description:"US Veterans, regardless of seniority level.",stripeKey:"VETERAN"}];return(0,nn.jsxs)("div",{className:"bg-white",children:[(0,nn.jsx)("div",{className:"bg-apn-blue text-white py-12",children:(0,nn.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:(0,nn.jsxs)("div",{className:"text-center",children:[(0,nn.jsx)("div",{className:"flex justify-center mb-4",children:(0,nn.jsx)("img",{src:"".concat("","/apn-logos/APN-Tag-white.jpg"),alt:"APN Logo",className:"h-16"})}),(0,nn.jsx)("h1",{className:"text-3xl font-bold",children:"Choose Your Membership"}),(0,nn.jsx)("p",{className:"mt-2 text-xl",children:"Select the tier that best fits your career level"})]})})}),(0,nn.jsx)("section",{className:"py-12",children:(0,nn.jsxs)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[d&&(0,nn.jsx)("div",{className:"bg-apn-blue text-white rounded-lg p-6 mb-8",children:(0,nn.jsxs)("div",{className:"text-center",children:[(0,nn.jsxs)("h2",{className:"text-2xl font-bold mb-2",children:["Welcome to APN, ",(null===r||void 0===r?void 0:r.firstName)||"New Member","! \ud83c\udf89"]}),(0,nn.jsx)("p",{className:"text-lg opacity-90",children:"Thank y
2ou for creating your account. Now let's choose your membership tier to unlock all the exclusive benefits of the Accelerated Professionals Network."})]})}),(0,nn.jsxs)("div",{className:"text-center mb-12",children:[(0,nn.jsx)("h2",{className:"text-3xl font-bold text-gray-900 mb-4",children:d?"Choose Your Membership Tier":"Accelerate your Career with APN"}),(0,nn.jsx)("p",{className:"text-lg text-gray-600 max-w-3xl mx-auto",children:"Becoming a member of APN will grant you access to member forums, groups, job boards, project inquiry boards, member directories, and more."})]}),(0,nn.jsx)("div",{className:"mb-12",children:(0,nn.jsx)("p",{className:"text-lg text-gray-600 mb-4",children:'Membership with APN is on a "Tier" system. Your Tier will not prevent you from attending or accessing APN events. Please make sure you are signing up for the correct tier as registration is monitored, evaluated, and approved by APN staff.'})}),i&&(0,nn.jsx)("div",{className:"max-w-md mx-auto mb-12",children:(0,nn.jsxs)("div",{className:"bg-white rounded-lg shadow-lg p-6",children:[(0,nn.jsx)("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Have a Discount Code?"}),(0,nn.jsx)(Na,{onDiscountApplied:c,onDiscountRemoved:()=>c(null),originalPrice:i&&(null===(t=u.find(e=>e.id===i))||void 0===t?void 0:t.price)||0,disabled:s})]})}),(0,nn.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8",children:u.map(e=>(0,nn.jsxs)("div",{className:"bg-white rounded-lg shadow-lg overflow-hidden border border-gray-200 hover:shadow-xl transition-shadow",children:[(0,nn.jsxs)("div",{className:"bg-apn-blue text-white p-6",children:[(0,nn.jsx)("h3",{className:"text-2xl font-bold",children:e.name}),l&&100===l.discountAmount?(0,nn.jsxs)("div",{children:[(0,nn.jsxs)("p",{className:"text-lg line-through opacity-75",children:["$",e.price]}),(0,nn.jsx)("p",{className:"text-3xl font-bold text-green-300",children:"FREE"}),(0,nn.jsxs)("p",{className:"text-sm text-green-200",children:["with ",l.code]})]}):l?(0,nn.jsxs)("div",{children:[(0,nn.jsxs)("p",{className:"text-lg line-through opacity-75",children:["$",e.price]}),(0,nn.jsxs)("p",{className:"text-3xl font-bold",children:["$",(e.price*(1-l.discountAmount/100)).toFixed(2)]}),(0,nn.jsxs)("p",{className:"text-sm text-green-200",children:["with ",l.code]})]}):(0,nn.jsxs)("p",{className:"text-3xl font-bold mt-2",children:["$",e.price]}),(0,nn.jsx)("p",{className:"text-sm opacity-90",children:"per year"})]}),(0,nn.jsxs)("div",{className:"p-6",children:[(0,nn.jsx)("p",{className:"text-gray-600 mb-6",children:e.description}),(0,nn.jsxs)("div",{className:"space-y-3",children:[(0,nn.jsx)("button",{onClick:()=>(async e=>{if(n)if(s)console.log("Payment already in progress, ignoring duplicate request");else{a(!0),o(e.id);try{console.log("Processing membership selection:",e);const t=await sa(n.uid,e.stripeKey,(null===l||void 0===l?void 0:l.code)||null);if(!t.url)throw new Error("Failed to create checkout session");a(!1),o(null),console.log("MembershipSelection: About to redirect to Stripe checkout"),console.log("Session URL:",t.url),console.log("Expected success URL:","".concat(window.location.origin,"/membership/success")),window.location.href=t.url}catch(t){console.error("Error processing membership:",t),alert("Payment failed. Please try again."),a(!1),o(null)}}else alert("Please log in to purchase a membership.")})(e),disabled:s&&i===e.id,className:"w-full bg-apn-blue text-white py-3 px-4 rounded-lg hover:bg-blue-700 transition duration-200 disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center",children:s&&i===e.id?(0,nn.jsxs)(nn.Fragment,{children:[(0,nn.jsxs)("svg",{className:"animate-spin -ml-1 mr-3 h-5 w-5 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[(0,nn.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,nn.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"Processing..."]}):(0,nn.jsxs)(nn.Fragment,{children:[(0,nn.jsx)("svg",{className:"w-5 h-5 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v8a3 3 0 003 3z"})}),"Pay with Stripe"]})}),(0,nn.jsxs)("button",{onClick:()=>alert("PayPal integration coming soon!"),className:"w-full bg-yellow-500 text-white py-3 px-4 roun
2ded-lg hover:bg-yellow-600 transition duration-200 flex items-center justify-center",children:[(0,nn.jsx)("svg",{className:"w-5 h-5 mr-2",fill:"currentColor",viewBox:"0 0 24 24",children:(0,nn.jsx)("path",{d:"M7.076 21.337H2.47a.641.641 0 0 1-.633-.74L4.944.901C5.026.382 5.474 0 5.998 0h7.46c2.57 0 4.578.543 5.69 1.81 1.01 1.15 1.304 2.42 1.012 4.287-.023.143-.047.288-.077.437-.983 5.05-4.349 6.797-8.647 6.797h-2.19c-.524 0-.968.382-1.05.9l-1.12 7.106zm14.146-14.42a3.35 3.35 0 0 0-.607-.541c-.013.076-.026.175-.041.26-.93 4.778-4.005 7.201-9.138 7.201h-2.19a.9.9 0 0 0-.89.756l-1.195 7.583a.384.384 0 0 0 .38.443h3.508c.457 0 .843-.334.917-.788l.038-.207.732-4.64.047-.257a.9.9 0 0 1 .917-.788h.577c3.719 0 6.624-1.51 7.47-5.881.354-1.832.172-3.357-.648-4.588a4.077 4.077 0 0 0-.916-.653z"})}),"Pay with PayPal"]})]}),(0,nn.jsx)("p",{className:"text-xs text-gray-500 mt-4 text-center",children:"Secure payment processing \u2022 Cancel anytime"})]})]},e.id))}),(0,nn.jsxs)("div",{className:"mt-16 bg-gray-50 rounded-lg p-8",children:[(0,nn.jsx)("h3",{className:"text-2xl font-bold text-center mb-8",children:"All Memberships Include:"}),(0,nn.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6",children:[(0,nn.jsxs)("div",{className:"text-center",children:[(0,nn.jsx)("div",{className:"w-12 h-12 bg-apn-blue rounded-full flex items-center justify-center mx-auto mb-4",children:(0,nn.jsx)("svg",{className:"w-6 h-6 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z"})})}),(0,nn.jsx)("h4",{className:"font-semibold",children:"Member Directory"}),(0,nn.jsx)("p",{className:"text-sm text-gray-600",children:"Connect with professionals"})]}),(0,nn.jsxs)("div",{className:"text-center",children:[(0,nn.jsx)("div",{className:"w-12 h-12 bg-apn-blue rounded-full flex items-center justify-center mx-auto mb-4",children:(0,nn.jsx)("svg",{className:"w-6 h-6 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M21 13.255A23.931 23.931 0 0112 15c-3.183 0-6.22-.62-9-1.745M16 6V4a2 2 0 00-2-2h-4a2 2 0 00-2-2v2m8 0V6a2 2 0 012 2v6a2 2 0 01-2 2H8a2 2 0 01-2-2V8a2 2 0 012-2V6"})})}),(0,nn.jsx)("h4",{className:"font-semibold",children:"Job Board"}),(0,nn.jsx)("p",{className:"text-sm text-gray-600",children:"Exclusive job opportunities"})]}),(0,nn.jsxs)("div",{className:"text-center",children:[(0,nn.jsx)("div",{className:"w-12 h-12 bg-apn-blue rounded-full flex items-center justify-center mx-auto mb-4",children:(0,nn.jsx)("svg",{className:"w-6 h-6 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10"})})}),(0,nn.jsx)("h4",{className:"font-semibold",children:"Project Board"}),(0,nn.jsx)("p",{className:"text-sm text-gray-600",children:"Find consulting opportunities"})]}),(0,nn.jsxs)("div",{className:"text-center",children:[(0,nn.jsx)("div",{className:"w-12 h-12 bg-apn-blue rounded-full flex items-center justify-center mx-auto mb-4",children:(0,nn.jsx)("svg",{className:"w-6 h-6 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})})}),(0,nn.jsx)("h4",{className:"font-semibold",children:"Forums & Groups"}),(0,nn.jsx)("p",{className:"text-sm text-gray-600",children:"Industry discussions"})]})]})]})]})})]})},Aa=()=>{const[t,n]=(0,e.useState)(1),[r,a]=(0,e.useState)(null),[i,o]=(0,e.useState)(""),[l,c]=(0,e.useState)(null),[d,u]=(0,e.useState)(!1),[m,h]=(0,e.useState)(""),[p,g]=(0,e.useState)({firstName:"",lastName:"",email:"",password:"",passwordConfirm:"",company:"",jobTitle:"",phone:"",linkedinUrl:"",aboutMe:""}),[f,x]=(0,e.useState)(!1),[b,y]=(0,e.useState)(!1),{signup:v,hasRole:w}=sn(),j=oe(),N="function"===typeof w&&w("admin"),k=e=>{const{name:t,value:n}=e.target;g(e=>(0,s.A)((0,s.A)({},e),{},{[t]:n}))},A=async()=>
2{if(i.trim())try{u(!0);const e=await Vt(i.trim());if(e.valid){const t=Wt(r.price,e.discountAmount,e.discountType);c({code:i.trim().toUpperCase(),discount:e.discount,originalPrice:r.price,discountedPrice:t,savings:r.price-t}),h("")}else c(null),h(e.error||"Invalid discount code")}catch(m){c(null),h("Error validating discount code")}finally{u(!1)}else c(null)},S=async()=>{if(p.firstName&&p.lastName&&p.email&&p.password)if(p.password===p.passwordConfirm)if(p.password.length<6)h("Password must be at least 6 characters");else if(f)if(b)try{u(!0),h("");const e={displayName:"".concat(p.firstName," ").concat(p.lastName),firstName:p.firstName,lastName:p.lastName,company:p.company,jobTitle:p.jobTitle,phone:p.phone,linkedinUrl:p.linkedinUrl,aboutMe:p.aboutMe,selectedTier:r.key,discountCode:(null===l||void 0===l?void 0:l.code)||null};console.log("Starting signup process...");const t=(l&&"number"===typeof l.discountedPrice?l.discountedPrice:r.price||0)>0,n=await v(p.email,p.password,e,null,{keepSession:t});console.log("Signup result:",n),t?j("/membership-payment",{state:{tier:r,discount:l||null,userData:(0,s.A)((0,s.A)({},e),{},{email:p.email})}}):j("/pending-approval",{state:{userData:(0,s.A)((0,s.A)({},e),{},{email:p.email,selectedTier:r.key})}})}catch(m){console.error("Registration error:",m),h("Failed to create account: "+m.message)}finally{u(!1)}else h("Please agree to the Privacy Policy to continue");else h("Please agree to the Terms and Conditions to continue");else h("Passwords do not match");else h("Please fill in all required fields")};return(0,nn.jsxs)("div",{className:"min-h-screen bg-gray-50 py-12",children:[1===t&&(0,nn.jsxs)("div",{className:"max-w-6xl mx-auto p-6",children:[(0,nn.jsxs)("div",{className:"text-center mb-8",children:[(0,nn.jsx)("h1",{className:"text-3xl font-bold text-gray-900 mb-4",children:"Choose Your Membership"}),(0,nn.jsx)("p",{className:"text-lg text-gray-600",children:"Select the membership tier that best fits your career stage"})]}),(0,nn.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:Object.entries(Bt).map(e=>{let[t,r]=e;return(0,nn.jsxs)("div",{className:"bg-white rounded-lg shadow-lg p-6 border-2 border-gray-200 hover:border-apn-blue transition-colors",children:[(0,nn.jsx)("h3",{className:"text-xl font-bold text-gray-900 mb-2",children:r.name}),(0,nn.jsxs)("div",{className:"text-3xl font-bold text-apn-blue mb-4",children:["$",r.price,"/year"]}),(0,nn.jsx)("p",{className:"text-gray-600 mb-6",children:r.description}),r.features&&r.features.length>0&&(0,nn.jsx)("ul",{className:"space-y-2 mb-6",children:r.features.map((e,t)=>(0,nn.jsxs)("li",{className:"flex items-center text-sm text-gray-600",children:[(0,nn.jsx)("svg",{className:"h-4 w-4 text-green-500 mr-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),e]},t))}),(0,nn.jsxs)("button",{onClick:()=>{return e=t,h(""),a((0,s.A)({key:e},Bt[e])),void n(2);var e},className:"w-full bg-apn-blue text-white py-2 px-4 rounded-lg font-semibold hover:bg-blue-700 transition duration-200",children:["Select ",r.name]})]},t)})})]}),2===t&&(()=>{var e;return(0,nn.jsxs)("div",{className:"max-w-2xl mx-auto p-6",children:[(0,nn.jsxs)("div",{className:"text-center mb-8",children:[(0,nn.jsx)("h1",{className:"text-3xl font-bold text-gray-900 mb-4",children:"Complete Your Profile"}),(0,nn.jsxs)("p",{className:"text-lg text-gray-600",children:["Selected: ",r.name," - $",r.price,"/year"]})]}),(0,nn.jsxs)("form",{className:"space-y-6",children:[(0,nn.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"First Name *"}),(0,nn.jsx)("input",{type:"text",name:"firstName",required:!0,value:p.firstName,onChange:k,className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-apn-blue focus:border-apn-blue"})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Last Name *"}),(0,nn.jsx)("input",{type:"text",name:"lastName",required:!0,value:p.lastName,onChange:k,className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-apn-blue focus:border-apn-blue"})]})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Email Address *"}),(0,nn.jsx)("input",{type:"email",name:"email",required:!0,value:p.email,onChange:k,className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-apn-blue focus:border-apn-blue"})]}),(0,nn.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Password *"}),(0,nn.jsx)("input",{type:"password",name:"password",required:!0,value:p.password,onChange:k,className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-apn-blue focus:border-apn-blue"})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Confirm Password *"}),(0,nn.jsx)("input",{type:"password",name:"passwordConfirm",required:!0,value:p.passwordConfirm,onChange:k,className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-apn-blue focus:border-apn-blue"})]})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Company"}),(0,nn.jsx)("input",{type:"text",name:"company",value:p.company,onChange:k,className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-apn-blue focus:border-apn-blue"})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Job Title"}),(0,nn.jsx)("input",{type:"text",name:"jobTitle",value:p.jobTitle,onChange:k,className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-apn-blue focus:border-apn-blue"})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Phone Number"}),(0,nn.jsx)("input",{type:"tel",name:"phone",value:p.phone,onChange:k,className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-apn-blue focus:border-apn-blue"})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"LinkedIn Profile"}),(0,nn.jsx)("input",{type:"url",name:"linkedinUrl",value:p.linkedinUrl,onChange:k,placeholder:"https://linkedin.com/in/yourprofile",className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-apn-blue focus:border-apn-blue"})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"About Me"}),(0,nn.jsx)("textarea",{name:"aboutMe",rows:4,value:p.aboutMe,onChange:k,className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-apn-blue focus:border-apn-blue"})]}),(0,nn.jsxs)("div",{className:"bg-gray-50 p-4 rounded-lg",children:[(0,nn.jsx)("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Discount Code (Optional)"}),(0,nn.jsxs)("div",{className:"flex space-x-2",children:[(0,nn.jsx)("input",{type:"text",value:i,onChange:e=>o(e.target.value),placeholder:"Enter discount code",className:"flex-1 px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-apn-blue focus:border-apn-blue"}),(0,nn.jsx)("button",{type:"button",onClick:A,disabled:d,className:"px-4 py-2 bg-green-600 text-white rounded-md hover:bg-green-700 disabled:bg-gray-400",children:d?"Validating...":"Apply"})]}),l&&(0,nn.jsxs)("div",{className:"mt-4 p-3 bg-green-100 border border-green-400 rounded-md",children:[(0,nn.jsx)("p",{className:"text-green-800 font-semibold",children:"\u2705 Discount Applied!"}),(0,nn.jsxs)("p",{className:"text-green-700",children:["object"===typeof l.discount&&null!==(e=l.discount)&&void 0!==e&&e.description?"".concat(l.discount.de
2scription," - "):"","Save $",l.savings]}),(0,nn.jsxs)("p",{className:"text-lg font-bold text-green-800",children:["Final Price: $",l.discountedPrice,0===l.discountedPrice&&" (FREE!)"]})]})]}),(0,nn.jsx)("div",{className:"bg-red-50 border border-red-200 p-6 rounded-lg",children:(0,nn.jsxs)("div",{className:"flex items-start",children:[(0,nn.jsx)("div",{className:"flex-shrink-0",children:(0,nn.jsx)("svg",{className:"h-5 w-5 text-red-400 mt-0.5",viewBox:"0 0 20 20",fill:"currentColor",children:(0,nn.jsx)("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 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z",clipRule:"evenodd"})})}),(0,nn.jsxs)("div",{className:"ml-3",children:[(0,nn.jsxs)("h3",{className:"text-lg font-semibold text-red-800 mb-4",children:["\u26a0\ufe0f LEGAL AGREEMENTS",N?" (DEBUG)":""," - Required for All Memberships"]}),(0,nn.jsxs)("div",{className:"space-y-3",children:[(0,nn.jsxs)("label",{className:"flex items-start",children:[(0,nn.jsx)("input",{type:"checkbox",checked:f,onChange:e=>x(e.target.checked),className:"mt-1 mr-3 h-4 w-4 text-red-600 focus:ring-red-500 border-gray-300 rounded",required:!0}),(0,nn.jsxs)("span",{className:"text-sm text-gray-700",children:["I agree to the"," ",(0,nn.jsx)(dt,{to:"/legal/terms-and-conditions",target:"_blank",className:"text-blue-600 hover:text-blue-800 underline",children:"Terms and Conditions"})," ","*"]})]}),(0,nn.jsxs)("label",{className:"flex items-start",children:[(0,nn.jsx)("input",{type:"checkbox",checked:b,onChange:e=>y(e.target.checked),className:"mt-1 mr-3 h-4 w-4 text-red-600 focus:ring-red-500 border-gray-300 rounded",required:!0}),(0,nn.jsxs)("span",{className:"text-sm text-gray-700",children:["I agree to the"," ",(0,nn.jsx)(dt,{to:"/legal/privacy-policy",target:"_blank",className:"text-blue-600 hover:text-blue-800 underline",children:"Privacy Policy"})," ","*"]})]})]}),(0,nn.jsx)("p",{className:"text-xs text-red-600 mt-2 font-medium",children:"* Required for membership registration"})]})]})}),m&&(0,nn.jsx)("div",{className:"p-3 bg-red-100 border border-red-400 text-red-700 rounded-md",children:m}),(0,nn.jsxs)("div",{className:"flex space-x-4",children:[(0,nn.jsx)("button",{type:"button",onClick:()=>n(1),className:"flex-1 px-4 py-2 border border-gray-300 text-gray-700 rounded-md hover:bg-gray-50",children:"Back to Plans"}),(0,nn.jsx)("button",{type:"button",onClick:S,disabled:d||!f||!b,className:"flex-1 px-4 py-2 bg-apn-blue text-white rounded-md hover:bg-blue-700 disabled:bg-gray-400 disabled:cursor-not-allowed",children:d?"Creating Account...":l&&0===l.discountedPrice?"Complete Registration (FREE)":"Continue to Payment"})]}),(!f||!b)&&(0,nn.jsx)("p",{className:"text-sm text-red-600 text-center",children:"Please agree to both the Terms and Conditions and Privacy Policy to continue"})]})]})})()]})};var Sa,Ea,Ca;!function(e){e.INITIAL="initial",e.PENDING="pending",e.REJECTED="rejected",e.RESOLVED="resolved"}(Sa||(Sa={})),function(e){e.LOADING_STATUS="setLoadingStatus",e.RESET_OPTIONS="resetOptions",e.SET_BRAINTREE_INSTANCE="braintreeInstance"}(Ea||(Ea={})),function(e){e.NUMBER="number",e.CVV="cvv",e.EXPIRATION_DATE="expirationDate",e.EXPIRATION_MONTH="expirationMonth",e.EXPIRATION_YEAR="expirationYear",e.POSTAL_CODE="postalCode"}(Ca||(Ca={}));var Ta=function(){return Ta=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var s in t=arguments[n])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e},Ta.apply(this,arguments)};function Pa(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var s=0;for(r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]])}return n}function _a(e,t,n){if(n||2===arguments.length)for(var r,s=0,a=t.length;s<a;s++)!r&&s in t||(r||(r=Array.prototype.slice.call(t,0,s)),r[s]=t[s]);return e.concat(r||Array.prototype.slice.call(t))}"function"===typeof SuppressedError&&SuppressedError;var Ia="data-react-paypal-script-id",Da="dataJsSdkLibrary",Ra="react-paypal-js",La="dataNamespace",Ma="dataSdkIntegrationSource",Oa="Failed to load the PayPal JS SDK script.",Fa="3.117.0",Ua=("https://js.braintreegateway.com/web/".concat(Fa,"/js/client.min.js"),"https://js.braintreegateway.com/web/".concat(Fa,"/js/paypal-checkout.min.js"),"paypal");function Ba(e){return void 0===e&&(e=Ua),window[e]}function za(e){var t=e.reactComponentName,n=e.sdkComponentKey,r=e.sdkRequestedComponents,s=void 0===r?"":r,a=e.sdkDataNamespace,i=void 0===a?Ua:a,o=n.charAt(0).toUpperCase().concat(n.substring(1)),l="Unable to render <".concat(t," /> because window.").concat(i,".").concat(o," is undefined."),c="string"===typeof s?s:s.join(",");
2if(!c.includes(n)){var d=[c,n].filter(Boolean).join();l+="\nTo fix the issue, add '".concat(n,"' to the list of components passed to the parent PayPalScriptProvider:")+"\n`<PayPalScriptProvider options={{ components: '".concat(d,"'}}>`.")}return l}function Va(e){var t=e,n=Ia;t[n];var r=Pa(t,[n+""]);return"react-paypal-js-".concat(function(e){for(var t="",n=0;n<e.length;n++){var r=e[n].charCodeAt(0)*n;e[n+1]&&(r+=e[n+1].charCodeAt(0)*(n-1)),t+=String.fromCharCode(97+Math.abs(r)%26)}return t}(JSON.stringify(r)))}function qa(e,t){var n,r;switch(t.type){case Ea.LOADING_STATUS:return"object"===typeof t.value?Ta(Ta({},e),{loadingStatus:t.value.state,loadingStatusErrorMessage:t.value.message}):Ta(Ta({},e),{loadingStatus:t.value});case Ea.RESET_OPTIONS:return function(e){var t=self.document.querySelector("script[".concat(Ia,'="').concat(e,'"]'));(null===t||void 0===t?void 0:t.parentNode)&&t.parentNode.removeChild(t)}(e.options[Ia]),Ta(Ta({},e),{loadingStatus:Sa.PENDING,options:Ta(Ta((n={},n[Ma]=Ra,n),t.value),(r={},r[Ia]="".concat(Va(t.value)),r))});case Ea.SET_BRAINTREE_INSTANCE:return Ta(Ta({},e),{braintreePayPalCheckoutInstance:t.value});default:return e}}var Wa=(0,e.createContext)(null);function Ha(e){if("function"===typeof(null===e||void 0===e?void 0:e.dispatch)&&0!==e.dispatch.length)return e;throw new Error("usePayPalScriptReducer must be used within a PayPalScriptProvider")}function Ga(){var t=Ha((0,e.useContext)(Wa));return[Ta(Ta({},t),{isInitial:t.loadingStatus===Sa.INITIAL,isPending:t.loadingStatus===Sa.PENDING,isResolved:t.loadingStatus===Sa.RESOLVED,isRejected:t.loadingStatus===Sa.REJECTED}),t.dispatch]}(0,e.createContext)({});var Ya=function(t){var n,r=t.className,s=void 0===r?"":r,a=t.disabled,i=void 0!==a&&a,o=t.children,l=t.forceReRender,c=void 0===l?[]:l,d=Pa(t,["className","disabled","children","forceReRender"]),u=i?{opacity:.38}:{},m="".concat(s," ").concat(i?"paypal-buttons-disabled":"").trim(),h=(0,e.useRef)(null),p=(0,e.useRef)(null),g=function(t){var n=(0,e.useRef)(new Proxy({},{get:function(e,t,n){return"function"===typeof e[t]?function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return e[t].apply(e,n)}:Reflect.get(e,t,n)}}));return n.current=Object.assign(n.current,t),n.current}(d),f=Ga()[0],x=f.isResolved,b=f.options,y=(0,e.useState)(null),v=y[0],w=y[1],j=(0,e.useState)(!0),N=j[0],k=j[1],A=(0,e.useState)(null)[1];function S(){null!==p.current&&p.current.close().catch(function(){})}return(null===(n=p.current)||void 0===n?void 0:n.updateProps)&&p.current.updateProps({message:d.message}),(0,e.useEffect)(function(){if(!1===x)return S;var e=Ba(b.dataNamespace);if(void 0===e||void 0===e.Buttons)return A(function(){throw new Error(za({reactComponentName:Ya.displayName,sdkComponentKey:"buttons",sdkRequestedComponents:b.components,sdkDataNamespace:b[La]}))}),S;try{p.current=e.Buttons(Ta(Ta({},g),{onInit:function(e,t){w(t),"function"===typeof d.onInit&&d.onInit(e,t)}}))}catch(t){return A(function(){throw new Error("Failed to render <PayPalButtons /> component. Failed to initialize: ".concat(t))})}return!1===p.current.isEligible()?(k(!1),S):h.current?(p.current.render(h.current).catch(function(e){null!==h.current&&0!==h.current.children.length&&A(function(){throw new Error("Failed to render <PayPalButtons /> component. ".concat(e))})}),S):S},_a(_a([x],c,!0),[d.fundingSource],!1)),(0,e.useEffect)(function(){null!==v&&(!0===i?v.disable().catch(function(){}):v.enable().catch(function(){}))},[i,v]),e.createElement(e.Fragment,null,N?e.createElement("div",{ref:h,style:u,className:m}):o)};function Ka(e){var t=e.sdkBaseUrl,n=e.environment,r=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var s=0;for(r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]])}return n}(e,["sdkBaseUrl","environment"]),s=t||function(e){return"sandbox"===e?"https://www.sandbox.paypal.com/sdk/js":"https://www.paypal.com/sdk/js"}(n),a=r,i=Object.keys(a).filter(function(e){return"undefined"!==typeof a[e]&&null!==a[e]&&""!==a[e]}).reduce(function(e,t){var n=a[t].toString();return"data"===(t=function(e){var t=function(e,t){return(t?"-":"")+e.toLowerCase()};return e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,t)}(t)).substring(0,4)||"crossorigin"===t?e.attributes[t]=n:e.queryParams[t]=n,e},{queryParams:{},attributes:{}}),o=i.queryParams,l=i.attributes;return o["merchant-id"]&&-1!==o["merchant-id"].indexOf(",")&&(l["data-merchant-id"]=o["merchant-id"],o["merchant-id"]="*"),{url:"".concat(s,"?").concat(Ja(o)),attributes:l}}function Ja(e){var t="";return Object.keys(e).forEach(function(n){0!==t.length&&(t+="&"),t+=n+"="+e[n]}),t}function $a(e,t){void 0===t&&(t={});var n=document.createElement("script");return n.src=e,Object.keys(t).forEach(function(e){n.setAttribute(e,t[e]),"data-csp-nonce"===e&&n.setAttribute("nonce",t["data-csp-nonce"])}),n}function Qa(e,t){if(void 0===t&&(t=Promise),ei(e,t),"undefined"===typeof document)return t.resolve(null);var n=Ka(e),r=n.url,s=n.attributes,a=s["data-namespace"]||"paypal",i=Za(a);return s["data-js-sdk-library"]||(s["data-js-sdk-library"]="paypal-js"),function(e,t){var n=document.querySelector('script[src="'.concat(e,'"]'));if(null===n)return null;var r=$a(e,t),s=n.cloneNode();if(delete s.dataset.uidAuto,Object.keys(s.dataset).length!==Object.keys(r.dataset).length)return null;var a=!0;return Object.keys(s.dataset).forEach(function(e){s.dataset[e]!==r.dataset[e]&&(a=!1)}),a?n:null}(r,s)&&i?t.resolve(i):Xa({url:r,attributes:s},t).then(function(){var e=Za(a);if(e)return e;throw new Error("The window.".concat(a," global variable is not available."))})}function Xa(e,t){void 0===t&&(t=Promise),ei(e,t);var n=e.url,r=e.attributes;if("string"!==typeof n||0===n.length)throw new Error("Invalid url.");if("undefined"!==typeof r&&"object"!==typeof r)throw new Error("Expected attributes to be an object.");return new t(function(e,t){if("undefined"===typeof document)return e();!function(e){var t=e.url,n=e.attributes,r=e.onSuccess,s=e.onError,a=$a(t,n);a.onerror=s,a.onload=r,document.head.insertBefore(a,document.head.firstElementChild)}({url:n,attributes:r,onSuccess:function(){return e()},onError:function(){var e=new Error('The script "'.concat(n,'" failed to load. Check the HTTP status code and response body in DevTools to learn more.'));return t(e)}})})}function Za(e){return window[e]}function ei(e,t){if("object"!==typeof e||null===e)throw new Error("Expected an options object.");var n=e.environment;if(n&&"production"!==n&&"sandbox"!==n)throw new Error('The `environment` option must be either "production" or "sandbox".');if("undefined"!==typeof t&&"function"!==typeof t)throw new Error("Expected PromisePonyfill to be a function.")}Ya.displayName="PayPalButtons","function"===typeof SuppressedError&&SuppressedError;var ti=function(t){var n=t.className,r=void 0===n?"":n,s=t.children,a=Pa(t,["className","children"]),i=Ga()[0],o=i.isResolved,l=i.options,c=(0,e.useRef)(null),d=(0,e.useState)(!0),u=d[0],m=d[1],h=(0,e.useState)(null)[1];return(0,e.useEffect)(function(){if(!1!==o){var e=Ba(l[La]);if(void 0===e||void 0===e.Marks)return h(function(){throw new Error(za({reactComponentName:ti.displayName,sdkComponentKey:"marks",sdkRequestedComponents:l.components,sdkDataNamespace:l[La]}))});!function(e){var t=c.current;if(!t||!e.isEligible())return m(!1);t.firstChild&&t.removeChild(t.firstChild),e.render(t).catch(function(e){null!==t&&0!==t.children.length&&h(function(){throw new Error("Failed to render <PayPalMarks /> component. ".concat(e))})})}(e.Marks(Ta({},a)))}},[o,a.fundingSource]),e.createElement(e.Fragment,null,u?e.createElement("div",{ref:c,className:r}):s)};ti.displayName="PayPalMarks";var ni=function(t){var n=t.className,r=void 0===n?"":n,s=t.forceReRender,a=void 0===s?[]:s,i=Pa(t,["className","forceReRender"]),o=Ga()[0],l=o.isResolved,c=o.options,d=(0,e.useRef)(null),u=(0,e.useRef)(null),m=(0,e.useState)(null)[1];return(0,e.useEffect)(function(){if(!1!==l){var e=Ba(c[La]);if(void 0===e||void 0===e.Messages)return m(function(){throw new Error(za({reactComponentName:ni.displayName,sdkComponentKey:"messages",sdkRequestedComponents:c.components,sdkDataNamespace:c[La]}))});u.current=e.Messages(Ta({},i)),u.current.render(d.current).catch(function(e){null!==d.current&&0!==d.current.children.length&&m(function(){throw new Error("Failed to render <PayPalMessages /> component. ".concat(e))})})}},_a([l],a,!0)),e.createElement("div",{ref:d,className:r})};ni.displayName="PayPalMessages";var ri=function(t){var n,r=t.options,s=void 0===r?{clientId:"test"}:r,a=t.children,i=t.deferLoading,o=void 0!==i&&i,l=(0,e.useReducer)(qa,{options:Ta(Ta({},s),(n={},n[Da]=Ra,n[Ma]=Ra,n[Ia]="".concat(Va(s)),n)),loadingStatus:o?Sa.INITIAL:Sa.PENDING}),c=l[0],d=l[1];return(0,e.useEffect)(function(){if(!1===o&&c.loadingStatus===Sa.INITIAL)return d({type:Ea.LOADING_STATUS,value:Sa.PEND
2ING});if(c.loadingStatus===Sa.PENDING){var e=!0;return Qa(c.options).then(function(){e&&d({type:Ea.LOADING_STATUS,value:Sa.RESOLVED})}).catch(function(t){console.error("".concat(Oa," ").concat(t)),e&&d({type:Ea.LOADING_STATUS,value:{state:Sa.REJECTED,message:String(t)}})}),function(){e=!1}}},[c.options,o,c.loadingStatus]),e.createElement(Wa.Provider,{value:Ta(Ta({},c),{dispatch:d})},a)};function si(){}(0,e.createContext)({cardFieldsForm:null,fields:{},registerField:si,unregisterField:si});const ai=(0,na.loadStripe)("pk_live_51Kr8J3Ec8kNP7Yp7Tu6erT0Ti9b2qUuacRAPc8kfvjV7nxACrPfmoeGuU8wkIJIOptmFCoCkqW2rAPbAc35Zu2Kg00T0uBJJAv"),ii=t=>{let{selectedTier:n,discountCode:r,onSuccess:s,onError:a}=t;const{currentUser:i}=sn(),[o,l]=(0,e.useState)("stripe"),[c,d]=(0,e.useState)(!1),[u,m]=(0,e.useState)(""),h=Bt&&Object.keys(Bt).length>0?Bt:{TIER1:{id:"tier1",name:"Tier 1",price:75,priceId:"price_tier1_annual"},TIER2:{id:"tier2",name:"Tier 2",price:125,priceId:"price_tier2_annual"},TIER3:{id:"tier3",name:"Tier 3",price:175,priceId:"price_tier3_annual"},TIER4:{id:"tier4",name:"Tier 4",price:225,priceId:"price_tier4_annual"},TIERUSV:{id:"tierUSV",name:"Tier USV",price:75,priceId:"price_tierUSV_annual"}},p=h[n];if(console.log("DualPaymentForm - selectedTier:",n),console.log("DualPaymentForm - MEMBERSHIP_TIERS:",Bt),console.log("DualPaymentForm - tiersToUse:",h),console.log("DualPaymentForm - tier:",p),!p)return(0,nn.jsxs)("div",{className:"text-red-600",children:["Invalid membership tier selected: ",n,". Available tiers: ",Object.keys(h).join(", ")]});const g=r?aa(p.price,r):{finalPrice:p.price,discountAmount:0},{finalPrice:f,discountAmount:x}=g;return(0,nn.jsxs)("div",{className:"max-w-md mx-auto bg-white rounded-lg shadow-lg p-6",children:[(0,nn.jsxs)("div",{className:"mb-6",children:[(0,nn.jsx)("h3",{className:"text-lg font-semibold mb-4",children:"Order Summary"}),(0,nn.jsxs)("div",{className:"bg-gray-50 p-4 rounded-lg",children:[(0,nn.jsxs)("div",{className:"flex justify-between items-center mb-2",children:[(0,nn.jsxs)("span",{children:[p.name," Membership"]}),(0,nn.jsxs)("span",{children:["$",p.price]})]}),x>0&&(0,nn.jsxs)("div",{className:"flex justify-between items-center mb-2 text-green-600",children:[(0,nn.jsxs)("span",{children:["Discount (",r,")"]}),(0,nn.jsxs)("span",{children:["-$",x.toFixed(2)]})]}),(0,nn.jsx)("hr",{className:"my-2"}),(0,nn.jsxs)("div",{className:"flex justify-between items-center font-semibold",children:[(0,nn.jsx)("span",{children:"Total"}),(0,nn.jsxs)("span",{children:["$",f.toFixed(2)]})]})]})]}),(0,nn.jsxs)("div",{className:"mb-6",children:[(0,nn.jsx)("h3",{className:"text-lg font-semibold mb-4",children:"Choose Payment Method"}),(0,nn.jsxs)("div",{className:"space-y-3",children:[(0,nn.jsxs)("label",{className:"flex items-center p-3 border rounded-lg cursor-pointer hover:bg-gray-50",children:[(0,nn.jsx)("input",{type:"radio",name:"paymentMethod",value:"stripe",checked:"stripe"===o,onChange:e=>l(e.target.value),className:"mr-3"}),(0,nn.jsxs)("div",{className:"flex items-center",children:[(0,nn.jsx)("span",{className:"font-medium",children:"Credit/Debit Card"}),(0,nn.jsxs)("div",{className:"ml-2 flex space-x-1",children:[(0,nn.jsx)("img",{src:"/images/payment/visa.png",alt:"Visa",className:"h-6",onError:e=>e.target.style.display="none"}),(0,nn.jsx)("img",{src:"/images/payment/mastercard.png",alt:"Mastercard",className:"h-6",onError:e=>e.target.style.display="none"}),(0,nn.jsx)("img",{src:"/images/payment/amex.png",alt:"American Express",className:"h-6",onError:e=>e.target.style.display="none"})]})]})]}),(0,nn.jsxs)("label",{className:"flex items-center p-3 border rounded-lg cursor-pointer hover:bg-gray-50",children:[(0,nn.jsx)("input",{type:"radio",name:"paymentMethod",value:"paypal",checked:"paypal"===o,onChange:e=>l(e.target.value),className:"mr-3"}),(0,nn.jsxs)("div",{className:"flex items-center",children:[(0,nn.jsx)("span",{className:"font-medium",children:"PayPal"}),(0,nn.jsx)("img",{src:"/images/payment/paypal.png",alt:"PayPal",className:"ml-2 h-6",onError:e=>e.target.style.display="none"})]})]})]})]}),u&&(0,nn.jsx)("div",{className:"mb-4 p-3 bg-red-50 border border-red-200 rounded-lg text-red-700",children:u}),(0,nn.jsxs)("div",{className:"space-y-4",children:["stripe"===o&&(0,nn.jsx)("button",{onClick:async()=>
2{if(i)if(c)console.log("Payment already in progress, ignoring duplicate request");else{d(!0),m("");try{console.log("Starting Stripe payment for:",{userId:i.uid,selectedTier:n,discountCode:r});const e=await ai;if(!e)throw new Error("Stripe failed to load");const t=await sa(i.uid,n,r);if(console.log("Checkout session created:",t),!t||!t.id)throw new Error("Invalid session data received");d(!1),console.log("About to redirect to Stripe checkout with session:",t.id),console.log("Success URL should be:","".concat(window.location.origin,"/membership/success"));const{error:s}=await e.redirectToCheckout({sessionId:t.id});s&&(console.error("Stripe redirect error:",s),m(s.message),null===a||void 0===a||a(s),d(!1))}catch(e){console.error("Stripe payment error:",e),m("Failed to process payment: ".concat(e.message)),null===a||void 0===a||a(e),d(!1)}}else m("Please log in to continue with payment.")},disabled:c,className:"w-full bg-apn-blue text-white py-3 px-4 rounded-lg font-semibold hover:bg-blue-700 disabled:opacity-50 disabled:cursor-not-allowed",children:c?"Processing...":"Pay $".concat(f.toFixed(2)," with Card")}),"paypal"===o&&ra.clientId&&(0,nn.jsx)(ri,{options:{"client-id":ra.clientId,currency:ra.currency,intent:ra.intent},children:(0,nn.jsx)(Ya,{style:{layout:"vertical",color:"blue",shape:"rect",label:"pay"},createOrder:async()=>{if(i)if(c)console.log("Order creation already in progress, ignoring duplicate request");else try{console.log("Creating PayPal order for:",{userId:i.uid,selectedTier:n,discountCode:r});const e=await ia(i.uid,n,r);return console.log("PayPal order ID created:",e),e}catch(u){throw console.error("Error creating PayPal order:",u),m("Failed to create PayPal order: ".concat(u.message)),u}else m("Please log in to continue with payment.")},onApprove:async(e,t)=>{if(c)console.log("Payment approval already in progress, ignoring duplicate request");else try{d(!0),m("");const e=await t.order.capture(),r=await oa(e,i.uid,n);if(!r.success)throw new Error("Payment processing failed");null===s||void 0===s||s(r.membershipData)}catch(u){console.error("PayPal approval error:",u);const t=la(u);m(t.error),null===a||void 0===a||a(u)}finally{d(!1)}},onError:e=>{console.error("PayPal error:",e);const t=la(e);m(t.error),null===a||void 0===a||a(e)},disabled:c})}),"paypal"===o&&!ra.clientId&&(0,nn.jsx)("div",{className:"text-center text-gray-500 py-4",children:"PayPal is not configured. Please contact support."})]}),(0,nn.jsx)("div",{className:"mt-6 text-center text-sm text-gray-500",children:(0,nn.jsx)("p",{children:"\ud83d\udd12 Your payment information is secure and encrypted"})})]})},oi=()=>{const t=oe(),n=se(),{currentUser:r}=sn(),[s,a]=(0,e.useState)(!1);console.log("MembershipPayment component rendering...");const{tier:i,discount:o,userData:l}=n.state||{};console.log("MembershipPayment - location.state:",n.state),console.log("MembershipPayment - tier:",i),console.log("MembershipPayment - discount:",o),console.log("MembershipPayment - userData:",l),console.log("MembershipPayment - currentUser:",r),(0,e.useEffect)(()=>{const e=setTimeout(()=>i&&l?r?void 0:(console.error("User not authenticated, redirecting to login"),void t("/login")):(console.error("No tier or user data found after delay, redirecting to registration"),void t("/register")),1e3);return()=>clearTimeout(e)},[i,l,r,t]);if(!i||!l)return(0,nn.jsx)("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center",children:(0,nn.jsxs)("div",{className:"text-center",children:[(0,nn.jsx)("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-apn-blue mx-auto mb-4"}),(0,nn.jsx)("p",{className:"text-gray-600",children:"Loading payment information..."})]})});const c=i.price,d=o?o.discountedPrice:c,u=c-d;return(0,nn.jsx)("div",{className:"min-h-screen bg-gray-50 py-12",children:(0,nn.jsxs)("div",{className:"max-w-4xl mx-auto px-4 sm:px-6 lg:px-8",children:[(0,nn.jsxs)("div",{className:"text-center mb-8",children:[(0,nn.jsx)("h1",{className:"text-3xl font-bold text-gray-900 mb-4",children:"Complete Your Membership"}),(0,nn.jsx)("p",{className:"text-lg text-gray-600",children:"You're just one step away from joining the APN community!"})]}),(0,nn.jsxs)("div",{className:"bg-white rounded-lg shadow-lg p-6 mb-8",children:[(0,nn.jsx)("h2",{className:"text-xl font-semibold text-gray-900 mb-4",children:"Order Summary"}),(0,nn.jsxs)("div",{className:"space-y-3",children:[(0,nn.jsxs)("div",{className:"flex justify-between",children:[(0,nn.jsx)("span",{className:"text-gray-600",children:"Membership Tier:"}),(0,nn.jsx)("span",{className:"font-semibold",children:i.name})]}),(0,nn.jsxs)("div",{className:"flex justify-between",children:[(0,nn.jsx)("span",{className:"text-gray-600",children:"Original Price:"}),(0,nn.jsxs)("span",{className:o?"line-through text-gray-400":"font-semibold",children:["$",c]})]}),o&&(0,nn.jsxs)(nn.Fragment,{children:[(0,nn.jsxs)("div",{className:"flex justify-between text-green-600",children:[(0,nn.jsxs)("span",{children:["Discount (",o.code,"):"]}),(0,nn.jsxs)("span",{children:["-$",u]})]}),(0,nn.jsxs)("div",{className:"flex justify-between text-lg font-bold text-green-600",children:[(0,nn.jsx)("span",{children:"Final Price:"}),(0,nn.jsxs)("span",{children:["$",d]})]})]}),!o&&(0,nn.jsxs)("div",{className:"flex justify-between text-lg font-bold",children:[(0,nn.jsx)("span",{children:"Total:"}),(0,nn.jsxs)("span",{children:["$",d]})]})]}),(0,nn.jsxs)("div",{className:"mt-6 pt-6 border-t border-gray-200",children:[(0,nn.jsx)("h3",{className:"text-lg font-semibold text-gray-900 mb-3",children:"Member Information"}),(0,nn.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 text-sm",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("span",{className:"text-gray-600",children:"Name:"}),(0,nn.jsxs)("span",{className:"ml-2 font-medium",children:[l.firstName," ",l.lastName]})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("span",{className:"text-gray-600",children:"Email:"}),(0,nn.jsx)("span",{className:"ml-2 font-medium",children:l.email})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("span",{className:"text-gray-600",children:"Company:"}),(0,nn.jsx)("span",{className:"ml-2 font-medium",children:l.company||"Not specified"})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("span",{className:"text-gray-600",children:"Job Title:"}),(0,nn.jsx)("span",{className:"ml-2 font-medium",children:l.jobTitle||"Not specified"})]})]})]})]}),(0,nn.jsxs)("div",{className:"bg-white rounded-lg shadow-lg p-6",children:[(0,nn.jsx)("h2",{className:"text-xl font-semibold text-gray-900 mb-6",children:"Payment Information"}),(0,nn.jsx)(ii,{selectedTier:i.key,discountCode:(null===o||void 0===o?void 0:o.code)||"",onSuccess:e=>{console.log("Payment successful:",e),setTimeout(()=>{t("/membership/success",{replace:!0})},1e3)},onError:e=>{console.error("Payment error:",e)}})]}),(0,nn.jsx)("div",{className:"text-center mt-8",children:(0,nn.jsx)("button",{onClick:()=>{t("/register")},className:"text-gray-600 hover:text-gray-800 underline",children:"\u2190 Back to Registration"})})]})})},li=()=>{const{userProfile:t,fetchUserData:n,currentUser:r}=sn(),[s]=pt(),[a,i]=(0,e.useState)(!1),[o,l]=(0,e.useState)(null);return(0,e.useEffect)(()=>{r&&(async()=>{const e=s.get("paypal"),t=s.get("tier"),c=s.get("paymentId");if(s.get("PayerID"),!a&&!o&&"true"===e&&t&&r&&c){i(!0),l(null);try{const e={id:c,purchase_units:[{amount:{value:"TIER1"===t?"75.00":"TIER2"===t?"150.00":"225.00",currency_code:"USD"}}]};await oa(e,r.uid,t),await n(r.uid);const s=window.location.pathname;window.history.replaceState({},"",s)}catch(d){console.error("PayPal processing error:",d),l(d.message)}finally{i(!1)}}})()},[r,n,s,a,o]),(0,e.useEffect)(()=>{console.log("MembershipSuccess page loaded"),console.log("Current user:",null===r||void 0===r?void 0:r.uid),console.log("Search params:",Object.fromEntries(s.entries())),console.log("Current URL:",window.location.href),r&&!s.get("paypal")&&(console.log("Fetching user data for Stripe payment success"),n(r.uid))},[r,n,s]),(0,e.useEffect)(()=>{"/membership/success"!==window.location.pathname&&(console.log("Not on success page, redirecting..."),window.location.href="/membership/success")},[]),a?(0,nn.jsx)("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center py-12 px-4 sm:px-6 lg:px-8",children:(0,nn.jsx)("div",{className:"max-w-md w-full space-y-8",children:(0,nn.jsxs)("div",{className:"text-center",children:[(0,nn.jsx)("div",{className:"mx-auto flex items-center justify-center h-24 w-24 rounded-full bg-blue-100 mb-6",children:(0,nn.jsxs)("svg",{className:"animate-spin h-12 w-12 text-blue-600",fill:"none",viewBox:"0 0 24 24",children:[(0,nn.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,nn.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}),(0,nn.jsx)("h2",{className:"text-2xl font-bold text-gray-900 mb-4",children:"Processing Your PayPal Payment..."}),(0,nn.jsx)("p",{className:"text-gray-600",children:"Please wait while we confirm your payment and activate your membership."})]})})}):o?(0,nn.jsx)("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center py-12 px-4 sm:px-6 lg:px-8",children:(0,nn.jsx)("div",{className:"max-w-md w-full space-y-8",children:(0,nn.jsxs)("div",{className:"text-center",children:[(0,nn.jsx)("div",{className:"mx-auto flex items-center justify-center h-24 w-24 rounded-full bg-red-100 mb-6",children:(0,nn.jsx)("svg",{className:"h-12 w-12 text-red-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L4.082 16.5c-.77.833.192 2.5 1.732 2.5z"})})}),(0,nn.jsx)("h2",{className:"text-2xl font-bold text-gray-900 mb-4",children:"Payment Processing Error"}),(0,nn.jsx)("p",{className:"text-gray-600 mb-6",children:o}),(0,nn.jsx)(dt,{to:"/register",className:"bg-apn-blue text-white py-3 px-4 roun
2ded-lg font-semibold hover:bg-blue-700 transition duration-200",children:"Try Again"})]})})}):(0,nn.jsx)("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center py-12 px-4 sm:px-6 lg:px-8",children:(0,nn.jsx)("div",{className:"max-w-md w-full space-y-8",children:(0,nn.jsxs)("div",{className:"text-center",children:[(0,nn.jsx)("div",{className:"mx-auto flex items-center justify-center h-24 w-24 rounded-full bg-green-100 mb-6",children:(0,nn.jsx)("svg",{className:"h-12 w-12 text-green-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M5 13l4 4L19 7"})})}),(0,nn.jsx)("h2",{className:"text-3xl font-bold text-gray-900 mb-4",children:"Welcome to APN!"}),(0,nn.jsxs)("p",{className:"text-lg text-gray-600 mb-6",children:["Your membership has been successfully activated. You now have access to all APN features and benefits.","true"===s.get("paypal")&&(0,nn.jsx)("span",{className:"block text-sm text-green-600 mt-2",children:"\u2713 PayPal payment completed successfully"})]}),t&&(0,nn.jsxs)("div",{className:"bg-white rounded-lg shadow-lg p-6 mb-6",children:[(0,nn.jsx)("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Membership Details"}),(0,nn.jsxs)("div",{className:"space-y-2 text-left",children:[(0,nn.jsxs)("div",{className:"flex justify-between",children:[(0,nn.jsx)("span",{className:"text-gray-600",children:"Member:"}),(0,nn.jsxs)("span",{className:"font-medium",children:[t.firstName," ",t.lastName]})]}),(0,nn.jsxs)("div",{className:"flex justify-between",children:[(0,nn.jsx)("span",{className:"text-gray-600",children:"Email:"}),(0,nn.jsx)("span",{className:"font-medium",children:t.email})]}),(0,nn.jsxs)("div",{className:"flex justify-between",children:[(0,nn.jsx)("span",{className:"text-gray-600",children:"Status:"}),(0,nn.jsx)("span",{className:"font-medium text-green-600",children:"Active"})]}),(0,nn.jsxs)("div",{className:"flex justify-between",children:[(0,nn.jsx)("span",{className:"text-gray-600",children:"Member Since:"}),(0,nn.jsx)("span",{className:"font-medium",children:t.memberSince?new Date(1e3*t.memberSince.seconds).toLocaleDateString():(new Date).toLocaleDateString()})]})]})]}),(0,nn.jsxs)("div",{className:"bg-apn-blue text-white rounded-lg p-6 mb-6",children:[(0,nn.jsx)("h3",{className:"text-lg font-semibold mb-4",children:"What's Next?"}),(0,nn.jsxs)("ul",{className:"text-left space-y-2",children:[(0,nn.jsxs)("li",{className:"flex items-center",children:[(0,nn.jsx)("svg",{className:"h-4 w-4 mr-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M5 13l4 4L19 7"})}),"Complete your profile"]}),(0,nn.jsxs)("li",{className:"flex items-center",children:[(0,nn.jsx)("svg",{className:"h-4 w-4 mr-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M5 13l4 4L19 7"})}),"Join professional groups"]}),(0,nn.jsxs)("li",{className:"flex items-center",children:[(0,nn.jsx)("svg",{className:"h-4 w-4 mr-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M5 13l4 4L19 7"})}),"Browse job opportunities"]}),(0,nn.jsxs)("li",{className:"flex items-center",children:[(0,nn.jsx)("svg",{className:"h-4 w-4 mr-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M5 13l4 4L19 7"})}),"Register for upcoming events"]})]})]}),(0,nn.jsxs)("div",{className:"space-y-4",children:[(0,nn.jsx)(dt,{to:"/profile/complete",className:"w-full bg-apn-blue text-white py-3 px-4 rounded-lg font-semibold hover:bg-blue-700 transition duration-200 block text-center",children:"Complete Your Profile"}),(0,nn.jsx)(dt,{to:"/events",className:"w-full bg-white text-apn-blue border border-apn-blue py-3 px-4 rounded-lg font-semibold hover:bg-gray-50 transition duration-200 block text-center",children:"Browse Events"}),(0,nn.jsx)(dt,{to:"/groups",className:"w-full bg-gray-100 text-gray-700 py-3 px-4 roun
2ded-lg font-semibold hover:bg-gray-200 transition duration-200 block text-center",children:"Join Groups"})]}),(0,nn.jsx)("div",{className:"mt-8 text-center",children:(0,nn.jsxs)("p",{className:"text-sm text-gray-500",children:["Need help getting started?",(0,nn.jsx)(dt,{to:"/about/contact",className:"text-apn-blue hover:text-blue-700 ml-1",children:"Contact our support team"})]})})]})})})},ci=()=>(0,nn.jsx)("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center py-12 px-4 sm:px-6 lg:px-8",children:(0,nn.jsx)("div",{className:"max-w-md w-full space-y-8",children:(0,nn.jsxs)("div",{className:"text-center",children:[(0,nn.jsx)("div",{className:"mx-auto flex items-center justify-center h-24 w-24 rounded-full bg-yellow-100 mb-6",children:(0,nn.jsx)("svg",{className:"h-12 w-12 text-yellow-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L4.082 16.5c-.77.833.192 2.5 1.732 2.5z"})})}),(0,nn.jsx)("h2",{className:"text-3xl font-bold text-gray-900 mb-4",children:"Payment Cancelled"}),(0,nn.jsx)("p",{className:"text-lg text-gray-600 mb-6",children:"Your payment was cancelled and no charges were made to your account."}),(0,nn.jsxs)("div",{className:"bg-white rounded-lg shadow-lg p-6 mb-6",children:[(0,nn.jsx)("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:"What happened?"}),(0,nn.jsx)("p",{className:"text-gray-600 text-left",children:"You cancelled the payment process before it was completed. This is completely normal and happens when:"}),(0,nn.jsxs)("ul",{className:"text-left text-gray-600 mt-4 space-y-2",children:[(0,nn.jsx)("li",{children:"\u2022 You decided to review membership options again"}),(0,nn.jsx)("li",{children:"\u2022 You encountered a technical issue"}),(0,nn.jsx)("li",{children:"\u2022 You want to use a different payment method"}),(0,nn.jsx)("li",{children:"\u2022 You need to apply a discount code"})]})]}),(0,nn.jsxs)("div",{className:"bg-apn-blue text-white rounded-lg p-6 mb-6",children:[(0,nn.jsx)("h3",{className:"text-lg font-semibold mb-4",children:"Ready to try again?"}),(0,nn.jsx)("p",{className:"text-left mb-4",children:"Your membership is still waiting for you! You can complete your registration at any time."}),(0,nn.jsxs)("ul",{className:"text-left space-y-2",children:[(0,nn.jsxs)("li",{className:"flex items-center",children:[(0,nn.jsx)("svg",{className:"h-4 w-4 mr-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M5 13l4 4L19 7"})}),"All membership tiers are still available"]}),(0,nn.jsxs)("li",{className:"flex items-center",children:[(0,nn.jsx)("svg",{className:"h-4 w-4 mr-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M5 13l4 4L19 7"})}),"Discount codes can still be applied"]}),(0,nn.jsxs)("li",{className:"flex items-center",children:[(0,nn.jsx)("svg",{className:"h-4 w-4 mr-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M5 13l4 4L19 7"})}),"Multiple payment methods accepted"]})]})]}),(0,nn.jsxs)("div",{className:"space-y-4",children:[(0,nn.jsx)(dt,{to:"/register",className:"w-full bg-apn-blue text-white py-3 px-4 rounded-lg font-semibold hover:bg-blue-700 transition duration-200 block text-center",children:"Try Again"}),(0,nn.jsx)(dt,{to:"/about/membership",className:"w-full bg-white text-apn-blue border border-apn-blue py-3 px-4 rounded-lg font-semibold hover:bg-gray-50 transition duration-200 block text-center",children:"Learn More About Membership"}),(0,nn.jsx)(dt,{to:"/",className:"w-full bg-gray-100 text-gray-700 py-3 px-4 rounded-lg font-semibold hover:bg-gray-200 transition duration-200 block text-center",children:"Return to Home"})]}),(0,nn.jsx)("div",{className:"mt-8 text-center",children:(0,nn.jsxs)("p",{className:"text-sm text-gray-500",children:["Having trouble with payment?",(0,nn.jsx)(dt,{to:"/about/contact",className:"text-apn-blue hover:text-blue-700 ml-1",children:"Contact our support team"})]})}),(0,nn.jsxs)("div",{className:"mt-6 p-4 bg-gray-100 rounded-lg",children:[(0,nn.jsx)("h4",{className:"font-semibold text-gray-900 mb-2",children:"Alternative Options"}),(0,nn.jsx)("p",{className:"text-sm text-gray-600",children:"If you're experiencing payment issues, you can also contact us directly to arrange alternative payment methods or get assistance with your membership registration."})]})]})})});function di(){const{userProfile:e}=sn(),t=null===e||void 0===e?void 0:e.membershipStatus,n="payment_failed"===t?"Your most recent membership payment didn\u2019t go through, so your member access is paused.":"cancelled"===t?"Your membership has been cancelled, so your member access is paused.":"Your membership is no longer active, so your member access is paused.";return(0,nn.jsxs)("div",{className:"max-w-2xl mx-auto px-4 py-16 text-center",children:[(0,nn.jsx)("img",{src:"".concat("","/apn-logos/APN-blue (1).png"),alt:"APN",className:"h-16 mx-auto mb-6 object-contain"}),(0,nn.jsx)("h1",{className:"text-3xl font-bold text-gray-900 mb-4",children:"Renew Your APN Membership"}),(0,nn.jsx)("p",{className:"text-gray-600 mb-2",children:n}),(0,nn.jsx)("p",{className:"text-gray-600 mb-8",children:"Renew now to restore access to the member directory, groups, and the job & project boards."}),(0,nn.jsxs)("div",{className:"flex flex-col sm:flex-row gap-4 justify-center",children:[(0,nn.jsx)(dt,{to:"/register",className:"bg-apn-blue text-white py-3 px-8 rounded-lg font-semibold hover:bg-blue-700 transition duration-200",children:"Renew Membership"}
2),(0,nn.jsx)("a",{href:"mailto:[email protected]?subject=APN%20Membership%20Renewal",className:"border border-gray-300 text-gray-700 py-3 px-8 rounded-lg font-semibold hover:bg-gray-50 transition duration-200",children:"Contact APN"})]}),(0,nn.jsx)("p",{className:"text-sm text-gray-400 mt-8",children:"Your profile and history are preserved \u2014 renewing simply restores your access."})]})}const ui=()=>{const{userProfile:t,currentUser:n,updateUserProfile:r}=sn(),a=oe(),[i,o]=(0,e.useState)(!1),[l,c]=(0,e.useState)(1),[d,u]=(0,e.useState)({firstName:"",lastName:"",title:"",company:"",city:"",state:"",workPhone:"",cellPhone:"",bio:"",linkedIn:"",companyCategory:"",companyDescription:""}),[m,h]=(0,e.useState)(!1),[p,g]=(0,e.useState)(!1);(0,e.useEffect)(()=>{t&&u({firstName:t.firstName||"",lastName:t.lastName||"",title:t.jobTitle||t.title||"",company:t.company||"",city:t.city||"",state:t.state||"",workPhone:t.phone||t.workPhone||"",cellPhone:t.cellPhone||"",bio:t.aboutMe||t.bio||"",linkedIn:t.linkedinUrl||t.linkedIn||"",companyCategory:t.companyCategory||"",companyDescription:t.companyDescription||""})},[t]);const f=e=>{const{name:t,value:n}=e.target;u(e=>(0,s.A)((0,s.A)({},e),{},{[t]:n}))};return(0,nn.jsx)("div",{className:"min-h-screen bg-gray-50 py-12 px-4 sm:px-6 lg:px-8",children:(0,nn.jsx)("div",{className:"max-w-2xl mx-auto",children:(0,nn.jsxs)("div",{className:"bg-white rounded-lg shadow-lg p-8",children:[(0,nn.jsxs)("div",{className:"text-center mb-8",children:[(0,nn.jsx)("h1",{className:"text-3xl font-bold text-gray-900 mb-2",children:"Complete Your Profile"}),(0,nn.jsx)("p",{className:"text-gray-600",children:"Help other members get to know you by completing your professional profile"})]}),(0,nn.jsxs)("div",{className:"mb-8",children:[(0,nn.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,nn.jsxs)("span",{className:"text-sm font-medium text-gray-700",children:["Step ",l," of ",3]}),(0,nn.jsxs)("span",{className:"text-sm text-gray-500",children:[Math.round(l/3*100),"% Complete"]})]}),(0,nn.jsx)("div",{className:"w-full bg-gray-200 rounded-full h-2",children:(0,nn.jsx)("div",{className:"bg-blue-600 h-2 rounded-full transition-all duration-300",style:{width:"".concat(l/3*100,"%")}})})]}),(0,nn.jsxs)("form",{onSubmit:async e=>{e.preventDefault();const t=["firstName","lastName","title","company","city","state"].filter(e=>{var t;return!(null!==(t=d[e])&&void 0!==t&&t.trim())});if(t.length>0)alert("Please fill in the following required fields: ".concat(t.join(", ")));else if(m)if(p){o(!0);try{console.log("Updating profile for user:",n.uid),console.log("Profile data:",d),await r(n.uid,(0,s.A)((0,s.A)({},d),{},{jobTitle:d.title,aboutMe:d.bio,linkedinUrl:d.linkedIn,phone:d.workPhone,profileCompleted:!0,profileCompletedAt:new Date,agreedToTerms:!0,agreedToPrivacy:!0,legalAgreementDate:new Date})),console.log("Profile updated successfully"),a("/events",{replace:!0})}catch(i){console.error("Error updating profile:",i),console.error("Error details:",i.message),console.error("Error code:",i.code),alert("Error updating profile: ".concat(i.message,". Please try again."))}finally{o(!1)}}else alert("Please agree to the Privacy Policy to continue");else alert("Please agree to the Terms and Conditions to continue")},children:[1===l&&(0,nn.jsx)("div",{className:"space-y-6",children:(0,nn.jsxs)("div",{children:[(0,nn.jsx)("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Basic Information"}),(0,nn.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"First Name *"}),(0,nn.jsx)("input",{type:"text",name:"firstName",value:d.firstName,onChange:f,required:!0,className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Last Name *"}),(0,nn.jsx)("input",{type:"text",name:"lastName",value:d.lastName,onChange:f,required:!0,className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Job Title *"}),(0,nn.jsx)("input",{type:"text",name:"title",value:d.title,onChange:f,required:!0,className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Company *"}),(0,nn.jsx)("input",{type:"text",name:"company",value:d.company,onChange:f,required:!0,className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"})]})]})]})}),2===l&&(0,nn.jsx)("div",{className:"space-y-6",children:(0,nn.jsxs)("div",{children:[(0,nn.jsx)("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Contact & Location"}),(0,nn.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"City *"}),(0,nn.jsx)("input",{type:"text",name:"city",value:d.city,onChange:f,required:!0,className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"State *"}),(0,nn.jsx)("input",{type:"text",name:"state",value:d.state,onChange:f,required:!0,className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Work Phone"}),(0,nn.jsx)("input",{type:"tel",name:"workPhone",value:d.workPhone,onChange:f,className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Cell Phone"}),(0,nn.jsx)("input",{type:"tel",name:"cellPhone",value:d.cellPhone,onChange:f,className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"})]})]})]})}),3===l&&(0,nn.jsxs)("div",{className:"space-y-6",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Professional Details"}),(0,nn.jsxs)("div",{className:"space-y-4",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"LinkedIn Profile"}),(0,nn.jsx)("input",{type:"url",name:"linkedIn",value:d.linkedIn,onChange:f,placeholder:"https://linkedin.com/in/yourprofile",className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Professional Bio"}),(0,nn.jsx)("textarea",{name:"bio",value:d.bio,onChange:f,rows:"4",placeholder:"Tell other members about your professional background, expertise, and interests...",className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"})]})]})]}),(0,nn.jsxs)("div",{className:"p-4 bg-gray-50 rounded-lg",children:[(0,nn.jsx)("h4",{className:"text-lg font-semibold text-gray-800 mb
2-4",children:"Legal Agreements"}),(0,nn.jsxs)("div",{className:"space-y-3",children:[(0,nn.jsxs)("label",{className:"flex items-start",children:[(0,nn.jsx)("input",{type:"checkbox",checked:m,onChange:e=>h(e.target.checked),className:"mt-1 mr-3 h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded",required:!0}),(0,nn.jsxs)("span",{className:"text-sm text-gray-700",children:["I agree to the"," ",(0,nn.jsx)(dt,{to:"/legal/terms-and-conditions",target:"_blank",className:"text-blue-600 hover:text-blue-800 underline",children:"Terms and Conditions"})," ","*"]})]}),(0,nn.jsxs)("label",{className:"flex items-start",children:[(0,nn.jsx)("input",{type:"checkbox",checked:p,onChange:e=>g(e.target.checked),className:"mt-1 mr-3 h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded",required:!0}),(0,nn.jsxs)("span",{className:"text-sm text-gray-700",children:["I agree to the"," ",(0,nn.jsx)(dt,{to:"/legal/privacy-policy",target:"_blank",className:"text-blue-600 hover:text-blue-800 underline",children:"Privacy Policy"})," ","*"]})]})]}),(0,nn.jsx)("p",{className:"text-xs text-gray-500 mt-2",children:"* Required to complete profile and access member features"})]})]}),(0,nn.jsxs)("div",{className:"flex justify-between mt-8",children:[(0,nn.jsx)("button",{type:"button",onClick:()=>{l>1&&c(l-1)},disabled:1===l,className:"px-6 py-2 border border-gray-300 rounded-md text-gray-700 hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed",children:"Previous"}),l<3?(0,nn.jsx)("button",{type:"button",onClick:()=>{l<3&&c(l+1)},className:"px-6 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700",children:"Next"}):(0,nn.jsx)("button",{type:"submit",disabled:i||!m||!p,className:"px-6 py-2 bg-green-600 text-white rounded-md hover:bg-green-700 disabled:opacity-50 disabled:cursor-not-allowed",children:i?"Saving...":"Complete Profile"})]}),3===l&&(!m||!p)&&(0,nn.jsx)("div",{className:"text-center mt-4",children:(0,nn.jsx)("p",{className:"text-sm text-red-600",children:"Please agree to both the Terms and Conditions and Privacy Policy to complete your profile"})})]}),(0,nn.jsx)("div",{className:"text-center mt-6",children:(0,nn.jsx)("button",{onClick:()=>a("/events"),className:"text-gray-500 hover:text-gray-700 text-sm",children:"Skip for now - I'll complete this later"})})]})})})},mi=()=>(0,nn.jsxs)("div",{className:"bg-white",children:[(0,nn.jsx)("div",{className:"bg-apn-blue text-white py-12",children:(0,nn.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:(0,nn.jsxs)("div",{className:"text-center",children:[(0,nn.jsx)("div",{className:"flex justify-center mb-4",children:(0,nn.jsx)("img",{src:"".concat("","/apn-logos/APN-Tag-white.jpg"),alt:"APN Logo",className:"h-16"})}),(0,nn.jsx)("h1",{className:"text-3xl font-bold",children:"Sponsorship"})]})})}),(0,nn.jsx)("section",{className:"py-12",children:(0,nn.jsxs)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[(0,nn.jsxs)("div",{className:"text-center mb-12",children:[(0,nn.jsx)("h2",{className:"text-3xl font-bold text-gray-900 mb-4",children:"Support the APN Community"}),(0,nn.jsx)("p",{className:"text-lg text-gray-600 max-w-3xl mx-auto",children:"Become a sponsor of the Accelerated Professionals Network and connect your brand with a community of finance professionals collaborating to create a more seamless M&A transaction process."})]}),(0,nn.jsxs)("div",{className:"mb-12",children:[(0,nn.jsx)("p",{className:"text-lg text-gray-600 mb-4",children:"APN sponsorship provides your organization with visibility and access to a network of finance professionals at various stages of their careers. Our members include professionals from investment banking, private equity, family offices, accounting, law, and more."}),(0,nn.jsx)("p",{className:"text-lg text-gray-600 mb-4",children:"By becoming a sponsor of APN or one of its events, you'll demonstrate your commitment to supporting professional development and networking in the finance industry while gaining valuable exposure for your brand."}),(0,nn.jsxs)("p",{className:"text-lg text-gray-600 mb-4",children:[(0,nn.jsx)("strong",{children:"Note:"})," Sponsorship pricing varies by event. Please contact us for specific pricing information for upcoming events."]}),(0,nn.jsxs)("div",{className:"bg-gray-50 p-6 rounded-lg border border-gray-200 mt-6",children:[(0,nn.jsx)("h3",{className:"text-xl font-bold text-gray-900 mb-3",children:"Referral Program"}),(0,nn.jsx)("p",{className:"text-gray-700 mb-3",children:"If any sponsor tier refers a specific number of attendees per event to register/attend, a proprietary discount will apply to their next sponsorship package or membership package."}),(0,nn.jsx)("p",{className:"text-gray-700",children:"All sponsors receive a 5% membership or event discount referral code specific to their organization. When they reach a specific amount of referrals, the discount is applied automatically to either their membership or next sponsorship package, and they receive an Ambassador badge."})]})]}),(0,nn.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-8",children:[{id:1,name:"Bronze Sponsor",price:"Contact for Pricing",benefits:["L
2ogo on APN Website Event Page","Recognition at APN Event","Access to attendee list 2 weeks in advance","1 free event registration for the organization","LinkedIn sponsorship announcements","Updated attendee list 3 days prior to the event"]},{id:2,name:"Silver Sponsor",price:"Contact for Pricing",benefits:["Everything in Bronze package","Access to attendee list 2.5 weeks in advance","2 free event registrations for the organization","Logo on event marketing emails","Negotiated referral discounts on future sponsorship packages"]},{id:3,name:"Gold Sponsor",price:"Contact for Pricing",benefits:["Everything in Silver package","Access to attendee list 3 weeks in advance","4 event registrations for the organization","15% discount code for any additional attendees from the organization"]}].map(e=>(0,nn.jsxs)("div",{className:"bg-white rounded-lg shadow-lg overflow-hidden border border-gray-200",children:[(0,nn.jsxs)("div",{className:"bg-apn-blue text-white p-6",children:[(0,nn.jsx)("h3",{className:"text-2xl font-bold",children:e.name}),(0,nn.jsx)("p",{className:"text-xl mt-2",children:e.price})]}),(0,nn.jsxs)("div",{className:"p-6",children:[(0,nn.jsx)("h4",{className:"font-semibold text-lg mb-4",children:"Benefits:"}),(0,nn.jsx)("ul",{className:"space-y-2 mb-6",children:e.benefits.map((e,t)=>(0,nn.jsxs)("li",{className:"flex items-start",children:[(0,nn.jsx)("svg",{className:"h-5 w-5 text-green-500 mr-2 mt-0.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M5 13l4 4L19 7"})}),(0,nn.jsx)("span",{className:"text-gray-600",children:e})]},t))}),(0,nn.jsx)(dt,{to:"/about/contact",className:"block w-full bg-apn-blue text-white text-center py-2 px-4 rounded hover:bg-blue-700 transition duration-200",children:"Contact Us"})]})]},e.id))}),(0,nn.jsxs)("div",{className:"mt-12 text-center",children:[(0,nn.jsx)("p",{className:"text-lg text-gray-600 mb-6",children:"For more information about sponsorship opportunities or to discuss custom sponsorship packages, please contact us."}),(0,nn.jsx)(dt,{to:"/about/contact",className:"inline-block bg-apn-blue text-white py-3 px-6 rounded-lg hover:bg-blue-700 transition duration-200",children:"Get in Touch"})]})]})}),(0,nn.jsx)("section",{className:"py-12 bg-gray-50",children:(0,nn.jsxs)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[(0,nn.jsxs)("div",{className:"text-center mb-12",children:[(0,nn.jsx)("h2",{className:"text-3xl font-bold text-gray-900 mb-4",children:"Our Current Sponsors"}),(0,nn.jsx)("p",{className:"text-lg text-gray-600",children:"We're grateful for the support of these organizations that make APN's work possible."})]}),(0,nn.jsx)("div",{className:"flex justify-center items-center flex-wrap gap-12",children:(0,nn.jsx)("div",{className:"bg-white p-6 rounded-lg shadow-md",children:(0,nn.jsx)("img",{src:"".concat("","/images/sponsors/hga-logo.jpg"),alt:"Hilton Global Associates",className:"h-24 object-contain",onError:e=>{e.target.onerror=null,e.target.src="".concat("","/apn-logos/APN-blue (1).png")}})})})]})}),(0,nn.jsx)("section",{className:"bg-apn-blue text-white py-12",children:(0,nn.jsxs)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 text-center",children:[(0,nn.jsx)("div",{className:"flex justify-center mb-6",children:(0,nn.jsx)("img",{src:"".concat("","/apn-logos/APN-Tag-SQ-white.jpg"),alt:"APN Logo Square",className:"h-20"})}),(0,nn.jsx)("h2",{className:"text-3xl font-bold mb-4",children:"Become a Sponsor Today"}),(0,nn.jsx)("p",{className:"text-xl mb-8 max-w-3xl mx-auto",children:"Support the APN community and gain visibility for your organization among finance professionals."}),(0,nn.jsx)(dt,{to:"/about/contact",className:"btn-primary bg-white text-apn-blue hover:bg-gray-100",children:"Contact Us About Sponsorship"})]})})]}),hi=()=>(0,nn.jsx)("svg",{className:"h-5 w-5 text-green-500 mr-2 mt-0.5 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M5 13l4 4L19 7"})}),pi=()=>(0,nn.jsx)("svg",{className:"h-6 w-6 text-apn-blue mr-3 mt-1 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})}),gi=[{title:"Business Development",items:["Strategic partnership development","Market expansion strategies","Revenue growth optimization","Client acquisition strategies","CRM systems design, rollouts & integrations"]},{title:"Marketing Consulting",items:["Digital marketing strategy","Brand positioning & messaging","Content marketing campaigns","Social media strategy"]},{title:"Website Development",items:["Custom web applications","Responsive design & development","E-commerce solutions","Database integration & APIs"]},{title:"AI Integration & Build-outs",items:["Custom AI chatbot development","Workflow & process automation","AI-powered analytics dashboards","Intelligent agent deployment"]}],fi=[{title:"Business Development & Strategic Market Expansion",desc:"Strategic partnerships, market analysis, and growth planning"},{title:"Marketing Strategy & Campaign Design",desc:"Content creation, digital marketing, and brand development"},{title:"CRM System Integration",desc:"Client relationship management and engagement optimization"},{title:"Website Development",desc:"React, JavaScript, HTML, CSS, and modern frameworks"},{title:"AI Integration & Automation",desc:"Custom AI agents, chatbots, workflow automation, and intelligent analytics"},{title:"Data Analytics & Performance Optimization",desc:"Business growth metrics and performance tracking"}],xi=()=>(0,nn.jsxs)("div",{className:"bg-white",children:[(0,nn.jsx)("div",{className:"bg-apn-blue text-white py-12",children:(0,nn.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:(0,nn.jsxs)("div",{className:"text-center",children:[(0,nn.jsx)("div",{className:"flex justify-center mb-4",children:(0,nn.jsx)("img",{src:"".concat("","/apn-logos/APN-Tag-white.jpg"),alt:"APN Logo",className:"h-16"})}),(0,nn.jsx)("h1",{className:"text-3xl font-bold",children:"Additional Services"}),(0,nn.jsx)("p",{className:"mt-2 text-xl",children:"Professional Business Development & Technology Solutions"})]})})}),(0,nn.jsx)("section",{className:"py-12",children:(0,nn.jsxs)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[(0,nn.jsxs)("div",{className:"text-center mb-12",children:[(0,nn.jsx)("h2",{className:"text-3xl font-bold text-gray-900 mb-4",children:"Our Services"}),(0,nn.jsx)("p",{className:"text-lg text-gray-600 max-w-3xl mx-auto",children:"Beyond our networking platform, we offer specialized consulting services to help your business grow and succeed in today's competitive market."})]}),(0,nn.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-8 mb-16",children:gi.map(e=>(0,nn.jsxs)("div",{className:"bg-white rounded-lg shadow-lg overflow-hidden border border-gray-200",children:[(0,nn.jsx)("div",{className:"bg-apn-blue text-white p-6",children:(0,nn.jsx)("h3",{className:"text-xl font-bold",children:e.title})}),(0,nn.jsx)("div",{className:"p-6",children:(0,nn.jsx)("ul",{className:"space-y-3 mb-6",children:e.items.map(e=>(0,nn.jsxs)("li",{className:"flex items-start",children:[(0,nn.jsx)(hi,{}),(0,nn.jsx)("span",{className:"text-gray-600",children:e})]},e))})})]},e.title))})]})}),(0,nn.jsx)("section",{className:"py-10 bg-gray-100",children:(0,nn.jsxs)("div",{className:"max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 text-center",children:[(0,nn.jsx)("h2",{className:"text-2xl font-bold text-apn-blue mb-3",children:"Already in contact with our team?"}),(0,nn.jsx)("p",{className:"text-gray-600 mb-6",children:"If you've completed a demo with our team, log in to view your site preview and project status."}),(0,nn.jsxs)(dt,{to:"/client/login",className:"inline-flex items-center px-6 py-3 bg-apn-blue text-white font-medium rounded-lg hover:bg-apn-dark-blue transition-colors",children:[(0,nn.jsx)("svg",{className:"h-5 w-5 mr-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"})}),"Client Portal Login"]})]})}),(0,nn.jsx)("section",{className:"py-12 bg-gray-50",children:(0,nn.jsxs)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[(0,nn.jsxs)("div",{className:"text-center mb-12",children:[(0,nn.jsx)("h2",{className:"text-3xl font-bold text-gray-900 mb-4",children:"Meet Our Consultants"}),(0,nn.jsx)("p",{className:"text-xl text-gray-600 mb-6",children:"Business Development, Marketing & Digital Solutions Specialists"})]}),(0,nn.jsx)("div",{className:"max-w-5xl mx-auto",children:(0,nn.jsx)("div",{className:"bg-white rounded-lg shadow-lg overflow-hidden",children:(0,nn.jsxs)("div",{className:"p-8",children:[(0,nn.jsxs)("div",{className:"mb-8",children:[(0,nn.jsx)("p",{className:"text-lg text-gray-700 leading-relaxed mb-6",children:"Our team of consultants brings extensive expertise in business development, marketing, website development, and AI integration, delivering innovative solutions to drive growth and elevate brand impact. Combining strategic insight with technical proficiency, they craft data-driven marketing campaigns, foster high-value partnerships, build modern user-centric websites, and deploy intelligent AI agents."}),(0,nn.jsx)("p",{className:"text-lg text-gray-700 leading-relaxed",children:"Their work includes developing full-stack web applications, building custom AI chatbots and automation workflows, and optimizing client engagement through CRM systems \u2014 ensuring seamless alignment between business objectives and digital innovation."})]}),(0,nn.jsx)("div",{className:"border-t border-gray-200 pt-8 mb-8",children:(0,nn.jsxs)("div",{className:"md:flex items-start",children:[(0,nn.jsxs)("div",{className:"md:w-1/3 mb-6 md:mb-0 md:pr-8",children:[(0,nn.jsx)("img",{src:"/apn-logos/nicholas-agouras.jpg",alt:"Nicholas Agouras",className:"rounded-lg shadow-md w-full"}),(0,nn.jsxs)("div",{className:"mt-4",children:[(0,nn.jsx)("h3",{className:"text-2xl font-bold text-gray-900",children:"Nicholas Agouras"}),(0,nn.jsx)("p",{className:"text-apn-blue font-semibold",children:"CTO & Head of AI & Software Development"}),(0,nn.jsx)("p",{className:"text-sm text-gray-600 mt-1",children:"[email protected]"}),(0,nn.jsx)("p",{className:"text-sm text-gray-600",children:"(203) 460-2492"}),(0,nn.jsx)("a",{href:"https://www.linkedin.com/in/nicholas-agouras-b1457092",target:"_blank",rel:"noopener noreferrer",className:"text-apn-blue hover:underline text-sm mt-1 inline-block",children:"LinkedIn Profile \u2192"})]})]}),(0,nn.jsxs)("div",{className:"md:w-2/3",children:[(0,nn.jsx)("p",{className:"text-lg text-gray-700 leading-relaxed mb-4",children:"Nicholas Agouras leads AI and software development at APN, bringing a rare combination of engineering discipline and creative problem-solving to the team. A Rutgers University graduate with deep roots in civil and environmental engineering, Nicholas spent years managing complex infrastru
2cture projects \u2014 from wastewater resilience programs to heavy civil construction \u2014 before channeling that same systematic thinking into software and AI."}),(0,nn.jsx)("p",{className:"text-lg text-gray-700 leading-relaxed mb-4",children:"At APN, Nicholas is the architect behind the platform's AI-powered engine: the automated site generation pipeline that builds custom websites for local businesses, the intelligent outreach systems that connect those businesses with opportunities they didn't know existed, and the agent orchestration framework that keeps the entire operation running around the clock. He's the person who turned the idea of \"build the website before you even call them\" into a working system that generates showcase-quality sites for dozens of industries, complete with real photography, industry-specific design systems, and local SEO built in."}),(0,nn.jsx)("p",{className:"text-lg text-gray-700 leading-relaxed",children:"Nicholas is driven by a simple belief: every local business \u2014 whether it's a 60-year-old barbershop or a brand-new landscaping company \u2014 deserves a professional online presence. His engineering background taught him to build things that work reliably at scale, and that's exactly what he does at APN."})]})]})}),(0,nn.jsxs)("div",{className:"border-t border-gray-200 pt-8",children:[(0,nn.jsx)("h3",{className:"text-2xl font-bold text-gray-900 mb-6",children:"Technical & Professional Expertise"}),(0,nn.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-8",children:fi.map(e=>(0,nn.jsxs)("div",{className:"flex items-start",children:[(0,nn.jsx)(pi,{}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("h4",{className:"font-semibold text-gray-900",children:e.title}),(0,nn.jsx)("p",{className:"text-gray-600 text-sm mt-1",children:e.desc})]})]},e.title))})]})]})})})]})}),(0,nn.jsx)("section",{className:"bg-apn-blue text-white py-12",children:(0,nn.jsxs)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 text-center",children:[(0,nn.jsx)("div",{className:"flex justify-center mb-6",children:(0,nn.jsx)("img",{src:"".concat("","/apn-logos/APN-Tag-SQ-white.jpg"),alt:"APN Logo Square",className:"h-20"})}),(0,nn.jsx)("h2",{className:"text-3xl font-bold mb-4",children:"Ready to Grow Your Business?"}),(0,nn.jsx)("p",{className:"text-xl mb-8 max-w-3xl mx-auto",children:"Contact us today to discuss how our consulting services can help accelerate your business growth and digital transformation."}),(0,nn.jsx)(dt,{to:"/about/contact",className:"btn-primary bg-white text-apn-blue hover:bg-gray-100",children:"Get Started Today"})]})}),(0,nn.jsxs)("section",{className:"py-16 bg-white",children:[(0,nn.jsx)("style",{children:"\n @keyframes apnStepFadeIn {\n from { opacity: 0; transform: translateY(24px); }\n to { opacity: 1; transform: translateY(0); }\n }\n .apn-how-step {\n opacity: 0;\n animation: apnStepFadeIn 0.7s ease-out forwards;\n }\n .apn-how-step-1 { animation-delay: 0.1s; }\n .apn-how-step-2 { animation-delay: 0.3s; }\n .apn-how-step-3 { animation-delay: 0.5s; }\n .apn-how-step-4 { animation-delay: 0.7s; }\n .apn-how-card {\n background: #ffffff;\n border: 1px solid #e5e7eb;\n border-radius: 8px;\n padding: 32px 24px;\n height: 100%;\n box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);\n transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;\n }\n .apn-how-card:hover {\n transform: translateY(-4px);\n border-color: #3d67ad;\n box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);\n }\n .apn-how-connector {\n display: none;\n }\n @media (min-width: 1024px) {\n .apn-how-connector {\n display: flex;\n position: absolute;\n top: 64px;\n right: -16px;\n width: 32px;\n height: 2px;\n background: linear-gradient(to right, #3d67ad, #e5e7eb);\n align-items: center;\n justify-content: flex-end;\n z-index: 1;\n }\n .apn-how-connector::after {\n content: '';\n width: 0;\n height: 0;\n border-left: 8px solid #3d67ad;\n border-top: 6px solid transparent;\n border-bottom: 6px solid transparent;\n }\n }\n "}),(0,nn.jsxs)("div",{className:"max-w-6xl mx-auto",children:[(0,nn.jsx)("h2",{className:"text-3xl font-bold text-center mb-4",style:{color:"#1f2937"},children:"How It Works"}),(0,nn.jsx)("p",{className:"text-center mb-12 max-w-2xl mx-auto",style:{color:"#6b7280"},children:"From consultation to go-live in one week"}),(0,nn.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6",children:[(0,nn.jsxs)("div",{className:"apn-how-step apn-
2how-step-1",style:{position:"relative"},children:[(0,nn.jsxs)("div",{className:"apn-how-card",children:[(0,nn.jsx)("div",{style:{fontSize:"12px",color:"#3d67ad",fontWeight:"700",letterSpacing:"0.1em",marginBottom:"12px"},children:"STEP 01"}),(0,nn.jsx)("div",{style:{width:"56px",height:"56px",borderRadius:"12px",background:"rgba(61, 103, 173, 0.1)",display:"flex",alignItems:"center",justifyContent:"center",marginBottom:"20px"},children:(0,nn.jsxs)("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",stroke:"#3d67ad",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,nn.jsx)("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2",ry:"2"}),(0,nn.jsx)("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),(0,nn.jsx)("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),(0,nn.jsx)("line",{x1:"3",y1:"10",x2:"21",y2:"10"})]})}),(0,nn.jsx)("h3",{style:{fontSize:"18px",fontWeight:"700",color:"#1f2937",marginBottom:"8px"},children:"Book a Free Consultation"}),(0,nn.jsx)("p",{style:{fontSize:"14px",color:"#6b7280",lineHeight:"1.6"},children:"Schedule a no-obligation call to discuss your goals, brand, and business needs."})]}),(0,nn.jsx)("div",{className:"apn-how-connector"})]}
2),(0,nn.jsxs)("div",{className:"apn-how-step apn-how-step-2",style:{position:"relative"},children:[(0,nn.jsxs)("div",{className:"apn-how-card",children:[(0,nn.jsx)("div",{style:{fontSize:"12px",color:"#3d67ad",fontWeight:"700",letterSpacing:"0.1em",marginBottom:"12px"},children:"STEP 02"}),(0,nn.jsx)("div",{style:{width:"56px",height:"56px",borderRadius:"12px",background:"rgba(61, 103, 173, 0.1)",display:"flex",alignItems:"center",justifyContent:"center",marginBottom:"20px"},children:(0,nn.jsxs)("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",stroke:"#3d67ad",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,nn.jsx)("polyline",{points:"16 18 22 12 16 6"}),(0,nn.jsx)("polyline",{points:"8 6 2 12 8 18"})]})}),(0,nn.jsx)("h3",{style:{fontSize:"18px",fontWeight:"700",color:"#1f2937",marginBottom:"8px"},children:"We Build Your Custom Demo"}),(0,nn.jsx)("p",{style:{fontSize:"14px",color:"#6b7280",lineHeight:"1.6"},children:"Our team designs and codes a custom demo site tailored to your business."})]}),(0,nn.jsx)("div",{className:"apn-how-connector"})]}
2),(0,nn.jsxs)("div",{className:"apn-how-step apn-how-step-3",style:{position:"relative"},children:[(0,nn.jsxs)("div",{className:"apn-how-card",children:[(0,nn.jsx)("div",{style:{fontSize:"12px",color:"#3d67ad",fontWeight:"700",letterSpacing:"0.1em",marginBottom:"12px"},children:"STEP 03"}),(0,nn.jsx)("div",{style:{width:"56px",height:"56px",borderRadius:"12px",background:"rgba(61, 103, 173, 0.1)",display:"flex",alignItems:"center",justifyContent:"center",marginBottom:"20px"},children:(0,nn.jsxs)("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",stroke:"#3d67ad",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,nn.jsx)("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}),(0,nn.jsx)("polyline",{points:"22 4 12 14.01 9 11.01"})]})}),(0,nn.jsx)("h3",{style:{fontSize:"18px",fontWeight:"700",color:"#1f2937",marginBottom:"8px"},children:"Review and Approve"}),(0,nn.jsx)("p",{style:{fontSize:"14px",color:"#6b7280",lineHeight:"1.6"},children:"Explore your new website, request revisions, and approve the final design."})]}),(0,nn.jsx)("div",{className:"apn-how-connector"})]}
2),(0,nn.jsx)("div",{className:"apn-how-step apn-how-step-4",style:{position:"relative"},children:(0,nn.jsxs)("div",{className:"apn-how-card",children:[(0,nn.jsx)("div",{style:{fontSize:"12px",color:"#3d67ad",fontWeight:"700",letterSpacing:"0.1em",marginBottom:"12px"},children:"STEP 04"}),(0,nn.jsx)("div",{style:{width:"56px",height:"56px",borderRadius:"12px",background:"rgba(61, 103, 173, 0.1)",display:"flex",alignItems:"center",justifyContent:"center",marginBottom:"20px"},children:(0,nn.jsxs)("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",stroke:"#3d67ad",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,nn.jsx)("path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z"}),(0,nn.jsx)("path",{d:"M12 15l-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z"}),(0,nn.jsx)("path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0"}),(0,nn.jsx)("path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5"})]})}),(0,nn.jsx)("h3",{style:{fontSize:"18px",fontWeight:"700",color:"#1f2937",marginBottom:"8px"},children:"Go Live \u2014 We Handle Everything"}),(0,nn.jsx)("p",{style:{fontSize:"14px",color:"#6b7280",lineHeight:"1.6"},children:"Domain, hosting, email, and deployment \u2014 we take care of the entire launch."})]})})]})]})]}),(0,nn.jsx)("section",{className:"py-16 bg-gray-50",children:(0,nn.jsxs)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[(0,nn.jsxs)("div",{className:"text-center mb-12",children:[(0,nn.jsx)("h2",{className:"text-3xl font-bold text-apn-blue mb-4",children:"Simple, Transparent Pricing"}),(0,nn.jsx)("p",{className:"text-lg text-gray-600 max-w-2xl mx-auto",children:"Every plan includes a custom-designed website, professional email, domain registration, and ongoing support. No hidden fees."})]}),(0,nn.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-8",children:[(0,nn.jsxs)("div",{className:"bg-white rounded-lg shadow-lg overflow-hidden border border-gray-200 flex flex-col",children:[(0,nn.jsxs)("div",{className:"bg-apn-blue text-white p-6",children:[(0,nn.jsx)("h3",{className:"text-xl font-bold",children:"Starter"}),(0,nn.jsxs)("div",{className:"mt-3",children:[(0,nn.jsx)("span",{className:"text-4xl font-bold",children:"$749"}),(0,nn.jsx)("span",{className:"text-apn-light-blue text-sm ml-1",children:"setup"})]}),(0,nn.jsx)("div",{className:"text-apn-light-blue text-sm mt-1",children:"+ $79/month"})]}),(0,nn.jsxs)("div",{className:"p-6 flex-1 flex flex-col",children:[(0,nn.jsx)("ul",{className:"space-y-3 flex-1",children:["Custom interactive website","Professional email (2 M365 mailboxes)","Custom domain registration","SEO schema + sitemap","Analytics tracking","Mobile-responsive design","Monthly maintenance","AI skill hooks"].map((e,t)=>(0,nn.jsxs)("li",{className:"flex items-start",children:[(0,nn.jsx)(hi,{}),(0,nn.jsx)("span",{className:"text-gray-700 text-sm",children:e})]},t))}),(0,nn.jsx)(dt,{to:"/about/contact?tier=starter",className:"mt-6 inline-flex justify-center items-center px-6 py-3 bg-apn-blue text-white font-medium rounded-lg hover:bg-apn-dark-blue transition-colors",children:"Book a Consultation"})]})]}),(0,nn.jsxs)("div",{className:"bg-white rounded-lg shadow-xl overflow-hidden border-2 border-apn-blue flex flex-col relative transform lg:-translate-y-2",children:[(0,nn.jsx)("div",{className:"absolute top-0 left-0 right-0 bg-apn-blue text-white text-center py-1 text-xs font-bold uppercase tracking-wider",children:"Most Popular"}),(0,nn.jsxs)("div",{className:"bg-apn-blue text-white p-6 pt-10",children:[(0,nn.jsx)("h3",{className:"text-xl font-bold",children:"Professional"}),(0,nn.jsxs)("div",{className:"mt-3",children:[(0,nn.jsx)("span",{className:"text-4xl font-bold",children:"$1,250"}),(0,nn.jsx)("span",{className:"text-apn-light-blue text-sm ml-1",children:"setup"})]}),(0,nn.jsx)("div",{className:"text-apn-light-blue text-sm mt-1",children:"+ $199/month"})]}),(0,nn.jsxs)("div",{className:"p-6 flex-1 flex flex-col",children:[(0,nn.jsx)("p",{className:"text-xs text-gray-500 font-semibold mb-3 uppercase tracking-wide",children:"Everything in Starter, plus:"}),(0,nn.jsx)("ul",{className:"space-y-3 flex-1",children:["AI chatbot widget (live on site)","Review management (Google/Yelp)","Booking calendar integration","Analytics dashboard","4 M365 mailboxes","Priority support"].map((e,t)=>(0,nn.jsxs)("li",{className:"flex items-start",children:[(0,nn.jsx)(hi,{}),(0,nn.jsx)("span",{className:"text-gray-700 text-sm",children:e})]},t))}),(0,nn.jsx)(dt,{to:"/about/contact?tier=professional",className:"mt-6 inline-flex justify-center items-center px-6 py-3 bg-apn-blue text-white font-medium rounded-lg hover:bg-apn-dark-blue transition-colors",children:"Book a Consultation"})]})]}),(0,nn.jsxs)("div",{className:"bg-white rounded-lg shadow-lg overflow-hidden border border-gray-200 flex flex-col",children:[(0,nn.jsxs)("div",{className:"bg-apn-blue text-white p-6",children:[(0,nn.jsx)("h3",{className:"text-xl font-bold",children:"Premium"}),(0,nn.jsxs)("div",{className:"mt-3",children:[(0,nn.jsx)("span",{className:"text-4xl font-bold",children:"$1,997"}),(0,nn.jsx)("span",{className:"text-apn-light-blue text-sm ml-1",children:"setup"})]}),(0,nn.jsx)("div",{className:"text-apn-light-blue text-sm mt-1",children:"+ $399/month"})]}),(0,nn.jsxs)("div",{className:"p-6 flex-1 flex flex-col",children:[(0,nn.jsx)("p",{className:"text-xs text-gray-500 font-semibold mb-3 uppercase tracking-wide",children:"Everything in Professional, plus:"}),(0,nn.jsx)("ul",{className:"space-y-3 flex-1",children:["Dedicated AI phone agent","Email drip campaigns","Social media integration","Full SEO + monthly reports","Unlimited M365 mailboxes","Dedicated AI account manager"].map((e,t)=>(0,nn.jsxs)("li",{className:"flex items-start",children:[(0,nn.jsx)(hi,{}),(0,nn.jsx)("span",{className:"text-gray-700 text-sm",children:e})]},t))}),(0,nn.jsx)(dt,{to:"/about/contact?tier=premium",className:"mt-6 inline-flex justify-center items-center px-6 py-3 bg-apn-blue text-white font-medium rounded-lg hover:bg-apn-dark-blue transition-colors",children:"Book a Consultation"})]})]}),(0,nn.jsxs)("div",{className:"bg-white rounded-lg shadow-lg overflow-hidden border border-gray-200 flex flex-col",children:[(0,nn.jsxs)("div",{className:"bg-apn-blue text-white p-6",children:[(0,nn.jsx)("h3",{className:"text-xl font-bold",children:"Enterprise"}),(0,nn.jsx)("div",{className:"mt-3",children:(0,nn.jsx)("span",{className:"text-3xl font-bold",children:"Custom"})}),(0,nn.jsx)("div",{className:"text-apn-light-blue text-sm mt-1",children:"pricing tailored to you"})]}),(0,nn.jsxs)("div",{className:"p-6 flex-1 flex flex-col",children:[(0,nn.jsx)("p",{className:"text-xs text-gray-500 font-semibold mb-3 uppercase tracking-wide",children:"Everything in Premium, plus:"}),(0,nn.jsx)("ul",{className:"space-y-3 flex-1",children:["Full AI business operating system","Custom AI agents per department","Custom branded voice AI","Live design sessions","Compliance monitoring","Dedicated infrastru
2cture","White-label option"].map((e,t)=>(0,nn.jsxs)("li",{className:"flex items-start",children:[(0,nn.jsx)(hi,{}),(0,nn.jsx)("span",{className:"text-gray-700 text-sm",children:e})]},t))}),(0,nn.jsx)(dt,{to:"/about/contact?tier=enterprise",className:"mt-6 inline-flex justify-center items-center px-6 py-3 bg-apn-blue text-white font-medium rounded-lg hover:bg-apn-dark-blue transition-colors",children:"Contact Us"})]})]})]}),(0,nn.jsx)("p",{className:"text-center text-gray-500 text-sm mt-10",children:"All plans include professional email setup, custom domain, and ongoing maintenance. No hidden fees. Cancel anytime after initial term."})]})})]}),bi={starter:{name:"Starter",setup:"$749",monthly:"$79/mo",features:"Custom website, professional email, domain, SEO, monthly maintenance"},professional:{name:"Professional",setup:"$1,250",monthly:"$199/mo",features:"Everything in Starter + AI chatbot, review management, booking, analytics dashboard"},premium:{name:"Premium",setup:"$1,997",monthly:"$399/mo",features:"Everything in Professional + AI phone agent, email drips, full SEO, social media"},enterprise:{name:"Enterprise",setup:"Custom",monthly:"Custom",features:"Full AI business operating system, custom agents per department, dedicated infrastructure"}},yi=["Restaurant","Salon/Spa","Contractor/Trades","Retail","Professional Services","Auto/Mechanic","Food/Beverage","Health/Wellness","Other"],vi=()=>{const t=se(),n=(new URLSearchParams(t.search).get("tier")||"").toLowerCase(),r=bi[n]?n:"",a=r?bi[r]:null,[i,o]=(0,e.useState)({name:"",email:"",phone:"",businessName:"",businessType:"",tierInterest:r,subject:a?"Consultation \u2014 ".concat(a.name," Plan"):"",message:""}),[l,c]=(0,e.useState)(!1);(0,e.useEffect)(()=>{r&&a&&o(e=>(0,s.A)((0,s.A)({},e),{},{tierInterest:r,subject:"Consultation \u2014 ".concat(a.name," Plan")}))},[r]);const d=e=>{const{name:t,value:n}=e.target;o(e=>(0,s.A)((0,s.A)({},e),{},{[t]:n}))};return(0,nn.jsxs)("div",{className:"bg-white",children:[(0,nn.jsx)("div",{className:"bg-apn-blue text-white py-12",children:(0,nn.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:(0,nn.jsxs)("div",{className:"text-center",children:[(0,nn.jsx)("div",{className:"flex justify-center mb-4",children:(0,nn.jsx)("img",{src:"".concat("","/apn-logos/APN-Tag-white.jpg"),alt:"APN Logo",className:"h-16"})}),(0,nn.jsx)("h1",{className:"text-3xl font-bold",children:"Contact Us"})]})})}),a&&(0,nn.jsx)("div",{className:"bg-apn-blue text-white py-6 border-t border-apn-light-blue",children:(0,nn.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:(0,nn.jsx)("div",{className:"bg-apn-dark-blue rounded-lg shadow-lg p-6 max-w-4xl mx-auto",children:(0,nn.jsxs)("div",{className:"flex flex-col md:flex-row md:items-center md:justify-between gap-4",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("p",{className:"text-sm uppercase tracking-wide text-apn-light-blue font-semibold mb-1",children:"You're interested in our"}),(0,nn.jsxs)("h2",{className:"text-2xl font-bold",children:[a.name," Plan \u2014 ",a.setup," setup + ",a.monthly]}),(0,nn.jsx)("p",{className:"text-apn-light-blue mt-2 text-sm",children:a.features})]}),(0,nn.jsx)(dt,{to:"/about/additional-services",className:"inline-flex items-center px-4 py-2 bg-white text-apn-blue font-medium rounded-lg hover:bg-gray-100 transition-colors text-sm whitespace-nowrap",children:"Compare Plans \u2192"})]})})})}),(0,nn.jsx)("section",{className:"py-12",children:(0,nn.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:(0,nn.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-12",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("h2",{className:"text-2xl font-bold text-gray-900 mb-6",children:"Get in Touch"}),(0,nn.jsx)("p",{className:"text-lg text-gray-600 mb-8",children:"Have questions about APN membership, sponsorship, or events? We're here to help! Fill out the form or use the contact information below to get in touch with our team."}),(0,nn.jsxs)("div",{className:"space-y-6",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("h3",{className:"text-xl font-semibold text-gray-900 mb-2",children:"General Inquiries"}),(0,nn.jsxs)("p",{className:"text-gray-600",children:[(0,nn.jsx)("strong",{children:"Email:"})," [email protected]"]})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("h3",{className:"text-xl font-semibold text-gray-900 mb-2",children:"Our Team"}),(0,nn.jsxs)("div",{className:"space-y-3",children:[(0,nn.jsxs)("div",{className:"text-gray-600",children:[(0,nn.jsx)("strong",{children:"Caroline Burnham"})," \u2014 Founder & CEO",(0,nn.jsx)("br",{}
2),(0,nn.jsx)("a",{href:"mailto:[email protected]",className:"text-apn-blue hover:underline",children:"[email protected]"}),(0,nn.jsx)("br",{}),"(724) 831-6105"]}),(0,nn.jsxs)("div",{className:"text-gray-600",children:[(0,nn.jsx)("strong",{children:"Nicholas Agouras"})," \u2014 CTO & Head of AI & Software Development",(0,nn.jsx)("br",{}),(0,nn.jsx)("a",{href:"mailto:[email protected]",className:"text-apn-blue hover:underline",children:"[email protected]"}),(0,nn.jsx)("br",{}),"(203) 460-2492"]})]})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("h3",{className:"text-xl font-semibold text-gray-900 mb-2",children:"Connect With Us"}),(0,nn.jsxs)("div",{className:"flex space-x-4",children:[(0,nn.jsx)("a",{href:"https://www.linkedin.com/company/accelerated-professionals-network/",target:"_blank",rel:"noopener noreferrer",className:"text-gray-600 hover:text-apn-blue transition-colors",children:(0,nn.jsx)("svg",{className:"h-6 w-6",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,nn.jsx)("path",{d:"M19 0h-14c-2.761 0-5 2.239-5 5v14c0 2.761 2.239 5 5 5h14c2.762 0 5-2.239 5-5v-14c0-2.761-2.238-5-5-5zm-11 19h-3v-11h3v11zm-1.5-12.268c-.966 0-1.75-.79-1.75-1.764s.784-1.764 1.75-1.764 1.75.79 1.75 1.764-.783 1.764-1.75 1.764zm13.5 12.268h-3v-5.604c0-3.368-4-3.113-4 0v5.604h-3v-11h3v1.765c1.396-2.586 7-2.777 7 2.476v6.759z"})})}),(0,nn.jsx)("a",{href:"https://www.instagram.com/the_apn_/",target:"_blank",rel:"noopener noreferrer",className:"text-gray-600 hover:text-apn-blue transition-colors",children:(0,nn.jsx)("svg",{className:"h-6 w-6",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,nn.jsx)("path",{fillRule:"evenodd",d:"M12.315 2c2.43 0 2.784.013 3.808.06 1.064.049 1.791.218 2.427.465a4.902 4.902 0 011.772 1.153 4.902 4.902 0 011.153 1.772c.247.636.416 1.363.465 2.427.048 1.067.06 1.407.06 4.123v.08c0 2.643-.012 2.987-.06 4.043-.049 1.064-.218 1.791-.465 2.427a4.902 4.902 0 01-1.153 1.772 4.902 4.902 0 01-1.772 1.153c-.636.247-1.363.416-2.427.465-1.067.048-1.407.06-4.123.06h-.08c-2.643 0-2.987-.012-4.043-.06-1.064-.049-1.791-.218-2.427-.465a4.902 4.902 0 01-1.772-1.153 4.902 4.902 0 01-1.153-1.772c-.247-.636-.416-1.363-.465-2.427-.047-1.024-.06-1.379-.06-3.808v-.63c0-2.43.013-2.784.06-3.808.049-1.064.218-1.791.465-2.427a4.902 4.902 0 011.153-1.772A4.902 4.902 0 015.45 2.525c.636-.247 1.363-.416 2.427-.465C8.901 2.013 9.256 2 11.685 2h.63zm-.081 1.802h-.468c-2.456 0-2.784.011-3.807.058-.975.045-1.504.207-1.857.344-.467.182-.8.398-1.15.748-.35.35-.566.683-.748 1.15-.137.353-.3.882-.344 1.857-.047 1.023-.058 1.351-.058 3.807v.468c0 2.456.011 2.784.058 3.807.045.975.207 1.504.344 1.857.182.466.399.8.748 1.15.35.35.683.566 1.15.748.353.137.882.3 1.857.344 1.054.048 1.37.058 4.041.058h.08c2.597 0 2.917-.01 3.96-.058.976-.045 1.505-.207 1.858-.344.466-.182.8-.398 1.15-.748.35-.35.566-.683.748-1.15.137-.353.3-.882.344-1.857.048-1.055.058-1.37.058-4.041v-.08c0-2.597-.01-2.917-.058-3.96-.045-.976-.207-1.505-.344-1.858a3.097 3.097 0 00-.748-1.15 3.098 3.098 0 00-1.15-.748c-.353-.137-.882-.3-1.857-.344-1.023-.047-1.351-.058-3.807-.058zM12 6.865a5.135 5.135 0 110 10.27 5.135 5.135 0 010-10.27zm0 1.802a3.333 3.333 0 100 6.666 3.333 3.333 0 000-6.666zm5.338-3.205a1.2 1.2 0 110 2.4 1.2 1.2 0 010-2.4z",clipRule:"evenodd"})})})]})]})]})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("h2",{className:"text-2xl font-bold text-gray-900 mb-6",children:"Send Us a Message"}),l?(0,nn.jsx)("div",{className:"bg-green-100 border border-green-400 text-green-700 px-4 py-3 rounded mb-6",children:(0,nn.jsx)("p",{children:"Thank you for your message! We'll get back to you as soon as possible."})}):null,(0,nn.jsxs)("form",{onSubmit:async e=>{e.preventDefault();try{await(0,vt.addDoc)((0,vt.collection)(yt.db,"contactRequests"),(0,s.A)((0,s.A)({},i),{},{status:"new",createdAt:(0,vt.serverTimestamp)()}))}catch(t){return console.error("Error submitting contact form:",t),void alert("Sorry \u2014 something went wrong sending your message. Please email us directly at [email protected].")}c(!0),o({name:"",email:"",phone:"",businessName:"",businessType:"",tierInterest:"",subject:"",message:""})},className:"space-y-5",children:[(0,nn.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-5",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"name",className:"block text-sm font-medium text-gray-700 mb-1",children:"Your Name *"}),(0,nn.jsx)("input",{type:"text",id:"name",name:"name",value:i.name,onChange:d,required:!0,className:"w-full px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue"})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"businessName",className:"block text-sm font-medium text-gray-700 mb-1",children:"Business N
2ame *"}),(0,nn.jsx)("input",{type:"text",id:"businessName",name:"businessName",value:i.businessName,onChange:d,required:!0,className:"w-full px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue"})]})]}),(0,nn.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-5",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"email",className:"block text-sm font-medium text-gray-700 mb-1",children:"Your Email *"}),(0,nn.jsx)("input",{type:"email",id:"email",name:"email",value:i.email,onChange:d,required:!0,className:"w-full px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue"})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"phone",className:"block text-sm font-medium text-gray-700 mb-1",children:"Phone Number *"}),(0,nn.jsx)("input",{type:"tel",id:"phone",name:"phone",value:i.phone,onChange:d,required:!0,placeholder:"(203) 555-1234",className:"w-full px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue"})]})]}),(0,nn.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-5",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"businessType",className:"block text-sm font-medium text-gray-700 mb-1",children:"Business Type"}),(0,nn.jsxs)("select",{id:"businessType",name:"businessType",value:i.businessType,onChange:d,className:"w-full px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue bg-white",children:[(0,nn.jsx)("option",{value:"",children:"Select your industry..."}),yi.map(e=>(0,nn.jsx)("option",{value:e,children:e},e))]})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"tierInterest",className:"block text-sm font-medium text-gray-700 mb-1",children:"Tier Interest"}),(0,nn.jsxs)("select",{id:"tierInterest",name:"tierInterest",value:i.tierInterest,onChange:d,className:"w-full px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue bg-white",children:[(0,nn.jsx)("option",{value:"",children:"Not sure yet"}),(0,nn.jsx)("option",{value:"starter",children:"Starter \u2014 $749 + $79/mo"}),(0,nn.jsx)("option",{value:"professional",children:"Professional \u2014 $1,250 + $199/mo"}),(0,nn.jsx)("option",{value:"premium",children:"Premium \u2014 $1,997 + $399/mo"}),(0,nn.jsx)("option",{value:"enterprise",children:"Enterprise \u2014 Custom pricing"})]})]})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"subject",className:"block text-sm font-medium text-gray-700 mb-1",children:"Subject"}),(0,nn.jsx)("input",{type:"text",id:"subject",name:"subject",value:i.subject,onChange:d,className:"w-full px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue"})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"message",className:"block text-sm font-medium text-gray-700 mb-1",children:"Your Message"}),(0,nn.jsx)("textarea",{id:"message",name:"message",value:i.message,onChange:d,rows:"5",className:"w-full px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue"})]}),(0,nn.jsx)("button",{type:"submit",className:"w-full bg-apn-blue text-white py-3 px-4 rounded-md hover:bg-apn-dark-blue transition duration-200 font-semibold",children:"Send Message"})]})]})]})})}),(0,nn.jsx)("section",{className:"bg-apn-blue text-white py-12",children:(0,nn.jsxs)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 text-center",children:[(0,nn.jsx)("div",{className:"flex justify-center mb-6",children:(0,nn.jsx)("img",{src:"".concat("","/apn-logos/APN-Tag-SQ-white.jpg"),alt:"APN Logo Square",className:"h-20"})}),(0,nn.jsx)("h2",{className:"text-3xl font-bold mb-4",children:"Ready to Join the Network?"}),(0,nn.jsx)("p",{className:"text-xl mb-8 max-w-3xl mx-auto",children:"Connect with finance professionals, access exclusive resources, and accelerate your career with APN."}),(0,nn.jsx)(dt,{to:"/register",className:"btn-primary bg-white text-apn-blue hover:bg-gray-100",children:"Become a Member Today"})]})})]})};var wi=n(705),ji=n(366),Ni=n.n(ji),ki=n(740),Ai=n.n(ki),Si=n(324),Ei=n.n(Si);const Ci=["children"],Ti=["children"];var Pi,_i,Ii=(e=>(e.BASE="base",e.BODY="body",e.HEAD="head",e.HTML="html",e.LINK="link",e.META="meta",e.NOSCRIPT="noscript",e.SCRIPT="script",e.STYLE="style",e.TITLE="title",e.FRAGMENT="Symbol(react.fragment)",e))(Ii||{}),Di={rel:["amphtml","canonical","alternate"]},Ri={type:["application/ld+json"]}
2,Li={charset:"",name:["generator","robots","description"],property:["og:type","og:title","og:url","og:image","og:image:alt","og:description","twitter:url","twitter:title","twitter:description","twitter:image","twitter:image:alt","twitter:card","twitter:site"]},Mi=Object.values(Ii),Oi={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},Fi=Object.entries(Oi).reduce((e,t)=>{let[n,r]=t;return e[r]=n,e},{}),Ui="data-rh",Bi="defaultTitle",zi="defer",Vi="encodeSpecialCharacters",qi="onChangeClientState",Wi="titleTemplate",Hi="prioritizeSeoTags",Gi=(e,t)=>{for(let n=e.length-1;n>=0;n-=1){const r=e[n];if(Object.prototype.hasOwnProperty.call(r,t))return r[t]}return null},Yi=e=>{let t=Gi(e,"title");const n=Gi(e,Wi);if(Array.isArray(t)&&(t=t.join("")),n&&t)return n.replace(/%s/g,()=>t);const r=Gi(e,Bi);return t||r||void 0},Ki=e=>Gi(e,qi)||(()=>{}),Ji=(e,t)=>t.filter(t=>"undefined"!==typeof t[e]).map(t=>t[e]).reduce((e,t)=>(0,s.A)((0,s.A)({},e),t),{}),$i=(e,t)=>t.filter(e=>"undefined"!==typeof e.base).map(e=>e.base).reverse().reduce((t,n)=>{if(!t.length){const r=Object.keys(n);for(let s=0;s<r.length;s+=1){const a=r[s].toLowerCase();if(-1!==e.indexOf(a)&&n[a])return t.concat(n)}}return t},[]),Qi=(e,t,n)=>{const r={};return n.filter(t=>{return!!Array.isArray(t[e])||("undefined"!==typeof t[e]&&(n="Helmet: ".concat(e,' should be of type "Array". Instead found type "').concat(typeof t[e],'"'),console&&"function"===typeof console.warn&&console.warn(n)),!1);var n}).map(t=>t[e]).reverse().reduce((e,n)=>{const a={};n.filter(e=>{let n;const s=Object.keys(e);for(let r=0;r<s.length;r+=1){const a=s[r],i=a.toLowerCase();-1===t.indexOf(i)||"rel"===n&&"canonical"===e[n].toLowerCase()||"rel"===i&&"stylesheet"===e[i].toLowerCase()||(n=i),-1===t.indexOf(a)||"innerHTML"!==a&&"cssText"!==a&&"itemprop"!==a||(n=a)}if(!n||!e[n])return!1;const i=e[n].toLowerCase();return r[n]||(r[n]={}),a[n]||(a[n]={}),!r[n][i]&&(a[n][i]=!0,!0)}).reverse().forEach(t=>e.push(t));const i=Object.keys(a);for(let t=0;t<i.length;t+=1){const e=i[t],n=(0,s.A)((0,s.A)({},r[e]),a[e]);r[e]=n}return e},[]).reverse()},Xi=(e,t)=>{if(Array.isArray(e)&&e.length)for(let n=0;n<e.length;n+=1){if(e[n][t])return!0}return!1},Zi=e=>Array.isArray(e)?e.join(""):e,eo=(e,t)=>Array.isArray(e)?e.reduce((e,n)=>(((e,t)=>{const n=Object.keys(e);for(let r=0;r<n.length;r+=1)if(t[n[r]]&&t[n[r]].includes(e[n[r]]))return!0;return!1})(n,t)?e.priority.push(n):e.default.push(n),e),{priority:[],default:[]}):{default:e,priority:[]},to=(e,t)=>(0,s.A)((0,s.A)({},e),{},{[t]:void 0}),no=["noscript","script","style"],ro=function(e){return!1===(!(arguments.length>1&&void 0!==arguments[1])||arguments[1])?String(e):String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")},so=e=>Object.keys(e).reduce((t,n)=>{const r="undefined"!==typeof e[n]?"".concat(n,'="').concat(e[n],'"'):"".concat(n);return t?"".concat(t," ").concat(r):r},""),ao=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object.keys(e).reduce((t,n)=>(t[Oi[n]||n]=e[n],t),t)},io=(t,n)=>n.map((n,r)=>{const s={key:r,[Ui]:!0};return Object.keys(n).forEach(e=>{const t=Oi[e]||e;if("innerHTML"===t||"cssText"===t){const e=n.innerHTML||n.cssText;s.dangerouslySetInnerHTML={__html:e}}else s[t]=n[e]}),e.createElement(t,s)}),oo=function(t,n){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];switch(t){case"title":return{toComponent:()=>((t,n,r)=>{const s=ao(r,{key:n,[Ui]:!0});return[e.createElement("title",s,n)]})(0,n.title,n.titleAttributes),toString:()=>((e,t,n,r)=>{const s=so(n),a=Zi(t);return s?"<".concat(e," ").concat(Ui,'="true" ').concat(s,">").concat(ro(a,r),"</").concat(e,">"):"<".concat(e," ").concat(Ui,'="true">').concat(ro(a,r),"</").concat(e,">")})(t,n.title,n.titleAttributes,r)};case"bodyAttributes":case"htmlAttributes":return{toComponent:()=>ao(n),toString:()=>so(n)};default:return{toComponent:()=>io(t,n),toString:()=>function(e,t){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return t.reduce((t,r)=>{const s=r,a=Object.keys(s).filter(e=>!("innerHTML"===e||"cssText"===e)).reduce((e,t)=>
2{const r="undefined"===typeof s[t]?t:"".concat(t,'="').concat(ro(s[t],n),'"');return e?"".concat(e," ").concat(r):r},""),i=s.innerHTML||s.cssText||"",o=-1===no.indexOf(e);return"".concat(t,"<").concat(e," ").concat(Ui,'="true" ').concat(a).concat(o?"/>":">".concat(i,"</").concat(e,">"))},"")}(t,n,r)}}},lo=e=>{const{baseTag:t,bodyAttributes:n,encode:r=!0,htmlAttributes:s,noscriptTags:a,styleTags:i,title:o="",titleAttributes:l,prioritizeSeoTags:c}=e;let{linkTags:d,metaTags:u,scriptTags:m}=e,h={toComponent:()=>{},toString:()=>""};return c&&({priorityMethods:h,linkTags:d,metaTags:u,scriptTags:m}=(e=>{let{metaTags:t,linkTags:n,scriptTags:r,encode:s}=e;const a=eo(t,Li),i=eo(n,Di),o=eo(r,Ri);return{priorityMethods:{toComponent:()=>[...io("meta",a.priority),...io("link",i.priority),...io("script",o.priority)],toString:()=>"".concat(oo("meta",a.priority,s)," ").concat(oo("link",i.priority,s)," ").concat(oo("script",o.priority,s))},metaTags:a.default,linkTags:i.default,scriptTags:o.default}})(e)),{priority:h,base:oo("base",t,r),bodyAttributes:oo("bodyAttributes",n,r),htmlAttributes:oo("htmlAttributes",s,r),link:oo("link",d,r),meta:oo("meta",u,r),noscript:oo("noscript",a,r),script:oo("script",m,r),style:oo("style",i,r),title:oo("title",{title:o,titleAttributes:l},r)}},co=[],uo=!("undefined"===typeof window||!window.document||!window.document.createElement),mo=class{constructor(e,t){(0,wi.A)(this,"instances",[]),(0,wi.A)(this,"canUseDOM",uo),(0,wi.A)(this,"context",void 0),(0,wi.A)(this,"value",{setHelmet:e=>{this.context.helmet=e},helmetInstances:{get:()=>this.canUseDOM?co:this.instances,add:e=>{(this.canUseDOM?co:this.instances).push(e)},remove:e=>{const t=(this.canUseDOM?co:this.instances).indexOf(e);(this.canUseDOM?co:this.instances).splice(t,1)}}}),this.context=e,this.canUseDOM=t||!1,t||(e.helmet=lo({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}}))}},ho=e.createContext({}),po=(Pi=class t extends e.Component{constructor(e){super(e),(0,wi.A)(this,"helmetData",void 0),this.helmetData=new mo(this.props.context||{},t.canUseDOM)}render(){return e.createElement(ho.Provider,{value:this.helmetData.value},this.props.children)}},(0,wi.A)(Pi,"canUseDOM",uo),Pi),go=(e,t)=>{const n=document.head||document.querySelector("head"),r=n.querySelectorAll("".concat(e,"[").concat(Ui,"]")),s=[].slice.call(r),a=[];let i;return t&&t.length&&t.forEach(t=>{const n=document.createElement(e);for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e))if("innerHTML"===e)n.innerHTML=t.innerHTML;else if("cssText"===e)n.styleSheet?n.styleSheet.cssText=t.cssText:n.appendChild(document.createTextNode(t.cssText));else{const r=e,s="undefined"===typeof t[r]?"":t[r];n.setAttribute(e,s)}n.setAttribute(Ui,"true"),s.some((e,t)=>(i=t,n.isEqualNode(e)))?s.splice(i,1):a.push(n)}),s.forEach(e=>{var t;return null===(t=e.parentNode)||void 0===t?void 0:t.removeChild(e)}),a.forEach(e=>n.appendChild(e)),{oldTags:s,newTags:a}},fo=(e,t)=>{const n=document.getElementsByTagName(e)[0];if(!n)return;const r=n.getAttribute(Ui),s=r?r.split(","):[],a=[...s],i=Object.keys(t);for(const o of i){const e=t[o]||"";n.getAttribute(o)!==e&&n.setAttribute(o,e),-1===s.indexOf(o)&&s.push(o);const r=a.indexOf(o);-1!==r&&a.splice(r,1)}for(let o=a.length-1;o>=0;o-=1)n.removeAttribute(a[o]);s.length===a.length?n.removeAttribute(Ui):n.getAttribute(Ui)!==i.join(",")&&n.setAttribute(Ui,i.join(","))},xo=(e,t)=>{const{baseTag:n,bodyAttributes:r,htmlAttributes:s,linkTags:a,metaTags:i,noscriptTags:o,onChangeClientState:l,scriptTags:c,styleTags:d,title:u,titleAttributes:m}=e;fo("body",r),fo("html",s),((e,t)=>{"undefined"!==typeof e&&document.title!==e&&(document.title=Zi(e)),fo("title",t)})(u,m);const h={baseTag:go("base",n),linkTags:go("link",a),metaTags:go("meta",i),noscriptTags:go("noscript",o),scriptTags:go("script",c),styleTags:go("style",d)},p={},g={};Object.keys(h).forEach(e=>{const{newTags:t,oldTags:n}=h[e];t.length&&(p[e]=t),n.length&&(g[e]=h[e].oldTags)}),t&&t(),l(e,p,g)},bo=null,yo=e=>{bo&&cancelAnimationFrame(bo),e.defer?bo=requestAnimationFrame(()=>{xo(e,()=>{bo=null})}):(xo(e),bo=null)},vo=class extends e.Component{constructor(){super(...arguments),(0,wi.A)(this,"rendered",!1)}shouldComponentUpdate(e){return!Ei()(e,this.props)}componentDidUpdate(){this.emitChange()}componentWillUnmount(){const{helmetInstances:e}=this.props.context;e.remove(this),this.emitChange()}emitChange(){const{helmetInstances:e,setHelmet:t}=this.props.context;let n=null;const r=(a=e.get().map(e=>{const t=(0,s.A)({},e.props);return delete t.context,t}),{baseTag:$i(["href"],a),bodyAttributes:Ji("bodyAttributes",a),defer:Gi(a,zi),encode:Gi(a,Vi),htmlAttributes:Ji("htmlAttributes",a),linkTags:Qi("link",["rel","href"],a),metaTags:Qi("meta",["name","charset","http-equiv","property","itemprop"],a),noscriptTags:Qi("noscript",["innerHTML"],a),onChangeClientState:Ki(a),scriptTags:Qi("script",["src","innerHTML"],a),styleTags:Qi("style",["cssText"],a),title:Yi(a),titleAttributes:Ji("titleAttributes",a),prioritizeSeoTags:Xi(a,Hi)});var a;
2po.canUseDOM?yo(r):lo&&(n=lo(r)),t(n)}init(){if(this.rendered)return;this.rendered=!0;const{helmetInstances:e}=this.props.context;e.add(this),this.emitChange()}render(){return this.init(),null}},wo=(_i=class extends e.Component{shouldComponentUpdate(e){return!Ni()(to(this.props,"helmetData"),to(e,"helmetData"))}mapNestedChildrenToProps(e,t){if(!t)return null;switch(e.type){case"script":case"noscript":return{innerHTML:t};case"style":return{cssText:t};default:throw new Error("<".concat(e.type," /> elements are self-closing and can not contain children. Refer to our API for more information."))}}flattenArrayTypeChildren(e,t,n,r){return(0,s.A)((0,s.A)({},t),{},{[e.type]:[...t[e.type]||[],(0,s.A)((0,s.A)({},n),this.mapNestedChildrenToProps(e,r))]})}mapObjectTypeChildren(e,t,n,r){switch(e.type){case"title":return(0,s.A)((0,s.A)({},t),{},{[e.type]:r,titleAttributes:(0,s.A)({},n)});case"body":return(0,s.A)((0,s.A)({},t),{},{bodyAttributes:(0,s.A)({},n)});case"html":return(0,s.A)((0,s.A)({},t),{},{htmlAttributes:(0,s.A)({},n)});default:return(0,s.A)((0,s.A)({},t),{},{[e.type]:(0,s.A)({},n)})}}mapArrayTypeChildrenToProps(e,t){let n=(0,s.A)({},t);return Object.keys(e).forEach(t=>{n=(0,s.A)((0,s.A)({},n),{},{[t]:e[t]})}),n}warnOnInvalidChildren(e,t){return Ai()(Mi.some(t=>e.type===t),"function"===typeof e.type?"You may be attempting to nest <Helmet> components within each other, which is not allowed. Refer to our API for more information.":"Only elements types ".concat(Mi.join(", ")," are allowed. Helmet does not support rendering <").concat(e.type,"> elements. Refer to our API for more information.")),Ai()(!t||"string"===typeof t||Array.isArray(t)&&!t.some(e=>"string"!==typeof e),"Helmet expects a string as a child of <".concat(e.type,">. Did you forget to wrap your children in braces? ( <").concat(e.type,">{``}</").concat(e.type,"> ) Refer to our API for more information.")),!0}mapChildrenToProps(t,n){let s={};return e.Children.forEach(t,e=>{if(!e||!e.props)return;const t=e.props,{children:a}=t,i=(0,r.A)(t,Ci),o=Object.keys(i).reduce((e,t)=>(e[Fi[t]||t]=i[t],e),{});let{type:l}=e;
2switch("symbol"===typeof l?l=l.toString():this.warnOnInvalidChildren(e,a),l){case"Symbol(react.fragment)":n=this.mapChildrenToProps(a,n);break;case"link":case"meta":case"noscript":case"script":case"style":s=this.flattenArrayTypeChildren(e,s,o,a);break;default:n=this.mapObjectTypeChildren(e,n,o,a)}}),this.mapArrayTypeChildrenToProps(s,n)}render(){const t=this.props,{children:n}=t,a=(0,r.A)(t,Ti);let i=(0,s.A)({},a),{helmetData:o}=a;if(n&&(i=this.mapChildrenToProps(n,i)),o&&!(o instanceof mo)){o=new mo(o.context,!0),delete i.helmetData}return o?e.createElement(vo,(0,s.A)((0,s.A)({},i),{},{context:o.value})):e.createElement(ho.Consumer,null,t=>e.createElement(vo,(0,s.A)((0,s.A)({},i),{},{context:t})))}},(0,wi.A)(_i,"defaultProps",{defer:!0,encodeSpecialCharacters:!0,prioritizeSeoTags:!1}),_i);const jo=()=>(Ln({title:"Accelerated Professionals | The APN Network | Join Elite Professionals",description:"Join accelerated professionals at The APN - the premier network for accelerated professionals seeking career growth. Connect with accelerated professionals worldwide in finance, consulting, and business.",keywords:["accelerated professionals","accelerated professional network","accelerated professionals network","accelerated career professionals","elite accelerated professionals","accelerated business professionals","accelerated finance professionals","accelerated consulting professionals","the apn accelerated professionals","join accelerated professionals","accelerated professionals community","accelerated professionals platform"],structuredData:{"@context":"https://schema.org","@type":"WebPage",name:"Accelerated Professionals Network",description:"The premier network for accelerated professionals seeking career advancement and professional growth.",url:"https://the-apn.web.app/accelerated-professionals",mainEntity:{"@type":"Organization",name:"The APN - Accelerated Professionals Network",description:"Connecting accelerated professionals worldwide for career growth and networking opportunities."}}}),(0,nn.jsxs)(nn.Fragment,{children:[(0,nn.jsxs)(wo,{children:[(0,nn.jsx)("title",{children:"Accelerated Professionals | The APN Network | Join Elite Professionals"}),(0,nn.jsx)("meta",{name:"description",content:"Join accelerated professionals at The APN - the premier network for accelerated professionals seeking career growth. Connect with accelerated professionals worldwide in finance, consulting, and business."}),(0,nn.jsx)("meta",{name:"keywords",content:"accelerated professionals, accelerated professional network, accelerated professionals network, elite professionals, career acceleration"}),(0,nn.jsx)("link",{rel:"canonical",href:"https://the-apn.web.app/accelerated-professionals"})]}),(0,nn.jsxs)("div",{className:"min-h-screen bg-gradient-to-br from-blue-50 to-white",children:[(0,nn.jsx)("section",{className:"relative py-20 px-4 sm:px-6 lg:px-8",children:(0,nn.jsxs)("div",{className:"max-w-7xl mx-auto text-center",children:[(0,nn.jsxs)("h1",{className:"text-5xl md:text-6xl font-bold text-gray-900 mb-6",children:[(0,nn.jsx)("span",{className:"text-blue-600",children:"Accelerated Professionals"}),(0,nn.jsx)("br",{}),"Network"]}),(0,nn.jsxs)("p",{className:"text-xl md:text-2xl text-gray-600 mb-8 max-w-4xl mx-auto",children:["Join the premier network of ",(0,nn.jsx)("strong",{children:"accelerated professionals"})," who are transforming their careers and achieving extraordinary success. Connect with ",(0,nn.jsx)("strong",{children:"accelerated professionals"})," worldwide."]}),(0,nn.jsxs)("div",{className:"flex flex-col sm:flex-row gap-4 justify-center",children:[(0,nn.jsx)(dt,{to:"/register",className:"bg-blue-600 text-white px-8 py-4 rounded-lg text-lg font-semibold hover:bg-blue-700 transition-colors",children:"Join Accelerated Professionals"}),(0,nn.jsx)(dt,{to:"/about/our-story",className:"border-2 border-blue-600 text-blue-600 px-8 py-4 rounded-lg text-lg font-semibold hover:bg-blue-50 transition-colors",children:"Learn About The APN"})]})]})}),(0,nn.jsx)("section",{className:"py-16 px-4 sm:px-6 lg:px-8 bg-white",children:(0,nn.jsxs)("div",{className:"max-w-6xl mx-auto",children:[(0,nn.jsxs)("h2",{className:"text-4xl font-bold text-center text-gray-900 mb-12",children:["What Makes ",(0,nn.jsx)("span",{className:"text-blue-600",children:"Accelerated Professionals"})," Different?"]}),(0,nn.jsxs)("div",{className:"grid md:grid-cols-3 gap-8",children:[(0,nn.jsxs)("div",{className:"text-center p-6",children:[(0,nn.jsx)("div",{className:"w-16 h-16 bg-blue-100 rounded-full flex items-center justify-center mx-auto mb-4",children:(0,nn.jsx)("svg",{className:"w-8 h-8 text-blue-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 10V3L4 14h7v7l9-11h-7z"})})}),(0,nn.jsx)("h3",{className:"text-xl font-semibold mb-3",children:"Rapid Career Growth"}),(0,nn.jsxs)("p",{className:"text-gray-600",children:[(0,nn.jsx)("strong",{children:"Accelerated professionals"})," leverage strategic networking and exclusive opportunities to fast-track their career advancement."]})]}),(0,nn.jsxs)("div",{className:"text-center p-6",children:[(0,nn.jsx)("div",{className:"w-16 h-16 bg-blue-100 rounded-full flex items-center justify-center mx-auto mb-4",children:(0,nn.jsx)("svg",{className:"w-8 h-8 text-blue-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2
20 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z"})})}),(0,nn.jsx)("h3",{className:"text-xl font-semibold mb-3",children:"Elite Network Access"}),(0,nn.jsxs)("p",{className:"text-gray-600",children:["Connect with other ",(0,nn.jsx)("strong",{children:"accelerated professionals"})," in finance, consulting, and business leadership roles."]})]}),(0,nn.jsxs)("div",{className:"text-center p-6",children:[(0,nn.jsx)("div",{className:"w-16 h-16 bg-blue-100 rounded-full flex items-center justify-center mx-auto mb-4",children:(0,nn.jsx)("svg",{className:"w-8 h-8 text-blue-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})})}),(0,nn.jsx)("h3",{className:"text-xl font-semibold mb-3",children:"Proven Success"}),(0,nn.jsxs)("p",{className:"text-gray-600",children:["Join thousands of ",(0,nn.jsx)("strong",{children:"accelerated professionals"})," who have achieved remarkable career milestones through The APN."]})]})]})]})}),(0,nn.jsx)("section",{className:"py-16 px-4 sm:px-6 lg:px-8 bg-gray-50",children:(0,nn.jsxs)("div",{className:"max-w-6xl mx-auto",children:[(0,nn.jsxs)("h2",{className:"text-4xl font-bold text-center text-gray-900 mb-12",children:[(0,nn.jsx)("span",{className:"text-blue-600",children:"Accelerated Professionals"})," Success Stories"]}),(0,nn.jsxs)("div",{className:"grid md:grid-cols-2 gap-8",children:[(0,nn.jsxs)("div",{className:"bg-white p-8 rounded-lg shadow-lg",children:[(0,nn.jsxs)("p",{className:"text-gray-600 mb-4 italic",children:['"Joining The APN transformed my career trajectory. As an ',(0,nn.jsx)("strong",{children:"accelerated professional"}),', I connected with industry leaders and landed my dream role in investment banking."']}),(0,nn.jsxs)("div",{className:"flex items-center",children:[(0,nn.jsx)("div",{className:"w-12 h-12 bg-blue-100 rounded-full flex items-center justify-center mr-4",children:(0,nn.jsx)("span",{className:"text-blue-600 font-semibold",children:"JS"})}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("h4",{className:"font-semibold",children:"John Smith"}),(0,nn.jsx)("p",{className:"text-gray-500",children:"VP, Goldman Sachs"})]})]})]}),(0,nn.jsxs)("div",{className:"bg-white p-8 rounded-lg shadow-lg",children:[(0,nn.jsxs)("p",{className:"text-gray-600 mb-4 italic",children:["\"The APN's network of ",(0,nn.jsx)("strong",{children:"accelerated professionals"}),' opened doors I never knew existed. The quality of connections and opportunities is unmatched."']}),(0,nn.jsxs)("div",{className:"flex items-center",children:[(0,nn.jsx)("div",{className:"w-12 h-12 bg-blue-100 rounded-full flex items-center justify-center mr-4",children:(0,nn.jsx)("span",{className:"text-blue-600 font-semibold",children:"MJ"})}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("h4",{className:"font-semibold",children:"Maria Johnson"}),(0,nn.jsx)("p",{className:"text-gray-500",children:"Partner, McKinsey & Company"})]})]})]})]})]})}),(0,nn.jsx)("section",{className:"py-16 px-4 sm:px-6 lg:px-8 bg-blue-600",children:(0,nn.jsxs)("div",{className:"max-w-4xl mx-auto text-center",children:[(0,nn.jsxs)("h2",{className:"text-4xl font-bold text-white mb-6",children:["Ready to Become an ",(0,nn.jsx)("span",{className:"text-blue-200",children:"Accelerated Professional"}),"?"]}),(0,nn.jsxs)("p",{className:"text-xl text-blue-100 mb-8",children:["Join thousands of ",(0,nn.jsx)("strong",{children:"accelerated professionals"})," who are advancing their careers through The APN's exclusive network and opportunities."]}),(0,nn.jsx)(dt,{to:"/register",className:"bg-white text-blue-600 px-8 py-4 rounded-lg text-lg font-semibold hover:bg-gray-100 transition-colors inline-block",children:"Join The Accelerated Professionals Network"})]})}),(0,nn.jsx)("section",{className:"py-12 px-4 sm:px-6 lg:px-8 bg-gray-900 text-white",children:(0,nn.jsxs)("div",{className:"max-w-6xl mx-auto",children:[(0,nn.jsxs)("h3",{className:"text-2xl font-bold mb-6 text-center",children:["The Premier ",(0,nn.jsx)("span",{className:"text-blue-400",children:"Accelerated Professionals"})," Network"]}),(0,nn.jsxs)("div",{className:"grid md:grid-cols-3 gap-8 text-sm",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("h4",{className:"font-semibold mb-3",children:"For Accelerated Professionals"}),(0,nn.jsxs)("ul",{className:"space-y-2 text-gray-300",children:[(0,nn.jsx)("li",{children:"\u2022 Connect with accelerated professionals worldwide"}),(0,nn.jsx)("li",{children:"\u2022 Access exclusive career opportunities"}),(0,nn.jsx)("li",{children:"\u2022 Join accelerated professionals events"}),(0,nn.jsx)("li",{children:"\u2022 Build your accelerated professional brand"})]})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("h4",{className:"font-semibold mb-3",children:"Accelerated Professional Benefits"}),(0,nn.jsxs)("ul",{className:"space-y-2 text-gray-300",children:[(0,nn.jsx)("li",{children:"\u2022 Accelerated career advancement"}),(0,nn.jsx)("li",{children:"\u2022 Elite accelerated professionals network"}),(0,nn.jsx)("li",{children:"\u2022 Accelerated professional development"}),(0,nn.jsx)("li",{children:"\u2022 Accelerated professionals mentorship"})]})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("h4",{className:"font-semibold mb-3",children:"Join Accelerated Professionals"}),(0,nn.jsxs)("ul",{className:"space-y-2 text-gray-300",children:[(0,nn.jsx)("li",{children:"\u2022 Apply for accelerated professionals membership"}),(0,nn.jsx)("li",{children:"\u2022 Meet other accelerated professionals"}),(0,nn.jsx)("li",{children:"\u2022 Accelerated professionals directory access"}),(0,nn.jsx)("li",{children:"\u2022 Accelerated professionals success support"})]})]})]})]})})]})]})),No=()=>(Ln({title:"Professional Network | The APN | #1 Professional Networking Platform",description:"Join the premier professional network - The APN. Connect with professionals worldwide through our exclusive professional network platform. The top choice for professional networking and career growth.",keywords:["professional network","professional networking","professional network platform","best professional network","top professional network","premier professional network","exclusive professional network","professional network community","professional network membership","professional network benefits","professional network events","professional network directory","finance professional network","business professional network"],structuredData:{"@context":"https://schema.org","@type":"WebPage",name:"Professional Network - The APN",description:"The premier professional network connecting professionals worldwide for career advancement and business growth.",url:"https://the-apn.web.app/professional-network",mainEntity:{"@type":"Organization",name:"The APN - Professional Network",description:"The leading professional network platform for career-focused professionals."}}}),(0,nn.jsxs)(nn.Fragment,{children:[(0,nn.jsxs)(wo,{children:[(0,nn.jsx)("title",{children:"Professional Network | The APN | #1 Professional Networking Platform"}),(0,nn.jsx)("meta",{name:"description",content:"Join the premier professional network - The APN. Connect with professionals worldwide through our exclusive professional network platform. The top choice for professional networking and career growth."}),(0,nn.jsx)("meta",{name:"keywords",content:"professional network, professional networking, professional network platform, best professional network, premier professional network"}),(0,nn.jsx)("link",{rel:"canonical",href:"https://the-apn.web.app/professional-network"})]}),(0,nn.jsxs)("div",{className:"min-h-screen bg-gradient-to-br from-blue-50 to-white",children:[(0,nn.jsx)("section",{className:"relative py-20 px-4 sm:px-6 lg:px-8",children:(0,nn.jsxs)("div",{className:"max-w-7xl mx-auto text-center",children:[(0,nn.jsxs)("h1",{className:"text-5xl md:text-6xl font-bold text-gray-900 mb-6",children:["The Premier",(0,nn.jsx)("br",{}),(0,nn.jsx)("span",{className:"text-blue-600",children:"Professional Network"})]}),(0,nn.jsxs)("p",{className:"text-xl md:text-2xl text-gray-600 mb-8 max-w-4xl mx-auto",children:["Join the world's leading ",(0,nn.jsx)("strong",{children:"professional network"})," connecting ambitious professionals across industries. Experience the power of a truly ",(0,nn.jsx)("strong",{children:"professional network"})," designed for success."]}),(0,nn.jsxs)("div",{className:"flex flex-col sm:flex-row gap-4 justify-center",children:[(0,nn.jsx)(dt,{to:"/register",className:"bg-blue-600 text-white px-8 py-4 rounded-lg text-lg font-semibold hover:bg-blue-700 transition-colors",children:"Join Our Professional Network"}),(0,nn.jsx)(dt,{to:"/directory",className:"border-2 border-blue-600 text-blue-600 px-8 py-4 rounded-lg text-lg font-semibold hover:bg-blue-50 transition-colors",children:"Explore Professional Network"})]})]})}),(0,nn.jsx)("section",{className:"py-16 px-4 sm:px-6 lg:px-8 bg-white",children:(0,nn.jsxs)("div",{className:"max-w-6xl mx-auto",children:[(0,nn.jsxs)("h2",{className:"text-4xl font-bold text-center text-gray-900 mb-12",children:["Why Choose The APN ",(0,nn.jsx)("span",{className:"text-blue-600",children:"Professional Network"}),"?"]}),(0,nn.jsxs)("div",{className:"grid md:grid-cols-3 gap-8",children:[(0,nn.jsxs)("div",{className:"text-center p-6",children:[(0,nn.jsx)("div",{className:"w-16 h-16 bg-blue-100 rounded-full flex items-center justify-center mx-auto mb-4",children:(0,nn.jsx)("svg",{className:"w-8 h-8 text-blue-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2
20 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z"})})}),(0,nn.jsx)("h3",{className:"text-xl font-semibold mb-3",children:"Exclusive Professional Network"}),(0,nn.jsxs)("p",{className:"text-gray-600",children:["Our ",(0,nn.jsx)("strong",{children:"professional network"})," is carefully curated to include only the most accomplished and ambitious professionals across industries."]})]}),(0,nn.jsxs)("div",{className:"text-center p-6",children:[(0,nn.jsx)("div",{className:"w-16 h-16 bg-blue-100 rounded-full flex items-center justify-center mx-auto mb-4",children:(0,nn.jsx)("svg",{className:"w-8 h-8 text-blue-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 13.255A23.931 23.931 0 0112 15c-3.183 0-6.22-.62-9-1.745M16 6V4a2 2 0 00-2-2h-4a2 2 0 00-2 2v2m4 6h.01M5 20h14a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})})}),(0,nn.jsx)("h3",{className:"text-xl font-semibold mb-3",children:"Career-Focused Networking"}),(0,nn.jsxs)("p",{className:"text-gray-600",children:["Unlike other ",(0,nn.jsx)("strong",{children:"professional networks"}),", we focus specifically on career advancement and meaningful professional connections."]})]}),(0,nn.jsxs)("div",{className:"text-center p-6",children:[(0,nn.jsx)("div",{className:"w-16 h-16 bg-blue-100 rounded-full flex items-center justify-center mx-auto mb-4",children:(0,nn.jsx)("svg",{className:"w-8 h-8 text-blue-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 10V3L4 14h7v7l9-11h-7z"})})}),(0,nn.jsx)("h3",{className:"text-xl font-semibold mb-3",children:"Accelerated Results"}),(0,nn.jsxs)("p",{className:"text-gray-600",children:["Members of our ",(0,nn.jsx)("strong",{children:"professional network"})," report faster career progression and better business outcomes than traditional networking."]})]})]})]})}),(0,nn.jsx)("section",{className:"py-16 px-4 sm:px-6 lg:px-8 bg-gray-50",children:(0,nn.jsxs)("div",{className:"max-w-6xl mx-auto",children:[(0,nn.jsxs)("h2",{className:"text-4xl font-bold text-center text-gray-900 mb-12",children:[(0,nn.jsx)("span",{className:"text-blue-600",children:"Professional Network"})," Features"]}),(0,nn.jsxs)("div",{className:"grid md:grid-cols-2 lg:grid-cols-4 gap-6",children:[(0,nn.jsxs)("div",{className:"bg-white p-6 rounded-lg shadow-lg text-center",children:[(0,nn.jsx)("h3",{className:"text-lg font-semibold mb-3",children:"Professional Network Directory"}),(0,nn.jsxs)("p",{className:"text-gray-600 text-sm",children:["Access our comprehensive ",(0,nn.jsx)("strong",{children:"professional network"})," directory with detailed member profiles."]})]}),(0,nn.jsxs)("div",{className:"bg-white p-6 rounded-lg shadow-lg text-center",children:[(0,nn.jsx)("h3",{className:"text-lg font-semibold mb-3",children:"Professional Network Events"}),(0,nn.jsxs)("p",{className:"text-gray-600 text-sm",children:["Attend exclusive ",(0,nn.jsx)("strong",{children:"professional network"})," events designed for meaningful connections."]})]}),(0,nn.jsxs)("div",{className:"bg-white p-6 rounded-lg shadow-lg text-center",children:[(0,nn.jsx)("h3",{className:"text-lg font-semibold mb-3",children:"Professional Network Jobs"}),(0,nn.jsxs)("p",{className:"text-gray-600 text-sm",children:["Access job opportunities shared within our ",(0,nn.jsx)("strong",{children:"professional network"})," community."]})]}),(0,nn.jsxs)("div",{className:"bg-white p-6 rounded-lg shadow-lg text-center",children:[(0,nn.jsx)("h3",{className:"text-lg font-semibold mb-3",children:"Professional Network Groups"}),(0,nn.jsxs)("p",{className:"text-gray-600 text-sm",children:["Join specialized groups within our ",(0,nn.jsx)("strong",{children:"professional network"})," based on your interests."]})]})]})]})}),(0,nn.jsx)("section",{className:"py-16 px-4 sm:px-6 lg:px-8 bg-white",children:(0,nn.jsxs)("div",{className:"max-w-6xl mx-auto text-center",children:[(0,nn.jsxs)("h2",{className:"text-4xl font-bold text-gray-900 mb-12",children:[(0,nn.jsx)("span",{className:"text-blue-600",children:"Professional Network"})," Success Metrics"]}),(0,nn.jsxs)("div",{className:"grid md:grid-cols-4 gap-8",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("div",{className:"text-4xl font-bold text-blue-600 mb-2",children:"10,000+"}),(0,nn.jsx)("p",{className:"text-gray-600",children:"Professionals in our network"})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("div",{className:"text-4xl font-bold text-blue-600 mb-2",children:"95%"}),(0,nn.jsx)("p",{className:"text-gray-600",children:"Professional network satisfaction rate"})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("div",{className:"text-4xl font-bold text-blue-600 mb-2",children:"500+"}),(0,nn.jsx)("p",{className:"text-gray-600",children:"Professional network events hosted"})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("div",{className:"text-4xl font-bold text-blue-600 mb-2",children:"85%"}),(0,nn.jsx)("p",{className:"text-gray-600",children:"Career advancement within 12 months"})]})]})]})}),(0,nn.jsx)("section",{className:"py-16 px-4 sm:px-6 lg:px-8 bg-blue-600",children:(0,nn.jsxs)("div",{className:"max-w-4xl mx-auto text-center",children:[(0,nn.jsxs)("h2",{className:"text-4xl font-bold text-white mb-6",children:["Join the Leading ",(0,nn.jsx)("span",{className:"text-blue-200",children:"Professional Network"})]}),(0,nn.jsxs)("p",{className:"text-xl text-blue-100 mb-8",children:["Experience the difference of a truly ",(0,nn.jsx)("strong",{children:"professional network"})," designed for ambitious professionals who want to accelerate their careers and build meaningful connections."]}),(0,nn.jsxs)("div",{className:"flex flex-col sm:flex-row gap-4 justify-center",children:[(0,nn.jsx)(dt,{to:"/register",className:"bg-white text-blue-600 px-8 py-4 rounded-lg text-lg font-semibold hover:bg-gray-100 transition-colors",children:"Join Professional Network"}),(0,nn.jsx)(dt,{to:"/about/membership",className:"border-2 border-white text-white px-8 py-4 rounded-lg text-lg font-semibold hover:bg-blue-700 transition-colors",children:"Professional Network Membership"})]})]})}),(0,nn.jsx)("section",{className:"py-12 px-4 sm:px-6 lg:px-8 bg-gray-900 text-white",children:(0,nn.jsxs)("div",{className:"max-w-6xl mx-auto",children:[(0,nn.jsxs)("h3",{className:"text-2xl font-bold mb-6 text-center",children:["The Ultimate ",(0,nn.jsx)("span",{className:"text-blue-400",children:"Professional Network"})," Experience"]}),(0,nn.jsxs)("div",{className:"grid md:grid-cols-3 gap-8 text-sm",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("h4",{className:"font-semibold mb-3",children:"Professional Network Benefits"}),(0,nn.jsxs)("ul",{className:"space-y-2 text-gray-300",children:[(0,nn.jsx)("li",{children:"\u2022 Access to exclusive professional network"}),(0,nn.jsx)("li",{children:"\u2022 Professional network directory access"}),(0,nn.jsx)("li",{children:"\u2022 Professional network events and meetups"}),(0,nn.jsx)("li",{children:"\u2022 Professional network job opportunities"})]})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("h4",{className:"font-semibold mb-3",children:"Professional Network Features"}),(0,nn.jsxs)("ul",{className:"space-y-2 text-gray-300",children:[(0,nn.jsx)("li",{children:"\u2022 Professional network messaging"}),(0,nn.jsx)("li",{children:"\u2022 Professional network groups"}),(0,nn.jsx)("li",{children:"\u2022 Professional network mentorship"}),(0,nn.jsx)("li",{children:"\u2022 Professional network resources"})]})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("h4",{className:"font-semibold mb-3",children:"Join Professional Network"}),(0,nn.jsxs)("ul",{className:"space-y-2 text-gray-300",children:[(0,nn.jsx)("li",{children:"\u2022 Professional network membership"}),(0,nn.jsx)("li",{children:"\u2022 Professional network community"}),(0,nn.jsx)("li",{children:"\u2022 Professional network support"}),(0,nn.jsx)("li",{children:"\u2022 Professional network success"})]})]})]})]})})]})]})),ko=()=>(0,nn.jsxs)(nn.Fragment,{children:[(0,nn.jsxs)(wo,{children:[(0,nn.jsx)("title",{children:"Terms and Conditions | The APN - Accelerated Professionals Network"}),(0,nn.jsx)("meta",{name:"description",content:"Terms and Conditions for The APN (Accelerated Professionals Network) membership and event participation."}),(0,nn.jsx)("meta",{name:"robots",content:"index, follow"})]}),(0,nn.jsx)("div",{className:"min-h-screen bg-gray-50 py-12",children:(0,nn.jsx)("div",{className:"max-w-4xl mx-auto px-4 sm:px-6 lg:px-8",children:(0,nn.jsxs)("div",{className:"bg-white shadow-lg rounded-lg p-8",children:[(0,nn.jsx)("h1",{className:"text-3xl font-bold text-gray-900 mb-8",children:"APN Membership Agreement and Policies"}),(0,nn.jsxs)("div",{className:"prose max-w-none",children:[(0,nn.jsx)("h2",{className:"text-2xl font-semibold text-gray-800 mb
2-4",children:"RECITALS AND DEFINITIONS"}),(0,nn.jsx)("p",{className:"mb-4",children:"WHEREAS, the Accelerated Professionals Network (APN) is a professional membership organization providing networking, educational, and professional development opportunities; WHEREAS, APN requires all members and participants to comply with its governing documents; NOW, THEREFORE, this Membership Policy Packet is adopted and binding upon all members and participants."}),(0,nn.jsxs)("p",{className:"mb-6",children:[(0,nn.jsx)("strong",{children:"APN"})," means the Accelerated Professionals Network. ",(0,nn.jsx)("strong",{children:"Member"})," means an individual accepted into membership. ",(0,nn.jsx)("strong",{children:"Events"})," means programs, conferences, activities, or functions organized, sponsored, or endorsed by APN. ",(0,nn.jsx)("strong",{children:"Officers and Agents"})," means directors, officers, employees, volunteers, representatives, successors, and assigns of APN."]}),(0,nn.jsx)("h2",{className:"text-2xl font-semibold text-gray-800 mb-4",children:"ARTICLE I - TERMS AND CONDITIONS"}),(0,nn.jsx)("h3",{className:"text-lg font-semibold text-gray-700 mb-2",children:"Membership and Eligibility"}),(0,nn.jsx)("p",{className:"mb-4",children:"Membership is open to individuals eighteen years of age or older who submit accurate applications. APN reserves discretion to approve, deny, suspend, or terminate membership."}),(0,nn.jsx)("h3",{className:"text-lg font-semibold text-gray-700 mb-2",children:"Dues and Payments"}),(0,nn.jsx)("p",{className:"mb-4",children:"Dues are set annually by APN. Payment of dues confers membership rights for the term. Dues are non-refundable."}),(0,nn.jsx)("h3",{className:"text-lg font-semibold text-gray-700 mb-2",children:"Conduct"}),(0,nn.jsx)("p",{className:"mb-4",children:"Members shall conduct themselves professionally and respectfully. Harassment, discrimination, abuse, or disruptive conduct is prohibited."}),(0,nn.jsx)("h3",{className:"text-lg font-semibold text-gray-700 mb-2",children:"Intellectual Property"}),(0,nn.jsx)("p",{className:"mb-4",children:"All APN logos, trademarks, publications, and content are property of APN. Unauthorized use is prohibited."}),(0,nn.jsx)("h3",{className:"text-lg font-semibold text-gray-700 mb-2",children:"Termination"}),(0,nn.jsx)("p",{className:"mb-4",children:"APN may terminate membership for violations of these Terms. Appeals must be submitted in writing."}),(0,nn.jsx)("h3",{className:"text-lg font-semibold text-gray-700 mb-2",children:"Indemnification"}),(0,nn.jsx)("p",{className:"mb-4",children:"Members shall indemnify, defend, and hold harmless APN and its Officers and Agents from all claims, liabilities, or expenses arising from membership or violations."}),(0,nn.jsx)("h3",{className:"text-lg font-semibold text-gray-700 mb-2",children:"Limitation of Liability"}),(0,nn.jsx)("p",{className:"mb-4",children:"APN and its Officers and Agents are not liable for indirect, incidental, or consequential damages. Liability is capped at dues paid in the twelve months preceding the claim."}),(0,nn.jsx)("h3",{className:"text-lg font-semibold text-gray-700 mb-2",children:"Waiver of Claims"}),(0,nn.jsx)("p",{className:"mb-4",children:"Members assume all risks associated with participation in APN activities, including illness, injury, communicable diseases, property loss, alcohol consumption, and negligence of third parties, and hereby waive and release all claims against APN and its Officers and Agents."}),(0,nn.jsx)("h3",{className:"text-lg font-semibold text-gray-700 mb-2",children:"Dispute Resolution"}),(0,nn.jsx)("p",{className:"mb-4",children:"Governed by New York law. Disputes shall be mediated in New York and, if unresolved, resolved by binding arbitration before the American Arbitration Association. Class actions are waived."}),(0,nn.jsx)("h3",{className:"text-lg font-semibold text-gray-700 mb-2",children:"Amendments"}),(0,nn.jsx)("p",{className:"mb-4",children:"APN may amend these Terms at any time by posting updated versions online."}),(0,nn.jsx)("h3",{className:"text-lg font-semibold text-gray-700 mb-2",children:"Hierarchy"}),(0,nn.jsx)("p",{className:"mb-6",children:"In the event of conflict, the Membership Agreement controls."}),(0,nn.jsx)("h2",{className:"text-2xl font-semibold text-gray-800 mb
2-4",children:"ARTICLE III - CODE OF CONDUCT AND ANTI-DISCRIMINATION POLICY"}),(0,nn.jsx)("h3",{className:"text-lg font-semibold text-gray-700 mb-2",children:"Anti-Discrimination Policy Statement"}),(0,nn.jsx)("p",{className:"mb-4",children:"APN is committed to maintaining an environment free from discrimination, harassment, and retaliation."}),(0,nn.jsx)("h3",{className:"text-lg font-semibold text-gray-700 mb-2",children:"Prohibited Conduct"}),(0,nn.jsx)("p",{className:"mb-4",children:"Discrimination, harassment, or retaliation based on race, color, religion, gender, age, disability, national origin, sexual orientation, or any protected category under applicable law is strictly prohibited. Additionally, lewd, lascivious, intoxicated, or otherwise disruptive behavior (including conduct that is sexually explicit, aggressive, or inappropriate in public or professional settings) is prohibited and may result in immediate removal from events, suspension, or termination of membership."}),(0,nn.jsx)("h2",{className:"text-2xl font-semibold text-gray-800 mb-4",children:"ARTICLE IV - EVENT REGISTRATION TERMS AND CONDITIONS"}),(0,nn.jsx)("h3",{className:"text-lg font-semibold text-gray-700 mb-2",children:"Registration and Payment"}),(0,nn.jsx)("p",{className:"mb-4",children:"Registration for APN events must be completed in advance through designated channels. Payment is required at the time of registration. APN reserves the right to deny registration for failure to pay or for prior violations of APN policies."}),(0,nn.jsx)("h3",{className:"text-lg font-semibold text-gray-700 mb-2",children:"Cancellations and Refunds"}),(0,nn.jsx)("p",{className:"mb-4",children:"Cancellations must be submitted in writing at least forty-eight hours prior to the event. Refunds or credits are provided at APN's sole discretion."}),(0,nn.jsx)("h3",{className:"text-lg font-semibold text-gray-700 mb-2",children:"Conduct at Events"}),(0,nn.jsx)("p",{className:"mb-4",children:"Attendees are expected to conduct themselves professionally and respectfully. Harassment, discrimination, abuse, or disruptive conduct will not be tolerated and may result in removal without refund."}),(0,nn.jsx)("h3",{className:"text-lg font-semibold text-gray-700 mb-2",children:"Media and Photography"}),(0,nn.jsx)("p",{className:"mb-4",children:"APN may photograph, film, or otherwise record events. By attending, participants consent to the use of their image and likeness by APN in promotional materials without compensation."}),(0,nn.jsx)("h2",{className:"text-2xl font-semibold text-gray-800 mb-4",children:"ARTICLE V - EVENT ATTENDEE WAIVER AND RELEASE"}),(0,nn.jsx)("h3",{className:"text-lg font-semibold text-gray-700 mb-2",children:"Assumption of Risk"}),(0,nn.jsx)("p",{className:"mb-4",children:"Attendees acknowledge that participation in APN events carries inherent risks, including but not limited to illness, injury, property loss, alcohol consumption, travel-related risks, and exposure to communicable diseases."}),(0,nn.jsx)("h3",{className:"text-lg font-semibold text-gray-700 mb-2",children:"Waiver and Release of Claims"}),(0,nn.jsx)("p",{className:"mb-4",children:"Attendees waive, release, and discharge APN and its Officers and Agents from all claims, liabilities, or causes of action arising from participation in APN events, whether caused by negligence or otherwise."}),(0,nn.jsx)("div",{className:"mt-8 p-4 bg-gray-100 rounded-lg",children:(0,nn.jsxs)("p",{className:"text-sm text-gray-600",children:[(0,nn.jsx)("strong",{children:"Version:"})," August 29, 2025 \u2013 Master Copy",(0,nn.jsx)("br",{}),(0,nn.jsx)("strong",{children:"Last Updated:"})," ",(new Date).toLocaleDateString()]})})]})]})})})]}),Ao=()=>(0,nn.jsxs)(nn.Fragment,{children:[(0,nn.jsxs)(wo,{children:[(0,nn.jsx)("title",{children:"Privacy Policy | The APN - Accelerated Professionals Network"}),(0,nn.jsx)("meta",{name:"description",content:"Privacy Policy for The APN (Accelerated Professionals Network) - How we collect, use, and protect your personal information."}),(0,nn.jsx)("meta",{name:"robots",content:"index, follow"})]}),(0,nn.jsx)("div",{className:"min-h-screen bg-gray-50 py-12",children:(0,nn.jsx)("div",{className:"max-w-4xl mx-auto px-4 sm:px-6 lg:px-8",children:(0,nn.jsxs)("div",{className:"bg-white shadow-lg rounded-lg p-8",children:[(0,nn.jsx)("h1",{className:"text-3xl font-bold text-gray-900 mb-8",children:"Privacy Policy"}),(0,nn.jsxs)("div",{className:"prose max-w-none",children:[(0,nn.jsx)("p",{className:"mb-6 text-lg text-gray-700",children:"The Accelerated Professionals Network (APN) is committed to protecting your privacy and personal information. This Privacy Policy explains how we
2collect, use, and safeguard your data."}),(0,nn.jsx)("h2",{className:"text-2xl font-semibold text-gray-800 mb-4",children:"ARTICLE II - PRIVACY POLICY"}),(0,nn.jsx)("h3",{className:"text-lg font-semibold text-gray-700 mb-2",children:"II.1 Categories of Data Collected"}),(0,nn.jsx)("p",{className:"mb-4",children:"APN may collect personal data including but not limited to name, address, email, phone number, employer, job title, payment details, event attendance records, and communications with APN."}),(0,nn.jsx)("h3",{className:"text-lg font-semibold text-gray-700 mb-2",children:"II.2 Lawful Basis for Processing"}),(0,nn.jsx)("p",{className:"mb-4",children:"Personal data is collected and processed under lawful bases including consent, contractual necessity, legal obligation, and APN's legitimate interests in managing its membership and events."}),(0,nn.jsx)("h3",{className:"text-lg font-semibold text-gray-700 mb-2",children:"II.3 Use of Data"}),(0,nn.jsx)("p",{className:"mb-4",children:"Data may be used to administer memberships, process payments, register event participants, communicate with members, maintain records, and comply with applicable laws."}),(0,nn.jsx)("h3",{className:"text-lg font-semibold text-gray-700 mb-2",children:"II.4 Retention of Data"}),(0,nn.jsx)("p",{className:"mb-4",children:"APN retains personal data for as long as necessary to fulfill the purposes for which it was collected, to comply with legal obligations, or to enforce rights. Data that is no longer required shall be securely deleted or anonymized."}),(0,nn.jsx)("h3",{className:"text-lg font-semibold text-gray-700 mb-2",children:"II.5 Security of Data"}),(0,nn.jsx)("p",{className:"mb-4",children:"APN implements commercially reasonable safeguards to protect data, but cannot guarantee absolute security. Members acknowledge that transmission of data over the internet carries inherent risks."}),(0,nn.jsx)("h3",{className:"text-lg font-semibold text-gray-700 mb-2",children:"II.6 Sharing of Data"}),(0,nn.jsx)("p",{className:"mb-4",children:"Data may be shared with vendors, service providers, payment processors, and event partners as necessary to fulfill APN's purposes. APN does not sell personal data."}),(0,nn.jsx)("h3",{className:"text-lg font-semibold text-gray-700 mb-2",children:"II.7 Cross-Border Transfers"}),(0,nn.jsx)("p",{className:"mb-4",children:"Data may be transferred outside of the jurisdiction of collection. APN shall take reasonable steps to ensure adequate protection consistent with applicable data protection laws."}),(0,nn.jsx)("h3",{className:"text-lg font-semibold text-gray-700 mb-2",children:"II.8 Member Rights"}),(0,nn.jsx)("p",{className:"mb-4",children:"Members may request access to, correction of, or deletion of their personal data. Where applicable under GDPR or CCPA, members may exercise rights including portability, restriction of processing, and objection."}),(0,nn.jsx)("h3",{className:"text-lg font-semibold text-gray-700 mb-2",children:"II.9 Breach Notification"}),(0,nn.jsx)("p",{className:"mb-4",children:"In the event of a data breach that may compromise personal data, APN shall notify affected members as required by law."}),(0,nn.jsx)("h3",{className:"text-lg font-semibold text-gray-700 mb-2",children:"II.10 Indemnification and Limitation of Liability"}),(0,nn.jsx)("p",{className:"mb-4",children:"Members shall indemnify and hold harmless APN and its Officers and Agents from claims arising from misuse of APN's systems or member-provided data. APN's liability is limited to dues paid in the twelve months preceding the claim."}),(0,nn.jsx)("h3",{className:"text-lg font-semibold text-gray-700 mb-2",children:"II.11 Dispute Resolution"}),(0,nn.jsx)("p",{className:"mb-4",children:"This Article shall be governed by New York law. Disputes shall be mediated in New York and, if unresolved, resolved by binding arbitration under the rules of the American Arbitration Association."}),(0,nn.jsx)("h3",{className:"text-lg font-semibold text-gray-700 mb-2",children:"II.12 Hierarchy"}),(0,nn.jsx)("p",{className:"mb-4",children:"In case of conflict, the Membership Agreement shall control."}),(0,nn.jsx)("h2",{className:"text-2xl font-semibold text-gray-800 mb
2-4",children:"Contact Information"}),(0,nn.jsx)("p",{className:"mb-4",children:"If you have questions about this Privacy Policy or wish to exercise your rights regarding your personal data, please contact us at:"}),(0,nn.jsxs)("div",{className:"bg-gray-100 p-4 rounded-lg mb-6",children:[(0,nn.jsx)("p",{className:"mb-2",children:(0,nn.jsx)("strong",{children:"The APN - Accelerated Professionals Network"})}),(0,nn.jsx)("p",{className:"mb-2",children:"Email: [email protected]"}),(0,nn.jsx)("p",{className:"mb-2",children:"Website: https://the-apn.com/about/contact"})]}),(0,nn.jsx)("h2",{className:"text-2xl font-semibold text-gray-800 mb-4",children:"Your Rights"}),(0,nn.jsx)("p",{className:"mb-4",children:"Depending on your location, you may have the following rights regarding your personal data:"}),(0,nn.jsxs)("ul",{className:"list-disc pl-6 mb-6",children:[(0,nn.jsxs)("li",{className:"mb-2",children:[(0,nn.jsx)("strong",{children:"Access:"})," Request a copy of the personal data we hold about you"]}),(0,nn.jsxs)("li",{className:"mb-2",children:[(0,nn.jsx)("strong",{children:"Correction:"})," Request correction of inaccurate or incomplete data"]}),(0,nn.jsxs)("li",{className:"mb-2",children:[(0,nn.jsx)("strong",{children:"Deletion:"})," Request deletion of your personal data"]}),(0,nn.jsxs)("li",{className:"mb-2",children:[(0,nn.jsx)("strong",{children:"Portability:"})," Request transfer of your data to another organization"]}),(0,nn.jsxs)("li",{className:"mb-2",children:[(0,nn.jsx)("strong",{children:"Restriction:"})," Request limitation of processing of your data"]}),(0,nn.jsxs)("li",{className:"mb-2",children:[(0,nn.jsx)("strong",{children:"Objection:"})," Object to processing of your data for certain purposes"]})]}),(0,nn.jsxs)("div",{className:"mt-8 p-4 bg-blue-50 border-l-4 border-blue-400",children:[(0,nn.jsx)("h3",{className:"text-lg font-semibold text-blue-800 mb-2",children:"Important Notice"}),(0,nn.jsx)("p",{className:"text-blue-700",children:"By using APN services, registering for events, or becoming a member, you acknowledge that you have read and understood this Privacy Policy and consent to the collection, use, and processing of your personal data as described herein."})]}),(0,nn.jsx)("div",{className:"mt-8 p-4 bg-gray-100 rounded-lg",children:(0,nn.jsxs)("p",{className:"text-sm text-gray-600",children:[(0,nn.jsx)("strong",{children:"Version:"})," August 29, 2025 \u2013 Master Copy",(0,nn.jsx)("br",{}),(0,nn.jsx)("strong",{children:"Last Updated:"})," ",(new Date).toLocaleDateString(),(0,nn.jsx)("br",{}),(0,nn.jsx)("strong",{children:"Effective Date:"})," ",(new Date).toLocaleDateString()]})})]})]})})})]}),So=()=>{const{hasRole:t,currentUser:n,isLoggedIn:r}=sn();Ln();const[s,a]=(0,e.useState)([]),[i,o]=(0,e.useState)([]),[l,c]=(0,e.useState)(!0),[d,u]=(0,e.useState)(null),[m,h]=(0,e.useState)(!0),p=(0,e.useRef)(!1),g=e=>{if(e.pricing){const t=[];if(void 0!==e.pricing.member&&t.push(e.pricing.member),void 0!==e.pricing.nonMember&&t.push(e.pricing.nonMember),t.length>0){const e=Math.min(...t),n=Math.max(...t);return e===n?"$".concat(e.toFixed(2)):"$".concat(e.toFixed(2)," - $").concat(n.toFixed(2))}}if(e.ticketTypes&&Array.isArray(e.ticketTypes)){const t=e.ticketTypes.map(e=>e.price).filter(e=>void 0!==e);if(t.length>0){const e=Math.min(...t),n=Math.max(...t);return e===n?"$".concat(e.toFixed(2)):"$".concat(e.toFixed(2)," - $").concat(n.toFixed(2))}}return e.price||"Contact for pricing"};(0,e.useEffect)(()=>{f()},[m]);const f=async()=>{try{if(c(!0),u(null),m){console.log("Loading events from Firebase...");const e=await(0,wn.kQ)(20,!0);console.log("Upcoming events from Firebase:",e);const t=(await(0,wn.kQ)(50,!1)).filter(e=>{var t;return(null!==(t=e.startDate)&&void 0!==t&&t.toDate?e.startDate.toDate():new Date(e.startDate))<new Date});console.log("Past events from Firebase:",t);const n=e.sort((e,t)=>{var n,r;return(null!==(n=e.startDate)&&void 0!==n&&n.toDate?e.startDate.toDate():new Date(e.startDate||e.date))-(null!==(r=t.startDate)&&void 0!==r&&r.toDate?t.startDate.toDate():new Date(t.startDate||t.date))}),r=t.sort((e,t)=>
2{var n,r;const s=null!==(n=e.startDate)&&void 0!==n&&n.toDate?e.startDate.toDate():new Date(e.startDate||e.date);return(null!==(r=t.startDate)&&void 0!==r&&r.toDate?t.startDate.toDate():new Date(t.startDate||t.date))-s});if(a(n),o(r),0===e.length&&0===t.length&&!p.current){console.log("Initial load: No events found in Firebase, adding static events...");const e=as(),t=is();a(e),o(t)}p.current=!0}else{console.log("Loading events from static data...");const e=as(),t=is();a(e),o(t)}}catch(e){console.error("Error loading events:",e),u(e.message),m&&(console.log("Firebase error, falling back to static data..."),h(!1))}finally{c(!1)}},[x,b]=(0,e.useState)("upcoming"),[y,v]=(0,e.useState)(""),[w,j]=(0,e.useState)("all"),N=e=>!0===e.isVirtual||"string"===typeof e.eventType&&e.eventType.toLowerCase().includes("virtual"),k=e=>{const t=y.toLowerCase(),n=(e.title||"").toLowerCase().includes(t)||(e.location||"").toLowerCase().includes(t),r="all"===w||("virtual"===w?N(e):!N(e));return n&&r},A=s.filter(k),S=i.filter(k);return l?(0,nn.jsx)("div",{className:"flex justify-center items-center min-h-screen",children:(0,nn.jsx)("div",{className:"animate-spin rounded-full h-12 w-12 border-t-2 border-b-2 border-apn-blue"})}):(0,nn.jsxs)("div",{className:"bg-white",children:[(0,nn.jsx)("div",{className:"bg-apn-blue text-white py-12",children:(0,nn.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:(0,nn.jsxs)("div",{className:"text-center",children:[(0,nn.jsx)("div",{className:"flex justify-center mb-4",children:(0,nn.jsx)("img",{src:"".concat("","/apn-logos/APN-Tag-white.jpg"),alt:"APN Logo",className:"h-16"})}),(0,nn.jsx)("h1",{className:"text-3xl font-bold",children:"Events"}),(0,nn.jsx)("p",{className:"mt-2 text-xl",children:"Connect, Learn, and Grow with APN"})]})})}),(0,nn.jsx)("section",{className:"py-12",children:(0,nn.jsxs)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[(0,nn.jsxs)("div",{className:"mb-8 flex flex-col md:flex-row justify-between items-center space-y-4 md:space-y-0",children:[(0,nn.jsxs)("div",{className:"flex space-x-4",children:[(0,nn.jsx)("button",{onClick:()=>b("upcoming"),className:"px-4 py-2 rounded-md ".concat("upcoming"===x?"bg-apn-blue text-white":"bg-gray-200 text-gray-700 hover:bg-gray-300"),children:"Upcoming Events"}),(0,nn.jsx)("button",{onClick:()=>b("past"),className:"px-4 py-2 rounded-md ".concat("past"===x?"bg-apn-blue text-white":"bg-gray-200 text-gray-700 hover:bg-gray-300"),children:"Past Events"}),t("admin")&&(0,nn.jsx)(dt,{to:"/admin/events/create",className:"px-4 py-2 bg-green-600 text-white rounded-md hover:bg-green-700 transition duration-200",children:"Create Event"})]}),(0,nn.jsx)("div",{className:"w-full md:w-64",children:(0,nn.jsx)("input",{type:"text",placeholder:"Search events...",value:y,onChange:e=>v(e.target.value),className:"w-full px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue"})})]}),"all"!==w&&(0,nn.jsx)("div",{className:"mb-4 flex items-center justify-center",children:(0,nn.jsxs)("span",{className:"inline-flex items-center bg-blue-50 text-apn-blue text-sm font-medium px-3 py-1 rounded-full",children:["Showing ","virtual"===w?"Virtual":"In-Person"," events",(0,nn.jsx)("button",{type:"button",onClick:()=>j("all"),className:"ml-2 font-bold hover:text-apn-dark-blue","aria-label":"Clear category filter",children:"\xd7"})]})}),(0,nn.jsx)("div",{children:"upcoming"===x?A.length>0?(0,nn.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8",children:A.map(e=>(0,nn.jsxs)("div",{className:"bg-white rounded-lg shadow-lg overflow-hidden border border-gray-200",children:[(0,nn.jsxs)("div",{className:"h-48 bg-white relative",children:[(0,nn.jsx)(dt,{to:"/events/".concat(e.id),className:"h-full w-full overflow-hidden flex items-center justify-center bg-white cursor-pointer",children:(0,nn.jsx)("img",{src:e.imageUrl||"".concat("","/apn-logos/APN-blue (1).png"),alt:e.title,className:"h-full w-full object-contain transition-transform duration-300 hover:scale-105",onError:e=>{e.target.onerror=null,e.target.src="".concat("","/apn-logos/APN-blue (1).png")}})}),e.featured&&(0,nn.jsx)("div",{className:"absolute top-0 left-0 bg-apn-blue text-white px-3 py-1",children:"Featured"})]}),(0,nn.jsxs)("div",{className:"p-6",children:[(0,nn.jsx)(dt,{to:"/events/".concat(e.id),children:(0,nn.jsx)("h3",{className:"text-xl font-bold mb-2 hover:text-apn-blue cursor-pointer",children:e.title})}),(0,nn.jsx)("p",{className:"text-gray-600 mb-4",children:e.description}),(0,nn.jsxs)("div",{className:"space-y-2 mb-6",children:[(0,nn.jsxs)("div",{className:"flex items-center text-gray-600",children:[(0,nn.jsx)("svg",{className:"h-5 w-5 mr-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})}),(0,nn.jsx)("span",{children:e.date})]}),(0,nn.jsxs)("div",{className:"flex items-center text-gray-600",children:[(0,nn.jsxs)("svg",{className:"h-5 w-5 mr-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:[(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"}),(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M15 11a3 3 0 11-6 0 3 3 0 016 0z"})]}),(0,nn.jsx)("span",{children:e.location})]}),(0,nn.jsxs)("div",{className:"flex items-center text-gray-600",children:[(0,nn.jsx)("svg",{className:"h-5 w-5 mr-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),(0,nn.jsx)("span",{children:g(e)})]})]}),(0,nn.jsx)(dt,{to:"/events/".concat(e.id),className:"block w-full bg-apn-blue text-white text-center py-2 px-4 roun
2ded hover:bg-blue-700 transition duration-200",children:"View Details"})]})]},e.id))}):(0,nn.jsx)("div",{className:"text-center py-12",children:(0,nn.jsx)("p",{className:"text-xl text-gray-600",children:"No upcoming events found matching your search."})}):S.length>0?(0,nn.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8",children:S.map(e=>(0,nn.jsxs)("div",{className:"bg-white rounded-lg shadow-lg overflow-hidden border border-gray-200",children:[(0,nn.jsxs)("div",{className:"h-48 bg-white relative",children:[(0,nn.jsx)(dt,{to:"/events/".concat(e.id),className:"h-full w-full overflow-hidden flex items-center justify-center bg-white cursor-pointer",children:(0,nn.jsx)("img",{src:e.imageUrl||"".concat("","/apn-logos/APN-blue (1).png"),alt:e.title,className:"h-full w-full object-contain transition-transform duration-300 hover:scale-105",onError:e=>{e.target.onerror=null,e.target.src="".concat("","/apn-logos/APN-blue (1).png")}})}),e.featured&&(0,nn.jsx)("div",{className:"absolute top-0 left-0 bg-apn-blue text-white px-3 py-1",children:"Featured"})]}),(0,nn.jsxs)("div",{className:"p-6",children:[(0,nn.jsx)(dt,{to:"/events/".concat(e.id),children:(0,nn.jsx)("h3",{className:"text-xl font-bold mb-2 hover:text-apn-blue cursor-pointer",children:e.title})}),(0,nn.jsx)("p",{className:"text-gray-600 mb-4",children:e.description}),(0,nn.jsxs)("div",{className:"space-y-2 mb-6",children:[(0,nn.jsxs)("div",{className:"flex items-center text-gray-600",children:[(0,nn.jsx)("svg",{className:"h-5 w-5 mr-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})}),(0,nn.jsx)("span",{children:e.date})]}),(0,nn.jsxs)("div",{className:"flex items-center text-gray-600",children:[(0,nn.jsxs)("svg",{className:"h-5 w-5 mr-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:[(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"}),(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M15 11a3 3 0 11-6 0 3 3 0 016 0z"})]}),(0,nn.jsx)("span",{children:e.location})]}),(0,nn.jsxs)("div",{className:"flex items-center text-gray-600",children:[(0,nn.jsx)("svg",{className:"h-5 w-5 mr-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),(0,nn.jsx)("span",{children:g(e)})]})]}),(0,nn.jsx)(dt,{to:"/events/".concat(e.id),className:"block w-full bg-gray-500 text-white text-center py-2 px-4 rounded hover:bg-gray-600 transition duration-200",children:"View Event Recap"})]})]},e.id))}):(0,nn.jsx)("div",{className:"text-center py-12",children:(0,nn.jsx)("p",{className:"text-xl text-gray-600",children:"No past events found matching your search."})})})]})}),(0,nn.jsx)("section",{className:"py-12 bg-gray-50",children:(0,nn.jsxs)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[(0,nn.jsx)("div",{className:"text-center mb-8",children:(0,nn.jsx)("h2",{className:"text-2xl font-bold text-gray-900",children:"Event Categories"})}),(0,nn.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[(0,nn.jsxs)("button",{type:"button",onClick:()=>{j(e=>"in-person"===e?"all":"in-person"),b("upcoming"),window.scrollTo({top:0,behavior:"smooth"})},className:"bg-white rounded-lg shadow-md p-6 text-center hover:shadow-lg transition duration-200 ".concat("in-person"===w?"ring-2 ring-apn-blue":""),children:[(0,nn.jsx)("h3",{className:"text-xl font-bold text-apn-blue mb-2",children:"In-Person"}),(0,nn.jsx)("p",{className:"text-gray-600",children:"Networking events and meetups in various cities"})]}),(0,nn.jsxs)("button",{type:"button",onClick:()=>{j(e=>"virtual"===e?"all":"virtual"),b("upcoming"),window.scrollTo({top:0,behavior:"smooth"})},className:"bg-white rounded-lg shadow-md p-6 text-center hover:shadow-lg transition duration-200 ".concat("virtual"===w?"ring-2 ring-apn-blue":""),children:[(0,nn.jsx)("h3",{className:"text-xl font-bold text-apn-blue mb-2",children:"Virtual"}),(0,nn.jsx)("p",{className:"text-gray-600",children:"Online webinars and digital networking opportunities"})]})]})]})}),(0,nn.jsx)("section",{className:"bg-apn-blue text-white py-12",children:(0,nn.jsxs)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 text-center",children:[(0,nn.jsx)("div",{className:"flex justify-center mb-6",children:(0,nn.jsx)("img",{src:"".concat("","/apn-logos/APN-Tag-SQ-white.jpg"),alt:"APN Logo Square",className:"h-20"})}),(0,nn.jsx)("h2",{className:"text-3xl font-bold mb-4",children:"Ready to Join the Network?"}),(0,nn.jsx)("p",{className:"text-xl mb-8 max-w-3xl mx-auto",children:"Connect with finance professionals, access exclusive resources, and accelerate your career with APN."}),(0,nn.jsx)(dt,{to:"/register",className:"btn-primary bg-white text-apn-blue hover:bg-gray-100",children:"Become a Member Today"})]})})]})},Eo=e=>{if(!e)return"";let t,n;if(e.startDate&&e.endDate){var r,s;t=null!==(r=e.startDate)&&void 0!==r&&r.toDate?e.startDate.toDate():new Date(e.startDate),n=null!==(s=e.endDate)&&void 0!==s&&s.toDate?e.endDate.toDate():new Date(e.endDate)}else{if(!e.date||!e.time)return console.warn("Invalid event format for calendar URL:",e),"";{const r=e.date,s=e.time;if(!s||!s.includes(" - "))return console.warn("Invalid event time format:",s),"";const[a,i]=s.split(" - ");t=new Date(r+" "+a),n=new Date(r+" "+i)}}const a=new URLSearchParams({action:"TEMPLATE",text:e.title,details:e.description,location:e.address||e.location,dates:"".concat(t.toISOString().replace(/-|:|\.\d+/g,""),"/").concat(n.toISOString().replace(/-|:|\.\d+/g,""))});return"https://calendar.google.com/calendar/render?".concat(a.toString())},Co=e=>{if(!e)return"";let t,n;if(e.startDate&&e.endDate){var r,s;t=null!==(r=e.startDate)&&void 0!==r&&r.toDate?e.startDate.toDate():new Date(e.startDate),n=null!==(s=e.endDate)&&void 0!==s&&s.toDate?e.endDate.toDate():new Date(e.endDate)}else{if(!e.date||!e.time)return console.warn("Invalid event format for calendar URL:",e),"";{const r=e.date,s=e.time;if(!s||!s.includes(" - "))return console.warn("Invalid event time format:",s),"";const[a,i]=s.split(" - ");t=new Date(r+" "+a),n=new Date(r+" "+i)}}const a=new URLSearchParams({path:"/calendar/action/compose",rru:"addevent",subject:e.title,body:e.description,location:e.address||e.location,startdt:t.toISOString(),enddt:n.toISOString()});return"https://outlook.office.com/calendar/0/deeplink/compose?".concat(a.toString())},To=e=>{if(!e)return;const t=(e=>{if(!e)return"";let t,n;if(e.startDate&&e.endDate){var r,s;t=null!==(r=e.startDate)&&void 0!==r&&r.toDate?e.startDate.toDate():new Date(e.startDate),n=null!==(s=e.endDate)&&void 0!==s&&s.toDate?e.endDate.toDate():new Date(e.endDate)}else{if(!e.date||!e.time)return console.warn("Invalid event format for calendar content:",e),"";{const r=e.date,s=e.time;if(!s||!s.includes(" - "))return console.warn("Invalid event time format:",s),"";const[a,i]=s.split(" - ");t=new Date(r+" "+a),n=new Date(r+" "+i)}}const a=e=>e.toISOString().replace(/-|:|\.\d+/g,"");return["BEGIN:VCALENDAR","VERSION:2.0","PRODID:-//APN//Event Calendar//EN","CALSCALE:GREGORIAN","BEGIN:VEVENT","SUMMARY:".concat(e.title),"DTSTART:".concat(a(t)),"DTEND:".concat(a(n)),"LOCATION:".concat(e.address||e.location),"DESCRIPTION:".concat(e.description.replace(/\\n
2/g,"\\n")),"END:VEVENT","END:VCALENDAR"].join("\r\n")})(e),n=new Blob([t],{type:"text/calendar;charset=utf-8"}),r=URL.createObjectURL(n),s=document.createElement("a");s.href=r,s.download="".concat(e.title.replace(/\s+/g,"_"),".ics"),document.body.appendChild(s),s.click(),document.body.removeChild(s),URL.revokeObjectURL(r)},Po=t=>{var n,r,s,a;let{event:i,onRegistrationComplete:o}=t;const{currentUser:l,userProfile:c}=sn(),[d,u]=(0,e.useState)(""),[m,h]=(0,e.useState)(null),[p,g]=(0,e.useState)(!1),[f,x]=(0,e.useState)(!1),[b,y]=(0,e.useState)(null),[v,w]=(0,e.useState)(!1),[j,N]=(0,e.useState)(!1),k="admin"===(null===c||void 0===c?void 0:c.role)||"approved"===(null===c||void 0===c?void 0:c.status)&&(null===c||void 0===c?void 0:c.membershipTier),A=e=>{u(e);let t=0;var n,r;if("member"===e)t=(null===(n=i.ticketTypes)||void 0===n||null===(r=n.find(e=>"member"===e.id))||void 0===r?void 0:r.price)||25;else if("non-member"===e){var s,a;t=(null===(s=i.ticketTypes)||void 0===s||null===(a=s.find(e=>"non-member"===e.id))||void 0===a?void 0:a.price)||50}h(t)},S=async()=>{x(!0),y(null);try{const e=String(i.id),t=m||0,n={member:"member","non-member":"nonMember",sponsor:"sponsor"},r={eventId:e,userId:(null===l||void 0===l?void 0:l.uid)||"anonymous",registrationType:n[d]||d,eventTitle:i.title,eventPrice:t,successUrl:"".concat(window.location.origin,"/events/").concat(i.id,"?success=true"),cancelUrl:"".concat(window.location.origin,"/events/").concat(i.id,"?canceled=true")},s=await fetch("https://us-central1-the-apn.cloudfunctions.net/createEventCheckoutSession",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});if(!s.ok){const e=await s.json();throw new Error(e.error||"Payment processing failed")}const{url:a}=await s.json();if(!a)throw new Error("No payment URL received");window.location.href=a}catch(e){console.error("Payment error:",e);let t="Payment failed. Please try again.";e.message&&"Failed to fetch"!==e.message&&(t=e.message),y(t),x(!1)}},E=async()=>{g(!0),x(!1),o&&o({eventId:i.id,ticketType:d,finalPrice:m})};return p?(0,nn.jsx)("div",{className:"text-center py-8",children:(0,nn.jsxs)("div",{className:"bg-green-50 border border-green-200 rounded-lg p-6",children:[(0,nn.jsx)("h3",{className:"text-lg font-semibold text-green-800 mb-2",children:"Registration Successful!"}),(0,nn.jsxs)("p",{className:"text-green-700",children:["Thank you for registering for ",i.title,". You will receive a confirmation email shortly."]})]})}):(0,nn.jsx)("div",{className:"max-w-4xl mx-auto p-6",children:(0,nn.jsxs)("div",{className:"bg-white rounded-lg shadow-lg p-6",children:[(0,nn.jsx)("h2",{className:"text-2xl font-bold text-gray-900 mb-6",children:"Event Registration"}),(0,nn.jsxs)("form",{onSubmit:async e=>{e.preventDefault(),d?v?j?m>0?await S():await E():alert("Please agree to the Privacy Policy to continue"):alert("Please agree to the Terms and Conditions to continue"):alert("Please select a ticket type")},className:"space-y-6",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("h3",{className:"text-lg font-semibold mb-4",children:"Select Registration Type"}),(0,nn.jsxs)("div",{className:"space-y-3",children:[k&&(0,nn.jsxs)("label",{className:"flex items-center p-4 border rounded-lg cursor-pointer hover:bg-gray-50",children:[(0,nn.jsx)("input",{type:"radio",name:"ticket",value:"member",checked:"member"===d,onChange:()=>A("member"),className:"mr-3"}),(0,nn.jsxs)("div",{className:"flex-1",children:[(0,nn.jsx)("span",{className:"font-medium",children:"Member Registration"}),(0,nn.jsxs)("span",{className:"ml-2 text-green-600",children:["$",(null===(n=i.ticketTypes)||void 0===n||null===(r=n.find(e=>"member"===e.id))||void 0===r?void 0:r.price)||25]})]})]}),(0,nn.jsxs)("label",{className:"flex items-center p-4 border rounded-lg cursor-pointer hover:bg-gray-50",children:[(0,nn.jsx)("input",{type:"radio",name:"ticket",value:"non-member",checked:"non-member"===d,onChange:()=>A("non-member"),className:"mr-3"}),(0,nn.jsxs)("div",{className:"flex-1",children:[(0,nn.jsx)("span",{className:"font-medium",children:"Non-Member Registration"}),(0,nn.jsxs)("span",{className:"ml-2 text-gray-600",children:["$",(null===(s=i.ticketTypes)||void 0===s||null===(a=s.find(e=>"non-member"===e.id))||void 0===a?void 0:a.price)||50]})]})]})]})]}),d&&null!==m&&(0,nn.jsxs)("div",{className:"border-t pt-6",children:[(0,nn.jsxs)("div",{className:"mb-6 p-4 bg-gray-50 rounded-lg",children:[(0,nn.jsx)("h4",{className:"text-lg font-semibold text-gray-800 mb
2-4",children:"Legal Agreements"}),(0,nn.jsxs)("div",{className:"space-y-3",children:[(0,nn.jsxs)("label",{className:"flex items-start",children:[(0,nn.jsx)("input",{type:"checkbox",checked:v,onChange:e=>w(e.target.checked),className:"mt-1 mr-3 h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded",required:!0}),(0,nn.jsxs)("span",{className:"text-sm text-gray-700",children:["I agree to the"," ",(0,nn.jsx)(dt,{to:"/legal/terms-and-conditions",target:"_blank",className:"text-blue-600 hover:text-blue-800 underline",children:"Terms and Conditions"})," ","*"]})]}),(0,nn.jsxs)("label",{className:"flex items-start",children:[(0,nn.jsx)("input",{type:"checkbox",checked:j,onChange:e=>N(e.target.checked),className:"mt-1 mr-3 h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded",required:!0}),(0,nn.jsxs)("span",{className:"text-sm text-gray-700",children:["I agree to the"," ",(0,nn.jsx)(dt,{to:"/legal/privacy-policy",target:"_blank",className:"text-blue-600 hover:text-blue-800 underline",children:"Privacy Policy"})," ","*"]})]})]}),(0,nn.jsx)("p",{className:"text-xs text-gray-500 mt-2",children:"* Required for event registration and participation"})]}),(0,nn.jsx)("div",{className:"bg-blue-50 p-4 rounded-lg mb-4",children:(0,nn.jsxs)("div",{className:"flex justify-between items-center",children:[(0,nn.jsx)("span",{className:"font-medium",children:"Total:"}),(0,nn.jsxs)("span",{className:"text-xl font-bold",children:["$",m.toFixed(2)]})]})}),m>0?(0,nn.jsx)("button",{type:"submit",disabled:f||!v||!j,className:"w-full bg-blue-600 text-white py-3 px-4 rounded-lg hover:bg-blue-700 disabled:opacity-50 disabled:cursor-not-allowed",children:f?"Processing...":"Pay $".concat(m.toFixed(2))}):(0,nn.jsx)("button",{type:"submit",disabled:!v||!j,className:"w-full bg-green-600 text-white py-3 px-4 rounded-lg hover:bg-green-700 disabled:opacity-50 disabled:cursor-not-allowed",children:"Complete Free Registration"}),(!v||!j)&&(0,nn.jsx)("p",{className:"text-sm text-red-600 text-center mt-2",children:"Please agree to both the Terms and Conditions and Privacy Policy to continue"}),b&&(0,nn.jsx)("div",{className:"mt-4 p-3 bg-red-50 border border-red-200 rounded text-red-700",children:b})]})]})]})})},_o=async e=>{try{const t=(0,vt.query)((0,vt.collection)(yt.db,"eventRegistrations"),(0,vt.where)("eventId","==",e)),n=(await(0,vt.getDocs)(t)).docs.map(e=>(0,s.A)({id:e.id},e.data())),r=e=>{const t=e.createdAt||e.registrationDate;if(!t)return 0;if("function"===typeof t.toMillis)return t.toMillis();if("number"===typeof t.seconds)return 1e3*t.seconds;const n=new Date(t).getTime();return isNaN(n)?0:n};return n.sort((e,t)=>r(t)-r(e))}catch(t){throw console.error("Error getting event registrations:",t),t}},Io=async e=>{try{const t=await _o(e),n={total:t.length,members:t.filter(e=>e.isMember).length,nonMembers:t.filter(e=>!e.isMember).length,sponsors:t.filter(e=>"sponsor"===e.registrationType).length,paid:t.filter(e=>"paid"===e.paymentStatus).length,pending:t.filter(e=>"pending"===e.paymentStatus).length,byTier:{}};return t.forEach(e=>{e.membershipTier&&(n.byTier[e.membershipTier]=(n.byTier[e.membershipTier]||0)+1)}),n}catch(t){throw console.error("Error getting attendee stats:",t),t}},Do=async function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];try{const r=await n.e(238).then(n.bind(n,238)),s=await _o(e),a=await(0,vt.x7)((0,vt.doc)(yt.db,"events",e)),i=a.exists()?a.data():null,o=(null===i||void 0===i?void 0:i.title)||"Event",l=s.map((e,n)=>{const r={"Registration #":n+1,"Full Name":"".concat(e.firstName||""," ").concat(e.lastName||"").trim(),Email:e.email||"",Phone:e.phone||"",Company:e.company||"","Job Title":e.jobTitle||"","Registration Type":e.registrationType||"","Registration Date":e.createdAt?new Date(1e3*e.createdAt.seconds).toLocaleDateString():"","Event Date":null!==i&&void 0!==i&&i.startDate?new Date(1e3*i.startDate.seconds).toLocaleDateString():"","Dietary Restrictions":e.dietaryRestrictions||"","Accessibility Needs":e.accessibilityNeeds||"","Company Size":e.companySize||"","How Did You Hear About Us":e.referralSource||"","Special Requests":e.specialRequests||"","Networking Interests":e.networkingInterests||"",Status:e.status||"Registered"};return t&&e.payment&&(r["Payment Status"]=e.payment.status||"",r["Payment Method"]=e.payment.method||"",r["Amount Paid"]=e.payment.amount||"",r["Transaction ID"]=e.payment.transactionId||"",r["Payment Date"]=e.payment.paidAt?new Date(1e3*e.payment.paidAt.seconds).toLocaleDateString():"",r["Discount Applied"]=e.payment.discountCode||"",r["Refund Status"]=e.payment.refundStatus||""),r}),c=r.utils.book_new(),d=r.utils.json_to_sheet(l);r.utils.book_append_sheet(c,d,"Attendees");const u=[{Metric:"Total Registrations",Value:s.length},{Metric:"Event Title",Value:o},{Metric:"Event Date",Value:null!==i&&void 0!==i&&i.startDate?new Date(1e3*i.startDate.seconds).toLocaleDateString():"TBD"},{Metric:"Event Location",Value:(null===i||void 0===i?void 0:i.location)||"TBD"},{Metric:"Virtual Event",Value:null!==i&&void 0!==i&&i.isVirtual?"Yes":"No"},{Metric:"Export Date",Value:(new Date).toLocaleDateString()},{Metric:"Export Time",Value:(new Date).toLocaleTimeString()},{Metric:"",Value:""},{Metric:"Registration Breakdown:",Value:""}],m={};
2s.forEach(e=>{const t=e.registrationType||"Standard";m[t]=(m[t]||0)+1}),Object.entries(m).forEach(e=>{let[t,n]=e;u.push({Metric:"".concat(t," Registrations"),Value:n})});const h=r.utils.json_to_sheet(u);if(r.utils.book_append_sheet(c,h,"Summary"),t){const e=s.filter(e=>e.payment).map(e=>({Name:"".concat(e.firstName||""," ").concat(e.lastName||"").trim(),Email:e.email,"Payment Status":e.payment.status||"",Amount:e.payment.amount||"",Method:e.payment.method||"","Transaction ID":e.payment.transactionId||"",Date:e.payment.paidAt?new Date(1e3*e.payment.paidAt.seconds).toLocaleDateString():""})),t=r.utils.json_to_sheet(e);r.utils.book_append_sheet(c,t,"Payments")}const p=(new Date).toISOString().split("T")[0],g="".concat(o.replace(/[^a-zA-Z0-9]/g,"_"),"_Attendees_").concat(p,".xlsx");return r.writeFile(c,g),{success:!0,filename:g,attendeeCount:s.length,exportDate:(new Date).toISOString(),sheets:t?["Attendees","Summary","Payments"]:["Attendees","Summary"]}}catch(r){throw console.error("Error exporting attendees to Excel:",r),r}},Ro=t=>{let{event:n}=t;const{hasRole:r}=sn(),[s,a]=(0,e.useState)(""),[i,o]=(0,e.useState)("name"),[l,c]=(0,e.useState)("asc"),[d,u]=(0,e.useState)([]),[m,h]=(0,e.useState)(null),[p,g]=(0,e.useState)(!0),[f,x]=(0,e.useState)("csv"),[b,y]=(0,e.useState)(!1),v=r("admin");(0,e.useEffect)(()=>{w()},[n.id]);const w=async()=>{try{g(!0);const[e,t]=await Promise.all([_o(n.id),Io(n.id)]);u(e),h(t)}catch(e){console.error("Error loading registrations:",e)}finally{g(!1)}};if(p)return(0,nn.jsxs)("div",{className:"text-center py-6",children:[(0,nn.jsx)("div",{className:"animate-spin rounded-full h-8 w-8 border-t-2 border-b-2 border-apn-blue mx-auto"}),(0,nn.jsx)("p",{className:"text-gray-500 mt-2",children:"Loading attendees..."})]});const j=d.length>0?d:n.attendees||[];if(0===j.length)return(0,nn.jsx)("div",{className:"text-center py-6",children:(0,nn.jsx)("p",{className:"text-gray-500",children:"No attendees registered for this event yet."})});const N=j.filter(e=>{const t="".concat(e.firstName||""," ").concat(e.lastName||"").toLowerCase(),n=(e.company||"").toLowerCase(),r=(e.title||"").toLowerCase(),a=(e.email||"").toLowerCase(),i=s.toLowerCase();return t.includes(i)||n.includes(i)||r.includes(i)||a.includes(i)}),k=[...N].sort((e,t)=>{let n,r;return"name"===i?(n="".concat(e.firstName||""," ").concat(e.lastName||"").toLowerCase(),r="".concat(t.firstName||""," ").concat(t.lastName||"").toLowerCase()):"company"===i?(n=(e.company||"").toLowerCase(),r=(t.company||"").toLowerCase()):"registrationDate"===i&&(n=e.createdAt?new Date(1e3*e.createdAt.seconds):new Date(e.registrationDate||0),r=t.createdAt?new Date(1e3*t.createdAt.seconds):new Date(t.registrationDate||0)),"asc"===l?n>r?1:-1:n<r?1:-1}),A=e=>{i===e?c("asc"===l?"desc":"asc"):(o(e),c("asc"))};return(0,nn.jsxs)("div",{children:[(0,nn.jsxs)("div",{className:"flex flex-col md:flex-row justify-between mb-4 space-y-4 md:space-y-0",children:[(0,nn.jsx)("div",{className:"w-full md:w-64",children:(0,nn.jsx)("input",{type:"text",placeholder:"Search attendees...",value:s,onChange:e=>a(e.target.value),className:"w-full px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue"})}),(0,nn.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,nn.jsx)("div",{className:"flex items-center space-x-2",children:(0,nn.jsxs)("label",{className:"text-sm text-gray-600",children:[(0,nn.jsx)("input",{type:"checkbox",checked:b,onChange:e=>y(e.target.checked),className:"mr-1",disabled:!v}),"Include Payment Info ",!v&&"(Admin Only)"]})}),(0,nn.jsxs)("button",{onClick:async()=>{if(v)try{const e=await async function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];try{const n=await _o(e),r=["First Name","Last Name","Email","Phone","Company","Title","Member Status","Membership Tier","Registration Type","Registration Date","Special Requirements","Emergency Contact","Dietary Restrictions"];t&&r.push("Payment Status","Payment Method","Amount Paid");const s=n.map(e=>{const n=[e.firstName||"",e.lastName||"",e.email||"",e.phone||"",e.company||"",e.title||"",e.isMember?"Member":"Non-Member",e.membershipTier||"",e.registrationType||"",e.createdAt?new Date(1e3*e.createdAt.seconds).toLocaleStr
2ing():"",e.specialRequirements||"",e.emergencyContact||"",e.dietaryRestrictions||""];return t&&n.push(e.paymentStatus||"",e.paymentMethod||"",e.amount?"$".concat(e.amount):""),n});return[r.join(","),...s.map(e=>e.map(e=>'"'.concat(e,'"')).join(","))].join("\n")}catch(n){throw console.error("Error exporting attendees to CSV:",n),n}}(n.id,b),t=new Blob([e],{type:"text/csv;charset=utf-8;"}),r=URL.createObjectURL(t),s=document.createElement("a");s.href=r,s.setAttribute("download","".concat((n.title||"event").replace(/\s+/g,"_"),"_attendees.csv")),document.body.appendChild(s),s.click(),document.body.removeChild(s),URL.revokeObjectURL(r)}catch(e){console.error("Error exporting attendees:",e),alert("Failed to export attendee list. Please try again.")}else alert("Only administrators can export attendee lists.")},className:"flex items-center text-apn-blue hover:text-blue-700 transition duration-200",children:[(0,nn.jsx)("svg",{className:"h-5 w-5 mr-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 10v6m0 0l-3-3m3 3l3-3m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})}),"Export CSV"]}),v&&(0,nn.jsxs)("button",{onClick:async()=>{if(v)try{const e=await Do(n.id,b);e.success&&alert("Successfully exported ".concat(e.attendeeCount," attendees to ").concat(e.filename))}catch(e){console.error("Error exporting to Excel:",e),alert("Failed to export attendee list to Excel. Please try again.")}else alert("Only administrators can export attendee lists.")},className:"flex items-center text-green-600 hover:text-green-700 transition duration-200",children:[(0,nn.jsx)("svg",{className:"h-5 w-5 mr-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 10v6m0 0l-3-3m3 3l3-3m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})}),"Export Excel"]})]})]}),(0,nn.jsx)("div",{className:"mb-4",children:(0,nn.jsxs)("p",{className:"text-sm text-gray-600",children:["Showing ",N.length," of ",j.length," attendees"]})}),(0,nn.jsx)("div",{className:"overflow-x-auto",children:(0,nn.jsxs)("table",{className:"min-w-full divide-y divide-gray-200",children:[(0,nn.jsx)("thead",{className:"bg-gray-50",children:(0,nn.jsxs)("tr",{children:[(0,nn.jsx)("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider cursor-pointer",onClick:()=>A("name"),children:(0,nn.jsxs)("div",{className:"flex items-center",children:[(0,nn.jsx)("span",{children:"Name"}),"name"===i&&(0,nn.jsx)("svg",{className:"ml-1 h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"asc"===l?"M5 15l7-7 7 7":"M19 9l-7 7-7-7"})})]})}),(0,nn.jsx)("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider cursor-pointer",onClick:()=>A("company"),children:(0,nn.jsxs)("div",{className:"flex items-center",children:[(0,nn.jsx)("span",{children:"Company"}),"company"===i&&(0,nn.jsx)("svg",{className:"ml-1 h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"asc"===l?"M5 15l7-7 7 7":"M19 9l-7 7-7-7"})})]})}),(0,nn.jsx)("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Title"}),(0,nn.jsx)("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Status"}),(0,nn.jsx)("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider cursor-pointer",onClick:()=>A("registrationDate"),children:(0,nn.jsxs)("div",{className:"flex items-center",children:[(0,nn.jsx)("span",{children:"Registered"}),"registrationDate"===i&&(0,nn.jsx)("svg",{className:"ml-1 h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"asc"===l?"M5 15l7-7 7 7":"M19 9l-7 7-7-7"})})]})})]})}),(0,nn.jsx)("tbody",{className:"bg-white divide-y divide-gray-200",children:k.map(e=>{const t="".concat(e.firstName||""," ").concat(e.lastName||"").trim()||e.attendeeName||e.name||"",n=e.email||e.attendeeEmail||"",r=t||(n?n.split("@")[0]:"")||"Guest",s=(t?t.split(/\s+/).map(e=>e.charAt(0)).slice(0,2).join(""):n?n.charAt(0):"?").toUpperCase(),a=e.registrationDate||e.createdAt;let i="";if(a){const e="function"===typeof a.toDate?a.toDate():"object"===typeof a&&"number"===typeof a.seconds?new Date(1e3*a.seconds):new Date(a);i=isNaN(e.getTime())?"":e.toLocaleDateString()}const o=e.isMember||"member"===e.registrationType;return(0,nn.jsxs)("tr",{children:[(0,nn.jsx)("td",{className:"px-6 py-4 whitespace-nowrap",children:(0,nn.jsxs)("div",{className:"flex items-center",children:[(0,nn.jsx)("div",{className:"flex-shrink-0 h-10 w-10",children:(0,nn.jsx)("div",{className:"h-10 w-10 rounded-full bg-gray-200 flex items-center justify-center",children:(0,nn.jsx)("span",{className:"text-gray-500 text-xs",children:s})})}),(0,nn.jsxs)("div",{className:"ml-4",children:[(0,nn.jsx)("div",{className:"text-sm font-medium text-gray-900",children:r}),(0,nn.jsx)("div",{className:"text-sm text-gray-500",children:n})]})]})}),(0,nn.jsx)("td",{className:"px-6 py-4 whitespace-nowrap",children:(0,nn.jsx)("div",{className:"text-sm text-gray-900",children:e.company||""})}),(0,nn.jsx)("td",{className:"px-6 py-4 whitespace-nowrap",children:(0,nn.jsx)("div",{className:"text-sm text-gray-900",children:e.title||""})}),(0,nn.jsx)("td",{className:"px-6 py-4 whitespace-nowrap",children:(0,nn.jsx)("span",{className:"px-2 inline-flex text-xs leading-5 font-semibold rounded-full ".concat(o?"bg-green-100 text-green-800":"bg-gray-100 text-gray-800"),children:o?"Member":"Non-Member"})}),(0,nn.jsx)("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:i})]},e.id)})})]})}),0===N.length&&(0,nn.jsx)("div",{className:"text-center py-6",children:(0,nn.jsx)("p",{className:"text-gray-500",children:"No attendees found matching your search."})})]})},Lo=t=>{let{eventId:n,onClose:r}=t;const{hasRole:a}=sn(),[i,o]=(0,e.useState)(!1),[l,c]=(0,e.useState)([]),[d,u]=(0,e.useState)({code:"",discount:"",type:"percentage",description:"",maxUses:"",validUntil:""}),m=a("admin");(0,e.useEffect)(()=>{n&&h()},[n]);const h=async()=>{try{const e=await(0,vt.x7)((0,vt.doc)(yt.db,"events",n));if(e.exists()){const t=e.data();c(t.discountCodes||[])}}catch(e){console.error("Error loading discount codes:",e)}};return m?(0,nn.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:(0,nn.jsxs)("div",{className:"bg-white rounded-lg p-6 max-w-4xl w-full mx-4 max-h-[90vh] overflow-y-auto",children:[(0,nn.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,nn.jsx)("h2",{className:"text-2xl font-bold text-gray-900",children:"Event Discount Codes"}),(0,nn.jsx)("button",{onClick:r,className:"text-gray-400 hover:text-gray-600",children:(0,nn.jsx)("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 18L18 6M6 6l12 12"})})})]}),(0,nn.jsxs)("div",{className:"bg-gray-50 rounded-lg p-4 mb-6",children:[(0,nn.jsx)("h3",{className:"text-lg font-semibold mb-4",children:"Add New Discount Code"}),(0,nn.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Code"}),(0,nn.jsx)("input",{type:"text",value:d.code,onChange:e=>u((0,s.A)((0,s.A)({},d),{},{code:e.target.value.toUpperCase()})),placeholder:"ADMIN50",className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue"})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Discount Amount"}),(0,nn.jsxs)("div",{className:"flex",children:[(0,nn.jsx)("input",{type:"number",value:d.discount,onChange:e=>u((0,s.A)((0,s.A)({},d),{},{discount:e.target.value})),placeholder:"50",className:"flex-1 px-3 py-2 border border-gray-300 rounded-l-md focus:outline-none focus:ring-2 focus:ring-apn-blue"}
2),(0,nn.jsxs)("select",{value:d.type,onChange:e=>u((0,s.A)((0,s.A)({},d),{},{type:e.target.value})),className:"px-3 py-2 border border-gray-300 rounded-r-md focus:outline-none focus:ring-2 focus:ring-apn-blue",children:[(0,nn.jsx)("option",{value:"percentage",children:"%"}),(0,nn.jsx)("option",{value:"fixed",children:"$"})]})]})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Description"}),(0,nn.jsx)("input",{type:"text",value:d.description,onChange:e=>u((0,s.A)((0,s.A)({},d),{},{description:e.target.value})),placeholder:"Admin discount",className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue"})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Max Uses (optional)"}),(0,nn.jsx)("input",{type:"number",value:d.maxUses,onChange:e=>u((0,s.A)((0,s.A)({},d),{},{maxUses:e.target.value})),placeholder:"Unlimited",className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue"})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Valid Until (optional)"}),(0,nn.jsx)("input",{type:"date",value:d.validUntil,onChange:e=>u((0,s.A)((0,s.A)({},d),{},{validUntil:e.target.value})),className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue"})]}),(0,nn.jsx)("div",{className:"flex items-end",children:(0,nn.jsx)("button",{onClick:async()=>{if(d.code&&d.discount){o(!0);try{const e=[...l,(0,s.A)((0,s.A)({},d),{},{code:d.code.toUpperCase(),discount:parseFloat(d.discount),maxUses:d.maxUses?parseInt(d.maxUses):null,usedCount:0,createdAt:new Date,active:!0})];await(0,vt.updateDoc)((0,vt.doc)(yt.db,"events",n),{discountCodes:e}),c(e),u({code:"",discount:"",type:"percentage",description:"",maxUses:"",validUntil:""}),alert("Discount code added successfully!")}catch(e){console.error("Error adding discount code:",e),alert("Failed to add discount code")}finally{o(!1)}}else alert("Please fill in code and discount amount")},disabled:i,className:"w-full bg-apn-blue text-white py-2 px-4 rounded-md hover:bg-blue-700 disabled:opacity-50",children:i?"Adding...":"Add Code"})})]})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("h3",{className:"text-lg font-semibold mb-4",children:"Existing Discount Codes"}),0===l.length?(0,nn.jsx)("p",{className:"text-gray-500",children:"No discount codes created yet."}):(0,nn.jsx)("div",{className:"space-y-3",children:l.map((e,t)=>(0,nn.jsx)("div",{className:"bg-white border border-gray-200 rounded-lg p-4",children:(0,nn.jsxs)("div",{className:"flex justify-between items-start",children:[(0,nn.jsxs)("div",{className:"flex-1",children:[(0,nn.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,nn.jsx)("span",{className:"font-mono font-bold text-lg",children:e.code}),(0,nn.jsxs)("span",{className:"bg-blue-100 text-blue-800 px-2 py-1 rounded text-sm",children:[e.discount,"percentage"===e.type?"%":"$"," off"]}),(0,nn.jsx)("span",{className:"px-2 py-1 rounded text-sm ".concat(e.active?"bg-green-100 text-green-800":"bg-red-100 text-red-800"),children:e.active?"Active":"Inactive"})]}),(0,nn.jsx)("p",{className:"text-gray-600 mt-1",children:e.description}),(0,nn.jsxs)("div",{className:"text-sm text-gray-500 mt-2",children:[e.maxUses&&(0,nn.jsxs)("span",{children:["Used: ",e.usedCount||0,"/",e.maxUses," \u2022 "]}),e.validUntil&&(0,nn.jsxs)("span",{children:["Valid until: ",new Date(e.validUntil).toLocaleDateString()]})]})]}),(0,nn.jsxs)("div",{className:"flex space-x-2",children:[(0,nn.jsx)("button",{onClick:()=>(async e=>{o(!0);try{const t=[...l];t[e].active=!t[e].active,await(0,vt.updateDoc)((0,vt.doc)(yt.db,"events",n),{discountCodes:t}),c(t)}catch(t){console.error("Error toggling discount code:",t),alert("Failed to update discount code")}finally{o(!1)}})(t),disabled:i,className:"px-3 py-1 rounded text-sm ".concat(e.active?"bg-red-100 text-red-700 hover:bg-red-200":"bg-green-100 text-green-700 hover:bg-green-200"),children:e.active?"Deactivate":"Activate"}),(0,nn.jsx)("button",{onClick:()=>(async e=>{if(window.confirm("Are you sure you want to delete this discount code?")){o(!0);
2try{const t=l.filter((t,n)=>n!==e);await(0,vt.updateDoc)((0,vt.doc)(yt.db,"events",n),{discountCodes:t}),c(t),alert("Discount code deleted successfully!")}catch(t){console.error("Error deleting discount code:",t),alert("Failed to delete discount code")}finally{o(!1)}}})(t),disabled:i,className:"px-3 py-1 bg-red-100 text-red-700 rounded text-sm hover:bg-red-200",children:"Delete"})]})]})},t))})]})]})}):null},Mo=async e=>{try{const t=await(0,vt.x7)((0,vt.doc)(yt.db,"users",e));if(t.exists()){return t.data().network||[]}return[]}catch(t){throw console.error("Error getting user connections:",t),t}},Oo=async(e,t)=>{try{const r=await Mo(t);if(0===r.length)return[];const a=(0,vt.query)((0,vt.collection)(yt.db,"eventRegistrations"),(0,vt.where)("eventId","==",e)),i=(await(0,vt.getDocs)(a)).docs.map(e=>(0,s.A)({id:e.id},e.data())),o=[];for(const e of i){if(r.some(t=>t.userId===e.userId||t.id===e.userId))try{const t=await(0,vt.x7)((0,vt.doc)(yt.db,"users",e.userId));if(t.exists()){const n=t.data();o.push((0,s.A)((0,s.A)({},e),{},{profile:{firstName:n.firstName,lastName:n.lastName,title:n.jobTitle,company:n.company,profilePhoto:n.profilePhoto,membershipTier:n.membershipTier}}))}}catch(n){console.error("Error fetching attendee profile:",n),o.push(e)}}return o}catch(r){throw console.error("Error getting connected attendees:",r),r}},Fo=async(e,t)=>{try{const n=(0,vt.doc)(yt.db,"users",e);return await(0,vt.updateDoc)(n,{network:(0,vt.hq)({userId:t.userId,id:t.id||t.userId,name:t.name,title:t.title,company:t.company,connectedAt:new Date,mutualConnections:t.mutualConnections||0})}),!0}catch(n){throw console.error("Error adding connection:",n),n}},Uo=async(e,t)=>{try{const n=(await Mo(e)).find(e=>e.userId===t||e.id===t);if(n){const t=(0,vt.doc)(yt.db,"users",e);await(0,vt.updateDoc)(t,{network:(0,vt.C3)(n)})}return!0}catch(n){throw console.error("Error removing connection:",n),n}},Bo=t=>{let{event:n}=t;const{currentUser:r}=sn(),[s,a]=(0,e.useState)([]),[i,o]=(0,e.useState)(!0),[l,c]=(0,e.useState)(!1);(0,e.useEffect)(()=>{r&&null!==n&&void 0!==n&&n.id&&d()},[r,null===n||void 0===n?void 0:n.id]);const d=async()=>{try{o(!0);const e=await Oo(n.id,r.uid);a(e)}catch(e){console.error("Error loading connected attendees:",e)}finally{o(!1)}};if(i)return(0,nn.jsxs)("div",{className:"bg-white rounded-lg shadow p-6",children:[(0,nn.jsx)("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Your Network at This Event"}),(0,nn.jsx)("div",{className:"animate-pulse",children:(0,nn.jsx)("div",{className:"space-y-3",children:[1,2,3].map(e=>(0,nn.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,nn.jsx)("div",{className:"w-10 h-10 bg-gray-200 rounded-full"}),(0,nn.jsxs)("div",{className:"flex-1",children:[(0,nn.jsx)("div",{className:"h-4 bg-gray-200 rounded w-3/4 mb-2"}),(0,nn.jsx)("div",{className:"h-3 bg-gray-200 rounded w-1/2"})]})]},e))})})]});if(0===s.length)return(0,nn.jsxs)("div",{className:"bg-white rounded-lg shadow p-6",children:[(0,nn.jsx)("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Your Network at This Event"}),(0,nn.jsxs)("div",{className:"text-center py-8",children:[(0,nn.jsx)("svg",{className:"mx-auto h-12 w-12 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M17 20h5v-2a3 3 0 00-5.196-2.121M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.196-2.121M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z"})}),(0,nn.jsx)("h4",{className:"mt-4 text-lg font-medium text-gray-900",children:"No connections attending"}),(0,nn.jsx)("p",{className:"mt-2 text-gray-500",children:"None of your network connections are registered for this event yet."}),(0,nn.jsx)(dt,{to:"/directory",className:"mt-4 inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md text-apn-blue bg-blue-50 hover:bg-blue-100",children:"Explore Member Directory"})]})]});const u=l?s:s.slice(0,5);return(0,nn.jsxs)("div",{className:"bg-white rounded-lg shadow p-6",children:[(0,nn.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,nn.jsx)("h3",{className:"text-lg font-semibold text-gray-900",children:"Your Network at This Event"}),(0,nn.jsxs)("span",{className:"text-sm text-gray-500",children:[s.length," connection",1!==s.length?"s":""," attending"]})]}),(0,nn.jsx)("div",{className:"space-y-4",children:u.map((e,t)=>{var n,r,s,a,i,o,l,c,d,u,m,h;return(0,nn.jsxs)("div",{className:"flex items-center space-x-3 p-3 rounded-lg hover:bg-gray-50 transition-colors",children:[(0,nn.jsx)("div",{className:"flex-shrink-0",children:null!==(n=e.profile)&&void 0!==n&&n.profilePhoto?(0,nn.jsx)("img",{src:e.profile.profilePhoto,alt:"".concat(e.profile.firstName," ").concat(e.profile.lastName),className:"w-10 h-10 rounded-full object-cover"}):(0,nn.jsx)("div",{className:"w-10 h-10 rounded-full bg-apn-blue flex items-center justify-center",children:(0,nn.jsxs)("span",{className:"text-white font-medium text-sm",children:[(null===(r=e.profile)||void 0===r||null===(s=r.firstName)||void 0===s?void 0:s[0])||(null===(a=e.firstName)||void 0===a?void 0:a[0])||"?",(null===(i=e.profile)||void 0===i||null===(o=i.lastName)||void 0===o?void 0:o[0])||
2(null===(l=e.lastName)||void 0===l?void 0:l[0])||""]})})}),(0,nn.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,nn.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,nn.jsxs)("p",{className:"text-sm font-medium text-gray-900 truncate",children:[(null===(c=e.profile)||void 0===c?void 0:c.firstName)||e.firstName," ",(null===(d=e.profile)||void 0===d?void 0:d.lastName)||e.lastName]}),(null===(u=e.profile)||void 0===u?void 0:u.membershipTier)&&(0,nn.jsx)("span",{className:"inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-blue-100 text-blue-800",children:e.profile.membershipTier})]}),(0,nn.jsxs)("p",{className:"text-sm text-gray-500 truncate",children:[(null===(m=e.profile)||void 0===m?void 0:m.title)||e.title,(null===(h=e.profile)||void 0===h?void 0:h.company)&&" at ".concat(e.profile.company)]}),(0,nn.jsxs)("p",{className:"text-xs text-gray-400",children:["Registered as: ",e.registrationType||"Member"]})]}),(0,nn.jsx)("div",{className:"flex-shrink-0",children:(0,nn.jsx)(dt,{to:"/directory/".concat(e.userId),className:"text-apn-blue hover:text-blue-700 text-sm font-medium",children:"View Profile"})})]},e.id||t)})}),s.length>5&&(0,nn.jsx)("div",{className:"mt-4 text-center",children:(0,nn.jsx)("button",{onClick:()=>c(!l),className:"text-apn-blue hover:text-blue-700 text-sm font-medium",children:l?"Show Less":"Show All ".concat(s.length," Connections")})}),s.length>0&&(0,nn.jsxs)("div",{className:"mt-6 pt-4 border-t border-gray-200",children:[(0,nn.jsx)("h4",{className:"text-sm font-medium text-gray-900 mb-2",children:"Network Insights"}),(0,nn.jsxs)("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("span",{className:"text-gray-500",children:"Companies represented:"}),(0,nn.jsx)("span",{className:"ml-1 font-medium",children:new Set(s.map(e=>{var t;return null===(t=e.profile)||void 0===t?void 0:t.company}).filter(Boolean)).size})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("span",{className:"text-gray-500",children:"Registration types:"}),(0,nn.jsx)("span",{className:"ml-1 font-medium",children:new Set(s.map(e=>e.registrationType)).size})]})]})]})]})},zo=()=>{const{id:t}=le(),[r]=pt(),{currentUser:s,hasRole:a}=sn(),[i,o]=(0,e.useState)(null),[l,c]=(0,e.useState)(!0),[d,u]=(0,e.useState)(!1),[m,h]=(0,e.useState)(!1),[p,g]=(0,e.useState)(!1),[f,x]=(0,e.useState)(""),[b,y]=(0,e.useState)(!1),[v,w]=(0,e.useState)(0),[j,N]=(0,e.useState)(!1),k=a("admin"),A=!!s,S=async e=>{if(x(e),e.trim()){const t=await(async e=>{const t=e.toUpperCase();if(null!==i&&void 0!==i&&i.discountCodes){const e=i.discountCodes.find(e=>e.code===t&&e.active&&(!e.validUntil||new Date(e.validUntil)>=new Date)&&(!e.maxUses||(e.usedCount||0)<e.maxUses));if(e)return{valid:!0,discount:e.discount,type:e.type||"percentage"}}try{const t=await Vt(e,"event");if(t.valid)return{valid:!0,discount:t.discountAmount,type:t.discountType}}catch(n){console.error("Error validating discount code:",n)}return{valid:!1,discount:0,type:null}})(e);y(t.valid),w(t.discount)}else y(!1),w(0)},E=e=>b&&v>0?e*(1-v/100):e,C=async e=>{if(s||"member"!==e&&"sponsor"!==e)try{g(!0);let o=0;var t;if("member"===e)o=(null===(t=i.pricing)||void 0===t?void 0:t.memberPrice)||i.memberPrice||0;else if("nonMember"===e){var r;o=(null===(r=i.pricing)||void 0===r?void 0:r.nonMemberPrice)||i.nonMemberPrice||0}else if("sponsor"===e){var a;o=(null===(a=i.pricing)||void 0===a?void 0:a.sponsorPrice)||i.sponsorPrice||0}let l=o;f&&b&&(l=o*(1-v/100));const c=await fetch("https://us-central1-the-apn.cloudfunctions.net/createEventCheckoutSession",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(((t,n,r)=>{let a=0;"member"===e&&void 0!==(null===(t=i.pricing)||void 0===t?void 0:t.member)?a=b?E(i.pricing.member):i.pricing.member:"nonMember"===e&&void 0!==(null===(n=i.pricing)||void 0===n?void 0:n.nonMember)?a=b?E(i.pricing.nonMember):i.pricing.nonMember:"sponsor"===e&&void 0!==(null===(r=i.pricing)||void 0===r?void 0:r.sponsor)&&(a=b?E(i.pricing.sponsor):i.pricing.sponsor);return{eventId:i.id,userId:(null===s||void 0===s?void 0:s.uid)||null,registrationType:e,discountCode:f||null,eventTitle:i.title,eventPrice:a,successUrl:"".concat(window.location.origin,"/events/").concat(i.id,"/registration/success"),cancelUrl:"".concat(window.location.origin,"/events/").concat(i.id)}})())});if(!c.ok)throw new Error("Failed to create checkout session");const d=await c.json(),u=await Promise.resolve().then(n.bind(n,972)).then(e=>e.loadStripe("pk_live_51Kr8J3Ec8kNP7Yp7Tu6erT0Ti9b2qUuacRAPc8kfvjV7nxACrPfmoeGuU8wkIJIOptmFCoCkqW2rAPbAc35Zu2Kg00T0uBJJAv")),{error:m}=await u.redirectToCheckout({sessionId:d.id});m&&(console.error("Stripe checkout error:",m),alert("Payment failed. Please try again."))}catch(o){console.error("Error creating checkout session:",o),alert("Unable to process payment. Please try again or c
2ontact support.")}finally{g(!1)}else alert("Please log in to access member or sponsor pricing.")},T=e=>{if(!e)return null;if("function"===typeof e.toDate)return e.toDate();if("object"===typeof e&&"number"===typeof e.seconds)return new Date(1e3*e.seconds);const t=new Date(e);return isNaN(t.getTime())?null:t},P=e=>{if(!e)return!1;if("boolean"===typeof e.isPast)return e.isPast;const t=T(e.endDate)||T(e.startDate)||T(e.startDateTime)||T(e.date);return!!t&&t<new Date},_=async function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(k)try{const t=await Do(i.id,e);t.success&&alert("Successfully exported ".concat(t.attendeeCount," attendees to ").concat(t.filename))}catch(t){console.error("Error exporting attendees:",t),alert("Failed to export attendee list. Please try again.")}else alert("Only administrators can export attendee lists.")},I=(0,e.useCallback)(async()=>{try{c(!0);let e=await(0,wn.getEventById)(t);if(e||(e=ss(parseInt(t))),!e)return console.error("Event not found in Firebase or static data"),void o(null);if(e&&e.ticketTypes&&!e.pricing){const t={};e.ticketTypes.forEach(e=>{"member"===e.id&&(t.member=e.price),"non-member"===e.id&&(t.nonMember=e.price),"sponsor"===e.id&&(t.sponsor=e.price)}),e.pricing=t}if(e&&!e.ticketTypes&&e.pricing){const t=[];void 0!==e.pricing.member&&t.push({id:"member",name:"Member Registration",price:e.pricing.member,description:"For current APN members",memberOnly:!0}),void 0!==e.pricing.nonMember&&t.push({id:"non-member",name:"Non-Member Registration",price:e.pricing.nonMember,description:"For non-members",memberOnly:!1}),void 0!==e.pricing.sponsor&&t.push({id:"sponsor",name:"Sponsor Registration",price:e.pricing.sponsor,description:"For event sponsors",memberOnly:!1}),e.ticketTypes=t}o(e)}catch(e){console.error("Error loading event:",e);try{const e=ss(parseInt(t));e?o(e):(console.error("Static data fallback also failed"),o(null))}catch(n){console.error("Static data fallback error:",n),o(null)}}finally{c(!1)}},[t]);return(0,e.useEffect)(()=>{I()},[t,I]),(0,e.useEffect)(()=>{const e=r.get("success"),t=r.get("canceled");if("true"===e||"true"===t){const n=window.location.pathname;window.history.replaceState({},"",n),"true"===e?console.log("Payment successful - registration confirmed"):"true"===t&&console.log("Payment canceled by user")}},[r]),l?(0,nn.jsx)("div",{className:"flex justify-center items-center min-h-screen",children:(0,nn.jsx)("div",{className:"animate-spin rounded-full h-12 w-12 border-t-2 border-b-2 border-apn-blue"})}):i?(0,nn.jsxs)("div",{className:"bg-white",children:[(0,nn.jsx)("div",{className:"bg-apn-blue text-white py-12",children:(0,nn.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:(0,nn.jsxs)("div",{className:"text-center",children:[(0,nn.jsx)("div",{className:"flex justify-center mb-4",children:(0,nn.jsx)("img",{src:"".concat("","/apn-logos/APN-Tag-white.png"),alt:"APN Logo",className:"h-16"})}),(0,nn.jsx)("h1",{className:"text-3xl font-bold",children:i.title})]})})}),(0,nn.jsx)("section",{className:"py-12",children:(0,nn.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:(0,nn.jsxs)("div",{className:"bg-white rounded-lg shadow-lg overflow-hidden",children:[(0,nn.jsxs)("div",{className:"relative h-96 bg-white",children:[(0,nn.jsx)("div",{className:"h-full w-full overflow-hidden flex items-center justify-center bg-white",children:(0,nn.jsx)("img",{src:(()=>{const e=i.imageUrl||i.image;return e?e.startsWith("http")?e:"".concat("").concat(e):"".concat("","/apn-logos/APN-blue (1).png")})(),alt:i.title,className:"h-full w-full object-contain",onError:e=>{e.target.onerror=null,e.target.src="".concat("","/apn-logos/APN-blue (1).png")}})}),i.featured&&(0,nn.jsx)("div",{className:"absolute top-4 left-4 bg-apn-blue text-white px-3 py-1 rounded-md",children:"Featured"})]}),(0,nn.jsxs)("div",{className:"p-6",children:[(0,nn.jsxs)("div",{className:"flex flex-col md:flex-row justify-between mb-8",children:[(0,nn.jsxs)("div",{className:"mb-4 md:mb-0",children:[(0,nn.jsx)("h2",{className:"text-2xl font-bold text-gray-900 mb-2",children:i.title}),(0,nn.jsx)("p",{className:"text-gray-600",children:i.description})]}),(0,nn.jsxs)("div",{className:"flex flex-col space-y-2",children:[P(i)||!i.ticketTypes&&!i.pricing?P(i)?(0,nn.jsx)("button",{className:"bg-gray-400 text-white py-2 px-6 rounded cursor-not-allowed",disabled:!0,children:"Registration Closed - Event Has Passed"}):i.ticketTypes||i.pricing?(0,nn.jsx)("button",{className:"bg-gray-400 text-white py-2 px-6 rounded cursor-not-allowed",disabled:!0,children:"Registration Closed"}):null:(0,nn.jsx)("button",{onClick:()=>u(!d),className:"bg-apn-blue text-white py-2 px-6 rounded hover:bg-blue-700 transition duration-200",children:d?"Hide Registration":"Register Now"}),A&&(0,nn.jsx)("button",{onClick:()=>h(!m),className:"bg-gray-200 text-gray-800 py-2 px-6 rounded hover:bg-gray-300 transition duration-200",children:m?"Hide Attendee List":"View Attendees"})]})]}
2),k&&(0,nn.jsxs)("div",{className:"mb-8 p-4 bg-yellow-50 border border-yellow-200 rounded-lg",children:[(0,nn.jsx)("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Admin Controls"}),(0,nn.jsxs)("div",{className:"flex flex-wrap gap-4",children:[(0,nn.jsxs)("button",{onClick:()=>_(!1),className:"flex items-center bg-green-600 text-white py-2 px-4 rounded hover:bg-green-700 transition duration-200",children:[(0,nn.jsx)("svg",{className:"h-5 w-5 mr-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 10v6m0 0l-3-3m3 3l3-3m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})}),"Export Attendees (Email List)"]}),(0,nn.jsxs)("button",{onClick:()=>_(!0),className:"flex items-center bg-blue-600 text-white py-2 px-4 rounded hover:bg-blue-700 transition duration-200",children:[(0,nn.jsx)("svg",{className:"h-5 w-5 mr-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 10v6m0 0l-3-3m3 3l3-3m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})}),"Export with Payment Info"]}),(0,nn.jsxs)(dt,{to:"/admin/events/edit/".concat(i.id),className:"flex items-center bg-gray-600 text-white py-2 px-4 rounded hover:bg-gray-700 transition duration-200",children:[(0,nn.jsx)("svg",{className:"h-5 w-5 mr-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})}),"Edit Event"]}),(0,nn.jsxs)("button",{onClick:async()=>{if(!i)return;const e='Are you sure you want to delete the event "'.concat(i.title,'"?\n\nThis action will:\n- Delete the event permanently\n- Cancel all registrations\n- Remove all attendee data\n\nThis cannot be undone.');if(window.confirm(e))try{console.log("\ud83d\uddd1\ufe0f Attempting to delete event with ID:",i.id,"Type:",typeof i.id);let e=i.id;if(i.id&&"string"===typeof i.id)e=i.id;else if(i.id&&"number"===typeof i.id)return void alert("\u274c Cannot Delete Static Event\n\nThis event (ID: ".concat(i.id,') is a static demo event that cannot be deleted.\n\nStatic events are:\n\u2022 Pre-loaded demo data from eventData.js\n\u2022 Used for testing and display purposes\n\u2022 Cannot be modified or deleted from the database\n\nTo work with deletable events:\n1. Create new events through Admin Dashboard\n2. Use the "Create Grand ReLaunch" admin tool (/admin/create-grand-relaunch)\n3. Firebase-generated events (with long string IDs) can be deleted\n\nCurrent event: "').concat(i.title,'" (Static Demo Event)'));console.log("\ud83d\uddd1\ufe0f Deleting event with ID:",e),await(0,wn.SX)(e),alert("Event deleted successfully"),window.location.href="/events"}catch(t){console.error("Error deleting event:",t),console.error("Error code:",t.code),console.error("Error message:",t.message);let e="";e="permission-denied"===t.code?"\u274c Permission Denied\n\nYou don't have the required permissions to delete this event.\n\nPossible solutions:\n\u2022 Make sure you're logged in as an admin\n\u2022 Check your user role in the database\n\u2022 Contact a site administrator\n\nEvent: \"".concat(i.title,'"\nError: ').concat(t.message||"Permission denied"):"not-found"===t.code?"\u274c Event Not Found\n\nThis event may have already been deleted or doesn't exist in the database.\n\nEvent ID: ".concat(i.id,'\nEvent Title: "').concat(i.title,'"\n\nThis might be a static event that cannot be deleted.'):'\u274c Delete Failed\n\nFailed to delete event: "'.concat(i.title,'"\n\nError: ').concat(t.message||t.code||"Unknown error","\n\nIf this persists:\n1. Try refreshing the page\n2. Check your internet connection\n3. Contact support if the issue continues\n\nEvent ID: ").concat(i.id),alert(e)}},className:"flex items-center bg-red-600 text-white py-2 px-4 roun
2ded hover:bg-red-700 transition duration-200",children:[(0,nn.jsx)("svg",{className:"h-5 w-5 mr-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})}),"Delete Event"]})]}),(0,nn.jsx)("p",{className:"text-sm text-gray-600 mt-2",children:"Export attendee lists for email distribution. Payment info export includes transaction details for accounting. Use delete to permanently cancel events."})]}),(0,nn.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-8 mb-8",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Event Details"}),(0,nn.jsxs)("div",{className:"space-y-4",children:[(0,nn.jsxs)("div",{className:"flex items-start",children:[(0,nn.jsx)("svg",{className:"h-6 w-6 text-apn-blue mr-3 mt-0.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("p",{className:"font-medium text-gray-900",children:"Date"}),(0,nn.jsx)("p",{className:"text-gray-600",children:i.date})]})]}),(0,nn.jsxs)("div",{className:"flex items-start",children:[(0,nn.jsx)("svg",{className:"h-6 w-6 text-apn-blue mr-3 mt-0.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("p",{className:"font-medium text-gray-900",children:"Time"}),(0,nn.jsx)("p",{className:"text-gray-600",children:(()=>{if(i.time)return i.time;if(i.date&&"string"===typeof i.date){var e,t;if(i.date.includes(" at "))return null===(e=i.date.split(" at ")[1])||void 0===e?void 0:e.trim();if(i.date.includes("at"))return null===(t=i.date.split("at")[1])||void 0===t?void 0:t.trim()}return"6:00 PM - 9:00 PM"})()})]})]}),(0,nn.jsxs)("div",{className:"flex items-start",children:[(0,nn.jsxs)("svg",{className:"h-6 w-6 text-apn-blue mr-3 mt-0.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:[(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"}),(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M15 11a3 3 0 11-6 0 3 3 0 016 0z"})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("p",{className:"font-medium text-gray-900",children:"Location"}),(0,nn.jsx)("p",{className:"text-gray-600",children:i.location}),i.address&&(0,nn.jsx)("p",{className:"text-gray-600",children:i.address})]})]}),(0,nn.jsxs)("div",{className:"flex items-start",children:[(0,nn.jsx)("svg",{className:"h-6 w-6 text-apn-blue mr-3 mt-0.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("p",{className:"font-medium text-gray-900",children:"Price"}),(0,nn.jsx)("p",{className:"text-gray-600",children:(e=>{if(e.pricing){const t=[];if(void 0!==e.pricing.member&&t.push(e.pricing.member),void 0!==e.pricing.nonMember&&t.push(e.pricing.nonMember),t.length>0){const e=Math.min(...t),n=Math.max(...t);return e===n?"$".concat(e.toFixed(2)):"$".concat(e.toFixed(2)," - $").concat(n.toFixed(2))}}if(e.ticketTypes&&Array.isArray(e.ticketTypes)){const t=e.ticketTypes.filter(e=>"sponsor"!==e.id&&!e.requiresSponsorSelection).map(e=>e.price).filter(e=>void 0!==e);if(t.length>0){const e=Math.min(...t),n=Math.max(...t);return e===n?"$".concat(e.toFixed(2)):"$".concat(e.toFixed(2)," - $").concat(n.toFixed(2))}}return e.price&&"string"===typeof e.price?(e.price.includes(" - ")||e.price.includes("-"),e.price):"Contact for pricing"})(i)})]})]})]})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Add to Calendar"}),(0,nn.jsxs)("div",{className:"space-y-3",children:[(0,nn.jsxs)("a",{href:Eo(i),target:"_blank",rel:"noopener noreferrer",className:"flex items-center text-gray-700 hover:text-apn-blue transition duration-200",children:[(0,nn.jsx)("svg",{className:"h-6 w-6 mr-2",viewBox:"0 0 24 24",fill:"
2currentColor",children:(0,nn.jsx)("path",{d:"M12 0C5.372 0 0 5.372 0 12s5.372 12 12 12 12-5.372 12-12S18.628 0 12 0zm6.804 16.863h-1.275v-6.934H7.471v6.934H6.196v-8.59h12.608v8.59zm-8.141.001H9.387v-5.66h1.276v5.66zm2.276 0h-1.276v-5.66h1.276v5.66zm2.276 0h-1.276v-5.66h1.276v5.66z"})}),"Add to Google Calendar"]}),(0,nn.jsxs)("a",{href:Co(i),target:"_blank",rel:"noopener noreferrer",className:"flex items-center text-gray-700 hover:text-apn-blue transition duration-200",children:[(0,nn.jsx)("svg",{className:"h-6 w-6 mr-2",viewBox:"0 0 24 24",fill:"currentColor",children:(0,nn.jsx)("path",{d:"M7.88 12.04q0 .45-.11.87-.1.41-.33.74-.22.33-.58.52-.37.2-.87.2t-.85-.2q-.35-.21-.57-.55-.22-.33-.33-.75-.1-.42-.1-.86t.1-.87q.1-.43.34-.76.22-.34.59-.54.36-.2.87-.2t.86.2q.35.21.57.55.22.34.31.77.1.43.1.88zM24 12v9.38q0 .46-.33.8-.33.32-.8.32H7.13q-.46 0-.8-.33-.32-.33-.32-.8V18H1q-.41 0-.7-.3-.3-.29-.3-.7V7q0-.41.3-.7Q.58 6 1 6h6.5V2.55q0-.44.3-.75.3-.3.75-.3h12.9q.44 0 .75.3.3.3.3.75V10.85l1.24.72h.01q.1.07.18.18.07.12.07.25zm-6-8.25v3h3v-3zm0 4.5v3h3v-3zm0 4.5v1.83l3.05-1.83zm-5.25-9v3h3.75v-3zm0 4.5v3h3.75v-3zm0 4.5v2.03l2.41 1.5 1.34-.8v-2.73zM9 3.75V6h2l.13.01.12.04v-2.3zM5.98 15.98q.9 0 1.6-.3.7-.32 1.19-.86.48-.55.73-1.28.25-.74.25-1.61 0-.83-.25-1.55-.24-.71-.71-1.24t-1.15-.83q-.68-.3-1.55-.3-.92 0-1.64.3-.71.3-1.2.85-.5.54-.75 1.3-.25.74-.25 1.63 0 .85.26 1.56.26.72.74 1.23.48.52 1.17.81.69.3 1.56.3zM7.5 21h12.39L12 16.08V17q0 .41-.3.7-.29.3-.7.3H7.5zm15-.13v-7.24l-5.9 3.54Z"})}),"Add to Outlook Calendar"]}),(0,nn.jsxs)("button",{onClick:()=>To(i),className:"flex items-center text-gray-700 hover:text-apn-blue transition duration-200",children:[(0,nn.jsx)("svg",{className:"h-6 w-6 mr-2",viewBox:"0 0 24 24",fill:"currentColor",children:(0,nn.jsx)("path",{d:"M17 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4V1h2v2h6V1h2v2zm-2 2H9v2H7V5H3v4h18V5h-4v2h-2V5zm5 6H4v8h16v-8z"})}),"Download iCalendar File"]})]})]})]}),(0,nn.jsxs)("div",{className:"mb-8",children:[(0,nn.jsx)("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:"About This Event"}),(0,nn.jsx)("div",{className:"prose max-w-none",dangerouslySetInnerHTML:{__html:i.longDescription}})]}),d&&(i.ticketTypes||i.pricing)&&!P(i)&&(0,nn.jsxs)("div",{className:"mb-8 p-6 bg-gray-50 rounded-lg",children:[(0,nn.jsx)("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Event Registration"}),(0,nn.jsxs)("div",{className:"mb-6 p-4 bg-white border border-gray-200 rounded-lg",children:[(0,nn.jsx)("h4",{className:"font-semibold text-gray-900 mb-3",children:"Discount Code"}),(0,nn.jsxs)("div",{className:"flex gap-3",children:[(0,nn.jsx)("input",{type:"text",placeholder:"Enter discount code (optional)",value:f,onChange:e=>S(e.target.value),className:"flex-1 px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue"}),b&&(0,nn.jsxs)("div",{className:"flex items-center text-green-600",children:[(0,nn.jsx)("svg",{className:"w-5 h-5 mr-1",fill:"currentColor",viewBox:"0 0 20 20",children:(0,nn.jsx)("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"})}),v,"% off applied!"]})]}),k&&(0,nn.jsxs)("div",{className:"mt-2 text-sm text-gray-600",children:[(0,nn.jsxs)("div",{className:"flex justify-between items-center mb-2",children:[(0,nn.jsx)("p",{className:"font-semibold text-red-600",children:"Admin Only - Discount Codes:"}),(0,nn.jsx)("button",{onClick:()=>N(!0),className:"bg-apn-blue text-white px-3 py-1 rounded text-xs hover:bg-blue-700",children:"Manage Codes"})]}),null!==i&&void 0!==i&&i.discountCodes&&i.discountCodes.length>0?(0,nn.jsxs)("div",{children:[(0,nn.jsx)("p",{className:"text-xs text-gray-500 mb-1",children:"Event-specific codes:"}),(0,nn.jsx)("ul",{className:"list-disc list-inside ml-2",children:i.discountCodes.filter(e=>e.active).map((e,t)=>(0,nn.jsxs)("li",{children:[(0,nn.jsx)("strong",{children:e.code})," - ",e.discount,"percentage"===e.type?"%":"$"," off",e.description&&" (".concat(e.description,")")]},t))})]}):(0,nn.jsx)("div",{children:(0,nn.jsx)("p",{className:"text-xs text-gray-500 mb-1",children:'No discount codes configured for this event yet. Click "Manage Codes" to add event-specific codes.'})}),(0,nn.jsx)("p",{className:"text-xs text-red-500 mt-1",children:"\u26a0\ufe0f These codes are for admin distribution only and not visible to regular users."})]})]}),i.pricing?(0,nn.jsxs)("div",{className:"space-y-4",children:[(0,nn.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[void 0!==i.pricing.member&&(0,nn.jsxs)("div",{className:"border border-gray-200 rounded-lg p-4",children:[(0,nn.jsx)("h4",{className:"font-semibold text-gray-900",children:"Member Price"}),(0,nn.jsx)("div",{className:"text-2xl font-bold text-apn-blue",children:b?(0,nn.jsxs)("div",{children:[(0,nn.jsxs)("span",{className:"line-through text-gray-400 text-lg",children:["$",i.pricing.member.toFixed(2)]}),(0,nn.jsxs)("div",{children:["$",E(i.pricing.member).toFixed(2)]}),(0,nn.jsxs)("div",{className:"text-sm text-green-600",children:["(",v,"% off)"]})]}):(0,nn.jsxs)("span",{children:["$",i.pricing.member.toFixed(2)]})}),(0,nn.jsx)("button",{className:"w-full mt-3 bg-apn-blue text-white py-2 px-4 roun
2ded hover:bg-blue-700 transition duration-200 disabled:opacity-50",onClick:()=>C("member"),disabled:p||!s,children:p?"Processing...":s?"Pay with Stripe":"Login Required"}),!s&&(0,nn.jsx)("p",{className:"text-xs text-red-600 mt-1",children:"Please log in for member pricing"})]}),void 0!==i.pricing.nonMember&&(0,nn.jsxs)("div",{className:"border border-gray-200 rounded-lg p-4",children:[(0,nn.jsx)("h4",{className:"font-semibold text-gray-900",children:"Non-Member Price"}),(0,nn.jsx)("div",{className:"text-2xl font-bold text-gray-600",children:b?(0,nn.jsxs)("div",{children:[(0,nn.jsxs)("span",{className:"line-through text-gray-400 text-lg",children:["$",i.pricing.nonMember.toFixed(2)]}),(0,nn.jsxs)("div",{children:["$",E(i.pricing.nonMember).toFixed(2)]}),(0,nn.jsxs)("div",{className:"text-sm text-green-600",children:["(",v,"% off)"]})]}):(0,nn.jsxs)("span",{children:["$",i.pricing.nonMember.toFixed(2)]})}),(0,nn.jsx)("button",{className:"w-full mt-3 bg-gray-600 text-white py-2 px-4 rounded hover:bg-gray-700 transition duration-200 disabled:opacity-50",onClick:()=>C("nonMember"),disabled:p,children:p?"Processing...":"Pay with Stripe"}),(0,nn.jsx)("p",{className:"text-xs text-green-600 mt-1",children:"\u2713 No login required"})]}),(0,nn.jsxs)("div",{className:"border border-green-200 rounded-lg p-4 bg-green-50",children:[(0,nn.jsx)("h4",{className:"font-semibold text-gray-900 mb-2",children:"Sponsor Access"}),(0,nn.jsx)("p",{className:"text-sm text-gray-600 mb-3",children:"Sponsors receive special discount codes. Enter your assigned code below to access sponsor pricing."}),(0,nn.jsxs)("div",{className:"space-y-2",children:[(0,nn.jsx)("label",{htmlFor:"sponsorCode",className:"block text-sm font-medium text-gray-700",children:"Sponsor Discount Code"}),(0,nn.jsx)("input",{type:"text",id:"sponsorCode",value:f,onChange:e=>S(e.target.value),placeholder:"Enter sponsor code...",className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-apn-blue focus:border-apn-blue"}),b&&(0,nn.jsxs)("p",{className:"text-sm text-green-600",children:["\u2705 Valid code! ",v,"% discount applied"]}),f&&!b&&(0,nn.jsx)("p",{className:"text-sm text-red-600",children:"\u274c Invalid discount code"})]})]})]}),(0,nn.jsxs)("div",{className:"mt-4 p-4 bg-blue-50 border border-blue-200 rounded-lg",children:[(0,nn.jsxs)("p",{className:"text-sm text-blue-800",children:[(0,nn.jsx)("strong",{children:"Secure Payment:"})," Click \"Pay with Stripe\" to proceed to secure checkout. You'll be redirected to Stripe's secure payment page to complete your registration."]}),(0,nn.jsxs)("div",{className:"mt-2 text-sm",children:[(0,nn.jsxs)("p",{className:"text-green-600",children:["\u2713 ",(0,nn.jsx)("strong",{children:"Non-members:"})," Can register without login"]}),(0,nn.jsxs)("p",{className:"text-blue-600",children:["\u2139 ",(0,nn.jsx)("strong",{children:"Members:"})," Please log in for member pricing"]}),(0,nn.jsxs)("p",{className:"text-purple-600",children:["\ud83c\udfab ",(0,nn.jsx)("strong",{children:"Sponsors:"})," Use your assigned discount code for special pricing"]})]})]})]}):(0,nn.jsx)(Po,{event:i,isLoggedIn:A})]}),d&&P(i)&&(0,nn.jsxs)("div",{className:"mb-8 p-6 bg-yellow-50 border border-yellow-200 rounded-lg",children:[(0,nn.jsx)("h3",{className:"text-lg font-semibold text-yellow-800 mb-2",children:"Registration Closed"}),(0,nn.jsx)("p",{className:"text-yellow-700",children:"This event has already taken place. Registration is no longer available."})]}),A&&(0,nn.jsx)("div",{className:"mb-8",children:(0,nn.jsx)(Bo,{event:i})}),m&&A&&(0,nn.jsxs)("div",{className:"mb-8",children:[(0,nn.jsx)("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Attendees"}),(0,nn.jsx)(Ro,{event:i})]})]})]})})}),(0,nn.jsx)("section",{className:"bg-apn-blue text-white py-12",children:(0,nn.jsxs)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 text-center",children:[(0,nn.jsx)("div",{className:"flex justify-center mb-6",children:(0,nn.jsx)("img",{src:"".concat("","/apn-logos/APN-Tag-SQ-white.jpg"),alt:"APN Logo Square",className:"h-20"})}),(0,nn.jsx)("h2",{className:"text-3xl font-bold mb-4",children:"Ready to Join the Network?"}),(0,nn.jsx)("p",{className:"text-xl mb-8 max-w-3xl mx-auto",children:"Connect with finance professionals, access exclusive resources, and accelerate your career with APN."}),(0,nn.jsx)(dt,{to:"/register",className:"btn-primary bg-white text-apn-blue hover:bg-gray-100",children:"Become a Member Today"})]})}),j&&(0,nn.jsx)(Lo,{eventId:null===i||void 0===i?void 0:i.id,onClose:()=>N(!1)})]}):(0,nn.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12",children:(0,nn.jsxs)("div",{className:"text-center",children:[(0,nn.jsx)("h1",{className:"text-3xl font-bold text-gray-900 mb-4",children:"Event Not Found"}),(0,nn.jsx)("p",{className:"text-gray-600 mb-8",children:"The event you're looking for doesn't exist or has been removed."}),(0,nn.jsx)(dt,{to:"/events",className:"inline-block bg-apn-blue text-white py-2 px-6 rounded hover:bg-blue-700 transition duration-200",children:"Back to Events"})]})})},Vo=()=>{var t,n;const{id:r}=le(),[s]=pt(),{currentUser:a}=sn(),[i,o]=(0,e.useState)(null),[l,c]=(0,e.useState)(!0),d=s.get("session_id"),u=s.get("payment_intent");(0,e.useEffect)(()=>{m()},[r]);const m=async()=>{try{const e=await(0,wn.getEventById)(r);o(e)}catch(e){console.error("Error loading event:",e)}finally{c(!1)}};return l?(0,nn.jsx)("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center",children:(0,nn.jsxs)("div",{className:"text-center",children:[(0,nn.jsx)("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-apn-blue mx-auto"}),(0,nn.jsx)("p",{className:"mt-4 text-gray-600",children:"Loading..."})]})}):(0,nn.jsx)("div",{className:"min-h-screen bg-gray-50 py-12",children:(0,nn.jsx)("div",{className:"max-w-3xl mx-auto px-4 sm:px-6 lg:px-8",children:(0,nn.jsxs)("div",{className:"bg-white shadow-lg rounded-lg overflow-hidden",children:[(0,nn.jsxs)("div",{className:"bg-green-50 px-6 py-8 text-center",children:[(0,nn.jsx)("div",{className:"mx-auto flex items-center justify-center h-16 w-16 rounded-full bg-green-100 mb-4",children:(0,nn.jsx)("svg",{className:"h-8 w-8 text-green-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M5 13l4 4L19 7"})})}),(0,nn.jsx)("h1",{className:"text-3xl font-bold text-gray-900 mb-2",children:"Registration Successful!"}),(0,nn.jsxs)("p",{className:"text-lg text-gray-600",children:["Thank you for registering for ",(null===i||void 0===i?void 0:i.title)||"the event"]})]}),(0,nn.jsxs)("div",{className:"px-6 py-8",children:[i&&(0,nn.jsxs)("div",{className:"space-y-6",children:[(0,nn.jsxs)("div",{className:"border-l-4 border-apn-blue pl-4",children:[(0,nn.jsx)("h2",{className:"text-xl font-semibold text-gray-900 mb-2",children:i.title}),(0,nn.jsxs)("div",{className:"space-y-2 text-gray-600",children:[(0,nn.jsxs)("div",{className:"flex items-center",children:[(0,nn.jsx)("svg",{className:"w-5 h-5 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})}),(null===(t=Bn(i.date||i.startDate))||void 0===t?void 0:t.toLocaleDateString("en-US",{weekday:"long",year:"numeric",month:"long",day:"numeric"}))||"Date to be announced"]}),(0,nn.jsxs)("div",{className:"flex items-center",children:[(0,nn.jsx)("svg",{className:"w-5 h-5 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})}),i.time||(null===(n=Bn(i.startDate))||void 0===n?void 0:n.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0}))]}),(0,nn.jsxs)("div",{className:"flex items-center",children:[(0,nn.jsxs)("svg",{className:"w-5 h-5 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"}),(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M15 11a3 3 0 11-6 0 3 3 0 016 0z"})]}),i.location||"Location TBD"]})]})]}),(0,nn.jsxs)("div",{className:"bg-gray-50 rounded-lg p-4",children:[(0,nn.jsx)("h3",{className:"font-semibold text-gray-900 mb-2",children:"Payment Confirmation"}),(0,nn.jsxs)("div",{className:"text-sm text-gray-600 space-y-1",children:[d&&(0,nn.jsxs)("p",{children:[(0,nn.jsx)("span",{className:"font-medium",children:"Session ID:"})," ",d]}),u&&(0,nn.jsxs)("p",{children:[(0,nn.jsx)("span",{className:"font-medium",children:"Payment ID:"})," ",u]}),(0,nn.jsx)("p",{className:"text-green-600 font-medium",children:"\u2713 Payment processed successfully"})]})]}),(0,nn.jsxs)("div",{className:"bg-blue-50 rounded-lg p-4",children:[(0,nn.jsx)("h3",{className:"font-semibold text-gray-900 mb-2",children:"What's Next?"}),(0,nn.jsxs)("ul",{className:"text-sm text-gray-600 space-y-1",children:[(0,nn.jsx)("li",{children:"\u2022 You'll receive a confirmation email shortly"}),(0,nn.jsx)("li",{children:"\u2022 Add the event to your calendar using the links on the event page"}),(0,nn.jsx)("li",{children:"\u2022 Check your profile for event details and updates"}),(0,nn.jsx)("li",{children:"\u2022 Contact us at [email protected] if you have any questions"})]})]})]}),(0,nn.jsxs)("div",{className:"mt-8 flex flex-col sm:flex-row gap-4",children:[(0,nn.jsx)(dt,{to:"/events/".concat(r),className:"flex-1 bg-apn-blue text-white py-3 px-6 rounded-lg text-center hover:bg-blue-700 transition duration-200",children:"View Event Details"}),(0,nn.jsx)(dt,{to:"/events",className:"flex-1 bg-gray-200 text-gray-800 py-3 px-6 rounded-lg text-center hover:bg-gray-300 transition duration-200",children:"Browse More Events"}),a&&(0,nn.jsx)(dt,{to:"/profile",className:"flex-1 bg-green-600 text-white py-3 px-6 rounded-lg text-center hover:bg-green-700 transition duration-200",children:"View My Profile"})]})]})]})})})},qo=()=>{const{id:t}=le(),[n,r]=(0,e.useState)(null),[s,a]=(0,e.useState)(!0);(0,e.useEffect)(()=>{i()},[t]);const i=async()=>{try{const e=await(0,wn.getEventById)(t);r(e)}catch(e){console.error("Error loading event:",e)}finally{a(!1)}};return s?(0,nn.jsx)("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center",children:(0,nn.jsxs)("div",{className:"text-center",children:[(0,nn.jsx)("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-apn-blue mx-auto"}),(0,nn.jsx)("p",{className:"mt-4 text-gray-600",children:"Loading..."})]})}):(0,nn.jsx)("div",{className:"min-h-screen bg-gray-50 py-12",children:(0,nn.jsx)("div",{className:"max-w-3xl mx-auto px-4 sm:px-6 lg:px-8",children:(0,nn.jsxs)("div",{className:"bg-white shadow-lg rounded-lg overflow-hidden",children:[(0,nn.jsxs)("div",{className:"bg-yellow-50 px-6 py-8 text-center",children:[(0,nn.jsx)("div",{className:"mx-auto flex items-center justify-center h-16 w-16 rounded-full bg-yellow-100 mb-4",children:(0,nn.jsx)("svg",{className:"h-8 w-8 text-yellow-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L3.732 16.5c-.77.833.192 2.5 1.732 2.5z"})})}),(0,nn.jsx)("h1",{className:"text-3xl font-bold text-gray-900 mb-2",children:"Registration Cancelled"}),(0,nn.jsxs)("p",{className:"text-lg text-gray-600",children:["Your registration for ",(null===n||void 0===n?void 0:n.title)||"the event"," was not completed"]})]}),(0,nn.jsxs)("div",{className:"px-6 py-8",children:[n&&(0,nn.jsxs)("div",{className:"space-y-6",children:[(0,nn.jsxs)("div",{className:"border-l-4 border-yellow-400 pl-4",children:[(0,nn.jsx)("h2",{className:"text-xl font-semibold text-gray-900 mb-2",children:n.title}),(0,nn.jsxs)("div",{className:"space-y-2 text-gray-600",children:[(0,nn.jsxs)("div",{className:"flex items-center",children:[(0,nn.jsx)("svg",{className:"w-5 h-5 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})}),new Date(n.date||n.startDate).toLocaleDateString("en-US",{weekday:"long",year:"numeric",month:"long",day:"numeric"})]}),(0,nn.jsxs)("div",{className:"flex items-center",children:[(0,nn.jsx)("svg",{className:"w-5 h-5 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})}),n.time||new Date(n.startDate).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})]}),(0,nn.jsxs)("div",{className:"flex items-center",children:[(0,nn.jsxs)("svg",{className:"w-5 h-5 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"}),(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M15 11a3 3 0 11-6 0 3 3 0 016 0z"})]}),n.location||"Location TBD"]})]})]}),(0,nn.jsxs)("div",{className:"bg-gray-50 rounded-lg p-4",children:[(0,nn.jsx)("h3",{className:"font-semibold text-gray-900 mb-2",children:"What Happened?"}),(0,nn.jsxs)("div",{className:"text-sm text-gray-600 space-y-1",children:[(0,nn.jsx)("p",{children:"\u2022 Your payment was not processed"}),(0,nn.jsx)("p",{children:"\u2022 No charges were made to your payment method"}),(0,nn.jsx)("p",{children:"\u2022 Your registration was not completed"})]})]}),(0,nn.jsxs)("div",{className:"bg-blue-50 rounded-lg p-4",children:[(0,nn.jsx)("h3",{className:"font-semibold text-gray-900 mb-2",children:"Want to Try Again?"}),(0,nn.jsxs)("ul",{className:"text-sm text-gray-600 space-y-1",children:[(0,nn.jsx)("li",{children:"\u2022 Return to the event page to register again"}),(0,nn.jsx)("li",{children:"\u2022 Check your payment method details"}),(0,nn.jsx)("li",{children:"\u2022 Contact us at [email protected] if you need assistance"}),(0,nn.jsx)("li",{children:"\u2022 Registration spots are held for 15 minutes during checkout"})]})]})]}),(0,nn.jsxs)("div",{className:"mt-8 flex flex-col sm:flex-row gap-4",children:[(0,nn.jsx)(dt,{to:"/events/".concat(t),className:"flex-1 bg-apn-blue text-white py-3 px-6 rounded-lg text-center hover:bg-blue-700 transition duration-200",children:"Try Registration Again"}),(0,nn.jsx)(dt,{to:"/events",className:"flex-1 bg-gray-200 text-gray-800 py-3 px-6 rounded-lg text-center hover:bg-gray-300 transition duration-200",children:"Browse Other Events"}),(0,nn.jsx)(dt,{to:"/contact",className:"flex-1 bg-yellow-600 text-white py-3 px-6 rounded-lg text-center hover:bg-yellow-700 transition duration-200",children:"Contact Support"})]})]})]})})})},Wo=()=>{const{hasRole:t}=sn(),[n,r]=(0,e.useState)([]),[s,a]=(0,e.useState)([]),[i,o]=(0,e.useState)(!0),[l,c]=(0,e.useState)(null),[d,u]=(0,e.useState)(!0),[m,h]=(0,e.useState)("all"),[p,g]=(0,e.useState)(""),[f,x]=(0,e.useState)("newest"),b=[{id:2,title:"APN Q1 NEWSLETTER",image:"/images/news/q1-newsletter.png",date:"April 15, 2022",author:"Caroline Burnham",category:"News",excerpt:"Check out our Q1 newsletter with updates on recent events and upcoming opportunities.",content:"Full article content would go here..."}];(0,e.useEffect)(()=>{y()},[d,m]);const y=async()=>{try{if(o(!0),c(null),d){console.log("Loading articles from Firebase...");const e=await(0,wn.GE)(20,m);console.log("Articles from Firebase:",e);const t=await(0,wn.A0)(3);if(console.log("Featured articles from Firebase:",t),r(e),a(t),0===e.length)return console.log("No articles found in Firebase, falling back to static data..."),void u(!1)}else console.log("Loading articles from static data..."),r(b),a(b.filter(e=>e.featured))}catch(e){console.error("Error loading articles:",e),c(e.message),d&&(console.log("Firebase error, falling back to static data..."),u(!1))
2}finally{o(!1)}},v=[...n.filter(e=>{const t="all"===m||e.category.toLowerCase()===m.toLowerCase(),n=e.title.toLowerCase().includes(p.toLowerCase())||e.excerpt.toLowerCase().includes(p.toLowerCase());return t&&n})].sort((e,t)=>{if("newest"===f){var n,r;const s=null!==(n=e.publishedAt)&&void 0!==n&&n.toDate?e.publishedAt.toDate():new Date(e.date);return(null!==(r=t.publishedAt)&&void 0!==r&&r.toDate?t.publishedAt.toDate():new Date(t.date))-s}if("oldest"===f){var s,a;return(null!==(s=e.publishedAt)&&void 0!==s&&s.toDate?e.publishedAt.toDate():new Date(e.date))-(null!==(a=t.publishedAt)&&void 0!==a&&a.toDate?t.publishedAt.toDate():new Date(t.date))}return e.id-t.id});return i?(0,nn.jsx)("div",{className:"flex justify-center items-center min-h-screen",children:(0,nn.jsx)("div",{className:"animate-spin rounded-full h-12 w-12 border-t-2 border-b-2 border-apn-blue"})}):(0,nn.jsxs)("div",{className:"bg-white",children:[(0,nn.jsx)("div",{className:"bg-apn-blue text-white py-12",children:(0,nn.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:(0,nn.jsxs)("div",{className:"text-center",children:[(0,nn.jsx)("div",{className:"flex justify-center mb-4",children:(0,nn.jsx)("img",{src:"".concat("","/apn-logos/APN-Tag-white.jpg"),alt:"APN Logo",className:"h-16"})}),(0,nn.jsx)("h1",{className:"text-3xl font-bold",children:"News"}),(0,nn.jsx)("p",{className:"mt-2 text-xl",children:"Stay Updated with APN"})]})})}),(0,nn.jsx)("section",{className:"py-12",children:(0,nn.jsxs)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[(0,nn.jsxs)("div",{className:"mb-8 flex flex-col md:flex-row justify-between items-center space-y-4 md:space-y-0",children:[(0,nn.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,nn.jsx)("button",{onClick:()=>h("all"),className:"px-4 py-2 rounded-md ".concat("all"===m?"bg-apn-blue text-white":"bg-gray-200 text-gray-700 hover:bg-gray-300"),children:"All"}),(0,nn.jsx)("button",{onClick:()=>h("feature"),className:"px-4 py-2 rounded-md ".concat("feature"===m?"bg-apn-blue text-white":"bg-gray-200 text-gray-700 hover:bg-gray-300"),children:"Features"}),(0,nn.jsx)("button",{onClick:()=>h("news"),className:"px-4 py-2 rounded-md ".concat("news"===m?"bg-apn-blue text-white":"bg-gray-200 text-gray-700 hover:bg-gray-300"),children:"News"})]}),(0,nn.jsx)("div",{className:"w-full md:w-64",children:(0,nn.jsx)("input",{type:"text",placeholder:"Search news...",value:p,onChange:e=>g(e.target.value),className:"w-full px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue"})})]}),(0,nn.jsx)("div",{className:"mb-8 flex justify-center",children:(0,nn.jsxs)("div",{className:"inline-flex rounded-md shadow-sm",role:"group",children:[(0,nn.jsx)("button",{onClick:()=>x("newest"),className:"px-4 py-2 text-sm font-medium rounded-l-lg ".concat("newest"===f?"bg-apn-blue text-white":"bg-white text-gray-700 border border-gray-300 hover:bg-gray-100"),children:"Newest"}),(0,nn.jsx)("button",{onClick:()=>x("oldest"),className:"px-4 py-2 text-sm font-medium ".concat("oldest"===f?"bg-apn-blue text-white":"bg-white text-gray-700 border-t border-b border-gray-300 hover:bg-gray-100"),children:"Oldest"}),(0,nn.jsx)("button",{onClick:()=>x("comments"),className:"px-4 py-2 text-sm font-medium ".concat("comments"===f?"bg-apn-blue text-white":"bg-white text-gray-700 border-t border-b border-gray-300 hover:bg-gray-100"),children:"Most Comments"}),(0,nn.jsx)("button",{onClick:()=>x("views"),className:"px-4 py-2 text-sm font-medium rounded-r-lg ".concat("views"===f?"bg-apn-blue text-white":"bg-white text-gray-700 border border-gray-300 hover:bg-gray-100"),children:"Most Views"})]})}),v.length>0?(0,nn.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8",children:v.map(e=>{var t;return(0,nn.jsxs)("div",{className:"bg-white rounded-lg shadow-lg overflow-hidden border border-gray-200",children:[(0,nn.jsx)(dt,{to:"/news/".concat(e.id),className:"block h-48 bg-white relative overflow-hidden",children:(0,nn.jsx)("div",{className:"h-full w-full overflow-hidden flex items-center justify-center bg-white",children:(0,nn.jsx)("img",{src:"".concat("").concat(e.image),alt:e.title,className:"h-full w-full object-contain transition-transform duration-300 hover:scale-105",onError:e=>{e.target.onerror=null,e.target.src="".concat("","/apn-logos/APN-blue (1).png")}})})}),(0,nn.jsxs)("div",{className:"p-6",children:[(0,nn.jsxs)("div",{className:"flex items-center mb-2",children:[(0,nn.jsx)("span",{className:"inline-block bg-apn-blue text-white text-xs px-2 py-1 rounded",children:e.category}),(0,nn.jsx)("span",{className:"text-gray-500 text-sm ml-2",children:null!==(t=e.publishedAt)&&void 0!==t&&t.toDate?e.publishedAt.toDate().toLocaleDateString():e.date})]}),(0,nn.jsx)("h3",{className:"text-xl font-bold mb-2",children:e.title}),(0,nn.jsx)("p",{className:"text-gray-600 mb-4",children:e.excerpt}),(0,nn.jsx)("div",{className:"flex items-center text-gray-500 text-sm mb-4",children:(0,nn.jsxs)("span",{children:["By ",e.author]})}),(0,nn.jsx)(dt,{to:"/news/".concat(e.id),className:"block w-full bg-apn-blue text-white text-center py-2 px-4 roun
2ded hover:bg-blue-700 transition duration-200",children:"Read More"})]})]},e.id)})}):(0,nn.jsx)("div",{className:"text-center py-12",children:(0,nn.jsx)("p",{className:"text-xl text-gray-600",children:"No news articles found matching your search."})}),(0,nn.jsx)("div",{className:"mt-12 flex justify-center",children:(0,nn.jsxs)("nav",{className:"inline-flex rounded-md shadow",children:[(0,nn.jsx)("a",{href:"#",className:"px-4 py-2 rounded-l-md border border-gray-300 bg-white text-gray-700 hover:bg-gray-50",children:"Previous"}),(0,nn.jsx)("a",{href:"#",className:"px-4 py-2 border-t border-b border-gray-300 bg-apn-blue text-white",children:"1"}),(0,nn.jsx)("a",{href:"#",className:"px-4 py-2 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-50",children:"2"}),(0,nn.jsx)("a",{href:"#",className:"px-4 py-2 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-50",children:"3"}),(0,nn.jsx)("a",{href:"#",className:"px-4 py-2 rounded-r-md border border-gray-300 bg-white text-gray-700 hover:bg-gray-50",children:"Next"})]})})]})}),(0,nn.jsx)("section",{className:"py-12 bg-gray-50",children:(0,nn.jsxs)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[(0,nn.jsx)("div",{className:"text-center mb-8",children:(0,nn.jsx)("h2",{className:"text-2xl font-bold text-gray-900",children:"Featured News"})}),(0,nn.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:n.filter(e=>"Feature"===e.category).slice(0,3).map(e=>(0,nn.jsxs)("div",{className:"bg-white rounded-lg shadow-md overflow-hidden",children:[(0,nn.jsx)(dt,{to:"/news/".concat(e.id),className:"block h-40 bg-white relative overflow-hidden",children:(0,nn.jsx)("div",{className:"h-full w-full overflow-hidden flex items-center justify-center bg-white",children:(0,nn.jsx)("img",{src:"".concat("").concat(e.image),alt:e.title,className:"h-full w-full object-contain transition-transform duration-300 hover:scale-105",onError:e=>{e.target.onerror=null,e.target.src="".concat("","/apn-logos/APN-blue (1).png")}})})}),(0,nn.jsxs)("div",{className:"p-4",children:[(0,nn.jsx)("h3",{className:"font-bold text-lg mb-2",children:e.title}),(0,nn.jsx)("p",{className:"text-gray-600 text-sm mb-4",children:e.excerpt}),(0,nn.jsx)(dt,{to:"/news/".concat(e.id),className:"text-apn-blue hover:underline text-sm",children:"Read More \u2192"})]})]},e.id))})]})}),(0,nn.jsx)("section",{className:"bg-apn-blue text-white py-12",children:(0,nn.jsxs)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 text-center",children:[(0,nn.jsx)("div",{className:"flex justify-center mb-6",children:(0,nn.jsx)("img",{src:"".concat("","/apn-logos/APN-Tag-SQ-white.jpg"),alt:"APN Logo Square",className:"h-20"})}),(0,nn.jsx)("h2",{className:"text-3xl font-bold mb-4",children:"Ready to Join the Network?"}),(0,nn.jsx)("p",{className:"text-xl mb-8 max-w-3xl mx-auto",children:"Connect with finance professionals, access exclusive resources, and accelerate your career with APN."}),(0,nn.jsx)(dt,{to:"/register",className:"btn-primary bg-white text-apn-blue hover:bg-gray-100",children:"Become a Member Today"})]})})]})},Ho=t=>{let{article:n,isLoggedIn:r,isAdmin:a,isMember:i}=t;const{currentUser:o,userProfile:l}=sn(),[c,d]=(0,e.useState)(""),[u,m]=(0,e.useState)([]),[h,p]=(0,e.useState)(!0),[g,f]=(0,e.useState)(!1),[x,b]=(0,e.useState)(!1),[y,v]=(0,e.useState)((null===n||void 0===n?void 0:n.likeCount)||0),[w,j]=(0,e.useState)(!1),[N,k]=(0,e.useState)(null),A=(0,e.useCallback)(async()=>{try{p(!0);const e=await(0,wn.fz)(n.id);m(e)}catch(e){console.error("Error loading comments:",e)}finally{p(!1)}},[n.id]);(0,e.useEffect)(()=>{null!==n&&void 0!==n&&n.id&&(A(),o&&n.likes&&b(n.likes.includes(o.uid)))},[null===n||void 0===n?void 0:n.id,null===n||void 0===n?void 0:n.likes,o,A]);const S=async()=>{if(o&&i)try{const e=await(0,wn.a9)(n.id,o.uid);b(e),v(t=>e?t+1:t-1)}catch(e){console.error("Error toggling article like:",e)}};return(0,nn.jsxs)("div",{className:"bg-white rounded-lg shadow-md mt-8",children:[(0,nn.jsx)("div",{className:"p-4 border-b border-gray-200",children:(0,nn.jsxs)("div",{className:"flex items-center justify-between",children:[(0,nn.jsx)("div",{className:"flex items-center space-x-4",children:(0,nn.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,nn.jsxs)("span",{className:"text-gray-600",children:[y," ",1===y?"like"
2:"likes"]}),(0,nn.jsxs)("span",{className:"text-gray-600",children:[u.length," ",1===u.length?"comment":"comments"]})]})}),(0,nn.jsxs)("div",{className:"flex items-center space-x-2",children:[i?(0,nn.jsxs)(nn.Fragment,{children:[(0,nn.jsxs)("button",{onClick:S,className:"flex items-center space-x-1 px-3 py-1 rounded-md transition-colors ".concat(x?"bg-apn-blue text-white":"bg-gray-100 text-gray-700 hover:bg-gray-200"),children:[(0,nn.jsx)("span",{children:"\ud83d\udc4d"}),(0,nn.jsx)("span",{children:x?"Liked":"Like"})]}),(0,nn.jsxs)("div",{className:"relative",onMouseEnter:()=>{N&&clearTimeout(N);const e=setTimeout(()=>{j(!0)},500);k(e)},onMouseLeave:()=>{N&&clearTimeout(N),setTimeout(()=>{j(!1)},200)},children:[(0,nn.jsxs)("button",{className:"flex items-center space-x-1 px-3 py-1 rounded-md bg-gray-100 text-gray-700 hover:bg-gray-200 transition-colors",children:[(0,nn.jsx)("span",{children:"\ud83d\ude0a"}),(0,nn.jsx)("span",{children:"React"})]}),w&&(0,nn.jsx)("div",{className:"absolute bottom-full left-0 mb-2 bg-white border border-gray-200 rounded-lg shadow-lg p-2 flex space-x-1 z-10",children:[{emoji:"\ud83d\udc4d",name:"Like"},{emoji:"\u2764\ufe0f",name:"Love"},{emoji:"\ud83d\ude02",name:"Laugh"},{emoji:"\ud83d\ude2e",name:"Wow"},{emoji:"\ud83d\ude22",name:"Sad"},{emoji:"\ud83d\ude21",name:"Angry"}].map(e=>(0,nn.jsx)("button",{onClick:()=>{S(),j(!1)},className:"p-2 hover:bg-gray-100 rounded transition-colors",title:e.name,children:(0,nn.jsx)("span",{className:"text-xl",children:e.emoji})},e.name))})]})]}):(0,nn.jsx)("div",{className:"text-gray-500 text-sm",children:r?"Membership required to react":"Login to react"}),(0,nn.jsxs)("button",{onClick:()=>{const e=window.location.href,t="https://www.linkedin.com/sharing/share-offsite/?url=".concat(encodeURIComponent(e));window.open(t,"_blank")},className:"flex items-center space-x-1 px-3 py-1 rounded-md bg-blue-600 text-white hover:bg-blue-700 transition-colors",children:[(0,nn.jsx)("span",{children:"\ud83d\udce4"}),(0,nn.jsx)("span",{children:"LinkedIn"})]}),(0,nn.jsxs)("button",{onClick:()=>{const e=window.location.href,t="Check out this article: ".concat(n.title),r="https://twitter.com/intent/tweet?text=".concat(encodeURIComponent(t),"&url=").concat(encodeURIComponent(e));window.open(r,"_blank")},className:"flex items-center space-x-1 px-3 py-1 rounded-md bg-black text-white hover:bg-gray-800 transition-colors",children:[(0,nn.jsx)("span",{children:"\ud83d\udce4"}),(0,nn.jsx)("span",{children:"X"})]})]})]})}),i?(0,nn.jsx)("div",{className:"p-4 border-b border-gray-200",children:(0,nn.jsxs)("form",{onSubmit:async e=>{if(e.preventDefault(),c.trim())if(o)if(i)try{f(!0);const e={content:c.trim(),authorId:o.uid,authorName:null!==l&&void 0!==l&&l.firstName&&null!==l&&void 0!==l&&l.lastName?"".concat(l.firstName," ").concat(l.lastName):(null===l||void 0===l?void 0:l.displayName)||"Anonymous User",authorEmail:o.email};await(0,wn.Py)(n.id,e),d(""),await A(),(0,Rr.oc)("Comment added successfully!")}catch(t){(0,Rr.H4)(t,{context:{component:"ArticleComments",action:"submitComment",articleId:n.id}})}finally{f(!1)}else(0,Rr.Fq)("You must be a member to comment.");else(0,Rr.Fq)("You must be logged in to comment.");else(0,Rr.Fq)("Please enter a comment.")},className:"space-y-4",children:[(0,nn.jsx)("div",{children:(0,nn.jsx)("textarea",{value:c,onChange:e=>d(e.target.value),placeholder:"Share your thoughts on this article...",className:"w-full p-3 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue resize-none",rows:"3",disabled:g})}),(0,nn.jsx)("div",{className:"flex justify-end",children:(0,nn.jsx)("button",{type:"submit",disabled:!c.trim()||g,className:"px-4 py-2 bg-apn-blue text-white rounded-md hover:bg-blue-700 disabled:bg-gray-300 disabled:cursor-not-allowed transition-colors",children:g?"Posting...":"Post Comment"})})]})}):(0,nn.jsx)("div",{className:"p-4 border-b border-gray-200 text-center",children:(0,nn.jsx)("p",{className:"text-gray-600",children:r?"Membership required to comment on articles.":"Please log in and become a member to comment on articles."})}),(0,nn.jsx)("div",{className:"p-4",children:h?(0,nn.jsxs)("div",{className:"text-center py-8",children:[(0,nn.jsx)("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-apn-blue mx-auto"}),(0,nn.jsx)("p",{className:"text-gray-500 mt-2",children:"Loading comments..."})]}):0===u.length?(0,nn.jsx)("div",{className:"text-center py-8",children:(0,nn.jsx)("p",{className:"text-gray-500",children:"Be the first to comment on this article!"})}):(0,nn.jsx)("div",{className:"space-y-6",children:u.map(e=>{var t,r,l;return(0,nn.jsxs)("div",{className:"flex",children:[(0,nn.jsx)("div",{className:"flex-shrink-0 mr-3",children:(0,nn.jsx)("div",{className:"h-10 w-10 rounded-full bg-apn-blue text-white flex items-center justify-center",children:e.authorName?e.authorName.charAt(0).toUpperCase():"U"})}),(0,nn.jsx)("div",{className:"flex-grow",children:(0,nn.jsxs)("div",{className:"bg-gray-50 rounded-lg p-4",children:[(0,nn.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,nn.jsx)("h4",{className:"font-semibold text-gray-900",children:e.authorName||"Anonymous"}),(0,nn.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,nn.jsx)("span",{className:"text-sm text-gray-500",children:null!==(t=e.createdAt)&&void 0!==t&&null!==(r=t.toDate)&&void 0!==r&&r.call(t)?e.createdAt.toDate().toLocaleDateString():"Recently"}),a&&(0,nn.jsx)("button",{onClick:()=>(async e=>{if(a){if(window.confirm("Are you sure you want to delete this comment? This action cannot be undone."))try{await(0,wn.Xf)(e,n.id),await A(),(0,Rr.oc)("Comment deleted successfully.")}catch(t){(0,Rr.H4)(t,{context:{component:"ArticleComments",action:"deleteComment",commentId:e,articleId:n.id}})}}else(0,Rr.Fq)("You do not have permission to delete comments.")})(e.id),className:"text-red-600 hover:text-red-800 text-sm",title:"Delete comment",children:"\ud83d\uddd1\ufe0f"})]})]}),(0,nn.jsx)("p",{className:"text-gray-700 mb-3",children:e.content}),(0,nn.jsx)("div",{className:"flex items-center space-x-4",children:i?(0,nn.jsxs)("button",{onClick:()=>(async e=>{if(o&&i)try{const t=await(0,wn.HJ)(e,o.uid);m(n=>n.map(n=>n.id===e?(0,s.A)((0,s.A)({},n),{},{likes:t?[...n.likes||[],o.uid]:(n.likes||[]).filter(e=>e!==o.uid),likeCount:t?(n.likeCount||0)+1:(n.likeCount||0)-1}):n))}catch(t){console.error("Error toggling comment like:",t)}})(e.id),className:"flex items-center space-x-1 text-sm ".concat(null!==(l=e.likes)&&void 0!==l&&l.includes(null===o||void 0===o?void 0:o.uid)?"text-apn-blue":"text-gray-500 hover:text-apn-blue"),children:[(0,nn.jsx)("span",{children:"\ud83d\udc4d"}),(0,nn.jsx)("span",{children:e.likeCount||0})]}):(0,nn.jsxs)("span",{className:"flex items-center space-x-1 text-sm text-gray-500",children:[(0,nn.jsx)("span",{children:"\ud83d\udc4d"}),(0,nn.jsx)("span",{children:e.likeCount||0})]})})]})})]},e.id)})})})]})},Go=()=>{var t;const{id:n}=le(),{currentUser:r,hasRole:s,isActiveMember:a}=sn(),[i,o]=(0,e.useState)(null),[l,c]=(0,e.useState)(!0),[,d]=(0,e.useState)(null),u=!!r,m=s("admin"),h=a(),p=[{id:2,title:"APN Q1 NEWSLETTER",image:"/images/news/q1-newsletter-full.png",date:"April 11, 2022",author:"Caroline Burnham",category:"News",content:'\n <div class="news-content">\n <h2 class="text-2xl font-bold mb-4">WE ARE LIVE!</h2>\n <p class="mb-4">We are proud to announce that our website is now accessible to all prospective members of APN. Current features that we have rolled out include the membership and event registration pages, in addition to articles that detail updates about our members, general network announcements, and notifications about new events.</p>\n \n <p class="mb-6">Over the course of the coming months, APN will keep you updated via email on the rollout of new features to the site including the member directory, job posting and project posting functionality, activity forum, member group pages, and much more.</p>\n \n <p class="mb-2"><strong>SOCIAL MEDIA:</strong> APN is now active on social media. Make sure to give us a follow! You can also access our social media pages through the upper right corner of the website or through the Contact Us page.</p>\n \n <div class="flex space-x-4 my-6">\n <a href="https://www.linkedin.com/company/accelerated-professionals-network/about/?viewAsMember=true" target="_blank" rel="noopener noreferrer" class="social-link">\n <img src="/images/social/linkedin.png" alt="LinkedIn" class="w-8 h-8" />\n </a>\n <a href="https://www.instagram.com/the_apn_/" target="_blank" rel="noopener noreferrer" class="social-link">\n <img src="/images/social/instagram.png" alt="Instagram" class="w-8 h-8" />\n </a>\n <a href="https://twitter.com/the_apn_" target="_blank" rel="noopener noreferrer" class="social-link">\n <img src="/images/social/twitter.png" alt="Twitter" class="w-8 h-8" />\n </a>\n </div>\n \n <h2 class="text-2xl font-bold mb-4">Join us for our first IN-PERSON event!</h2>\n <p class="mb-6">APN is excited to be hosting our first event at Printers Alley on Tuesday, April 12th from 6:30-8:30pm. Check out the Events page to register.</p>\n \n <h2 class="text-2xl font-bold mb-4">
2MEMBERSHIP</h2>\n <p class="mb-6">Prospective members can now register to become an official part of the Accelerated Professionals Network. Membership will be on a tiered system, so make sure to register for the correct one! All details are on the Membership page. Feel free to contact Cara with any questions.</p>\n \n <h2 class="text-2xl font-bold mb-4">Recommended Business Books</h2>\n <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-6">\n <div class="bg-gray-100 p-4 rounded-lg">\n <h3 class="font-bold mb-2">Rich Dad Poor Dad</h3>\n <p>A classic personal finance book that teaches important lessons about money and investing.</p>\n </div>\n <div class="bg-gray-100 p-4 rounded-lg">\n <h3 class="font-bold mb-2">How to Win Friends and Influence People</h3>\n <p>Dale Carnegie\'s timeless advice on building relationships and effective communication.</p>\n </div>\n </div>\n </div>\n '}],g=(0,e.useCallback)(async()=>{try{c(!0),d(null);let e=await(0,wn.zE)(n);e||(console.log("Article not found in Firebase, trying static data..."),e=p.find(e=>e.id===parseInt(n))),o(e)}catch(e){console.error("Error loading article:",e),d(e.message);const t=p.find(e=>e.id===parseInt(n));o(t)}finally{c(!1)}},[n,d]);return(0,e.useEffect)(()=>{g()},[g]),l?(0,nn.jsx)("div",{className:"flex justify-center items-center min-h-screen",children:(0,nn.jsx)("div",{className:"animate-spin rounded-full h-12 w-12 border-t-2 border-b-2 border-apn-blue"})}):i?(0,nn.jsxs)("div",{className:"bg-white",children:[(0,nn.jsx)("div",{className:"bg-apn-blue text-white py-12",children:(0,nn.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:(0,nn.jsxs)("div",{className:"text-center",children:[(0,nn.jsx)("div",{className:"flex justify-center mb-4",children:(0,nn.jsx)("img",{src:"".concat("","/apn-logos/APN-Tag-white.jpg"),alt:"APN Logo",className:"h-16"})}),(0,nn.jsx)("h1",{className:"text-3xl font-bold",children:i.title})]})})}),(0,nn.jsx)("section",{className:"py-12",children:(0,nn.jsxs)("div",{className:"max-w-4xl mx-auto px-4 sm:px-6 lg:px-8",children:[(0,nn.jsxs)("div",{className:"mb-8",children:[(0,nn.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("span",{className:"inline-block bg-apn-blue text-white text-xs px-2 py-1 rounded mr-2",children:i.category}),(0,nn.jsx)("span",{className:"text-gray-500 text-sm",children:null!==(t=i.publishedAt)&&void 0!==t&&t.toDate?i.publishedAt.toDate().toLocaleDateString():i.date})]}),(0,nn.jsxs)("div",{className:"text-gray-500 text-sm",children:["By ",i.author]})]}),(0,nn.jsx)("div",{className:"mb-8",children:(0,nn.jsx)("img",{src:"".concat("").concat(i.image),alt:i.title,className:"w-full h-auto rounded-lg shadow-md"})}),(0,nn.jsx)("div",{className:"prose max-w-none",dangerouslySetInnerHTML:{__html:i.content}}),(0,nn.jsxs)("div",{className:"mt-12 pt-6 border-t border-gray-200",children:[(0,nn.jsx)("h3",{className:"text-lg font-semibold mb-4",children:"Share This Article"}),(0,nn.jsxs)("div",{className:"flex space-x-4",children:[(0,nn.jsx)("a",{href:"https://www.linkedin.com/shareArticle?mini=true&url=".concat(encodeURIComponent(window.location.href),"&title=").concat(encodeURIComponent(i.title)),target:"_blank",rel:"noopener noreferrer",className:"text-gray-500 hover:text-apn-blue transition-colors",children:(0,nn.jsx)("img",{src:"/images/social/linkedin.png",alt:"LinkedIn",className:"w-6 h-6"})}),(0,nn.jsx)("a",{href:"https://twitter.com/intent/tweet?text=".concat(encodeURIComponent(i.title),"&url=").concat(encodeURIComponent(window.location.href)),target:"_blank",rel:"noopener noreferrer",className:"text-gray-500 hover:text-apn-blue transition-colors",children:(0,nn.jsx)("img",{src:"/images/social/twitter.png",alt:"Twitter",className:"w-6 h-6"})}),(0,nn.jsx)("a",{href:"mailto:?subject=".concat(encodeURIComponent(i.title),"&body=").concat(encodeURIComponent(window.location.href)),className:"text-gray-500 hover:text-apn-blue transition-colors",children:(0,nn.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})})})]})]})]}),(0,nn.jsx)(Ho,{article:i,isLoggedIn:u,isAdmin:m,isMember:h}),(0,nn.jsx)("div",{className:"mt-8 text-center",children:(0,nn.jsx)(dt,{to:"/news",className:"btn-primary",children:"Back to News"})})]})})]}):(0,nn.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12",children:(0,nn.jsxs)("div",{className:"text-center",children:[(0,nn.jsx)("h1",{className:"text-3xl font-bold text-gray-900 mb-4",children:"Article Not Found"}),(0,nn.jsx)("p",{className:"text-lg text-gray-600 mb-8",children:"The article you're looking for doesn't exist or has been removed."}),(0,nn.jsx)(dt,{to:"/news",className:"btn-primary",children:"Back to News"})]})})},Yo=Math.min,Ko=Math.max,Jo=Math.round,$o=Math.floor,Qo=e=>({x:e,y:e}
vendor: 4,711 bytes, line 2
2),Xo={left:"right",right:"left",bottom:"top",top:"bottom"},Zo={start:"end",end:"start"};function el(e,t,n){return Ko(e,Yo(t,n))}function tl(e,t){return"function"===typeof e?e(t):e}function nl(e){return e.split("-")[0]}function rl(e){return e.split("-")[1]}function sl(e){return"x"===e?"y":"x"}function al(e){return"y"===e?"height":"width"}function il(e){return["top","bottom"].includes(nl(e))?"y":"x"}function ol(e){return sl(il(e))}function ll(e){return e.replace(/start|end/g,e=>Zo[e])}function cl(e){return e.replace(/left|right|bottom|top/g,e=>Xo[e])}function dl(e){return"number"!==typeof e?function(e){return(0,s.A)({top:0,right:0,bottom:0,left:0},e)}(e):{top:e,right:e,bottom:e,left:e}}function ul(e){const{x:t,y:n,width:r,height:s}=e;return{width:r,height:s,top:n,left:t,right:t+r,bottom:n+s,x:t,y:n}}const ml=["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment"],hl=["mainAxis","crossAxis","limiter"];function pl(e,t,n){let{reference:r,floating:s}=e;const a=il(t),i=ol(t),o=al(i),l=nl(t),c="y"===a,d=r.x+r.width/2-s.width/2,u=r.y+r.height/2-s.height/2,m=r[o]/2-s[o]/2;let h;switch(l){case"top":h={x:d,y:r.y-s.height};break;case"bottom":h={x:d,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:u};break;case"left":h={x:r.x-s.width,y:u};break;default:h={x:r.x,y:r.y}}switch(rl(t)){case"start":h[i]-=m*(n&&c?-1:1);break;case"end":h[i]+=m*(n&&c?-1:1)}return h}async function gl(e,t){var n;void 0===t&&(t={});const{x:r,y:s,platform:a,rects:i,elements:o,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:m=!1,padding:h=0}=tl(t,e),p=dl(h),g=o[m?"floating"===u?"reference":"floating":u],f=ul(await a.getClippingRect({element:null==(n=await(null==a.isElement?void 0:a.isElement(g)))||n?g:g.contextElement||await(null==a.getDocumentElement?void 0:a.getDocumentElement(o.floating)),boundary:c,rootBoundary:d,strategy:l})),x="floating"===u?{x:r,y:s,width:i.floating.width,height:i.floating.height}:i.reference,b=await(null==a.getOffsetParent?void 0:a.getOffsetParent(o.floating)),y=await(null==a.isElement?void 0:a.isElement(b))&&await(null==a.getScale?void 0:a.getScale(b))||{x:1,y:1},v=ul(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:x,offsetParent:b,strategy:l}):x);return{top:(f.top-v.top+p.top)/y.y,bottom:(v.bottom-f.bottom+p.bottom)/y.y,left:(f.left-v.left+p.left)/y.x,right:(v.right-f.right+p.right)/y.x}}function fl(){return"undefined"!==typeof window}function xl(e){return vl(e)?(e.nodeName||"").toLowerCase():"#document"}function bl(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function yl(e){var t;return null==(t=(vl(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function vl(e){return!!fl()&&(e instanceof Node||e instanceof bl(e).Node)}function wl(e){return!!fl()&&(e instanceof Element||e instanceof bl(e).Element)}function jl(e){return!!fl()&&(e instanceof HTMLElement||e instanceof bl(e).HTMLElement)}function Nl(e){return!(!fl()||"undefined"===typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof bl(e).ShadowRoot)}function kl(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=Pl(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(s)}function Al(e){return["table","td","th"].includes(xl(e))}function Sl(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch(Nd){return!1}})}function El(e){const t=Cl(),n=wl(e)?Pl(e):e;return["transform","translate","scale","rotate","perspective"].some(e=>!!n[e]&&"none"!==n[e])||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","translate","scale","rotate","perspective","filter"].some(e=>(n.willChange||"").includes(e))||["paint","layout","strict","content"].some(e=>(n.contain||"").includes(e))}function Cl(){return!("undefined"===typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function Tl(e){return["html","body","#document"].includes(xl(e))}function Pl(e){return bl(e).getComputedStyle(e)}function _l(e){return wl(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Il(e){if("html"===xl(e))return e;const t=e.assignedSlot||e.parentNode||Nl(e)&&e.host||yl(e);return Nl(t)?t.host:t}function Dl(e){const t=Il(e);return Tl(t)?e.ownerDocument?e.ownerDocument.body:e.body:jl(t)&&kl(t)?t:Dl(t)}function Rl(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const s=Dl(e),a=s===(null==(r=e.ownerDocument)?void 0:r.body),i=bl(s);if(a){const e=Ll(i);
vendor: 5,737 bytes, line 2
2return t.concat(i,i.visualViewport||[],kl(s)?s:[],e&&n?Rl(e):[])}return t.concat(s,Rl(s,[],n))}function Ll(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ml(e){const t=Pl(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=jl(e),a=s?e.offsetWidth:n,i=s?e.offsetHeight:r,o=Jo(n)!==a||Jo(r)!==i;return o&&(n=a,r=i),{width:n,height:r,$:o}}function Ol(e){return wl(e)?e:e.contextElement}function Fl(e){const t=Ol(e);if(!jl(t))return Qo(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:a}=Ml(t);let i=(a?Jo(n.width):n.width)/r,o=(a?Jo(n.height):n.height)/s;return i&&Number.isFinite(i)||(i=1),o&&Number.isFinite(o)||(o=1),{x:i,y:o}}const Ul=Qo(0);function Bl(e){const t=bl(e);return Cl()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Ul}function zl(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const s=e.getBoundingClientRect(),a=Ol(e);let i=Qo(1);t&&(r?wl(r)&&(i=Fl(r)):i=Fl(e));const o=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==bl(e))&&t}(a,n,r)?Bl(a):Qo(0);let l=(s.left+o.x)/i.x,c=(s.top+o.y)/i.y,d=s.width/i.x,u=s.height/i.y;if(a){const e=bl(a),t=r&&wl(r)?bl(r):r;let n=e,s=Ll(n);for(;s&&r&&t!==n;){const e=Fl(s),t=s.getBoundingClientRect(),r=Pl(s),a=t.left+(s.clientLeft+parseFloat(r.paddingLeft))*e.x,i=t.top+(s.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,c*=e.y,d*=e.x,u*=e.y,l+=a,c+=i,n=bl(s),s=Ll(n)}}return ul({width:d,height:u,x:l,y:c})}function Vl(e,t){const n=_l(e).scrollLeft;return t?t.left+n:zl(yl(e)).left+n}function ql(e,t,n){void 0===n&&(n=!1);const r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-(n?0:Vl(e,r)),y:r.top+t.scrollTop}}function Wl(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=bl(e),r=yl(e),s=n.visualViewport;let a=r.clientWidth,i=r.clientHeight,o=0,l=0;if(s){a=s.width,i=s.height;const e=Cl();(!e||e&&"fixed"===t)&&(o=s.offsetLeft,l=s.offsetTop)}return{width:a,height:i,x:o,y:l}}(e,n);else if("document"===t)r=function(e){const t=yl(e),n=_l(e),r=e.ownerDocument.body,s=Ko(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=Ko(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+Vl(e);const o=-n.scrollTop;return"rtl"===Pl(r).direction&&(i+=Ko(t.clientWidth,r.clientWidth)-s),{width:s,height:a,x:i,y:o}}(yl(e));else if(wl(t))r=function(e,t){const n=zl(e,!0,"fixed"===t),r=n.top+e.clientTop,s=n.left+e.clientLeft,a=jl(e)?Fl(e):Qo(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:s*a.x,y:r*a.y}}(t,n);else{const n=Bl(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return ul(r)}function Hl(e,t){const n=Il(e);return!(n===t||!wl(n)||Tl(n))&&("fixed"===Pl(n).position||Hl(n,t))}function Gl(e,t,n){const r=jl(t),s=yl(t),a="fixed"===n,i=zl(e,!0,a,t);let o={scrollLeft:0,scrollTop:0};const l=Qo(0);if(r||!r&&!a)if(("body"!==xl(t)||kl(s))&&(o=_l(t)),r){const e=zl(t,!0,a,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else s&&(l.x=Vl(s));const c=!s||r||a?Qo(0):ql(s,o);return{x:i.left+o.scrollLeft-l.x-c.x,y:i.top+o.scrollTop-l.y-c.y,width:i.width,height:i.height}}function Yl(e){return"static"===Pl(e).position}function Kl(e,t){if(!jl(e)||"fixed"===Pl(e).position)return null;if(t)return t(e);let n=e.offsetParent;return yl(e)===n&&(n=n.ownerDocument.body),n}function Jl(e,t){const n=bl(e);if(Sl(e))return n;if(!jl(e)){let t=Il(e);for(;t&&!Tl(t);){if(wl(t)&&!Yl(t))return t;t=Il(t)}return n}let r=Kl(e,t);for(;r&&Al(r)&&Yl(r);)r=Kl(r,t);return r&&Tl(r)&&Yl(r)&&!El(r)?n:r||function(e){let t=Il(e);for(;jl(t)&&!Tl(t);){if(El(t))return t;if(Sl(t))return null;t=Il(t)}return null}(e)||n}const $l={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const a="fixed"===s,i=yl(r),o=!!t&&Sl(t.floating);if(r===i||o&&a)return n;let l={scrollLeft:0,scrollTop:0},c=Qo(1);const d=Qo(0),u=jl(r);if((u||!u&&!a)&&(("body"!==xl(r)||kl(i))&&(l=_l(r)),jl(r))){const e=zl(r);c=Fl(r),d.x=e.x+r.clientLeft,d.y=e.y+r.clientTop}const m=!i||u||a?Qo(0):ql(i,l,!0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+d.x+m.x,y:n.y*c.y-l.scrollTop*c.y+d.y+m.y}},getDocumentElement:yl,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const a=[..."clippingAncestors"===n?Sl(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=Rl(e,[],!1).filter(e=>wl(e)&&"body"!==xl(e)),s=null;const a="fixed"===Pl(e).position;let i=a?Il(e):e;for(;wl(i)&&!Tl(i);){const t=Pl(i),n=El(i);n||"fixed"!==t.position||(s=null),(a?!n&&!s:!n&&"static"===t.position&&s&&["absolute","fixed"].includes(s.position)||kl(i)&&!n&&Hl(e,i))?r=r.filter(e=>e!==i):s=t,i=Il(i)}return t.set(e,r),r}(t,this._c):[].concat(n),r],i=a[0],o=a.reduce((e,n)=>{const r=Wl(t,n,s);return e.top=Ko(r.top,e.top),e.right=Yo(r.right,e.right),e.bottom=Yo(r.bottom,e.bottom),e.left=Ko(r.left,e.left),e},Wl(t,i,s));return{width:o.right-o.left,height:o.bottom-o.top,x:o.left,y:o.top}},getOffsetParent:Jl,getElementRects:async function(e){const t=this.getOffsetParent||Jl,n=this.getDimensions,r=await n(e.floating);return{reference:Gl(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=Ml(e);return{width:t,height:n}},getScale:Fl,isElement:wl,isRTL:function(e){return"rtl"===Pl(e).direction}};function Ql(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Xl(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:a=!0,ancestorResize:i=!0,elementResize:o="function"===typeof ResizeObserver,layoutShift:l="function"===typeof IntersectionObserver,animationFrame:c=!1}=r,d=Ol(e),u=a||i?[...d?Rl(d):[],...Rl(t)]:[];
2u.forEach(e=>{a&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)});const m=d&&l?function(e,t){let n,r=null;const a=yl(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function o(l,c){void 0===l&&(l=!1),void 0===c&&(c=1),i();const d=e.getBoundingClientRect(),{left:u,top:m,width:h,height:p}=d;if(l||t(),!h||!p)return;const g={rootMargin:-$o(m)+"px "+-$o(a.clientWidth-(u+h))+"px "+-$o(a.clientHeight-(m+p))+"px "+-$o(u)+"px",threshold:Ko(0,Yo(1,c))||1};let f=!0;function x(t){const r=t[0].intersectionRatio;if(r!==c){if(!f)return o();r?o(!1,r):n=setTimeout(()=>{o(!1,1e-7)},1e3)}1!==r||Ql(d,e.getBoundingClientRect())||o(),f=!1}try{r=new IntersectionObserver(x,(0,s.A)((0,s.A)({},g),{},{root:a.ownerDocument}))}catch(Nd){r=new IntersectionObserver(x,g)}r.observe(e)}(!0),i}(d,n):null;let h,p=-1,g=null;o&&(g=new ResizeObserver(e=>{let[r]=e;r&&r.target===d&&g&&(g.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=g)||e.observe(t)})),n()}),d&&!c&&g.observe(d),g.observe(t));let f=c?zl(e):null;return c&&function t(){const r=zl(e);f&&!Ql(f,r)&&n();f=r,h=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach(e=>{a&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)}),null==m||m(),null==(e=g)||e.disconnect(),g=null,c&&cancelAnimationFrame(h)}}const Zl=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:a,y:i,placement:o,middlewareData:l}=t,c=await async function(e,t){const{placement:n,platform:r,elements:s}=e,a=await(null==r.isRTL?void 0:r.isRTL(s.floating)),i=nl(n),o=rl(n),l="y"===il(n),c=["left","top"].includes(i)?-1:1,d=a&&l?-1:1,u=tl(t,e);let{mainAxis:m,crossAxis:h,alignmentAxis:p}="number"===typeof u?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return o&&"number"===typeof p&&(h="end"===o?-1*p:p),l?{x:h*d,y:m*c}:{x:m*c,y:h*d}}(t,e);return o===(null==(n=l.offset)?void 0:n.placement)&&null!=(r=l.arrow)&&r.alignmentOffset?{}:{x:a+c.x,y:i+c.y,data:(0,s.A)((0,s.A)({},c),{},{placement:o})}}}},ec=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:a,placement:i}=t,o=tl(e,t),{mainAxis:l=!0,crossAxis:c=!1,limiter:d={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}}}=o,u=(0,r.A)(o,hl),m={x:n,y:a},h=await gl(t,u),p=il(nl(i)),g=sl(p);let f=m[g],x=m[p];if(l){const e="y"===g?"bottom":"right";f=el(f+h["y"===g?"top":"left"],f,f-h[e])}if(c){const e="y"===p?"bottom":"right";x=el(x+h["y"===p?"top":"left"],x,x-h[e])}const b=d.fn((0,s.A)((0,s.A)({},t),{},{[g]:f,[p]:x}));return(0,s.A)((0,s.A)({},b),{},{data:{x:b.x-n,y:b.y-a,enabled:{[g]:l,[p]:c}}})}}},tc=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,s;const{placement:a,middlewareData:i,rects:o,initialPlacement:l,platform:c,elements:d}=t,u=tl(e,t),{mainAxis:m=!0,crossAxis:h=!0,fallbackPlacements:p,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:x=!0}=u,b=(0,r.A)(u,ml);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const y=nl(a),v=il(l),w=nl(l)===l,j=await(null==c.isRTL?void 0:c.isRTL(d.floating)),N=p||(w||!x?[cl(l)]:function(e){const t=cl(e);return[ll(e),t,ll(t)]}(l)),k="none"!==f;!p&&k&&N.push(...function(e,t,n,r){const s=rl(e);let a=function(e,t,n){const r=["left","right"],s=["right","left"],a=["top","bottom"],i=["bottom","top"];switch(e){case"top":case"bottom":return n?t?s:r:t?r:s;case"left":case"right":return t?a:i;default:return[]}}(nl(e),"start"===n,r);return s&&(a=a.map(e=>e+"-"+s),t&&(a=a.concat(a.map(ll)))),a}(l,x,f,j));const A=[l,...N],S=await gl(t,b),E=[];let C=(null==(s=i.flip)?void 0:s.overflows)||[];if(m&&E.push(S[y]),h){const e=function(e,t,n){void 0===n&&(n=!1);const r=rl(e),s=ol(e),a=al(s);let i="x"===s?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[a]>t.floating[a]&&(i=cl(i)),[i,cl(i)]}(a,o,j);E.push(S[e[0]],S[e[1]])}if(C=[...C,{placement:a,overflows:E}],!E.every(e=>e<=0)){var T,P;const e=((null==(T=i.flip)?void 0:T.index)||0)+1,t=A[e];if(t)return{data:{index:e,overflows:C},reset:{placement:t}};let n=null==(P=C.filter(e=>e.overflows[0]<=0).sort((e,t)=>
2e.overflows[1]-t.overflows[1])[0])?void 0:P.placement;if(!n)switch(g){case"bestFit":{var _;const e=null==(_=C.filter(e=>{if(k){const t=il(e.placement);return t===v||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:_[0];e&&(n=e);break}case"initialPlacement":n=l}if(a!==n)return{reset:{placement:n}}}return{}}}},nc=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:a,rects:i,platform:o,elements:l,middlewareData:c}=t,{element:d,padding:u=0}=tl(e,t)||{};if(null==d)return{};const m=dl(u),h={x:n,y:r},p=ol(a),g=al(p),f=await o.getDimensions(d),x="y"===p,b=x?"top":"left",y=x?"bottom":"right",v=x?"clientHeight":"clientWidth",w=i.reference[g]+i.reference[p]-h[p]-i.floating[g],j=h[p]-i.reference[p],N=await(null==o.getOffsetParent?void 0:o.getOffsetParent(d));let k=N?N[v]:0;k&&await(null==o.isElement?void 0:o.isElement(N))||(k=l.floating[v]||i.floating[g]);const A=w/2-j/2,S=k/2-f[g]/2-1,E=Yo(m[b],S),C=Yo(m[y],S),T=E,P=k-f[g]-C,_=k/2-f[g]/2+A,I=el(T,_,P),D=!c.arrow&&null!=rl(a)&&_!==I&&i.reference[g]/2-(_<T?E:C)-f[g]/2<0,R=D?_<T?_-T:_-P:0;return{[p]:h[p]+R,data:(0,s.A)({[p]:I,centerOffset:_-I-R},D&&{alignmentOffset:R}),reset:D}}}),rc=(e,t,n)=>{const r=new Map,a=(0,s.A)({platform:$l},n),i=(0,s.A)((0,s.A)({},a.platform),{},{_c:r});return(async(e,t,n)=>{const{placement:r="bottom",strategy:a="absolute",middleware:i=[],platform:o}=n,l=i.filter(Boolean),c=await(null==o.isRTL?void 0:o.isRTL(t));let d=await o.getElementRects({reference:e,floating:t,strategy:a}),{x:u,y:m}=pl(d,r,c),h=r,p={},g=0;for(let f=0;f<l.length;f++){const{name:n,fn:i}=l[f],{x:x,y:b,data:y,reset:v}=await i({x:u,y:m,initialPlacement:r,placement:h,strategy:a,middlewareData:p,rects:d,platform:o,elements:{reference:e,floating:t}});u=null!=x?x:u,m=null!=b?b:m,p=(0,s.A)((0,s.A)({},p),{},{[n]:(0,s.A)((0,s.A)({},p[n]),y)}),v&&g<=50&&(g++,"object"===typeof v&&(v.placement&&(h=v.placement),v.rects&&(d=!0===v.rects?await o.getElementRects({reference:e,floating:t,strategy:a}):v.rects),({x:u,y:m}=pl(d,h,c))),f=-1)}return{x:u,y:m,placement:h,strategy:a,middlewareData:p}})(e,t,(0,s.A)((0,s.A)({},a),{},{platform:i}))};var sc=n(139);const ac="react-tooltip-core-styles",ic="react-tooltip-base-styles",oc={core:!1,base:!1};function lc(e){let{css:t,id:n=ic,type:r="base",ref:s}=e;var a,i;if(!t||"undefined"==typeof document||oc[r])return;if("core"===r&&"undefined"!=typeof process&&(null===(a=null===process||void 0===process?void 0:{NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_DEBUG:"true",REACT_APP_EMAILJS_PUBLIC_KEY:"your-emailjs-public-key",REACT_APP_EMAILJS_SERVICE_ID:"your-emailjs-service-id",REACT_APP_EMAILJS_TEMPLATE_ID:"your-emailjs-template-id",REACT_APP_ENVIRONMENT:"development",REACT_APP_FIREBASE_API_KEY:"AIzaSyCldlZuqyf25VFuTgRkQH5lVo-ohxE9P6E",REACT_APP_FIREBASE_APP_ID:"1:462477660480:web:cf4338dd149dec6670eaa5",REACT_APP_FIREBASE_AUTH_DOMAIN:"the-apn.firebaseapp.com",REACT_APP_FIREBASE_MESSAGING_SENDER_ID:"462477660480",REACT_APP_FIREBASE_PROJECT_ID:"the-apn",REACT_APP_FIREBASE_STORAGE_BUCKET:"the-apn.firebasestorage.app",REACT_APP_LINKEDIN_CLIENT_ID:"your-linkedin-client-id",REACT_APP_PAYPAL_CLIENT_ID:"AdMd2uVTb0FcGkk2mFpxkMVcDCCC-a3plmioVusIdWjNP3IX48gijhJomgPpg9vBZEmhirZ4odOX38p7",REACT_APP_PAYPAL_CLIENT_ID_LIVE:"AVxmacawl8XsTAt73wWVAZLbojvCkdYAWijaO6E4juw3iAZNEk6Ddk_k6DKo7qLLpdVS6rQa_PjYlMUi",REACT_APP_STRIPE_PUBLISHABLE_KEY:"pk_live_51Kr8J3Ec8kNP7Yp7Tu6erT0Ti9b2qUuacRAPc8kfvjV7nxACrPfmoeGuU8wkIJIOptmFCoCkqW2rAPbAc35Zu2Kg00T0uBJJAv"})||void 0===a?void 0:a.REACT_TOOLTIP_DISABLE_CORE_STYLES))return;if("base"!==r&&"undefined"!=typeof process&&(null===(i=null===process||void 0===process?void 0:{NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_DEBUG:"true",REACT_APP_EMAILJS_PUBLIC_KEY:"your-emailjs-public-key",REACT_APP_EMAILJS_SERVICE_ID:"your-emailjs-service-id",REACT_APP_EMAILJS_TEMPLATE_ID:"your-emailjs-template-id",REACT_APP_ENVIRONMENT:"development",REACT_APP_FIREBASE_API_KEY:"AIzaSyCldlZuqyf25VFuTgRkQH5lVo-ohxE9P6E",REACT_APP_FIREBASE_APP_ID:"1:462477660480:web:cf4338dd149dec6670eaa5",REACT_APP_FIREBASE_AUTH_DOMAIN:"the-apn.firebaseapp.com",REACT_APP_FIREBASE_MESSAGING_SENDER_ID:"462477660480",REACT_APP_FIREBASE_PROJECT_ID:"the-apn",REACT_APP_FIREBASE_STORAGE_BUCKET:"the-apn.firebasestorage.app",REACT_APP_LINKEDIN_CLIENT_ID:"your-linkedin-client-id",REACT_APP_PAYPAL_CLIENT_ID:"AdMd2uVTb0FcGkk2mFpxkMVcDCCC-a3plmioVusIdWjNP3IX48gijhJomgPpg9vBZEmhirZ4odOX38p7",REACT_APP_PAYPAL_CLIENT_ID_LIVE:"AVxmacawl8XsTAt73wWVAZLbojvCkdYAWijaO6E4juw3iAZNEk6Ddk_k6DKo7qLLpdVS6rQa_PjYlMUi",REACT_APP_STRIPE_PUBLISHABLE_KEY:"pk_live_51Kr8J3Ec8kNP7Yp7Tu6erT0Ti9b2qUuacRAPc8kfvjV7nxACrPfmoeGuU8wkIJIOptmFCoCkqW2rAPbAc35Zu2Kg00T0uBJJAv"})||void 0===i?void 0:i.REACT_TOOLTIP_DISABLE_BASE_STYLES))return;"core"===r&&(n=ac),s||(s={});const{insertAt:o}=s;
2if(document.getElementById(n))return;const l=document.head||document.getElementsByTagName("head")[0],c=document.createElement("style");c.id=n,c.type="text/css","top"===o&&l.firstChild?l.insertBefore(c,l.firstChild):l.appendChild(c),c.styleSheet?c.styleSheet.cssText=t:c.appendChild(document.createTextNode(t)),oc[r]=!0}const cc=async e=>{let{elementReference:t=null,tooltipReference:n=null,tooltipArrowReference:r=null,place:a="top",offset:i=10,strategy:o="absolute",middlewares:l=[Zl(Number(i)),tc({fallbackAxisSideDirection:"start"}),ec({padding:5})],border:c}=e;if(!t)return{tooltipStyles:{},tooltipArrowStyles:{},place:a};if(null===n)return{tooltipStyles:{},tooltipArrowStyles:{},place:a};const d=l;return r?(d.push(nc({element:r,padding:5})),rc(t,n,{placement:a,strategy:o,middleware:d}).then(e=>{let{x:t,y:n,placement:r,middlewareData:a}=e;var i,o;const l={left:"".concat(t,"px"),top:"".concat(n,"px"),border:c},{x:d,y:u}=null!==(i=a.arrow)&&void 0!==i?i:{x:0,y:0},m=null!==(o={top:"bottom",right:"left",bottom:"top",left:"right"}[r.split("-")[0]])&&void 0!==o?o:"bottom",h=c&&{borderBottom:c,borderRight:c};let p=0;if(c){const e="".concat(c).match(/(\d+)px/);p=(null==e?void 0:e[1])?Number(e[1]):1}return{tooltipStyles:l,tooltipArrowStyles:(0,s.A)((0,s.A)({left:null!=d?"".concat(d,"px"):"",top:null!=u?"".concat(u,"px"):"",right:"",bottom:""},h),{},{[m]:"-".concat(4+p,"px")}),place:r}})):rc(t,n,{placement:"bottom",strategy:o,middleware:d}).then(e=>{let{x:t,y:n,placement:r}=e;return{tooltipStyles:{left:"".concat(t,"px"),top:"".concat(n,"px")},tooltipArrowStyles:{},place:r}})},dc=(e,t)=>!("CSS"in window&&"supports"in window.CSS)||window.CSS.supports(e,t),uc=(e,t,n)=>{let r=null;const s=function(){for(var s=arguments.length,a=new Array(s),i=0;i<s;i++)a[i]=arguments[i];const o=()=>{r=null,n||e.apply(this,a)};n&&!r&&(e.apply(this,a),r=setTimeout(o,t)),n||(r&&clearTimeout(r),r=setTimeout(o,t))};return s.cancel=()=>{r&&(clearTimeout(r),r=null)},s},mc=e=>null!==e&&!Array.isArray(e)&&"object"==typeof e,hc=(e,t)=>{if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every((e,n)=>hc(e,t[n]));if(Array.isArray(e)!==Array.isArray(t))return!1;if(!mc(e)||!mc(t))return e===t;const n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every(n=>hc(e[n],t[n]))},pc=e=>{if(!(e instanceof HTMLElement||e instanceof SVGElement))return!1;const t=getComputedStyle(e);return["overflow","overflow-x","overflow-y"].some(e=>{const n=t.getPropertyValue(e);return"auto"===n||"scroll"===n})},gc=e=>{if(!e)return null;let t=e.parentElement;for(;t;){if(pc(t))return t;t=t.parentElement}return document.scrollingElement||document.documentElement},fc="undefined"!=typeof window?e.useLayoutEffect:e.useEffect,xc=e=>{e.current&&(clearTimeout(e.current),e.current=null)},bc="DEFAULT_TOOLTIP_ID",yc={anchorRefs:new Set,activeAnchor:{current:null},attach:()=>{},detach:()=>{},setActiveAnchor:()=>{}},vc=(0,e.createContext)({getTooltipData:()=>yc});function wc(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:bc;return(0,e.useContext)(vc).getTooltipData(t)}var jc={tooltip:"core-styles-module_tooltip__3vRRp",fixed:"core-styles-module_fixed__pcSol",arrow:"core-styles-module_arrow__cvMwQ",noArrow:"core-styles-module_noArrow__xock6",clickable:"core-styles-module_clickable__ZuTTB",show:"core-styles-module_show__Nt9eE",closing:"core-styles-module_closing__sGnxF"},Nc={tooltip:"styles-module_tooltip__mnnfp",arrow:"styles-module_arrow__K0L3T",dark:"styles-module_dark__xNqje",light:"styles-module_light__Z6W-X",success:"styles-module_success__A2AKt",warning:"styles-module_warning__SCK0X",error:"styles-module_error__JvumD",info:"styles-module_info__BWdHW"};const kc=t=>{let{forwardRef:n,id:r,className:a,classNameArrow:i,variant:o="dark",anchorId:l,anchorSelect:c,place:d="top",offset:u=10,events:m=["hover"],openOnClick:h=!1,positionStrategy:p="absolute",middlewares:g,wrapper:f,delayShow:x=0,delayHide:b=0,float:y=!1,hidden:v=!1,noArrow:w=!1,clickable:j=!1,closeOnEsc:N=!1,closeOnScroll:k=!1,closeOnResize:A=!1,openEvents:S,closeEvents:E,globalCloseEvents:C,imperativeModeOnly:T,style:P,position:_,afterShow:I,afterHide:D,disableTooltip:R,content:L,contentWrapperRef:M,isOpen:O,defaultIsOpen:F=!1,setIsOpen:U,activeAnchor:B,setActiveAnchor:z,border:V,opacity:q,arrowColor:W,role:H="tooltip"}=t;var G;const Y=(0,e.useRef)(null),K=(0,e.useRef)(null),J=(0,e.useRef)(null),$=(0,e.useRef)(null),Q=(0,e.useRef)(null),[X,Z]=(0,e.useState)({tooltipStyles:{},tooltipArrowStyles:{},place:d}),[ee,te]=(0,e.useState)(!1),[ne,re]=(0,e.useState)(!1),[se,ae]=(0,e.useState)(null),ie=(0,e.useRef)(!1),oe=(0,e.useRef)(null),{anch
2orRefs:le,setActiveAnchor:ce}=wc(r),de=(0,e.useRef)(!1),[ue,me]=(0,e.useState)([]),he=(0,e.useRef)(!1),pe=h||m.includes("click"),ge=pe||(null==S?void 0:S.click)||(null==S?void 0:S.dblclick)||(null==S?void 0:S.mousedown),fe=S?(0,s.A)({},S):{mouseover:!0,focus:!0,mouseenter:!1,click:!1,dblclick:!1,mousedown:!1};!S&&pe&&Object.assign(fe,{mouseenter:!1,focus:!1,mouseover:!1,click:!0});const xe=E?(0,s.A)({},E):{mouseout:!0,blur:!0,mouseleave:!1,click:!1,dblclick:!1,mouseup:!1};!E&&pe&&Object.assign(xe,{mouseleave:!1,blur:!1,mouseout:!1});const be=C?(0,s.A)({},C):{escape:N||!1,scroll:k||!1,resize:A||!1,clickOutsideAnchor:ge||!1};T&&(Object.assign(fe,{mouseover:!1,focus:!1,mouseenter:!1,click:!1,dblclick:!1,mousedown:!1}),Object.assign(xe,{mouseout:!1,blur:!1,mouseleave:!1,click:!1,dblclick:!1,mouseup:!1}),Object.assign(be,{escape:!1,scroll:!1,resize:!1,clickOutsideAnchor:!1})),fc(()=>(he.current=!0,()=>{he.current=!1}),[]);const ye=e=>{he.current&&(e&&re(!0),setTimeout(()=>{he.current&&(null==U||U(e),void 0===O&&te(e))},10))};(0,e.useEffect)(()=>{if(void 0===O)return()=>null;O&&re(!0);const e=setTimeout(()=>{te(O)},10);return()=>{clearTimeout(e)}},[O]),(0,e.useEffect)(()=>{if(ee!==ie.current)if(xc(Q),ie.current=ee,ee)null==I||I();else{const e=(()=>{const e=getComputedStyle(document.body).getPropertyValue("--rt-transition-show-delay").match(/^([\d.]+)(ms|s)$/);if(!e)return 0;const[,t,n]=e;return Number(t)*("ms"===n?1:1e3)})();Q.current=setTimeout(()=>{re(!1),ae(null),null==D||D()},e+25)}},[ee]);const ve=e=>{Z(t=>hc(t,e)?t:e)},we=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:x;xc(J),ne?ye(!0):J.current=setTimeout(()=>{ye(!0)},e)},je=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:b;xc($),$.current=setTimeout(()=>{de.current||ye(!1)},e)},Ne=e=>{var t;if(!e)return;const n=null!==(t=e.currentTarget)&&void 0!==t?t:e.target;if(!(null==n?void 0:n.isConnected))return z(null),void ce({current:null});x?we():ye(!0),z(n),ce({current:n}),xc($)},ke=()=>{j?je(b||100):b?je():ye(!1),xc(J)},Ae=e=>{let{x:t,y:n}=e;var r;const s={getBoundingClientRect:()=>({x:t,y:n,width:0,height:0,top:n,left:t,right:t,bottom:n})};cc({place:null!==(r=null==se?void 0:se.place)&&void 0!==r?r:d,offset:u,elementReference:s,tooltipReference:Y.current,tooltipArrowReference:K.current,strategy:p,middlewares:g,border:V}).then(e=>{ve(e)})},Se=e=>{if(!e)return;const t=e,n={x:t.clientX,y:t.clientY};Ae(n),oe.current=n},Ee=e=>{var t;if(!ee)return;const n=e.target;n.isConnected&&((null===(t=Y.current)||void 0===t?void 0:t.contains(n))||[document.querySelector("[id='".concat(l,"']")),...ue].some(e=>null==e?void 0:e.contains(n))||(ye(!1),xc(J)))},Ce=uc(Ne,50,!0),Te=uc(ke,50,!0),Pe=e=>{Te.cancel(),Ce(e)},_e=()=>{Ce.cancel(),Te()},Ie=(0,e.useCallback)(()=>{var e,t;const n=null!==(e=null==se?void 0:se.position)&&void 0!==e?e:_;n?Ae(n):y?oe.current&&Ae(oe.current):(null==B?void 0:B.isConnected)&&cc({place:null!==(t=null==se?void 0:se.place)&&void 0!==t?t:d,offset:u,elementReference:B,tooltipReference:Y.current,tooltipArrowReference:K.current,strategy:p,middlewares:g,border:V}).then(e=>{he.current&&ve(e)})},[ee,B,L,P,d,null==se?void 0:se.place,u,p,_,null==se?void 0:se.position,y]);(0,e.useEffect)(()=>{var e,t;const n=new Set(le);ue.forEach(e=>{(null==R?void 0:R(e))||n.add({current:e})});const r=document.querySelector("[id='".concat(l,"']"));r&&!(null==R?void 0:R(r))&&n.add({current:r});const s=()=>{ye(!1)},a=gc(B),i=gc(Y.current);be.scroll&&(window.addEventListener("scroll",s),null==a||a.addEventListener("scroll",s),null==i||i.addEventListener("scroll",s));let o=null;be.resize?window.addEventListener("resize",s):B&&Y.current&&(o=Xl(B,Y.current,Ie,{ancestorResize:!0,elementResize:!0,layoutShift:!0}));const c=e=>{"Escape"===e.key&&ye(!1)};be.escape&&window.addEventListener("keydown",c),be.clickOutsideAnchor&&window.addEventListener("click",Ee);const d=[],u=e=>Boolean((null==e?void 0:e.target)&&(null==B?void 0:B.contains(e.target))),m=e=>{ee&&u(e)||Ne(e)},h=e=>{ee&&u(e)&&ke()},p=["mouseover","mouseout","mouseenter","mouseleave","focus","blur"],g=["click","dblclick","mousedown","mouseup"];
2Object.entries(fe).forEach(e=>{let[t,n]=e;n&&(p.includes(t)?d.push({event:t,listener:Pe}):g.includes(t)&&d.push({event:t,listener:m}))}),Object.entries(xe).forEach(e=>{let[t,n]=e;n&&(p.includes(t)?d.push({event:t,listener:_e}):g.includes(t)&&d.push({event:t,listener:h}))}),y&&d.push({event:"pointermove",listener:Se});const f=()=>{de.current=!0},x=()=>{de.current=!1,ke()},b=j&&(xe.mouseout||xe.mouseleave);return b&&(null===(e=Y.current)||void 0===e||e.addEventListener("mouseover",f),null===(t=Y.current)||void 0===t||t.addEventListener("mouseout",x)),d.forEach(e=>{let{event:t,listener:r}=e;n.forEach(e=>{var n;null===(n=e.current)||void 0===n||n.addEventListener(t,r)})}),()=>{var e,t;be.scroll&&(window.removeEventListener("scroll",s),null==a||a.removeEventListener("scroll",s),null==i||i.removeEventListener("scroll",s)),be.resize?window.removeEventListener("resize",s):null==o||o(),be.clickOutsideAnchor&&window.removeEventListener("click",Ee),be.escape&&window.removeEventListener("keydown",c),b&&(null===(e=Y.current)||void 0===e||e.removeEventListener("mouseover",f),null===(t=Y.current)||void 0===t||t.removeEventListener("mouseout",x)),d.forEach(e=>{let{event:t,listener:r}=e;n.forEach(e=>{var n;null===(n=e.current)||void 0===n||n.removeEventListener(t,r)})})}},[B,Ie,ne,le,ue,S,E,C,pe,x,b]),(0,e.useEffect)(()=>{var e,t;let n=null!==(t=null!==(e=null==se?void 0:se.anchorSelect)&&void 0!==e?e:c)&&void 0!==t?t:"";!n&&r&&(n="[data-tooltip-id='".concat(r.replace(/'/g,"\\'"),"']"));const s=new MutationObserver(e=>{const t=[],s=[];e.forEach(e=>{if("attributes"===e.type&&"data-tooltip-id"===e.attributeName&&(e.target.getAttribute("data-tooltip-id")===r?t.push(e.target):e.oldValue===r&&s.push(e.target)),"childList"===e.type){if(B){const t=[...e.removedNodes].filter(e=>1===e.nodeType);if(n)try{s.push(...t.filter(e=>e.matches(n))),s.push(...t.flatMap(e=>[...e.querySelectorAll(n)]))}catch(e){}t.some(e=>{var t;return!!(null===(t=null==e?void 0:e.contains)||void 0===t?void 0:t.call(e,B))&&(re(!1),ye(!1),z(null),xc(J),xc($),!0)})}if(n)try{const r=[...e.addedNodes].filter(e=>1===e.nodeType);t.push(...r.filter(e=>e.matches(n))),t.push(...r.flatMap(e=>[...e.querySelectorAll(n)]))}catch(e){}}}),(t.length||s.length)&&me(e=>[...e.filter(e=>!s.includes(e)),...t])});return s.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-tooltip-id"],attributeOldValue:!0}),()=>{s.disconnect()}},[r,c,null==se?void 0:se.anchorSelect,B]),(0,e.useEffect)(()=>{Ie()},[Ie]),(0,e.useEffect)(()=>{if(!(null==M?void 0:M.current))return()=>null;const e=new ResizeObserver(()=>{setTimeout(()=>Ie())});return e.observe(M.current),()=>{e.disconnect()}},[L,null==M?void 0:M.current]),(0,e.useEffect)(()=>{var e;const t=document.querySelector("[id='".concat(l,"']")),n=[...ue,t];B&&n.includes(B)||z(null!==(e=ue[0])&&void 0!==e?e:t)},[l,ue,B]),(0,e.useEffect)(()=>(F&&ye(!0),()=>{xc(J),xc($)}),[]),(0,e.useEffect)(()=>{var e;let t=null!==(e=null==se?void 0:se.anchorSelect)&&void 0!==e?e:c;if(!t&&r&&(t="[data-tooltip-id='".concat(r.replace(/'/g,"\\'"),"']")),t)try{const e=Array.from(document.querySelectorAll(t));me(e)}catch(e){me([])}},[r,c,null==se?void 0:se.anchorSelect]),(0,e.useEffect)(()=>{J.current&&(xc(J),we(x))},[x]);const De=null!==(G=null==se?void 0:se.content)&&void 0!==G?G:L,Re=ee&&Object.keys(X.tooltipStyles).length>0;return(0,e.useImperativeHandle)(n,()=>({open:e=>{if(null==e?void 0:e.anchorSelect)try{document.querySelector(e.anchorSelect)}catch(n){return void console.warn('[react-tooltip] "'.concat(e.anchorSelect,'" is not a valid CSS selector'))}ae(null!=e?e:null),(null==e?void 0:e.delay)?we(e.delay):ye(!0)},close:e=>{(null==e?void 0:e.delay)?je(e.delay):ye(!1)},activeAnchor:B,place:X.place,isOpen:Boolean(ne&&!v&&De&&Re)})),ne&&!v&&De?e.createElement(f,{id:r,role:H,className:sc("react-tooltip",jc.tooltip,Nc.tooltip,Nc[o],a,"react-tooltip__place-".concat(X.place),jc[Re?"show":"closing"],Re?"react-tooltip__show":"react-tooltip__closing","fixed"===p&&jc.fixed,j&&jc.clickable),onTransitionEnd:e=>{xc(Q),ee||"opacity"!==e.propertyName||(re(!1),ae(null),null==D||D())},style:(0,s.A)((0,s.A)((0,s.A)({},P),X.tooltipStyles),{},{opacity:void 0!==q&&Re?q:void 0}),ref:Y},De,e.createElement(f,{className:sc("react-tooltip-arrow",jc.arrow,Nc.arrow,i,w&&jc.noArrow),style:(0,s.A)((0,s.A)({},X.tooltipArrowStyles),{},{background:W?"linear-gradient(to right bottom, transparent 50%, ".concat(W," 50%)"):void 0}),ref:K})):null},Ac=t=>{let{content:n}=t;return e.createElement("span",{dangerouslySetInnerHTML:{__html:n}})}
2,Sc=e.forwardRef((t,n)=>{let{id:r,anchorId:a,anchorSelect:i,content:o,html:l,render:c,className:d,classNameArrow:u,variant:m="dark",place:h="top",offset:p=10,wrapper:g="div",children:f=null,events:x=["hover"],openOnClick:b=!1,positionStrategy:y="absolute",middlewares:v,delayShow:w=0,delayHide:j=0,float:N=!1,hidden:k=!1,noArrow:A=!1,clickable:S=!1,closeOnEsc:E=!1,closeOnScroll:C=!1,closeOnResize:T=!1,openEvents:P,closeEvents:_,globalCloseEvents:I,imperativeModeOnly:D=!1,style:R,position:L,isOpen:M,defaultIsOpen:O=!1,disableStyleInjection:F=!1,border:U,opacity:B,arrowColor:z,setIsOpen:V,afterShow:q,afterHide:W,disableTooltip:H,role:G="tooltip"}=t;const[Y,K]=(0,e.useState)(o),[J,$]=(0,e.useState)(l),[Q,X]=(0,e.useState)(h),[Z,ee]=(0,e.useState)(m),[te,ne]=(0,e.useState)(p),[re,se]=(0,e.useState)(w),[ae,ie]=(0,e.useState)(j),[oe,le]=(0,e.useState)(N),[ce,de]=(0,e.useState)(k),[ue,me]=(0,e.useState)(g),[he,pe]=(0,e.useState)(x),[ge,fe]=(0,e.useState)(y),[xe,be]=(0,e.useState)(null),[ye,ve]=(0,e.useState)(null),we=(0,e.useRef)(F),{anchorRefs:je,activeAnchor:Ne}=wc(r),ke=e=>null==e?void 0:e.getAttributeNames().reduce((t,n)=>{var r;return n.startsWith("data-tooltip-")&&(t[n.replace(/^data-tooltip-/,"")]=null!==(r=null==e?void 0:e.getAttribute(n))&&void 0!==r?r:null),t},{}),Ae=e=>{const t={place:e=>{var t;X(null!==(t=e)&&void 0!==t?t:h)},content:e=>{K(null!=e?e:o)},html:e=>{$(null!=e?e:l)},variant:e=>{var t;ee(null!==(t=e)&&void 0!==t?t:m)},offset:e=>{ne(null===e?p:Number(e))},wrapper:e=>{var t;me(null!==(t=e)&&void 0!==t?t:g)},events:e=>{const t=null==e?void 0:e.split(" ");pe(null!=t?t:x)},"position-strategy":e=>{var t;fe(null!==(t=e)&&void 0!==t?t:y)},"delay-show":e=>{se(null===e?w:Number(e))},"delay-hide":e=>{ie(null===e?j:Number(e))},float:e=>{le(null===e?N:"true"===e)},hidden:e=>{de(null===e?k:"true"===e)},"class-name":e=>{be(e)}};Object.values(t).forEach(e=>e(null)),Object.entries(e).forEach(e=>{let[n,r]=e;var s;null===(s=t[n])||void 0===s||s.call(t,r)})};(0,e.useEffect)(()=>{K(o)},[o]),(0,e.useEffect)(()=>{$(l)},[l]),(0,e.useEffect)(()=>{X(h)},[h]),(0,e.useEffect)(()=>{ee(m)},[m]),(0,e.useEffect)(()=>{ne(p)},[p]),(0,e.useEffect)(()=>{se(w)},[w]),(0,e.useEffect)(()=>{ie(j)},[j]),(0,e.useEffect)(()=>{le(N)},[N]),(0,e.useEffect)(()=>{de(k)},[k]),(0,e.useEffect)(()=>{fe(y)},[y]),(0,e.useEffect)(()=>{we.current!==F&&console.warn("[react-tooltip] Do not change `disableStyleInjection` dynamically.")},[F]),(0,e.useEffect)(()=>{"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent("react-tooltip-inject-styles",{detail:{disableCore:"core"===F,disableBase:F}}))},[]),(0,e.useEffect)(()=>{var e;const t=new Set(je);let n=i;if(!n&&r&&(n="[data-tooltip-id='".concat(r.replace(/'/g,"\\'"),"']")),n)try{document.querySelectorAll(n).forEach(e=>{t.add({current:e})})}catch(e){console.warn('[react-tooltip] "'.concat(n,'" is not a valid CSS selector'))}const s=document.querySelector("[id='".concat(a,"']"));if(s&&t.add({current:s}),!t.size)return()=>null;const o=null!==(e=null!=ye?ye:s)&&void 0!==e?e:Ne.current,l=new MutationObserver(e=>{e.forEach(e=>{var t;if(!o||"attributes"!==e.type||!(null===(t=e.attributeName)||void 0===t?void 0:t.startsWith("data-tooltip-")))return;const n=ke(o);Ae(n)})}),c={attributes:!0,childList:!1,subtree:!1};if(o){const e=ke(o);Ae(e),l.observe(o,c)}return()=>{l.disconnect()}},[je,Ne,ye,a,i]),(0,e.useEffect)(()=>{(null==R?void 0:R.border)&&console.warn("[react-tooltip] Do not set `style.border`. Use `border` prop instead."),U&&!dc("border","".concat(U))&&console.warn('[react-tooltip] "'.concat(U,'" is not a valid `border`.')),(null==R?void 0:R.opacity)&&console.warn("[react-tooltip] Do not set `style.opacity`. Use `opacity` prop instead."),B&&!dc("opacity","".concat(B))&&console.warn('[react-tooltip] "'.concat(B,'" is not a valid `opacity`.'))},[]);let Se=f;const Ee=(0,e.useRef)(null);if(c){const t=c({content:(null==ye?void 0:ye.getAttribute("data-tooltip-content"))||Y||null,activeAnchor:ye});Se=t?e.createElement("div",{ref:Ee,className:"react-tooltip-content-wrapper"},t):null}else Y&&(Se=Y);J&&(Se=e.createElement(Ac,{content:J}));const Ce={forwardRef:n,id:r,anchorId:a,anchorSelect:i,className:sc(d,xe),classNameArrow:u,content:Se,contentWrapperRef:Ee,place:Q,variant:Z,offset:te,wrapper:ue,events:he,openOnClick:b,positionStrategy:ge,middlewares:v,delayShow:re,delayHide:ae,float:oe,hidden:ce,noArrow:A,clickable:S,closeOnEsc:E,closeOnScroll:C,closeOnResize:T,openEvents:P,closeEvents:_,globalCloseEvents:I,imperativeModeOnly:D,style:R,position:L,isOpen:M,defaultIsOpen:O,border:U,opacity:B,arrowColor:z,setIsOpen:V,afterShow:q,afterHide:W,disableTooltip:H,activeAnchor:ye,setActiveAnchor:e=>ve(e),role:G};return e.createElement(kc,(0,s.A)({},Ce))});"undefined"!=typeof window&&window.addEventListener("react-tooltip-inject-styles",e=>{e.detail.disableCore||lc({css:":root{--rt-color-white:#fff;--rt-color-dark:#222;--rt-color-success:#8dc572;--rt-color-error:#be6464;--rt-color-warning:#f0ad4e;--rt-color-info:#337ab7;--rt-opacity:0.9;--rt-transition-show-delay:0.15s;--rt-transition-closing-delay:0.15s}.core-styles-module_tooltip__3vRRp{position:absolute;top:0;left:0;pointer-events:none;opacity:0;will-change:opacity}.core-styles-module_fixed__pcSol{position:fixed}.core-styles-module_arrow__cvMwQ{position:absolute;background:inherit}.core-styles-module_noArrow__xock6{display:none}.core-styles-module_clickable__ZuTTB{pointer-events:auto}
2.core-styles-module_show__Nt9eE{opacity:var(--rt-opacity);transition:opacity var(--rt-transition-show-delay)ease-out}.core-styles-module_closing__sGnxF{opacity:0;transition:opacity var(--rt-transition-closing-delay)ease-in}",type:"core"}),e.detail.disableBase||lc({css:"\n.styles-module_tooltip__mnnfp{padding:8px 16px;border-radius:3px;font-size:90%;width:max-content}.styles-module_arrow__K0L3T{width:8px;height:8px}[class*='react-tooltip__place-top']>.styles-module_arrow__K0L3T{transform:rotate(45deg)}[class*='react-tooltip__place-right']>.styles-module_arrow__K0L3T{transform:rotate(135deg)}[class*='react-tooltip__place-bottom']>.styles-module_arrow__K0L3T{transform:rotate(225deg)}[class*='react-tooltip__place-left']>.styles-module_arrow__K0L3T{transform:rotate(315deg)}.styles-module_dark__xNqje{background:var(--rt-color-dark);color:var(--rt-color-white)}.styles-module_light__Z6W-X{background-color:var(--rt-color-white);color:var(--rt-color-dark)}.styles-module_success__A2AKt{background-color:var(--rt-color-success);color:var(--rt-color-white)}.styles-module_warning__SCK0X{background-color:var(--rt-color-warning);color:var(--rt-color-white)}.styles-module_error__JvumD{background-color:var(--rt-color-error);color:var(--rt-color-white)}.styles-module_info__BWdHW{background-color:var(--rt-color-info);color:var(--rt-color-white)}",type:"base"})});const Ec=t=>{let{badge:n,size:r="small",showTooltip:s=!0}=t;const a={tiny:"w-4 h-4 text-[10px]",small:"w-6 h-6 text-sm",medium:"w-8 h-8 text-base",large:"w-12 h-12 text-2xl"},i=a[r]||a.small,o="badge-".concat(n.id),l=n.tooltipDescription||n.name,[c,d]=(0,e.useState)(!1);return(0,nn.jsxs)("div",{className:"inline-block align-middle",children:[n.image&&!c?(0,nn.jsx)("img",{src:"".concat("").concat(n.image),alt:n.name,className:"".concat(i," object-contain"),"data-tooltip-id":s?o:void 0,"data-tooltip-content":s?l:void 0,onError:()=>d(!0)}):n.emoji?(0,nn.jsx)("span",{className:"".concat(i," inline-flex items-center justify-center rounded-full bg-blue-50 leading-none"),role:"img","aria-label":n.name,"data-tooltip-id":s?o:void 0,"data-tooltip-content":s?l:void 0,children:n.emoji}):null,s&&(0,nn.jsx)(Sc,{id:o,place:"top",effect:"solid"})]})},Cc=e=>{let{badges:t,size:n="small",showTooltip:r=!0,className:s=""}=e;const a=Array.isArray(t)?t:[];return 0===a.length?null:(0,nn.jsx)("div",{className:"flex gap-1 ".concat(s),children:a.map(e=>(0,nn.jsx)(Ec,{badge:e,size:n,showTooltip:r},e.id))})},Tc={FOUNDING_MEMBER:{id:"founding-member",name:"Founding Member",tooltipDescription:"Founding Member",publicDescription:"One of the first 25 members of their chapter.",description:"One of the first 25 members of their chapter. Receives 50% discount on first year membership.",image:"/ap-badges/founding-member-badge-nobackground.png",discountPercentage:50},VIP_MEMBER:{id:"vip-member",name:"VIP Member",tooltipDescription:"VIP Member",publicDescription:"One of the members #26-50 of their chapter.",description:"One of the members #26-50 of their chapter. Receives 25% discount on first year membership.",image:"/ap-badges/vip-member-badge-nobackground.png",discountPercentage:25},FIVE_YEAR_MEMBER:{id:"5-year-member",name:"5 Year Member",tooltipDescription:"5 Year Member",publicDescription:"A member for 5 consecutive years.",description:"A member for 5 consecutive years. Receives 25% off of 5 event registrations.",image:"/ap-badges/5-year-badge.png",eventDiscounts:5,discountPercentage:25},TEN_YEAR_MEMBER:{id:"10-year-member",name:"10 Year Member",tooltipDescription:"10 Year Member",publicDescription:"A member for 10 consecutive years.",description:"A member for 10 consecutive years. Receives 30% off of 10 event registrations.",image:"/ap-badges/10-year-member-badge-nobackground.png",eventDiscounts:10,discountPercentage:30},CHAPTER_PRESIDENT:{id:"chapter-president",name:"Chapter President",tooltipDescription:"Chapter President",publicDescription:"President of a local APN chapter.",description:"President of a local APN chapter.",image:"/ap-badges/chapter-badge-president-nobackground.png"},AMBASSADOR:{id:"ambassador",name:"Ambassador",tooltipDescription:"Ambassador",publicDescription:"Member who has successfully referred multiple people to APN events or membership.",description:"Member who has successfully referred multiple people to APN events or membership. Receives automatic discount on next membership or sponsorship package.",image:"/ap-badges/vip-member-badge-nobackground.png",discountPercentage:10},LINKEDIN_CONNECTED:{id:"linkedin-connected",name:"LinkedIn Connected",tooltipDescription:"LinkedIn Connected",publicDescription:"Linked their LinkedIn profile.",description:"Linked their LinkedIn profile to their APN account for easier networking.",image:"/ap-badges/linkedin-badge.png",emoji:"\ud83d\udd17"},CONNECTOR:{id:"connector",name:"Connector",tooltipDescription:"Connector \u2014 referred a new member",publicDescription:"Referred someone to APN.",description:"Referred at least one new person to APN. Refer 5+ to become an Ambassador.",image:"/ap-badges/connector-badge.png",emoji:"\ud83e\udd1d"}},Pc={2023:"/ap-badges/class-of-2023.png",2024:"/ap-badges/class-of-2024.png",2025:"/ap-badges/class-of-2025.png",2026:"/ap-badges/class-of-2026.png"},_c=e=>{if(!e)return[];const t=[];(e.isFoundingMember||"[email protected]"===e.email)&&t.push((0,s.A)((0,s.A)({},Tc.FOUNDING_MEMBER),{},{earnedDate:e.memberSince})),(e.isVipMember||"[email protected]"===e.email)&&t.push((0,s.A)((0,s.A)({},Tc.VIP_MEMBER),{},{earnedDate:e.memberSince}));const n=(e=>{if(!e)return 0;let t=null;if("function"===typeof e.toDate)t=e.toDate();else if(e instanceof Date)t=e;else if("object"===typeof e&&"number"===typeof e.seconds)t=new Date(1e3*e.seconds);else if("string"===typeof e){const n=e.trim().split(" "),r={January:0,February:1,March:2,April:3,May:4,June:5,July:6,August:7,September:8,October:9,November:10,December:11};if(2!==n.length||void 0===r[n[0]]||isNaN(parseInt(n[1]))){const n=new Date(e);t=isNaN(n.getTime())?null:n}else t=new Date(parseInt(n[1]),r[n[0]],1)}if(!t||isNaN(t.getTime()))return 0;const n=new Date;let r=n.getFullYear()-t.getFullYear();return(n.getMonth()<t.getMonth()||n.getMonth()===t.getMonth()&&n.getDate()<t.getDate())&&r--,Math.max(0,r)})(e.memberSince);if(n>=10?t.push((0,s.A)((0,s.A)({},Tc.TEN_YEAR_MEMBER),{}
2,{earnedDate:"".concat((new Date).toLocaleString("default",{month:"long"})," ").concat((new Date).getFullYear())})):n>=5&&t.push((0,s.A)((0,s.A)({},Tc.FIVE_YEAR_MEMBER),{},{earnedDate:"".concat((new Date).toLocaleString("default",{month:"long"})," ").concat((new Date).getFullYear())})),"Chapter President"===e.role){const n=(0,s.A)((0,s.A)({},Tc.CHAPTER_PRESIDENT),{},{name:"".concat(e.chapter," Chapter President"),tooltipDescription:"".concat(e.chapter," Chapter President"),earnedDate:e.roleStartDate||e.memberSince}),r=((e,t)=>{var n;if(!t)return null;const r=t.toLowerCase(),s={"new york":{"chapter-president":"/ap-badges/chapter-badge-president-ny-nobackground.png"},chicago:{"chapter-president":"/ap-badges/chapter-badge-president-chicago-nobackground.png"},"los angeles":{"chapter-president":"/ap-badges/chapter-badge-president-la-nobackground.png"},boston:{"chapter-president":"/ap-badges/chapter-badge-president-nobackground.png"}};return s[r]&&s[r][e]?s[r][e]:null===(n=Tc[e])||void 0===n?void 0:n.image})("chapter-president",e.chapter);r&&(n.image=r),t.push(n)}e.referralCount&&e.referralCount>=5&&t.push((0,s.A)((0,s.A)({},Tc.AMBASSADOR),{},{earnedDate:e.ambassadorSince||(new Date).toLocaleString("default",{month:"long",year:"numeric"})})),"string"===typeof e.linkedinUrl&&/linkedin\.com/i.test(e.linkedinUrl)&&t.push((0,s.A)({},Tc.LINKEDIN_CONNECTED)),e.referralCount&&e.referralCount>=1&&e.referralCount<5&&t.push((0,s.A)({},Tc.CONNECTOR));const r=(e=>{if(!e)return null;let t=null;if("function"===typeof e.toDate)t=e.toDate();else if(e instanceof Date)t=e;else if("object"===typeof e&&"number"===typeof e.seconds)t=new Date(1e3*e.seconds);else if("string"===typeof e){const n=e.trim().split(" ");if(2===n.length&&!isNaN(parseInt(n[1])))return parseInt(n[1]);const r=new Date(e);isNaN(r.getTime())||(t=r)}return t&&!isNaN(t.getTime())?t.getFullYear():null})(e.memberSince);return r&&t.push({id:"class-of-".concat(r),name:"Class of ".concat(r),tooltipDescription:"Class of ".concat(r," \u2014 joined APN in ").concat(r),publicDescription:"Joined APN in ".concat(r,"."),image:Pc[r],emoji:"\ud83c\udf93"}),t},Ic=[{id:"seed-1",isSeed:!0,firstName:"John",lastName:"Smith",title:"Investment Banking Associate",company:"Goldman Sachs",location:"New York, NY",specialty:"Investment Banking",image:"",linkedinUrl:"https://www.linkedin.com/in/john-smith-apn",bio:"Investment banking associate focused on M&A advisory across technology and industrials. Active in the APN community connecting deal professionals.",memberSince:"March 2019",isFoundingMember:!0,isVipMember:!1,referralCount:0,role:"",chapter:"New York",ambassadorSince:null},{id:"seed-2",isSeed:!0,firstName:"Sarah",lastName:"Johnson",title:"Private Equity Analyst",company:"Blackstone",location:"New York, NY",specialty:"Private Equity",image:"",bio:"Private equity analyst evaluating buyout opportunities in healthcare and consumer. Passionate about building a stronger network of M&A professionals.",memberSince:"June 2023",isFoundingMember:!1,isVipMember:!0,referralCount:5,role:"",chapter:"New York",ambassadorSince:null},{id:"seed-3",isSeed:!0,firstName:"Michael",lastName:"Chen",title:"VP of Corporate Development",company:"Morgan Stanley",location:"Chicago, IL",specialty:"Corporate Development",image:"",bio:"Leads corporate development and strategic acquisitions. Long-time APN member and ambassador who loves connecting people across the deal ecosystem.",memberSince:"May 2018",isFoundingMember:!1,isVipMember:!1,referralCount:12,role:"",chapter:"Chicago",ambassadorSince:"June 2020"},{id:"seed-4",isSeed:!0,firstName:"Emily",lastName:"Rodriguez",title:"Tax Manager",company:"Deloitte",location:"Los Angeles, CA",specialty:"Accounting",image:"",bio:"Tax manager specializing in transaction structuring and due diligence. Chapter President for the APN Los Angeles community.",memberSince:"June 2023",isFoundingMember:!1,isVipMember:!1,referralCount:0,role:"Chapter President",chapter:"Los Angeles",ambassadorSince:null},{id:"seed-5",isSeed:!0,firstName:"David",lastName:"Kim",title:"Associate Attorney",company:"Skadden",location:"Boston, MA",specialty:"Law Firm",image:"",bio:"M&A attorney advising on complex cross-border transactions. Founding member of the APN community.",memberSince:"June 2023",isFoundingMember:!0,isVipMember:!1,referralCount:0,role:"",chapter:"Boston",ambassadorSince:null},{id:"seed-6",isSeed:!0,firstName:"Jessica",lastName:"Lee",title:"Investment Banking Analyst",company:"JP Morgan",location:"San Francisco, CA",specialty:"Investment Banking",image:"",linkedinUrl:"https://www.linkedin.com/in/jessica-lee-apn",bio:"Investment banking analyst covering technology and s
2oftware. Enthusiastic about mentorship and growing the next generation of dealmakers.",memberSince:"June 2023",isFoundingMember:!1,isVipMember:!0,referralCount:0,role:"",chapter:"San Francisco",ambassadorSince:null},{id:"seed-7",isSeed:!0,firstName:"Robert",lastName:"Wilson",title:"Director",company:"KPMG",location:"Dallas, TX",specialty:"Accounting",image:"",bio:"Director in transaction services with over a decade advising on buy-side and sell-side diligence. Long-standing member of APN.",memberSince:"January 2015",isFoundingMember:!1,isVipMember:!1,referralCount:0,role:"",chapter:"Dallas",ambassadorSince:null},{id:"seed-8",isSeed:!0,firstName:"Amanda",lastName:"Thompson",title:"Wealth Management Associate",company:"UBS",location:"Miami, FL",specialty:"Wealth Manager",image:"",bio:"Wealth management associate helping business owners plan around liquidity events. Active APN ambassador in the Southeast.",memberSince:"June 2023",isFoundingMember:!1,isVipMember:!1,referralCount:7,role:"",chapter:"Miami",ambassadorSince:"January 2024"}],Dc=()=>{const[t,n]=(0,e.useState)([]),[r,s]=(0,e.useState)(!0),[a,i]=(0,e.useState)(null),[o,l]=(0,e.useState)(""),[c,d]=(0,e.useState)(""),[u,m]=(0,e.useState)(""),[h,p]=(0,e.useState)("grid"),[g,f]=(0,e.useState)(1),[x]=(0,e.useState)(8);(0,e.useEffect)(()=>{b()},[]);const b=async()=>{try{s(!0),i(null);const e=(await(0,wn.getAllUsers)(100)).filter(e=>"approved"===e.status&&"admin"!==e.role||!0===e.isFoundingMember).map(e=>{var t;return{id:e.id,name:"".concat(e.firstName||""," ").concat(e.lastName||"").trim()||e.displayName||"Member",title:e.title||e.jobTitle||"",company:e.company||e.organization||"",location:e.location||e.city||"",specialty:e.specialty||e.industry||"",tier:e.membershipTier||"",image:e.profilePhoto||e.photoURL||e.profileImage||"",memberSince:e.memberSince||(null!==(t=e.createdAt)&&void 0!==t&&t.toDate?e.createdAt.toDate().toLocaleDateString("en-US",{month:"long",year:"numeric"}):""),isFoundingMember:e.isFoundingMember||!1,isVipMember:e.isVipMember||!1,role:e.role||"",referralCount:e.referralCount||0,ambassadorSince:e.ambassadorSince||null,badges:_c(e)}}),t=Ic.map(e=>({id:e.id,name:"".concat(e.firstName||""," ").concat(e.lastName||"").trim(),title:e.title||"",company:e.company||"",location:e.location||"",specialty:e.specialty||"",tier:"",image:e.image||"",memberSince:e.memberSince||"",isFoundingMember:e.isFoundingMember||!1,isVipMember:e.isVipMember||!1,role:e.role||"",referralCount:e.referralCount||0,ambassadorSince:e.ambassadorSince||null,badges:_c(e)})),r=await(0,wn.l9)();n(r?e:[...e,...t])}catch(e){console.error("Error loading members:",e),i("Failed to load members. Please try again.")}finally{s(!1)}},y=[...new Set(t.map(e=>e.location).filter(Boolean))],v=t.filter(e=>{const t=!o||(e.name||"").toLowerCase().includes(o.toLowerCase())||(e.title||"").toLowerCase().includes(o.toLowerCase())||(e.company||"").toLowerCase().includes(o.toLowerCase()),n=""===c||e.location===c,r=""===u||e.specialty===u;return t&&n&&r});return(0,nn.jsxs)("div",{className:"bg-white",children:[(0,nn.jsx)("div",{className:"bg-apn-blue text-white py-12",children:(0,nn.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:(0,nn.jsxs)("div",{className:"text-center",children:[(0,nn.jsx)("div",{className:"flex justify-center mb-4",children:(0,nn.jsx)("img",{src:"".concat("","/apn-logos/APN-Tag-white.jpg"),alt:"APN Logo",className:"h-16"})}),(0,nn.jsx)("h1",{className:"text-3xl font-bold",children:"Member Directory"})]})})}),(0,nn.jsx)("section",{className:"py-12",children:(0,nn.jsxs)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[(0,nn.jsxs)("div",{className:"mb-8 space-y-4",children:[(0,nn.jsxs)("div",{className:"flex flex-col md:flex-row justify-between items-center gap-4",children:[(0,nn.jsx)("div",{className:"w-full md:w-1/2",children:(0,nn.jsx)("input",{type:"text",placeholder:"Search members by name, title, or company...",value:o,onChange:e=>l(e.target.value),className:"w-full px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue"})}),(0,nn.jsxs)("div",{className:"flex space-x-4",children:[(0,nn.jsx)("button",{onClick:()=>p("grid"),className:"p-2 rounded-md ".concat("grid"===h?"bg-apn-blue text-white":"bg-gray-200 text-gray-700 hover:bg-gray-300"),children:(0,nn.jsx)("svg",{className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M4 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2V6zM14 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2V6zM4 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2v-2zM14 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2v-2z"})})}),(0,nn.jsx)("button",{onClick:()=>p("list"),className:"p-2 rounded-md ".concat("list"===h?"bg-apn-blue text-white":"bg-gray-200 text-gray-700 hover:bg-gray-300"),children:(0,nn.jsx)("svg",{className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M4 6h16M4 12h16M4 18h16"})})})]})]}),(0,nn.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"location-filter",className:"block text-sm font-medium text-gray-700 mb-1",children:"Filter by Location"}),(0,nn.jsxs)("select",{id:"location-filter",value:c,onChange:e=>d(e.target.value),className:"w-full px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue",children:[(0,nn.jsx)("option",{value:"",children:"All Locations"}),y.map((e,t)=>(0,nn.jsx)("option",{value:e,children:e},t))]})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"specialty-filter",className:"block text-sm font-medium text-gray-700 mb-1",children:"Filter by Specialty"}),(0,nn.jsxs)("select",{id:"specialty-filter",value:u,onChange:e=>m(e.target.value),className:"w-full px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue",children:[(0,nn.jsx)("option",{value:"",children:"All Specialties"}),["Wealth Manager","Management Consultant","Valuation","Investment Banking","Private Equity","Venture Capital","Law Firm","Accounting","Financial Planning","Corporate Development","Healthcare Finance"].map((e,t)=>(0,nn.jsx)("option",{value:e,children:e},t))]})]})]})]}
2),r?(0,nn.jsx)("div",{className:"flex justify-center items-center py-12",children:(0,nn.jsx)("div",{className:"animate-spin rounded-full h-12 w-12 border-t-2 border-b-2 border-apn-blue"})}):a?(0,nn.jsxs)("div",{className:"text-center py-12",children:[(0,nn.jsx)("p",{className:"text-xl text-red-600",children:a}),(0,nn.jsx)("button",{onClick:b,className:"mt-4 bg-apn-blue text-white py-2 px-6 rounded hover:bg-blue-700",children:"Try Again"})]}):(0,nn.jsxs)(nn.Fragment,{children:[(0,nn.jsx)("div",{className:"mb-6",children:(0,nn.jsxs)("p",{className:"text-gray-600",children:["Showing ",Math.min(g*x,v.length)," of ",v.length," members"]})}),v.length>0?"grid"===h?(0,nn.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6",children:v.slice((g-1)*x,g*x).map(e=>(0,nn.jsx)("div",{className:"bg-white rounded-lg shadow-lg overflow-hidden border border-gray-200",children:(0,nn.jsxs)("div",{className:"p-6 text-center",children:[(0,nn.jsx)("div",{className:"w-24 h-24 rounded-full bg-gray-300 mx-auto mb-4 overflow-hidden",children:e.image?(0,nn.jsx)("img",{src:e.image,alt:e.name,className:"h-full w-full object-cover"}):(0,nn.jsx)("div",{className:"h-full w-full flex items-center justify-center",children:(0,nn.jsx)("span",{className:"text-gray-600 text-2xl font-bold",children:(e.name||"?")[0]})})}),(0,nn.jsxs)("div",{className:"flex items-center justify-center gap-1 mb-1",children:[(0,nn.jsx)("h3",{className:"text-lg font-bold",children:e.name}),e.badges&&e.badges.length>0&&(0,nn.jsx)(Cc,{badges:e.badges,size:"small"})]}),e.title&&(0,nn.jsx)("p",{className:"text-gray-600 text-sm mb-2",children:e.title}),e.company&&(0,nn.jsx)("p",{className:"text-gray-600 text-sm mb-4",children:e.company}),(0,nn.jsxs)("div",{className:"space-y-1 text-sm text-gray-600 mb-4",children:[e.location&&(0,nn.jsx)("p",{children:e.location}),e.specialty&&(0,nn.jsxs)("p",{children:["Specialty: ",e.specialty]})]}),(0,nn.jsx)(dt,{to:"/directory/".concat(e.id),className:"block w-full bg-apn-blue text-white text-center py-2 px-4 rounded hover:bg-blue-700 transition duration-200",children:"View Profile"})]})},e.id))}):(0,nn.jsx)("div",{className:"space-y-4",children:v.slice((g-1)*x,g*x).map(e=>(0,nn.jsx)("div",{className:"bg-white rounded-lg shadow-lg overflow-hidden border border-gray-200",children:(0,nn.jsxs)("div",{className:"p-6 flex items-center",children:[(0,nn.jsx)("div",{className:"w-16 h-16 rounded-full bg-gray-300 mr-6 flex-shrink-0 overflow-hidden",children:e.image?(0,nn.jsx)("img",{src:e.image,alt:e.name,className:"h-full w-full object-cover"}):(0,nn.jsx)("div",{className:"h-full w-full flex items-center justify-center",children:(0,nn.jsx)("span",{className:"text-gray-600 text-xl font-bold",children:(e.name||"?")[0]})})}),(0,nn.jsxs)("div",{className:"flex-grow",children:[(0,nn.jsxs)("div",{className:"flex items-center gap-1",children:[(0,nn.jsx)("h3",{className:"text-lg font-bold",children:e.name}),e.badges&&e.badges.length>0&&(0,nn.jsx)(Cc,{badges:e.badges,size:"small"})]}),(0,nn.jsxs)("p",{className:"text-gray-600",children:[e.title,e.title&&e.company?" at ":"",e.company]}),(0,nn.jsxs)("div",{className:"flex flex-wrap gap-2 mt-2",children:[e.location&&(0,nn.jsx)("span",{className:"inline-block bg-gray-100 text-gray-600 text-xs px-2 py-1 rounded",children:e.location}),e.specialty&&(0,nn.jsx)("span",{className:"inline-block bg-gray-100 text-gray-600 text-xs px-2 py-1 rounded",children:e.specialty})]})]}),(0,nn.jsx)("div",{className:"ml-4",children:(0,nn.jsx)(dt,{to:"/directory/".concat(e.id),className:"inline-block bg-apn-blue text-white py-2 px-4 rounded hover:bg-blue-700 transition duration-200",children:"View Profile"})})]})},e.id))}):(0,nn.jsx)("div",{className:"text-center py-12",children:(0,nn.jsx)("p",{className:"text-xl text-gray-600",children:"No members found matching your search criteria."})})]}),v.length>x&&(0,nn.jsx)("div",{className:"mt-12 flex justify-center",children:(0,nn.jsxs)("nav",{className:"inline-flex rounded-md shadow",children:[(0,nn.jsx)("button",{onClick:()=>f(e=>Math.max(e-1,1)),disabled:1===g,className:"px-4 py-2 rounded-l-md border border-gray-300 ".concat(1===g?"bg-gray-100 text-gray-400 cursor-not-allowed":"bg-white text-gray-700 hover:bg-gray-50"),children:"Previous"}),Array.from({length:Math.ceil(v.length/x)},(e,t)=>t+1).map(e=>(0,nn.jsx)("button",{onClick:()=>f(e),className:"px-4 py-2 border-t border-b border-gray-300 ".concat(g===e?"bg-apn-blue text-white":"bg-white text-gray-700 hover:bg-gray-50"),children:e},e)),(0,nn.jsx)("button",{onClick:()=>f(e=>Math.min(e+1,Math.ceil(v.length/x))),disabled:g===Math.ceil(v.length/x),className:"px-4 py-2 rounded-r-md border border-gray-300 ".concat(g===Math.ceil(v.length/x)?"bg-gray-100 text-gray-400 cursor-not-allowed":"bg-white text-gray-700 hover:bg-gray-50"),children:"Next"})]})})]})}),(0,nn.jsx)("section",{className:"bg-apn-blue text-white py-12",children:(0,nn.jsxs)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 text-center",children:[(0,nn.jsx)("div",{className:"flex justify-center mb-6",children:(0,nn.jsx)("img",{src:"".concat("","/apn-logos/APN-Tag-SQ-white.jpg"),alt:"APN Logo Square",className:"h-20"})}),(0,nn.jsx)("h2",{className:"text-3xl font-bold mb-4",children:"Update Your Profile"}),(0,nn.jsx)("p",{className:"text-xl mb-8 max-w-3xl mx-auto",children:"Keep your profile information up to date to make the most of your APN membership."}),(0,nn.jsx)(dt,{to:"/profile",className:"btn-primary bg-white text-apn-blue hover:bg-gray-100",children:"Edit Your Profile"})]})})]})},Rc=()=>{var t;const{id:n}=le(),r=oe(),{currentUser:s,userProfile:a}=sn(),i=!!s,[o,l]=(0,e.useState)(!1),c="string"===typeof n&&!n.startsWith("seed-"),d=i&&c&&n!==(null===s||void 0===s?void 0:s.uid),u=(null===a||void 0===a?void 0:a.displayName)||"".concat((null===a||void 0===a?void 0:a.firstName)||""," ").concat((null===a||void 0===a?void 0:a.lastName)||"").trim()||(null===s||void 0===s?void 0:s.email)||"Member",[m,h]=(0,e.useState)(null),[p,g]=(0,e.useState)(!0),[f,x]=(0,e.useState)("about"),[b,y]=(0,e.useState)(!1);return(0,e.useEffect)(()=>{let e=!1;const t=e=>{if(!e)return"";let t=null;if("function"===typeof e.toDate)t=e.toDate();else if(e instanceof Date)t=e;else if("object"===typeof e&&"number"===typeof e.seconds)t=new Date(1e3*e.seconds);else{const n=new Date(e);t=isNaN(n.getTime())?null:n}return t?t.toLocaleDateString("en-US",{month:"long",year:"numeric"}):"string"===typeof e?e:""},r=(e,n)=>
2({id:n,firstName:e.firstName||(e.displayName?e.displayName.split(" ")[0]:"")||"Member",lastName:e.lastName||(e.displayName?e.displayName.split(" ").slice(1).join(" "):""),title:e.title||e.jobTitle||"",company:e.company||e.organization||"",location:e.location||e.city||"",email:e.email||"",phone:e.phone||"",linkedin:e.linkedin||e.linkedinUrl||"",bio:e.bio||e.aboutMe||"",profileImage:e.profilePhoto||e.image||e.photoURL||e.profileImage||"",memberSince:t(e.memberSince||e.createdAt),education:Array.isArray(e.education)?e.education:[],experience:Array.isArray(e.experience)?e.experience:[],groups:Array.isArray(e.groups)?e.groups:[],events:Array.isArray(e.events)?e.events:[],connections:Array.isArray(e.connections)?e.connections:[],suggestedConnections:Array.isArray(e.suggestedConnections)?e.suggestedConnections:[],badges:_c(e)});return(async()=>{g(!0);try{const t=(e=>Ic.find(t=>t.id===e)||null)(n);if(t)return void(e||(h(r(t,n)),y(!1)));const s=await(0,wn.VM)(n);if(e)return;if(!s||s.status&&"approved"!==s.status||"admin"===s.role)return void h(null);h(r(s,n)),y(!1)}catch(t){console.error("Error loading member profile:",t),e||h(null)}finally{e||g(!1)}})(),()=>{e=!0}},[n]),p?(0,nn.jsx)("div",{className:"flex justify-center items-center min-h-screen",children:(0,nn.jsx)("div",{className:"animate-spin rounded-full h-12 w-12 border-t-2 border-b-2 border-apn-blue"})}):m?(0,nn.jsxs)("div",{className:"bg-white",children:[(0,nn.jsx)("div",{className:"bg-apn-blue text-white py-12",children:(0,nn.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:(0,nn.jsxs)("div",{className:"text-center",children:[(0,nn.jsx)("div",{className:"flex justify-center mb-4",children:(0,nn.jsx)("img",{src:"".concat("","/apn-logos/APN-Tag-white.jpg"),alt:"APN Logo",className:"h-16"})}),(0,nn.jsx)("h1",{className:"text-3xl font-bold",children:"Member Profile"})]})})}),(0,nn.jsx)("section",{className:"py-12",children:(0,nn.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:(0,nn.jsxs)("div",{className:"bg-white rounded-lg shadow-lg overflow-hidden",children:[(0,nn.jsx)("div",{className:"p-6 bg-gray-50 border-b border-gray-200",children:(0,nn.jsxs)("div",{className:"flex flex-col md:flex-row items-center md:items-start",children:[(0,nn.jsx)("div",{className:"mb-4 md:mb-0 md:mr-6",children:(0,nn.jsxs)("div",{className:"relative",children:[m.profileImage?(0,nn.jsx)("img",{src:m.profileImage.startsWith("http")?m.profileImage:"".concat("").concat(m.profileImage),alt:"".concat(m.firstName," ").concat(m.lastName),className:"h-32 w-32 rounded-full object-cover border-4 border-white shadow"}):(0,nn.jsx)("div",{className:"h-32 w-32 rounded-full bg-apn-blue flex items-center justify-center border-4 border-white shadow text-white text-4xl font-semibold",children:((null===(t=m.firstName)||void 0===t?void 0:t.charAt(0))||"?").toUpperCase()}),m.badges&&m.badges.length>0&&(0,nn.jsxs)("div",{className:"absolute -bottom-2 -right-2 flex items-center gap-0.5",children:[m.badges.slice(0,3).map(e=>(0,nn.jsx)(Ec,{badge:e,size:"medium"},e.id)),m.badges.length>3&&(0,nn.jsxs)("span",{className:"h-8 w-8 rounded-full bg-gray-200 shadow-md border border-gray-200 flex items-center justify-center text-xs font-semibold text-gray-700",children:["+",m.badges.length-3]})]})]})}),(0,nn.jsxs)("div",{className:"text-center md:text-left flex-grow",children:[(0,nn.jsxs)("h2",{className:"text-2xl font-bold text-gray-900 flex items-center justify-center md:justify-start",children:[m.firstName," ",m.lastName,m.badges&&m.badges.length>0&&(0,nn.jsx)("span",{className:"ml-2 inline-flex items-center gap-1",children:m.badges.slice(0,3).map(e=>(0,nn.jsx)(Ec,{badge:e,size:"small"},e.id))})]}),(0,nn.jsxs)("p",{className:"text-lg text-gray-600",children:[m.title," at ",m.company]}),(0,nn.jsx)("p",{className:"text-gray-500 mb-4",children:m.location}),(0,nn.jsxs)("div",{className:"flex flex-wrap justify-center md:justify-start gap-2",children:[m.memberSince&&(0,nn.jsxs)("span",{className:"inline-flex items-center px-3 py-1 rounded-full text-xs font-medium bg-blue-100 text-blue-800",children:["Member since ",m.memberSince]}),m.groups&&m.groups.length>0&&(0,nn.jsxs)("span",{className:"inline-flex items-center px-3 py-1 rounded-full text-xs font-medium bg-green-100 text-green-800",children:[m.groups.length," Groups"]}),m.events&&m.events.length>0&&(0,nn.jsxs)("span",{className:"inline-flex items-center px-3 py-1 rounded-full text-xs font-medium bg-purple-100 text-purple-800",children:[m.events.length," Events"]})]})]}),(0,nn.jsx)("div",{className:"mt-4 md:mt-0",children:i&&(0,nn.jsxs)("div",{className:"flex flex-col space-y-2",children:[(0,nn.jsxs)("a",{href:"mailto:".concat(m.email),className:"inline-flex items-center justify-center px-4 py-2 border border-transparent roun
2ded-md shadow-sm text-sm font-medium text-white bg-apn-blue hover:bg-blue-700",children:[(0,nn.jsx)("svg",{className:"h-4 w-4 mr-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})}),"Contact"]}),d&&(0,nn.jsxs)("button",{onClick:async()=>{if(d&&!o)try{l(!0);const e="".concat(m.firstName||""," ").concat(m.lastName||"").trim()||"Member",t=await(async(e,t,n,r)=>{const s=(0,vt.collection)(yt.db,"conversations"),a=(0,vt.query)(s,(0,vt.where)("participants","array-contains",e)),i=(await(0,vt.getDocs)(a)).docs.find(e=>(e.data().participants||[]).includes(n));return i?i.id:(await(0,vt.addDoc)(s,{participants:[e,n],participantNames:{[e]:t||"Member",[n]:r||"Member"},lastMessage:"",lastMessageAt:(0,vt.serverTimestamp)(),createdAt:(0,vt.serverTimestamp)(),updatedAt:(0,vt.serverTimestamp)(),unread:{[e]:0,[n]:0}})).id})(s.uid,u,m.id,e);r("/messages/".concat(t))}catch(e){console.error("Error starting conversation:",e),alert("Failed to start conversation. Please try again."),l(!1)}},disabled:o,className:"inline-flex items-center justify-center px-4 py-2 border border-transparent rounded-md shadow-sm text-sm font-medium text-white ".concat(o?"bg-gray-300 cursor-not-allowed":"bg-apn-light-blue hover:bg-apn-blue"),children:[(0,nn.jsx)("svg",{className:"h-4 w-4 mr-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})}),o?"Starting\u2026":"Message"]}),b?(0,nn.jsxs)("button",{onClick:()=>y(!1),className:"inline-flex items-center justify-center px-4 py-2 border border-gray-300 rounded-md shadow-sm text-sm font-medium text-gray-700 bg-white hover:bg-gray-50",children:[(0,nn.jsx)("svg",{className:"h-4 w-4 mr-2 text-gray-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M13 7a4 4 0 11-8 0 4 4 0 018 0zM9 14a6 6 0 00-6 6v1h12v-1a6 6 0 00-6-6zM21 12h-6"})}),"Remove from Network"]}):(0,nn.jsxs)("button",{onClick:()=>y(!0),className:"inline-flex items-center justify-center px-4 py-2 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-green-600 hover:bg-green-700",children:[(0,nn.jsx)("svg",{className:"h-4 w-4 mr-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 4v16m8-8H4"})}),"Add to Network"]}),m.linkedin&&(0,nn.jsxs)("a",{href:m.linkedin,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center justify-center px-4 py-2 border border-gray-300 rounded-md shadow-sm text-sm font-medium text-gray-700 bg-white hover:bg-gray-50",children:[(0,nn.jsx)("svg",{className:"h-4 w-4 mr-2 text-blue-600",fill:"currentColor",viewBox:"0 0 24 24",children:(0,nn.jsx)("path",{d:"M19 0h-14c-2.761 0-5 2.239-5 5v14c0 2.761 2.239 5 5 5h14c2.762 0 5-2.239 5-5v-14c0-2.761-2.238-5-5-5zm-11 19h-3v-11h3v11zm-1.5-12.268c-.966 0-1.75-.79-1.75-1.764s.784-1.764 1.75-1.764 1.75.79 1.75 1.764-.783 1.764-1.75 1.764zm13.5 12.268h-3v-5.604c0-3.368-4-3.113-4 0v5.604h-3v-11h3v1.765c1.396-2.586 7-2.777 7 2.476v6.759z"})}),"LinkedIn"]})]})})]})}),(0,nn.jsx)("div",{className:"border-b border-gray-200",children:(0,nn.jsxs)("nav",{className:"flex -mb-px",children:[(0,nn.jsx)("button",{onClick:()=>x("about"),className:"py-4 px-6 font-medium text-sm border-b-2 ".concat("about"===f?"border-apn-blue text-apn-blue":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"),children:"About"}),(0,nn.jsx)("button",{onClick:()=>x("groups"),className:"py-4 px-6 font-medium text-sm border-b-2 ".concat("groups"===f?"border-apn-blue text-apn-blue":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"),children:"Groups"}),(0,nn.jsx)("button",{onClick:()=>x("events"),className:"py-4 px-6 font-medium text-sm border-b-2 ".concat("events"===f?"border-apn-blue text-apn-blue":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"),children:"Events"}),(0,nn.jsx)("button",{onClick:()=>x("network"),className:"py-4 px-6 font-medium text-sm border-b-2 ".concat("network"===f?"border-apn-blue text-apn-blue":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"),children:"Network"})]})}),(0,nn.jsxs)("div",{className:"p-6",children:["about"===f&&(0,nn.jsxs)("div",{className:"space-y-8",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("h3",{className:"text-lg font-semibold text-gray-900 mb-3",children:"Bio"}),(0,nn.jsx)("p",{className:"text-gray-700",children:m.bio})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("h3",{className:"text-lg font-semibold text-gray-900 mb-3",children:"Experience"}),(0,nn.jsx)("div",{className:"space-y-4",children:m.experience.map((e,t)=>(0,nn.jsxs)("div",{className:"border-l-2 border-gray-200 pl-4 py-1",children:[(0,nn.jsx)("h4",{className:"font-semibold text-gray-900",children:e.title}),(0,nn.jsx)("p",{className:"text-gray-600",children:e.company}),(0,nn.jsxs)("p",{className:"text-sm text-gray-500",children:[e.startDate," - ",e.endDate]}),(0,nn.jsx)("p",{className:"text-gray-700 mt-1",children:e.description})]},t))})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("h3",{className:"text-lg font-semibold text-gray-900 mb-3",children:"Education"}),(0,nn.jsx)("div",{className:"space-y-4",children:m.education.map((e,t)=>(0,nn.jsxs)("div",{className:"border-l-2 border-gray-200 pl-4 py-1",children:[(0,nn.jsx)("h4",{className:"font-semibold text-gray-900",children:e.institution}),(0,nn.jsx)("p",{className:"text-gray-600",children:e.degree}),(0,nn.jsx)("p",{className:"text-sm text-gray-500",children:e.year})]},t))})]}),i&&(0,nn.jsxs)("div",{children:[(0,nn.jsx)("h3",{className:"text-lg font-semibold text-gray-900 mb-3",children:"Contact Information"}),(0,nn.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("p",{className:"text-sm text-gray-500",children:"Email"}),(0,nn.jsx)("p",{className:"text-gray-700",children:m.email})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("p",{className:"text-sm text-gray-500",children:"Phone"}),(0,nn.jsx)("p",{className:"text-gray-700",children:m.phone})]}),m.linkedin&&(0,nn.jsxs)("div",{children:[(0,nn.jsx)("p",{className:"text-sm text-gray-500",children:"LinkedIn"}),(0,nn.jsx)("a",{href:m.linkedin,target:"_blank",rel:"noopener noreferrer",className:"text-apn-blue hover:underline",children:m.linkedin.replace("https://www.linkedin.com/in/","")})]})]})]})]}),"groups"===f&&(0,nn.jsxs)("div",{children:[(0,nn.jsx)("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Groups"}),m.groups&&m.groups.length>0?(0,nn.jsx)("div",{className:"space-y-4",children:m.groups.map(e=>(0,nn.jsxs)("div",{className:"border border-gray-200 rounded-lg p-4 flex justify-between items-center",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("h4",{className:"font-semibold text-gray-900",children:e.name}),(0,nn.jsxs)("p",{className:"text-sm text-gray-500",children:["Role: ",e.role]})]}),(0,nn.jsx)(dt,{to:"/groups/".concat(e.id),className:"inline-flex items-center px-3 py-1 border border-transparent text-sm leading-5 font-medium rounded-md text-white bg-apn-blue hover:bg-blue-700 focus:outline-none focus:border-blue-700 focus:shadow-outline-blue active:bg-blue-800 transition ease-in-out duration-150",children:"View Group"})]},e.id))}):(0,nn.jsx)("p",{className:"text-gray-500 text-center py-8",children:"This member hasn't joined any groups yet."})]}),"events"===f&&(0,nn.jsxs)("div",{children:[(0,nn.jsx)("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Events"}),m.events&&m.events.length>0?(0,nn.jsx)("div",{className:"space-y-4",children:m.events.map(e=>(0,nn.jsxs)("div",{className:"border border-gray-200 rounded-lg p-4 flex justify-between items-center",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("h4",{className:"font-semibold text-gray-900",children:e.title}),(0,nn.jsx)("p",{className:"text-sm text-gray-500",children:e.date}),(0,nn.jsx)("span",{className:"inline-block mt-1 px-2 py-1 text-xs rounded-full ".concat("Attended"===e.status?"bg-green-100 text-green-800":"bg-blue-100 text-blue-800"),children:e.status})]}),(0,nn.jsx)(dt,{to:"/events/".concat(e.id),className:"inline-flex items-center px-3 py-1 border border-transparent text-sm leading-5 font-medium rounded-md text-white bg-apn-blue hover:bg-blue-700 focus:outline-none focus:border-blue-700 focus:shadow-outline-blue active:bg-blue-800 transition ease-in-out duration-150",children:"View Event"})]},e.id))}):(0,nn.jsx)("p",{className:"text-gray-500 text-center py-8",children:"This member hasn't attended any events yet."})]}),"network"===f&&(0,nn.jsxs)("div",{children:[(0,nn.jsxs)("div",{className:"mb-8",children:[(0,nn.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,nn.jsxs)("h3",{className:"text-lg font-semibold text-gray-900",children:["Connections (",m.connections.length,")"]}),b&&(0,nn.jsxs)("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-green-100 text-green-800",children:[(0,nn.jsx)("svg",{className:"-ml-0.5 mr-1.5 h-2 w-2 text-green-400",fill:"currentColor",viewBox:"0 0 8 8",children:(0,nn.jsx)("circle",{cx:"4",cy:"4",r:"3"})}),"In Your Network"]})]}),m.connections&&m.connections.length>0?(0,nn.jsxs)(nn.Fragment,{children:[(0,nn.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:m.connections.slice(0,6).map(e=>(0,nn.jsxs)("div",{className:"border border-gray-200 rounded-lg p-4 flex items-center",children:[(0,nn.jsx)("div",{className:"flex-shrink-0 mr-4",children:(0,nn.jsx)("img",{src:"".concat("").concat(e.image),alt:e.name,className:"h-12 w-12 rounded-full object-cover",onError:e=>{e.target.onerror=null,e.target.src="".concat("","/images/profiles/default-avatar.png")}})}),(0,nn.jsxs)("div",{className:"flex-grow",children:[(0,nn.jsx)("h4",{className:"font-semibold text-gray-900",children:e.name}),(0,nn.jsxs)("p",{className:"text-sm text-gray-600",children:[e.title," at ",e.company]}),(0,nn.jsxs)("p",{className:"text-xs text-gray-500 mt-1",children:[e.mutualConnections," mutual connections"]})]}),(0,nn.jsx)("div",{children:(0,nn.jsx)(dt,{to:"/directory/".concat(e.id),className:"inline-flex items-center px-3 py-1 border border-gray-300 text-sm leading-5 font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:border-blue-300 focus:shadow-outline-blue active:bg-gray-100 transition ease-in-out duration-150",children:"View"})})]},e.id))}),m.connections.length>6&&(0,nn.jsx)("div",{className:"mt-6 text-center",children:(0,nn.jsxs)("span",{className:"text-gray-500 text-sm",children:["Showing 6 of ",m.connections.length," connections"]})})]}):(0,nn.jsx)("p",{className:"text-gray-500 text-center py-8",children:"This member doesn't have any connections yet."})]}),m.suggestedConnections&&m.suggestedConnections.length>0&&(0,nn.jsxs)("div",{children:[(0,nn.jsx)("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:"People You May Know"}),(0,nn.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:m.suggestedConnections.map(e=>(0,nn.jsxs)("div",{className:"border border-gray-200 rounded-lg p-4 flex items-center bg-gray-50",children:[(0,nn.jsx)("div",{className:"flex-shrink-0 mr-4",children:(0,nn.jsx)("img",{src:"".concat("").concat(e.image),alt:e.name,className:"h-12 w-12 rounded-full object-cover",onError:e=>{e.target.onerror=null,e.target.src="".concat("","/images/profiles/default-avatar.png")}})}),(0,nn.jsxs)("div",{className:"flex-grow",children:[(0,nn.jsx)("h4",{className:"font-semibold text-gray-900",children:e.name}),(0,nn.jsxs)("p",{className:"text-sm text-gray-600",children:[e.title," at ",e.company]}),(0,nn.jsxs)("p",{className:"text-xs text-gray-500 mt-1",children:[e.mutualConnections," mutual connections"]})]}),(0,nn.jsx)("div",{children:(0,nn.jsxs)("button",{className:"inline-flex items-center px-3 py-1 border border-transparent text-sm leading-5 font-medium rounded-md text-white bg-green-600 hover:bg-green-700 focus:outline-none focus:border-green-700 focus:shadow-outline-green active:bg-green-800 transition ease-in-out duration-150",children:[(0,nn.jsx)("svg",{className:"-ml-0.5 mr-1 h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 4v16m8-8H4"})}),"Connect"]})})]},e.id))})]})]})]})]})})}),(0,nn.jsx)("section",{className:"bg-apn-blue text-white py-12",children:(0,nn.jsxs)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 text-center",children:[(0,nn.jsx)("div",{className:"flex justify-center mb-6",children:(0,nn.jsx)("img",{src:"".concat("","/apn-logos/APN-Tag-SQ-white.jpg"),alt:"APN Logo Square",className:"h-20"})}),(0,nn.jsx)("h2",{className:"text-3xl font-bold mb-4",children:"Ready to Join the Network?"}),(0,nn.jsx)("p",{className:"text-xl mb-8 max-w-3xl mx-auto",children:"Connect with finance professionals, access exclusive resources, and accelerate your career with APN."}),(0,nn.jsx)(dt,{to:"/register",className:"btn-primary bg-white text-apn-blue hover:bg-gray-100",children:"Become a Member Today"})]})})]}):(0,nn.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12",children:(0,nn.jsxs)("div",{className:"text-center",children:[(0,nn.jsx)("h1",{className:"text-3xl font-bold text-gray-900 mb-4",children:"Member Not Found"}),(0,nn.jsx)("p",{className:"text-gray-600 mb-8",children:"The member you're looking for doesn't exist or has been removed."}),(0,nn.jsx)(dt,{to:"/directory",className:"inline-block bg-apn-blue text-white py-2 px-6 rounded hover:bg-blue-700 transition duration-200",children:"Back to Directory"})]})})},Lc=[{id:"seed-group-1",isSeed:!0,name:"Investment Banking Professionals",description:"Discuss live deals, market trends, and career moves with fellow IB professionals.",members:156,posts:324,category:"Industry",image:""},{id:"seed-group-2",isSeed:!0,name:"Private Equity & Buyouts",description:"Sourcing, diligence, value creation, and exits \u2014 a hub for PE and buyout pros.",members:112,posts:210,category:"Industry",image:""},{id:"seed-group-3",isSeed:!0,name:"M&A Legal & Tax",description:"Deal structuring, due diligence, and regulatory considerations for M&A counsel and tax advisors.",members:89,posts:167,category:"Specialty",image:""},{id:"seed-group-4",isSeed:!0,name:"Corporate Development",description:"In-house dealmakers sharing strategy, integration, and pipeline best practices.",members:74,posts:131,category:"Industry",image:""},{id:"seed-group-5",isSeed:!0,name:"Wealth Management & Liquidity",description:"Advisors helping founders and executives plan around liquidity events.",members:68,posts:96,category:"Specialty",image:""},{id:"seed-group-6",isSeed:!0,name:"Women in Finance",description:"A supportive community for women across investment banking, PE, and advisory.",members:134,posts:245,
2category:"Community",image:""}],Mc=[{label:"APN Blue",path:"/apn-logos/APN-Tag-SQ-blue.png"},{label:"APN Black",path:"/apn-logos/APN-Tag-SQ-black.png"},{label:"APN Clear",path:"/apn-logos/APN-Tag-SQ-trans.png"},{label:"APN Stacked",path:"/apn-logos/APN-Tag-Stack-blue.jpg"}],Oc="/apn-logos/APN-Tag-SQ-blue.png",Fc=e=>e?/^https?:\/\//i.test(e)?e:"".concat("").concat(e):"".concat("").concat(Oc),Uc=()=>{const{currentUser:t}=sn(),[n,r]=(0,e.useState)([]),[s,a]=(0,e.useState)(!0),[i,o]=(0,e.useState)(null),[l,c]=(0,e.useState)(!1);(0,e.useEffect)(()=>{console.log("Groups component mounted, calling loadGroups..."),d()},[]);const d=async()=>{try{a(!0),o(null),console.log("Loading groups from Firebase...");const e=await(0,wn.f)(20);r(e),t&&b(e.filter(e=>Array.isArray(e.members)&&e.members.includes(t.uid)).map(e=>e.id));const n=await(0,wn.l9)();c(n)}catch(i){console.error("Error loading groups:",i),o("Failed to load groups: ".concat(i.message))}finally{a(!1)}},[u,m]=(0,e.useState)(""),[h,p]=(0,e.useState)(""),[g,f]=(0,e.useState)("members"),[x,b]=(0,e.useState)([]),[y,v]=(0,e.useState)(1),[w]=(0,e.useState)(6),j=l?n:[...n,...Lc],N=[...new Set(j.map(e=>e.category))],k=[...j.filter(e=>{const t=e.name.toLowerCase().includes(u.toLowerCase())||e.description.toLowerCase().includes(u.toLowerCase()),n=""===h||e.category===h;return t&&n})].sort((e,t)=>"members"===g?(t.memberCount||t.members||0)-(e.memberCount||e.members||0):"posts"===g?(t.posts||0)-(e.posts||0):"name"===g?e.name.localeCompare(t.name):0);return s?(0,nn.jsx)("div",{className:"flex justify-center items-center min-h-screen",children:(0,nn.jsxs)("div",{className:"text-center",children:[(0,nn.jsx)("div",{className:"animate-spin rounded-full h-12 w-12 border-t-2 border-b-2 border-apn-blue mx-auto mb-4"}),(0,nn.jsx)("p",{children:"Loading groups from Firebase..."})]})}):i?(0,nn.jsx)("div",{className:"max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:(0,nn.jsxs)("div",{className:"bg-red-50 border border-red-200 rounded-md p-4",children:[(0,nn.jsx)("h3",{className:"text-red-800 font-medium",children:"Error Loading Groups"}),(0,nn.jsx)("p",{className:"text-red-700",children:i}),(0,nn.jsx)("button",{onClick:d,className:"mt-2 bg-red-600 text-white px-4 py-2 rounded hover:bg-red-700",children:"Retry"})]})}):(0,nn.jsxs)("div",{className:"bg-white",children:[(0,nn.jsx)("div",{className:"bg-apn-blue text-white py-12",children:(0,nn.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:(0,nn.jsxs)("div",{className:"text-center",children:[(0,nn.jsx)("div",{className:"flex justify-center mb-4",children:(0,nn.jsx)("img",{src:"".concat("","/apn-logos/APN-Tag-white.jpg"),alt:"APN Logo",className:"h-16"})}),(0,nn.jsx)("h1",{className:"text-3xl font-bold",children:"Groups"})]})})}),(0,nn.jsx)("section",{className:"py-12",children:(0,nn.jsxs)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[(0,nn.jsxs)("div",{className:"mb-12",children:[(0,nn.jsx)("h2",{className:"text-2xl font-bold text-gray-900 mb-6",children:"My Groups"}),(0,nn.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:[n.filter(e=>x.includes(e.id)).map(e=>(0,nn.jsxs)("div",{className:"bg-white rounded-lg shadow-lg overflow-hidden border border-gray-200",children:[(0,nn.jsx)("div",{className:"h-40 bg-white relative overflow-hidden",children:(0,nn.jsx)("div",{className:"h-full w-full overflow-hidden flex items-center justify-center bg-white",children:(0,nn.jsx)("img",{src:Fc(e.image),alt:e.name,className:"h-full w-full object-contain transition-transform duration-300 hover:scale-105",onError:e=>{e.target.onerror=null,e.target.src="".concat("","/apn-logos/APN-blue (1).png")}})})}),(0,nn.jsxs)("div",{className:"p-6",children:[(0,nn.jsx)("h3",{className:"text-xl font-bold mb-2",children:e.name}),(0,nn.jsx)("p",{className:"text-gray-600 mb-4 line-clamp-2",children:e.description}),(0,nn.jsxs)("div",{className:"flex justify-between text-sm text-gray-500 mb-4",children:[(0,nn.jsxs)("span",{children:[e.memberCount||e.members||0," members"]}),(0,nn.jsxs)("span",{children:[e.posts||0," posts"]})]}),(0,nn.jsx)(dt,{to:"/groups/".concat(e.id),className:"block w-full bg-apn-blue text-white text-center py-2 px-4 roun
2ded hover:bg-blue-700 transition duration-200",children:"View Group"})]})]},e.id)),(0,nn.jsx)("div",{className:"bg-white rounded-lg shadow-lg overflow-hidden border border-dashed border-gray-300 flex items-center justify-center p-6",children:(0,nn.jsxs)("div",{className:"text-center",children:[(0,nn.jsx)("div",{className:"w-16 h-16 bg-gray-100 rounded-full flex items-center justify-center mx-auto mb-4",children:(0,nn.jsx)("svg",{className:"h-8 w-8 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 6v6m0 0v6m0-6h6m-6 0H6"})})}),(0,nn.jsx)("h3",{className:"text-lg font-semibold text-gray-700 mb-2",children:"Create a New Group"}),(0,nn.jsx)("p",{className:"text-gray-500 mb-4",children:"Start a discussion on a topic you're passionate about"}),(0,nn.jsx)(dt,{to:"/groups/create",className:"inline-block bg-apn-blue text-white py-2 px-4 rounded hover:bg-blue-700 transition duration-200",children:"Create Group"})]})})]})]}),(0,nn.jsxs)("div",{className:"mb-8 space-y-4",children:[(0,nn.jsx)("h2",{className:"text-2xl font-bold text-gray-900",children:"Discover Groups"}),(0,nn.jsxs)("div",{className:"flex flex-col md:flex-row justify-between items-center gap-4",children:[(0,nn.jsx)("div",{className:"w-full md:w-1/2",children:(0,nn.jsx)("input",{type:"text",placeholder:"Search groups by name or description...",value:u,onChange:e=>m(e.target.value),className:"w-full px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue"})}),(0,nn.jsxs)("div",{className:"flex space-x-4 w-full md:w-auto",children:[(0,nn.jsxs)("select",{value:h,onChange:e=>p(e.target.value),className:"px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue",children:[(0,nn.jsx)("option",{value:"",children:"All Categories"}),N.map((e,t)=>(0,nn.jsx)("option",{value:e,children:e},t))]}),(0,nn.jsxs)("select",{value:g,onChange:e=>f(e.target.value),className:"px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue",children:[(0,nn.jsx)("option",{value:"members",children:"Sort by Members"}),(0,nn.jsx)("option",{value:"posts",children:"Sort by Activity"}),(0,nn.jsx)("option",{value:"name",children:"Sort by Name"})]})]})]})]}),k.length>0?(0,nn.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:k.slice((y-1)*w,y*w).map(e=>(0,nn.jsxs)("div",{className:"bg-white rounded-lg shadow-lg overflow-hidden border border-gray-200",children:[(0,nn.jsxs)(dt,{to:"/groups/".concat(e.id),className:"block h-40 bg-white relative overflow-hidden",children:[(0,nn.jsx)("div",{className:"h-full w-full overflow-hidden flex items-center justify-center bg-white",children:(0,nn.jsx)("img",{src:Fc(e.image),alt:e.name,className:"h-full w-full object-contain transition-transform duration-300 hover:scale-105",onError:e=>{e.target.onerror=null,e.target.src="".concat("","/apn-logos/APN-blue (1).png")}})}),(0,nn.jsx)("div",{className:"absolute top-0 right-0 bg-gray-100 text-gray-700 px-3 py-1 text-sm",children:e.category})]}),(0,nn.jsxs)("div",{className:"p-6",children:[(0,nn.jsx)("h3",{className:"text-xl font-bold mb-2",children:e.name}),(0,nn.jsx)("p",{className:"text-gray-600 mb-4 line-clamp-2",children:e.description}),(0,nn.jsxs)("div",{className:"flex justify-between text-sm text-gray-500 mb-4",children:[(0,nn.jsxs)("span",{children:[e.memberCount||e.members||0," members"]}),(0,nn.jsxs)("span",{children:[e.posts||0," posts"]})]}),x.includes(e.id)?(0,nn.jsx)(dt,{to:"/groups/".concat(e.id),className:"block w-full bg-apn-blue text-white text-center py-2 px-4 rounded hover:bg-blue-700 transition duration-200",children:"View Group"}):(0,nn.jsx)("button",{onClick:()=>(async e=>{if(e.isSeed||String(e.id).startsWith("seed-"))alert("This is a demo group. You\u2019ll be able to join real groups as they\u2019re created.");else if(t)try{await(0,wn.U7)(e.id,t.uid),b(t=>[...t,e.id])}catch(i){console.error("Error joining group:",i),alert("Could not join the group. Please try again.")}else alert("Please log in to join groups.")})(e),className:"block w-full bg-gray-800 text-white text-center py-2 px-4 roun
2ded hover:bg-gray-700 transition duration-200",children:"Join Group"})]})]},e.id))}):(0,nn.jsx)("div",{className:"text-center py-12",children:(0,nn.jsx)("p",{className:"text-xl text-gray-600",children:"No groups found matching your search criteria."})}),k.length>w&&(0,nn.jsx)("div",{className:"mt-12 flex justify-center",children:(0,nn.jsxs)("nav",{className:"inline-flex rounded-md shadow",children:[(0,nn.jsx)("button",{onClick:()=>v(e=>Math.max(e-1,1)),disabled:1===y,className:"px-4 py-2 rounded-l-md border border-gray-300 ".concat(1===y?"bg-gray-100 text-gray-400 cursor-not-allowed":"bg-white text-gray-700 hover:bg-gray-50"),children:"Previous"}),Array.from({length:Math.ceil(k.length/w)},(e,t)=>t+1).map(e=>(0,nn.jsx)("button",{onClick:()=>v(e),className:"px-4 py-2 border-t border-b border-gray-300 ".concat(y===e?"bg-apn-blue text-white":"bg-white text-gray-700 hover:bg-gray-50"),children:e},e)),(0,nn.jsx)("button",{onClick:()=>v(e=>Math.min(e+1,Math.ceil(k.length/w))),disabled:y===Math.ceil(k.length/w),className:"px-4 py-2 rounded-r-md border border-gray-300 ".concat(y===Math.ceil(k.length/w)?"bg-gray-100 text-gray-400 cursor-not-allowed":"bg-white text-gray-700 hover:bg-gray-50"),children:"Next"})]})})]})}),(0,nn.jsx)("section",{className:"bg-apn-blue text-white py-12",children:(0,nn.jsxs)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 text-center",children:[(0,nn.jsx)("div",{className:"flex justify-center mb-6",children:(0,nn.jsx)("img",{src:"".concat("","/apn-logos/APN-Tag-SQ-white.jpg"),alt:"APN Logo Square",className:"h-20"})}),(0,nn.jsx)("h2",{className:"text-3xl font-bold mb-4",children:"Start Your Own Group"}),(0,nn.jsx)("p",{className:"text-xl mb-8 max-w-3xl mx-auto",children:"Have a topic you're passionate about? Create a group and connect with like-minded professionals."}),(0,nn.jsx)(dt,{to:"/groups/create",className:"btn-primary bg-white text-apn-blue hover:bg-gray-100",children:"Create a Group"})]})})]})},Bc=t=>{var n;let{group:r}=t;const{hasRole:a,currentUser:i}=sn(),[o,l]=(0,e.useState)("members"),[c,d]=(0,e.useState)(""),[u,m]=(0,e.useState)("all"),[h,p]=(0,e.useState)([]),[g,f]=(0,e.useState)([]),[x,b]=(0,e.useState)(!1);(0,e.useEffect)(()=>{"content"===o&&null!==r&&void 0!==r&&r.id&&y()},[o,null===r||void 0===r?void 0:r.id]);const y=async()=>{try{b(!0),console.log("\ud83d\udd04 Loading group content for admin monitoring...");const t=await(0,wn.PJ)(r.id);p(t);const n=[];for(const r of t)try{const e=(await(0,wn.yL)(r.id)).map(e=>(0,s.A)((0,s.A)({},e),{},{parentPostId:r.id,parentPostTitle:r.title}));n.push(...e)}catch(e){console.error("Error loading comments for post:",r.id,e)}f(n),console.log("\u2705 Group content loaded:",{posts:t.length,comments:n.length})}catch(e){console.error("\u274c Error loading group content:",e),(0,Rr.H4)(e,{context:{component:"GroupAdmin",action:"loadGroupContent",groupId:r.id}})}finally{b(!1)}},[v,w]=(0,e.useState)(((null===r||void 0===r?void 0:r.members)||[]).map(e=>({id:e,role:(null===r||void 0===r?void 0:r.createdBy)===e?"owner":"member"})));(0,e.useEffect)(()=>{w(((null===r||void 0===r?void 0:r.members)||[]).map(e=>({id:e,role:(null===r||void 0===r?void 0:r.createdBy)===e?"owner":"member"})))},[null===r||void 0===r?void 0:r.members,null===r||void 0===r?void 0:r.createdBy]);const[j,N]=(0,e.useState)((null===r||void 0===r?void 0:r.moderators)||[]);(0,e.useEffect)(()=>{N((null===r||void 0===r?void 0:r.moderators)||[])},[null===r||void 0===r?void 0:r.moderators]);const[k,A]=(0,e.useState)({name:(null===r||void 0===r?void 0:r.name)||"",description:(null===r||void 0===r?void 0:r.description)||"",category:(null===r||void 0===r?void 0:r.category)||"Industry"}),[S,E]=(0,e.useState)(!1);(0,e.useEffect)(()=>{A({name:(null===r||void 0===r?void 0:r.name)||"",description:(null===r||void 0===r?void 0:r.description)||"",category:(null===r||void 0===r?void 0:r.category)||"Industry"})},[null===r||void 0===r?void 0:r.name,null===r||void 0===r?void 0:r.description,null===r||void 0===r?void 0:r.category]);const C=[...h.map(e=>({id:"post-".concat(e.id),type:"discussion",title:e.title,content:e.content,author:e.authorName||"Unknown",createdAt:e.createdAt,flagged:!1,originalId:e.id,originalType:"post"})),...g.map(e=>({id:"comment-".concat(e.id),type:"comment",content:e.content,author:e.authorName||"Unknown",createdAt:e.createdAt,parentTitle:e.parentPostTitle||"Unknown Discussion",flagged:!1,originalId:e.id,originalType:"comment"}))];if(!(a("admin")||(null===r||void 0===r||null===(n=r.moderators)||void 0===n?void 0:n.includes(null===i||void 0===i?void 0:i.uid))))return(0,nn.jsx)("div",{className:"text-center py-8",children:(0,nn.jsx)("p",{className:"text-gray-500",children:"Access denied. Admin privileges required."})});const T=v.filter(e=>String(e.id).toLowerCase().includes(c.toLowerCase())),P=C.filter(e=>{const t=e.title&&e.title.toLowerCase().includes(c.toLowerCase())||e.content.toLowerCase().includes(c.toLowerCase())||e.author.toLowerCase().includes(c.toLowerCase()),n="all"===u||"flagged"===u&&e.flagged||u===e.type;return t&&n}),_=a("admin")||(null===r||void 0===r?void 0:r.createdBy)===(null===i||void 0===i?void 0:i.uid);return(0,nn.jsxs)("div",{children:[(0,nn.jsx)("div",{className:"border-b border-gray-200 mb-6",children:(0,nn.jsxs)("nav",{className:"flex -mb-px",children:[(0,nn.jsx)("button",{onClick:()=>l("members"),className:"py-4 px-6 font-medium text-sm border-b-2 ".concat("members"===o?"border-apn-blue text-apn-blue":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"),children:"Members"}),(0,nn.jsx)("button",{onClick:()=>l("content"),className:"py-4 px-6 font-medium text-sm border-b-2 ".concat("content"===o?"border-apn-blue text-apn-blue":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"),children:"Content Moderation"}),(0,nn.jsx)("button",{onClick:()=>l("settings"),className:"py-4 px-6 font-medium text-sm border-b-2 ".concat("settings"===o?"border-apn-blue text-apn-blue":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"),children:"Group Settings"})]})}),"members"===o&&(0,nn.jsxs)("div",{children:[(0,nn.jsx)("div",{className:"mb-6",children:(0,nn.jsx)("input",{type:"text",placeholder:"Search members...",value:c,onChange:e=>d(e.target.value),className:"w-full px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue"})}),(0,nn.jsx)("div",{className:"overflow-x-auto",children:(0,nn.jsxs)("table",{className:"min-w-full divide-y divide-gray-200",children:[(0,nn.jsx)("thead",{className:"bg-gray-50",children:(0,nn.jsxs)("tr",{children:[(0,nn.jsx)("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Member"}),(0,nn.jsx)("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Role"}),(0,nn.jsx)("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Joined"}),(0,nn.jsx)("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Actions"})]})}),(0,nn.jsxs)("tbody",{className:"bg-white divide-y divide-gray-200",children:[T.map(e=>(0,nn.jsxs)("tr",{children:[(0,nn.jsx)("td",{className:"px-6 py-4 whitespace-nowrap",children:(0,nn.jsxs)("div",{className:"flex items-center",children:[(0,nn.jsx)("div",{className:"flex-shrink-0 h-10 w-10",children:(0,nn.jsx)("div",{className:"h-10 w-10 rounded-full bg-gray-300 flex items-center justify-center",children:(0,nn.jsx)("span",{className:"text-sm font-medium text-gray-700",children:String(e.id).charAt(0).toUpperCase()})})}),(0,nn.jsxs)("div",{className:"ml-4",children:[(0,nn.jsx)("div",{className:"text-sm font-medium text-gray-900",children:"owner"===e.role?"Owner":j.includes(e.id)?"Moderator":"Member"}),(0,nn.jsx)("div",{className:"text-sm text-gray-500 break-all",children:e.id})]})]})}),(0,nn.jsx)("td",{className:"px-6 py-4 whitespace-nowrap",children:(0,nn.jsxs)("select",{value:e.role,onChange:t=>{return n=e.id,r=t.target.value,void w(v.map(e=>e.id===n?(0,s.A)((0,s.A)({},e),{},{role:r}):e));var n,r},disabled:"owner"===e.role,className:"block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-apn-blue focus:border-apn-blue sm:text-sm",children:[(0,nn.jsx)("option",{value:"member",children:"Member"}),(0,nn.jsx)("option",{value:"admin",children:"Admin"}),(0,nn.jsx)("option",{value:"owner",children:"Owner"})]})}),(0,nn.jsx)("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:"\u2014"}),(0,nn.jsxs)("td",{className:"px-6 py-4 whitespace-nowrap text-right text-sm font-medium space-x-3",children:[_&&"owner"!==e.role&&(0,nn.jsx)("button",{onClick:()=>(async e=>{const t=j.includes(e),n=t?j.filter(t=>t!==e):[...j,e];try{await(0,wn.vW)(r.id,{moderators:n}
2),N(n),(0,Rr.oc)(t?"Moderator removed.":"Member promoted to moderator.")}catch(s){(0,Rr.H4)(s,{context:{component:"GroupAdmin",action:"toggleModerator",groupId:r.id,memberId:e}})}})(e.id),className:"text-apn-blue hover:text-apn-dark-blue",children:j.includes(e.id)?"Remove moderator":"Make moderator"}),"owner"!==e.role&&(0,nn.jsx)("button",{onClick:()=>(async e=>{if(window.confirm("Are you sure you want to remove this member from the group? This action cannot be undone."))try{await(0,wn.JW)(r.id,e),w(v.filter(t=>t.id!==e)),(0,Rr.oc)("Member has been removed from the group.")}catch(t){(0,Rr.H4)(t,{context:{component:"GroupAdmin",action:"removeMember",groupId:r.id,memberId:e}})}})(e.id),className:"text-red-600 hover:text-red-900",children:"Remove"})]})]},e.id)),0===T.length&&(0,nn.jsx)("tr",{children:(0,nn.jsx)("td",{colSpan:"4",className:"px-6 py-8 text-center text-sm text-gray-500",children:"No members to display yet."})})]})]})})]}),"content"===o&&(0,nn.jsxs)("div",{children:[(0,nn.jsxs)("div",{className:"mb-6 flex flex-col md:flex-row space-y-4 md:space-y-0 md:space-x-4",children:[(0,nn.jsx)("input",{type:"text",placeholder:"Search content...",value:c,onChange:e=>d(e.target.value),className:"w-full md:w-2/3 px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue"}),(0,nn.jsxs)("select",{value:u,onChange:e=>m(e.target.value),className:"w-full md:w-1/3 px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue",children:[(0,nn.jsx)("option",{value:"all",children:"All Content"}),(0,nn.jsx)("option",{value:"discussions",children:"Discussions"}),(0,nn.jsx)("option",{value:"comment",children:"Comments"}),(0,nn.jsx)("option",{value:"flagged",children:"Flagged Content"})]})]}),x?(0,nn.jsxs)("div",{className:"text-center py-8",children:[(0,nn.jsx)("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-apn-blue mx-auto"}),(0,nn.jsx)("p",{className:"text-gray-500 mt-2",children:"Loading group content..."})]}):(0,nn.jsxs)("div",{className:"space-y-4",children:[P.map(e=>{var t;return(0,nn.jsx)("div",{className:"p-4 border rounded-lg ".concat(e.flagged?"border-red-300 bg-red-50":"border-gray-200"),children:(0,nn.jsxs)("div",{className:"flex justify-between",children:[(0,nn.jsxs)("div",{className:"flex-grow",children:[(0,nn.jsxs)("div",{className:"flex items-center mb-2",children:[(0,nn.jsx)("span",{className:"inline-block bg-gray-100 text-gray-800 text-xs px-2 py-1 rounded mr-2",children:"discussion"===e.type?"Discussion":"Comment"}),(0,nn.jsxs)("span",{className:"text-gray-500 text-sm",children:["by ",e.author]}),(0,nn.jsx)("span",{className:"mx-2 text-gray-400",children:"\u2022"}),(0,nn.jsx)("span",{className:"text-gray-500 text-sm",children:null!==(t=e.createdAt)&&void 0!==t&&t.toDate?e.createdAt.toDate().toLocaleString():new Date(e.createdAt).toLocaleString()})]}),"discussion"===e.type&&(0,nn.jsx)("h3",{className:"text-lg font-semibold mb-2",children:e.title}),"comment"===e.type&&(0,nn.jsxs)("div",{className:"text-sm text-gray-500 mb-2",children:["On: ",e.parentTitle]}),(0,nn.jsx)("p",{className:"text-gray-700",children:e.content})]}),(0,nn.jsxs)("div",{className:"flex flex-col space-y-2 ml-4",children:[(0,nn.jsx)("button",{onClick:()=>(e.id,void(0,Rr.Fq)("Flagging system coming soon. Use delete for now to remove inappropriate content.")),className:"text-sm px-3 py-1 rounded ".concat(e.flagged?"bg-red-100 text-red-700 hover:bg-red-200":"bg-gray-100 text-gray-700 hover:bg-gray-200"),title:"Flag/Unflag content for review",children:e.flagged?"Unflag":"Flag"}),(0,nn.jsx)("button",{onClick:()=>(async e=>{const t=e.title||e.content.substring(0,50)+"...";if(window.confirm('Are you sure you want to delete "'.concat(t,'"? This action cannot be undone.')))try{"post"===e.originalType?(await(0,wn.xX)(e.originalId),p(t=>t.filter(t=>t.id!==e.originalId)),f(t=>t.filter(t=>t.parentPostId!==e.originalId))):"comment"===e.originalType&&(await(0,wn.IW)(e.originalId,e.parentPostId),f(t=>t.filter(t=>t.id!==e.originalId))),(0,Rr.oc)("Content deleted successfully.")}catch(n){(0,Rr.H4)(n,{context:{component:"GroupAdmin",action:"deleteContent",groupId:r.id,contentId:e.originalId,contentType:e.originalType}})}})(e),className:"text-sm px-3 py-1 rounded bg-red-600 text-white hover:bg-red-700",title:"Permanently delete this content",children:"Delete"})]})]})},e.id)}),0===P.length&&!x&&(0,nn.jsx)("div",{className:"text-center py-8",children:(0,nn.jsx)("p",{className:"text-gray-500",children:0===C.length?"No content found in this group.":"No content found matching your criteria."})})]})]}),"settings"===o&&(0,nn.jsx)("div",{children:(0,nn.jsxs)("div",{className:"space-y-6",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"Group Information"}),(0,nn.jsxs)("div",{className:"space-y-4",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"group-name",className:"block text-sm font-medium text-gray-700",children:"Group Name"}),(0,nn.jsx)("input",{type:"text",id:"group-name",value:k.name,onChange:e=>A((0,s.A)((0,s.A)({},k),{},{name:e.target.value})),className:"mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-apn-blue focus:border-apn-blue sm:text-sm"})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"group-description",className:"block text-sm font-medium text-gray-700",children:"Description"}),(0,nn.jsx)("textarea",{id:"group-description",rows:"3",value:k.description,onChange:e=>A((0,s.A)((0,s.A)({},k),{},{description:e.target.value})),className:"mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-apn-blue focus:border-apn-blue sm:text-sm"})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"group-category",className:"block text-sm font-medium text-gray-700",children:"Category"}),(0,nn.jsxs)("select",{id:"group-category",value:k.category,onChange:e=>A((0,s.A)((0,s.A)({},k),{},{category:e.target.value})),className:"mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-apn-blue focus:border-apn-blue sm:text-sm",children:[(0,nn.jsx)("option",{value:"Industry",children:"Industry"}),(0,nn.jsx)("option",{value:"Topic",children:"Topic"}),(0,nn.jsx)("option",{value:"Location",children:"Location"}),(0,nn.jsx)("option",{value:"Interest",children:"Interest"})]})]})]})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"Privacy Settings"}),(0,nn.jsxs)("div",{className:"space-y-4",children:[(0,nn.jsxs)("div",{className:"flex items-center",children:[(0,nn.jsx)("input",{id:"private-group",name:"privacy",type:"radio",defaultChecked:!0,className:"h-4 w-4 text-apn-blue focus:ring-apn-blue border-gray-300"}),(0,nn.jsx)("label",{htmlFor:"private-group",className:"ml-3 block text-sm font-medium text-gray-700",children:"Private - Only members can see content"})]}),(0,nn.jsxs)("div",{className:"flex items-center",children:[(0,nn.jsx)("input",{id:"public-group",name:"privacy",type:"radio",className:"h-4 w-4 text-apn-blue focus:ring-apn-blue border-gray-300"}),(0,nn.jsx)("label",{htmlFor:"public-group",className:"ml-3 block text-sm font-medium text-gray-700",children:"Public - Anyone can see content, but only members can post"})]})]})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"Moderation Settings"}),(0,nn.jsxs)("div",{className:"space-y-4",children:[(0,nn.jsxs)("div",{className:"flex items-center",children:[(0,nn.jsx)("input",{id:"auto-approve",type:"checkbox",defaultChecked:!0,className:"h-4 w-4 text-apn-blue focus:ring-apn-blue border-gray-300 rounded"}),(0,nn.jsx)("label",{htmlFor:"auto-approve",className:"ml-3 block text-sm font-medium text-gray-700",children:"Auto-approve new member posts"})]}),(0,nn.jsxs)("div",{className:"flex items-center",children:[(0,nn.jsx)("input",{id:"notify-admins",type:"checkbox",defaultChecked:!0,className:"h-4 w-4 text-apn-blue focus:ring-apn-blue border-gray-300 rounded"}),(0,nn.jsx)("label",{htmlFor:"notify-admins",className:"ml-3 block text-sm font-medium text-gray-700",children:"Notify admins of new posts"})]}),(0,nn.jsxs)("div",{className:"flex items-center",children:[(0,nn.jsx)("input",{id:"allow-comments",type:"checkbox",defaultChecked:!0,className:"h-4 w-4 text-apn-blue focus:ring-apn-blue border-gray-300 rounded"}),(0,nn.jsx)("label",{htmlFor:"allow-comments",className:"ml-3 block text-sm font-medium text-gray-700",children:"Allow comments on discu
2ssions"})]})]})]}),(0,nn.jsxs)("div",{className:"flex justify-end space-x-3",children:[(0,nn.jsx)("button",{type:"button",className:"px-4 py-2 border border-gray-300 rounded-md shadow-sm text-sm font-medium text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-apn-blue",children:"Cancel"}),(0,nn.jsx)("button",{type:"button",onClick:async()=>{try{E(!0),await(0,wn.vW)(r.id,{name:k.name,description:k.description,category:k.category}),(0,Rr.oc)("Group settings saved.")}catch(e){(0,Rr.H4)(e,{context:{component:"GroupAdmin",action:"saveSettings",groupId:r.id}})}finally{E(!1)}},disabled:S,className:"px-4 py-2 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-apn-blue hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-apn-blue disabled:opacity-50",children:S?"Saving...":"Save Changes"})]})]})})]})},zc=t=>{let{post:n,isLoggedIn:r,isAdmin:a,isMember:i}=t;const{currentUser:o,userProfile:l}=sn(),[c,d]=(0,e.useState)(""),[u,m]=(0,e.useState)([]),[h,p]=(0,e.useState)(!0),[g,f]=(0,e.useState)(!1),[x,b]=(0,e.useState)(!1),[y,v]=(0,e.useState)((null===n||void 0===n?void 0:n.likeCount)||0),[w,j]=(0,e.useState)(null),[N,k]=(0,e.useState)(""),[A,S]=(0,e.useState)(!1),[E,C]=(0,e.useState)(null),[T,P]=(0,e.useState)(null),_=[{emoji:"\ud83d\udc4d",name:"like",label:"Like"},{emoji:"\u2764\ufe0f",name:"love",label:"Love"},{emoji:"\ud83d\ude02",name:"laugh",label:"Laugh"},{emoji:"\ud83d\ude2e",name:"wow",label:"Wow"},{emoji:"\ud83d\ude22",name:"sad",label:"Sad"},{emoji:"\ud83d\ude21",name:"angry",label:"Angry"}];(0,e.useEffect)(()=>{var e;null!==n&&void 0!==n&&n.id&&(D(),b((null===n||void 0===n||null===(e=n.likes)||void 0===e?void 0:e.includes(null===o||void 0===o?void 0:o.uid))||!1),v((null===n||void 0===n?void 0:n.likeCount)||0))},[null===n||void 0===n?void 0:n.id,null===n||void 0===n?void 0:n.likes,null===n||void 0===n?void 0:n.likeCount,null===o||void 0===o?void 0:o.uid]);const I=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return e.filter(e=>null===t?null===e.parentCommentId||void 0===e.parentCommentId:e.parentCommentId===t).map(t=>(0,s.A)((0,s.A)({},t),{},{replies:I(e,t.id)}))},D=async()=>{try{p(!0),console.log("\ud83d\udd04 Loading comments for post:",n.id);const e=await(0,wn.yL)(n.id);console.log("\ud83d\udce5 Raw comments data received:",e),console.log("\ud83d\udcca Number of comments found:",e.length),e.length>0&&console.log("\ud83d\udcdd First comment sample:",e[0]);const t=I(e,null);console.log("\ud83c\udf33 Nested comments built:",t),console.log("\ud83c\udf33 Number of top-level comments:",t.length),m(t)}catch(e){console.error("\u274c Error loading comments:",e)}finally{p(!1)}},R=()=>{const e=setTimeout(()=>{C(null)},300);P(e)},L=e=>{if(!e)return"Unknown";const t=e.toDate?e.toDate():new Date(e),n=(new Date-t)/36e5;return n<1?"Just now":n<24?"".concat(Math.floor(n),"h ago"):t.toLocaleDateString()},M=function(e){var t,c;let d=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const u=["","ml-8","ml-16","ml-24","ml-32","ml-40","ml-48"][Math.min(d,6)];return(0,nn.jsx)("div",{className:"".concat(u," ").concat(d>0?"mt-4":""),children:(0,nn.jsxs)("div",{className:"flex",children:[(0,nn.jsx)("div",{className:"flex-shrink-0 mr-3",children:(0,nn.jsx)("div",{className:"".concat(d>0?"h-8 w-8":"h-10 w-10"," rounded-full bg-gray-400 text-white flex items-center justify-center text-sm"),children:e.authorName?e.authorName.charAt(0).toUpperCase():"U"})}),(0,nn.jsxs)("div",{className:"flex-grow",children:[(0,nn.jsxs)("div",{className:"".concat(d>0?"bg-gray-50":"bg-white"," rounded-lg p-3 ").concat(0===d?"border border-gray-200":""),children:[(0,nn.jsxs)("div",{className:"flex items-center mb-2",children:[(0,nn.jsx)("span",{className:"font-semibold text-gray-900 ".concat(d>0?"text-sm":""),children:e.authorName}),e.authorTitle&&e.authorCompany&&(0,nn.jsxs)(nn.Fragment,{children:[(0,nn.jsx)("span",{className:"mx-1 text-gray-500",children:"\u2022"}),(0,nn.jsxs)("span",{className:"text-gray-500 ".concat(d>0?"text-xs":"text-sm"),children:[e.authorTitle," at ",e.authorCompany]})]})]}),(0,nn.jsx)("p",{className:"text-gray-700 ".concat(d>0?"text-sm":""),children:e.content})]}),(0,nn.jsxs)("div",{className:"mt-2 flex items-center ".concat(d>0?"text-xs":"text-sm"," text-gray-500"),children:[(0,nn.jsx)("span",{className:"mr-4",children:L(e.createdAt)}),(0,nn.jsxs)("button",{className:"mr-4 flex items-center transition duration-200 ".concat(null!==(t=e.likes)&&void 0!==t&&t.includes(null===o||void 0===o?void 0:o.uid)?"text-blue-600":"text-gray-500 hover:text-apn-blue"," ").concat(r&&i?"":"opacity-50 cursor-not-allowed"),onClick:()=>(async e=>{if(o&&i)try{await(0,wn.NK)(e,o.uid),await D()}catch(t){(0,Rr.H4)(t,{context:{component:"GroupComments",action:"toggleCommentLike",commentId:e}})}else(0,Rr.Fq)("You must be a group member to like comments.")})(e.id),disabled:!r||!i,children:[(0,nn.jsx)("svg",{className:"".concat(d>0?"h-3 w-3":"h-4 w-4"," mr-1"),fill:null!==(c=e.likes)&&void 0!==c&&c.includes(null===o||void 0===o?void 0:o.uid)?"currentColor":"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M14 10h4.764a2 2 0 011.789 2.894l-3.5 7A2 2 0 0115.263 21h-4.017c-.
2163 0-.326-.02-.485-.60L7 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"})}),(0,nn.jsx)("span",{children:e.likeCount||0})]}),i&&d<10&&(0,nn.jsx)("button",{className:"mr-4 text-gray-500 hover:text-apn-blue transition duration-200",onClick:()=>{j(w===e.id?null:e.id),k("")},children:w===e.id?"Cancel":"Reply"}),i&&(0,nn.jsxs)("div",{className:"relative inline-block",onMouseEnter:()=>{return t=e.id,T&&clearTimeout(T),void C(t);var t},onMouseLeave:R,children:[(0,nn.jsx)("button",{className:"text-gray-500 hover:text-apn-blue transition duration-200",children:"React"}),E===e.id&&(0,nn.jsx)("div",{className:"absolute bottom-full left-0 mb-2 bg-white border border-gray-200 rounded-lg shadow-lg p-2 flex space-x-1 z-10",children:_.map(t=>(0,nn.jsx)("button",{onClick:()=>(async(e,t)=>{if(o&&i)try{C(null),await(0,wn.V1)(e,o.uid,t),await D()}catch(n){(0,Rr.H4)(n,{context:{component:"GroupComments",action:"setCommentReaction",commentId:e}})}else(0,Rr.Fq)("You must be a group member to react.")})(e.id,t.name),className:"p-2 hover:bg-gray-100 rounded transition duration-200",title:t.label,children:(0,nn.jsx)("span",{className:"text-lg",children:t.emoji})},t.name))})]}),e.reactions&&Object.keys(e.reactions).length>0&&(0,nn.jsx)("span",{className:"mr-4 flex items-center space-x-2",children:_.map(t=>(0,s.A)((0,s.A)({},t),{},{count:Object.values(e.reactions).filter(e=>e===t.name).length})).filter(e=>e.count>0).map(e=>(0,nn.jsxs)("span",{className:"text-sm",title:e.label,children:[e.emoji," ",e.count]},e.name))}),a&&(0,nn.jsx)("button",{className:"text-red-500 hover:text-red-700",onClick:()=>(async e=>{if(a){if(window.confirm("Are you sure you want to delete this comment? This action cannot be undone."))try{await(0,wn.IW)(e,n.id),await D(),(0,Rr.oc)("Comment deleted successfully.")}catch(t){(0,Rr.H4)(t,{context:{component:"GroupComments",action:"deleteComment",commentId:e}})}}else(0,Rr.Fq)("You do not have permission to delete comments.")})(e.id),children:"Delete"})]}),w===e.id&&(0,nn.jsx)("div",{className:"mt-4",children:(0,nn.jsxs)("form",{onSubmit:t=>(async(e,t)=>{if(e.preventDefault(),N.trim())if(o&&i){S(!0);try{const e={postId:n.id,parentCommentId:t,content:N.trim(),authorId:o.uid,authorName:null!==l&&void 0!==l&&l.firstName&&null!==l&&void 0!==l&&l.lastName?"".concat(l.firstName," ").concat(l.lastName):o.displayName||o.email||"Anonymous User",authorEmail:o.email,authorTitle:(null===l||void 0===l?void 0:l.jobTitle)||"",authorCompany:(null===l||void 0===l?void 0:l.company)||"",likes:[],likeCount:0,isReply:!0};await(0,wn.hS)(n.id,e),k(""),j(null),await D()}catch(r){console.error("Error adding reply:",r),alert("Error adding reply: ".concat(r.message,". Please try again."))}finally{S(!1)}}else alert("You must be a member to reply.");else alert("Please enter a reply.")})(t,e.id),className:"flex",children:[(0,nn.jsx)("div",{className:"flex-shrink-0 mr-3",children:(0,nn.jsx)("div",{className:"h-8 w-8 rounded-full bg-apn-blue text-white flex items-center justify-center text-sm",children:null!==l&&void 0!==l&&l.firstName?l.firstName.charAt(0).toUpperCase():"U"})}),(0,nn.jsxs)("div",{className:"flex-grow",children:[(0,nn.jsx)("textarea",{value:N,onChange:e=>k(e.target.value),placeholder:"Reply to ".concat(e.authorName,"..."),className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue resize-none",rows:"2",disabled:A}),(0,nn.jsxs)("div",{className:"mt-2 flex justify-end space-x-2",children:[(0,nn.jsx)("button",{type:"button",onClick:()=>{j(null),k("")},className:"px-3 py-1 text-sm text-gray-600 hover:text-gray-800",disabled:A,children:"Cancel"}),(0,nn.jsx)("button",{type:"submit",className:"px-4 py-1 bg-apn-blue text-white text-sm rounded hover:bg-blue-700 transition duration-200 disabled:opacity-50",disabled:A||!N.trim(),children:A?"Posting...":"Reply"})]})]})]})}),e.replies&&e.replies.length>0&&(0,nn.jsx)("div",{className:"mt-4",children:e.replies.map(e=>M(e,d+1))})]})]})},e.id)};return(0,nn.jsxs)("div",{className:"border border-gray-200 rounded-lg overflow-hidden",children:[(0,nn.jsx)("div",{className:"bg-gray-50 px-4 py-3 border-b border-gray-200",children:(0,nn.jsx)("div",{className:"flex items-center justify-between",children:(0,nn.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,nn.jsxs)("button",{className:"flex items-center transition duration-200 ".concat(x?"text-blue-600":"text-gray-500 hover:text-apn-blue"," ").concat(r&&i?"":"opacity-50 cursor-not-allowed"),onClick:async()=>
2{if(o&&i)try{await(0,wn.fd)(n.id,o.uid),x?(b(!1),v(e=>Math.max(0,e-1))):(b(!0),v(e=>e+1))}catch(e){(0,Rr.H4)(e,{context:{component:"GroupComments",action:"togglePostLike",postId:n.id}})}else(0,Rr.Fq)("You must be a group member to like posts.")},disabled:!r||!i,children:[(0,nn.jsx)("svg",{className:"h-5 w-5 mr-1",fill:x?"currentColor":"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",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-.60L7 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"})}),(0,nn.jsx)("span",{children:y})]}),(0,nn.jsxs)("span",{className:"text-gray-500",children:[u.length," ",1===u.length?"comment":"comments"]})]})})}),(0,nn.jsxs)("div",{className:"p-4",children:[h?(0,nn.jsxs)("div",{className:"text-center py-8",children:[(0,nn.jsx)("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-apn-blue mx-auto"}),(0,nn.jsx)("p",{className:"text-gray-500 mt-2",children:"Loading comments..."})]}):0===u.length?(0,nn.jsx)("div",{className:"text-center py-8",children:(0,nn.jsx)("p",{className:"text-gray-500",children:"Be the first to comment on this discussion!"})}):(0,nn.jsx)("div",{className:"space-y-6",children:u.map(e=>M(e))}),i?(0,nn.jsx)("div",{className:"mt-6",children:(0,nn.jsxs)("form",{onSubmit:async e=>{if(e.preventDefault(),c.trim())if(o)if(i)if(null!==n&&void 0!==n&&n.id){f(!0);try{const e={postId:n.id,content:c.trim(),authorId:o.uid,authorName:null!==l&&void 0!==l&&l.firstName&&null!==l&&void 0!==l&&l.lastName?"".concat(l.firstName," ").concat(l.lastName):o.displayName||o.email||"Anonymous User",authorEmail:o.email,authorTitle:(null===l||void 0===l?void 0:l.jobTitle)||"",authorCompany:(null===l||void 0===l?void 0:l.company)||"",parentCommentId:null,likes:[],likeCount:0};await(0,wn.hS)(n.id,e);d(""),await D(),(0,Rr.oc)("Comment added successfully!")}catch(t){(0,Rr.H4)(t,{context:{component:"GroupComments",action:"submitComment",postId:n.id}})}finally{f(!1)}}else(0,Rr.H4)(new Error("Post ID not found"),{context:{component:"GroupComments",action:"submitComment"}});else(0,Rr.Fq)("You must be a group member to comment.");else(0,Rr.Fq)("You must be logged in to comment.");else(0,Rr.Fq)("Please enter a comment.")},className:"flex",children:[(0,nn.jsx)("div",{className:"flex-shrink-0 mr-3",children:(0,nn.jsx)("div",{className:"h-10 w-10 rounded-full bg-apn-blue text-white flex items-center justify-center",children:null!==l&&void 0!==l&&l.firstName?l.firstName.charAt(0).toUpperCase():null!==o&&void 0!==o&&o.displayName?o.displayName.charAt(0).toUpperCase():"U"})}),(0,nn.jsxs)("div",{className:"flex-grow",children:[(0,nn.jsx)("textarea",{value:c,onChange:e=>d(e.target.value),placeholder:"Add a comment...",className:"w-full px-4 py-3 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-apn-blue resize-none",rows:"3",disabled:g}),(0,nn.jsx)("div",{className:"mt-3 flex justify-end",children:(0,nn.jsx)("button",{type:"submit",className:"px-6 py-2 bg-apn-blue text-white rounded-lg hover:bg-blue-700 transition duration-200 disabled:opacity-50",disabled:g||!c.trim(),children:g?"Posting...":"Post Comment"})})]})]})}):(0,nn.jsx)("div",{className:"mt-6 text-center py-4 bg-gray-50 rounded-lg",children:(0,nn.jsx)("p",{className:"text-gray-500",children:r?"You must be a member of this group to comment.":"Please log in to comment."})})]})]})},Vc={"seed-group-1":[{id:"seed-post-1a",isSeed:!0,authorName:"John Smith",title:"Deal flow picking up in Q3?",content:"Seeing a real uptick in mid-market tech mandates this quarter. Anyone else watching sponsors come back to the table after a quiet first half?",createdAt:"2026-06-18T14:00:00Z",likeCount:14,likes:[],commentCount:2,seedComments:[{authorName:"Sarah Johnson",content:"Yes \u2014 our PE coverage team is busier than
2it\u2019s been in a year. Mostly add-ons though, not new platforms."},{authorName:"Michael Chen",content:"Same on the corp-dev side. Valuations finally feel reasonable again."}]},{id:"seed-post-1b",isSeed:!0,authorName:"Jessica Lee",title:"Standardizing our LBO template \u2014 recommendations?",content:"Onboarding a few analysts and want one clean LBO template for the team. What references does the group swear by?",createdAt:"2026-06-20T16:30:00Z",likeCount:9,likes:[],commentCount:1,seedComments:[{authorName:"David Kim",content:"A clean internal template beats anything off the shelf \u2014 but Wall Street Prep is a solid starting point."}]}],"seed-group-2":[{id:"seed-post-2a",isSeed:!0,authorName:"Sarah Johnson",title:"How is everyone thinking about exit timing?",content:"Given the rate environment, are you extending holds where the thesis has runway, or pushing to exit into strength?",createdAt:"2026-06-19T13:00:00Z",likeCount:11,likes:[],commentCount:1,seedComments:[{authorName:"Robert Wilson",content:"Extending where there\u2019s still a value-creation lever to pull. Forcing an exit into a soft market rarely ends well."}]}],"seed-group-3":[{id:"seed-post-3a",isSeed:!0,authorName:"David Kim",title:"Reps & warranties insurance on sub-$50M deals?",content:"Increasingly seeing RWI on smaller transactions. At what enterprise value does it stop making sense for you?",createdAt:"2026-06-21T11:00:00Z",likeCount:7,likes:[],commentCount:2,seedComments:[{authorName:"Emily Rodriguez",content:"We\u2019ve placed it as low as ~$25M EV when the buyer insists \u2014 premiums have come down a lot."},{authorName:"Michael Chen",content:"Agreed, it\u2019s almost standard now even on lower-middle-market deals."}]}]},qc=()=>{const{id:t}=le(),{currentUser:n,hasRole:r}=sn(),[a,i]=(0,e.useState)(null),[o,l]=(0,e.useState)([]),[c,d]=(0,e.useState)(!0),[u,m]=(0,e.useState)(!1),[h,p]=(0,e.useState)(!1),[g,f]=(0,e.useState)(!1),[x,b]=(0,e.useState)({title:"",content:""}),[y,v]=(0,e.useState)(!1),w=!!n;(0,e.useEffect)(()=>{console.log("GroupDetail component mounted for group ID:",t),j(),window.scrollTo({top:0,behavior:"smooth"})},[t,n]);const j=async()=>{try{if(d(!0),"string"===typeof t&&t.startsWith("seed-group-")){const e=Lc.find(e=>e.id===t);return e?(i((0,s.A)((0,s.A)({},e),{},{members:[],memberCount:e.members,isSeed:!0})),l(Vc[t]||[]),m(r("admin")),p(!1),void d(!1)):(i(null),void d(!1))}const o=await(0,wn.getGroupById)(t);if(console.log("Group data loaded:",o),!o)return console.log("No group data found for ID:",t),i(null),void d(!1);i(o);const c=await(0,wn.PJ)(t);if(l(c),n){var e,a;const t=r("admin")||(null===(e=o.moderators)||void 0===e?void 0:e.includes(n.uid)),s=null===(a=o.members)||void 0===a?void 0:a.includes(n.uid);console.log("\ud83d\udd0d User permissions check:",{userId:n.uid,email:n.email,hasAdminRole:r("admin"),groupModerators:o.moderators,groupMembers:o.members,userIsAdmin:t,userIsMember:s,groupId:o.id}),m(t),p(s),console.log("\ud83c\udfaf Final state set:",{isAdmin:t,isMember:s})}else console.log("\u274c No current user found"),m(!1),p(!1)}catch(o){console.error("Error loading group data:",o),i(null)}finally{d(!1)}},N=async()=>{if(n&&a)if(a.isSeed)(0,Rr.Fq)("This is a demo group. You can join real groups as they\u2019re created.");else try{console.log("\ud83d\udd04 Joining group:",a.id,"for user:",n.uid),await(0,wn.U7)(a.id,n.uid),p(!0),i(e=>(0,s.A)((0,s.A)({},e),{},{members:[...e.members||[],n.uid],memberCount:(e.memberCount||0)+1})),await j(),(0,Rr.oc)("Successfully joined the group!")}catch(e){console.error("Error joining group:",e),p(!1),i(e=>(0,s.A)((0,s.A)({},e),{},{members:(e.members||[]).filter(e=>e!==n.uid),memberCount:Math.max(0,(e.memberCount||0)-1)})),(0,Rr.H4)(e,{context:{component:"GroupDetail",action:"joinGroup",groupId:a.id}})}},k=async()=>{if(n&&a&&window.confirm("Are you sure you want to leave this group?"))try{console.log("\ud83d\udd04 Leaving group:",a.id,"for user:",n.uid),p(!1),i(e=>(0,s.A)((0,s.A)({},e),{},{members:(e.members||[]).filter(e=>e!==n.uid),memberCount:Math.max(0,(e.memberCount||0)-1)})),await(0,wn.j)(a.id,n.uid),await j(),(0,Rr.oc)("Successfully left the group.")}catch(e){console.error("Error leaving group:",e),p(!0),i(e=>(0,s.A)((0,s.A)({},e),{},{members:[...e.members||[],n.uid],memberCount:(e.memberCount||0)+1})),(0,Rr.H4)(e,{context:{component:"GroupDetail",action:"leaveGroup",groupId:a.id}})}},A=()=>{b({title:"",content:""}),f(!1)};if(c)return(0,nn.jsx)("div",{className:"flex justify-center items-center min-h-screen",children:(0,nn.jsx)("div",{className:"animate-spin rounded-full h-12 w-12 border-t-2 border-b-2 border-apn-blue"})});if(!a)return(0,nn.jsx)("div",{className:"max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:(0,nn.jsxs)("div",{className:"text-center",children:[(0,nn.jsx)("h2",{className:"text-2xl font-bold text-gray-900",children:"Group Not Found"}),(0,nn.jsx)("p",{className:"text-gray-600 mt-2",children:"The group you're looking for doesn't exist."}),(0,nn.jsx)(dt,{to:"/groups",className:"text-apn-blue hover:text-blue-700 mt-4 inline-block",children:"\u2190 Back to Groups"})]})});const S=e=>{if(!e)return"Unknown";return(e.toDate?e.toDate():new Date(e)).toLocaleDateString()};return c?(0,nn.jsx)("div",{className:"flex justify-center items-center min-h-screen",children:(0,nn.jsx)("div",{className:"animate-spin rounded-full h-12 w-12 border-t-2 border-b-2 border-apn-blue"})}):a?(0,nn.jsxs)("div",{className:"bg-white",children:[(0,nn.jsx)("div",{className:"bg-apn-blue text-white py-12",children:(0,nn.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:(0,nn.jsxs)("div",{className:"text-center",children:[(0,nn.jsx)("div",{className:"flex justify-center mb-4",children:(0,nn.jsx)("img",{src:"".concat("","/apn-logos/APN-Tag-white.jpg"),alt:"APN Logo",className:"h-16"})}),(0,nn.jsx)("h1",{className:"text-3xl font-bold",children:a.name})]})})}),(0,nn.jsx)("section",{className:"py-12",children:(0,nn.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:(0,nn.jsxs)("div",{className:"bg-white rounded-lg shadow-lg overflow-hidden",children:[(0,nn.jsxs)("div",{className:"relative h-64 bg-white",children:[(0,nn.jsx)("div",{className:"h-full w-full overflow-hidden flex items-center justify-center bg-white",children:(0,nn.jsx)("img",{src:Fc(a.image),alt:a.name,className:"h-full w-full object-contain",onError:e=>{e.target.onerror=null,e.target.src="".concat("","/apn-logos/APN-blue (1).png")}})}),(0,nn.jsx)("div",{className:"absolute top-4 right-4 bg-gray-100 text-gray-700 px-3 py-1 rounded-md",children:a.category})]}),(0,nn.jsxs)("div",{className:"p-6",children:[(0,nn.jsxs)("div",{className:"flex flex-col md:flex-row justify-between mb-8",children:[(0,nn.jsxs)("div",{className:"mb-4 md:mb-0",children:[(0,nn.jsx)("h2",{className:"text-2xl font-bold text-gray-900 mb-2",children:a.name}),(0,nn.jsx)("p",{className:"text-gray-600 mb-4",children:a.description}),(0,nn.jsxs)("div",{className:"flex space-x-4 text-sm text-gray-500",children:[(0,nn.jsxs)("span",{children:[a.memberCount||0," members"]}),(0,nn.jsxs)("span",{children:[o.length," posts"]}),(0,nn.jsxs)("span",{children:["Created ",S(a.createdAt)]})]})]}),(0,nn.jsxs)("div",{className:"flex flex-col space-y-2",children:[u&&(0,nn.jsx)(dt,{to:"/groups/".concat(a.id,"/admin"),className:"bg-gray-800 text-white py-2 px-6 rounded hover:bg-gray-700 transition duration-200",children:"Admin Controls"}),h?(0,nn.jsx)("button",{onClick:k,className:"bg-red-600 text-white py-2 px-6 rounded hover:bg-red-700 transition duration-200",children:"Leave Group"}):(0,nn.jsx)("button",{onClick:N,className:"bg-apn-blue text-white py-2 px-6 rounded hover:bg-blue-700 transition duration-200",children:"Join Group"})]})]}),u&&(0,nn.jsxs)("div",{className:"mb-8 p-6 bg-gray-50 rounded-lg",children:[(0,nn.jsx)("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Admin Controls"}),(0,nn.jsx)(Bc,{group:a})]}),(0,nn.jsxs)("div",{className:"mb-8",children:[(0,nn.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("h3",{className:"text-lg font-semibold text-gray-900",children:"Discussions"}),h&&!u&&(0,nn.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:"Group managers start discussions. Members can react and reply to existing discussions."})]}),(0,nn.jsx)("button",{onClick:()=>{u?(f(!0),window.scrollTo({top:0,behavior:"smooth"})):alert("Only group managers can start new discussions. Members can react and reply to existing discussions.")}
2,className:"py-1 px-4 rounded transition duration-200 ".concat(u?"bg-apn-blue text-white hover:bg-blue-700":"bg-gray-300 text-gray-500 cursor-not-allowed"),disabled:!u,title:u?"Start a new discussion":"Only group managers can start new discussions",children:"+ New Discussion"})]}),(0,nn.jsx)("div",{className:"space-y-6",children:0===o.length?(0,nn.jsx)("div",{className:"text-center py-8 text-gray-500",children:(0,nn.jsx)("p",{children:"No discussions yet. Be the first to start a conversation!"})}):o.map(e=>{var t,r,s,i;return(0,nn.jsxs)("div",{className:"border border-gray-200 rounded-lg overflow-hidden",children:[(0,nn.jsxs)("div",{className:"p-4 bg-gray-50",children:[(0,nn.jsxs)("div",{className:"flex items-center mb-2",children:[(0,nn.jsx)("div",{className:"h-10 w-10 rounded-full bg-apn-blue flex items-center justify-center text-white font-semibold mr-3",children:e.authorName?e.authorName.charAt(0).toUpperCase():"U"}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("h4",{className:"font-semibold text-gray-900",children:e.authorName||"Unknown User"}),(0,nn.jsx)("p",{className:"text-sm text-gray-500",children:"Group Member"})]})]}),(0,nn.jsx)("h3",{className:"text-xl font-bold mb-2",children:e.title}),(0,nn.jsx)("p",{className:"text-gray-700",children:e.content}),(0,nn.jsxs)("div",{className:"mt-4 flex items-center justify-between text-sm text-gray-500",children:[(0,nn.jsx)("span",{children:S(e.createdAt)}),(0,nn.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,nn.jsxs)("button",{className:"flex items-center transition duration-200 ".concat(null!==(t=e.likes)&&void 0!==t&&t.includes(null===n||void 0===n?void 0:n.uid)?"text-blue-600":"text-gray-500 hover:text-apn-blue"," ").concat(w&&h?"":"opacity-50 cursor-not-allowed"),onClick:()=>(async e=>{if(n&&h)try{await(0,wn.fd)(e,n.uid);const t=await(0,wn.PJ)(a.id);l(t)}catch(t){(0,Rr.H4)(t,{context:{component:"GroupDetail",action:"togglePostLike",postId:e,groupId:a.id}})}else(0,Rr.Fq)("You must be a group member to like posts.")})(e.id),disabled:!w||!h,children:[(0,nn.jsx)("svg",{className:"h-5 w-5 mr-1",fill:null!==(r=e.likes)&&void 0!==r&&r.includes(null===n||void 0===n?void 0:n.uid)?"currentColor":"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",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-.60L7 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"})}),(0,nn.jsx)("span",{children:e.likeCount||(null===(s=e.likes)||void 0===s?void 0:s.length)||0})]}),(0,nn.jsxs)("button",{className:"flex items-center hover:text-apn-blue",children:[(0,nn.jsx)("svg",{className:"h-5 w-5 mr-1",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M8 10h.01M12 10h.01M16 10h.01M9 16H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-5l-5 5v-5z"})}),(0,nn.jsx)("span",{children:e.commentCount||(null===(i=e.replies)||void 0===i?void 0:i.length)||0})]}),u&&(0,nn.jsx)("button",{className:"text-red-500 hover:text-red-700",onClick:()=>(async e=>{if(u){if(window.confirm("Are you sure you want to delete this post? This action cannot be undone."))try{await(0,wn.xX)(e);const t=await(0,wn.PJ)(a.id);l(t),(0,Rr.oc)("Post deleted successfully.")}catch(t){(0,Rr.H4)(t,{context:{component:"GroupDetail",action:"deletePost",postId:e,groupId:a.id}})}}else(0,Rr.Fq)("You do not have permission to delete posts.")})(e.id),children:"Delete"})]})]})]}),e.isSeed?(0,nn.jsx)("div",{className:"border-t border-gray-100 px-4 py-3 space-y-3",children:(e.seedComments||[]).map((e,t)=>(0,nn.jsxs)("div",{className:"flex items-start",children:[(0,nn.jsx)("div",{className:"h-8 w-8 rounded-full bg-apn-blue text-white flex items-center justify-center text-xs mr-3 flex-shrink-0",children:e.authorName?e.authorName.charAt(0):"U"}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("span",{className:"text-sm font-medium text-gray-900",children:e.authorName}),(0,nn.jsx)("p",{className:"text-sm text-gray-700",children:e.content})]})]},t))}):(0,nn.jsx)(zc,{post:e,isLoggedIn:w,isAdmin:u,isMember:h})]},e.id)})})]}),(0,nn.jsxs)("div",{className:"mb-8",children:[(0,nn.jsx)("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Members"}),(0,nn.jsxs)("div",{className:"text-gray-600",children:[(0,nn.jsxs)("p",{children:["This group has ",a.memberCount||0," members."]}),h?(0,nn.jsx)("button",{onClick:k,className:"mt-2 bg-red-600 text-white py-2 px-4 roun
2ded hover:bg-red-700 transition duration-200",children:"Leave Group"}):(0,nn.jsx)("button",{onClick:N,className:"mt-2 bg-apn-blue text-white py-2 px-4 rounded hover:bg-blue-700 transition duration-200",children:"Join Group"})]})]})]})]})})}),(0,nn.jsx)("section",{className:"bg-apn-blue text-white py-12",children:(0,nn.jsxs)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 text-center",children:[(0,nn.jsx)("div",{className:"flex justify-center mb-6",children:(0,nn.jsx)("img",{src:"".concat("","/apn-logos/APN-Tag-SQ-white.jpg"),alt:"APN Logo Square",className:"h-20"})}),(0,nn.jsx)("h2",{className:"text-3xl font-bold mb-4",children:"Start Your Own Group"}),(0,nn.jsx)("p",{className:"text-xl mb-8 max-w-3xl mx-auto",children:"Have a topic you're passionate about? Create a group and connect with like-minded professionals."}),(0,nn.jsx)(dt,{to:"/groups/create",className:"btn-primary bg-white text-apn-blue hover:bg-gray-100",children:"Create a Group"})]})}),g&&(0,nn.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4",children:(0,nn.jsx)("div",{className:"bg-white rounded-lg shadow-xl max-w-2xl w-full max-h-full overflow-y-auto",children:(0,nn.jsxs)("div",{className:"p-6",children:[(0,nn.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,nn.jsx)("h3",{className:"text-xl font-bold text-gray-900",children:"Start New Discussion"}),(0,nn.jsx)("button",{onClick:A,className:"text-gray-400 hover:text-gray-600",children:(0,nn.jsx)("svg",{className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 18L18 6M6 6l12 12"})})})]}),(0,nn.jsxs)("form",{onSubmit:async e=>{if(e.preventDefault(),n&&x.title.trim()&&x.content.trim()){v(!0);try{const e={groupId:a.id,title:x.title.trim(),content:x.content.trim(),authorId:n.uid,authorName:n.displayName||n.email,type:"discussion",likes:[],replies:[]};await(0,wn._j)(e,n.uid);try{await(0,pn.P_)(a.id,x.title,n.displayName||n.email,n.uid)}catch(t){console.error("Error sending notifications:",t)}b({title:"",content:""}),f(!1);const r=await(0,wn.PJ)(a.id);l(r),alert("Discussion created successfully!")}catch(r){console.error("Error creating discussion:",r),alert("Error creating discussion. Please try again.")}finally{v(!1)}}else alert("Please fill in both title and content for your discussion.")},className:"space-y-4",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"discussionTitle",className:"block text-sm font-medium text-gray-700 mb-2",children:"Discussion Title *"}),(0,nn.jsx)("input",{type:"text",id:"discussionTitle",value:x.title,onChange:e=>b(t=>(0,s.A)((0,s.A)({},t),{},{title:e.target.value})),className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue focus:border-apn-blue",placeholder:"What would you like to discuss?",required:!0,maxLength:200}),(0,nn.jsxs)("p",{className:"text-sm text-gray-500 mt-1",children:[x.title.length,"/200 characters"]})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"discussionContent",className:"block text-sm font-medium text-gray-700 mb-2",children:"Discussion Content *"}),(0,nn.jsx)("textarea",{id:"discussionContent",value:x.content,onChange:e=>b(t=>(0,s.A)((0,s.A)({},t),{},{content:e.target.value})),rows:6,className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue focus:border-apn-blue",placeholder:"Share your thoughts, ask questions, or start a conversation...",required:!0,maxLength:2e3}),(0,nn.jsxs)("p",{className:"text-sm text-gray-500 mt-1",children:[x.content.length,"/2000 characters"]})]}),(0,nn.jsxs)("div",{className:"bg-gray-50 p-4 rounded-md",children:[(0,nn.jsx)("h4",{className:"text-sm font-medium text-gray-700 mb-2",children:"Discussion Guidelines:"}),(0,nn.jsxs)("ul",{className:"text-sm text-gray-600 space-y-1",children:[(0,nn.jsx)("li",{children:"\u2022 Keep discussions professional and respectful"}),(0,nn.jsx)("li",{children:"\u2022 Stay on topic and relevant to the group"}),(0,nn.jsx)("li",{children:"\u2022 No spam, self-promotion, or inappropriate content"}),(0,nn.jsx)("li",{children:"\u2022 Encourage constructive dialogue and networking"})]})]}),(0,nn.jsxs)("div",{className:"flex justify-end space-x-3 pt-4",children:[(0,nn.jsx)("button",{type:"button",onClick:A,className:"px-4 py-2 border border-gray-300 rounded-md text-gray-700 hover:bg-gray-50 transition duration-200",children:"Cancel"}),(0,nn.jsx)("button",{type:"submit",disabled:y||!x.title.trim()||!x.content.trim(),className:"px-6 py-2 bg-apn-blue text-white rounded-md hover:bg-blue-700 disabled:opacity-50 disabled:cursor-not-allowed transition duration-200",children:y?"Creating...":"Start Discussion"})]})]})]})})})]}):(0,nn.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12",children:(0,nn.jsxs)("div",{className:"text-center",children:[(0,nn.jsx)("h1",{className:"text-3xl font-bold text-gray-900 mb-4",children:"Group Not Found"}),(0,nn.jsx)("p",{className:"text-gray-600 mb-8",children:"The group you're looking for doesn't exist or has been removed."}),(0,nn.jsx)(dt,{to:"/groups",className:"inline-block bg-apn-blue text-white py-2 px-6 rounded hover:bg-blue-700 transition duration-200",children:"Back to Groups"})]})})},Wc={PROFILE_IMAGES:{path:"profileImages",maxSize:5242880,allowedTypes:["image/jpeg","image/png","image/gif","
2image/webp"],maxWidth:800,maxHeight:800},RESUMES:{path:"resumes",maxSize:10485760,allowedTypes:["application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document"]},PORTFOLIOS:{path:"portfolios",maxSize:52428800,allowedTypes:["application/pdf","image/jpeg","image/png"]},EVENT_IMAGES:{path:"eventImages",maxSize:10485760,allowedTypes:["image/jpeg","image/png","image/gif","image/webp"],maxWidth:1200,maxHeight:800},COMPANY_LOGOS:{path:"companyLogos",maxSize:2097152,allowedTypes:["image/jpeg","image/png","image/svg+xml"],maxWidth:400,maxHeight:400},DOCUMENTS:{path:"documents",maxSize:26214400,allowedTypes:["application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"]}},Hc=async function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";try{const s=Wc[t];if(!s)throw new Error("Invalid upload configuration");const a=((e,t)=>{const n=[];return e.size>t.maxSize&&n.push("File size must be less than ".concat(t.maxSize/1048576,"MB")),t.allowedTypes.includes(e.type)||n.push("File type ".concat(e.type," is not allowed. Allowed types: ").concat(t.allowedTypes.join(", "))),n})(e,s);if(a.length>0)throw new Error(a.join(", "));let i=e;e.type.startsWith("image/")&&s.maxWidth&&s.maxHeight&&(i=await((e,t,n)=>new Promise(r=>{const s=document.createElement("canvas"),a=s.getContext("2d"),i=new Image;i.onload=()=>{let{width:o,height:l}=i;if(o>t||l>n){const e=Math.min(t/o,n/l);o*=e,l*=e}s.width=o,s.height=l,a.drawImage(i,0,0,o,l),s.toBlob(r,e.type,.9)},i.src=URL.createObjectURL(e)}))(e,s.maxWidth,s.maxHeight));const o=Date.now(),l=Math.random().toString(36).substring(2),c=e.name.split(".").pop(),d="".concat(o,"_").concat(l,".").concat(c),u=r?"".concat(s.path,"/").concat(r,"/").concat(d):"".concat(s.path,"/").concat(n,"/").concat(d),m=(0,ha.KR)(yt.IG,u),h=await(0,ha.D)(m,i);return{url:await(0,ha.qk)(h.ref),path:u,filename:d,size:i.size,type:i.type,uploadedAt:new Date}}catch(s){throw console.error("Error uploading file:",s),s}},Gc=()=>{const t=oe(),{currentUser:n}=sn(),[r,a]=(0,e.useState)(!1),[i,o]=(0,e.useState)({name:"",description:"",category:"Networking",isPrivate:!1,image:Oc}),[l,c]=(0,e.useState)(!1),[d,u]=(0,e.useState)(""),m=e=>{const{name:t,value:n,type:r,checked:a}=e.target;o(e=>(0,s.A)((0,s.A)({},e),{},{[t]:"checkbox"===r?a:n}))};return(0,nn.jsx)("div",{className:"min-h-screen bg-gray-50 py-8",children:(0,nn.jsx)("div",{className:"max-w-2xl mx-auto px-4 sm:px-6 lg:px-8",children:(0,nn.jsxs)("div",{className:"bg-white rounded-lg shadow-md p-6",children:[(0,nn.jsxs)("div",{className:"mb-6",children:[(0,nn.jsx)("h1",{className:"text-2xl font-bold text-gray-900",children:"Create New Group"}),(0,nn.jsx)("p",{className:"text-gray-600 mt-2",children:"Start a new professional group and connect with like-minded members."})]}),(0,nn.jsxs)("form",{onSubmit:async e=>{if(e.preventDefault(),n){a(!0);try{const e=(0,s.A)((0,s.A)({},i),{},{createdBy:n.uid,members:[n.uid],memberCount:1,posts:[],moderators:[n.uid],createdAt:new Date,updatedAt:new Date}),r=await(0,wn.wj)(e,n.uid);t("/groups/".concat(r))}catch(r){console.error("Error creating group:",r),alert("Error creating group. Please try again.")}finally{a(!1)}}},className:"space-y-6",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"name",className:"block text-sm font-medium text-gray-700 mb-2",children:"Group Name *"}),(0,nn.jsx)("input",{type:"text",id:"name",name:"name",required:!0,value:i.name,onChange:m,className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue focus:border-transparent",placeholder:"Enter group name"})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"description",className:"block text-sm font-medium text-gray-700 mb-2",children:"Description *"}),(0,nn.jsx)("textarea",{id:"description",name:"description",required:!0,rows:4,value:i.description,onChange:m,className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue focus:border-transparent",placeholder:"Describe what this group is about"})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"category",className:"block text-sm font-medium text-gray-700 mb-2",children:"Category"}),(0,nn.jsx)("select",{id:"category",name:"category",value:i.category,onChange:m,className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue focus:border-transparent",children:["Networking","Industry Specific","Career Development","Education","Regional","Diversity & Inclusion","Technology","Other"].map(e=>(0,nn.jsx)("option",{value:e,children:e},e))})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Group Photo"}),(0,nn.jsxs)("div",{className:"flex items-center gap-4 mb-3",children:[(0,nn.jsx)("div",{className:"h-20 w-20 rounded-lg border border-gray-200 bg-white flex items-center justify-center overflow-hidden flex-shrink-0",children:(0,nn.jsx)("img",{src:Fc(i.image),alt:"Group preview",className:"h-full w-full object-contain"})}),(0,nn.jsx)("p",{className:"text-sm text-gray-500",children:"Pick an APN logo or upload your own photo. You can change this later."})]}),(0,nn.jsx)("div",{className:"flex flex-wrap gap-2 mb-3",children:Mc.map(e=>(0,nn.jsx)("button",{type:"button",onClick:()=>{return t=e.path,o(e=>(0,s.A)((0,s.A)({},e),{},{image:t}));var t}
2,title:e.label,className:"h-14 w-14 rounded-md border-2 bg-white flex items-center justify-center overflow-hidden ".concat(i.image===e.path?"border-apn-blue":"border-gray-200 hover:border-gray-300"),children:(0,nn.jsx)("img",{src:"".concat("").concat(e.path),alt:e.label,className:"h-full w-full object-contain"})},e.path))}),(0,nn.jsxs)("label",{className:"inline-flex items-center px-4 py-2 bg-gray-100 text-gray-700 text-sm rounded-md cursor-pointer hover:bg-gray-200",children:[l?"Uploading\u2026":"Upload a photo",(0,nn.jsx)("input",{type:"file",accept:"image/*",onChange:async e=>{const t=e.target.files&&e.target.files[0];if(t&&n){u(""),c(!0);try{const e=await Hc(t,"PROFILE_IMAGES",n.uid);o(t=>(0,s.A)((0,s.A)({},t),{},{image:e.url}))}catch(r){console.error("Group photo upload failed:",r),u(r.message||"Upload failed. Please use a JPG/PNG under 5MB.")}finally{c(!1)}}},disabled:l,className:"hidden"})]}),d&&(0,nn.jsx)("p",{className:"text-sm text-red-500 mt-2",children:d})]}),(0,nn.jsxs)("div",{className:"flex items-center",children:[(0,nn.jsx)("input",{type:"checkbox",id:"isPrivate",name:"isPrivate",checked:i.isPrivate,onChange:m,className:"h-4 w-4 text-apn-blue focus:ring-apn-blue border-gray-300 rounded"}),(0,nn.jsx)("label",{htmlFor:"isPrivate",className:"ml-2 block text-sm text-gray-700",children:"Make this group private (members must be approved)"})]}),(0,nn.jsxs)("div",{className:"flex justify-between pt-6",children:[(0,nn.jsx)("button",{type:"button",onClick:()=>t("/groups"),className:"px-4 py-2 text-gray-600 bg-gray-200 rounded-md hover:bg-gray-300 transition duration-200",children:"Cancel"}),(0,nn.jsx)("button",{type:"submit",disabled:r,className:"px-6 py-2 bg-apn-blue text-white rounded-md hover:bg-blue-700 transition duration-200 disabled:opacity-50",children:r?"Creating...":"Create Group"})]})]})]})})})},Yc=[{id:"seed-job-1",isSeed:!0,title:"M&A Associate",company:"Goldman Sachs",companyType:"Investment Bank",location:"New York, NY",type:"Full-time",salary:"$175,000 - $225,000",description:"Execute buy- and sell-side M&A transactions across technology and industrials. Build financial models, manage due diligence, and support senior bankers through close.",requirements:["2-4 years of investment banking experience","Strong financial modeling skills","CFA a plus"],contactEmail:"[email protected]",featured:!0,status:"open",postedBy:"seed",postedDate:"2026-06-10"},{id:"seed-job-2",isSeed:!0,title:"Private Equity Analyst",company:"Blackstone",companyType:"Private Equity",location:"New York, NY",type:"Full-time",salary:"$150,000 - $190,000",description:"Evaluate buyout opportunities across consumer and healthcare. Support diligence, modeling, and portfolio monitoring.",requirements:["1-3 years in IB or PE","LBO modeling","Strong analytical skills"],contactEmail:"[email protected]",featured:!1,status:"open",postedBy:"seed",postedDate:"2026-06-12"},{id:"seed-job-3",isSeed:!0,title:"Corporate Development Manager",company:"Morgan Stanley",companyType:"Investment Bank",location:"Chicago, IL",type:"Full-time",salary:"$160,000 - $200,000",description:"Lead inorganic growth initiatives: pipeline development, valuation, negotiation, and post-merger integration.",requirements:["4+ years in IB, PE, or corporate development","M&A execution experience"],contactEmail:"[email protected]",featured:!1,status:"open",postedBy:"seed",postedDate:"2026-06-14"}],Kc=t=>{let{isOpen:n,onClose:r,job:a,onSuccess:i}=t;const{currentUser:o}=sn(),[l,c]=(0,e.useState)(!1),[d,u]=(0,e.useState)(""),[m,h]=(0,e.useState)(!1),[p,g]=(0,e.useState)({candidateName:"",candidateEmail:"",candidatePhone:"",relationship:"",note:"",resumeFile:null}),f=e=>{const{name:t,value:n}=e.target;g(e=>(0,s.A)((0,s.A)({},e),{},{[t]:n}))};return n?(0,nn.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4",children:(0,nn.jsx)("div",{className:"bg-white rounded-lg max-w-md w-full max-h-[90vh] overflow-y-auto",children:(0,nn.jsxs)("div",{className:"p-6",children:[(0,nn.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,nn.jsx)("h3",{className:"text-lg font-semibold text-gray-900",children:"Refer Someone for This Job"}),(0,nn.jsx)("button",{onClick:r,className:"text-gray-400 hover:text-gray-600",disabled:l,children:(0,nn.jsx)("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 18L18 6M6 6l12 12"})})})]}),a&&(0,nn.jsxs)("div",{className:"mb-4 p-3 bg-gray-50 rounded-lg",children:[(0,nn.jsx)("h4",{className:"font-medium text-gray-900",children:a.title}),(0,nn.jsxs)("p",{className:"text-sm text-gray-600",children:[a.company," \u2022 ",a.location]})]}),m?(0,nn.jsxs)("div",{className:"text-center py-8",children:[(0,nn.jsx)("div",{className:"w-16 h-16 mx-auto mb-4 bg-green-100 rounded-full flex items-center justify-center",children:(0,nn.jsx)("svg",{className:"w-8 h-8 text-green-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M5 13l4 4L19 7"})})}),(0,nn.jsx)("h4",{className:"text-lg font-semibold text-gray-900 mb-2",children:"Referral Submitted!"}
2),(0,nn.jsx)("p",{className:"text-gray-600",children:"Thank you for referring a candidate. We'll review the referral and be in touch."})]}):(0,nn.jsxs)("form",{onSubmit:async e=>{if(e.preventDefault(),!o)return void u("Please log in to submit a referral.");if(!p.candidateName.trim()||!p.candidateEmail.trim()||!p.relationship)return void u("Please fill in all required fields.");if(/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(p.candidateEmail)){c(!0),u("");try{const e={jobId:a.id,jobTitle:a.title,company:a.company,referrerUserId:o.uid,referrerName:o.displayName||o.email,referrerEmail:o.email,candidateName:p.candidateName.trim(),candidateEmail:p.candidateEmail.trim(),candidatePhone:p.candidatePhone.trim(),relationship:p.relationship,note:p.note.trim(),status:"pending",submittedAt:(new Date).toISOString(),hasResume:!!p.resumeFile};console.log("Submitting job referral:",e),await new Promise(e=>setTimeout(e,1e3)),h(!0),i&&i(e),setTimeout(()=>{r(),h(!1),g({candidateName:"",candidateEmail:"",candidatePhone:"",relationship:"",note:"",resumeFile:null})},2e3)}catch(d){console.error("Error submitting referral:",d),u("Failed to submit referral. Please try again.")}finally{c(!1)}}else u("Please enter a valid email address.")},children:[d&&(0,nn.jsx)("div",{className:"mb-4 p-3 bg-red-100 border border-red-400 text-red-700 rounded",children:d}),(0,nn.jsxs)("div",{className:"space-y-4",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"candidateName",className:"block text-sm font-medium text-gray-700 mb-1",children:"Candidate Name *"}),(0,nn.jsx)("input",{type:"text",id:"candidateName",name:"candidateName",value:p.candidateName,onChange:f,className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue",placeholder:"Full name of the candidate",required:!0})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"candidateEmail",className:"block text-sm font-medium text-gray-700 mb-1",children:"Candidate Email *"}),(0,nn.jsx)("input",{type:"email",id:"candidateEmail",name:"candidateEmail",value:p.candidateEmail,onChange:f,className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue",placeholder:"[email protected]",required:!0})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"candidatePhone",className:"block text-sm font-medium text-gray-700 mb-1",children:"Candidate Phone (Optional)"}),(0,nn.jsx)("input",{type:"tel",id:"candidatePhone",name:"candidatePhone",value:p.candidatePhone,onChange:f,className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue",placeholder:"(555) 123-4567"})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"relationship",className:"block text-sm font-medium text-gray-700 mb-1",children:"Your Relationship to Candidate *"}),(0,nn.jsxs)("select",{id:"relationship",name:"relationship",value:p.relationship,onChange:f,className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue",required:!0,children:[(0,nn.jsx)("option",{value:"",children:"Select relationship"}),["Former Colleague","Current Colleague","Friend","Family Member","Professional Contact","LinkedIn Connection","Other"].map(e=>(0,nn.jsx)("option",{value:e,children:e},e))]})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"resumeFile",className:"block text-sm font-medium text-gray-700 mb-1",children:"Resume (Optional)"}),(0,nn.jsx)("input",{type:"file",id:"resumeFile",name:"resumeFile",onChange:e=>{g(t=>(0,s.A)((0,s.A)({},t),{},{resumeFile:e.target.files[0]}))},accept:".pdf,.doc,.docx",className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue"}),(0,nn.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"PDF, DOC, or DOCX files only"})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"note",className:"block text-sm font-medium text-gray-700 mb-1",children:"Additional Notes (Optional)"}),(0,nn.jsx)("textarea",{id:"note",name:"note",value:p.note,onChange:f,rows:"3",className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue",placeholder:"Why do you think this candidate would be a good fit?"})]})]}),(0,nn.jsxs)("div",{className:"flex space-x-3 mt-6",children:[(0,nn.jsx)("button",{type:"button",onClick:r,className:"flex-1 px-4 py-2 border border-gray-300 rounded-md text-gray-700 hover:bg-gray-50",disabled:l,children:"Cancel"}),(0,nn.jsx)("button",{type:"submit",className:"flex-1 px-4 py-2 bg-apn-blue text-white rounded-md hover:bg-blue-700 disabled:opacity-50",disabled:l,children:l?"Submitting...":"Submit Referral"})]})]})]})})}):null},Jc=t=>{let{isOpen:n,onClose:r,posting:a,type:i="job"}=t;const{currentUser:o,userProfile:l}=sn(),[c,d]=(0,e.useState)(!1),[u,m]=(0,e.useState)({coverLetter:"",resumeFile:null,shareProfile:!0}),h=e=>{const{name:t,value:n,type:r,checked:a}=e.target;m(e=>(0,s.A)((0,s.A)({},e),{},{[t]:"checkbox"===r?a:n}))};return n?(0,nn.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4",children:(0,nn.jsx)("div",{className:"bg-white rounded-lg max-w-2xl w-full max-h-[90vh] overflow-y-auto",children:(0,nn.jsxs)("div",{className:"p-6",children:[(0,nn.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,nn.jsxs)("h2",{className:"text-2xl font-bold text-gray-900",children:["Apply for ","job"===i?"Job":"Project"]}),(0,nn.jsx)("button",{onClick:r,className:"text-gray-400 hover:text-gray-600",children:(0,nn.jsx)("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 18L18 6M6 6l12 12"})})})]}),(0,nn.jsxs)("div",{className:"bg-gray-50 rounded-lg p-4 mb-6",children:[(0,nn.jsx)("h3",{className:"font-semibold text-lg",children:a.title}),(0,nn.jsxs)("p",{className:"text-gray-600",children:[a.company||a.client," \u2022 ",a.location]}),a.salary&&(0,nn.jsx)("p",{className:"text-green-600 font-medium",children:a.salary}),a.budget&&(0,nn.jsx)("p",{className:"text-green-600 font-medium",children:a.budget})]}),(0,nn.jsxs)("form",{onSubmit:async e=>{if(e.preventDefault(),o)if(u.shareProfile){d(!0);try{var t;let e=null;if(u.resumeFile){const t=await fetch("https://us-central1-the-apn.cloudfunctions.net/generateUploadUrl",{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(await o.getIdToken())},body:JSON.stringify({fileName:u.resumeFile.name,fileType:u.resumeFile.type,uploadType:"document"})});if(!t.ok)throw new Error("Failed to generate upload URL");const{uploadUrl:n,filePath:r}=await t.json();if(!(await fetch(n,{method:"PUT",headers:{"Content-Type":u.resumeFile.type},body:u.resumeFile})).ok)throw new Error("Failed to upload resume");const s=await fetch("https://us-central1-the-apn.cloudfunctions.net/confirmFileUpload",{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(await o.getIdToken())},body:JSON.stringify({filePath:r,uploadType:"document",metadata:{originalName:u.resumeFile.name,postingId:a.id,postingType:i}})});if(!s.ok)throw new Error("Failed to confirm file upload");const{fileUrl:l}=await s.json();e=l}const n={postingId:a.id,postingType:i,postingTitle:a.title,applicantId:o.uid,applicantName:"".concat((null===l||void 0===l?void 0:l.firstName)||""," ").concat((null===l||void 0===l?void 0:l.lastName)||"").trim(),applicantEmail:(null===l||void 0===l?void 0:l.email)||o.email,coverLetter:u.coverLetter,resumeUrl:e,resumeFileName:null===(t=u.resumeFile)||void 0===t?void 0:t.name,shareProfile:u.shareProfile,appliedAt:(new Date).toISOString(),status:"submitted"};if(!(await fetch("https://us-central1-the-apn.cloudfunctions.net/submitApplication",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})).ok)throw new Error("Failed to submit application");alert("Application submitted successfully!"),r()}catch(n){console.error("Error submitting application:",n),alert("Failed to submit application. Please try again.")}finally{d(!1)}}else alert("You must consent to share your profile information");else alert("Please log in to apply")},className:"space-y-6",children:[(0,nn.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Name"}),(0,nn.jsx)("input",{type:"text",value:"".concat((null===l||void 0===l?void 0:l.firstName)||""," ").concat((null===l||void 0===l?void 0:l.lastName)||"").trim(),disabled:!0,className:"w-full px-3 py-2 border border-gray-300 rounded-md bg-gray-50"})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Email"}),(0,nn.jsx)("input",{type:"email",value:(null===l||void 0===l?void 0:l.email)||(null===o||void 0===o?void 0:o.email)||"",disabled:!0,className:"w-full px-3 py-2 border border-gray-300 rounded-md bg-gray-50"})]})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Cover Letter (Optional)"}),(0,nn.jsx)("textarea",{name:"coverLetter",value:u.coverLetter,onChange:h,rows:"4",placeholder:"Tell the employer why you're interested in this position and what makes you a great fit...",className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsxs)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:["Attachment ",(0,nn.jsx)("span",{className:"text-gray-400",children:"(optional)"})]}),(0,nn.jsx)("input",{type:"file",onChange:e=>{const t=e.target.files[0];if(t){if(!["application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document"].includes(t.type))return void alert("Please upload a PDF or Word document");
2if(t.size>10485760)return void alert("File size must be less than 10MB");m(e=>(0,s.A)((0,s.A)({},e),{},{resumeFile:t}))}},accept:".pdf,.doc,.docx,.txt",className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"}),(0,nn.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:"Upload a document (PDF, Word, or TXT, max 10MB)"}),u.resumeFile&&(0,nn.jsxs)("p",{className:"text-sm text-green-600 mt-1",children:["\u2713 ",u.resumeFile.name," selected"]})]}),(0,nn.jsxs)("div",{className:"flex items-start",children:[(0,nn.jsx)("input",{type:"checkbox",name:"shareProfile",checked:u.shareProfile,onChange:h,required:!0,className:"mt-1 mr-3"}),(0,nn.jsxs)("label",{className:"text-sm text-gray-700",children:["I consent to share my profile information and resume with the ","job"===i?"employer":"project creator"," for this application."]})]}),(0,nn.jsxs)("div",{className:"flex justify-end space-x-4",children:[(0,nn.jsx)("button",{type:"button",onClick:r,className:"px-6 py-2 border border-gray-300 rounded-md text-gray-700 hover:bg-gray-50",children:"Cancel"}),(0,nn.jsx)("button",{type:"submit",disabled:c,className:"px-6 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 disabled:opacity-50",children:c?"Submitting...":"Submit Application"})]})]})]})})}):null},$c=()=>{const{currentUser:t}=sn(),[n,r]=(0,e.useState)([]),[s,a]=(0,e.useState)(!0),[i,o]=(0,e.useState)(null),[l,c]=(0,e.useState)(!1);(0,e.useEffect)(()=>{console.log("JobBoard component mounted, loading jobs..."),d()},[]);const d=async()=>{try{a(!0),o(null),console.log("Loading jobs from Firebase...");const e=await(0,wn.zA)(20);console.log("Jobs loaded successfully:",e),console.log("Number of jobs:",e.length),r(e);const t=await(0,wn.l9)();c(t)}catch(i){console.error("Error loading jobs:",i),o("Failed to load jobs. Please try again."),r([])}finally{a(!1)}},[u,m]=(0,e.useState)(""),[h,p]=(0,e.useState)(""),[g,f]=(0,e.useState)(""),[x,b]=(0,e.useState)(""),[y,v]=(0,e.useState)(!1),[w,j]=(0,e.useState)("list"),[N,k]=(0,e.useState)(!1),[A,S]=(0,e.useState)(null),[E,C]=(0,e.useState)(!1),[T,P]=(0,e.useState)(null),[_,I]=(0,e.useState)(1),[D]=(0,e.useState)(10),R=e=>"closed"===e.status,L=async e=>{if(t)try{await(0,wn.Ao)(e,t.uid),d(),alert("Job marked as filled successfully!")}catch(i){console.error("Error marking job as filled:",i),alert("Failed to mark job as filled. Please try again.")}},M=e=>t&&(e.postedBy===t.uid||e.contactEmail===t.email),O=()=>t&&"[email protected]"===t.email,F=async(e,t)=>{if(!O())return;if(window.confirm('Are you sure you want to permanently delete the job "'.concat(t,'"? This action cannot be undone.')))try{await(0,wn.XX)(e),d(),alert("Job deleted successfully!")}catch(i){console.error("Error deleting job:",i),alert("Failed to delete job. Please try again.")}},U=l?n:[...n,...Yc];console.log("Jobs state:",n),console.log("Display jobs:",U);const B=e=>{S(e),k(!0)},z=[...new Set(U.map(e=>e.location))],V=[...new Set(U.map(e=>e.type))],q=[...new Set(U.map(e=>e.companyType))].filter(Boolean),W=[...new Set(["Investment Bank","Private Equity","Hedge Fund","Asset Management","Consulting","Corporate","Venture Capital","Insurance","Real Estate","Fintech","Accounting Firm","Law Firm",...q])],H=[...U.filter(e=>{const t=(e.title||"").toLowerCase().includes(u.toLowerCase())||(e.company||"").toLowerCase().includes(u.toLowerCase())||(e.description||"").toLowerCase().includes(u.toLowerCase()),n=""===h||e.location===h,r=""===g||e.type===g,s=""===x||e.companyType===x,a=!y||e.featured;return t&&n&&r&&s&&a})].sort((e,t)=>{var n,r;return((null===(n=Bn(t.postedDate))||void 0===n?void 0:n.getTime())||0)-((null===(r=Bn(e.postedDate))||void 0===r?void 0:r.getTime())||0)}),G=Math.ceil(H.length/D),Y=(_-1)*D,K=Y+D,J=H.slice(Y,K),$=e=>{I(e),window.scrollTo({top:0,behavior:"smooth"})};return s?(0,nn.jsx)("div",{className:"flex justify-center items-center min-h-screen",children:(0,nn.jsxs)("div",{className:"text-center",children:[(0,nn.jsx)("div",{className:"animate-spin rounded-full h-12 w-12 border-t-2 border-b-2 border-apn-blue mx-auto mb-4"}),(0,nn.jsx)("p",{children:"Loading jobs from Firebase..."})]})}):i?(0,nn.jsx)("div",{className:"max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:(0,nn.jsxs)("div",{className:"bg-red-50 border border-red-200 rounded-md p-4",children:[(0,nn.jsx)("h3",{className:"text-red-800 font-medium",children:"Error Loading Jobs"}),(0,nn.jsx)("p",{className:"text-red-700",children:i}),(0,nn.jsx)("button",{onClick:d,className:"mt-2 bg-red-600 text-white px-4 py-2 rounded hover:bg-red-700",children:"Retry"})]})}):(0,nn.jsxs)("div",{className:"bg-white",children:[(0,nn.jsx)("div",{className:"bg-apn-blue text-white py-12",children:(0,nn.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:(0,nn.jsxs)("div",{className:"text-center",children:[(0,nn.jsx)("div",{className:"flex justify-center mb-4",children:(0,nn.jsx)("img",{src:"".concat("","/apn-logos/APN-Tag-white.jpg"),alt:"APN Logo",className:"h-16"})}),(0,nn.jsx)("h1",{className:"text-3xl font-bold",children:"Job Board"})]})})}),(0,nn.jsx)("section",{className:"py-12",children:(0,nn.jsxs)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[(0,nn.jsxs)("div",{className:"mb-8 space-y-4",children:[(0,nn.jsxs)("div",{className:"flex flex-col md:flex-row justify-between items-center gap-4",children:[(0,nn.jsx)("div",{className:"w-full md:w-1/2",children:(0,nn.jsx)("input",{type:"text",placeholder:"Search jobs by title, company, or keywords...",value:u,onChange:e=>m(e.target.value),className:"w-full px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue"})}),(0,nn.jsxs)("div",{className:"flex space-x-4",children:[(0,nn.jsx)("button",{onClick:()=>j("list"),className:"p-2 rounded-md ".concat("list"===w?"bg-apn-blue text-white":"bg-gray-200 text-gray-700 hover:bg-gray-300"),children:(0,nn.jsx)("svg",{className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M4 6h16M4 12h16M4 18h16"})})}),(0,nn.jsx)("button",{onClick:()=>j("grid"),className:"p-2 rounded-md ".concat("grid"===w?"bg-apn-blue text-white":"bg-gray-200 text-gray-700 hover:bg-gray-300"),children:(0,nn.jsx)("svg",{className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M4 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2V6zM14 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2V6zM4 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2v-2zM14 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2v-2z"})})})]})]}),(0,nn.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"location-filter",className:"block text-sm font-medium text-gray-700 mb-1",children:"Filter by Location"}),(0,nn.jsxs)("select",{id:"location-filter",value:h,onChange:e=>p(e.target.value),className:"w-full px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue",children:[(0,nn.jsx)("option",{value:"",children:"All Locations"}),z.map((e,t)=>(0,nn.jsx)("option",{value:e,children:e},t))]})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"type-filter",className:"block text-sm font-medium text-gray-700 mb-1",children:"Filter by Job Type"}),(0,nn.jsxs)("select",{id:"type-filter",value:g,onChange:e=>f(e.target.value),className:"w-full px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue",children:[(0,nn.jsx)("option",{value:"",children:"All Types"}),V.map((e,t)=>(0,nn.jsx)("option",{value:e,children:e},t))]})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"company-type-filter",className:"block text-sm font-medium text-gray-700 mb-1",children:"Filter by Company Type"}),(0,nn.jsxs)("select",{id:"company-type-filter",value:x,onChange:e=>b(e.target.value),className:"w-full px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue",children:[(0,nn.jsx)("option",{value:"",children:"All Company Types"}),W.map((e,t)=>(0,nn.jsx)("option",{value:e,children:e},t))]})]}),(0,nn.jsx)("div",{className:"flex items-end",children:(0,nn.jsxs)("label",{className:"flex items-center",children:[(0,nn.jsx)("input",{type:"checkbox",checked:y,onChange:()=>v(!y),className:"h-4 w-4 text-apn-blue focus:ring-apn-blue border-gray-300 rounded"}),(0,nn.jsx)("span",{className:"ml-2 text-sm text-gray-700",children:"Show Featured Jobs Only"})]})})]})]}),(0,nn.jsxs)("div",{className:"mb-6 flex justify-between items-center",children:[(0,nn.jsxs)("p",{className:"text-gray-600",children:["Showing ",Y+1,"-",Math.min(K,H.length)," of ",H.length," jobs"]}),(0,nn.jsxs)(dt,{to:"/jobs/post",className:"inline-flex items-center bg-apn-blue text-white py-2 px-4 roun
2ded hover:bg-blue-700 transition duration-200",children:[(0,nn.jsx)("svg",{className:"h-5 w-5 mr-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 6v6m0 0v6m0-6h6m-6 0H6"})}),"Post a Job"]})]}),J.length>0?"list"===w?(0,nn.jsx)("div",{className:"space-y-6",children:J.map(e=>(0,nn.jsx)("div",{className:"bg-white rounded-lg shadow-lg overflow-hidden border ".concat(e.featured?"border-apn-blue":"border-gray-200"),children:(0,nn.jsxs)("div",{className:"p-6",children:[(0,nn.jsxs)("div",{className:"flex flex-col md:flex-row justify-between mb-4",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("h3",{className:"text-xl font-bold",children:e.title}),(0,nn.jsxs)("p",{className:"text-gray-600",children:[e.company," \u2022 ",e.location]})]}),(0,nn.jsxs)("div",{className:"mt-2 md:mt-0 flex items-start",children:[e.featured&&(0,nn.jsx)("span",{className:"inline-block bg-apn-blue text-white text-xs px-2 py-1 rounded mr-2",children:"Featured"}),(0,nn.jsx)("span",{className:"inline-block bg-gray-100 text-gray-600 text-xs px-2 py-1 rounded",children:e.type})]})]}),(0,nn.jsx)("p",{className:"text-gray-600 mb-4",children:e.description}),(0,nn.jsxs)("div",{className:"mb-4",children:[(0,nn.jsx)("h4",{className:"font-semibold text-gray-700 mb-2",children:"Requirements:"}),(0,nn.jsx)("ul",{className:"list-disc pl-5 text-gray-600 space-y-1",children:(Array.isArray(e.requirements)?e.requirements:[]).map((e,t)=>(0,nn.jsx)("li",{children:e},t))})]}),(0,nn.jsxs)("div",{className:"flex flex-col md:flex-row justify-between items-start md:items-center",children:[(0,nn.jsxs)("div",{className:"mb-4 md:mb-0",children:[(0,nn.jsx)("span",{className:"text-gray-700 font-semibold",children:"Salary:"})," ",(0,nn.jsx)("span",{className:"text-gray-600",children:e.salary}),(0,nn.jsxs)("p",{className:"text-gray-500 text-sm",children:["Posted on ",zn(e.postedDate)]})]}),(0,nn.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,nn.jsx)(dt,{to:"/jobs/".concat(e.id),className:"inline-block bg-apn-blue text-white py-2 px-4 rounded hover:bg-blue-700 transition duration-200",children:"View Details"}),R(e)?(0,nn.jsx)("div",{className:"inline-block bg-red-100 text-red-800 py-2 px-4 rounded border border-red-300",children:"No longer accepting applications"}):(0,nn.jsxs)(nn.Fragment,{children:[(0,nn.jsx)("button",{onClick:()=>{P(e),C(!0)},className:"inline-block bg-green-600 text-white py-2 px-4 rounded hover:bg-green-700 transition duration-200",children:"Apply Now"}),(0,nn.jsx)("button",{onClick:()=>B(e),className:"inline-block bg-purple-600 text-white py-2 px-4 rounded hover:bg-purple-700 transition duration-200",children:"Refer Someone"})]}),M(e)&&"closed"!==e.status&&(0,nn.jsx)("button",{onClick:()=>L(e.id),className:"inline-block bg-orange-600 text-white py-2 px-4 rounded hover:bg-orange-700 transition duration-200",children:"Mark as Filled"}),O()&&(0,nn.jsx)("button",{onClick:()=>F(e.id,e.title),className:"inline-block bg-red-600 text-white py-2 px-4 rounded hover:bg-red-700 transition duration-200",children:"Delete"})]})]})]})},e.id))}):(0,nn.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:J.map(e=>(0,nn.jsxs)("div",{className:"bg-white rounded-lg shadow-lg overflow-hidden border h-full flex flex-col ".concat(e.featured?"border-apn-blue":"border-gray-200"),children:[(0,nn.jsxs)("div",{className:"p-6 flex-grow",children:[(0,nn.jsxs)("div",{className:"flex justify-between items-start mb-4",children:[(0,nn.jsx)("h3",{className:"text-lg font-bold",children:e.title}),e.featured&&(0,nn.jsx)("span",{className:"inline-block bg-apn-blue text-white text-xs px-2 py-1 rounded",children:"Featured"})]}),(0,nn.jsx)("p",{className:"text-gray-600 mb-2",children:e.company}),(0,nn.jsxs)("div",{className:"space-y-2 mb-4",children:[(0,nn.jsxs)("div",{className:"flex items-center text-gray-600",children:[(0,nn.jsxs)("svg",{className:"h-5 w-5 mr-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:[(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"}),(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M15 11a3 3 0 11-6 0 3 3 0 016 0z"})]}),(0,nn.jsx)("span",{children:e.location})]}),(0,nn.jsxs)("div",{className:"flex items-center text-gray-600",children:[(0,nn.jsx)("svg",{className:"h-5 w-5 mr-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M21 13.255A23.931 23.931 0 0112 15c-3.183 0-6.22-.62-9-1.745M16 6V4a2 2 0 00-2-2h-4a2 2 0 00-2 2v2m4 6h.01M5 20h14a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})}),(0,nn.jsx)("span",{children:e.type})]}),(0,nn.jsxs)("div",{className:"flex items-center text-gray-600",children:[(0,nn.jsx)("svg",{className:"h-5 w-5 mr-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),(0,nn.jsx)("span",{children:e.salary})]})]}),(0,nn.jsx)("p",{className:"text-gray-600 mb-4 line-clamp-3",children:e.description})]}),(0,nn.jsx)("div",{className:"p-6 bg-gray-50 border-t border-gray-200",children:(0,nn.jsxs)("div",{className:"flex flex-col space-y-3",children:[(0,nn.jsxs)("p",{className:"text-gray-500 text-sm",children:["Posted ",zn(e.postedDate)]}),(0,nn.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,nn.jsx)(dt,{to:"/jobs/".concat(e.id),className:"inline-block bg-apn-blue text-white py-1 px-3 rounded text-sm hover:bg-blue-700 transition duration-200",children:"View Details"}),R(e)?(0,nn.jsx)("div",{className:"inline-block bg-red-100 text-red-800 py-1 px-3 rounded text-sm border border-red-300",children:"No longer accepting applications"}):(0,nn.jsxs)(nn.Fragment,{children:[(0,nn.jsx)("button",{onClick:()=>{P(e),C(!0)},className:"inline-block bg-green-600 text-white py-1 px-3 rounded text-sm hover:bg-green-700 transition duration-200",children:"Apply Now"}),(0,nn.jsx)("button",{onClick:()=>B(e),className:"inline-block bg-purple-600 text-white py-1 px-3 rounded text-sm hover:bg-purple-700 transition duration-200",children:"Refer"})]}),M(e)&&"closed"!==e.status&&(0,nn.jsx)("button",{onClick:()=>L(e.id),className:"inline-block bg-orange-600 text-white py-1 px-3 rounded text-sm hover:bg-orange-700 transition duration-200",children:"Filled"}),O()&&(0,nn.jsx)("button",{onClick:()=>F(e.id,e.title),className:"inline-block bg-red-600 text-white py-1 px-3 rounded text-sm hover:bg-red-700 transition duration-200",children:"Delete"})]})]})})]},e.id))}):(0,nn.jsx)("div",{className:"text-center py-12",children:(0,nn.jsx)("p",{className:"text-xl text-gray-600",children:"No jobs found matching your search criteria."})}),G>1&&(0,nn.jsx)("div",{className:"mt-12 flex justify-center",children:(0,nn.jsxs)("nav",{className:"inline-flex rounded-md shadow",children:[(0,nn.jsx)("button",{onClick:()=>{_>1&&$(_-1)},disabled:1===_,className:"px-4 py-2 rounded-l-md border border-gray-300 ".concat(1===_?"bg-gray-100 text-gray-400 cursor-not-allowed":"bg-white text-gray-700 hover:bg-gray-50"),children:"Previous"}),Array.from({length:G},(e,t)=>t+1).map(e=>(0,nn.jsx)("button",{onClick:()=>$(e),className:"px-4 py-2 border-t border-b border-gray-300 ".concat(_===e?"bg-apn-blue text-white":"bg-white text-gray-700 hover:bg-gray-50"),children:e},e)),(0,nn.jsx)("button",{onClick:()=>{_<G&&$(_+1)},disabled:_===G,className:"px-4 py-2 rounded-r-md border border-gray-300 ".concat(_===G?"bg-gray-100 text-gray-400 cursor-not-allowed":"bg-white text-gray-700 hover:bg-gray-50"),children:"Next"})]})})]})}),(0,nn.jsx)("section",{className:"py-12 bg-gray-50",children:(0,nn.jsxs)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[(0,nn.jsx)("div",{className:"text-center mb-8",children:(0,nn.jsx)("h2",{className:"text-2xl font-bold text-gray-900",children:"Featured Employers"})}),(0,nn.jsx)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-6",children:["Goldman Sachs","JP Morgan","Blackstone","Skadden"].map((e,t)=>(0,nn.jsx)("div",{className:"bg-white rounded-lg shadow-md p-6 flex items-center justify-center",children:(0,nn.jsx)("span",{className:"text-lg font-semibold text-gray-700",children:e})},t))})]})}),(0,nn.jsx)("section",{className:"bg-apn-blue text-white py-12",children:(0,nn.jsxs)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 text-center",children:[(0,nn.jsx)("div",{className:"flex justify-center mb-6",children:(0,nn.jsx)("img",{src:"".concat("","/apn-logos/APN-Tag-SQ-white.jpg"),alt:"APN Logo Square",className:"h-20"})}),(0,nn.jsx)("h2",{className:"text-3xl font-bold mb-4",children:"Looking to Hire?"}),(0,nn.jsx)("p",{className:"text-xl mb-8 max-w-3xl mx-auto",children:"Post your job openings on the APN Job Board to reach qualified finance professionals."}),(0,nn.jsx)(dt,{to:"/jobs/post",className:"btn-primary bg-white text-apn-blue hover:bg-gray-100",children:"Post a Job"})]})}),N&&A&&(0,nn.jsx)(Kc,{isOpen:N,onClose:()=>{k(!1),S(null)},job:A,onSuccess:e=>{console.log("Referral submitted successfully:",e),alert("Referral submitted successfully! Thank you for helping connect talent with opportunities.")}}),E&&T&&(0,nn.jsx)(Jc,{isOpen:E,onClose:()=>{C(!1),P(null)},posting:T,type:"job"})]})},Qc=e=>{if(!e)return 0;if("function"===typeof e.toDate)return e.toDate().getTime();if("number"===typeof e.seconds)return 1e3*e.seconds;const t=new Date(e);return isNaN(t.getTime())?0:t.getTime()},Xc=async(e,t,n,r)=>{const s=(null===e||void 0===e?void 0:e.postedBy)||null,a=await(0,vt.addDoc)((0,vt.collection)(yt.db,"applications"),{kind:"referral",postingId:e.id,postingType:t,postingTitle:e.title||"",creatorId:s,referrerId:n||null,refereeName:r.name||"",refereeEmail:r.email||"",relationship:r.relationship||"",note:r.note||"",status:"new",createdAt:(0,vt.serverTimestamp)(),updatedAt:(0,vt.serverTimestamp)()});
2return s&&await(0,vt.addDoc)((0,vt.collection)(yt.db,"notifications"),{userId:s,type:"referral.submitted",title:"New Referral: ".concat(e.title||t),message:"".concat(r.name||"Someone"," was referred for your ").concat(t),data:{applicationId:a.id,postingId:e.id,postingType:t,isReferral:!0},read:!1,createdAt:(0,vt.serverTimestamp)()}),a.id},Zc=["new","submitted","reviewed","shortlisted","declined"],ed=e=>{switch(e){case"reviewed":return"bg-blue-100 text-blue-800";case"shortlisted":return"bg-green-100 text-green-800";case"declined":return"bg-red-100 text-red-800";default:return"bg-yellow-100 text-yellow-800"}},td=e=>{if(!e)return"";const t=e.toDate?e.toDate():e.seconds?new Date(1e3*e.seconds):new Date(e);return isNaN(t.getTime())?"":t.toLocaleDateString()},nd=t=>{let{postingId:n,creatorId:r,applications:a=null,collapsible:i=!0}=t;const[o,l]=(0,e.useState)(a||[]),[c,d]=(0,e.useState)(!a),[u,m]=(0,e.useState)(!i),h=(0,e.useCallback)(async()=>{if(!a&&n){d(!0);try{l(await(async(e,t)=>{if(!e||!t)return[];const n=(0,vt.query)((0,vt.collection)(yt.db,"applications"),(0,vt.where)("creatorId","==",t)),r=(await(0,vt.getDocs)(n)).docs.map(e=>(0,s.A)({id:e.id},e.data())).filter(t=>t.postingId===e);return r.sort((e,t)=>Qc(t.createdAt)-Qc(e.createdAt)),r})(n,r))}catch(Nd){console.error("Failed to load applications:",Nd)}finally{d(!1)}}},[n,r,a]);(0,e.useEffect)(()=>{h()},[h]),(0,e.useEffect)(()=>{a&&l(a)},[a]);const p=async(e,t)=>{l(n=>n.map(n=>n.id===e?(0,s.A)((0,s.A)({},n),{},{status:t}):n));try{await(async(e,t)=>{await(0,vt.updateDoc)((0,vt.doc)(yt.db,"applications",e),{status:t,updatedAt:(0,vt.serverTimestamp)()})})(e,t)}catch(Nd){console.error("Status update failed:",Nd)}},g=o.length;return(0,nn.jsxs)("div",{className:"border border-gray-200 rounded-lg bg-white",children:[(0,nn.jsxs)("button",{type:"button",onClick:()=>i&&m(e=>!e),className:"w-full flex items-center justify-between px-4 py-3 text-left",children:[(0,nn.jsxs)("span",{className:"font-semibold text-gray-900",children:["Applications & referrals received (",g,")"]}),i&&(0,nn.jsx)("svg",{className:"h-5 w-5 text-gray-400 transform transition-transform ".concat(u?"rotate-180":""),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M19 9l-7 7-7-7"})})]}),u&&(0,nn.jsx)("div",{className:"px-4 pb-4 space-y-3",children:c?(0,nn.jsx)("p",{className:"text-sm text-gray-500",children:"Loading\u2026"}):0===g?(0,nn.jsx)("p",{className:"text-sm text-gray-500",children:"No applications or referrals yet."}):o.map(e=>{const t="referral"===e.kind,n=t?e.refereeName:e.applicantName,r=t?e.refereeEmail:e.applicantEmail;return(0,nn.jsxs)("div",{className:"border border-gray-100 rounded-md p-3",children:[(0,nn.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsxs)("p",{className:"font-medium text-gray-900",children:[n||"Unknown",t&&(0,nn.jsx)("span",{className:"ml-2 text-xs bg-purple-100 text-purple-700 px-2 py-0.5 rounded",children:"Referral"})]}),r&&(0,nn.jsx)("p",{className:"text-sm text-gray-500",children:r}),(0,nn.jsx)("p",{className:"text-xs text-gray-400",children:td(e.createdAt)})]}),(0,nn.jsx)("span",{className:"text-xs px-2 py-1 rounded flex-shrink-0 ".concat(ed(e.status)),children:e.status||"new"})]}),e.coverLetter&&(0,nn.jsx)("p",{className:"text-sm text-gray-700 mt-2 whitespace-pre-wrap",children:e.coverLetter}),t&&e.note&&(0,nn.jsx)("p",{className:"text-sm text-gray-700 mt-2 whitespace-pre-wrap",children:e.note}),t&&e.relationship&&(0,nn.jsxs)("p",{className:"text-xs text-gray-500 mt-1",children:["Relationship: ",e.relationship]}),(0,nn.jsxs)("div",{className:"flex items-center gap-3 mt-3",children:[e.resumeUrl&&(0,nn.jsxs)("a",{href:e.resumeUrl,target:"_blank",rel:"noopener noreferrer",className:"text-sm text-apn-blue hover:underline",children:[e.resumeFileName||"View r\xe9sum\xe9"," \u2193"]}),(0,nn.jsx)("select",{value:e.status||"new",onChange:t=>p(e.id,t.target.value),className:"ml-auto text-sm border border-gray-300 rounded px-2 py-1",children:Zc.map(e=>(0,nn.jsx)("option",{value:e,children:e},e))})]})]},e.id)})})]})},rd=()=>{var t;const{id:n}=le(),r=se(),{currentUser:a,isAdmin:i}=sn(),[o,l]=(0,e.useState)(null),[c,d]=(0,e.useState)(!0),[u,m]=(0,e.useState)(!1),[h,p]=(0,e.useState)(!1),[g,f]=(0,e.useState)(!1);(0,e.useEffect)(()=>
2{"true"===new URLSearchParams(r.search).get("apply")&&m(!0)},[r]);const[x,b]=(0,e.useState)({name:"",email:"",description:"",attachment:null}),[y,v]=(0,e.useState)({name:"",email:"",relationship:"",note:""}),w=(0,e.useCallback)(async()=>{try{if(d(!0),"string"===typeof n&&n.startsWith("seed-job-"))return l(Yc.find(e=>e.id===n)||null),void d(!1);const e=await(0,wn.YQ)(n);l(e)}catch(e){console.error("Error loading job:",e),l(null)}finally{d(!1)}},[n]);(0,e.useEffect)(()=>{w()},[w]),(0,e.useEffect)(()=>{a&&b(e=>(0,s.A)((0,s.A)({},e),{},{name:a.displayName||"",email:a.email||""}))},[a]);const j=e=>{const{name:t,value:n}=e.target;v((0,s.A)((0,s.A)({},y),{},{[t]:n}))};return c?(0,nn.jsx)("div",{className:"flex justify-center items-center min-h-screen",children:(0,nn.jsx)("div",{className:"animate-spin rounded-full h-12 w-12 border-t-2 border-b-2 border-apn-blue"})}):o?(0,nn.jsxs)("div",{className:"bg-white",children:[(0,nn.jsx)("div",{className:"bg-apn-blue text-white py-12",children:(0,nn.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:(0,nn.jsxs)("div",{className:"text-center",children:[(0,nn.jsx)("div",{className:"flex justify-center mb-4",children:(0,nn.jsx)("img",{src:"".concat("","/apn-logos/APN-Tag-white.jpg"),alt:"APN Logo",className:"h-16"})}),(0,nn.jsx)("h1",{className:"text-3xl font-bold",children:o.title}),(0,nn.jsxs)("p",{className:"mt-2 text-lg",children:[o.company,o.location&&" \u2022 ".concat(o.location)]})]})})}),(0,nn.jsx)("section",{className:"py-12",children:(0,nn.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:(0,nn.jsxs)("div",{className:"bg-white rounded-lg shadow-lg overflow-hidden",children:[(0,nn.jsx)("div",{className:"bg-gray-50 p-6 border-b border-gray-200",children:(0,nn.jsxs)("div",{className:"flex flex-col md:flex-row justify-between items-start md:items-center",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsxs)("div",{className:"flex items-center",children:[(0,nn.jsx)("h2",{className:"text-2xl font-bold text-gray-900",children:o.title}),o.featured&&(0,nn.jsx)("span",{className:"ml-2 inline-block bg-apn-blue text-white text-xs px-2 py-1 rounded",children:"Featured"})]}),(0,nn.jsxs)("p",{className:"text-gray-600 mt-1",children:[o.company,o.location&&" \u2022 ".concat(o.location)]})]}),(0,nn.jsxs)("div",{className:"mt-4 md:mt-0 flex space-x-4",children:[(0,nn.jsx)("button",{onClick:()=>m(!0),className:"inline-flex items-center bg-apn-blue text-white py-2 px-6 rounded hover:bg-blue-700 transition duration-200",children:"Apply Now"}),(0,nn.jsx)("button",{onClick:()=>p(!0),className:"inline-flex items-center bg-white text-apn-blue border border-apn-blue py-2 px-6 rounded hover:bg-gray-50 transition duration-200",children:"Refer Someone"})]})]})}),(0,nn.jsxs)("div",{className:"p-6",children:[(0,nn.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6 mb-8",children:[(o.type||o.jobType)&&(0,nn.jsxs)("div",{className:"bg-gray-50 p-4 rounded-lg",children:[(0,nn.jsx)("h3",{className:"font-semibold text-gray-900 mb-2",children:"Job Type"}),(0,nn.jsx)("p",{className:"text-gray-700",children:o.type||o.jobType})]}),o.location&&(0,nn.jsxs)("div",{className:"bg-gray-50 p-4 rounded-lg",children:[(0,nn.jsx)("h3",{className:"font-semibold text-gray-900 mb-2",children:"Location"}),(0,nn.jsx)("p",{className:"text-gray-700",children:o.location})]}),o.salary&&(0,nn.jsxs)("div",{className:"bg-gray-50 p-4 rounded-lg",children:[(0,nn.jsx)("h3",{className:"font-semibold text-gray-900 mb-2",children:"Salary"}),(0,nn.jsx)("p",{className:"text-gray-700",children:o.salary})]})]}),(o.description||o.detailedDescription)&&(0,nn.jsxs)("div",{className:"mb-8",children:[(0,nn.jsx)("h3",{className:"text-xl font-semibold text-gray-900 mb-4",children:"Job Description"}),o.description&&(0,nn.jsx)("p",{className:"text-gray-700 mb-4",children:o.description}),o.detailedDescription&&(0,nn.jsx)("p",{className:"text-gray-700",children:o.detailedDescription})]}),o.responsibilities&&o.responsibilities.length>0&&(0,nn.jsxs)("div",{className:"mb-8",children:[(0,nn.jsx)("h3",{className:"text-xl font-semibold text-gray-900 mb-4",children:"Responsibilities"}),(0,nn.jsx)("ul",{className:"list-disc pl-5 text-gray-700 space-y-2",children:o.responsibilities.map((e,t)=>(0,nn.jsx)("li",{children:e},t))})]}),Array.isArray(o.requirements)&&o.requirements.length>0&&(0,nn.jsxs)("div",{className:"mb-8",children:[(0,nn.jsx)("h3",{className:"text-xl font-semibold text-gray-900 mb-4",children:"Requirements"}),(0,nn.jsx)("ul",{className:"list-disc pl-5 text-gray-700 space-y-2",children:o.requirements.map((e,t)=>(0,nn.jsx)("li",{children:e},t))})]}),o.benefits&&o.benefits.length>0&&(0,nn.jsxs)("div",{className:"mb-8",children:[(0,nn.jsx)("h3",{className:"text-xl font-semibold text-gray-900 mb-4",children:"Benefits"}),(0,nn.jsx)("ul",{className:"list-disc pl-5 text-gray-700 space-y-2",children:o.benef
2its.map((e,t)=>(0,nn.jsx)("li",{children:e},t))})]}),(0,nn.jsx)("div",{className:"border-t border-gray-200 pt-6",children:(0,nn.jsxs)("div",{className:"flex flex-col md:flex-row justify-between items-start md:items-center",children:[(0,nn.jsxs)("div",{children:[o.postedDate&&(0,nn.jsxs)("p",{className:"text-gray-600",children:["Posted on ",null!==(t=o.postedDate)&&void 0!==t&&t.toDate?o.postedDate.toDate().toLocaleDateString():new Date(o.postedDate).toLocaleDateString()]}),o.applicationDeadline&&(0,nn.jsxs)("p",{className:"text-gray-600",children:["Application Deadline: ",new Date(o.applicationDeadline).toLocaleDateString()]})]}),(0,nn.jsxs)("div",{className:"mt-4 md:mt-0 flex space-x-4",children:[(0,nn.jsx)("button",{onClick:()=>m(!0),className:"inline-flex items-center bg-apn-blue text-white py-2 px-6 rounded hover:bg-blue-700 transition duration-200",children:"Apply Now"}),(0,nn.jsx)("button",{onClick:()=>p(!0),className:"inline-flex items-center bg-white text-apn-blue border border-apn-blue py-2 px-6 rounded hover:bg-gray-50 transition duration-200",children:"Refer Someone"})]})]})}),o&&a&&(a.uid===o.postedBy||i())&&(0,nn.jsx)("div",{className:"mt-8",children:(0,nn.jsx)(nd,{postingId:n,creatorId:o.postedBy})})]})]})})}),u&&o&&(0,nn.jsx)(Jc,{isOpen:u,onClose:()=>m(!1),posting:o,type:"job"}),!1,h&&(0,nn.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center p-4 z-50",children:(0,nn.jsx)("div",{className:"bg-white rounded-lg shadow-xl max-w-2xl w-full max-h-[90vh] overflow-y-auto",children:(0,nn.jsxs)("div",{className:"p-6",children:[(0,nn.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,nn.jsx)("h2",{className:"text-xl font-bold text-gray-900",children:"Refer Someone for this Job"}),(0,nn.jsx)("button",{onClick:()=>p(!1),className:"text-gray-400 hover:text-gray-500",children:(0,nn.jsx)("svg",{className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 18L18 6M6 6l12 12"})})})]}),(0,nn.jsxs)("p",{className:"text-gray-600 mb-6",children:["You are referring someone for: ",(0,nn.jsx)("span",{className:"font-semibold",children:o.title})," at ",(0,nn.jsx)("span",{className:"font-semibold",children:o.company})]}),(0,nn.jsxs)("form",{onSubmit:async e=>{e.preventDefault();try{await Xc(o,"job",null===a||void 0===a?void 0:a.uid,y),alert("Your referral has been submitted successfully!"),p(!1),v({name:"",email:"",relationship:"",note:""})}catch(t){console.error("Error submitting referral:",t),alert("Failed to submit referral. Please try again.")}},children:[(0,nn.jsxs)("div",{className:"mb-4",children:[(0,nn.jsx)("label",{htmlFor:"name",className:"block text-sm font-medium text-gray-700 mb-1",children:"Referral's Name"}),(0,nn.jsx)("input",{type:"text",id:"name",name:"name",value:y.name,onChange:j,required:!0,className:"w-full px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue",placeholder:"Full name of the person you're referring"})]}),(0,nn.jsxs)("div",{className:"mb-4",children:[(0,nn.jsx)("label",{htmlFor:"email",className:"block text-sm font-medium text-gray-700 mb-1",children:"Referral's Email"}),(0,nn.jsx)("input",{type:"email",id:"email",name:"email",value:y.email,onChange:j,required:!0,className:"w-full px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue",placeholder:"Email address of the person you're referring"})]}),(0,nn.jsxs)("div",{className:"mb-4",children:[(0,nn.jsx)("label",{htmlFor:"relationship",className:"block text-sm font-medium text-gray-700 mb-1",children:"Your Relationship"}),(0,nn.jsxs)("select",{id:"relationship",name:"relationship",value:y.relationship,onChange:j,required:!0,className:"w-full px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue",children:[(0,nn.jsx)("option",{value:"",children:"Select your relationship"}),(0,nn.jsx)("option",{value:"Colleague",children:"Colleague"}),(0,nn.jsx)("option",{value:"Classmate",children:"Classmate"}),(0,nn.jsx)("option",{value:"Friend",children:"Friend"}),(0,nn.jsx)("option",{value:"Professional Connection",children:"Professional Connection"}),(0,nn.jsx)("option",{value:"Other",children:"Other"})]})]}),(0,nn.jsxs)("div",{className:"mb-6",children:[(0,nn.jsx)("label",{htmlFor:"note",className:"block text-sm font-medium text-gray-700 mb-1",children:"Referral Note"}),(0,nn.jsx)("textarea",{id:"note",name:"note",rows:"4",value:y.note,onChange:j,required:!0,className:"w-full px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue",placeholder:"Why do you think this person would be a good fit for the job?"})]}),(0,nn.jsxs)("div",{className:"flex justify-end space-x-4",children:[(0,nn.jsx)("button",{type:"button",onClick:()=>p(!1),className:"px-4 py-2 border border-gray-300 rounded-md text-gray-700 hover:bg-gray-50",children:"Cancel"}),(0,nn.jsx)("button",{type:"submit",className:"px-4 py-2 bg-apn-blue text-white rounded-md hover:bg-blue-700",children:"Submit Referral"})]})]})]})})}),(0,nn.jsx)("section",{className:"bg-apn-blue text-white py-12",children:(0,nn.jsxs)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 text-center",children:[(0,nn.jsx)("div",{className:"flex justify-center mb-6",children:(0,nn.jsx)("img",{src:"".concat("","/apn-logos/APN-Tag-SQ-white.jpg"),alt:"APN Logo Square",className:"h-20"})}),(0,nn.jsx)("h2",{className:"text-3xl font-bold mb-4",children:"Find More Jobs"}),(0,nn.jsx)("p",{className:"text-xl mb-8 max-w-3xl mx-auto",children:"Browse our job board to find more opportunities that match your skills and career goals."}),(0,nn.jsx)(dt,{to:"/jobs",className:"btn-primary bg-white text-apn-blue hover:bg-gray-100",children:"View All Jobs"})]})})]}):(0,nn.jsx)("div",{className:"bg-white min-h-screen",children:(0,nn.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12",children:(0,nn.jsxs)("div",{className:"text-center",children:[(0,nn.jsx)("h1",{className:"text-3xl font-bold text-gray-900",children:"Job Not Found"}),(0,nn.jsx)("p",{className:"mt-4 text-lg text-gray-600",children:"The job you're looking for doesn't exist or has been removed."}),(0,nn.jsx)(dt,{to:"/jobs",className:"mt-6 inline-block bg-apn-blue text-white py-2 px-6 rounded hover:bg-blue-700 transition duration-200",children:"Back to Job Board"})]})})})},sd=()=>{const{currentUser:t}=sn(),[n,r]=(0,e.useState)({jobs:[],projects:[]}),[a,i]=(0,e.useState)(!0);(0,e.useEffect)(()=>{let e=!1;return(async()=>
2{if(t){i(!0);try{const n=await(async e=>{if(!e)return{jobs:[],projects:[]};const[t,n,r]=await Promise.all([(0,vt.getDocs)((0,vt.query)((0,vt.collection)(yt.db,"jobs"),(0,vt.where)("postedBy","==",e))),(0,vt.getDocs)((0,vt.query)((0,vt.collection)(yt.db,"projects"),(0,vt.where)("postedBy","==",e))),(0,vt.getDocs)((0,vt.query)((0,vt.collection)(yt.db,"applications"),(0,vt.where)("creatorId","==",e)))]),a=r.docs.map(e=>(0,s.A)({id:e.id},e.data())),i=e=>a.filter(t=>t.postingId===e).sort((e,t)=>Qc(t.createdAt)-Qc(e.createdAt));return{jobs:t.docs.map(e=>(0,s.A)((0,s.A)({id:e.id},e.data()),{},{applications:i(e.id)})),projects:n.docs.map(e=>(0,s.A)((0,s.A)({id:e.id},e.data()),{},{applications:i(e.id)}))}})(t.uid);e||r(n)}catch(Nd){console.error("Failed to load postings:",Nd)}finally{e||i(!1)}}})(),()=>{e=!0}},[t]);const o=(e,t)=>{const n=(e.applications||[]).length;return(0,nn.jsxs)("div",{className:"bg-white rounded-lg shadow-sm border border-gray-200 p-4 mb-4",children:[(0,nn.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,nn.jsx)(dt,{to:"/".concat(t,"s/").concat(e.id),className:"font-semibold text-gray-900 hover:text-apn-blue",children:e.title||"Untitled"}),(0,nn.jsxs)("span",{className:"text-sm text-gray-500",children:[n," application",1===n?"":"s"]})]}),(0,nn.jsx)(nd,{applications:e.applications||[],collapsible:!0})]},e.id)};if(a)return(0,nn.jsx)("div",{className:"max-w-4xl mx-auto px-4 py-8 text-gray-500",children:"Loading your postings\u2026"});const l=0===n.jobs.length&&0===n.projects.length;return(0,nn.jsxs)("div",{className:"max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:[(0,nn.jsx)("h1",{className:"text-2xl font-bold text-gray-900 mb-2",children:"My Postings"}),(0,nn.jsx)("p",{className:"text-gray-600 mb-6",children:"Jobs and projects you've posted, and the applications & referrals you've received."}),l?(0,nn.jsxs)("div",{className:"bg-white rounded-lg border border-gray-200 p-8 text-center",children:[(0,nn.jsx)("p",{className:"text-gray-600 mb-4",children:"You haven't posted any jobs or projects yet."}),(0,nn.jsxs)("div",{className:"flex justify-center gap-3",children:[(0,nn.jsx)(dt,{to:"/jobs",className:"bg-apn-blue text-white px-4 py-2 rounded-md hover:bg-apn-dark-blue",children:"Browse / Post Jobs"}),(0,nn.jsx)(dt,{to:"/projects",className:"border border-apn-blue text-apn-blue px-4 py-2 rounded-md hover:bg-gray-50",children:"Browse / Post Projects"})]})]}):(0,nn.jsxs)(nn.Fragment,{children:[n.jobs.length>0&&(0,nn.jsxs)("section",{className:"mb-8",children:[(0,nn.jsx)("h2",{className:"text-lg font-semibold text-gray-900 mb-3",children:"Your Jobs"}),n.jobs.map(e=>o(e,"job"))]}),n.projects.length>0&&(0,nn.jsxs)("section",{className:"mb-8",children:[(0,nn.jsx)("h2",{className:"text-lg font-semibold text-gray-900 mb-3",children:"Your Projects"}),n.projects.map(e=>o(e,"project"))]})]})]})},ad=e=>{const t=Bn(e);if(!t)return"";const n=Date.now()-t.getTime(),r=Math.floor(n/6e4);if(r<1)return"now";if(r<60)return"".concat(r,"m");const s=Math.floor(r/60);if(s<24)return"".concat(s,"h");const a=Math.floor(s/24);return a<7?"".concat(a,"d"):t.toLocaleDateString()},id=e=>{const t=Bn(e);return t?t.toLocaleTimeString([],{hour:"numeric",minute:"2-digit"}):""},od=()=>{const{conversationId:t}=le(),n=oe(),{currentUser:r,userProfile:a}=sn(),i=(null===a||void 0===a?void 0:a.displayName)||"".concat((null===a||void 0===a?void 0:a.firstName)||""," ").concat((null===a||void 0===a?void 0:a.lastName)||"").trim()||(null===r||void 0===r?void 0:r.email)||"Member",[o,l]=(0,e.useState)([]),[c,d]=(0,e.useState)(t||null),[u,m]=(0,e.useState)([]),[h,p]=(0,e.useState)(""),[g,f]=(0,e.useState)(!1),x=(0,e.useRef)(null);(0,e.useEffect)(()=>{if(!r)return;const e=hn(r.uid,l);return()=>e()},[r]),(0,e.useEffect)(()=>{t&&d(t)},[t]),(0,e.useEffect)(()=>{if(!c)return void m([]);const e=((e,t)=>{const n=(0,vt.collection)(yt.db,"conversations",e,"messages"),r=(0,vt.query)(n,(0,vt.orderBy)("createdAt","asc"));return(0,vt.aQ)(r,e=>{const n=e.docs.map(e=>(0,s.A)({id:e.id},e.data()));t(n)})})(c,m);return()=>e()},[c]),(0,e.useEffect)(()=>{c&&r&&(async(e,t)=>{if(!e||!t)return;const n=(0,vt.doc)(yt.db,"conversations",e);await(0,vt.updateDoc)(n,{["unread.".concat(t)]:0})})(c,r.uid).catch(e=>console.error("Error marking conversation read:",e))},[c,r]),(0,e.useEffect)(()=>{var e;null===(e=x.current)||void 0===e||e.scrollIntoView({behavior:"smooth"})},[u]);const b=e=>{if(!e)return"Member";return(e.participantNames||{})[(e.participants||[]).find(e=>e!==(null===r||void 0===r?void 0:r.uid))]||"Member"},y=o.find(e=>e.id===c)||null,v=async e=>{e.preventDefault();const t=h.trim();if(t&&c&&!g)try{f(!0),await(async(e,t,n,r)=>{const s=(r||"").trim();if(!s)return;const a=(0,vt.collection)(yt.db,"conversations",e,"messages");await(0,vt.addDoc)(a,{senderId:t,senderName:n||"Member",text:s,createdAt:(0,vt.serverTimestamp)()});const i=(0,vt.doc)(yt.db,"conversations",e),o=await(0,vt.x7)(i),l=(o.exists()&&o.data().participants||[]).find(e=>
2e!==t),c={lastMessage:mn(s),lastMessageAt:(0,vt.serverTimestamp)(),updatedAt:(0,vt.serverTimestamp)()};l&&(c["unread.".concat(l)]=(0,vt.GV)(1)),await(0,vt.updateDoc)(i,c),l&&await(0,vt.addDoc)((0,vt.collection)(yt.db,"notifications"),{userId:l,type:"message.received",title:"New message from ".concat(n||"Member"),message:s.slice(0,120),data:{conversationId:e},read:!1,createdAt:(0,vt.serverTimestamp)()})})(c,r.uid,i,t),p("")}catch(n){console.error("Error sending message:",n),alert("Failed to send message. Please try again.")}finally{f(!1)}};return(0,nn.jsxs)("div",{className:"bg-white",children:[(0,nn.jsx)("div",{className:"bg-apn-blue text-white py-12",children:(0,nn.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:(0,nn.jsxs)("div",{className:"text-center",children:[(0,nn.jsx)("div",{className:"flex justify-center mb-4",children:(0,nn.jsx)("img",{src:"".concat("","/apn-logos/APN-Tag-white.jpg"),alt:"APN Logo",className:"h-16"})}),(0,nn.jsx)("h1",{className:"text-3xl font-bold",children:"Messages"})]})})}),(0,nn.jsx)("section",{className:"py-12",children:(0,nn.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:(0,nn.jsx)("div",{className:"bg-white rounded-lg shadow-lg overflow-hidden border border-gray-200",children:(0,nn.jsxs)("div",{className:"flex flex-col md:flex-row min-h-[32rem]",children:[(0,nn.jsxs)("div",{className:"w-full md:w-1/3 border-b md:border-b-0 md:border-r border-gray-200 flex flex-col",children:[(0,nn.jsx)("div",{className:"p-4 border-b border-gray-200 bg-gray-50",children:(0,nn.jsx)("h2",{className:"text-lg font-semibold text-gray-900",children:"Conversations"})}),(0,nn.jsx)("div",{className:"flex-grow overflow-y-auto max-h-[28rem]",children:o.length>0?o.map(e=>{var t;const s=c===e.id?0:(null===(t=e.unread)||void 0===t?void 0:t[null===r||void 0===r?void 0:r.uid])||0;return(0,nn.jsxs)("button",{type:"button",onClick:()=>{return t=e.id,d(t),void n("/messages/".concat(t));var t},className:"w-full text-left px-4 py-3 border-b border-gray-100 hover:bg-gray-50 focus:outline-none ".concat(c===e.id?"bg-blue-50":""),children:[(0,nn.jsxs)("div",{className:"flex justify-between items-center mb-1",children:[(0,nn.jsx)("span",{className:"font-semibold text-gray-900 truncate",children:b(e)}),(0,nn.jsx)("span",{className:"text-xs text-gray-400 ml-2 flex-shrink-0",children:ad(e.lastMessageAt)})]}),(0,nn.jsxs)("div",{className:"flex justify-between items-center gap-2",children:[(0,nn.jsx)("p",{className:"text-sm text-gray-500 truncate",children:e.lastMessage||"No messages yet"}),s>0&&(0,nn.jsx)("span",{className:"flex-shrink-0 bg-apn-blue text-white text-xs font-semibold rounded-full px-2 py-0.5 min-w-[1.25rem] text-center",children:s>99?"99+":s})]})]},e.id)}):(0,nn.jsx)("div",{className:"p-6 text-center",children:(0,nn.jsx)("p",{className:"text-gray-500 text-sm",children:"No conversations yet. Start one from a member's profile."})})})]}),(0,nn.jsx)("div",{className:"w-full md:w-2/3 flex flex-col",children:c?(0,nn.jsxs)(nn.Fragment,{children:[(0,nn.jsx)("div",{className:"p-4 border-b border-gray-200 bg-gray-50",children:(0,nn.jsx)("h2",{className:"text-lg font-semibold text-gray-900",children:b(y)})}),(0,nn.jsxs)("div",{className:"flex-grow overflow-y-auto p-4 space-y-3 max-h-[24rem]",children:[u.length>0?u.map(e=>{const t=e.senderId===(null===r||void 0===r?void 0:r.uid);return(0,nn.jsx)("div",{className:"flex ".concat(t?"justify-end":"justify-start"),children:(0,nn.jsxs)("div",{className:"max-w-xs md:max-w-md px-4 py-2 rounded-lg ".concat(t?"bg-apn-blue text-white":"bg-gray-100 text-gray-900"),children:[(0,nn.jsx)("p",{className:"text-sm whitespace-pre-wrap break-words",children:e.text}),(0,nn.jsx)("p",{className:"text-xs mt-1 ".concat(t?"text-blue-100":"text-gray-400"),children:id(e.createdAt)})]})},e.id)}):(0,nn.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,nn.jsx)("p",{className:"text-gray-500 text-sm",children:"No messages yet. Say hello!"})}),(0,nn.jsx)("div",{ref:x})]}),(0,nn.jsx)("form",{onSubmit:v,className:"p-4 border-t border-gray-200",children:(0,nn.jsxs)("div",{className:"flex items-end gap-2",children:[(0,nn.jsx)("textarea",{value:h,onChange:e=>p(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),v(e))},placeholder:"Type a message...",rows:2,className:"flex-grow px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue resize-none"}),(0,nn.jsx)("button",{type:"submit",disabled:g||!h.trim(),className:"px-4 py-2 rounded-md text-white font-medium ".concat(g||!h.trim()?"bg-gray-300 cursor-not-allowed":"bg-apn-blue hover:bg-blue-700"),
2children:"Send"})]})})]}):(0,nn.jsx)("div",{className:"flex items-center justify-center h-full p-12",children:(0,nn.jsx)("p",{className:"text-gray-500 text-center",children:"Select a conversation to start messaging."})})})]})})})})]})},ld=[{id:"seed-project-1",isSeed:!0,title:"Sell-Side M&A Advisory \u2014 SaaS Company",client:"Confidential SaaS Founder",industry:"Technology",specialty:"Investment Banking",location:"Remote",budget:"$50,000 - $100,000",duration:"3-6 months",deadline:"2026-09-01",description:"Run a sell-side process for a ~$10M ARR vertical SaaS business: positioning, buyer outreach, and negotiation through close.",requirements:["M&A advisory experience","SaaS sector knowledge","Buyer network"],skills:["M&A","Valuation","SaaS","Deal Structuring"],contactEmail:"[email protected]",featured:!0,status:"open",postedBy:"seed",postedDate:"2026-06-11"},{id:"seed-project-2",isSeed:!0,title:"Quality of Earnings \u2014 Manufacturing Acquisition",client:"Midwest PE Firm",industry:"Manufacturing",specialty:"Accounting",location:"Chicago, IL",budget:"$25,000 - $60,000",duration:"4-8 weeks",deadline:"2026-08-15",description:"Perform buy-side quality of earnings and working-capital analysis on a $40M manufacturing target.",requirements:["Transaction services / QoE experience","CPA preferred"],skills:["Due Diligence","Quality of Earnings","Accounting","Financial Analysis"],contactEmail:"[email protected]",featured:!1,status:"open",postedBy:"seed",postedDate:"2026-06-13"},{id:"seed-project-3",isSeed:!0,title:"Fairness Opinion \u2014 Healthcare Merger",client:"Regional Health System",industry:"Healthcare",specialty:"Valuation",location:"Remote",budget:"$30,000 - $75,000",duration:"6-10 weeks",deadline:"2026-09-30",description:"Provide an independent fairness opinion for a proposed healthcare merger, including valuation analysis and board presentation.",requirements:["Valuation / fairness opinion experience","Healthcare sector knowledge"],skills:["Valuation","Fairness Opinion","Healthcare","Financial Modeling"],contactEmail:"[email protected]",featured:!1,status:"open",postedBy:"seed",postedDate:"2026-06-15"}],cd=()=>{const{currentUser:t}=sn(),[n,r]=(0,e.useState)([]),[s,a]=(0,e.useState)(!0),[i,o]=(0,e.useState)(null),[l,c]=(0,e.useState)(!1);(0,e.useEffect)(()=>{console.log("ProjectBoard component mounted, loading projects..."),d()},[]);const d=async()=>{try{a(!0),o(null),console.log("Loading projects from Firebase...");const e=await(0,wn.JQ)(20);console.log("Projects loaded successfully:",e),console.log("Number of projects:",e.length),r(e);const t=await(0,wn.l9)();c(t)}catch(i){console.error("Error loading projects:",i),o("Failed to load projects. Please try again."),r([])}finally{a(!1)}},[u,m]=(0,e.useState)(""),[h,p]=(0,e.useState)(""),[g,f]=(0,e.useState)(""),[x,b]=(0,e.useState)(""),[y,v]=(0,e.useState)(!1),[w,j]=(0,e.useState)("list"),[N,k]=(0,e.useState)(!1),[A,S]=(0,e.useState)(null),[E,C]=(0,e.useState)(1),[T]=(0,e.useState)(10),P=e=>"closed"===e.status,_=async e=>{if(t)try{await(0,wn.ay)(e,t.uid),d(),alert("Project marked as filled successfully!")}catch(i){console.error("Error marking project as filled:",i),alert("Failed to mark project as filled. Please try again.")}},I=e=>t&&(e.postedBy===t.uid||e.contactEmail===t.email),D=()=>t&&"[email protected]"===t.email,R=async(e,t)=>{if(!D())return;if(window.confirm('Are you sure you want to permanently delete the project "'.concat(t,'"? This action cannot be undone.')))try{await(0,wn.xx)(e),d(),alert("Project deleted successfully!")}catch(i){console.error("Error deleting project:",i),alert("Failed to delete project. Please try again.")}},L=[...new Set(n.map(e=>e.location))],M=[...new Set(n.map(e=>e.industry))],O=[...new Set(["Technology","Financial Services","Healthcare","Real Estate","Manufacturing","Pharmaceuticals","Venture Capital","Industrial",...M])].filter(Boolean),F=l?n:[...n,...ld],U=[...new Set(F.map(e=>e.specialty))],B=[...new Set(["Management Consultant/Advisory","Valuation","Accounting","Legal","Underwriter/Investor","Bank(IB)",...U])].filter(Boolean),z=[...F.filter(e=>{const t=(e.title||"").toLowerCase().includes(u.toLowerCase())||(e.description||"").toLowerCase().includes(u.toLowerCase())||(e.client||"").toLowerCase().includes(u.toLowerCase())||(e.skills||[]).some(e=>e.toLowerCase().includes(u.toLowerCase())),n=""===h||e.industry===h,r=""===g||e.location===g,s=""===x||e.specialty===x,a=!y||e.featured;return t&&n&&r&&s&&a})].sort((e,t)=>
2{var n,r;return((null===(n=Bn(t.postedDate))||void 0===n?void 0:n.getTime())||0)-((null===(r=Bn(e.postedDate))||void 0===r?void 0:r.getTime())||0)}),V=Math.ceil(z.length/T),q=(E-1)*T,W=q+T,H=z.slice(q,W),G=e=>{C(e),window.scrollTo({top:0,behavior:"smooth"})};return s?(0,nn.jsx)("div",{className:"flex justify-center items-center min-h-screen",children:(0,nn.jsxs)("div",{className:"text-center",children:[(0,nn.jsx)("div",{className:"animate-spin rounded-full h-12 w-12 border-t-2 border-b-2 border-apn-blue mx-auto mb-4"}),(0,nn.jsx)("p",{children:"Loading projects from Firebase..."})]})}):i?(0,nn.jsx)("div",{className:"flex justify-center items-center min-h-screen",children:(0,nn.jsxs)("div",{className:"text-center",children:[(0,nn.jsx)("p",{className:"text-red-600 mb-4",children:i}),(0,nn.jsx)("button",{onClick:d,className:"bg-apn-blue text-white px-4 py-2 rounded hover:bg-blue-700",children:"Try Again"})]})}):(0,nn.jsxs)("div",{className:"bg-white",children:[(0,nn.jsx)("div",{className:"bg-apn-blue text-white py-12",children:(0,nn.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:(0,nn.jsxs)("div",{className:"text-center",children:[(0,nn.jsx)("div",{className:"flex justify-center mb-4",children:(0,nn.jsx)("img",{src:"".concat("","/apn-logos/APN-Tag-white.jpg"),alt:"APN Logo",className:"h-16"})}),(0,nn.jsx)("h1",{className:"text-3xl font-bold",children:"Project Board"})]})})}),(0,nn.jsx)("section",{className:"py-12",children:(0,nn.jsxs)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[(0,nn.jsxs)("div",{className:"mb-8 space-y-4",children:[(0,nn.jsxs)("div",{className:"flex flex-col md:flex-row justify-between items-center gap-4",children:[(0,nn.jsx)("div",{className:"w-full md:w-1/2",children:(0,nn.jsx)("input",{type:"text",placeholder:"Search projects by title, client, or skills...",value:u,onChange:e=>m(e.target.value),className:"w-full px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue"})}),(0,nn.jsxs)("div",{className:"flex space-x-4",children:[(0,nn.jsx)("button",{onClick:()=>j("list"),className:"p-2 rounded-md ".concat("list"===w?"bg-apn-blue text-white":"bg-gray-200 text-gray-700 hover:bg-gray-300"),children:(0,nn.jsx)("svg",{className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M4 6h16M4 12h16M4 18h16"})})}),(0,nn.jsx)("button",{onClick:()=>j("grid"),className:"p-2 rounded-md ".concat("grid"===w?"bg-apn-blue text-white":"bg-gray-200 text-gray-700 hover:bg-gray-300"),children:(0,nn.jsx)("svg",{className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M4 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2V6zM14 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2V6zM4 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2v-2zM14 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2v-2z"})})})]})]}),(0,nn.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"industry-filter",className:"block text-sm font-medium text-gray-700 mb-1",children:"Filter by Industry"}),(0,nn.jsxs)("select",{id:"industry-filter",value:h,onChange:e=>p(e.target.value),className:"w-full px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue",children:[(0,nn.jsx)("option",{value:"",children:"All Industries"}),(0,nn.jsx)("option",{value:"Technology",children:"Technology"}),(0,nn.jsx)("option",{value:"Financial Services",children:"Financial Services"}),(0,nn.jsx)("option",{value:"Healthcare",children:"Healthcare"}),(0,nn.jsx)("option",{value:"Real Estate",children:"Real Estate"}),(0,nn.jsx)("option",{value:"Manufacturing",children:"Manufacturing"}),(0,nn.jsx)("option",{value:"Pharmaceuticals",children:"Pharmaceuticals"}),(0,nn.jsx)("option",{value:"Venture Capital",children:"Venture Capital"}),(0,nn.jsx)("option",{value:"Industrial",children:"Industrial"}),O.filter(e=>!["Technology","Financial Services","Healthcare","Real Estate","Manufacturing","Pharmaceuticals","Venture Capital","Industrial"].includes(e)).map((e,t)=>(0,nn.jsx)("option",{value:e,children:e},"extra-".concat(t)))]})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"location-filter",className:"block text-sm font-medium text-gray-700 mb-1",children:"Filter by Location"}),(0,nn.jsxs)("select",{id:"location-filter",value:g,onChange:e=>f(e.target.value),className:"w-full px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue",children:[(0,nn.jsx)("option",{value:"",children:"All Locations"}),L.map((e,t)=>(0,nn.jsx)("option",{value:e,children:e},t))]})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"specialty-filter",className:"block text-sm font-medium text-gray-700 mb-1",children:"Filter by Specialty"}),(0,nn.jsxs)("select",{id:"specialty-filter",value:x,onChange:e=>b(e.target.value),className:"w-full px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue",children:[(0,nn.jsx)("option",{value:"",children:"All Specialties"}),(0,nn.jsx)("option",{value:"Management Consultant/Advisory",children:"Management Consultant/Advisory"}),(0,nn.jsx)("option",{value:"Valuation",children:"Valuation"}),(0,nn.jsx)("option",{value:"Accounting",children:"Accounting"}),(0,nn.jsx)("option",{value:"Legal",children:"Legal"}),(0,nn.jsx)("option",{value:"Underwriter/Investor",children:"Underwriter/Investor"}),(0,nn.jsx)("option",{value:"Bank(IB)",children:"Bank(IB)"}),B.filter(e=>!["Management Consultant/Advisory","Valuation","Accounting","Legal","Underwriter/Investor","Bank(IB)"].includes(e)).map((e,t)=>(0,nn.jsx)("option",{value:e,children:e},"extra-".concat(t)))]})]}),(0,nn.jsx)("div",{className:"flex items-end",children:(0,nn.jsxs)("label",{className:"flex items-center",children:[(0,nn.jsx)("input",{type:"checkbox",checked:y,onChange:()=>v(!y),className:"h-4 w-4 text-apn-blue focus:ring-apn-blue border-gray-300 rounded"}),(0,nn.jsx)("span",{className:"ml-2 text-sm text-gray-700",children:"Show Featured Projects Only"})]})})]})]}),(0,nn.jsxs)("div",{className:"mb-6 flex justify-between items-center",children:[(0,nn.jsxs)("p",{className:"text-gray-600",children:["Showing ",q+1,"-",Math.min(W,z.length)," of ",z.length," projects"]}),(0,nn.jsxs)(dt,{to:"/projects/post",className:"inline-flex items-center bg-apn-blue text-white py-2 px-4 roun
2ded hover:bg-blue-700 transition duration-200",children:[(0,nn.jsx)("svg",{className:"h-5 w-5 mr-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 6v6m0 0v6m0-6h6m-6 0H6"})}),"Post a Project"]})]}),H.length>0?"list"===w?(0,nn.jsx)("div",{className:"space-y-6",children:H.map(e=>(0,nn.jsx)("div",{className:"bg-white rounded-lg shadow-lg overflow-hidden border ".concat(e.featured?"border-apn-blue":"border-gray-200"),children:(0,nn.jsxs)("div",{className:"p-6",children:[(0,nn.jsxs)("div",{className:"flex flex-col md:flex-row justify-between mb-4",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("h3",{className:"text-xl font-bold",children:e.title}),(0,nn.jsxs)("p",{className:"text-gray-600",children:[e.client," \u2022 ",e.industry," \u2022 ",e.location]}),(0,nn.jsxs)("p",{className:"text-gray-600 mt-1",children:["Specialty: ",(0,nn.jsx)("span",{className:"font-medium",children:e.specialty})]})]}),(0,nn.jsxs)("div",{className:"mt-2 md:mt-0 flex items-start",children:[e.featured&&(0,nn.jsx)("span",{className:"inline-block bg-apn-blue text-white text-xs px-2 py-1 rounded mr-2",children:"Featured"}),(0,nn.jsx)("span",{className:"inline-block bg-green-100 text-green-800 text-xs px-2 py-1 rounded",children:e.status})]})]}),(0,nn.jsx)("p",{className:"text-gray-600 mb-4",children:e.description}),(0,nn.jsxs)("div",{className:"mb-4",children:[(0,nn.jsx)("h4",{className:"font-semibold text-gray-700 mb-2",children:"Requirements:"}),(0,nn.jsx)("ul",{className:"list-disc pl-5 text-gray-600 space-y-1",children:(Array.isArray(e.requirements)?e.requirements:[]).map((e,t)=>(0,nn.jsx)("li",{children:e},t))})]}),(0,nn.jsxs)("div",{className:"mb-4",children:[(0,nn.jsx)("h4",{className:"font-semibold text-gray-700 mb-2",children:"Skills:"}),(0,nn.jsx)("div",{className:"flex flex-wrap gap-2",children:(Array.isArray(e.skills)?e.skills:[]).map((e,t)=>(0,nn.jsx)("span",{className:"inline-block bg-gray-100 text-gray-700 text-xs px-2 py-1 rounded",children:e},t))})]}),(0,nn.jsxs)("div",{className:"flex flex-col md:flex-row justify-between items-start md:items-center",children:[(0,nn.jsxs)("div",{className:"mb-4 md:mb-0 space-y-1",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("span",{className:"text-gray-700 font-semibold",children:"Budget:"})," ",(0,nn.jsx)("span",{className:"text-gray-600",children:e.budget})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("span",{className:"text-gray-700 font-semibold",children:"Duration:"})," ",(0,nn.jsx)("span",{className:"text-gray-600",children:e.duration})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("span",{className:"text-gray-700 font-semibold",children:"Deadline:"})," ",(0,nn.jsx)("span",{className:"text-gray-600",children:zn(e.deadline)})]}),(0,nn.jsxs)("p",{className:"text-gray-500 text-sm",children:["Posted on ",zn(e.postedDate)]})]}),(0,nn.jsxs)("div",{className:"flex flex-wrap gap-3",children:[P(e)?(0,nn.jsx)("div",{className:"inline-block bg-red-100 text-red-800 py-2 px-6 rounded border border-red-300",children:"No longer accepting applications"}):(0,nn.jsxs)(nn.Fragment,{children:[(0,nn.jsx)("button",{onClick:()=>{S(e),k(!0)},className:"inline-block bg-apn-blue text-white py-2 px-6 rounded hover:bg-blue-700 transition duration-200",children:"Apply Now"}),(0,nn.jsx)(dt,{to:"/projects/".concat(e.id),className:"inline-block bg-white text-apn-blue border border-apn-blue py-2 px-6 rounded hover:bg-gray-50 transition duration-200",children:"Refer Someone"})]}),I(e)&&"closed"!==e.status&&(0,nn.jsx)("button",{onClick:()=>_(e.id),className:"inline-block bg-orange-600 text-white py-2 px-6 rounded hover:bg-orange-700 transition duration-200",children:"Mark as Filled"}),D()&&(0,nn.jsx)("button",{onClick:()=>R(e.id,e.title),className:"inline-block bg-red-600 text-white py-2 px-6 rounded hover:bg-red-700 transition duration-200",children:"Delete"})]})]})]})},e.id))}):(0,nn.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:H.map(e=>(0,nn.jsxs)("div",{className:"bg-white rounded-lg shadow-lg overflow-hidden border h-full flex flex-col ".concat(e.featured?"border-apn-blue":"border-gray-200"),children:[(0,nn.jsxs)("div",{className:"p-6 flex-grow",children:[(0,nn.jsxs)("div",{className:"flex justify-between items-start mb-4",children:[(0,nn.jsx)("h3",{className:"text-lg font-bold",children:e.title}),e.featured&&(0,nn.jsx)("span",{className:"inline-block bg-apn-blue text-white text-xs px-2 py-1 rounded",children:"Featured"})]}),(0,nn.jsx)("p",{className:"text-gray-600 mb-2",children:e.client}),(0,nn.jsxs)("p",{className:"text-gray-600 mb-2",children:["Specialty: ",(0,nn.jsx)("span",{className:"font-medium",children:e.specialty})]}),(0,nn.jsxs)("div",{className:"space-y-2 mb-4",children:[(0,nn.jsxs)("div",{className:"flex items-center text-gray-600",children:[(0,nn.jsx)("svg",{className:"h-5 w-5 mr-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4"})}),(0,nn.jsx)("span",{children:e.industry})]}),(0,nn.jsxs)("div",{className:"flex items-center text-gray-600",children:[(0,nn.jsxs)("svg",{className:"h-5 w-5 mr-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:[(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"}),(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M15 11a3 3 0 11-6 0 3 3 0 016 0z"})]}),(0,nn.jsx)("span",{children:e.location})]}),(0,nn.jsxs)("div",{className:"flex items-center text-gray-600",children:[(0,nn.jsx)("svg",{className:"h-5 w-5 mr-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})}),(0,nn.jsx)("span",{children:e.duration})]}),(0,nn.jsxs)("div",{className:"flex items-center text-gray-600",children:[(0,nn.jsx)("svg",{className:"h-5 w-5 mr-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),(0,nn.jsx)("span",{children:e.budget})]})]}),(0,nn.jsx)("p",{className:"text-gray-600 mb-4 line-clamp-3",children:e.description}),(0,nn.jsxs)("div",{className:"flex flex-wrap gap-2 mb-4",children:[(Array.isArray(e.skills)?e.skills:[]).slice(0,3).map((e,t)=>(0,nn.jsx)("span",{className:"inline-block bg-gray-100 text-gray-700 text-xs px-2 py-1 rounded",children:e},t)),(e.skills||[]).length>3&&(0,nn.jsxs)("span",{className:"inline-block bg-gray-100 text-gray-700 text-xs px-2 py-1 rounded",children:["+",(e.skills||[]).length-3," more"]})]})]}),(0,nn.jsx)("div",{className:"p-6 bg-gray-50 border-t border-gray-200",children:(0,nn.jsxs)("div",{className:"flex justify-between items-center",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("span",{className:"inline-block bg-green-100 text-green-800 text-xs px-2 py-1 rounded mr-2",children:e.status}),(0,nn.jsxs)("span",{className:"text-gray-500 text-xs",children:["Deadline: ",zn(e.deadline)]})]}),(0,nn.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,nn.jsx)(dt,{to:"/projects/".concat(e.id),className:"inline-block bg-apn-blue text-white py-1 px-3 rounded text-sm hover:bg-blue-700 transition duration-200",children:"View Details"}),P(e)?(0,nn.jsx)("div",{className:"inline-block bg-red-100 text-red-800 py-1 px-3 rounded text-sm border border-red-300",children:"No longer accepting applications"}):(0,nn.jsxs)(nn.Fragment,{children:[(0,nn.jsx)("button",{onClick:()=>{S(e),k(!0)},className:"inline-block bg-green-600 text-white py-1 px-3 rounded text-sm hover:bg-green-700 transition duration-200",children:"Apply Now"}),(0,nn.jsx)(dt,{to:"/projects/".concat(e.id),className:"inline-block bg-white text-apn-blue border border-apn-blue py-1 px-3 rounded text-sm hover:bg-gray-50 transition duration-200",children:"Refer"})]}),I(e)&&"closed"!==e.status&&(0,nn.jsx)("button",{onClick:()=>_(e.id),className:"inline-block bg-orange-600 text-white py-1 px-3 rounded text-sm hover:bg-orange-700 transition duration-200",children:"Filled"}),D()&&(0,nn.jsx)("button",{onClick:()=>R(e.id,e.title),className:"inline-block bg-red-600 text-white py-1 px-3 rounded text-sm hover:bg-red-700 transition duration-200",children:"Delete"})]})]})})]},e.id))}):(0,nn.jsx)("div",{className:"text-center py-12",children:(0,nn.jsx)("p",{className:"text-xl text-gray-600",children:"No projects found matching your search criteria."})}),V>1&&(0,nn.jsx)("div",{className:"mt-12 flex justify-center",children:(0,nn.jsxs)("nav",{className:"inline-flex rounded-md shadow",children:[(0,nn.jsx)("button",{onClick:()=>{E>1&&G(E-1)},disabled:1===E,className:"px-4 py-2 rounded-l-md border border-gray-300 ".concat(1===E?"bg-gray-100 text-gray-400 cursor-not-allowed":"bg-white text-gray-700 hover:bg-gray-50"),children:"Previous"}),Array.from({length:V},(e,t)=>t+1).map(e=>(0,nn.jsx)("button",{onClick:()=>G(e),className:"px-4 py-2 border-t border-b border-gray-300 ".concat(E===e?"bg-apn-blue text-white":"bg-white text-gray-700 hover:bg-gray-50"),children:e},e)),(0,nn.jsx)("button",{onClick:()=>{E<V&&G(E+1)},disabled:E===V,className:"px-4 py-2 rounded-r-md border border-gray-300 ".concat(E===V?"bg-gray-100 text-gray-400 cursor-not-allowed":"bg-white text-gray-700 hover:bg-gray-50"),children:"Next"})]})})]})}),(0,nn.jsx)("section",{className:"bg-apn-blue text-white py-12",children:(0,nn.jsxs)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 text-center",children:[(0,nn.jsx)("div",{className:"flex justify-center mb-6",children:(0,nn.jsx)("img",{src:"".concat("","/apn-logos/APN-Tag-SQ-white.jpg"),alt:"APN Logo Square",className:"h-20"})}),(0,nn.jsx)("h2",{className:"text-3xl font-bold mb-4",children:"Need Help with a Project?"}),(0,nn.jsx)("p",{className:"text-xl mb-8 max-w-3xl mx-auto",children:"Post your project on the APN Project Board to connect with qualified finance professionals."}),(0,nn.jsx)(dt,{to:"/projects/post",className:"btn-primary bg-white text-apn-blue hover:bg-gray-100",children:"Post a Project"})]})}),N&&A&&(0,nn.jsx)(Jc,{isOpen:N,onClose:()=>{k(!1),S(null)},posting:A,type:"project"})]})},dd=()=>{var t,n,r;const{id:a}=le(),i=se(),{currentUser:o,isAdmin:l}=sn(),[c,d]=(0,e.useState)(null),[u,m]=(0,e.useState)(!0),[h,p]=(0,e.useState)(!1),[g,f]=(0,e.useState)(!1),[x,b]=(0,e.useState)(!1);(0,e.useEffect)(()=>{"true"===new URLSearchParams(i.search).get("apply")&&p(!0)},[i]);const[y,v]=(0,e.useState)({name:"",email:"",description:"",attachment:null}),[w,j]=(0,e.useState)({name:"",email:"",relationship:"",note:""}),N=(0,e.useCallback)(async()=>{try{if(m(!0),"string"===typeof a&&a.startsWith("seed-project-"))return d(ld.find(e=>e.id===a)||null),void m(!1);const e=await(0,wn.G6)(a);d(e)}catch(e){console.error("Error loading project:",e),d(null)}finally{m(!1)}},[a]);(0,e.useEffect)(()=>{N()},[N]),(0,e.useEffect)(()=>{o&&v(e=>(0,s.A)((0,s.A)({},e),{},{name:o.displayName||"",email:o.email||""}))},[o]);const k=e=>{const{name:t,value:n}=e.target;j((0,s.A)((0,s.A)({},w),{},{[t]:n}))};return u?(0,nn.jsx)("div",{className:"flex justify-center items-center min-h-screen",children:(0,nn.jsx)("div",{className:"animate-spin rounded-full h-12 w-12 border-t-2 border-b-2 border-apn-blue"})}):c?(0,nn.jsxs)("div",{className:"bg-white",children:[(0,nn.jsx)("div",{className:"bg-apn-blue text-white py-12",children:(0,nn.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:(0,nn.jsxs)("div",{className:"text-center",children:[(0,nn.jsx)("div",{className:"flex justify-center mb-4",children:(0,nn.jsx)("img",{src:"".concat("","/apn-logos/APN-Tag-white.jpg"),alt:"APN Logo",className:"h-16"})}),(0,nn.jsx)("h1",{className:"text-3xl font-bold",children:c.title}),(0,nn.jsxs)("p",{className:"mt-2 text-lg",children:[c.company||c.client,(c.industry||c.type)&&" \u2022 ".concat(c.industry||c.type),c.location&&" \u2022 ".concat(c.location)]})]})})}),(0,nn.jsx)("section",{className:"py-12",children:(0,nn.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:(0,nn.jsxs)("div",{className:"bg-white rounded-lg shadow-lg overflow-hidden",children:[(0,nn.jsx)("div",{className:"bg-gray-50 p-6 border-b border-gray-200",children:(0,nn.jsxs)("div",{className:"flex flex-col md:flex-row justify-between items-start md:items-center",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsxs)("div",{className:"flex items-center",children:[(0,nn.jsx)("h2",{className:"text-2xl font-bold text-gray-900",children:c.title}),c.featured&&(0,nn.jsx)("span",{className:"ml-2 inline-block bg-apn-blue text-white text-xs px-2 py-1 rounded",children:"Featured"})]}),(0,nn.jsxs)("p",{className:"text-gray-600 mt-1",children:[c.company||c.client,c.specialty&&" \u2022 ".concat(c.specialty),c.postedByName&&" \u2022 Posted by ".concat(c.postedByName)]})]}),(0,nn.jsxs)("div",{className:"mt-4 md:mt-0 flex space-x-4",children:[(0,nn.jsx)("button",{onClick:()=>p(!0),className:"inline-flex items-center bg-apn-blue text-white py-2 px-6 rounded hover:bg-blue-700 transition duration-200",children:"Apply Now"}),(0,nn.jsx)("button",{onClick:()=>f(!0),className:"inline-flex items-center bg-white text-apn-blue border border-apn-blue py-2 px-6 rounded hover:bg-gray-50 transition duration-200",children:"Refer Someone"})]})]})}),(0,nn.jsxs)("div",{className:"p-6",children:[(0,nn.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6 mb-8",children:[(c.location||c.type)&&(0,nn.jsxs)("div",{className:"bg-gray-50 p-4 rounded-lg",children:[(0,nn.jsx)("h3",{className:"font-semibold text-gray-900 mb-2",children:c.location?"Location":"Type"}),(0,nn.jsx)("p",{className:"text-gray-700",children:c.location||c.type})]}),c.duration&&(0,nn.jsxs)("div",{className:"bg-gray-50 p-4 rounded-lg",children:[(0,nn.jsx)("h3",{className:"font-semibold text-gray-900 mb-2",children:"Duration"}),(0,nn.jsx)("p",{className:"text-gray-700",children:c.duration})]}),c.budget&&(0,nn.jsxs)("div",{className:"bg-gray-50 p-4 rounded-lg",children:[(0,nn.jsx)("h3",{className:"font-semibold text-gray-900 mb-2",children:"Budget"}),(0,nn.jsx)("p",{className:"text-gray-700",children:c.budget})]})]}),void 0!==c.views&&(0,nn.jsxs)("p",{className:"text-sm text-gray-500 mb-4",children:[c.views," views \u2022 ",(null===(t=c.applications)||void 0===t?void 0:t.length)||0," application(s)"]}),(0,nn.jsxs)("div",{className:"mb-8",children:[(0,nn.jsx)("h3",{className:"text-xl font-semibold text-gray-900 mb-4",children:"Project Description"}),(0,nn.jsx)("p",{className:"text-gray-700 mb-4",children:c.description}),c.detailedDescription&&(0,nn.jsx)("p",{className:"text-gray-700",children:c.detailedDescription})]}),c.responsibilities&&c.responsibilities.length>0&&(0,nn.jsxs)("div",{className:"mb-8",children:[(0,nn.jsx)("h3",{className:"text-xl font-semibold text-gray-900 mb-4",children:"Responsibilities"}),(0,nn.jsx)("ul",{className:"list-disc pl-5 text-gray-700 space-y-2",children:c.responsibilities.map((e,t)=>(0,nn.jsx)("li",{children:e},t))})]}),Array.isArray(c.requirements)&&c.requirements.length>0&&(0,nn.jsxs)("div",{className:"mb-8",children:[(0,nn.jsx)("h3",{className:"text-xl font-semibold text-gray-900 mb-4",children:"Requirements"}),(0,nn.jsx)("ul",{className:"list-disc pl-5 text-gray-700 space-y-2",children:c.requirements.map((e,t)=>(0,nn.jsx)("li",{children:e},t))})]}),Array.isArray(c.skills)&&c.skills.length>0&&(0,nn.jsxs)("div",{className:"mb-8",children:[(0,nn.jsx)("h3",{className:"text-xl font-semibold text-gray-900 mb-4",children:"Skills"}),(0,nn.jsx)("div",{className:"flex flex-wrap gap-2",children:c.skills.map((e,t)=>(0,nn.jsx)("span",{className:"inline-block bg-gray-100 text-gray-700 px-3 py-1 rounded-full",children:e},t))})]}),(0,nn.jsx)("div",{className:"border-t border-gray-200 pt-6",children:(0,nn.jsxs)("div",{className:"flex flex-col md:flex-row justify-between items-start md:items-center",children:[(0,nn.jsxs)("div",{
2children:[c.postedDate&&(0,nn.jsxs)("p",{className:"text-gray-600",children:["Posted on ",null!==(n=c.postedDate)&&void 0!==n&&n.toDate?c.postedDate.toDate().toLocaleDateString():new Date(c.postedDate).toLocaleDateString()]}),c.deadline&&(0,nn.jsxs)("p",{className:"text-gray-600",children:["Application Deadline: ",null!==(r=c.deadline)&&void 0!==r&&r.toDate?c.deadline.toDate().toLocaleDateString():new Date(c.deadline).toLocaleDateString()]})]}),(0,nn.jsxs)("div",{className:"mt-4 md:mt-0 flex space-x-4",children:[(0,nn.jsx)("button",{onClick:()=>p(!0),className:"inline-flex items-center bg-apn-blue text-white py-2 px-6 rounded hover:bg-blue-700 transition duration-200",children:"Apply Now"}),(0,nn.jsx)("button",{onClick:()=>f(!0),className:"inline-flex items-center bg-white text-apn-blue border border-apn-blue py-2 px-6 rounded hover:bg-gray-50 transition duration-200",children:"Refer Someone"})]})]})}),c&&o&&(o.uid===c.postedBy||l())&&(0,nn.jsx)("div",{className:"mt-8",children:(0,nn.jsx)(nd,{postingId:a,creatorId:c.postedBy})})]})]})})}),h&&c&&(0,nn.jsx)(Jc,{isOpen:h,onClose:()=>p(!1),posting:c,type:"project"}),!1,g&&(0,nn.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center p-4 z-50",children:(0,nn.jsx)("div",{className:"bg-white rounded-lg shadow-xl max-w-2xl w-full max-h-[90vh] overflow-y-auto",children:(0,nn.jsxs)("div",{className:"p-6",children:[(0,nn.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,nn.jsx)("h2",{className:"text-xl font-bold text-gray-900",children:"Refer Someone for this Project"}),(0,nn.jsx)("button",{onClick:()=>f(!1),className:"text-gray-400 hover:text-gray-500",children:(0,nn.jsx)("svg",{className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 18L18 6M6 6l12 12"})})})]}),(0,nn.jsxs)("p",{className:"text-gray-600 mb-6",children:["You are referring someone for: ",(0,nn.jsx)("span",{className:"font-semibold",children:c.title})]}),(0,nn.jsxs)("form",{onSubmit:async e=>{e.preventDefault();try{await Xc(c,"project",null===o||void 0===o?void 0:o.uid,w),alert("Your referral has been submitted successfully!"),f(!1),j({name:"",email:"",relationship:"",note:""})}catch(t){console.error("Error submitting referral:",t),alert("Failed to submit referral. Please try again.")}},children:[(0,nn.jsxs)("div",{className:"mb-4",children:[(0,nn.jsx)("label",{htmlFor:"name",className:"block text-sm font-medium text-gray-700 mb-1",children:"Referral's Name"}),(0,nn.jsx)("input",{type:"text",id:"name",name:"name",value:w.name,onChange:k,required:!0,className:"w-full px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue",placeholder:"Full name of the person you're referring"})]}),(0,nn.jsxs)("div",{className:"mb-4",children:[(0,nn.jsx)("label",{htmlFor:"email",className:"block text-sm font-medium text-gray-700 mb-1",children:"Referral's Email"}),(0,nn.jsx)("input",{type:"email",id:"email",name:"email",value:w.email,onChange:k,required:!0,className:"w-full px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue",placeholder:"Email address of the person you're referring"})]}),(0,nn.jsxs)("div",{className:"mb-4",children:[(0,nn.jsx)("label",{htmlFor:"relationship",className:"block text-sm font-medium text-gray-700 mb-1",children:"Your Relationship"}),(0,nn.jsxs)("select",{id:"relationship",name:"relationship",value:w.relationship,onChange:k,required:!0,className:"w-full px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue",children:[(0,nn.jsx)("option",{value:"",children:"Select your relationship"}),(0,nn.jsx)("option",{value:"Colleague",children:"Colleague"}),(0,nn.jsx)("option",{value:"Classmate",children:"Classmate"}),(0,nn.jsx)("option",{value:"Friend",children:"Friend"}),(0,nn.jsx)("option",{value:"Professional Connection",children:"Professional Connection"}),(0,nn.jsx)("option",{value:"Other",children:"Other"})]})]}),(0,nn.jsxs)("div",{className:"mb-6",children:[(0,nn.jsx)("label",{htmlFor:"note",className:"block text-sm font-medium text-gray-700 mb-1",children:"Referral Note"}),(0,nn.jsx)("textarea",{id:"note",name:"note",rows:"4",value:w.note,onChange:k,required:!0,className:"w-full px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue",placeholder:"Why do you think this person would be a good fit for the project?"})]}),(0,nn.jsxs)("div",{className:"flex justify-end space-x-4",children:[(0,nn.jsx)("button",{type:"button",onClick:()=>f(!1),className:"px-4 py-2 border border-gray-300 rounded-md text-gray-700 hover:bg-gray-50",children:"Cancel"}),(0,nn.jsx)("button",{type:"submit",className:"px-4 py-2 bg-apn-blue text-white rounded-md hover:bg-blue-700",children:"Submit Referral"})]})]})]})})}),(0,nn.jsx)("section",{className:"py-12 bg-gray-50",children:(0,nn.jsxs)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[(0,nn.jsx)("div",{className:"text-center mb-8",children:(0,nn.jsx)("h2",{className:"text-2xl font-bold text-gray-900",children:"Similar Projects"})}),(0,nn.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[(0,nn.jsx)("div",{className:"bg-white rounded-lg shadow-md overflow-hidden",children:(0,nn.jsxs)("div",{className:"p-6",children:[(0,nn.jsx)("h3",{className:"font-bold text-lg mb-2",children:"Financial Due Diligence for Healthcare Acquisition"}),(0,nn.jsx)("p",{className:"text-gray-600 text-sm mb-4 line-clamp-2",children:"Conduct financial due diligence for a healthcare company acquisition with focus on revenue recognition and compliance."}),(0,nn.jsxs)("div",{className:"flex justify-between text-xs text-gray-500 mb-4",children:[(0,nn.jsx)("span",{children:"Remote"}),(0,nn.jsx)("span",{children:"3-4 weeks"})]}),(0,nn.jsx)(dt,{to:"/projects/3",className:"text-apn-blue hover:underline text-sm",children:"View Details \u2192"})]})}),(0,nn.jsx)("div",{className:"bg-white rounded-lg shadow-md overflow-hidden",children:(0,nn.jsxs)("div",{className:"p-6",children:[(0,nn.jsx)("h3",{className:"font-bold text-lg mb-2",children:"SaaS Company Valuation"}),(0,nn.jsx)("p",{className:"text-gray-600 text-sm mb-4 line-clamp-2",children:"Perform valuation of a growing SaaS company for potential acquisition by a private equity firm."}),(0,nn.jsxs)("div",{className:"flex justify-between text-xs text-gray-500 mb-4",children:[(0,nn.jsx)("span",{children:"New York, NY"}),(0,nn.jsx)("span",{children:"2-3 weeks"})]}),(0,nn.jsx)(dt,{to:"/projects/4",className:"text-apn-blue hover:underline text-sm",children:"View Details \u2192"})]})}),(0,nn.jsx)("div",{className:"bg-white rounded-lg shadow-md overflow-hidden",children:(0,nn.jsxs)("div",{className:"p-6",children:[(0,nn.jsx)("h3",{className:"font-bold text-lg mb-2",children:"Technology Sector Market Analysis"}),(0,nn.jsx)("p",{className:"text-gray-600 text-sm mb-4 line-clamp-2",children:"Conduct comprehensive market analysis of the enterprise softw
2are sector for a strategic planning initiative."}),(0,nn.jsxs)("div",{className:"flex justify-between text-xs text-gray-500 mb-4",children:[(0,nn.jsx)("span",{children:"Remote"}),(0,nn.jsx)("span",{children:"4-5 weeks"})]}),(0,nn.jsx)(dt,{to:"/projects/5",className:"text-apn-blue hover:underline text-sm",children:"View Details \u2192"})]})})]})]})}),(0,nn.jsx)("section",{className:"bg-apn-blue text-white py-12",children:(0,nn.jsxs)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 text-center",children:[(0,nn.jsx)("div",{className:"flex justify-center mb-6",children:(0,nn.jsx)("img",{src:"".concat("","/apn-logos/APN-Tag-SQ-white.jpg"),alt:"APN Logo Square",className:"h-20"})}),(0,nn.jsx)("h2",{className:"text-3xl font-bold mb-4",children:"Find More Projects"}),(0,nn.jsx)("p",{className:"text-xl mb-8 max-w-3xl mx-auto",children:"Browse our project board to find more opportunities that match your skills and expertise."}),(0,nn.jsx)(dt,{to:"/projects",className:"btn-primary bg-white text-apn-blue hover:bg-gray-100",children:"View All Projects"})]})})]}):(0,nn.jsx)("div",{className:"bg-white min-h-screen",children:(0,nn.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12",children:(0,nn.jsxs)("div",{className:"text-center",children:[(0,nn.jsx)("h1",{className:"text-3xl font-bold text-gray-900",children:"Project Not Found"}),(0,nn.jsx)("p",{className:"mt-4 text-lg text-gray-600",children:"The project you're looking for doesn't exist or has been removed."}),(0,nn.jsx)(dt,{to:"/projects",className:"mt-6 inline-block bg-apn-blue text-white py-2 px-6 rounded hover:bg-blue-700 transition duration-200",children:"Back to Project Board"})]})})})},ud=((0,na.loadStripe)("pk_live_51Kr8J3Ec8kNP7Yp7Tu6erT0Ti9b2qUuacRAPc8kfvjV7nxACrPfmoeGuU8wkIJIOptmFCoCkqW2rAPbAc35Zu2Kg00T0uBJJAv"),{BASIC:0,FEATURED:25,PREMIUM:50}),md=async function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"BASIC";try{const r=ud[n];if(0===r)return await(0,wn.createProject)(t,e);const s="https://us-central1-the-apn.cloudfunctions.net/createProjectCheckoutSession",a={userId:e,projectData:t,postingType:n,fee:r,successUrl:"".concat(window.location.origin,"/projects/payment/success"),cancelUrl:"".concat(window.location.origin,"/projects/payment/cancel")};console.log("Creating project checkout session:",a);const i=await fetch(s,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});if(!i.ok){let e="Failed to create checkout session";try{e=(await i.json()).error||e}catch(Nd){e="Payment service error (".concat(i.status,")")}throw new Error(e)}const o=await i.json();return console.log("Checkout session created:",o),o}catch(r){throw console.error("Error creating project checkout session:",r),r}},hd=async function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"BASIC";try{const r=ud[n];if(0===r)return await(0,wn.createProject)(t,e);const s="https://us-central1-the-apn.cloudfunctions.net/createProjectPayPalOrder",a={userId:e,projectData:t,postingType:n,fee:r,successUrl:"".concat(window.location.origin,"/projects/payment/success"),cancelUrl:"".concat(window.location.origin,"/projects/payment/cancel")};console.log("Creating project PayPal order:",a);const i=await fetch(s,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});if(!i.ok){let e="Failed to create PayPal order";try{e=(await i.json()).error||e}catch(Nd){e="PayPal service error (".concat(i.status,")")}throw new Error(e)}const o=await i.json();return console.log("PayPal order created:",o),o}catch(r){throw console.error("Error creating project PayPal order:",r),r}},pd=function(){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?ud.PREMIUM:arguments.length>0&&void 0!==arguments[0]&&arguments[0]?ud.FEATURED:ud.BASIC},gd=t=>{let{isOpen:r,onClose:s,projectData:a,postingType:i,onSuccess:o}=t;const{currentUser:l}=sn(),[c,d]=(0,e.useState)(!1),[u,m]=(0,e.useState)(""),[h,p]=(0,e.useState)("stripe"),g=ud[i]||0;return r?(0,nn.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:(0,nn.jsxs)("div",{className:"bg-white rounded-lg p-6 max-w-md w-full mx-4",children:[(0,nn.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,nn.jsx)("h3",{className:"text-lg font-semibold text-gray-900",children:0===g?"Confirm Project Posting":"Project Posting Payment"}),(0,nn.jsx)("button",{onClick:s,className:"text-gray-400 hover:text-gray-600",disabled:c,
2children:(0,nn.jsx)("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 18L18 6M6 6l12 12"})})})]}),(0,nn.jsxs)("div",{className:"mb-4",children:[(0,nn.jsx)("h4",{className:"font-medium text-gray-900 mb-2",children:a.title}),(0,nn.jsxs)("div",{className:"text-sm text-gray-600 space-y-1",children:[(0,nn.jsxs)("p",{children:[(0,nn.jsx)("span",{className:"font-medium",children:"Posting Type:"})," ","FEATURED"===i?"Featured":"Basic"]}),(0,nn.jsxs)("p",{children:[(0,nn.jsx)("span",{className:"font-medium",children:"Fee:"})," ",0===g?"Free":"$".concat(g)]}),"FEATURED"===i&&(0,nn.jsx)("p",{className:"text-blue-600 text-xs",children:"\u2728 Featured projects appear at the top of the project board and receive more visibility"})]})]}),u&&(0,nn.jsx)("div",{className:"mb-4 p-3 bg-red-100 border border-red-400 text-red-700 rounded",children:u}),(0,nn.jsxs)("form",{onSubmit:async e=>{if(e.preventDefault(),0!==g)"stripe"===h?await(async()=>{if(l){d(!0),m("");try{const e=await md(l.uid,a,i);e.url?window.location.href=e.url:e.id&&(o(e.id),s())}catch(u){console.error("Stripe payment error:",u),m("Payment failed: ".concat(u.message))}finally{d(!1)}}else m("Please log in to continue with payment.")})():"paypal"===h&&await(async()=>{if(l){d(!0),m("");try{const t=await hd(l.uid,a,i);if(t.links){var e;const n=null===(e=t.links.find(e=>"approve"===e.rel))||void 0===e?void 0:e.href;if(!n)throw new Error("PayPal approval URL not found");window.location.href=n}else t.id&&(o(t.id),s())}catch(u){console.error("PayPal payment error:",u),m("PayPal payment failed: ".concat(u.message))}finally{d(!1)}}else m("Please log in to continue with payment.")})();else try{d(!0);const{createProject:e}=await Promise.resolve().then(n.bind(n,193)),t=await e(a,l.uid);o(t),s()}catch(u){m("Failed to create project: ".concat(u.message))}finally{d(!1)}},children:[g>0&&(0,nn.jsxs)("div",{className:"mb-4",children:[(0,nn.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Payment Method"}),(0,nn.jsxs)("div",{className:"space-y-2",children:[(0,nn.jsxs)("label",{className:"flex items-center",children:[(0,nn.jsx)("input",{type:"radio",name:"paymentMethod",value:"stripe",checked:"stripe"===h,onChange:e=>p(e.target.value),className:"mr-2"}),(0,nn.jsx)("span",{className:"text-sm",children:"Credit/Debit Card (Stripe)"})]}),(0,nn.jsxs)("label",{className:"flex items-center",children:[(0,nn.jsx)("input",{type:"radio",name:"paymentMethod",value:"paypal",checked:"paypal"===h,onChange:e=>p(e.target.value),className:"mr-2"}),(0,nn.jsx)("span",{className:"text-sm",children:"PayPal"})]})]})]}),(0,nn.jsxs)("div",{className:"flex space-x-3",children:[(0,nn.jsx)("button",{type:"button",onClick:s,className:"flex-1 px-4 py-2 border border-gray-300 rounded-md text-gray-700 hover:bg-gray-50",disabled:c,children:"Cancel"}),(0,nn.jsx)("button",{type:"submit",className:"flex-1 px-4 py-2 bg-apn-blue text-white rounded-md hover:bg-blue-700 disabled:opacity-50",disabled:c,children:c?"Processing...":0===g?"Post Project":"Pay $".concat(g)})]})]})]})}):null},fd=()=>{const t=oe(),{currentUser:n}=sn(),[r,a]=(0,e.useState)(!1),[i,o]=(0,e.useState)({title:"",client:"",industry:"",location:"",specialty:"",duration:"",budgetMin:"",budgetMax:"",description:"",requirements:[""],skills:[""],deadline:"",featured:!1}),[l,c]=(0,e.useState)({}),[d,u]=(0,e.useState)(!1),[m,h]=(0,e.useState)(null),p=e=>{const{name:t,value:n,type:r,checked:a}=e.target;o((0,s.A)((0,s.A)({},i),{},{[t]:"checkbox"===r?a:n})),l[t]&&c((0,s.A)((0,s.A)({},l),{},{[t]:null}))},g=pd(i.featured),f=i.featured?"FEATURED":"BASIC";return(0,nn.jsxs)("div",{className:"bg-white",children:[(0,nn.jsx)("div",{className:"bg-apn-blue text-white py-12",children:(0,nn.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:(0,nn.jsxs)("div",{className:"text-center",children:[(0,nn.jsx)("div",{className:"flex justify-center mb-4",children:(0,nn.jsx)("img",{src:"".concat("","/apn-logos/APN-Tag-white.jpg"),alt:"APN Logo",className:"h-16"})}),(0,nn.jsx)("h1",{className:"text-3xl font-bold",children:"Post a Project"})]})})}),(0,nn.jsx)("section",{className:"py-12",children:(0,nn.jsx)("div",{className:"max-w-3xl mx-auto px-4 sm:px-6 lg:px-8",children:(0,nn.jsx)("div",{className:"bg-white rounded-lg shadow-lg overflow-hidden border border-gray-200 p-6",children:(0,nn.jsxs)("form",{onSubmit:e=>{if(e.preventDefault(),n)if((()=>{const e={};return i.title.trim()||(e.title="Project title is required"),i.client.trim()||(e.client="Client name is required"),i.industry||(e.industry="Industry is required"),i.location.trim()||(e.location="Location is required"),i.specialty||(e.specialty="Specialty is required"),i.duration.trim()||(e.duration="Duration is required"),i.description.trim()||(e.description="Description is required"),i.deadline||(e.deadline="Deadline is required"),(i.budgetMin.trim()||i.budgetMax.trim())&&(i.budgetMin.trim()&&i.budgetMax.trim()?parseInt(i.budgetMin)>=parseInt(i.budgetMax)&&(e.budget="Maximum budget must be greater than minimum budget"):e.budget="Please fill in both min and max if providing a budget range"),0===i.requirements.filter(e=>""!==e.trim()).length&&(e.requirements="At least one requirement is required"),0===i.skills.filter(e=>""!==e.trim()).length&&(e.skills="At least one skill is required"),
2c(e),0===Object.keys(e).length})()){const e=(0,s.A)((0,s.A)({},i),{},{budget:i.budgetMin.trim()&&i.budgetMax.trim()?"$".concat(i.budgetMin.trim()," - $").concat(i.budgetMax.trim()):"",budgetRange:i.budgetMin.trim()&&i.budgetMax.trim()?"".concat(i.budgetMin.trim(),"-").concat(i.budgetMax.trim()):"",requirements:i.requirements.filter(e=>""!==e.trim()),skills:i.skills.filter(e=>""!==e.trim()),postedDate:(new Date).toISOString().split("T")[0],status:"active",featured:i.featured,timeline:i.duration,projectType:"One-time",urgency:"Medium",contactEmail:n.email});h(e),u(!0)}else{const e=Object.keys(l)[0],t=document.getElementById(e);t&&t.scrollIntoView({behavior:"smooth",block:"center"})}else alert("Please log in to post a project.")},children:[(0,nn.jsxs)("div",{className:"mb-6",children:[(0,nn.jsx)("label",{htmlFor:"title",className:"block text-sm font-medium text-gray-700 mb-2",children:"Project Title *"}),(0,nn.jsx)("input",{type:"text",id:"title",name:"title",value:i.title,onChange:p,className:"w-full px-4 py-2 border rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue ".concat(l.title?"border-red-500":"border-gray-300"),placeholder:"e.g., M&A Due Diligence for Tech Acquisition"}),l.title&&(0,nn.jsx)("p",{className:"mt-1 text-sm text-red-500",children:l.title})]}),(0,nn.jsxs)("div",{className:"mb-6",children:[(0,nn.jsx)("label",{htmlFor:"client",className:"block text-sm font-medium text-gray-700 mb-2",children:"Client Name *"}),(0,nn.jsx)("input",{type:"text",id:"client",name:"client",value:i.client,onChange:p,className:"w-full px-4 py-2 border rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue ".concat(l.client?"border-red-500":"border-gray-300"),placeholder:"e.g., Confidential or Company Name"}),l.client&&(0,nn.jsx)("p",{className:"mt-1 text-sm text-red-500",children:l.client})]}),(0,nn.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 mb-6",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"industry",className:"block text-sm font-medium text-gray-700 mb-2",children:"Industry *"}),(0,nn.jsxs)("select",{id:"industry",name:"industry",value:i.industry,onChange:p,className:"w-full px-4 py-2 border rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue ".concat(l.industry?"border-red-500":"border-gray-300"),children:[(0,nn.jsx)("option",{value:"",children:"Select Industry"}),["Technology","Healthcare","Financial Services","Manufacturing","Retail","Energy","Real Estate","Consumer Goods","Media & Entertainment","Transportation & Logistics","Other"].map((e,t)=>(0,nn.jsx)("option",{value:e,children:e},t))]}),l.industry&&(0,nn.jsx)("p",{className:"mt-1 text-sm text-red-500",children:l.industry})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"location",className:"block text-sm font-medium text-gray-700 mb-2",children:"Location *"}),(0,nn.jsx)("input",{type:"text",id:"location",name:"location",value:i.location,onChange:p,className:"w-full px-4 py-2 border rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue ".concat(l.location?"border-red-500":"border-gray-300"),placeholder:"e.g., Remote or New York, NY"}),l.location&&(0,nn.jsx)("p",{className:"mt-1 text-sm text-red-500",children:l.location})]})]}),(0,nn.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 mb-6",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"specialty",className:"block text-sm font-medium text-gray-700 mb-2",children:"Specialty *"}),(0,nn.jsxs)("select",{id:"specialty",name:"specialty",value:i.specialty,onChange:p,className:"w-full px-4 py-2 border rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue ".concat(l.specialty?"border-red-500":"border-gray-300"),children:[(0,nn.jsx)("option",{value:"",children:"Select Specialty"}),["Investment Banking","Private Equity","Venture Capital","Management Consultant/Advisory","Accounting","Valuation","Legal","Tax","Other"].map((e,t)=>(0,nn.jsx)("option",{value:e,children:e},t))]}),l.specialty&&(0,nn.jsx)("p",{className:"mt-1 text-sm text-red-500",children:l.specialty})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"duration",className:"block text-sm font-medium text-gray-700 mb-2",children:"Duration *"}),(0,nn.jsx)("input",{type:"text",id:"duration",name:"duration",value:i.duration,onChange:p,className:"w-full px-4 py-2 border rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue ".concat(l.duration?"border-red-500":"border-gray-300"),placeholder:"e.g., 4-6 weeks"}),l.duration&&(0,nn.jsx)("p",{className:"mt-1 text-sm text-red-500",children:l.duration})]})]}),(0,nn.jsxs)("div",{className:"mb-6",children:[(0,nn.jsxs)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:["Budget Range (USD) ",(0,nn.jsx)("span",{className:"text-gray-400 font-normal",children:"(optional)"})]}),(0,nn.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,nn.jsxs)("div",{className:"relative flex-1",children:[(0,nn.jsx)("span",{className:"absolute inset-y-0 left-0 flex items-center pl-3 text-gray-500",children:"$"}),(0,nn.jsx)("input",{type:"number",id:"budgetMin",name:"budgetMin",value:i.budgetMin,onChange:p,className:"w-full pl-8 pr-4 py-2 border rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue ".concat(l.budget?"border-red-500":"border-gray-300"),placeholder:"Min",min:"0"})]}),(0,nn.jsx)("span",{className:"text-gray-500",children:"to"}),(0,nn.jsxs)("div",{className:"relative flex-1",children:[(0,nn.jsx)("span",{className:"absolute inset-y-0 left-0 flex items-center pl-3 text-gray-500",children:"$"}),(0,nn.jsx)("input",{type:"number",id:"budgetMax",name:"budgetMax",value:i.budgetMax,onChange:p,className:"w-full pl-8 pr-4 py-2 border rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue ".concat(l.budget?"border-red-500":"border-gray-300"),placeholder:"Max",min:"0"})]})]}),l.budget&&(0,nn.jsx)("p",{className:"mt-1 text-sm text-red-500",children:l.budget})]}),(0,nn.jsxs)("div",{className:"mb-6",children:[(0,nn.jsx)("label",{htmlFor:"description",className:"block text-sm font-medium text-gray-700 mb-2",children:"Project Description *"}),(0,nn.jsx)("textarea",{id:"description",name:"description",value:i.description,onChange:p,rows:"5",className:"w-full px-4 py-2 border rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue ".concat(l.description?"border-red-500":"border-gray-300"),placeholder:"Provide a detailed description of the project..."}),l.description&&(0,nn.jsx)("p",{className:"mt-1 text-sm text-red-500",children:l.description})]}),(0,nn.jsxs)("div",{className:"mb-6",children:[(0,nn.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Requirements *"}),i.requirements.map((e,t)=>(0,nn.jsxs)("div",{className:"flex items-center mb-2",children:[(0,nn.jsx)("input",{type:"text",value:e,onCh
2ange:e=>((e,t)=>{const n=[...i.requirements];n[e]=t,o((0,s.A)((0,s.A)({},i),{},{requirements:n}))})(t,e.target.value),className:"flex-1 px-4 py-2 border rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue ".concat(l.requirements?"border-red-500":"border-gray-300"),placeholder:"Requirement ".concat(t+1)}),(0,nn.jsx)("button",{type:"button",onClick:()=>(e=>{const t=[...i.requirements];t.splice(e,1),o((0,s.A)((0,s.A)({},i),{},{requirements:t}))})(t),className:"ml-2 text-red-500 hover:text-red-700",disabled:1===i.requirements.length,children:(0,nn.jsx)("svg",{className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})]},t)),(0,nn.jsxs)("button",{type:"button",onClick:()=>{o((0,s.A)((0,s.A)({},i),{},{requirements:[...i.requirements,""]}))},className:"mt-2 text-apn-blue hover:text-blue-700 flex items-center",children:[(0,nn.jsx)("svg",{className:"h-5 w-5 mr-1",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 6v6m0 0v6m0-6h6m-6 0H6"})}),"Add Requirement"]}),l.requirements&&(0,nn.jsx)("p",{className:"mt-1 text-sm text-red-500",children:l.requirements})]}),(0,nn.jsxs)("div",{className:"mb-6",children:[(0,nn.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Required Skills *"}),i.skills.map((e,t)=>(0,nn.jsxs)("div",{className:"flex items-center mb-2",children:[(0,nn.jsx)("input",{type:"text",value:e,onChange:e=>((e,t)=>{const n=[...i.skills];n[e]=t,o((0,s.A)((0,s.A)({},i),{},{skills:n}))})(t,e.target.value),className:"flex-1 px-4 py-2 border rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue ".concat(l.skills?"border-red-500":"border-gray-300"),placeholder:"Skill ".concat(t+1)}),(0,nn.jsx)("button",{type:"button",onClick:()=>(e=>{const t=[...i.skills];t.splice(e,1),o((0,s.A)((0,s.A)({},i),{},{skills:t}))})(t),className:"ml-2 text-red-500 hover:text-red-700",disabled:1===i.skills.length,children:(0,nn.jsx)("svg",{className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})]},t)),(0,nn.jsxs)("button",{type:"button",onClick:()=>{o((0,s.A)((0,s.A)({},i),{},{skills:[...i.skills,""]}))},className:"mt-2 text-apn-blue hover:text-blue-700 flex items-center",children:[(0,nn.jsx)("svg",{className:"h-5 w-5 mr-1",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 6v6m0 0v6m0-6h6m-6 0H6"})}),"Add Skill"]}),l.skills&&(0,nn.jsx)("p",{className:"mt-1 text-sm text-red-500",children:l.skills})]}),(0,nn.jsxs)("div",{className:"mb-6",children:[(0,nn.jsx)("label",{htmlFor:"deadline",className:"block text-sm font-medium text-gray-700 mb-2",children:"Application Deadline *"}),(0,nn.jsx)("input",{type:"date",id:"deadline",name:"deadline",value:i.deadline,onChange:p,className:"w-full px-4 py-2 border rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue ".concat(l.deadline?"border-red-500":"border-gray-300"),min:(new Date).toISOString().split("T")[0]}),l.deadline&&(0,nn.jsx)("p",{className:"mt-1 text-sm text-red-500",children:l.deadline})]}),(0,nn.jsxs)("div",{className:"mb-6",children:[(0,nn.jsxs)("div",{className:"flex items-center",children:[(0,nn.jsx)("input",{type:"checkbox",id:"featured",name:"featured",checked:i.featured,onChange:p,className:"h-4 w-4 text-apn-blue focus:ring-apn-blue border-gray-300 rounded"}),(0,nn.jsxs)("label",{htmlFor:"featured",className:"ml-2 block text-sm text-gray-700",children:["Feature this project ",g>0&&"(+$".concat(g,")")]})]}),(0,nn.jsxs)("p",{className:"mt-1 text-sm text-gray-500",children:["Featured projects appear at the top of the project board and receive more visibility.",g>0&&" Additional fee: $".concat(g)]})]}),(0,nn.jsxs)("div",{className:"flex justify-end space-x-4",children:[(0,nn.jsx)(dt,{to:"/projects",className:"px-6 py-2 border border-gray-300 rounded-md text-gray-700 hover:bg-gray-50",children:"Cancel"}),(0,nn.jsx)("button",{type:"submit",className:"px-6 py-2 bg-apn-blue text-white rounded-md hover:bg-blue-700 transition duration-200",children:g>0?"Post Project ($".concat(g,")"):"Post Project (Free)"})]})]})})})}),d&&m&&(0,nn.jsx)(gd,{isOpen:d,onClose:()=>u(!1),projectData:m,postingType:f,onSuccess:async e=>{a(!0);try{console.log("Creating project with data:",e);const r=await(0,wn.createProject)(e,n.uid);console.log("Project created with ID:",r),alert("Project posted successfully!"),t("/projects/".concat(r))}catch(r){console.error("Error creating project:",r),alert("Failed to create project posting. Please try again.")}finally{a(!1)}}})]})},xd=()=>{const t=oe(),{currentUser:n}=sn(),[r,a]=(0,e.useState)(!1),[i,o]=(0,e.useState)({title:"",company:"",location:"",type:"",salaryMin:"",salaryMax:"",description:"",requirements:[""],postedDate:(new Date).toISOString().split("T")[0],applicationDeadline:"",contactEmail:"",contactPhone:"",featured:!1}),[l,c]=(0,e.useState)({}),d=e=>{const{name:t,value:n,type:r,checked:a}=e.target;o((0,s.A)((0,s.A)({},i),{},{[t]:"checkbox"===r?a:n})),l[t]&&c((0,s.A)((0,s.A)({},l),{},{[t]:null}))};return(0,nn.jsxs)("div",{className:"bg-white",children:[(0,nn.jsx)("div",{className:"bg-apn-blue text-white py-12",children:(0,nn.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:(0,nn.jsxs)("div",{className:"text-center",children:[(0,nn.jsx)("div",{className:"flex justify-center mb-4",children:(0,nn.jsx)("img",{src:"".concat("","/apn-logos/APN-Tag-white.jpg"),alt:"APN Logo",className:"h-16"})}),(0,nn.jsx)("h1",{className:"text-3xl font-bold",children:"Post a Job"})]})})}),(0,nn.jsx)("section",{className:"py-12",children:(0,nn.jsx)("div",{className:"max-w-3xl mx-auto px-4 sm:px-6 lg:px-8",children:(0,nn.jsx)("div",{className:"bg-white rounded-lg shadow-lg overflow-hidden border border-gray-200 p-6",children:(0,nn.jsxs)("form",{onSubmit:async e=>{if(e.preventDefault(),n)if((()=>{const e={};i.title.trim()||(e.title="Job title is required"),i.company.trim()||(e.company="Company name is required"),i.location.trim()||(e.location="Location is required"),i.type||(e.type="Job type is required"),i.description.trim()||(e.description="Job description is required"),i.contactEmail.trim()||(e.contactEmail="Contact email is required"),i.contactEmail.trim()&&!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(i.contactEmail)&&(e.contactEmail="Please enter a valid email address"),i.contactPhone.trim()&&!/^[0-9+\-() ]{10,20}$/.test(i.contactPhone)&&(e.contactPhone="Please enter a valid phone number"),!i.salaryMin.trim()&&i.salary
2Max.trim()||i.salaryMin.trim()&&!i.salaryMax.trim()?e.salary="Please provide both minimum and maximum salary or leave both empty":i.salaryMin.trim()&&i.salaryMax.trim()&&parseInt(i.salaryMin)>=parseInt(i.salaryMax)&&(e.salary="Maximum salary must be greater than minimum salary"),0===i.requirements.filter(e=>""!==e.trim()).length&&(e.requirements="At least one requirement is required"),i.applicationDeadline&&new Date(i.applicationDeadline)<=new Date&&(e.applicationDeadline="Application deadline must be in the future");return c(e),0===Object.keys(e).length})()){a(!0);try{const e={title:i.title,company:i.company,location:i.location,type:i.type,description:i.description,salary:i.salaryMin&&i.salaryMax?"$".concat(i.salaryMin.trim()," - $").concat(i.salaryMax.trim()):"Not specified",requirements:i.requirements.filter(e=>""!==e.trim()),applicationDeadline:i.applicationDeadline?new Date(i.applicationDeadline):null,contactEmail:i.contactEmail||n.email};console.log("Creating job with data:",e);const r=await(0,wn._S)(e,n.uid);console.log("Job created with ID:",r),alert("Job posted successfully!"),t("/jobs/".concat(r))}catch(r){console.error("Error creating job:",r),alert("Failed to create job posting. Please try again.")}finally{a(!1)}}else{const e=Object.keys(l)[0],t=document.getElementById(e);t&&t.scrollIntoView({behavior:"smooth",block:"center"})}else alert("Please log in to post a job.")},children:[(0,nn.jsxs)("div",{className:"mb-6",children:[(0,nn.jsx)("label",{htmlFor:"title",className:"block text-sm font-medium text-gray-700 mb-2",children:"Job Title *"}),(0,nn.jsx)("input",{type:"text",id:"title",name:"title",value:i.title,onChange:d,className:"w-full px-4 py-2 border rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue ".concat(l.title?"border-red-500":"border-gray-300"),placeholder:"e.g., Investment Banking Associate"}),l.title&&(0,nn.jsx)("p",{className:"mt-1 text-sm text-red-500",children:l.title})]}),(0,nn.jsxs)("div",{className:"mb-6",children:[(0,nn.jsx)("label",{htmlFor:"company",className:"block text-sm font-medium text-gray-700 mb-2",children:"Company Name *"}),(0,nn.jsx)("input",{type:"text",id:"company",name:"company",value:i.company,onChange:d,className:"w-full px-4 py-2 border rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue ".concat(l.company?"border-red-500":"border-gray-300"),placeholder:"e.g., Goldman Sachs"}),l.company&&(0,nn.jsx)("p",{className:"mt-1 text-sm text-red-500",children:l.company})]}),(0,nn.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 mb-6",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"location",className:"block text-sm font-medium text-gray-700 mb-2",children:"Location *"}),(0,nn.jsx)("input",{type:"text",id:"location",name:"location",value:i.location,onChange:d,className:"w-full px-4 py-2 border rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue ".concat(l.location?"border-red-500":"border-gray-300"),placeholder:"e.g., New York, NY or Remote"}),l.location&&(0,nn.jsx)("p",{className:"mt-1 text-sm text-red-500",children:l.location})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"type",className:"block text-sm font-medium text-gray-700 mb-2",children:"Job Type *"}),(0,nn.jsxs)("select",{id:"type",name:"type",value:i.type,onChange:d,className:"w-full px-4 py-2 border rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue ".concat(l.type?"border-red-500":"border-gray-300"),children:[(0,nn.jsx)("option",{value:"",children:"Select Job Type"}),["Full-time","Part-time","Contract","Temporary","Internship","Remote"].map((e,t)=>(0,nn.jsx)("option",{value:e,children:e},t))]}),l.type&&(0,nn.jsx)("p",{className:"mt-1 text-sm text-red-500",children:l.type})]})]}),(0,nn.jsxs)("div",{className:"mb-6",children:[(0,nn.jsxs)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:["Salary Range (USD) ",(0,nn.jsx)("span",{className:"text-gray-500 text-xs",children:"(Optional)"})]}),(0,nn.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,nn.jsxs)("div",{className:"relative flex-1",children:[(0,nn.jsx)("span",{className:"absolute inset-y-0 left-0 flex items-center pl-3 text-gray-500",children:"$"}
2),(0,nn.jsx)("input",{type:"number",id:"salaryMin",name:"salaryMin",value:i.salaryMin,onChange:d,className:"w-full pl-8 pr-4 py-2 border rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue ".concat(l.salary?"border-red-500":"border-gray-300"),placeholder:"Min",min:"0"})]}),(0,nn.jsx)("span",{className:"text-gray-500",children:"to"}),(0,nn.jsxs)("div",{className:"relative flex-1",children:[(0,nn.jsx)("span",{className:"absolute inset-y-0 left-0 flex items-center pl-3 text-gray-500",children:"$"}),(0,nn.jsx)("input",{type:"number",id:"salaryMax",name:"salaryMax",value:i.salaryMax,onChange:d,className:"w-full pl-8 pr-4 py-2 border rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue ".concat(l.salary?"border-red-500":"border-gray-300"),placeholder:"Max",min:"0"})]})]}),l.salary&&(0,nn.jsx)("p",{className:"mt-1 text-sm text-red-500",children:l.salary}),(0,nn.jsx)("p",{className:"mt-1 text-sm text-gray-500",children:"Leave blank if you prefer not to disclose the salary range."})]}),(0,nn.jsxs)("div",{className:"mb-6",children:[(0,nn.jsx)("label",{htmlFor:"description",className:"block text-sm font-medium text-gray-700 mb-2",children:"Job Description *"}),(0,nn.jsx)("textarea",{id:"description",name:"description",value:i.description,onChange:d,rows:"5",className:"w-full px-4 py-2 border rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue ".concat(l.description?"border-red-500":"border-gray-300"),placeholder:"Provide a detailed description of the job role, responsibilities, and company information..."}),l.description&&(0,nn.jsx)("p",{className:"mt-1 text-sm text-red-500",children:l.description})]}),(0,nn.jsxs)("div",{className:"mb-6",children:[(0,nn.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Requirements *"}),i.requirements.map((e,t)=>(0,nn.jsxs)("div",{className:"flex items-center mb-2",children:[(0,nn.jsx)("input",{type:"text",value:e,onChange:e=>((e,t)=>{const n=[...i.requirements];n[e]=t,o((0,s.A)((0,s.A)({},i),{},{requirements:n}))})(t,e.target.value),className:"flex-1 px-4 py-2 border rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue ".concat(l.requirements?"border-red-500":"border-gray-300"),placeholder:"Requirement ".concat(t+1)}),(0,nn.jsx)("button",{type:"button",onClick:()=>(e=>{const t=[...i.requirements];t.splice(e,1),o((0,s.A)((0,s.A)({},i),{},{requirements:t}))})(t),className:"ml-2 text-red-500 hover:text-red-700",disabled:1===i.requirements.length,children:(0,nn.jsx)("svg",{className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})]},t)),(0,nn.jsxs)("button",{type:"button",onClick:()=>{o((0,s.A)((0,s.A)({},i),{},{requirements:[...i.requirements,""]}))},className:"mt-2 text-apn-blue hover:text-blue-700 flex items-center",children:[(0,nn.jsx)("svg",{className:"h-5 w-5 mr-1",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 6v6m0 0v6m0-6h6m-6 0H6"})}),"Add Requirement"]}),l.requirements&&(0,nn.jsx)("p",{className:"mt-1 text-sm text-red-500",children:l.requirements})]}),(0,nn.jsxs)("div",{className:"mb-6",children:[(0,nn.jsxs)("label",{htmlFor:"applicationDeadline",className:"block text-sm font-medium text-gray-700 mb-2",children:["Application Deadline ",(0,nn.jsx)("span",{className:"text-gray-500 text-xs",children:"(Optional)"})]}),(0,nn.jsx)("input",{type:"date",id:"applicationDeadline",name:"applicationDeadline",value:i.applicationDeadline,onChange:d,className:"w-full px-4 py-2 border rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue ".concat(l.applicationDeadline?"border-red-500":"border-gray-300"),min:(new Date).toISOString().split("T")[0]}),l.applicationDeadline&&(0,nn.jsx)("p",{className:"mt-1 text-sm text-red-500",children:l.applicationDeadline})]}),(0,nn.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 mb-6",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"contactEmail",className:"block text-sm font-medium text-gray-700 mb-2",children:"Contact Email *"}
2),(0,nn.jsx)("input",{type:"email",id:"contactEmail",name:"contactEmail",value:i.contactEmail,onChange:d,className:"w-full px-4 py-2 border rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue ".concat(l.contactEmail?"border-red-500":"border-gray-300"),placeholder:"e.g., [email protected]"}),l.contactEmail&&(0,nn.jsx)("p",{className:"mt-1 text-sm text-red-500",children:l.contactEmail})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsxs)("label",{htmlFor:"contactPhone",className:"block text-sm font-medium text-gray-700 mb-2",children:["Contact Phone ",(0,nn.jsx)("span",{className:"text-gray-500 text-xs",children:"(Optional)"})]}),(0,nn.jsx)("input",{type:"tel",id:"contactPhone",name:"contactPhone",value:i.contactPhone,onChange:d,className:"w-full px-4 py-2 border rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue ".concat(l.contactPhone?"border-red-500":"border-gray-300"),placeholder:"e.g., (123) 456-7890"}),l.contactPhone&&(0,nn.jsx)("p",{className:"mt-1 text-sm text-red-500",children:l.contactPhone})]})]}),(0,nn.jsxs)("div",{className:"mb-6",children:[(0,nn.jsxs)("div",{className:"flex items-center",children:[(0,nn.jsx)("input",{type:"checkbox",id:"featured",name:"featured",checked:i.featured,onChange:d,className:"h-4 w-4 text-apn-blue focus:ring-apn-blue border-gray-300 rounded"}),(0,nn.jsx)("label",{htmlFor:"featured",className:"ml-2 block text-sm text-gray-700",children:"Feature this job (additional fee may apply)"})]}),(0,nn.jsx)("p",{className:"mt-1 text-sm text-gray-500",children:"Featured jobs appear at the top of the job board and receive more visibility."})]}),(0,nn.jsxs)("div",{className:"flex justify-end space-x-4",children:[(0,nn.jsx)(dt,{to:"/jobs",className:"px-6 py-2 border border-gray-300 rounded-md text-gray-700 hover:bg-gray-50",children:"Cancel"}),(0,nn.jsx)("button",{type:"submit",className:"px-6 py-2 bg-apn-blue text-white rounded-md hover:bg-blue-700 transition duration-200",children:"Post Job"})]})]})})})})]})},bd=()=>{var t;const{userProfile:n,currentUser:r,loading:a,updateUserProfile:i}=sn(),[o,l]=(0,e.useState)({firstName:"",lastName:"",email:"",secondaryEmail:"",title:"",roleDescription:"",company:"",companyCategory:"",companyDescription:"",city:"",state:"",workPhone:"",cellPhone:"",memberTier:"",memberSince:"",chapter:"",role:"",roleStartDate:"",isFoundingMember:!1,isVipMember:!1,bio:"",linkedIn:"",profilePhoto:"",groups:[],eventsRegistered:[],showEvents:!0,network:[],education:[],experience:[]}),[c,d]=(0,e.useState)(!1),[u,m]=(0,e.useState)(o),[h,p]=(0,e.useState)(null),[g,f]=(0,e.useState)([]),[x,b]=(0,e.useState)(!1);(0,e.useEffect)(()=>{n&&l({firstName:n.firstName||"",lastName:n.lastName||"",email:n.email||"",secondaryEmail:n.secondaryEmail||"",title:n.jobTitle||"",roleDescription:n.roleDescription||"",company:n.company||"",companyCategory:n.companyCategory||"",companyDescription:n.companyDescription||"",city:n.city||"",state:n.state||"",workPhone:n.workPhone||n.phone||"",cellPhone:n.cellPhone||"",memberTier:n.membershipTier||"",memberSince:(()=>{const e=n.memberSince;if(!e)return"";const t=e.toDate?e.toDate():e.seconds?new Date(1e3*e.seconds):new Date(e);return isNaN(t.getTime())?"":t.toLocaleDateString()})(),chapter:n.chapter||"",role:n.role||"",roleStartDate:n.roleStartDate||"",isFoundingMember:n.isFoundingMember||!1,isVipMember:n.isVipMember||!1,referralCount:n.referralCount||0,bio:n.aboutMe||"",linkedIn:n.linkedinUrl||"",profilePhoto:n.profilePhoto||"",groups:n.groups||[],eventsRegistered:n.eventsRegistered||[],showEvents:!1!==n.showEvents,network:n.network||[],education:n.education||[],experience:n.experience||[]})},[n]),(0,e.useEffect)(()=>{const e=_c(o);f(e)},[o]);if(a)return(0,nn.jsx)("div",{className:"flex justify-center items-center min-h-screen",children:(0,nn.jsx)("div",{className:"animate-spin rounded-full h-12 w-12 border-t-2 border-b-2 border-apn-blue"})});const y=e=>{const{name:t,value:n,type:r,files:a}=e.target;if("file"===r&&a&&a[0]){const e=a[0],t=new FileReader;t.onloadend=()=>{p(t.result),m(e=>(0,s.A)((0,s.A)({},e),{},{profilePhoto:t.result}))}
2,t.readAsDataURL(e)}else m(e=>(0,s.A)((0,s.A)({},e),{},{[t]:n}))},v=async e=>{e.preventDefault();try{const e={firstName:u.firstName,lastName:u.lastName,email:u.email,secondaryEmail:u.secondaryEmail,jobTitle:u.title,roleDescription:u.roleDescription,company:u.company,companyCategory:u.companyCategory,companyDescription:u.companyDescription,city:u.city,state:u.state,phone:u.workPhone,cellPhone:u.cellPhone,chapter:u.chapter,aboutMe:u.bio,linkedinUrl:u.linkedIn,profilePhoto:u.profilePhoto,groups:u.groups,eventsRegistered:u.eventsRegistered,showEvents:u.showEvents,education:u.education,experience:u.experience};await i(r.uid,e),l(u),d(!1),alert("Profile updated successfully!")}catch(t){console.error("Error updating profile:",t),alert("Error updating profile. Please try again.")}};return(0,nn.jsxs)("div",{className:"bg-white",children:[(0,nn.jsx)("div",{className:"bg-apn-blue text-white py-12",children:(0,nn.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:(0,nn.jsxs)("div",{className:"text-center",children:[(0,nn.jsx)("div",{className:"flex justify-center mb-4",children:(0,nn.jsx)("img",{src:"".concat("","/apn-logos/APN-Tag-white.jpg"),alt:"APN Logo",className:"h-16"})}),(0,nn.jsx)("h1",{className:"text-3xl font-bold",children:"My Profile"})]})})}),(0,nn.jsx)("section",{className:"py-12",children:(0,nn.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:(0,nn.jsxs)("div",{className:"bg-white rounded-lg shadow-lg overflow-hidden",children:[(0,nn.jsxs)("div",{className:"bg-gray-50 p-6 flex flex-col md:flex-row justify-between items-center border-b border-gray-200",children:[(0,nn.jsxs)("div",{className:"flex items-center mb-4 md:mb-0",children:[(0,nn.jsx)("div",{className:"w-24 h-24 rounded-full mr-6 flex-shrink-0 overflow-hidden",children:o.profilePhoto?(0,nn.jsx)("img",{src:o.profilePhoto,alt:"Profile",className:"w-full h-full object-cover"}):(0,nn.jsx)("div",{className:"h-full w-full bg-gray-300 flex items-center justify-center",children:(0,nn.jsxs)("span",{className:"text-gray-600 text-xl",children:[o.firstName.charAt(0),o.lastName.charAt(0)]})})}),(0,nn.jsxs)("div",{children:[(0,nn.jsxs)("div",{className:"flex items-center gap-2",children:[(0,nn.jsxs)("h2",{className:"text-2xl font-bold text-gray-900",children:[o.firstName," ",o.lastName]}),(0,nn.jsx)(Cc,{badges:g,size:"small",className:"ml-2"})]}),(0,nn.jsxs)("p",{className:"text-gray-600",children:[o.title," at ",o.company]}),(0,nn.jsxs)("p",{className:"text-gray-600",children:[o.city,", ",o.state]}),(0,nn.jsxs)("p",{className:"text-gray-600",children:["Member Since: ",o.memberSince]}),o.role&&(0,nn.jsxs)("p",{className:"text-gray-600",children:["Role: ",o.role]})]})]}),(0,nn.jsx)("div",{children:c?(0,nn.jsxs)("div",{className:"flex space-x-4",children:[(0,nn.jsx)("button",{onClick:()=>d(!1),className:"px-4 py-2 border border-gray-300 rounded-md text-gray-700 hover:bg-gray-50",children:"Cancel"}),(0,nn.jsx)("button",{onClick:v,className:"px-4 py-2 bg-apn-blue text-white rounded-md hover:bg-blue-700",children:"Save Changes"})]}):(0,nn.jsxs)("div",{className:"flex space-x-4",children:[(0,nn.jsx)("button",{onClick:()=>{m(o),d(!0)},className:"px-4 py-2 bg-apn-blue text-white rounded-md hover:bg-blue-700",children:"Edit Profile"}),"[email protected]"===o.email&&(0,nn.jsx)("button",{onClick:async()=>{b(!0);try{await(0,wn.Vk)()?(alert("Admin profile updated! Please refresh the page to see changes."),window.location.reload()):alert("Failed to update admin profile. Check console for errors.")}catch(e){console.error("Error fixing admin profile:",e),alert("Error updating admin profile. Check console for details.")}finally{b(!1)}},disabled:x,className:"px-4 py-2 bg-green-600 text-white rounded-md hover:bg-green-700 disabled:opacity-50",children:x?"Fixing...":"Fix Admin Profile"})]})})]}),(0,nn.jsx)("div",{className:"p-6",children:c?(0,nn.jsxs)("form",{onSubmit:v,className:"space-y-6",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Profile Photo"}),(0,nn.jsxs)("div",{className:"flex items-center space-x-6 mb-6",children:[(0,nn.jsx)("div",{className:"shrink-0",children:h?(0,nn.jsx)("img",{className:"h-24 w-24 object-cover rounded-full",src:h,alt:"Profile preview"}):u.profilePhoto?(0,nn.jsx)("img",{className:"h-24 w-24 object-cover rounded-full",src:u.profilePhoto,alt:"Current profile"}):(0,nn.jsx)("div",{className:"h-24 w-24 rounded-full bg-gray-200 flex items-center justify-center",children:(0,nn.jsxs)("span",{className:"text-gray-600 text-xl",children:[u.firstName.charAt(0),u.lastName.charAt(0)]})})}),(0,nn.jsxs)("div",{className:"flex text-sm text-gray-600",children:[(0,nn.jsxs)("label",{htmlFor:"profilePhoto",className:"relative cursor-pointer bg-white rounded-md font-medium text-apn-blue hover:text-blue-700 focus-within:outline-none",children:[(0,nn.jsx)("span",{children:"Change photo"}),(0,nn.jsx)("input",{id:"profilePhoto",name:"profilePhoto",type:"file",accept:"image/*",className:"sr-only",onChange:y})]}),(0,nn.jsx)("p",{className:"pl-1",children:"or drag and drop"})]})]})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Personal Information"}),(0,nn.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"firstName",className:"block text-sm font-medium text-gray-700 mb-1",children:"First Name *"}),(0,nn.jsx)("input",{type:"text",id:"firstName",name:"firstName",value:u.firstName,onChange:y,required:!0,className:"w-full px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue"})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"lastName",className:"block text-sm font-medium text-gray-700 mb-1",children:"Last Name *"}),(0,nn.jsx)("input",{type:"text",id:"lastName",name:"lastName",value:u.lastName,onChange:y,required:!0,className:"w-full px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue"})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"email",className:"block text-sm font-medium text-gray-700 mb-1",children:"Email *"}),(0,nn.jsx)("input",{type:"email",id:"email",name:"email",value:u.email,onChange:y,required:!0,className:"w-full px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue"})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"secondaryEmail",className:"block text-sm font-medium text-gray-700 mb-1",children:"Secondary Email"}),(0,nn.jsx)("input",{type:"email",id:"secondaryEmail",name:"secondaryEmail",value:u.secondaryEmail,onChange:y,className:"w-full px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue"})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"workPhone",className:"block text-sm font-medium text-gray-700 mb-1",children:"Work Phone *"}),(0,nn.jsx)("input",{type:"text",id:"workPhone",name:"workPhone",value:u.workPhone,onChange:y,required:!0,className:"w-full px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue"})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"cellPhone",className:"block text-sm font-medium text-gray-700 mb-1",children:"Cell Phone"}),(0,nn.jsx)("input",{type:"text",id:"cellPhone",name:"cellPhone",value:u.cellPhone,onChange:y,className:"w-full px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue"})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"city",className:"block text-sm font-medium text-gray-700 mb-1",children:"City *"}),(0,nn.jsx)("input",{type:"text",id:"city",name:"city",value:u.city,onChange:y,required:!0,className:"w-full px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue"})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"state",className:"block text-sm font-medium text-gray-700 mb-1",children:"State *"}),(0,nn.jsx)("input",{type:"text",id:"state",name:"state",value:u.state,onChange:y,required:!0,className:"w-full px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue"})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"linkedIn",className:"block text-sm font-medium text-gray-700 mb-1",children:"LinkedIn URL"}),(0,nn.jsx)("input",{type:"text",id:"linkedIn",name:"linkedIn",value:u.linkedIn,onChange:y,className:"w-full px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue"})]})]})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Company Information"}),(0,nn.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"company",className:"block text-sm font-medium text-gray-700 mb-1",children:"Company *"}),(0,nn.jsx)("input",{type:"text",id:"company",name:"company",value:u.company,onChange:y,required:!0,className:"w-full px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue"})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"companyCategory",className:"block text-sm font-medium text-gray-700 mb-1",children:"Company Category *"}),(0,nn.jsxs)("select",{id:"companyCategory",name:"companyCategory",value:u.companyCategory,onChange:y,required:!0,className:"w-full px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue",children:[(0,nn.jsx)("option",{value:"",children:"Select a category"}),(0,nn.jsx)("option",{value:"PE",children:"PE"}),(0,nn.jsx)("option",{value:"IB",children:"IB"}),(0,nn.jsx)("option",{value:"Wealth Management",children:"Wealth Management"}),(0,nn.jsx)("option",{value:"Accounting",children:"Accounting"}),(0,nn.jsx)("option",{value:"Legal",children:"Legal"}),(0,nn.jsx)("option",{value:"Insurance",children:"Insurance"}),(0,nn.jsx)("option",{value:"Recruiting",children:"Recruiting"}),(0,nn.jsx)("option",{value:"Management Consulting",children:"Management Consulting"}),(0,nn.jsx)("option",{value:"Individual",children:"Individual"}),(0,nn.jsx)("option",{value:"Business Advisory",children:"Business Advisory"}),(0,nn.jsx)("option",{value:"Other",children:"Other"})]})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"title",className:"block text-sm font-medium text-gray-700 mb-1",children:"Job Title *"}),(0,nn.jsx)("input",{type:"text",id:"title",name:"title",value:u.title,onChange:y,required:!0,className:"w-full px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue"})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"roleDescription",className:"block text-sm font-medium text-gray-700 mb-1",children:"Role Description"}),(0,nn.jsx)("input",{type:"text",id:"roleDescription",name:"roleDescription",value:u.roleDescription,onChange:y,className:"w-full px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue"})]}),(0,nn.jsxs)("div",{className:"md:col-span-2",children:[(0,nn.jsx)("label",{htmlFor:"companyDescription",className:"block text-sm font-medium text-gray-700 mb-1",children:"Company Description"}),(0,nn.jsx)("textarea",{id:"companyDescription",name:"companyDescription",rows:"3",value:u.companyDescription,onChange:y,className:"w-full px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue"})]})]})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Membership Information"}),(0,nn.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"memberTier",className:"block text-sm font-medium text-gray-700 mb-1",children:"Member Tier"}),(0,nn.jsx)("div",{className:"w-full px-4 py-2 border border-gray-200 rounded-md bg-gray-50 text-gray-700",children:u.memberTier||"Not set"}),(0,nn.jsx)("p",{className:"mt-1 text-xs text-gray-500",children:"Set by your paid membership \u2014 contact an admin to change it."})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"memberSince",className:"block text-sm font-medium text-gray-700 mb-1",children:"Member Since *"}),(0,nn.jsx)("input",{type:"text",id:"memberSince",name:"memberSince",value:u.memberSince,onChange:y,required:!0,disabled:!0,className:"w-full px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue bg-gray-100"})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("label",{htmlFor:"chapter",className:"block text-sm font-medium text-gray-700 mb-1",children:"Chapter *"}),(0,nn.jsx)("input",{type:"text",id:"chapter",name:"chapter",value:u.chapter,onChange:y,required:!0,className:"w-full px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue"})]}),(0,nn.jsx)("div",{children:(0,nn.jsxs)("label",{className:"flex items-center mt-6",children:[(0,nn.jsx)("input",{type:"checkbox",name:"showEvents",checked:u.showEvents,onChange:e=>{m(t=>(0,s.A)((0,s.A)({},t),{},{showEvents:e.target.checked}))},className:"h-4 w-4 text-apn-blue focus:ring-apn-blue border-gray-300 rounded"}),(0,nn.jsx)("span",{className:"ml-2 text-sm text-gray-700",children:"Display registered events on profile"})]})})]})]}),(0,nn.jsxs)("div",{className:"mx-auto max-w-4xl",children:[(0,nn.jsx)("label",{htmlFor:"bio",className:"block text-sm font-medium text-gray-700 mb-1",children:"Professional Bio"}),(0,nn.jsx)("textarea",{id:"bio",name:"bio",rows:"6",value:u.bio,onChange:y,className:"w-full px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-apn-blue text-lg",placeholder:"Tell others about your professional background, interests, and expertise..."})]})]}):(0,nn.jsxs)("div",{className:"space-y-8",children:[(0,nn.jsxs)("div",{className:"mx-auto max-w-4xl",children:[(0,nn.jsx)("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:"About"}),(0,nn.jsx)("p",{className:"text-gray-600 text-lg leading-relaxed",children:o.bio})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Contact Information"}),(0,nn.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("p",{className:"text-gray-500 text-sm",children:"Email"}),(0,nn.jsx)("p",{className:"text-gray-900",children:o.email})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("p",{className:"text-gray-500 text-sm",children:"Secondary Email"}),(0,nn.jsx)("p",{className:"text-gray-900",children:o.secondaryEmail||"Not provided"})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("p",{className:"text-gray-500 text-sm",children:"Work Phone"}),(0,nn.jsx)("p",{className:"text-gray-900",children:o.workPhone})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("p",{className:"text-gray-500 text-sm",children:"Cell Phone"}),(0,nn.jsx)("p",{className:"text-gray-900",children:o.cellPhone||"Not provided"})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("p",{className:"text-gray-500 text-sm",children:"LinkedIn"}),(0,nn.jsx)("a",{href:o.linkedIn,target:"_blank",rel:"noopener noreferrer",className:"text-apn-blue hover:underline",children:o.linkedIn})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("p",{className:"text-gray-500 text-sm",children:"Location"}),(0,nn.jsxs)("p",{className:"text-gray-900",children:[o.city,", ",o.state]})]})]})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Company Information"}),(0,nn.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("p",{className:"text-gray-500 text-sm",children:"Company"}),(0,nn.jsx)("p",{className:"text-gray-900",children:o.company})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("p",{className:"text-gray-500 text-sm",children:"Company Category"}),(0,nn.jsx)("p",{className:"text-gray-900",children:o.companyCategory})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("p",{className:"text-gray-500 text-sm",children:"Job Title"}),(0,nn.jsx)("p",{className:"text-gray-900",children:o.title})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("p",{className:"text-gray-500 text-sm",children:"R
2ole Description"}),(0,nn.jsx)("p",{className:"text-gray-900",children:o.roleDescription||"Not provided"})]}),(0,nn.jsxs)("div",{className:"md:col-span-2",children:[(0,nn.jsx)("p",{className:"text-gray-500 text-sm",children:"Company Description"}),(0,nn.jsx)("p",{className:"text-gray-900",children:o.companyDescription||"Not provided"})]})]})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Membership Information"}),(0,nn.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("p",{className:"text-gray-500 text-sm",children:"Member Tier"}),(0,nn.jsx)("p",{className:"text-gray-900",children:o.memberTier})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("p",{className:"text-gray-500 text-sm",children:"Member Since"}),(0,nn.jsx)("p",{className:"text-gray-900",children:o.memberSince})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("p",{className:"text-gray-500 text-sm",children:"Chapter"}),(0,nn.jsx)("p",{className:"text-gray-900",children:o.chapter})]})]})]}),g.length>0&&(0,nn.jsxs)("div",{children:[(0,nn.jsx)("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Badges & Achievements"}),(0,nn.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-6",children:g.map(e=>(0,nn.jsxs)("div",{className:"flex items-center p-4 border border-gray-200 rounded-lg",children:[(0,nn.jsx)("img",{src:"".concat("").concat(e.image),alt:e.name,className:"w-16 h-16 object-contain mr-4"}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("h4",{className:"font-semibold text-gray-900",children:e.name}),(0,nn.jsx)("p",{className:"text-sm text-gray-600",children:e.publicDescription||e.name}),e.earnedDate&&(0,nn.jsxs)("p",{className:"text-xs text-gray-500 mt-1",children:["Earned: ",e.earnedDate]})]})]},e.id))})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Experience"}),(0,nn.jsx)("div",{className:"space-y-6",children:o.experience.map(e=>(0,nn.jsxs)("div",{className:"border-b border-gray-200 pb-6 last:border-b-0 last:pb-0",children:[(0,nn.jsx)("h4",{className:"font-semibold text-gray-900",children:e.title}),(0,nn.jsx)("p",{className:"text-gray-600",children:e.company}),(0,nn.jsxs)("p",{className:"text-gray-500 text-sm",children:[e.startDate," - ",e.endDate]}),(0,nn.jsx)("p",{className:"text-gray-600 mt-2",children:e.description})]},e.id))})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Education"}),(0,nn.jsx)("div",{className:"space-y-6",children:o.education.map(e=>(0,nn.jsxs)("div",{className:"border-b border-gray-200 pb-6 last:border-b-0 last:pb-0",children:[(0,nn.jsx)("h4",{className:"font-semibold text-gray-900",children:e.institution}),(0,nn.jsx)("p",{className:"text-gray-600",children:e.degree}),(0,nn.jsx)("p",{className:"text-gray-500 text-sm",children:e.year})]},e.id))})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Groups"}),(0,nn.jsx)("div",{className:"flex flex-wrap gap-2",children:o.groups.length>0?o.groups.map((e,t)=>(0,nn.jsx)("span",{className:"inline-block bg-gray-100 text-gray-700 px-3 py-1 rounded-full",children:e},t)):(0,nn.jsx)("p",{className:"text-gray-600",children:"Not a member of any groups yet"})})]}),o.showEvents&&(0,nn.jsxs)("div",{children:[(0,nn.jsx)("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Registered Events"}),(0,nn.jsx)("div",{className:"flex flex-wrap gap-2",children:o.eventsRegistered.length>0?o.eventsRegistered.map((e,t)=>(0,nn.jsx)("span",{className:"inline-block bg-gray-100 text-gray-700 px-3 py-1 rounded-full",children:e},t)):(0,nn.jsx)("p",{className:"text-gray-600",children:"Not registered for any events yet"})})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,nn.jsxs)("h3",{className:"text-lg font-semibold text-gray-900",children:["My Network (",(null===(t=o.network)||void 0===t?void 0:t.length)||0,")"]}),(0,nn.jsxs)(dt,{to:"/my-network",className:"text-apn-blue hover:text-blue-700 text-sm font-medium flex items-center",children:["View All",(0,nn.jsx)("svg",{className:"ml-1 h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M9 5l7 7-7 7"})})]})]}),(0,nn.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:[o.network.length>0?o.network.slice(0,6).map(e=>(0,nn.jsxs)("div",{className:"border border-gray-200 rounded-lg p-4 flex items-center",children:[(0,nn.jsx)("div",{className:"flex-shrink-0 mr-4",children:(0,nn.jsx)("img",{src:"".concat("").concat(e.image),alt:e.name,className:"h-12 w-12 rounded-full object-cover",onError:e=>{e.target.onerror=null,e.target.src="".concat("","/images/profiles/default-avatar.png")}})}),(0,nn.jsxs)("div",{className:"flex-grow",children:[(0,nn.jsx)("h4",{className:"font-semibold text-gray-900",children:e.name}),(0,nn.jsxs)("p",{className:"text-sm text-gray-600",children:[e.title," at ",e.company]})]}),(0,nn.jsx)("div",{children:(0,nn.jsx)(dt,{to:"/directory/".concat(e.id),className:"inline-flex items-center px-3 py-1 border border-gray-300 text-sm leading-5 font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:border-blue-300 focus:shadow-outline-blue active:bg-gray-100 transition ease-in-out duration-150",children:"View"})})]},e.id)):(0,nn.jsx)("p",{className:"text-gray-600",children:"You haven't connected with anyone yet"}),o.network.length>6&&(0,nn.jsxs)(dt,{to:"/my-network",className:"border border-dashed border-gray-300 rounded-lg p-4 flex flex-col items-center justify-center text-gray-500 hover:text-apn-blue hover:border-apn-blue transition duration-200",children:[(0,nn.jsxs)("span",{className:"text-lg mb-1",children:["+",o.network.length-6]}),(0,nn.jsx)("span",{children:"View All Connections"})]})]})]})]})})]})})}),(0,nn.jsx)("section",{className:"bg-apn-blue text-white py-12",children:(0,nn.jsxs)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 text-center",children:[(0,nn.jsx)("div",{className:"flex justify-center mb-6",children:(0,nn.jsx)("img",{src:"".concat("","/apn-logos/APN-Tag-SQ-white.jpg"),alt:"APN Logo Square",className:"h-20"})}),(0,nn.jsx)("h2",{className:"text-3xl font-bold mb-4",children:"Explore the APN Community"}),(0,nn.jsx)("p",{className:"text-xl mb-8 max-w-3xl mx-auto",children:"Connect with other finance professionals, join groups, and discover job opportunities."}),(0,nn.jsxs)("div",{className:"flex flex-wrap justify-center gap-4",children:[(0,nn.jsx)(dt,{to:"/directory",className:"btn-primary bg-white text-apn-blue hover:bg-gray-100",children:"Member Directory"}),(0,nn.jsx)(dt,{to:"/groups",className:"btn-primary bg-white text-apn-blue hover:bg-gray-100",children:"Join Groups"})]})]})})]})},yd=()=>{const{currentUser:t}=sn(),[n,r]=(0,e.useState)([]),[s,a]=(0,e.useState)(!0),[i,o]=(0,e.useState)(""),[l,c]=(0,e.useState)(""),[d,u]=(0,e.useState)(1),[m]=(0,e.useState)(12),[h,p]=(0,e.useState)([]);(0,e.useEffect)(()=>{let e=!1;const n=(e,t)=>({id:t,name:e.name||"".concat(e.firstName||""," ").concat(e.lastName||"").trim()||e.displayName||"Member",title:e.title||e.jobTitle||"",company:e.company||e.organization||"",industry:e.industry||e.specialty||"",image:e.image||e.photoURL||e.profileImage||"",mutualConnections:e.mutualConnections||0});return(async()=>{a(!0);try{if(!t)return void(e||(r([]),p([])));const s=(await Mo(t.uid)||[]).map(e=>n(e,e.userId||e.id)),a=new Set(s.map(e=>e.id)),[i,o]=await Promise.all([(0,wn.getAllUsers)(100).catch(()=>[]),(0,wn.l9)().catch(()=>!1)]),l=(i||[]).filter(e=>"approved"===e.status&&"admin"!==e.role&&e.id!==t.uid&&!a.has(e.id)).map(e=>n(e,e.id)),c=o?[]:Ic.filter(e=>!a.has(e.id)).map(e=>n(e,e.id));e||(r(s),p([...l,...c]))}
2catch(s){console.error("Error loading network:",s),e||(r([]),p([]))}finally{e||a(!1)}})(),()=>{e=!0}},[t]);const g=[...new Set(n.map(e=>e.industry))],f=n.filter(e=>{const t=e.name.toLowerCase().includes(i.toLowerCase())||e.title.toLowerCase().includes(i.toLowerCase())||e.company.toLowerCase().includes(i.toLowerCase()),n=""===l||e.industry===l;return t&&n}),x=d*m,b=x-m,y=f.slice(b,x),v=Math.ceil(f.length/m),w=e=>u(e);return s?(0,nn.jsx)("div",{className:"flex justify-center items-center min-h-screen",children:(0,nn.jsx)("div",{className:"animate-spin rounded-full h-12 w-12 border-t-2 border-b-2 border-apn-blue"})}):(0,nn.jsxs)("div",{className:"bg-white",children:[(0,nn.jsx)("div",{className:"bg-apn-blue text-white py-12",children:(0,nn.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:(0,nn.jsxs)("div",{className:"text-center",children:[(0,nn.jsx)("div",{className:"flex justify-center mb-4",children:(0,nn.jsx)("img",{src:"".concat("","/apn-logos/APN-Tag-white.jpg"),alt:"APN Logo",className:"h-16"})}),(0,nn.jsx)("h1",{className:"text-3xl font-bold",children:"My Network"}),(0,nn.jsx)("p",{className:"mt-2 text-lg",children:"Manage your professional connections"})]})})}),(0,nn.jsx)("section",{className:"py-12",children:(0,nn.jsxs)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[(0,nn.jsxs)("div",{className:"bg-white rounded-lg shadow-lg overflow-hidden",children:[(0,nn.jsx)("div",{className:"bg-gray-50 p-6 border-b border-gray-200",children:(0,nn.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6 text-center",children:[(0,nn.jsxs)("div",{children:[(0,nn.jsx)("h3",{className:"text-3xl font-bold text-gray-900",children:n.length}),(0,nn.jsx)("p",{className:"text-gray-600",children:"Total Connections"})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("h3",{className:"text-3xl font-bold text-gray-900",children:g.length}),(0,nn.jsx)("p",{className:"text-gray-600",children:"Industries"})]}),(0,nn.jsxs)("div",{children:[(0,nn.jsx)("h3",{className:"text-3xl font-bold text-gray-900",children:h.length}),(0,nn.jsx)("p",{className:"text-gray-600",children:"Suggested Connections"})]})]})}),(0,nn.jsx)("div",{className:"p-6 border-b border-gray-200",children:(0,nn.jsxs)("div",{className:"flex flex-col md:flex-row space-y-4 md:space-y-0 md:space-x-4",children:[(0,nn.jsxs)("div",{className:"w-full md:w-2/3",children:[(0,nn.jsx)("label",{htmlFor:"search",className:"sr-only",children:"Search"}),(0,nn.jsxs)("div",{className:"relative",children:[(0,nn.jsx)("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:(0,nn.jsx)("svg",{className:"h-5 w-5 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})}),(0,nn.jsx)("input",{id:"search",type:"text",placeholder:"Search by name, title, or company",value:i,onChange:e=>{o(e.target.value),u(1)},className:"block w-full pl-10 pr-3 py-2 border border-gray-300 rounded-md leading-5 bg-white placeholder-gray-500 focus:outline-none focus:placeholder-gray-400 focus:ring-1 focus:ring-apn-blue focus:border-apn-blue sm:text-sm"})]})]}),(0,nn.jsxs)("div",{className:"w-full md:w-1/3",children:[(0,nn.jsx)("label",{htmlFor:"industry",className:"sr-only",children:"Filter by Industry"}),(0,nn.jsxs)("select",{id:"industry",value:l,onChange:e=>{c(e.target.value),u(1)},className:"block w-full pl-3 pr-10 py-2 border border-gray-300 rounded-md leading-5 bg-white focus:outline-none focus:ring-1 focus:ring-apn-blue focus:border-apn-blue sm:text-sm",children:[(0,nn.jsx)("option",{value:"",children:"All Industries"}),g.map((e,t)=>(0,nn.jsx)("option",{value:e,children:e},t))]})]})]})}),(0,nn.jsxs)("div",{className:"p-6",children:[(0,nn.jsxs)("h2",{className:"text-xl font-semibold text-gray-900 mb-6",children:["Your Connections (",f.length,")"]}),0===f.length?(0,nn.jsxs)("div",{className:"text-center py-12",children:[(0,nn.jsx)("svg",{className:"mx-auto h-12 w-12 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 4.354a4 4 0 110 5.292M15 21H3v-1a6 6 0 0112 0v1zm0 0h6v-1a6 6 0 00-9-5.197M13 7a4 4 0 11-8 0 4 4 0 018 0z"})}),(0,nn.jsx)("h3",{className:"mt-2 text-lg font-medium text-gray-900",children:"No connections foun
2d"}),(0,nn.jsx)("p",{className:"mt-1 text-gray-500",children:"Try adjusting your search or filter to find connections."})]}):(0,nn.jsxs)(nn.Fragment,{children:[(0,nn.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:y.map(e=>(0,nn.jsx)("div",{className:"border border-gray-200 rounded-lg overflow-hidden",children:(0,nn.jsxs)("div",{className:"p-4",children:[(0,nn.jsxs)("div",{className:"flex items-center",children:[(0,nn.jsx)("div",{className:"flex-shrink-0 mr-4",children:(0,nn.jsx)("img",{src:"".concat("").concat(e.image),alt:e.name,className:"h-16 w-16 rounded-full object-cover",onError:e=>{e.target.onerror=null,e.target.src="".concat("","/images/profiles/default-avatar.png")}})}),(0,nn.jsxs)("div",{className:"flex-grow",children:[(0,nn.jsx)("h3",{className:"text-lg font-semibold text-gray-900",children:e.name}),(0,nn.jsx)("p",{className:"text-gray-600",children:e.title}),(0,nn.jsx)("p",{className:"text-gray-500 text-sm",children:e.company}),(0,nn.jsx)("p",{className:"text-gray-500 text-xs mt-1",children:e.industry})]})]}),(0,nn.jsxs)("div",{className:"mt-4 flex justify-between",children:[(0,nn.jsx)(dt,{to:"/directory/".concat(e.id),className:"inline-flex items-center px-3 py-1 border border-gray-300 text-sm leading-5 font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:border-blue-300 focus:shadow-outline-blue active:bg-gray-100 transition ease-in-out duration-150",children:"View Profile"}),(0,nn.jsx)("button",{onClick:()=>(async e=>{if(t){r(t=>t.filter(t=>t.id!==e));try{await Uo(t.uid,e)}catch(n){console.error("Error removing connection:",n)}}})(e.id),className:"inline-flex items-center px-3 py-1 border border-gray-300 text-sm leading-5 font-medium rounded-md text-red-600 bg-white hover:bg-red-50 focus:outline-none focus:border-red-300 focus:shadow-outline-red active:bg-red-100 transition ease-in-out duration-150",children:"Remove"})]})]})},e.id))}),v>1&&(0,nn.jsx)("div",{className:"mt-8 flex justify-center",children:(0,nn.jsxs)("nav",{className:"relative z-0 inline-flex rounded-md shadow-sm -space-x-px","aria-label":"Pagination",children:[(0,nn.jsxs)("button",{onClick:()=>w(d>1?d-1:1),disabled:1===d,className:"relative inline-flex items-center px-2 py-2 rounded-l-md border border-gray-300 bg-white text-sm font-medium ".concat(1===d?"text-gray-300 cursor-not-allowed":"text-gray-500 hover:bg-gray-50"),children:[(0,nn.jsx)("span",{className:"sr-only",children:"Previous"}),(0,nn.jsx)("svg",{className:"h-5 w-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:(0,nn.jsx)("path",{fillRule:"evenodd",d:"M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z",clipRule:"evenodd"})})]}),[...Array(v)].map((e,t)=>{const n=t+1;return 1===n||n===v||n>=d-1&&n<=d+1?(0,nn.jsx)("button",{onClick:()=>w(n),className:"relative inline-flex items-center px-4 py-2 border text-sm font-medium ".concat(d===n?"z-10 bg-apn-blue border-apn-blue text-white":"bg-white border-gray-300 text-gray-500 hover:bg-gray-50"),children:n},n):2===n&&d>3||n===v-1&&d<v-2?(0,nn.jsx)("span",{className:"relative inline-flex items-center px-4 py-2 border border-gray-300 bg-white text-sm font-medium text-gray-700",children:"..."},n):null}),(0,nn.jsxs)("button",{onClick:()=>w(d<v?d+1:v),disabled:d===v,className:"relative inline-flex items-center px-2 py-2 rounded-r-md border border-gray-300 bg-white text-sm font-medium ".concat(d===v?"text-gray-300 cursor-not-allowed":"text-gray-500 hover:bg-gray-50"),children:[(0,nn.jsx)("span",{className:"sr-only",children:"Next"}),(0,nn.jsx)("svg",{className:"h-5 w-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:(0,nn.jsx)("path",{fillRule:"evenodd",d:"M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z",clipRule:"evenodd"})})]})]})})]})]})]}),h.length>0&&(0,nn.jsxs)("div",{className:"mt-8 bg-white rounded-lg shadow-lg overflow-hidden",children:[(0,nn.jsxs)("div",{className:"p-6 border-b border-gray-200",children:[(0,nn.jsx)("h2",{className:"text-xl font-semibold text-gray-900",children:"People You May Know"}),(0,nn.jsx)("p",{className:"text-gray-600",children:"Connect with professionals in your industry"})]}),(0,nn.jsx)("div",{className:"p-6",children:(0,nn.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:h.map(e=>(0,nn.jsx)("div",{className:"border border-gray-200 rounded-lg overflow-hidden bg-gray-50",children:(0,nn.jsxs)("div",{className:"p-4",children:[(0,nn.jsxs)("div",{className:"flex items-center",children:[(0,nn.jsx)("div",{className:"flex-shrink-0 mr-4",children:(0,nn.jsx)("img",{src:"".concat("").concat(e.image),alt:e.name,className:"h-16 w-16 rounded-full object-cover",onError:e=>{e.target.onerror=null,e.target.src="".concat("","/images/profiles/default-avatar.png")}})}),(0,nn.jsxs)("div",{className:"flex-grow",children:[(0,nn.jsx)("h3",{className:"text-lg font-semibold text-gray-900",children:e.name}),(0,nn.jsx)("p",{className:"text-gray-600",children:e.title}),(0,nn.jsx)("p",{className:"text-gray-500 text-sm",children:e.company}),(0,nn.jsxs)("p",{className:"text-gray-500 text-xs mt-1",children:[e.mutualConnections," mutual connections"]})]})]}),(0,nn.jsxs)("div",{className:"mt-4 flex justify-between",children:[(0,nn.jsx)(dt,{to:"/directory/".concat(e.id),className:"inline-flex items-center px-3 py-1 border border-gray-300 text-sm leading-5 font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:border-blue-300 focus:shadow-outline-blue active:bg-gray-100 transition ease-in-out duration-150",children:"View Profile"}),(0,nn.jsxs)("button",{onClick:()=>(async e=>{if(t)if(String(e.id).startsWith("seed-"))alert("This is a demo member. You can connect with real members as they join.");else{r(t=>[...t,e]),p(t=>t.filter(t=>t.id!==e.id));try{await Fo(t.uid,{userId:e.id,id:e.id,name:e.name,title:e.title,company:e.company,mutualConnections:e.mutualConnections||0})}catch(n){console.error("Error adding connection:",n)}}else alert("Please log in to connect.")})(e),className:"inline-flex items-center px-3 py-1 border border-transparent text-sm leading-5 font-medium rounded-md text-white bg-green-600 hover:bg-green-700 focus:outline-none focus:border-green-700 focus:shadow-outline-green active:bg-green-800 transition ease-in-out duration-150",children:[(0,nn.jsx)("svg",{className:"mr-1 h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,nn.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 4v16m8-8H4"})}),"Connect"]})]})]})},e.id))})})]})]})}),(0,nn.jsx)("section",{className:"bg-apn-blue text-white py-12",children:(0,nn.jsxs)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 text-center",children:[(0,nn.jsx)("div",{className:"flex justify-center mb-6",children:(0,nn.jsx)("img",{src:"".concat("","/apn-logos/APN-Tag-SQ-white.jpg"),alt:"APN Logo Square",className:"h-20"})}),(0,nn.jsx)("h2",{className:"text-3xl font-bold mb-4",children:"Expand Your Network"}),(0,nn.jsx)("p",{className:"text-xl mb-8 max-w-3xl mx-auto",children:"Discover more professionals in your industry by exploring the member directory."}),(0,nn.jsx)(dt,{to:"/directory",className:"btn-primary bg-white text-apn-blue hover:bg-gray-100",children:"Browse Member Directory"})]})})]})};function vd(e){let{headerRef:t}=e;const{currentUser:n,logout:r}=sn();un();const s=window.location.pathname,a=!["/login","/forgot-password","/pending-approval","/firebase-connection","/firebase-test","/debug-auth","/admin-setup","/client/login","/client/dashboard","/client/deposit"].some(e=>s.startsWith(e));return(0,nn.jsxs)("div",{className:"flex flex-col min-h-screen",children:[a&&(0,nn.jsx)(xn,{ref:t,isLoggedIn:!!n,onLogout:r}),(0,nn.jsx)("main",{className:"flex-grow",children:(0,nn.jsxs)(Se,{children:[(0,nn.jsx)(ke,{path:"/login",element:(0,nn.jsx)(En,{})}),(0,nn.jsx)(ke,{path:"/signup",element:(0,nn.jsx)(Ne,{to:"/register",replace:!0})}),(0,nn.jsx)(ke,{path:"/forgot-password",element:(0,nn.jsx)(Cn,{})}),(0,nn.jsx)(ke,{path:"/pending-approval",element:(0,nn.jsx)(qn,{})}),(0,nn.jsx)(ke,{path:"/firebase-connection",element:(0,nn.jsx)(Nn,{})}),(0,nn.jsx)(ke,{path:"/firebase-test",element:(0,nn.jsx)(vn,{children:(0,nn.jsx)(jn,{})})}),(0,nn.jsx)(ke,{path:"/debug-auth",element:(0,nn.jsx)(kn,{})}),(0,nn.jsx)(ke,{path:"/admin-setup",element:(0,nn.jsx)(ga,{})}),(0,nn.jsx)(ke,{path:"/payment-test",element:(0,nn.jsx)(An,{})}),(0,nn.jsx)(ke,{path:"/",element:(0,nn.jsx)(Fn,{})}),(0,nn.jsx)(ke,{path:"/accelerated-professionals",element:(0,nn.jsx)(jo,{})}),(0,nn.jsx)(ke,{path:"/professional-network",element:(0,nn.jsx)(No,{})}),(0,nn.jsx)(ke,{path:"/accelerated",element:(0,nn.jsx)(jo,{})}),(0,nn.jsx)(ke,{path:"/professional",element:(0,nn.jsx)(No,{})}),(0,nn.jsx)(ke,{path:"/network",element:(0,nn.jsx)(No,{})}),(0,nn.jsx)(ke,{path:"/about/our-story",element:(0,nn.jsx)(wa,{})}),(0,nn.jsx)(ke,{path:"/about/membership",element:(0,nn.jsx)(ja,{})}),(0,nn.jsx)(ke,{path:"/membership",element:(0,nn.jsx)(Ne,{to:"/register",replace:!0})}),(0,nn.jsx)(ke,{path:"/register",element:(0,nn.jsx)(Aa,{})}),(0,nn.jsx)(ke,{path:"/membership-payment",element:(0,nn.jsx)(oi,{})}),(0,nn.jsx)(ke,{path:"/membership/success",element:(0,nn.jsx)(li,{})}),(0,nn.jsx)(ke,{path:"/membership/cancel",element:(0,nn.jsx)(ci,{})}),(0,nn.jsx)(ke,{path:"/membership/renew",element:(0,nn.jsx)(vn,{children:(0,nn.jsx)(di,{})})}),(0,nn.jsx)(ke,{path:"/profile/complete",element:(0,nn.jsx)(ui,{})}),(0,nn.jsx)(ke,{path:"/membership/legacy",element:(0,nn.jsx)(ka,{})}),(0,nn.jsx)(ke,{path:"/about/sponsorship",element:(0,nn.jsx)(mi,{})}),(0,nn.jsx)(ke,{path:"/about/additional-services",element:(0,nn.jsx)(xi,{})}),(0,nn.jsx)(ke,{path:"/about/contact",element:(0,nn.jsx)(vi,{})}),(0,nn.jsx)(ke,{path:"/legal/terms-and-conditions",element:(0,nn.jsx)(ko,{})}),(0,nn.jsx)(ke,{path:"/legal/privacy-policy",element:(0,nn.jsx)(Ao,{})}),(0,nn.jsx)(ke,{path:"/events",element:(0,nn.jsx)(So,{})}),(0,nn.jsx)(ke,{path:"/events/:id",element:(0,nn.jsx)(zo,{})}),(0,nn.jsx)(ke,{path:"/events/:id/registration/success",element:(0,nn.jsx)(Vo,{})}),(0,nn.jsx)(ke,{path:"/events/:id/registration/cancel",element:(0,nn.jsx)(qo,{})}),(0,nn.jsx)(ke,{path:"/news",element:(0,nn.jsx)(Wo,{})}),(0,nn.jsx)(ke,{path:"/news/:id",element:(0,nn.jsx)(Go,{})}),(0,nn.jsx)(ke,{path:"/client/login",element:(0,nn.jsx)(fa,{})}),(0,nn.jsx)(ke,{path:"/client/dashboard",element:(0,nn.jsx)(ba,{})}),(0,nn.jsx)(ke,{path:"/client/deposit/:id",element:(0,nn.jsx)(ya,{})}),(0,nn.jsx)(ke,{path:"/client/deposit/:id/success",element:(0,nn.jsx)(va,{})}),(0,nn.jsx)(ke,{path:"/dashboard",element:(0,nn.jsx)(vn,{requireApproval:!0,requireActiveMembership:!0,children:(0,nn.jsx)(Vn,{})})}),(0,nn.jsx)(ke,{path:"/directory",element:(0,nn.jsx)(vn,{requireApproval:!0,requireActiveMembership:!0,children:(0,nn.jsx)(Dc,{})})}),(0,nn.jsx)(ke,{path:"/directory/:id",element:(0,nn.jsx)(vn,{requireApproval:!0,requireActiveMembership:!0,children:(0,nn.jsx)(Rc,{})})}),(0,nn.jsx)(ke,{path:"/groups",element:(0,nn.jsx)(vn,{requireApproval:!0,requireActiveMembership:!0,children:(0,nn.jsx)(Uc,{})})}),(0,nn.jsx)(ke,{path:"/groups/create",element:(0,nn.jsx)(vn,{requireApproval:!0,requireActiveMembership:!0,children:(0,nn.jsx)(Gc,{})})}),(0,nn.jsx)(ke,{path:"/groups/:id",element:(0,nn.jsx)(vn,{requireApproval:!0,requireActiveMembership:!0,children:(0,nn.jsx)(qc,{})})}),(0,nn.jsx)(ke,{path:"/groups/:id/admin",element:(0,nn.jsx)(vn,{requireApproval:!0,requireActiveMembership:!0,children:(0,nn.jsx)(Lr,{})})}),(0,nn.jsx)(ke,{path:"/jobs",element:(0,nn.jsx)(vn,{requireApproval:!0,requireActiveMembership:!0,children:(0,nn.jsx)($c,{})})}),(0,nn.jsx)(ke,{path:"/my-postings",element:(0,nn.jsx)(vn,{requireApproval:!0,requireActiveMembership:!0,children:(0,nn.jsx)(sd,{})})}),(0,nn.jsx)(ke,{path:"/messages",element:(0,nn.jsx)(vn,{requireApproval:!0,requireActiveMembership:!0,children:(0,nn.jsx)(od,{})})}),(0,nn.jsx)(ke,{path:"/messages/:conversationId",element:(0,nn.jsx)(vn,{requireApproval:!0,requireActiveMembership:!0,children:(0,nn.jsx)(od,{})})}),(0,nn.jsx)(ke,{path:"/jobs/:id",element:(0,nn.jsx)(vn,{requireApproval:!0,requireActiveMembership:!0,children:(0,nn.jsx)(rd,{})})}),(0,nn.jsx)(ke,{path:"/jobs/post",element:(0,nn.jsx)(vn,{requireApproval:!0,requireActiveMembership:!0,children:(0,nn.jsx)(xd,{})})}),(0,nn.jsx)(ke,{path:"/projects",element:(0,nn.jsx)(vn,{requireApproval:!0,requireActiveMembership:!0,children:(0,nn.jsx)(cd,{})})}),(0,nn.jsx)(ke,{path:"/projects/:id",element:(0,nn.jsx)(vn,{requireApproval:!0,requireActiveMembership:!0,children:(0,nn.jsx)(dd,{})})}),(0,nn.jsx)(ke,{path:"/projects/post",element:(0,nn.jsx)(vn,{requireApproval:!0,requireActiveMembership:!0,children:(0,nn.jsx)(fd,{})})}),(0,nn.jsx)(ke,{path:"/profile",element:(0,nn.jsx)(vn,{children:(0,nn.jsx)(bd,{})})}),(0,nn.jsx)(ke,{path:"/my-network",element:(0,nn.jsx)(vn,{requireApproval:!0,requireActiveMembership:!0,children:(0,nn.jsx)(yd,{})})}),(0,nn.jsx)(ke,{path:"/admin",element:(0,nn.jsx)(vn,{adminOnly:!0,children:(0,nn.jsx)(Ir,{})})}),(0,nn.jsx)(ke,{path:"/admin/user-management",element:(0,nn.jsx)(vn,{adminOnly:!0,children:(0,nn.jsx)(Ir,{})})}),(0,nn.jsx)(ke,{path:"/admin/events/create",element:(0,nn.jsx)(vn,{adminOnly:!0,children:(0,nn.jsx)(pa,{})})}),(0,nn.jsx)(ke,{path:"/admin/events/edit/:id",element:(0,nn.jsx)(vn,{adminOnly:!0,children:(0,nn.jsx)(pa,{})})}),(0,nn.jsx)(ke,{path:"/admin/groups",element:(0,nn.jsx)(vn,{adminOnly:!0,children:(0,nn.jsx)(Dr,{})})}),(0,nn.jsx)(ke,{path:"/admin/postings",element:(0,nn.jsx)(vn,{adminOnly:!0,children:(0,nn.jsx)(ks,{})})}),(0,nn.jsx)(ke,{path:"/admin/users",element:(0,nn.jsx)(vn,{adminOnly:!0,children:(0,nn.jsx)(Yr,{})})}),(0,nn.jsx)(ke,{path:"/admin/seo",element:(0,nn.jsx)(vn,{adminOnly:!0,children:(0,nn.jsx)(Xr,{})})}),(0,nn.jsx)(ke,{path:"/admin/export",element:(0,nn.jsx)(vn,{adminOnly:!0,children:(0,nn.jsx)(Kr,{})})}),(0,nn.jsx)(ke,{path:"/admin/seed-data",element:(0,nn.jsx)(vn,{adminOnly:!0,children:(0,nn.jsx)(Gr,{})})}),(0,nn.jsx)(ke,{path:"/admin/debug-groups",element:(0,nn.jsx)(vn,{adminOnly:!0,children:(0,nn.jsx)(Zr,{})})}),(0,nn.jsx)(ke,{path:"/admin/test-firebase",element:(0,nn.jsx)(vn,{adminOnly:!0,children:(0,nn.jsx)(es,{})})}),(0,nn.jsx)(ke,{path:"/admin/migrate-events",element:(0,nn.jsx)(vn,{adminOnly:!0,children:(0,nn.jsx)(ms,{})})}),(0,nn.jsx)(ke,{path:"/admin/event-cleanup",element:(0,nn.jsx)(vn,{adminOnly:!0,children:(0,nn.jsx)(hs,{})})}),(0,nn.jsx)(ke,{path:"/admin/create-grand-relaunch",element:(0,nn.jsx)(vn,{adminOnly:!0,children:(0,nn.jsx)(js,{})})}),(0,nn.jsx)(ke,{path:"/admin/database-cleanup",element:(0,nn.jsx)(vn,{adminOnly:!0,children:(0,nn.jsx)(Ns,{})})}),(0,nn.jsx)(ke,{path:"/admin/migrate-news",element:(0,nn.jsx)(vn,{adminOnly:!0,children:(0,nn.jsx)(bs,{})})}),(0,nn.jsx)(ke,{path:"/admin/news-management",element:(0,nn.jsx)(vn,{adminOnly:!0,children:(0,nn.jsx)(vs,{})})}),(0,nn.jsx)(ke,{path:"/admin/testing",element:(0,nn.jsx)(vn,{adminOnly:!0,children:(0,nn.jsx)(ws,{})})}),(0,nn.jsx)(ke,{path:"/admin/campaigns",element:(0,nn.jsx)(vn,{adminOnly:!0,children:(0,nn.jsx)(Ls,{})})}),(0,nn.jsx)(ke,{path:"/admin/clients",element:(0,nn.jsx)(vn,{adminOnly:!0,children:(0,nn.jsx)(dr,{})})}),(0,nn.jsx)(ke,{path:"/admin/agency-clients",element:(0,nn.jsx)(vn,{adminOnly:!0,children:(0,nn.jsx)(Bs,{})})}),(0,nn.jsx)(ke,{path:"/admin/agency-pipeline",element:(0,nn.jsx)(vn,{adminOnly:!0,children:(0,nn.jsx)(Hs,{})})}),(0,nn.jsx)(ke,{path:"/admin/client-portal",element:(0,nn.jsx)(vn,{adminOnly:!0,children:(0,nn.jsx)(kr,{})})}),(0,nn.jsx)(ke,{path:"/jobs/create",element:(0,nn.jsx)(vn,{requireApproval:!0,requireActiveMembership:!0,children:(0,nn.jsx)(ea,{})})}),(0,nn.jsx)(ke,{path:"/projects/create",element:(0,nn.jsx)(vn,{requireApproval:!0,requireActiveMembership:!0,children:(0,nn.jsx)(ta,{})})}),(0,nn.jsx)(ke,{path:"/linkedin/groups",element:(0,nn.jsx)(vn,{requireRole:"admin",children:(0,nn.jsx)(Xs,{})})}),(0,nn.jsx)(ke,{path:"/linkedin/graduates",element:(0,nn.jsx)(vn,{requireRole:"admin",children:(0,nn.jsx)(Zs,{})})}),(0,nn.jsx)(ke,{path:"/test/discount",element:(0,nn.jsx)(Sn,{})}),(0,nn.jsx)(ke,{path:"*",element:(0,nn.jsx)(Ne,{to:"/",replace:!0
2})})]})}),(0,nn.jsx)(bn,{}),(0,nn.jsx)(yn,{})]})}const wd=function(){const t=(0,e.useRef)(null);return(0,nn.jsx)(an,{children:(0,nn.jsx)(cn,{children:(0,nn.jsx)(lt,{children:(0,nn.jsx)(vd,{headerRef:t})})})})},jd=e=>{e&&e instanceof Function&&n.e(453).then(n.bind(n,453)).then(t=>{let{getCLS:n,getFID:r,getFCP:s,getLCP:a,getTTFB:i}=t;n(e),r(e),s(e),a(e),i(e)})};t.createRoot(document.getElementById("root")).render((0,nn.jsx)(e.StrictMode,{children:(0,nn.jsx)(wd,{})})),jd()})()})(); 3//# sourceMappingURL=main.440fff96.js.map
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.