PageSourceSearch

https://dlmneighborhood.ai/neighborhood/assets/index-CrWxx-PS.js

js dlmneighborhood.ai collected 2026-10-05 15:15:46 UTC 563,884 bytes, 16 lines download raw bytes

vendor: 4,672 bytes, line 1
1(function(){const i=document.createElement("link").relList;if(i&&i.supports&&i.supports("modulepreload"))return;for(const f of document.querySelectorAll('link[rel="modulepreload"]'))u(f);new MutationObserver(f=>{for(const h of f)if(h.type==="childList")for(const g of h.addedNodes)g.tagName==="LINK"&&g.rel==="modulepreload"&&u(g)}).observe(document,{childList:!0,subtree:!0});function r(f){const h={};return f.integrity&&(h.integrity=f.integrity),f.referrerPolicy&&(h.referrerPolicy=f.referrerPolicy),f.crossOrigin==="use-credentials"?h.credentials="include":f.crossOrigin==="anonymous"?h.credentials="omit":h.credentials="same-origin",h}function u(f){if(f.ep)return;f.ep=!0;const h=r(f);fetch(f.href,h)}})();function wp(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l}var au={exports:{}},$l={};var Rh;function wy(){if(Rh)return $l;Rh=1;var l=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function r(u,f,h){var g=null;if(h!==void 0&&(g=""+h),f.key!==void 0&&(g=""+f.key),"key"in f){h={};for(var w in f)w!=="key"&&(h[w]=f[w])}else h=f;return f=h.ref,{$$typeof:l,type:u,key:g,ref:f!==void 0?f:null,props:h}}return $l.Fragment=i,$l.jsx=r,$l.jsxs=r,$l}var Oh;function Sy(){return Oh||(Oh=1,au.exports=wy()),au.exports}var a=Sy(),nu={exports:{}},Se={};var zh;function Cy(){if(zh)return Se;zh=1;var l=Symbol.for("react.transitional.element"),i=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),h=Symbol.for("react.consumer"),g=Symbol.for("react.context"),w=Symbol.for("react.forward_ref"),b=Symbol.for("react.suspense"),x=Symbol.for("react.memo"),N=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),E=Symbol.iterator;function I(v){return v===null||typeof v!="object"?null:(v=E&&v[E]||v["@@iterator"],typeof v=="function"?v:null)}var $={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},V=Object.assign,P={};function G(v,j,S){this.props=v,this.context=j,this.refs=P,this.updater=S||$}G.prototype.isReactComponent={},G.prototype.setState=function(v,j){if(typeof v!="object"&&typeof v!="function"&&v!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,v,j,"setState")},G.prototype.forceUpdate=function(v){this.updater.enqueueForceUpdate(this,v,"forceUpdate")};function O(){}O.prototype=G.prototype;function D(v,j,S){this.props=v,this.context=j,this.refs=P,this.updater=S||$}var R=D.prototype=new O;R.constructor=D,V(R,G.prototype),R.isPureReactComponent=!0;var Z=Array.isArray;function k(){}var T={H:null,A:null,T:null,S:null},A=Object.prototype.hasOwnProperty;function se(v,j,S){var U=S.ref;return{$$typeof:l,type:v,key:j,ref:U!==void 0?U:null,props:S}}function J(v,j){return se(v.type,j,v.props)}function Q(v){return typeof v=="object"&&v!==null&&v.$$typeof===l}function te(v){var j={"=":"=0",":":"=2"};return"$"+v.replace(/[=:]/g,function(S){return j[S]})}var ne=/\/+/g;function ie(v,j){return typeof v=="object"&&v!==null&&v.key!=null?te(""+v.key):j.toString(36)}function ae(v){switch(v.status){case"fulfilled":return v.value;case"rejected":throw v.reason;default:switch(typeof v.status=="string"?v.then(k,k):(v.status="pending",v.then(function(j){v.status==="pending"&&(v.status="fulfilled",v.value=j)},function(j){v.status==="pending"&&(v.status="rejected",v.reason=j)})),v.status){case"fulfilled":return v.value;case"rejected":throw v.reason}}throw v}function C(v,j,S,U,le){var ue=typeof v;(ue==="undefined"||ue==="boolean")&&(v=null);var pe=!1;if(v===null)pe=!0;else switch(ue){case"bigint":case"string":case"number":pe=!0;break;case"object":switch(v.$$typeof){case l:case i:pe=!0;break;case N:return pe=v._init,C(pe(v._payload),j,S,U,le)}}if(pe)return le=le(v),pe=U===""?"."+ie(v,0):U,Z(le)?(S="",pe!=null&&(S=pe.replace(ne,"$&/")+"/"),C(le,j,S,"",function(Ue){return Ue})):le!=null&&(Q(le)&&(le=J(le,S+(le.key==null||v&&v.key===le.key?"":(""+le.key).replace(ne,"$&/")+"/")+pe)),j.push(le)),1;pe=0;var ye=U===""?".":U+":";if(Z(v))for(var je=0;je<v.length;je++)U=v[je],ue=ye+ie(U,je),pe+=C(U,j,S,ue,le);else if(je=I(v),typeof je=="function")for(v=je.call(v),je=0;!(U=v.next()).done;)U=U.value,ue=ye+ie(U,je++),pe+=C(U,j,S,ue,le);else if(ue==="object"){if(typeof v.then=="function")return C(ae(v),j,S,U,le);throw j=String(v),Error("Objects are not valid as a React child (found: "+(j==="[object Object]"?"object with keys {"+Object.keys(v).join(", ")+"}":j)+"). If you meant to render a collection of children, use an array instead.")}return pe}
vendor: 15,540 bytes, line 1
1function H(v,j,S){if(v==null)return v;var U=[],le=0;return C(v,U,"","",function(ue){return j.call(S,ue,le++)}),U}function re(v){if(v._status===-1){var j=v._result;j=j(),j.then(function(S){(v._status===0||v._status===-1)&&(v._status=1,v._result=S)},function(S){(v._status===0||v._status===-1)&&(v._status=2,v._result=S)}),v._status===-1&&(v._status=0,v._result=j)}if(v._status===1)return v._result.default;throw v._result}var de=typeof reportError=="function"?reportError:function(v){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var j=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof v=="object"&&v!==null&&typeof v.message=="string"?String(v.message):String(v),error:v});if(!window.dispatchEvent(j))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",v);return}console.error(v)},xe={map:H,forEach:function(v,j,S){H(v,function(){j.apply(this,arguments)},S)},count:function(v){var j=0;return H(v,function(){j++}),j},toArray:function(v){return H(v,function(j){return j})||[]},only:function(v){if(!Q(v))throw Error("React.Children.only expected to receive a single React element child.");return v}};return Se.Activity=p,Se.Children=xe,Se.Component=G,Se.Fragment=r,Se.Profiler=f,Se.PureComponent=D,Se.StrictMode=u,Se.Suspense=b,Se.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,Se.__COMPILER_RUNTIME={__proto__:null,c:function(v){return T.H.useMemoCache(v)}},Se.cache=function(v){return function(){return v.apply(null,arguments)}},Se.cacheSignal=function(){return null},Se.cloneElement=function(v,j,S){if(v==null)throw Error("The argument must be a React element, but you passed "+v+".");var U=V({},v.props),le=v.key;if(j!=null)for(ue in j.key!==void 0&&(le=""+j.key),j)!A.call(j,ue)||ue==="key"||ue==="__self"||ue==="__source"||ue==="ref"&&j.ref===void 0||(U[ue]=j[ue]);var ue=arguments.length-2;if(ue===1)U.children=S;else if(1<ue){for(var pe=Array(ue),ye=0;ye<ue;ye++)pe[ye]=arguments[ye+2];U.children=pe}return se(v.type,le,U)},Se.createContext=function(v){return v={$$typeof:g,_currentValue:v,_currentValue2:v,_threadCount:0,Provider:null,Consumer:null},v.Provider=v,v.Consumer={$$typeof:h,_context:v},v},Se.createElement=function(v,j,S){var U,le={},ue=null;if(j!=null)for(U in j.key!==void 0&&(ue=""+j.key),j)A.call(j,U)&&U!=="key"&&U!=="__self"&&U!=="__source"&&(le[U]=j[U]);var pe=arguments.length-2;if(pe===1)le.children=S;else if(1<pe){for(var ye=Array(pe),je=0;je<pe;je++)ye[je]=arguments[je+2];le.children=ye}if(v&&v.defaultProps)for(U in pe=v.defaultProps,pe)le[U]===void 0&&(le[U]=pe[U]);return se(v,ue,le)},Se.createRef=function(){return{current:null}},Se.forwardRef=function(v){return{$$typeof:w,render:v}},Se.isValidElement=Q,Se.lazy=function(v){return{$$typeof:N,_payload:{_status:-1,_result:v},_init:re}},Se.memo=function(v,j){return{$$typeof:x,type:v,compare:j===void 0?null:j}},Se.startTransition=function(v){var j=T.T,S={};T.T=S;try{var U=v(),le=T.S;le!==null&&le(S,U),typeof U=="object"&&U!==null&&typeof U.then=="function"&&U.then(k,de)}catch(ue){de(ue)}finally{j!==null&&S.types!==null&&(j.types=S.types),T.T=j}},Se.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},Se.use=function(v){return T.H.use(v)},Se.useActionState=function(v,j,S){return T.H.useActionState(v,j,S)},Se.useCallback=function(v,j){return T.H.useCallback(v,j)},Se.useContext=function(v){return T.H.useContext(v)},Se.useDebugValue=function(){},Se.useDeferredValue=function(v,j){return T.H.useDeferredValue(v,j)},Se.useEffect=function(v,j){return T.H.useEffect(v,j)},Se.useEffectEvent=function(v){return T.H.useEffectEvent(v)},Se.useId=function(){return T.H.useId()},Se.useImperativeHandle=function(v,j,S){return T.H.useImperativeHandle(v,j,S)},Se.useInsertionEffect=function(v,j){return T.H.useInsertionEffect(v,j)},Se.useLayoutEffect=function(v,j){return T.H.useLayoutEffect(v,j)},Se.useMemo=function(v,j){return T.H.useMemo(v,j)},Se.useOptimistic=function(v,j){return T.H.useOptimistic(v,j)},Se.useReducer=function(v,j,S){return T.H.useReducer(v,j,S)},Se.useRef=function(v){return T.H.useRef(v)},Se.useState=function(v){return T.H.useState(v)},Se.useSyncExternalStore=function(v,j,S){return T.H.useSyncExternalStore(v,j,S)},Se.useTransition=function(){return T.H.useTransition()},Se.version="19.2.7",Se}var Bh;function Eu(){return Bh||(Bh=1,nu.exports=Cy()),nu.exports}var m=Eu();const oe=wp(m);var lu={exports:{}},Yl={},iu={exports:{}},ru={};var Dh;function ky(){return Dh||(Dh=1,(function(l){function i(C,H){var re=C.length;C.push(H);e:for(;0<re;){var de=re-1>>>1,xe=C[de];if(0<f(xe,H))C[de]=H,C[re]=xe,re=de;else break e}}function r(C){return C.length===0?null:C[0]}function u(C){if(C.length===0)return null;var H=C[0],re=C.pop();if(re!==H){C[0]=re;e:for(var de=0,xe=C.length,v=xe>>>1;de<v;){var j=2*(de+1)-1,S=C[j],U=j+1,le=C[U];if(0>f(S,re))U<xe&&0>f(le,S)?(C[de]=le,C[U]=re,de=U):(C[de]=S,C[j]=re,de=j);else if(U<xe&&0>f(le,re))C[de]=le,C[U]=re,de=U;else break e}}return H}function f(C,H){var re=C.sortIndex-H.sortIndex;return re!==0?re:C.id-H.id}if(l.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var h=performance;l.unstable_now=function(){return h.now()}}else{var g=Date,w=g.now();l.unstable_now=function(){return g.now()-w}}var b=[],x=[],N=1,p=null,E=3,I=!1,$=!1,V=!1,P=!1,G=typeof setTimeout=="function"?setTimeout:null,O=typeof clearTimeout=="function"?clearTimeout:null,D=typeof setImmediate<"u"?setImmediate:null;function R(C){for(var H=r(x);H!==null;){if(H.callback===null)u(x);else if(H.startTime<=C)u(x),H.sortIndex=H.expirationTime,i(b,H);else break;H=r(x)}}function Z(C){if(V=!1,R(C),!$)if(r(b)!==null)$=!0,k||(k=!0,te());else{var H=r(x);H!==null&&ae(Z,H.startTime-C)}}var k=!1,T=-1,A=5,se=-1;function J(){return P?!0:!(l.unstable_now()-se<A)}function Q(){if(P=!1,k){var C=l.unstable_now();se=C;var H=!0;try{e:{$=!1,V&&(V=!1,O(T),T=-1),I=!0;var re=E;try{t:{for(R(C),p=r(b);p!==null&&!(p.expirationTime>C&&J());){var de=p.callback;if(typeof de=="function"){p.callback=null,E=p.priorityLevel;var xe=de(p.expirationTime<=C);if(C=l.unstable_now(),typeof xe=="function"){p.callback=xe,R(C),H=!0;break t}p===r(b)&&u(b),R(C)}else u(b);p=r(b)}if(p!==null)H=!0;else{var v=r(x);v!==null&&ae(Z,v.startTime-C),H=!1}}break e}finally{p=null,E=re,I=!1}H=void 0}}finally{H?te():k=!1}}}var te;if(typeof D=="function")te=function(){D(Q)};else if(typeof MessageChannel<"u"){var ne=new MessageChannel,ie=ne.port2;ne.port1.onmessage=Q,te=function(){ie.postMessage(null)}}else te=function(){G(Q,0)};function ae(C,H){T=G(function(){C(l.unstable_now())},H)}l.unstable_IdlePriority=5,l.unstable_ImmediatePriority=1,l.unstable_LowPriority=4,l.unstable_NormalPriority=3,l.unstable_Profiling=null,l.unstable_UserBlockingPriority=2,l.unstable_cancelCallback=function(C){C.callback=null},l.unstable_forceFrameRate=function(C){0>C||125<C?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):A=0<C?Math.floor(1e3/C):5},l.unstable_getCurrentPriorityLevel=function(){return E},l.unstable_next=function(C){switch(E){case 1:case 2:case 3:var H=3;break;default:H=E}var re=E;E=H;try{return C()}finally{E=re}},l.unstable_requestPaint=function(){P=!0},l.unstable_runWithPriority=function(C,H){switch(C){case 1:case 2:case 3:case 4:case 5:break;default:C=3}var re=E;E=C;try{return H()}finally{E=re}},l.unstable_scheduleCallback=function(C,H,re){var de=l.unstable_now();switch(typeof re=="object"&&re!==null?(re=re.delay,re=typeof re=="number"&&0<re?de+re:de):re=de,C){case 1:var xe=-1;break;case 2:xe=250;break;case 5:xe=1073741823;break;case 4:xe=1e4;break;default:xe=5e3}return xe=re+xe,C={id:N++,callback:H,priorityLevel:C,startTime:re,expirationTime:xe,sortIndex:-1},re>de?(C.sortIndex=re,i(x,C),r(b)===null&&C===r(x)&&(V?(O(T),T=-1):V=!0,ae(Z,re-de))):(C.sortIndex=xe,i(b,C),$||I||($=!0,k||(k=!0,te()))),C},l.unstable_shouldYield=J,l.unstable_wrapCallback=function(C){var H=E;return function(){var re=E;E=H;try{return C.apply(this,arguments)}finally{E=re}}}})(ru)),ru}var Uh;function _y(){return Uh||(Uh=1,iu.exports=ky()),iu.exports}var ou={exports:{}},St={};var Lh;function Ey(){if(Lh)return St;Lh=1;var l=Eu();function i(b){var x="https://react.dev/errors/"+b;if(1<arguments.length){x+="?args[]="+encodeURIComponent(arguments[1]);for(var N=2;N<arguments.length;N++)x+="&args[]="+encodeURIComponent(arguments[N])}return"Minified React error #"+b+"; visit "+x+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var u={d:{f:r,r:function(){throw Error(i(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},f=Symbol.for("react.portal");function h(b,x,N){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:f,key:p==null?null:""+p,children:b,containerInfo:x,implementation:N}}var g=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function w(b,x){if(b==="font")return"";if(typeof x=="string")return x==="use-credentials"?x:""}return St.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=u,St.createPortal=function(b,x){var N=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!x||x.nodeType!==1&&x.nodeType!==9&&x.nodeType!==11)throw Error(i(299));return h(b,x,null,N)},St.flushSync=function(b){var x=g.T,N=u.p;try{if(g.T=null,u.p=2,b)return b()}finally{g.T=x,u.p=N,u.d.f()}},St.preconnect=function(b,x){typeof b=="string"&&(x?(x=x.crossOrigin,x=typeof x=="string"?x==="use-credentials"?x:"":void 0):x=null,u.d.C(b,x))},St.prefetchDNS=function(b){typeof b=="string"&&u.d.D(b)},St.preinit=function(b,x){if(typeof b=="string"&&x&&typeof x.as=="string"){var N=x.as,p=w(N,x.crossOrigin),E=typeof x.integrity=="string"?x.integrity:void 0,I=typeof x.fetchPriority=="string"?x.fetchPriority:void 0;N==="style"?u.d.S(b,typeof x.precedence=="string"?x.precedence:void 0,{crossOrigin:p,integrity:E,fetchPriority:I}):N==="script"&&u.d.X(b,{crossOrigin:p,integrity:E,fetchPriority:I,nonce:typeof x.nonce=="string"?x.nonce:void 0})}},St.preinitModule=function(b,x){if(typeof b=="string")if(typeof x=="object"&&x!==null){if(x.as==null||x.as==="script"){var N=w(x.as,x.crossOrigin);u.d.M(b,{crossOrigin:N,integrity:typeof x.integrity=="string"?x.integrity:void 0,nonce:typeof x.nonce=="string"?x.nonce:void 0})}}else x==null&&u.d.M(b)},St.preload=function(b,x){if(typeof b=="string"&&typeof x=="object"&&x!==null&&typeof x.as=="string"){var N=x.as,p=w(N,x.crossOrigin);u.d.L(b,N,{crossOrigin:p,integrity:typeof x.integrity=="string"?x.integrity:void 0,nonce:typeof x.nonce=="string"?x.nonce:void 0,type:typeof x.type=="string"?x.type:void 0,fetchPriority:typeof x.fetchPriority=="string"?x.fetchPriority:void 0,referrerPolicy:typeof x.referrerPolicy=="string"?x.referrerPolicy:void 0,imageSrcSet:typeof x.imageSrcSet=="string"?x.imageSrcSet:void 0,imageSizes:typeof x.imageSizes=="string"?x.imageSizes:void 0,media:typeof x.media=="string"?x.media:void 0})}},St.preloadModule=function(b,x){if(typeof b=="string")if(x){var N=w(x.as,x.crossOrigin);u.d.m(b,{as:typeof x.as=="string"&&x.as!=="script"?x.as:void 0,crossOrigin:N,integrity:typeof x.integrity=="string"?x.integrity:void 0})}else u.d.m(b)},St.requestFormReset=function(b){u.d.r(b)},St.unstable_batchedUpdates=function(b,x){return b(x)},St.useFormState=function(b,x,N){return g.H.useFormState(b,x,N)},St.useFormStatus=function(){return g.H.useHostTransitionStatus()},St.version="19.2.7",St}var qh;function Sp(){if(qh)return ou.exports;qh=1;function l(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(i){console.error(i)}}return l(),ou.exports=Ey(),ou.exports}var Hh;function Ty(){if(Hh)return Yl;Hh=1;var l=_y(),i=Eu(),r=Sp();function u(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)t+="&args[]="+encodeURIComponent(arguments[s])}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 f(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function h(e){var t=e,s=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(s=t.return),e=t.return;while(e)}return t.tag===3?s:null}function g(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function w(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function b(e){if(h(e)!==e)throw Error(u(188))}function x(e){var t=e.alternate;if(!t){if(t=h(e),t===null)throw Error(u(188));return t!==e?null:e}for(var s=e,n=t;;){var o=s.return;if(o===null)break;var c=o.alternate;if(c===null){if(n=o.return,n!==null){s=n;continue}break}if(o.child===c.child){for(c=o.child;c;){if(c===s)return b(o),e;if(c===n)return b(o),t;c=c.sibling}throw Error(u(188))}if(s.return!==n.return)s=o,n=c;else{for(var d=!1,y=o.child;y;){if(y===s){d=!0,s=o,n=c;break}if(y===n){d=!0,n=o,s=c;break}y=y.sibling}if(!d){for(y=c.child;y;){if(y===s){d=!0,s=c,n=o;break}if(y===n){d=!0,n=c,s=o;break}y=y.sibling}if(!d)throw Error(u(189))}}if(s.alternate!==n)throw Error(u(190))}if(s.tag!==3)throw Error(u(188));return s.stateNode.current===s?e:t}function N(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=N(e),t!==null)return t;e=e.sibling}return null}var p=Object.assign,E=Symbol.for("react.element"),I=Symbol.for("react.transitional.element"),$=Symbol.for("react.portal"),V=Symbol.for("react.fragment"),P=Symbol.for("react.strict_mode"),G=Symbol.for("react.profiler"),O=Symbol.for("react.consumer"),D=Symbol.for("react.context"),R=Symbol.for("react.forward_ref"),Z=Symbol.for("react.suspense"),k=Symbol.for("react.suspense_list"),T=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),se=Symbol.for("react.activity"),J=Symbol.for("react.memo_cache_sentinel"),Q=Symbol.iterator;function te(e){return e===null||typeof e!="object"?null:(e=Q&&e[Q]||e["@@iterator"],typeof e=="function"?e:null)}var ne=Symbol.for("react.client.reference");function ie(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ne?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case V:return"Fragment";case G:return"Profiler";case P:return"StrictMode";case Z:return"Suspense";case k:return"SuspenseList";case se:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case $:return"Portal";case D:return e.displayName||"Context";case O:return(e._context.displayName||"Context")+".Consumer";case R:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case T:return t=e.displayName||null,t!==null?t:ie(e.type)||"Memo";case A:t=e._payload,e=e._init;try{return ie(e(t))}catch{}}return null}var ae=Array.isArray,C=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,re={pending:!1,data:null,method:null,action:null},de=[],xe=-1;function v(e){return{current:e}}function j(e){0>xe||(e.current=de[xe],de[xe]=null,xe--)}function S(e,t){xe++,de[xe]=e.current,e.current=t}var U=v(null),le=v(null),ue=v(null),pe=v(null);function ye(e,t){switch(S(ue,t),S(le,e),S(U,null),t.nodeType){case 9:case 11:e=(e
vendor: 11,614 bytes, lines 1-8
1=t.documentElement)&&(e=e.namespaceURI)?th(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=th(t),e=sh(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}j(U),S(U,e)}function je(){j(U),j(le),j(ue)}function Ue(e){e.memoizedState!==null&&S(pe,e);var t=U.current,s=sh(t,e.type);t!==s&&(S(le,e),S(U,s))}function gt(e){le.current===e&&(j(U),j(le)),pe.current===e&&(j(pe),Ul._currentValue=re)}var Ct,Ts;function me(e){if(Ct===void 0)try{throw Error()}catch(s){var t=s.stack.trim().match(/\n( *(at )?)/);Ct=t&&t[1]||"",Ts=-1<s.stack.indexOf(`
2    at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
3`+Ct+e+Ts}var ce=!1;function Te(e,t){if(!e||ce)return"";ce=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var n={DetermineComponentFrameRoot:function(){try{if(t){var ee=function(){throw Error()};if(Object.defineProperty(ee.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ee,[])}catch(X){var Y=X}Reflect.construct(e,[],ee)}else{try{ee.call()}catch(X){Y=X}e.call(ee.prototype)}}else{try{throw Error()}catch(X){Y=X}(ee=e())&&typeof ee.catch=="function"&&ee.catch(function(){})}}catch(X){if(X&&Y&&typeof X.stack=="string")return[X.stack,Y.stack]}return[null,null]}};n.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var o=Object.getOwnPropertyDescriptor(n.DetermineComponentFrameRoot,"name");o&&o.configurable&&Object.defineProperty(n.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var c=n.DetermineComponentFrameRoot(),d=c[0],y=c[1];if(d&&y){var _=d.split(`
4`),q=y.split(`
5`);for(o=n=0;n<_.length&&!_[n].includes("DetermineComponentFrameRoot");)n++;for(;o<q.length&&!q[o].includes("DetermineComponentFrameRoot");)o++;if(n===_.length||o===q.length)for(n=_.length-1,o=q.length-1;1<=n&&0<=o&&_[n]!==q[o];)o--;for(;1<=n&&0<=o;n--,o--)if(_[n]!==q[o]){if(n!==1||o!==1)do if(n--,o--,0>o||_[n]!==q[o]){var F=`
6`+_[n].replace(" at new "," at ");return e.displayName&&F.includes("<anonymous>")&&(F=F.replace("<anonymous>",e.displayName)),F}while(1<=n&&0<=o);break}}}finally{ce=!1,Error.prepareStackTrace=s}return(s=e?e.displayName||e.name:"")?me(s):""}function st(e,t){switch(e.tag){case 26:case 27:case 5:return me(e.type);case 16:return me("Lazy");case 13:return e.child!==t&&t!==null?me("Suspense Fallback"):me("Suspense");case 19:return me("SuspenseList");case 0:case 15:return Te(e.type,!1);case 11:return Te(e.type.render,!1);case 1:return Te(e.type,!0);case 31:return me("Activity");default:return""}}function fs(e){try{var t="",s=null;do t+=st(e,s),s=e,e=e.return;while(e);return t}catch(n){return`
7Error generating stack: `+n.message+`
8`+n.stack}}var Gt=Object.prototype.hasOwnProperty,Kn=l.unstable_scheduleCallback,Jn=l.unstable_cancelCallback,kt=l.unstable_shouldYield,Is=l.unstable_requestPaint,_t=l.unstable_now,Gr=l.unstable_getCurrentPriorityLevel,Sa=l.unstable_ImmediatePriority,Pl=l.unstable_UserBlockingPriority,Ca=l.unstable_NormalPriority,In=l.unstable_LowPriority,As=l.unstable_IdlePriority,ei=l.log,Fs=l.unstable_setDisableYieldValue,ka=null,Et=null;function ms(e){if(typeof ei=="function"&&Fs(e),Et&&typeof Et.setStrictMode=="function")try{Et.setStrictMode(ka,e)}catch{}}var jt=Math.clz32?Math.clz32:vs,Zr=Math.log,Fn=Math.LN2;function vs(e){return e>>>=0,e===0?32:31-(Zr(e)/Fn|0)|0}var Wa=256,Pa=262144,_a=4194304;function Ns(e){var t=e&42;if(t!==0)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:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function we(e,t,s){var n=e.pendingLanes;if(n===0)return 0;var o=0,c=e.suspendedLanes,d=e.pingedLanes;e=e.warmLanes;var y=n&134217727;return y!==0?(n=y&~c,n!==0?o=Ns(n):(d&=y,d!==0?o=Ns(d):s||(s=y&~e,s!==0&&(o=Ns(s))))):(y=n&~c,y!==0?o=Ns(y):d!==0?o=Ns(d):s||(s=n&~e,s!==0&&(o=Ns(s)))),o===0?0:t!==0&&t!==o&&(t&c)===0&&(c=o&-o,s=t&-t,c>=s||c===32&&(s&4194048)!==0)?t:o}function Xe(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ft(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;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function wt(){var e=_a;return _a<<=1,(_a&62914560)===0&&(_a=4194304),e}function Ws(e){for(var t=[],s=0;31>s;s++)t.push(e);return t}function Ke(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Mt(e,t,s,n,o,c){var d=e.pendingLanes;e.pendingLanes=s,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=s,e.entangledLanes&=s,e.errorRecoveryDisabledLanes&=s,e.shellSuspendCounter=0;var y=e.entanglements,_=e.expirationTimes,q=e.hiddenUpdates;for(s=d&~s;0<s;){var F=31-jt(s),ee=1<<F;y[F]=0,_[F]=-1;var Y=q[F];if(Y!==null)for(q[F]=null,F=0;F<Y.length;F++){var X=Y[F];X!==null&&(X.lane&=-536870913)}s&=~ee}n!==0&&Ea(e,n,0),c!==0&&o===0&&e.tag!==0&&(e.suspendedLanes|=c&~(d&~t))}function Ea(e,t,s){e.pendingLanes|=t,e.suspendedLanes&=~t;var n=31-jt(t);e.entangledLanes|=t,e.entanglements[n]=e.entanglements[n]|1073741824|s&261930}function Rt(e,t){var s=e.entangledLanes|=t;for(e=e.entanglements;s;){var n=31-jt(s),o=1<<n;o&t|e[n]&t&&(e[n]|=t),s&=~o}}function Ot(e,t){var s=t&-t;return s=(s&42)!==0?1:en(s),(s&(e.suspendedLanes|t))!==0?0:s}function en(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 hs(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Xr(){var e=H.p;return e!==0?e:(e=window.event,e===void 0?32:Ch(e.type))}function Hu(e,t){var s=H.p;try{return H.p=e,t()}finally{H.p=s}}var Ps=Math.random().toString(36).slice(2),xt="__reactFiber$"+Ps,zt="__reactProps$"+Ps,tn="__reactContainer$"+Ps,Qr="__reactEvents$"+Ps,fg="__reactListeners$"+Ps,mg="__reactHandles$"+Ps,$u="__reactResources$"+Ps,Wn="__reactMarker$"+Ps;function Kr(e){delete e[xt],delete e[zt],delete e[Qr],delete e[fg],delete e[mg]}function sn(e){var t=e[xt];if(t)return t;for(var s=e.parentNode;s;){if(t=s[tn]||s[xt]){if(s=t.alternate,t.child!==null||s!==null&&s.child!==null)for(e=ch(e);e!==null;){if(s=e[xt])return s;e=ch(e)}return t}e=s,s=e.parentNode}return null}function an(e){if(e=e[xt]||e[tn]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Pn(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(u(33))}function nn(e){var t=e[$u];return t||(t=e[$u]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function mt(e){e[Wn]=!0}var Yu=new Set,Vu={};function Ta(e,t){ln(e,t),ln(e+"Capture",t)}function ln(e,t){for(Vu[e]=t,e=0;e<t.length;e++)Yu.add(t[e])}var hg=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]*$"),Gu={},Zu={};function pg(e){return Gt.call(Zu,e)?!0:Gt.call(Gu,e)?!1:hg.test(e)?Zu[e]=!0:(Gu[e]=!0,!1)}function ti(e,t,s){if(pg(t))if(s===null)e.removeAttribute(t);else{switch(typeof s){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var n=t.toLowerCase().slice(0,5);if(n!=="data-"&&n!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+s)}}function si(e,t,s){if(s===null)e.removeAttribute(t);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+s)}}function Ms(e,t,s,n){if(n===null)e.removeAttribute(s);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(s);return}e.setAttributeNS(t,s,""+n)}}function ts(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Xu(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function gg(e,t,s){var n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,c=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(d){s=""+d,c.call(this,d)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return s},setValue:function(d){s=""+d},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Jr(e){if(!e._valueTracker){var t=Xu(e)?"checked":"value";e._valueTracker=gg(e,t,""+e[t])}}function Qu(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var s=t.getValue(),n="";return e&&(n=Xu(e)?e.checked?"true":"false":e.value),e=n,e!==s?(t.setValue(e),!0):!1}function ai(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var xg=/[\n"\\]/g;function ss(e){return e.replace(xg,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Ir(e,t,s,n,o,c,d,y){e.name="",d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"?e.type=d:e.removeAttribute("type"),t!=null?d==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+ts(t)):e.value!==""+ts(t)&&(e.value=""+ts(t)):d!=="submit"&&d!=="reset"||e.removeAttribute("value"),t!=null?Fr(e,d,ts(t)):s!=null?Fr(e,d,ts(s)):n!=null&&e.removeAttribute("value"),o==null&&c!=null&&(e.defaultChecked=!!c),o!=null&&(e.checked=o&&typeof o!="function"&&typeof o!="symbol"),y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"?e.name=""+ts(y):e.removeAttribute("name")}function Ku(e,t,s,n,o,c,d,y){if(c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"&&(e.type=c),t!=null||s!=null){if(!(c!=="submit"&&c!=="reset"||t!=null)){Jr(e);return}s=s!=null?""+ts(s):"",t=t!=null?""+ts(t):s,y||t===e.value||(e.value=t),e.defaultValue=t}n=n??o,n=typeof n!="function"&&typeof n!="symbol"&&!!n,e.checked=y?e.checked:!!n,e.defaultChecked=!!n,d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(e.name=d),Jr(e)}function Fr(e,t,s){t==="number"&&ai(e.ownerDocument)===e||e.defaultValue===""+s||(e.defaultValue=""+s)}function rn(e,t,s,n){if(e=e.options,t){t={};for(var o=0;o<s.length;o++)t["$"+s[o]]=!0;for(s=0;s<e.length;s++)o=t.hasOwnProperty("$"+e[s].value),e[s].selected!==o&&(e[s].selected=o),o&&n&&(e[s].defaultSelected=!0)}else{for(s=""+ts(s),t=null,o=0;o<e.length;o++){if(e[o].value===s){e[o].selected=!0,n&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}
vendor: 4,574 bytes, line 8
8function Ju(e,t,s){if(t!=null&&(t=""+ts(t),t!==e.value&&(e.value=t),s==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=s!=null?""+ts(s):""}function Iu(e,t,s,n){if(t==null){if(n!=null){if(s!=null)throw Error(u(92));if(ae(n)){if(1<n.length)throw Error(u(93));n=n[0]}s=n}s==null&&(s=""),t=s}s=ts(t),e.defaultValue=s,n=e.textContent,n===s&&n!==""&&n!==null&&(e.value=n),Jr(e)}function on(e,t){if(t){var s=e.firstChild;if(s&&s===e.lastChild&&s.nodeType===3){s.nodeValue=t;return}}e.textContent=t}var yg=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 Fu(e,t,s){var n=t.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?n?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":n?e.setProperty(t,s):typeof s!="number"||s===0||yg.has(t)?t==="float"?e.cssFloat=s:e[t]=(""+s).trim():e[t]=s+"px"}function Wu(e,t,s){if(t!=null&&typeof t!="object")throw Error(u(62));if(e=e.style,s!=null){for(var n in s)!s.hasOwnProperty(n)||t!=null&&t.hasOwnProperty(n)||(n.indexOf("--")===0?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="");for(var o in t)n=t[o],t.hasOwnProperty(o)&&s[o]!==n&&Fu(e,o,n)}else for(var c in t)t.hasOwnProperty(c)&&Fu(e,c,t[c])}function Wr(e){if(e.indexOf("-")===-1)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 bg=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
8-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"]]),vg=/^[\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 ni(e){return vg.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Rs(){}var Pr=null;function eo(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var cn=null,un=null;function Pu(e){var t=an(e);if(t&&(e=t.stateNode)){var s=e[zt]||null;e:switch(e=t.stateNode,t.type){case"input":if(Ir(e,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),t=s.name,s.type==="radio"&&t!=null){for(s=e;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+ss(""+t)+'"][type="radio"]'),t=0;t<s.length;t++){var n=s[t];if(n!==e&&n.form===e.form){var o=n[zt]||null;if(!o)throw Error(u(90));Ir(n,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name)}}for(t=0;t<s.length;t++)n=s[t],n.form===e.form&&Qu(n)}break e;case"textarea":Ju(e,s.value,s.defaultValue);break e;case"select":t=s.value,t!=null&&rn(e,!!s.multiple,t,!1)}}}var to=!1;function ed(e,t,s){if(to)return e(t,s);to=!0;try{var n=e(t);return n}finally{if(to=!1,(cn!==null||un!==null)&&(Zi(),cn&&(t=cn,e=un,un=cn=null,Pu(t),e)))for(t=0;t<e.length;t++)Pu(e[t])}}function el(e,t){var s=e.stateNode;if(s===null)return null;var n=s[zt]||null;if(n===null)return null;s=n[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":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(s&&typeof s!="function")throw Error(u(231,t,typeof s));return s}var Os=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),so=!1;if(Os)try{var tl={};Object.defineProperty(tl,"passive",{get:function(){so=!0}}),window.addEventListener("test",tl,tl),window.removeEventListener("test",tl,tl)}catch{so=!1}var ea=null,ao=null,li=null;function td(){if(li)return li;var e,t=ao,s=t.length,n,o="value"in ea?ea.value:ea.textContent,c=o.length;for(e=0;e<s&&t[e]===o[e];e++);var d=s-e;for(n=1;n<=d&&t[s-n]===o[c-n];n++);return li=o.slice(e,1<n?1-n:void 0)}function ii(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function ri(){return!0}function sd(){return!1}function Bt(e){function t(s,n,o,c,d){this._reactName=s,this._targetInst=o,this.type=n,this.nativeEvent=c,this.target=d,this.currentTarget=null;for(var y in e)e.hasOwnProperty(y)&&(s=e[y],this[y]=s?s(c):c[y]);return this.isDefaultPrevented=(c.defaultPrevented!=null?c.defaultPrevented:c.returnValue===!1)?ri:sd,this.isPropagationStopped=sd,this}return p(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=ri)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=ri)},persist:function(){},isPersistent:ri}),t}var Aa={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},oi=Bt(Aa),sl=p({},Aa,{view:0,detail:0}),Ng=Bt(sl),no,lo,al,ci=p({},sl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ro,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==al&&(al&&e.type==="mousemove"?(no=e.screenX-al.screenX,lo=e.screenY-al.screenY):lo=no=0,al=e),no)},movementY:function(e){return"movementY"in e?e.movementY:lo}}),ad=Bt(ci),jg=p({},ci,{dataTransfer:0}),wg=Bt(jg),Sg=p({},sl,{relatedTarget:0}),io=Bt(Sg),Cg=p({},Aa,{animationName:0,elapsedTime:0,pseudoElement:0}),kg=Bt(Cg),_g=p({},Aa,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Eg=Bt(_g),Tg=p({},Aa,{data:0}),nd=Bt(Tg),Ag={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Mg={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"},Rg={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Og(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Rg[e])?!!t[e]:!1}function ro(){return Og}var zg=p({},sl,{key:function(e){if(e.key){var t=Ag[e.key]||e.key;if(t!=="Unidentified")return t}
vendor: 4,866 bytes, line 8
8return e.type==="keypress"?(e=ii(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Mg[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ro,charCode:function(e){return e.type==="keypress"?ii(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ii(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Bg=Bt(zg),Dg=p({},ci,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ld=Bt(Dg),Ug=p({},sl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ro}),Lg=Bt(Ug),qg=p({},Aa,{propertyName:0,elapsedTime:0,pseudoElement:0}),Hg=Bt(qg),$g=p({},ci,{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}),Yg=Bt($g),Vg=p({},Aa,{newState:0,oldState:0}),Gg=Bt(Vg),Zg=[9,13,27,32],oo=Os&&"CompositionEvent"in window,nl=null;Os&&"documentMode"in document&&(nl=document.documentMode);var Xg=Os&&"TextEvent"in window&&!nl,id=Os&&(!oo||nl&&8<nl&&11>=nl),rd=" ",od=!1;function cd(e,t){switch(e){case"keyup":return Zg.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ud(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var dn=!1;function Qg(e,t){switch(e){case"compositionend":return ud(t);case"keypress":return t.which!==32?null:(od=!0,rd);case"textInput":return e=t.data,e===rd&&od?null:e;default:return null}}function Kg(e,t){if(dn)return e==="compositionend"||!oo&&cd(e,t)?(e=td(),li=ao=ea=null,dn=!1,e):null;switch(e){case"paste":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 id&&t.locale!=="ko"?null:t.data;default:return null}}var Jg={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 dd(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Jg[e.type]:t==="textarea"}function fd(e,t,s,n){cn?un?un.push(n):un=[n]:cn=n,t=Wi(t,"onChange"),0<t.length&&(s=new oi("onChange","change",null,s,n),e.push({event:s,listeners:t}))}var ll=null,il=null;function Ig(e){Jm(e,0)}function ui(e){var t=Pn(e);if(Qu(t))return e}function md(e,t){if(e==="change")return t}var hd=!1;if(Os){var co;if(Os){var uo="oninput"in document;if(!uo){var pd=document.createElement("div");pd.setAttribute("oninput","return;"),uo=typeof pd.oninput=="function"}co=uo}else co=!1;hd=co&&(!document.documentMode||9<document.documentMode)}function gd(){ll&&(ll.detachEvent("onpropertychange",xd),il=ll=null)}function xd(e){if(e.propertyName==="value"&&ui(il)){var t=[];fd(t,il,e,eo(e)),ed(Ig,t)}}function Fg(e,t,s){e==="focusin"?(gd(),ll=t,il=s,ll.attachEvent("onpropertychange",xd)):e==="focusout"&&gd()}function Wg(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ui(il)}function Pg(e,t){if(e==="click")return ui(t)}function ex(e,t){if(e==="input"||e==="change")return ui(t)}function tx(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Zt=typeof Object.is=="function"?Object.is:tx;function rl(e,t){if(Zt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var s=Object.keys(e),n=Object.keys(t);if(s.length!==n.length)return!1;for(n=0;n<s.length;n++){var o=s[n];if(!Gt.call(t,o)||!Zt(e[o],t[o]))return!1}return!0}function yd(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function bd(e,t){var s=yd(e);e=0;for(var n;s;){if(s.nodeType===3){if(n=e+s.textContent.length,e<=t&&n>=t)return{node:s,offset:t-e};e=n}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=yd(s)}}function vd(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?vd(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Nd(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=ai(e.document);t instanceof e.HTMLIFrameElement;){try{var s=typeof t.contentWindow.location.href=="string"}catch{s=!1}if(s)e=t.contentWindow;else break;t=ai(e.document)}return t}function fo(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var sx=Os&&"documentMode"in document&&11>=document.documentMode,fn=null,mo=null,ol=null,ho=!1;
vendor: 19,276 bytes, line 8
8function jd(e,t,s){var n=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;ho||fn==null||fn!==ai(n)||(n=fn,"selectionStart"in n&&fo(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),ol&&rl(ol,n)||(ol=n,n=Wi(mo,"onSelect"),0<n.length&&(t=new oi("onSelect","select",null,t,s),e.push({event:t,listeners:n}),t.target=fn)))}function Ma(e,t){var s={};return s[e.toLowerCase()]=t.toLowerCase(),s["Webkit"+e]="webkit"+t,s["Moz"+e]="moz"+t,s}var mn={animationend:Ma("Animation","AnimationEnd"),animationiteration:Ma("Animation","AnimationIteration"),animationstart:Ma("Animation","AnimationStart"),transitionrun:Ma("Transition","TransitionRun"),transitionstart:Ma("Transition","TransitionStart"),transitioncancel:Ma("Transition","TransitionCancel"),transitionend:Ma("Transition","TransitionEnd")},po={},wd={};Os&&(wd=document.createElement("div").style,"AnimationEvent"in window||(delete mn.animationend.animation,delete mn.animationiteration.animation,delete mn.animationstart.animation),"TransitionEvent"in window||delete mn.transitionend.transition);function Ra(e){if(po[e])return po[e];if(!mn[e])return e;var t=mn[e],s;for(s in t)if(t.hasOwnProperty(s)&&s in wd)return po[e]=t[s];return e}var Sd=Ra("animationend"),Cd=Ra("animationiteration"),kd=Ra("animationstart"),ax=Ra("transitionrun"),nx=Ra("transitionstart"),lx=Ra("transitioncancel"),_d=Ra("transitionend"),Ed=new Map,go="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(" ");go.push("scrollEnd");function ps(e,t){Ed.set(e,t),Ta(t,[e])}var di=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},as=[],hn=0,xo=0;function fi(){for(var e=hn,t=xo=hn=0;t<e;){var s=as[t];as[t++]=null;var n=as[t];as[t++]=null;var o=as[t];as[t++]=null;var c=as[t];if(as[t++]=null,n!==null&&o!==null){var d=n.pending;d===null?o.next=o:(o.next=d.next,d.next=o),n.pending=o}c!==0&&Td(s,o,c)}}function mi(e,t,s,n){as[hn++]=e,as[hn++]=t,as[hn++]=s,as[hn++]=n,xo|=n,e.lanes|=n,e=e.alternate,e!==null&&(e.lanes|=n)}function yo(e,t,s,n){return mi(e,t,s,n),hi(e)}function Oa(e,t){return mi(e,null,null,t),hi(e)}function Td(e,t,s){e.lanes|=s;var n=e.alternate;n!==null&&(n.lanes|=s);for(var o=!1,c=e.return;c!==null;)c.childLanes|=s,n=c.alternate,n!==null&&(n.childLanes|=s),c.tag===22&&(e=c.stateNode,e===null||e._visibility&1||(o=!0)),e=c,c=c.return;return e.tag===3?(c=e.stateNode,o&&t!==null&&(o=31-jt(s),e=c.hiddenUpdates,n=e[o],n===null?e[o]=[t]:n.push(t),t.lane=s|536870912),c):null}function hi(e){if(50<Al)throw Al=0,_c=null,Error(u(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var pn={};function ix(e,t,s,n){this.tag=e,this.key=s,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=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Xt(e,t,s,n){return new ix(e,t,s,n)}function bo(e){return e=e.prototype,!(!e||!e.isReactComponent)}function zs(e,t){var s=e.alternate;return s===null?(s=Xt(e.tag,t,e.key,e.mode),s.elementType=e.elementType,s.type=e.type,s.stateNode=e.stateNode,s.alternate=e,e.alternate=s):(s.pendingProps=t,s.type=e.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=e.flags&65011712,s.childLanes=e.childLanes,s.lanes=e.lanes,s.child=e.child,s.memoizedProps=e.memoizedProps,s.memoizedState=e.memoizedState,s.updateQueue=e.updateQueue,t=e.dependencies,s.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},s.sibling=e.sibling,s.index=e.index,s.ref=e.ref,s.refCleanup=e.refCleanup,s}function Ad(e,t){e.flags&=65011714;var s=e.alternate;return s===null?(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=s.childLanes,e.lanes=s.lanes,e.child=s.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=s.memoizedProps,e.memoizedState=s.memoizedState,e.updateQueue=s.updateQueue,e.type=s.type,t=s.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function pi(e,t,s,n,o,c){var d=0;if(n=e,typeof e=="function")bo(e)&&(d=1);else if(typeof e=="string")d=dy(e,s,U.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case se:return e=Xt(31,s,t,o),e.elementType=se,e.lanes=c,e;case V:return za(s.children,o,c,t);case P:d=8,o|=24;break;case G:return e=Xt(12,s,t,o|2),e.elementType=G,e.lanes=c,e;case Z:return e=Xt(13,s,t,o),e.elementType=Z,e.lanes=c,e;case k:return e=Xt(19,s,t,o),e.elementType=k,e.lanes=c,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case D:d=10;break e;case O:d=9;break e;case R:d=11;break e;case T:d=14;break e;case A:d=16,n=null;break e}d=29,s=Error(u(130,e===null?"null":typeof e,"")),n=null}return t=Xt(d,s,t,o),t.elementType=e,t.type=n,t.lanes=c,t}function za(e,t,s,n){return e=Xt(7,e,n,t),e.lanes=s,e}function vo(e,t,s){return e=Xt(6,e,null,t),e.lanes=s,e}function Md(e){var t=Xt(18,null,null,0);return t.stateNode=e,t}function No(e,t,s){return t=Xt(4,e.children!==null?e.children:[],e.key,t),t.lanes=s,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Rd=new WeakMap;function ns(e,t){if(typeof e=="object"&&e!==null){var s=Rd.get(e);return s!==void 0?s:(t={value:e,source:t,stack:fs(t)},Rd.set(e,t),t)}return{value:e,source:t,stack:fs(t)}}var gn=[],xn=0,gi=null,cl=0,ls=[],is=0,ta=null,js=1,ws="";function Bs(e,t){gn[xn++]=cl,gn[xn++]=gi,gi=e,cl=t}function Od(e,t,s){ls[is++]=js,ls[is++]=ws,ls[is++]=ta,ta=e;var n=js;e=ws;var o=32-jt(n)-1;n&=~(1<<o),s+=1;var c=32-jt(t)+o;if(30<c){var d=o-o%5;c=(n&(1<<d)-1).toString(32),n>>=d,o-=d,js=1<<32-jt(t)+o|s<<o|n,ws=c+e}else js=1<<c|s<<o|n,ws=e}function jo(e){e.return!==null&&(Bs(e,1),Od(e,1,0))}function wo(e){for(;e===gi;)gi=gn[--xn],gn[xn]=null,cl=gn[--xn],gn[xn]=null;for(;e===ta;)ta=ls[--is],ls[is]=null,ws=ls[--is],ls[is]=null,js=ls[--is],ls[is]=null}function zd(e,t){ls[is++]=js,ls[is++]=ws,ls[is++]=ta,js=t.id,ws=t.overflow,ta=e}var yt=null,Ge=null,Re=!1,sa=null,rs=!1,So=Error(u(519));function aa(e){var t=Error(u(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ul(ns(t,e)),So}function Bd(e){var t=e.stateNode,s=e.type,n=e.memoizedProps;switch(t[xt]=e,t[zt]=n,s){case"dialog":Ee("cancel",t),Ee("close",t);break;case"iframe":case"object":case"embed":Ee("load",t);break;case"video":case"audio":for(s=0;s<Rl.length;s++)Ee(Rl[s],t);break;case"source":Ee("error",t);break;case"img":case"image":case"link":Ee("error",t),Ee("load",t);break;case"details":Ee("toggle",t);break;case"input":Ee("invalid",t),Ku(t,n.value,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name,!0);break;case"select":Ee("invalid",t);break;case"textarea":Ee("invalid",t),Iu(t,n.value,n.defaultValue,n.children)}s=n.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||t.textContent===""+s||n.suppressHydrationWarning===!0||Pm(t.textContent,s)?(n.popover!=null&&(Ee("beforetoggle",t),Ee("toggle",t)),n.onScroll!=null&&Ee("scroll",t),n.onScrollEnd!=null&&Ee("scrollend",t),n.onClick!=null&&(t.onclick=Rs),t=!0):t=!1,t||aa(e,!0)}function Dd(e){for(yt=e.return;yt;)switch(yt.tag){case 5:case 31:case 13:rs=!1;return;case 27:case 3:rs=!0;return;default:yt=yt.return}}function yn(e){if(e!==yt)return!1;if(!Re)return Dd(e),Re=!0,!1;var t=e.tag,s;if((s=t!==3&&t!==27)&&((s=t===5)&&(s=e.type,s=!(s!=="form"&&s!=="button")||Yc(e.type,e.memoizedProps)),s=!s),s&&Ge&&aa(e),Dd(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(317));Ge=oh(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(317));Ge=oh(e)}else t===27?(t=Ge,xa(e.type)?(e=Qc,Qc=null,Ge=e):Ge=t):Ge=yt?cs(e.stateNode.nextSibling):null;return!0}function Ba(){Ge=yt=null,Re=!1}function Co(){var e=sa;return e!==null&&(qt===null?qt=e:qt.push.apply(qt,e),sa=null),e}function ul(e){sa===null?sa=[e]:sa.push(e)}var ko=v(null),Da=null,Ds=null;function na(e,t,s){S(ko,t._currentValue),t._currentValue=s}function Us(e){e._currentValue=ko.current,j(ko)}function _o(e,t,s){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===s)break;e=e.return}}function Eo(e,t,s,n){var o=e.child;for(o!==null&&(o.return=e);o!==null;){var c=o.dependencies;if(c!==null){var d=o.child;c=c.firstContext;e:for(;c!==null;){var y=c;c=o;for(var _=0;_<t.length;_++)if(y.context===t[_]){c.lanes|=s,y=c.alternate,y!==null&&(y.lanes|=s),_o(c.return,s,e),n||(d=null);break e}c=y.next}}else if(o.tag===18){if(d=o.return,d===null)throw Error(u(341));d.lanes|=s,c=d.alternate,c!==null&&(c.lanes|=s),_o(d,s,e),d=null}else d=o.child;if(d!==null)d.return=o;else for(d=o;d!==null;){if(d===e){d=null;break}if(o=d.sibling,o!==null){o.return=d.return,d=o;break}d=d.return}o=d}}function bn(e,t,s,n){e=null;for(var o=t,c=!1;o!==null;){if(!c){if((o.flags&524288)!==0)c=!0;else if((o.flags&262144)!==0)break}if(o.tag===10){var d=o.alternate;if(d===null)throw Error(u(387));if(d=d.memoizedProps,d!==null){var y=o.type;Zt(o.pendingProps.value,d.value)||(e!==null?e.push(y):e=[y])}}else if(o===pe.current){if(d=o.alternate,d===null)throw Error(u(387));d.memoizedState.memoizedState!==o.memoizedState.memoizedState&&(e!==null?e.push(Ul):e=[Ul])}o=o.return}e!==null&&Eo(t,e,s,n),t.flags|=262144}function xi(e){for(e=e.firstContext;e!==null;){if(!Zt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ua(e){Da=e,Ds=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function bt(e){return Ud(Da,e)}function yi(e,t){return Da===null&&Ua(e),Ud(e,t)}function Ud(e,t){var s=t._currentValue;if(t={context:t,memoizedValue:s,next:null},Ds===null){if(e===null)throw Error(u(308));Ds=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ds=Ds.next=t;return s}var rx=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(s,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(s){return s()})}},ox=l.unstable_scheduleCallback,cx=l.unstable_NormalPriority,at={$$typeof:D,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function To(){return{controller:new rx,data:new Map,refCount:0}}function dl(e){e.refCount--,e.refCount===0&&ox(cx,function(){e.controller.abort()})}var fl=null,Ao=0,vn=0,Nn=null;function ux(e,t){if(fl===null){var s=fl=[];Ao=0,vn=Oc(),Nn={status:"pending",value:void 0,then:function(n){s.push(n)}}}return Ao++,t.then(Ld,Ld),t}function Ld(){if(--Ao===0&&fl!==null){Nn!==null&&(Nn.status="fulfilled");var e=fl;fl=null,vn=0,Nn=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function dx(e,t){var s=[],n={status:"pending",value:null,reason:null,then:function(o){s.push(o)}};return e.then(function(){n.status="fulfilled",n.value=t;for(var o=0;o<s.length;o++)(0,s[o])(t)},function(o){for(n.status="rejected",n.reason=o,o=0;o<s.length;o++)(0,s[o])(void 0)}),n}var qd=C.S;C.S=function(e,t){wm=_t(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&ux(e,t),qd!==null&&qd(e,t)};var La=v(null);function Mo(){var e=La.current;return e!==null?e:Ve.pooledCache}function bi(e,t){t===null?S(La,La.current):S(La,t.pool)}function Hd(){var e=Mo();return e===null?null:{parent:at._currentValue,pool:e}}var jn=Error(u(460)),Ro=Error(u(474)),vi=Error(u(542)),Ni={then:function(){}};function $d(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Yd(e,t,s){switch(s=e[s],s===void 0?e.push(t):s!==t&&(t.then(Rs,Rs),t=s),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Gd(e),e;default:if(typeof t.status=="string")t.then(Rs,Rs);else{if(e=Ve,e!==null&&100<e.shellSuspendCounter)throw Error(u(482));e=t,e.status="pending",e.then(function(n){if(t.status==="pending"){var o=t;o.status="fulfilled",o.value=n}},function(n){if(t.status==="pending"){var o=t;o.status="rejected",o.reason=n}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Gd(e),e}throw Ha=t,jn}}function qa(e){try{var t=e._init;return t(e._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(Ha=s,jn):s}}var Ha=null;function Vd(){if(Ha===null)throw Error(u(459));var e=Ha;return Ha=null,e}function Gd(e){if(e===jn||e===vi)throw Error(u(483))}var wn=null,ml=0;function ji(e){var t=ml;return ml+=1,wn===null&&(wn=[]),Yd(wn,e,t)}function hl(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function wi(e,t){throw t.$$typeof===E?Error(u(525)):(e=Object.prototype.toString.call(t),Error(u(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Zd(e){function t(z,M){if(e){var L=z.deletions;L===null?(z.deletions=[M],z.flags|=16):L.push(M)}}function s(z,M){if(!e)return null;for(;M!==null;)t(z,M),M=M.sibling;return null}function n(z){for(var M=new Map;z!==null;)z.key!==null?M.set(z.key,z):M.set(z.index,z),z=z.sibling;return M}function o(z,M){return z=zs(z,M),z.index=0,z.sibling=null,z}function c(z,M,L){return z.index=L,e?(L=z.alternate,L!==null?(L=L.index,L<M?(z.flags|=67108866,M):L):(z.flags|=67108866,M)):(z.flags|=1048576,M)}function d(z){return e&&z.alternate===null&&(z.flags|=67108866),z}function y(z,M,L,W){return M===null||M.tag!==6?(M=vo(L,z.mode,W),M.return=z,M):(M=o(M,L),M.return=z,M)}function _(z,M,L,W){var ve=L.type;return ve===V?F(z,M,L.props.children,W,L.key):M!==null&&(M.elementType===ve||typeof ve=="object"&&ve!==null&&ve.$$typeof===A&&qa(ve)===M.type)?(M=o(M,L.props),hl(M,L),M.return=z,M):(M=pi(L.type,L.key,L.props,null,z.mode,W),hl(M,L),M.return=z,M)}function q(z,M,L,W){return M===null||M.tag!==4||M.stateNode.containerInfo!==L.containerInfo||M.stateNode.implementation!==L.implementation?(M=No(L,z.mode,W),M.return=z,M):(M=o(M,L.children||[]),M.return=z,M)}function F(z,M,L,W,ve){return M===null||M.tag!==7?(M=za(L,z.mode,W,ve),M.return=z,M):(M=o(M,L),M.return=z,M)}function ee(z,M,L){if(typeof M=="string"&&M!==""||typeof M=="number"||typeof M=="bigint")return M=vo(""+M,z.mode,L),M.return=z,M;if(typeof M=="object"&&M!==null){switch(M.$$typeof){case I:return L=pi(M.type,M.key,M.props,null,z.mode,L),hl(L,M),L.return=z,L;case $:return M=No(M,z.mode,L),M.return=z,M;case A:return M=qa(M),ee(z,M,L)}if(ae(M)||te(M))return M=za(M,z.mode,L,null),M.return=z,M;if(typeof M.then=="function")return ee(z,ji(M),L);if(M.$$typeof===D)return ee(z,yi(z,M),L);wi(z,M)}return null}function Y(z,M,L,W){var ve=M!==null?M.key:null;if(typeof L=="string"&&L!==""||typeof L=="number"||typeof L=="bigint")return ve!==null?null:y(z,M,""+L,W);if(typeof L=="object"&&L!==null){switch(L.$$typeof){case I:return L.key===ve?_(z,M,L,W):null;case $:return L.key===ve?q(z,M,L,W):null;case A:return L=qa(L),Y(z,M,L,W)}if(ae(L)||te(L))return ve!==null?null:F(z,M,L,W,null);if(typeof L.then=="function")return Y(z,M,ji(L),W);if(L.$$typeof===D)return Y(z,M,yi(z,L),W);wi(z,L)}return null}function X(z,M,L,W,ve){if(typeof W=="string"&&W!==""||typeof W=="number"||typeof W=="bigint")return z=z.get(L)||null,y(M,z,""+W,ve);if(typeof W=="object"&&W!==null){switch(W.$$typeof){case I:return z=z.get(W.key===null?L:W.key)||null,_(M,z,W,ve);case $:return z=z.get(W.key===null?L:W.key)||null,q(M,z,W,ve);case A:return W=qa(W),X(z,M,L,W,ve)}if(ae(W)||te(W))return z=z.get(L)||null,F(M,z,W,ve,null);if(typeof W.then=="function")return X(z,M,L,ji(W),ve);if(W.$$typeof===D)return X(z,M,L,yi(M,W),ve);wi(M,W)}return null}function he(z,M,L,W){for(var ve=null,ze=null,ge=M,ke=M=0,Me=null;ge!==null&&ke<L.length;ke++){ge.index>ke?(Me=ge,ge=null):Me=ge.sibling;var Be=Y(z,ge,L[ke],W);if(Be===null){ge===null&&(ge=Me);break}e&&ge&&Be.alternate===null&&t(z,ge),M=c(Be,M,ke),ze===null?ve=Be:ze.sibling=Be,ze=Be,ge=Me}if(ke===L.length)return s(z,ge),Re&&Bs(z,ke),ve;if(ge===null){for(;ke<L.length;ke++)ge=ee(z,L[ke],W),ge!==null&&(M=c(ge,M,ke),ze===null?ve=ge:ze.sibling=ge,ze=ge);return Re&&Bs(z,ke),ve}for(ge=n(ge);ke<L.length;ke++)Me=X(ge,z,ke,L[ke],W),Me!==null&&(e&&Me.alternate!==null&&ge.delete(Me.key===null?ke:Me.key),M=c(Me,M,ke),ze===null?ve=Me:ze.sibling=Me,ze=Me);return e&&ge.forEach(function(ja){return t(z,ja)}),Re&&Bs(z,ke),ve}function Ne(z,M,L,W){if(L==null)throw Error(u(151));for(var ve=null,ze=null,ge=M,ke=M=0,Me=null,Be=L.next();ge!==null&&!Be.done;ke++,Be=L.next()){ge.index>ke?(Me=ge,ge=null):Me=ge.sibling;var ja=Y(z,ge,Be.value,W);if(ja===null){ge===null&&(ge=Me);break}e&&ge&&ja.alternate===null&&t(z,ge),M=c(ja,M,ke),ze===null?ve=ja:ze.sibling=ja,ze=ja,ge=Me}if(Be.done)return s(z,ge),Re&&Bs(z,ke),ve;if(ge===null){for(;!Be.done;ke++,Be=L.next())Be=ee(z,Be.value,W),Be!==null&&(M=c(Be,M,ke),ze===null?ve=Be:ze.sibling=Be,ze=Be);return Re&&Bs(z,ke),ve}for(ge=n(ge);!Be.done;ke++,Be=L.next())Be=X(ge,z,ke,Be.value,W),Be!==null&&(e&&Be.alternate!==null&&ge.delete(Be.key===null?ke:Be.key),M=c(Be,M,ke),ze===null?ve=Be:ze.sibling=Be,ze=Be);return e&&ge.forEach(function(jy){return t(z,jy)}),Re&&Bs(z,ke),ve}function Ye(z,M,L,W){if(typeof L=="object"&&L!==null&&L.type===V&&L.key===null&&(L=L.props.children),typeof L=="object"&&L!==null){switch(L.$$typeof){case I:e:{for(var ve=L.key;M!==null;){if(M.key===ve){if(ve=L.type,ve===V){if(M.tag===7){s(z,M.sibling),W=o(M,L.props.children),W.return=z,z=W;break e}}else if(M.elementType===ve||typeof ve=="object"&&ve!==null&&ve.$$typeof===A&&qa(ve)===M.type){s(z,M.sibling),W=o(M,L.props),hl(W,L),W.return=z,z=W;break e}s(z,M);break}else t(z,M);M=M.sibling}L.type===V?(W=za(L.props.children,z.mode,W,L.key),W.return=z,z=W):(W=pi(L.type,L.key,L.props,null,z.mode,W),hl(W,L),W.return=z,z=W)}return d(z);case $:e:{for(ve=L.key;M!==null;){if(M.key===ve)if(M.tag===4&&M.stateNode.containerInfo===L.containerInfo&&M.stateNode.implementation===L.implementation){s(z,M.sibling),W=o(M,L.children||[]),W.return=z,z=W;break e}else{s(z,M);break}else t(z,M);M=M.sibling}W=No(L,z.mode,W),W.return=z,z=W}return d(z);case A:return L=qa(L),Ye(z,M,L,W)}if(ae(L))return he(z,M,L,W);if(te(L)){if(ve=te(L),typeof ve!="function")throw Error(u(150));return L=ve.call(L),Ne(z,M,L,W)}if(typeof L.then=="function")return Ye(z,M,ji(L),W);
vendor: 15,645 bytes, line 8
8if(L.$$typeof===D)return Ye(z,M,yi(z,L),W);wi(z,L)}return typeof L=="string"&&L!==""||typeof L=="number"||typeof L=="bigint"?(L=""+L,M!==null&&M.tag===6?(s(z,M.sibling),W=o(M,L),W.return=z,z=W):(s(z,M),W=vo(L,z.mode,W),W.return=z,z=W),d(z)):s(z,M)}return function(z,M,L,W){try{ml=0;var ve=Ye(z,M,L,W);return wn=null,ve}catch(ge){if(ge===jn||ge===vi)throw ge;var ze=Xt(29,ge,null,z.mode);return ze.lanes=W,ze.return=z,ze}}}var $a=Zd(!0),Xd=Zd(!1),la=!1;function Oo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function zo(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 ia(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ra(e,t,s){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,(De&2)!==0){var o=n.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),n.pending=t,t=hi(e),Td(e,null,s),t}return mi(e,n,t,s),hi(e)}function pl(e,t,s){if(t=t.updateQueue,t!==null&&(t=t.shared,(s&4194048)!==0)){var n=t.lanes;n&=e.pendingLanes,s|=n,t.lanes=s,Rt(e,s)}}function Bo(e,t){var s=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,s===n)){var o=null,c=null;if(s=s.firstBaseUpdate,s!==null){do{var d={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};c===null?o=c=d:c=c.next=d,s=s.next}while(s!==null);c===null?o=c=t:c=c.next=t}else o=c=t;s={baseState:n.baseState,firstBaseUpdate:o,lastBaseUpdate:c,shared:n.shared,callbacks:n.callbacks},e.updateQueue=s;return}e=s.lastBaseUpdate,e===null?s.firstBaseUpdate=t:e.next=t,s.lastBaseUpdate=t}var Do=!1;function gl(){if(Do){var e=Nn;if(e!==null)throw e}}function xl(e,t,s,n){Do=!1;var o=e.updateQueue;la=!1;var c=o.firstBaseUpdate,d=o.lastBaseUpdate,y=o.shared.pending;if(y!==null){o.shared.pending=null;var _=y,q=_.next;_.next=null,d===null?c=q:d.next=q,d=_;var F=e.alternate;F!==null&&(F=F.updateQueue,y=F.lastBaseUpdate,y!==d&&(y===null?F.firstBaseUpdate=q:y.next=q,F.lastBaseUpdate=_))}if(c!==null){var ee=o.baseState;d=0,F=q=_=null,y=c;do{var Y=y.lane&-536870913,X=Y!==y.lane;if(X?(Ae&Y)===Y:(n&Y)===Y){Y!==0&&Y===vn&&(Do=!0),F!==null&&(F=F.next={lane:0,tag:y.tag,payload:y.payload,callback:null,next:null});e:{var he=e,Ne=y;Y=t;var Ye=s;switch(Ne.tag){case 1:if(he=Ne.payload,typeof he=="function"){ee=he.call(Ye,ee,Y);break e}ee=he;break e;case 3:he.flags=he.flags&-65537|128;case 0:if(he=Ne.payload,Y=typeof he=="function"?he.call(Ye,ee,Y):he,Y==null)break e;ee=p({},ee,Y);break e;case 2:la=!0}}Y=y.callback,Y!==null&&(e.flags|=64,X&&(e.flags|=8192),X=o.callbacks,X===null?o.callbacks=[Y]:X.push(Y))}else X={lane:Y,tag:y.tag,payload:y.payload,callback:y.callback,next:null},F===null?(q=F=X,_=ee):F=F.next=X,d|=Y;if(y=y.next,y===null){if(y=o.shared.pending,y===null)break;X=y,y=X.next,X.next=null,o.lastBaseUpdate=X,o.shared.pending=null}}while(!0);F===null&&(_=ee),o.baseState=_,o.firstBaseUpdate=q,o.lastBaseUpdate=F,c===null&&(o.shared.lanes=0),fa|=d,e.lanes=d,e.memoizedState=ee}}function Qd(e,t){if(typeof e!="function")throw Error(u(191,e));e.call(t)}function Kd(e,t){var s=e.callbacks;if(s!==null)for(e.callbacks=null,e=0;e<s.length;e++)Qd(s[e],t)}var Sn=v(null),Si=v(0);function Jd(e,t){e=Xs,S(Si,e),S(Sn,t),Xs=e|t.baseLanes}function Uo(){S(Si,Xs),S(Sn,Sn.current)}function Lo(){Xs=Si.current,j(Sn),j(Si)}var Qt=v(null),os=null;function oa(e){var t=e.alternate;S(Pe,Pe.current&1),S(Qt,e),os===null&&(t===null||Sn.current!==null||t.memoizedState!==null)&&(os=e)}function qo(e){S(Pe,Pe.current),S(Qt,e),os===null&&(os=e)}function Id(e){e.tag===22?(S(Pe,Pe.current),S(Qt,e),os===null&&(os=e)):ca()}function ca(){S(Pe,Pe.current),S(Qt,Qt.current)}function Kt(e){j(Qt),os===e&&(os=null),j(Pe)}var Pe=v(0);function Ci(e){for(var t=e;t!==null;){if(t.tag===13){var s=t.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||Zc(s)||Xc(s)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Ls=0,Ce=null,He=null,nt=null,ki=!1,Cn=!1,Ya=!1,_i=0,yl=0,kn=null,fx=0;function Ie(){throw Error(u(321))}function Ho(e,t){if(t===null)return!1;for(var s=0;s<t.length&&s<e.length;s++)if(!Zt(e[s],t[s]))return!1;return!0}function $o(e,t,s,n,o,c){return Ls=c,Ce=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,C.H=e===null||e.memoizedState===null?zf:sc,Ya=!1,c=s(n,o),Ya=!1,Cn&&(c=Wd(t,s,n,o)),Fd(e),c}function Fd(e){C.H=Nl;var t=He!==null&&He.next!==null;if(Ls=0,nt=He=Ce=null,ki=!1,yl=0,kn=null,t)throw Error(u(300));e===null||lt||(e=e.dependencies,e!==null&&xi(e)&&(lt=!0))}function Wd(e,t,s,n){Ce=e;var o=0;do{if(Cn&&(kn=null),yl=0,Cn=!1,25<=o)throw Error(u(301));if(o+=1,nt=He=null,e.updateQueue!=null){var c=e.updateQueue;c.lastEffect=null,c.events=null,c.stores=null,c.memoCache!=null&&(c.memoCache.index=0)}C.H=Bf,c=t(s,n)}while(Cn);return c}function mx(){var e=C.H,t=e.useState()[0];return t=typeof t.then=="function"?bl(t):t,e=e.useState()[0],(He!==null?He.memoizedState:null)!==e&&(Ce.flags|=1024),t}function Yo(){var e=_i!==0;return _i=0,e}function Vo(e,t,s){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s}function Go(e){if(ki){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}ki=!1}Ls=0,nt=He=Ce=null,Cn=!1,yl=_i=0,kn=null}function Tt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return nt===null?Ce.memoizedState=nt=e:nt=nt.next=e,nt}function et(){if(He===null){var e=Ce.alternate;e=e!==null?e.memoizedState:null}else e=He.next;var t=nt===null?Ce.memoizedState:nt.next;if(t!==null)nt=t,He=e;else{if(e===null)throw Ce.alternate===null?Error(u(467)):Error(u(310));He=e,e={memoizedState:He.memoizedState,baseState:He.baseState,baseQueue:He.baseQueue,queue:He.queue,next:null},nt===null?Ce.memoizedState=nt=e:nt=nt.next=e}return nt}function Ei(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function bl(e){var t=yl;return yl+=1,kn===null&&(kn=[]),e=Yd(kn,e,t),t=Ce,(nt===null?t.memoizedState:nt.next)===null&&(t=t.alternate,C.H=t===null||t.memoizedState===null?zf:sc),e}function Ti(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return bl(e);if(e.$$typeof===D)return bt(e)}throw Error(u(438,String(e)))}function Zo(e){var t=null,s=Ce.updateQueue;if(s!==null&&(t=s.memoCache),t==null){var n=Ce.alternate;n!==null&&(n=n.updateQueue,n!==null&&(n=n.memoCache,n!=null&&(t={data:n.data.map(function(o){return o.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),s===null&&(s=Ei(),Ce.updateQueue=s),s.memoCache=t,s=t.data[t.index],s===void 0)for(s=t.data[t.index]=Array(e),n=0;n<e;n++)s[n]=J;return t.index++,s}function qs(e,t){return typeof t=="function"?t(e):t}function Ai(e){var t=et();return Xo(t,He,e)}function Xo(e,t,s){var n=e.queue;if(n===null)throw Error(u(311));n.lastRenderedReducer=s;var o=e.baseQueue,c=n.pending;if(c!==null){if(o!==null){var d=o.next;o.next=c.next,c.next=d}t.baseQueue=o=c,n.pending=null}if(c=e.baseState,o===null)e.memoizedState=c;else{t=o.next;var y=d=null,_=null,q=t,F=!1;do{var ee=q.lane&-536870913;if(ee!==q.lane?(Ae&ee)===ee:(Ls&ee)===ee){var Y=q.revertLane;if(Y===0)_!==null&&(_=_.next={lane:0,revertLane:0,gesture:null,action:q.action,hasEagerState:q.hasEagerState,eagerState:q.eagerState,next:null}),ee===vn&&(F=!0);else if((Ls&Y)===Y){q=q.next,Y===vn&&(F=!0);continue}else ee={lane:0,revertLane:q.revertLane,gesture:null,action:q.action,hasEagerState:q.hasEagerState,eagerState:q.eagerState,next:null},_===null?(y=_=ee,d=c):_=_.next=ee,Ce.lanes|=Y,fa|=Y;ee=q.action,Ya&&s(c,ee),c=q.hasEagerState?q.eagerState:s(c,ee)}else Y={lane:ee,revertLane:q.revertLane,gesture:q.gesture,action:q.action,hasEagerState:q.hasEagerState,eagerState:q.eagerState,next:null},_===null?(y=_=Y,d=c):_=_.next=Y,Ce.lanes|=ee,fa|=ee;q=q.next}while(q!==null&&q!==t);if(_===null?d=c:_.next=y,!Zt(c,e.memoizedState)&&(lt=!0,F&&(s=Nn,s!==null)))throw s;e.memoizedState=c,e.baseState=d,e.baseQueue=_,n.lastRenderedState=c}return o===null&&(n.lanes=0),[e.memoizedState,n.dispatch]}function Qo(e){var t=et(),s=t.queue;if(s===null)throw Error(u(311));s.lastRenderedReducer=e;var n=s.dispatch,o=s.pending,c=t.memoizedState;if(o!==null){s.pending=null;var d=o=o.next;do c=e(c,d.action),d=d.next;while(d!==o);Zt(c,t.memoizedState)||(lt=!0),t.memoizedState=c,t.baseQueue===null&&(t.baseState=c),s.lastRenderedState=c}return[c,n]}function Pd(e,t,s){var n=Ce,o=et(),c=Re;if(c){if(s===void 0)throw Error(u(407));s=s()}else s=t();var d=!Zt((He||o).memoizedState,s);if(d&&(o.memoizedState=s,lt=!0),o=o.queue,Io(sf.bind(null,n,o,e),[e]),o.getSnapshot!==t||d||nt!==null&&nt.memoizedState.tag&1){if(n.flags|=2048,_n(9,{destroy:void 0},tf.bind(null,n,o,s,t),null),Ve===null)throw Error(u(349));c||(Ls&127)!==0||ef(n,t,s)}return s}function ef(e,t,s){e.flags|=16384,e={getSnapshot:t,value:s},t=Ce.updateQueue,t===null?(t=Ei(),Ce.updateQueue=t,t.stores=[e]):(s=t.stores,s===null?t.stores=[e]:s.push(e))}function tf(e,t,s,n){t.value=s,t.getSnapshot=n,af(t)&&nf(e)}function sf(e,t,s){return s(function(){af(t)&&nf(e)})}function af(e){var t=e.getSnapshot;e=e.value;try{var s=t();return!Zt(e,s)}catch{return!0}}function nf(e){var t=Oa(e,2);t!==null&&Ht(t,e,2)}function Ko(e){var t=Tt();if(typeof e=="function"){var s=e;if(e=s(),Ya){ms(!0);try{s()}finally{ms(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:qs,lastRenderedState:e},t}function lf(e,t,s,n){return e.baseState=s,Xo(e,He,typeof n=="function"?n:qs)}function hx(e,t,s,n,o){if(Oi(e))throw Error(u(485));if(e=t.action,e!==null){var c={payload:o,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(d){c.listeners.push(d)}};C.T!==null?s(!0):c.isTransition=!1,n(c),s=t.pending,s===null?(c.next=t.pending=c,rf(t,c)):(c.next=s.next,t.pending=s.next=c)}}function rf(e,t){var s=t.action,n=t.payload,o=e.state;if(t.isTransition){var c=C.T,d={};C.T=d;try{var y=s(o,n),_=C.S;_!==null&&_(d,y),of(e,t,y)}catch(q){Jo(e,t,q)}finally{c!==null&&d.types!==null&&(c.types=d.types),C.T=c}}else try{c=s(o,n),of(e,t,c)}catch(q){Jo(e,t,q)}}function of(e,t,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(n){cf(e,t,n)},function(n){return Jo(e,t,n)}):cf(e,t,s)}function cf(e,t,s){t.status="fulfilled",t.value=s,uf(t),e.state=s,t=e.pending,t!==null&&(s=t.next,s===t?e.pending=null:(s=s.next,t.next=s,rf(e,s)))}function Jo(e,t,s){var n=e.pending;if(e.pending=null,n!==null){n=n.next;do t.status="rejected",t.reason=s,uf(t),t=t.next;while(t!==n)}e.action=null}function uf(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function df(e,t){return t}function ff(e,t){if(Re){var s=Ve.formState;if(s!==null){e:{var n=Ce;if(Re){if(Ge){t:{for(var o=Ge,c=rs;o.nodeType!==8;){if(!c){o=null;break t}if(o=cs(o.nextSibling),o===null){o=null;break t}}c=o.data,o=c==="F!"||c==="F"?o:null}if(o){Ge=cs(o.nextSibling),n=o.data==="F!";break e}}aa(n)}n=!1}n&&(t=s[0])}}return s=Tt(),s.memoizedState=s.baseState=t,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:df,lastRenderedState:t},s.queue=n,s=Mf.bind(null,Ce,n),n.dispatch=s,n=Ko(!1),c=tc.bind(null,Ce,!1,n.queue),n=Tt(),o={state:t,dispatch:null,action:e,pending:null},n.queue=o,s=hx.bind(null,Ce,o,c,s),o.dispatch=s,n.memoizedState=e,[t,s,!1]}function mf(e){var t=et();return hf(t,He,e)}function hf(e,t,s){if(t=Xo(e,t,df)[0],e=Ai(qs)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var n=bl(t)}catch(d){throw d===jn?vi:d}else n=t;t=et();var o=t.queue,c=o.dispatch;return s!==t.memoizedState&&(Ce.flags|=2048,_n(9,{destroy:void 0},px.bind(null,o,s),null)),[n,c,e]}function px(e,t){e.action=t}function pf(e){var t=et(),s=He;if(s!==null)return hf(t,s,e);et(),t=t.memoizedState,s=et();var n=s.queue.dispatch;return s.memoizedState=e,[t,n,!1]}function _n(e,t,s,n){return e={tag:e,create:s,deps:n,inst:t,next:null},t=Ce.updateQueue,t===null&&(t=Ei(),Ce.updateQueue=t),s=t.lastEffect,s===null?t.lastEffect=e.next=e:(n=s.next,s.next=e,e.next=n,t.lastEffect=e),e}function gf(){return et().memoizedState}function Mi(e,t,s,n){var o=Tt();Ce.flags|=e,o.memoizedState=_n(1|t,{destroy:void 0},s,n===void 0?null:n)}function Ri(e,t,s,n){var o=et();n=n===void 0?null:n;var c=o.memoizedState.inst;He!==null&&n!==null&&Ho(n,He.memoizedState.deps)?o.memoizedState=_n(t,c,s,n):(Ce.flags|=e,o.memoizedState=_n(1|t,c,s,n))}function xf(e,t){Mi(8390656,8,e,t)}function Io(e,t){Ri(2048,8,e,t)}function gx(e){Ce.flags|=4;var t=Ce.updateQueue;if(t===null)t=Ei(),Ce.updateQueue=t,t.events=[e];else{var s=t.events;s===null?t.events=[e]:s.push(e)}}function yf(e){var t=et().memoizedState;return gx({ref:t,nextImpl:e}),function(){if((De&2)!==0)throw Error(u(440));return t.impl.apply(void 0,arguments)}}function bf(e,t){return Ri(4,2,e,t)}function vf(e,t){return Ri(4,4,e,t)}function Nf(e,t){if(typeof t=="function"){e=e();var s=t(e);return function(){typeof s=="function"?s():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function jf(e,t,s){s=s!=null?s.concat([e]):null,Ri(4,4,Nf.bind(null,t,e),s)}function Fo(){}function wf(e,t){var s=et();t=t===void 0?null:t;var n=s.memoizedState;return t!==null&&Ho(t,n[1])?n[0]:(s.memoizedState=[e,t],e)}function Sf(e,t){var s=et();t=t===void 0?null:t;var n=s.memoizedState;if(t!==null&&Ho(t,n[1]))return n[0];if(n=e(),Ya){ms(!0);try{e()}finally{ms(!1)}}return s.memoizedState=[n,t],n}function Wo(e,t,s){return s===void 0||(Ls&1073741824)!==0&&(Ae&261930)===0?e.memoizedState=t:(e.memoizedState=s,e=Cm(),Ce.lanes|=e,fa|=e,s)}function Cf(e,t,s,n){return Zt(s,t)?s:Sn.current!==null?(e=Wo(e,s,n),Zt(e,t)||(lt=!0),e):(Ls&42)===0||(Ls&1073741824)!==0&&(Ae&261930)===0?(lt=!0,e.memoizedState=s):(e=Cm(),Ce.lanes|=e,fa|=e,t)}function kf(e,t,s,n,o){var c=H.p;H.p=c!==0&&8>c?c:8;var d=C.T,y={};C.T=y,tc(e,!1,t,s);try{var _=o(),q=C.S;if(q!==null&&q(y,_),_!==null&&typeof _=="object"&&typeof _.then=="function"){var F=dx(_,n);vl(e,t,F,Ft(e))}else vl(e,t,n,Ft(e))}catch(ee){vl(e,t,{then:function(){},status:"rejected",reason:ee},Ft())}finally{H.p=c,d!==null&&y.types!==null&&(d.types=y.types),C.T=d}}function xx(){}function Po(e,t,s,n){if(e.tag!==5)throw Error(u(476));var o=_f(e).queue;kf(e,o,t,re,s===null?xx:function(){return Ef(e),s(n)})}function _f(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:re,baseState:re,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:qs,lastRenderedState:re},next:null};var s={};return t.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:qs,lastRenderedState:s},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ef(e){var t=_f(e);t.next===null&&(t=e.alternate.memoizedState),vl(e,t.next.queue,{},Ft())}function ec(){return bt(Ul)}function Tf(){return et().memoizedState}function Af(){return et().memoizedState}function yx(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var s=Ft();e=ia(s);var n=ra(t,e,s);n!==null&&(Ht(n,t,s),pl(n,t,s)),t={cache:To()},e.payload=t;return}t=t.return}}function bx(e,t,s){var n=Ft();s={lane:n,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Oi(e)?Rf(t,s):(s=yo(e,t,s,n),s!==null&&(Ht(s,e,n),Of(s,t,n)))}
vendor: 4,304 bytes, line 8
8function Mf(e,t,s){var n=Ft();vl(e,t,s,n)}function vl(e,t,s,n){var o={lane:n,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(Oi(e))Rf(t,o);else{var c=e.alternate;if(e.lanes===0&&(c===null||c.lanes===0)&&(c=t.lastRenderedReducer,c!==null))try{var d=t.lastRenderedState,y=c(d,s);if(o.hasEagerState=!0,o.eagerState=y,Zt(y,d))return mi(e,t,o,0),Ve===null&&fi(),!1}catch{}if(s=yo(e,t,o,n),s!==null)return Ht(s,e,n),Of(s,t,n),!0}return!1}function tc(e,t,s,n){if(n={lane:2,revertLane:Oc(),gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Oi(e)){if(t)throw Error(u(479))}else t=yo(e,s,n,2),t!==null&&Ht(t,e,2)}function Oi(e){var t=e.alternate;return e===Ce||t!==null&&t===Ce}function Rf(e,t){Cn=ki=!0;var s=e.pending;s===null?t.next=t:(t.next=s.next,s.next=t),e.pending=t}function Of(e,t,s){if((s&4194048)!==0){var n=t.lanes;n&=e.pendingLanes,s|=n,t.lanes=s,Rt(e,s)}}var Nl={readContext:bt,use:Ti,useCallback:Ie,useContext:Ie,useEffect:Ie,useImperativeHandle:Ie,useLayoutEffect:Ie,useInsertionEffect:Ie,useMemo:Ie,useReducer:Ie,useRef:Ie,useState:Ie,useDebugValue:Ie,useDeferredValue:Ie,useTransition:Ie,useSyncExternalStore:Ie,useId:Ie,useHostTransitionStatus:Ie,useFormState:Ie,useActionState:Ie,useOptimistic:Ie,useMemoCache:Ie,useCacheRefresh:Ie};Nl.useEffectEvent=Ie;var zf={readContext:bt,use:Ti,useCallback:function(e,t){return Tt().memoizedState=[e,t===void 0?null:t],e},useContext:bt,useEffect:xf,useImperativeHandle:function(e,t,s){s=s!=null?s.concat([e]):null,Mi(4194308,4,Nf.bind(null,t,e),s)},useLayoutEffect:function(e,t){return Mi(4194308,4,e,t)},useInsertionEffect:function(e,t){Mi(4,2,e,t)},useMemo:function(e,t){var s=Tt();t=t===void 0?null:t;var n=e();if(Ya){ms(!0);try{e()}finally{ms(!1)}}return s.memoizedState=[n,t],n},useReducer:function(e,t,s){var n=Tt();if(s!==void 0){var o=s(t);if(Ya){ms(!0);try{s(t)}finally{ms(!1)}}}else o=t;return n.memoizedState=n.baseState=o,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:o},n.queue=e,e=e.dispatch=bx.bind(null,Ce,e),[n.memoizedState,e]},useRef:function(e){var t=Tt();return e={current:e},t.memoizedState=e},useState:function(e){e=Ko(e);var t=e.queue,s=Mf.bind(null,Ce,t);return t.dispatch=s,[e.memoizedState,s]},useDebugValue:Fo,useDeferredValue:function(e,t){var s=Tt();return Wo(s,e,t)},useTransition:function(){var e=Ko(!1);return e=kf.bind(null,Ce,e.queue,!0,!1),Tt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,s){var n=Ce,o=Tt();if(Re){if(s===void 0)throw Error(u(407));s=s()}else{if(s=t(),Ve===null)throw Error(u(349));(Ae&127)!==0||ef(n,t,s)}o.memoizedState=s;var c={value:s,getSnapshot:t};return o.queue=c,xf(sf.bind(null,n,c,e),[e]),n.flags|=2048,_n(9,{destroy:void 0},tf.bind(null,n,c,s,t),null),s},useId:function(){var e=Tt(),t=Ve.identifierPrefix;if(Re){var s=ws,n=js;s=(n&~(1<<32-jt(n)-1)).toString(32)+s,t="_"+t+"R_"+s,s=_i++,0<s&&(t+="H"+s.toString(32)),t+="_"}else s=fx++,t="_"+t+"r_"+s.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:ec,useFormState:ff,useActionState:ff,useOptimistic:function(e){var t=Tt();t.memoizedState=t.baseState=e;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=s,t=tc.bind(null,Ce,!0,s),s.dispatch=t,[e,t]},useMemoCache:Zo,useCacheRefresh:function(){return Tt().memoizedState=yx.bind(null,Ce)},useEffectEvent:function(e){var t=Tt(),s={impl:e};return t.memoizedState=s,function(){if((De&2)!==0)throw Error(u(440));return s.impl.apply(void 0,arguments)}}},sc={readContext:bt,use:Ti,useCallback:wf,useContext:bt,useEffect:Io,useImperativeHandle:jf,useInsertionEffect:bf,useLayoutEffect:vf,useMemo:Sf,useReducer:Ai,useRef:gf,useState:function(){return Ai(qs)},useDebugValue:Fo,useDeferredValue:function(e,t){var s=et();return Cf(s,He.memoizedState,e,t)},useTransition:function(){var e=Ai(qs)[0],t=et().memoizedState;return[typeof e=="boolean"?e:bl(e),t]},useSyncExternalStore:Pd,useId:Tf,useHostTransitionStatus:ec,useFormState:mf,useActionState:mf,useOptimistic:function(e,t){var s=et();return lf(s,He,e,t)},useMemoCache:Zo,useCacheRefresh:Af};sc.useEffectEvent=yf;var Bf={readContext:bt,use:Ti,useCallback:wf,useContext:bt,useEffect:Io,useImperativeHandle:jf,useInsertionEffect:bf,useLayoutEffect:vf,useMemo:Sf,useReducer:Qo,useRef
vendor: 14,708 bytes, line 8
8:gf,useState:function(){return Qo(qs)},useDebugValue:Fo,useDeferredValue:function(e,t){var s=et();return He===null?Wo(s,e,t):Cf(s,He.memoizedState,e,t)},useTransition:function(){var e=Qo(qs)[0],t=et().memoizedState;return[typeof e=="boolean"?e:bl(e),t]},useSyncExternalStore:Pd,useId:Tf,useHostTransitionStatus:ec,useFormState:pf,useActionState:pf,useOptimistic:function(e,t){var s=et();return He!==null?lf(s,He,e,t):(s.baseState=e,[e,s.queue.dispatch])},useMemoCache:Zo,useCacheRefresh:Af};Bf.useEffectEvent=yf;function ac(e,t,s,n){t=e.memoizedState,s=s(n,t),s=s==null?t:p({},t,s),e.memoizedState=s,e.lanes===0&&(e.updateQueue.baseState=s)}var nc={enqueueSetState:function(e,t,s){e=e._reactInternals;var n=Ft(),o=ia(n);o.payload=t,s!=null&&(o.callback=s),t=ra(e,o,n),t!==null&&(Ht(t,e,n),pl(t,e,n))},enqueueReplaceState:function(e,t,s){e=e._reactInternals;var n=Ft(),o=ia(n);o.tag=1,o.payload=t,s!=null&&(o.callback=s),t=ra(e,o,n),t!==null&&(Ht(t,e,n),pl(t,e,n))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var s=Ft(),n=ia(s);n.tag=2,t!=null&&(n.callback=t),t=ra(e,n,s),t!==null&&(Ht(t,e,s),pl(t,e,s))}};function Df(e,t,s,n,o,c,d){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,c,d):t.prototype&&t.prototype.isPureReactComponent?!rl(s,n)||!rl(o,c):!0}function Uf(e,t,s,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(s,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(s,n),t.state!==e&&nc.enqueueReplaceState(t,t.state,null)}function Va(e,t){var s=t;if("ref"in t){s={};for(var n in t)n!=="ref"&&(s[n]=t[n])}if(e=e.defaultProps){s===t&&(s=p({},s));for(var o in e)s[o]===void 0&&(s[o]=e[o])}return s}function Lf(e){di(e)}function qf(e){console.error(e)}function Hf(e){di(e)}function zi(e,t){try{var s=e.onUncaughtError;s(t.value,{componentStack:t.stack})}catch(n){setTimeout(function(){throw n})}}function $f(e,t,s){try{var n=e.onCaughtError;n(s.value,{componentStack:s.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(o){setTimeout(function(){throw o})}}function lc(e,t,s){return s=ia(s),s.tag=3,s.payload={element:null},s.callback=function(){zi(e,t)},s}function Yf(e){return e=ia(e),e.tag=3,e}function Vf(e,t,s,n){var o=s.type.getDerivedStateFromError;if(typeof o=="function"){var c=n.value;e.payload=function(){return o(c)},e.callback=function(){$f(t,s,n)}}var d=s.stateNode;d!==null&&typeof d.componentDidCatch=="function"&&(e.callback=function(){$f(t,s,n),typeof o!="function"&&(ma===null?ma=new Set([this]):ma.add(this));var y=n.stack;this.componentDidCatch(n.value,{componentStack:y!==null?y:""})})}function vx(e,t,s,n,o){if(s.flags|=32768,n!==null&&typeof n=="object"&&typeof n.then=="function"){if(t=s.alternate,t!==null&&bn(t,s,o,!0),s=Qt.current,s!==null){switch(s.tag){case 31:case 13:return os===null?Xi():s.alternate===null&&Fe===0&&(Fe=3),s.flags&=-257,s.flags|=65536,s.lanes=o,n===Ni?s.flags|=16384:(t=s.updateQueue,t===null?s.updateQueue=new Set([n]):t.add(n),Ac(e,n,o)),!1;case 22:return s.flags|=65536,n===Ni?s.flags|=16384:(t=s.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([n])},s.updateQueue=t):(s=t.retryQueue,s===null?t.retryQueue=new Set([n]):s.add(n)),Ac(e,n,o)),!1}throw Error(u(435,s.tag))}return Ac(e,n,o),Xi(),!1}if(Re)return t=Qt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=o,n!==So&&(e=Error(u(422),{cause:n}),ul(ns(e,s)))):(n!==So&&(t=Error(u(423),{cause:n}),ul(ns(t,s))),e=e.current.alternate,e.flags|=65536,o&=-o,e.lanes|=o,n=ns(n,s),o=lc(e.stateNode,n,o),Bo(e,o),Fe!==4&&(Fe=2)),!1;var c=Error(u(520),{cause:n});if(c=ns(c,s),Tl===null?Tl=[c]:Tl.push(c),Fe!==4&&(Fe=2),t===null)return!0;n=ns(n,s),s=t;do{switch(s.tag){case 3:return s.flags|=65536,e=o&-o,s.lanes|=e,e=lc(s.stateNode,n,e),Bo(s,e),!1;case 1:if(t=s.type,c=s.stateNode,(s.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||c!==null&&typeof c.componentDidCatch=="function"&&(ma===null||!ma.has(c))))return s.flags|=65536,o&=-o,s.lanes|=o,o=Yf(o),Vf(o,e,s,n),Bo(s,o),!1}s=s.return}while(s!==null);return!1}var ic=Error(u(461)),lt=!1;function vt(e,t,s,n){t.child=e===null?Xd(t,null,s,n):$a(t,e.child,s,n)}function Gf(e,t,s,n,o){s=s.render;var c=t.ref;if("ref"in n){var d={};for(var y in n)y!=="ref"&&(d[y]=n[y])}else d=n;return Ua(t),n=$o(e,t,s,d,c,o),y=Yo(),e!==null&&!lt?(Vo(e,t,o),Hs(e,t,o)):(Re&&y&&jo(t),t.flags|=1,vt(e,t,n,o),t.child)}function Zf(e,t,s,n,o){if(e===null){var c=s.type;return typeof c=="function"&&!bo(c)&&c.defaultProps===void 0&&s.compare===null?(t.tag=15,t.type=c,Xf(e,t,c,n,o)):(e=pi(s.type,null,n,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(c=e.child,!hc(e,o)){var d=c.memoizedProps;if(s=s.compare,s=s!==null?s:rl,s(d,n)&&e.ref===t.ref)return Hs(e,t,o)}return t.flags|=1,e=zs(c,n),e.ref=t.ref,e.return=t,t.child=e}function Xf(e,t,s,n,o){if(e!==null){var c=e.memoizedProps;if(rl(c,n)&&e.ref===t.ref)if(lt=!1,t.pendingProps=n=c,hc(e,o))(e.flags&131072)!==0&&(lt=!0);else return t.lanes=e.lanes,Hs(e,t,o)}return rc(e,t,s,n,o)}function Qf(e,t,s,n){var o=n.children,c=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.mode==="hidden"){if((t.flags&128)!==0){if(c=c!==null?c.baseLanes|s:s,e!==null){for(n=t.child=e.child,o=0;n!==null;)o=o|n.lanes|n.childLanes,n=n.sibling;n=o&~c}else n=0,t.child=null;return Kf(e,t,c,s,n)}if((s&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&bi(t,c!==null?c.cachePool:null),c!==null?Jd(t,c):Uo(),Id(t);else return n=t.lanes=536870912,Kf(e,t,c!==null?c.baseLanes|s:s,s,n)}else c!==null?(bi(t,c.cachePool),Jd(t,c),ca(),t.memoizedState=null):(e!==null&&bi(t,null),Uo(),ca());return vt(e,t,o,s),t.child}function jl(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Kf(e,t,s,n,o){var c=Mo();return c=c===null?null:{parent:at._currentValue,pool:c},t.memoizedState={baseLanes:s,cachePool:c},e!==null&&bi(t,null),Uo(),Id(t),e!==null&&bn(e,t,n,!0),t.childLanes=o,null}function Bi(e,t){return t=Ui({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Jf(e,t,s){return $a(t,e.child,null,s),e=Bi(t,t.pendingProps),e.flags|=2,Kt(t),t.memoizedState=null,e}function Nx(e,t,s){var n=t.pendingProps,o=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Re){if(n.mode==="hidden")return e=Bi(t,n),t.lanes=536870912,jl(null,e);if(qo(t),(e=Ge)?(e=rh(e,rs),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ta!==null?{id:js,overflow:ws}:null,retryLane:536870912,hydrationErrors:null},s=Md(e),s.return=t,t.child=s,yt=t,Ge=null)):e=null,e===null)throw aa(t);return t.lanes=536870912,null}return Bi(t,n)}var c=e.memoizedState;if(c!==null){var d=c.dehydrated;if(qo(t),o)if(t.flags&256)t.flags&=-257,t=Jf(e,t,s);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(u(558));else if(lt||bn(e,t,s,!1),o=(s&e.childLanes)!==0,lt||o){if(n=Ve,n!==null&&(d=Ot(n,s),d!==0&&d!==c.retryLane))throw c.retryLane=d,Oa(e,d),Ht(n,e,d),ic;Xi(),t=Jf(e,t,s)}else e=c.treeContext,Ge=cs(d.nextSibling),yt=t,Re=!0,sa=null,rs=!1,e!==null&&zd(t,e),t=Bi(t,n),t.flags|=4096;return t}return e=zs(e.child,{mode:n.mode,children:n.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Di(e,t){var s=t.ref;if(s===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(u(284));(e===null||e.ref!==s)&&(t.flags|=4194816)}}function rc(e,t,s,n,o){return Ua(t),s=$o(e,t,s,n,void 0,o),n=Yo(),e!==null&&!lt?(Vo(e,t,o),Hs(e,t,o)):(Re&&n&&jo(t),t.flags|=1,vt(e,t,s,o),t.child)}function If(e,t,s,n,o,c){return Ua(t),t.updateQueue=null,s=Wd(t,n,s,o),Fd(e),n=Yo(),e!==null&&!lt?(Vo(e,t,c),Hs(e,t,c)):(Re&&n&&jo(t),t.flags|=1,vt(e,t,s,c),t.child)}function Ff(e,t,s,n,o){if(Ua(t),t.stateNode===null){var c=pn,d=s.contextType;typeof d=="object"&&d!==null&&(c=bt(d)),c=new s(n,c),t.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=nc,t.stateNode=c,c._reactInternals=t,c=t.stateNode,c.props=n,c.state=t.memoizedState,c.refs={},Oo(t),d=s.contextType,c.context=typeof d=="object"&&d!==null?bt(d):pn,c.state=t.memoizedState,d=s.getDerivedStateFromProps,typeof d=="function"&&(ac(t,s,d,n),c.state=t.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof c.getSnapshotBeforeUpdate=="function"||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(d=c.state,typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount(),d!==c.state&&nc.enqueueReplaceState(c,c.state,null),xl(t,n,c,o),gl(),c.state=t.memoizedState),typeof c.componentDidMount=="function"&&(t.flags|=4194308),n=!0}else if(e===null){c=t.stateNode;var y=t.memoizedProps,_=Va(s,y);c.props=_;var q=c.context,F=s.contextType;d=pn,typeof F=="object"&&F!==null&&(d=bt(F));var ee=s.getDerivedStateFromProps;F=typeof ee=="function"||typeof c.getSnapshotBeforeUpdate=="function",y=t.pendingProps!==y,F||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(y||q!==d)&&Uf(t,c,n,d),la=!1;var Y=t.memoizedState;c.state=Y,xl(t,n,c,o),gl(),q=t.memoizedState,y||Y!==q||la?(typeof ee=="function"&&(ac(t,s,ee,n),q=t.memoizedState),(_=la||Df(t,s,_,n,Y,q,d))?(F||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount()),typeof c.componentDidMount=="function"&&(t.flags|=4194308)):(typeof c.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=q),c.props=n,c.state=q,c.context=d,n=_):(typeof c.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{c=t.stateNode,zo(e,t),d=t.memoizedProps,F=Va(s,d),c.props=F,ee=t.pendingProps,Y=c.context,q=s.contextType,_=pn,typeof q=="object"&&q!==null&&(_=bt(q)),y=s.getDerivedStateFromProps,(q=typeof y=="function"||typeof c.getSnapshotBeforeUpdate=="function")||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(d!==ee||Y!==_)&&Uf(t,c,n,_),la=!1,Y=t.memoizedState,c.state=Y,xl(t,n,c,o),gl();var X=t.memoizedState;d!==ee||Y!==X||la||e!==null&&e.dependencies!==null&&xi(e.dependencies)?(typeof y=="function"&&(ac(t,s,y,n),X=t.memoizedState),(F=la||Df(t,s,F,n,Y,X,_)||e!==null&&e.dependencies!==null&&xi(e.dependencies))?(q||typeof c.UNSAFE_componentWillUpdate!="function"&&typeof c.componentWillUpdate!="function"||(typeof c.componentWillUpdate=="function"&&c.componentWillUpdate(n,X,_),typeof c.UNSAFE_componentWillUpdate=="function"&&c.UNSAFE_componentWillUpdate(n,X,_)),typeof c.componentDidUpdate=="function"&&(t.flags|=4),typeof c.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof c.componentDidUpdate!="function"||d===e.memoizedProps&&Y===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||d===e.memoizedProps&&Y===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=X),c.props=n,c.state=X,c.context=_,n=F):(typeof c.componentDidUpdate!="function"||d===e.memoizedProps&&Y===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||d===e.memoizedProps&&Y===e.memoizedState||(t.flags|=1024),n=!1)}return c=n,Di(e,t),n=(t.flags&128)!==0,c||n?(c=t.stateNode,s=n&&typeof s.getDerivedStateFromError!="function"?null:c.render(),t.flags|=1,e!==null&&n?(t.child=$a(t,e.child,null,o),t.child=$a(t,null,s,o)):vt(e,t,s,o),t.memoizedState=c.state,e=t.child):e=Hs(e,t,o),e}function Wf(e,t,s,n){return Ba(),t.flags|=256,vt(e,t,s,n),t.child}var oc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function cc(e){return{baseLanes:e,cachePool:Hd()}}function uc(e,t,s){return e=e!==null?e.childLanes&~s:0,t&&(e|=It),e}function Pf(e,t,s){var n=t.pendingProps,o=!1,c=(t.flags&128)!==0,d;if((d=c)||(d=e!==null&&e.memoizedState===null?!1:(Pe.current&2)!==0),d&&(o=!0,t.flags&=-129),d=(t.flags&32)!==0,t.flags&=-33,e===null){if(Re){if(o?oa(t):ca(),(e=Ge)?(e=rh(e,rs),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ta!==null?{id:js,overflow:ws}:null,retryLane:536870912,hydrationErrors:null},s=Md(e),s.return=t,t.child=s,yt=t,Ge=null)):e=null,e===null)throw aa(t);return Xc(e)?t.lanes=32:t.lanes=536870912,null}var y=n.children;return n=n.fallback,o?(ca(),o=t.mode,y=Ui({mode:"hidden",children:y},o),n=za(n,o,s,null),y.return=t,n.return=t,y.sibling=n,t.child=y,n=t.child,n.memoizedState=cc(s),n.childLanes=uc(e,d,s),t.memoizedState=oc,jl(null,n)):(oa(t),dc(t,y))}var _=e.memoizedState;if(_!==null&&(y=_.dehydrated,y!==null)){if(c)t.flags&256?(oa(t),t.flags&=-257,t=fc(e,t,s)):t.memoizedState!==null?(ca(),t.child=e.child,t.flags|=128,t=null):(ca(),y=n.fallback,o=t.mode,n=Ui({mode:"visible",children:n.children},o),y=za(y,o,s,null),y.flags|=2,n.return=t,y.return=t,n.sibling=y,t.child=n,$a(t,e.child,null,s),n=t.child,n.memoizedState=cc(s),n.childLanes=uc(e,d,s),t.memoizedState=oc,t=jl(null,n));else if(oa(t),Xc(y)){if(d=y.nextSibling&&y.nextSibling.dataset,d)var q=d.dgst;d=q,n=Error(u(419)),n.stack="",n.digest=d,ul({value:n,source:null,stack:null}),t=fc(e,t,s)}else if(lt||bn(e,t,s,!1),d=(s&e.childLanes)!==0,lt||d){if(d=Ve,d!==null&&(n=Ot(d,s),n!==0&&n!==_.retryLane))throw _.retryLane=n,Oa(e,n),Ht(d,e,n),ic;Zc(y)||Xi(),t=fc(e,t,s)}else Zc(y)?(t.flags|=192,t.child=e.child,t=null):(e=_.treeContext,Ge=cs(y.nextSibling),yt=t,Re=!0,sa=null,rs=!1,e!==null&&zd(t,e),t=dc(t,n.children),t.flags|=4096);return t}return o?(ca(),y=n.fallback,o=t.mode,_=e.child,q=_.sibling,n=zs(_,{mode:"hidden",children:n.children}),n.subtreeFlags=_.subtreeFlags&65011712,q!==null?y=zs(q,y):(y=za(y,o,s,null),y.flags|=2),y.return=t,n.return=t,n.sibling=y,t.child=n,jl(null,n),n=t.child,y=e.child.memoizedState,y===null?y=cc(s):(o=y.cachePool,o!==null?(_=at._currentValue,o=o.parent!==_?{parent:_,pool:_}:o):o=Hd(),y={baseLanes:y.baseLanes|s,cachePool:o}),n.memoizedState=y,n.childLanes=uc(e,d,s),t.memoizedState=oc,jl(e.child,n)):(oa(t),s=e.child,e=s.sibling,s=zs(s,{mode:"visible",children:n.children}),s.return=t,s.sibling=null,e!==null&&(d=t.deletions,d===null?(t.deletions=[e],t.flags|=16):d.push(e)),t.child=s,t.memoizedState=null,s)}function dc(e,t){return t=Ui({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Ui(e,t){return e=Xt(22,e,null,t),e.lanes=0,e}function fc(e,t,s){return $a(t,e.child,null,s),e=dc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}
vendor: 4,939 bytes, line 8
8function em(e,t,s){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),_o(e.return,t,s)}function mc(e,t,s,n,o,c){var d=e.memoizedState;d===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:s,tailMode:o,treeForkCount:c}:(d.isBackwards=t,d.rendering=null,d.renderingStartTime=0,d.last=n,d.tail=s,d.tailMode=o,d.treeForkCount=c)}function tm(e,t,s){var n=t.pendingProps,o=n.revealOrder,c=n.tail;n=n.children;var d=Pe.current,y=(d&2)!==0;if(y?(d=d&1|2,t.flags|=128):d&=1,S(Pe,d),vt(e,t,n,s),n=Re?cl:0,!y&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&em(e,s,t);else if(e.tag===19)em(e,s,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(o){case"forwards":for(s=t.child,o=null;s!==null;)e=s.alternate,e!==null&&Ci(e)===null&&(o=s),s=s.sibling;s=o,s===null?(o=t.child,t.child=null):(o=s.sibling,s.sibling=null),mc(t,!1,o,s,c,n);break;case"backwards":case"unstable_legacy-backwards":for(s=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&Ci(e)===null){t.child=o;break}e=o.sibling,o.sibling=s,s=o,o=e}mc(t,!0,s,null,c,n);break;case"together":mc(t,!1,null,null,void 0,n);break;default:t.memoizedState=null}return t.child}function Hs(e,t,s){if(e!==null&&(t.dependencies=e.dependencies),fa|=t.lanes,(s&t.childLanes)===0)if(e!==null){if(bn(e,t,s,!1),(s&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(u(153));if(t.child!==null){for(e=t.child,s=zs(e,e.pendingProps),t.child=s,s.return=t;e.sibling!==null;)e=e.sibling,s=s.sibling=zs(e,e.pendingProps),s.return=t;s.sibling=null}return t.child}function hc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&xi(e)))}function jx(e,t,s){switch(t.tag){case 3:ye(t,t.stateNode.containerInfo),na(t,at,e.memoizedState.cache),Ba();break;case 27:case 5:Ue(t);break;case 4:ye(t,t.stateNode.containerInfo);break;case 10:na(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,qo(t),null;break;case 13:var n=t.memoizedState;if(n!==null)return n.dehydrated!==null?(oa(t),t.flags|=128,null):(s&t.child.childLanes)!==0?Pf(e,t,s):(oa(t),e=Hs(e,t,s),e!==null?e.sibling:null);oa(t);break;case 19:var o=(e.flags&128)!==0;if(n=(s&t.childLanes)!==0,n||(bn(e,t,s,!1),n=(s&t.childLanes)!==0),o){if(n)return tm(e,t,s);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),S(Pe,Pe.current),n)break;return null;case 22:return t.lanes=0,Qf(e,t,s,t.pendingProps);case 24:na(t,at,e.memoizedState.cache)}return Hs(e,t,s)}function sm(e,t,s){if(e!==null)if(e.memoizedProps!==t.pendingProps)lt=!0;else{if(!hc(e,s)&&(t.flags&128)===0)return lt=!1,jx(e,t,s);lt=(e.flags&131072)!==0}else lt=!1,Re&&(t.flags&1048576)!==0&&Od(t,cl,t.index);switch(t.lanes=0,t.tag){case 16:e:{var n=t.pendingProps;if(e=qa(t.elementType),t.type=e,typeof e=="function")bo(e)?(n=Va(e,n),t.tag=1,t=Ff(null,t,e,n,s)):(t.tag=0,t=rc(null,t,e,n,s));else{if(e!=null){var o=e.$$typeof;if(o===R){t.tag=11,t=Gf(null,t,e,n,s);break e}else if(o===T){t.tag=14,t=Zf(null,t,e,n,s);break e}}throw t=ie(e)||e,Error(u(306,t,""))}}return t;case 0:return rc(e,t,t.type,t.pendingProps,s);case 1:return n=t.type,o=Va(n,t.pendingProps),Ff(e,t,n,o,s);case 3:e:{if(ye(t,t.stateNode.containerInfo),e===null)throw Error(u(387));n=t.pendingProps;var c=t.memoizedState;o=c.element,zo(e,t),xl(t,n,null,s);var d=t.memoizedState;if(n=d.cache,na(t,at,n),n!==c.cache&&Eo(t,[at],s,!0),gl(),n=d.element,c.isDehydrated)if(c={element:n,isDehydrated:!1,cache:d.cache},t.updateQueue.baseState=c,t.memoizedState=c,t.flags&256){t=Wf(e,t,n,s);break e}else if(n!==o){o=ns(Error(u(424)),t),ul(o),t=Wf(e,t,n,s);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,Ge=cs(e.firstChild),yt=t,Re=!0,sa=null,rs=!0,s=Xd(t,null,n,s),t.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling;else{if(Ba(),n===o){t=Hs(e,t,s);break e}vt(e,t,n,s)}t=t.child}return t;case 26:return Di(e,t),e===null?(s=mh(t.type,null,t.pendingProps,null))?t.memoizedState=s:Re||(s=t.type,e=t.pendingProps,n=Pi(ue.current).createElement(s),n[xt]=t,n[zt]=e,Nt(n,s,e),mt(n),t.stateNode=n):t.memoizedState=mh(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Ue(t),e===null&&Re&&(n=t.stateNode=uh(t.type,t.pendingProps,ue.current),yt=t,rs=!0,o=Ge,xa(t.type)?(Qc=o,Ge=cs(n.firstChild)):Ge=o),vt(e,t,t.pendingProps.children,s),Di(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Re&&((o=n=Ge)&&(n=Wx(n,t.type,t.pendingProps,rs),n!==null?(t.stateNode=n,yt=t,Ge=cs(n.firstChild),rs=!1,o=!0):o=!1),o||aa(t)),Ue(t),o=t.type,c=t.pendingProps,d=e!==null?e.memoizedProps:null,n=c.children,Yc(o,c)?n=null:d!==null&&Yc(o,d)&&(t.flags|=32),t.memoizedState!==null&&(o=$o(e,t,mx,null,
vendor: 4,242 bytes, line 8
8null,s),Ul._currentValue=o),Di(e,t),vt(e,t,n,s),t.child;case 6:return e===null&&Re&&((e=s=Ge)&&(s=Px(s,t.pendingProps,rs),s!==null?(t.stateNode=s,yt=t,Ge=null,e=!0):e=!1),e||aa(t)),null;case 13:return Pf(e,t,s);case 4:return ye(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=$a(t,null,n,s):vt(e,t,n,s),t.child;case 11:return Gf(e,t,t.type,t.pendingProps,s);case 7:return vt(e,t,t.pendingProps,s),t.child;case 8:return vt(e,t,t.pendingProps.children,s),t.child;case 12:return vt(e,t,t.pendingProps.children,s),t.child;case 10:return n=t.pendingProps,na(t,t.type,n.value),vt(e,t,n.children,s),t.child;case 9:return o=t.type._context,n=t.pendingProps.children,Ua(t),o=bt(o),n=n(o),t.flags|=1,vt(e,t,n,s),t.child;case 14:return Zf(e,t,t.type,t.pendingProps,s);case 15:return Xf(e,t,t.type,t.pendingProps,s);case 19:return tm(e,t,s);case 31:return Nx(e,t,s);case 22:return Qf(e,t,s,t.pendingProps);case 24:return Ua(t),n=bt(at),e===null?(o=Mo(),o===null&&(o=Ve,c=To(),o.pooledCache=c,c.refCount++,c!==null&&(o.pooledCacheLanes|=s),o=c),t.memoizedState={parent:n,cache:o},Oo(t),na(t,at,o)):((e.lanes&s)!==0&&(zo(e,t),xl(t,null,null,s),gl()),o=e.memoizedState,c=t.memoizedState,o.parent!==n?(o={parent:n,cache:n},t.memoizedState=o,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=o),na(t,at,n)):(n=c.cache,na(t,at,n),n!==o.cache&&Eo(t,[at],s,!0))),vt(e,t,t.pendingProps.children,s),t.child;case 29:throw t.pendingProps}throw Error(u(156,t.tag))}function $s(e){e.flags|=4}function pc(e,t,s,n,o){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(o&335544128)===o)if(e.stateNode.complete)e.flags|=8192;else if(Tm())e.flags|=8192;else throw Ha=Ni,Ro}else e.flags&=-16777217}function am(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!yh(t))if(Tm())e.flags|=8192;else throw Ha=Ni,Ro}function Li(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?wt():536870912,e.lanes|=t,Mn|=t)}function wl(e,t){if(!Re)switch(e.tailMode){case"hidden":t=e.tail;for(var s=null;t!==null;)t.alternate!==null&&(s=t),t=t.sibling;s===null?e.tail=null:s.sibling=null;break;case"collapsed":s=e.tail;for(var n=null;s!==null;)s.alternate!==null&&(n=s),s=s.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function Ze(e){var t=e.alternate!==null&&e.alternate.child===e.child,s=0,n=0;if(t)for(var o=e.child;o!==null;)s|=o.lanes|o.childLanes,n|=o.subtreeFlags&65011712,n|=o.flags&65011712,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)s|=o.lanes|o.childLanes,n|=o.subtreeFlags,n|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=n,e.childLanes=s,t}function wx(e,t,s){var n=t.pendingProps;switch(wo(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ze(t),null;case 1:return Ze(t),null;case 3:return s=t.stateNode,n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Us(at),je(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(yn(t)?$s(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Co())),Ze(t),null;case 26:var o=t.type,c=t.memoizedState;return e===null?($s(t),c!==null?(Ze(t),am(t,c)):(Ze(t),pc(t,o,null,n,s))):c?c!==e.memoizedState?($s(t),Ze(t),am(t,c)):(Ze(t),t.flags&=-16777217):(e=e.memoizedProps,e!==n&&$s(t),Ze(t),pc(t,o,e,n,s)),null;case 27:if(gt(t),s=ue.current,o=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&$s(t);else{if(!n){if(t.stateNode===null)throw Error(u(166));return Ze(t),null}e=U.current,yn(t)?Bd(t):(e=uh(o,n,s),t.stateNode=e,$s(t))}return Ze(t),null;case 5:if(gt(t),o=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&$s(t);else{if(!n){if(t.stateNode===null)throw Error(u(166));return Ze(t),null}if(c=U.current,yn(t))Bd(t);else{var d=Pi(ue.current);switch(c){case 1:c=d.createElementNS("http://www.w3.org/2000/svg",o);break;case 2:c=d.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;default:switch(o){case"svg":c=d.createElementNS("http://www.w3.org/2000/svg",o);break;case"math":c=d.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;case"script":c=d.createElement("div"),c.innerHTML="<script><\/script>",c=c.removeChild(c.firstChild);break;
vendor: 24,882 bytes, line 8
8case"select":c=typeof n.is=="string"?d.createElement("select",{is:n.is}):d.createElement("select"),n.multiple?c.multiple=!0:n.size&&(c.size=n.size);break;default:c=typeof n.is=="string"?d.createElement(o,{is:n.is}):d.createElement(o)}}c[xt]=t,c[zt]=n;e:for(d=t.child;d!==null;){if(d.tag===5||d.tag===6)c.appendChild(d.stateNode);else if(d.tag!==4&&d.tag!==27&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===t)break e;for(;d.sibling===null;){if(d.return===null||d.return===t)break e;d=d.return}d.sibling.return=d.return,d=d.sibling}t.stateNode=c;e:switch(Nt(c,o,n),o){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}n&&$s(t)}}return Ze(t),pc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,s),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==n&&$s(t);else{if(typeof n!="string"&&t.stateNode===null)throw Error(u(166));if(e=ue.current,yn(t)){if(e=t.stateNode,s=t.memoizedProps,n=null,o=yt,o!==null)switch(o.tag){case 27:case 5:n=o.memoizedProps}e[xt]=t,e=!!(e.nodeValue===s||n!==null&&n.suppressHydrationWarning===!0||Pm(e.nodeValue,s)),e||aa(t,!0)}else e=Pi(e).createTextNode(n),e[xt]=t,t.stateNode=e}return Ze(t),null;case 31:if(s=t.memoizedState,e===null||e.memoizedState!==null){if(n=yn(t),s!==null){if(e===null){if(!n)throw Error(u(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(557));e[xt]=t}else Ba(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ze(t),e=!1}else s=Co(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),e=!0;if(!e)return t.flags&256?(Kt(t),t):(Kt(t),null);if((t.flags&128)!==0)throw Error(u(558))}return Ze(t),null;case 13:if(n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(o=yn(t),n!==null&&n.dehydrated!==null){if(e===null){if(!o)throw Error(u(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(u(317));o[xt]=t}else Ba(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ze(t),o=!1}else o=Co(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=o),o=!0;if(!o)return t.flags&256?(Kt(t),t):(Kt(t),null)}return Kt(t),(t.flags&128)!==0?(t.lanes=s,t):(s=n!==null,e=e!==null&&e.memoizedState!==null,s&&(n=t.child,o=null,n.alternate!==null&&n.alternate.memoizedState!==null&&n.alternate.memoizedState.cachePool!==null&&(o=n.alternate.memoizedState.cachePool.pool),c=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(c=n.memoizedState.cachePool.pool),c!==o&&(n.flags|=2048)),s!==e&&s&&(t.child.flags|=8192),Li(t,t.updateQueue),Ze(t),null);case 4:return je(),e===null&&Uc(t.stateNode.containerInfo),Ze(t),null;case 10:return Us(t.type),Ze(t),null;case 19:if(j(Pe),n=t.memoizedState,n===null)return Ze(t),null;if(o=(t.flags&128)!==0,c=n.rendering,c===null)if(o)wl(n,!1);else{if(Fe!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(c=Ci(e),c!==null){for(t.flags|=128,wl(n,!1),e=c.updateQueue,t.updateQueue=e,Li(t,e),t.subtreeFlags=0,e=s,s=t.child;s!==null;)Ad(s,e),s=s.sibling;return S(Pe,Pe.current&1|2),Re&&Bs(t,n.treeForkCount),t.child}e=e.sibling}n.tail!==null&&_t()>Vi&&(t.flags|=128,o=!0,wl(n,!1),t.lanes=4194304)}else{if(!o)if(e=Ci(c),e!==null){if(t.flags|=128,o=!0,e=e.updateQueue,t.updateQueue=e,Li(t,e),wl(n,!0),n.tail===null&&n.tailMode==="hidden"&&!c.alternate&&!Re)return Ze(t),null}else 2*_t()-n.renderingStartTime>Vi&&s!==536870912&&(t.flags|=128,o=!0,wl(n,!1),t.lanes=4194304);n.isBackwards?(c.sibling=t.child,t.child=c):(e=n.last,e!==null?e.sibling=c:t.child=c,n.last=c)}return n.tail!==null?(e=n.tail,n.rendering=e,n.tail=e.sibling,n.renderingStartTime=_t(),e.sibling=null,s=Pe.current,S(Pe,o?s&1|2:s&1),Re&&Bs(t,n.treeForkCount),e):(Ze(t),null);case 22:case 23:return Kt(t),Lo(),n=t.memoizedState!==null,e!==null?e.memoizedState!==null!==n&&(t.flags|=8192):n&&(t.flags|=8192),n?(s&536870912)!==0&&(t.flags&128)===0&&(Ze(t),t.subtreeFlags&6&&(t.flags|=8192)):Ze(t),s=t.updateQueue,s!==null&&Li(t,s.retryQueue),s=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),n=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),n!==s&&(t.flags|=2048),e!==null&&j(La),null;case 24:return s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),Us(at),Ze(t),null;case 25:return null;case 30:return null}throw Error(u(156,t.tag))}function Sx(e,t){switch(wo(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Us(at),je(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return gt(t),null;case 31:if(t.memoizedState!==null){if(Kt(t),t.alternate===null)throw Error(u(340));Ba()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Kt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(u(340));Ba()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return j(Pe),null;case 4:return je(),null;case 10:return Us(t.type),null;case 22:case 23:return Kt(t),Lo(),e!==null&&j(La),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Us(at),null;case 25:return null;default:return null}}function nm(e,t){switch(wo(t),t.tag){case 3:Us(at),je();break;case 26:case 27:case 5:gt(t);break;case 4:je();break;case 31:t.memoizedState!==null&&Kt(t);break;case 13:Kt(t);break;case 19:j(Pe);break;case 10:Us(t.type);break;case 22:case 23:Kt(t),Lo(),e!==null&&j(La);break;case 24:Us(at)}}function Sl(e,t){try{var s=t.updateQueue,n=s!==null?s.lastEffect:null;if(n!==null){var o=n.next;s=o;do{if((s.tag&e)===e){n=void 0;var c=s.create,d=s.inst;n=c(),d.destroy=n}s=s.next}while(s!==o)}}catch(y){qe(t,t.return,y)}}function ua(e,t,s){try{var n=t.updateQueue,o=n!==null?n.lastEffect:null;if(o!==null){var c=o.next;n=c;do{if((n.tag&e)===e){var d=n.inst,y=d.destroy;if(y!==void 0){d.destroy=void 0,o=t;var _=s,q=y;try{q()}catch(F){qe(o,_,F)}}}n=n.next}while(n!==c)}}catch(F){qe(t,t.return,F)}}function lm(e){var t=e.updateQueue;if(t!==null){var s=e.stateNode;try{Kd(t,s)}catch(n){qe(e,e.return,n)}}}function im(e,t,s){s.props=Va(e.type,e.memoizedProps),s.state=e.memoizedState;try{s.componentWillUnmount()}catch(n){qe(e,t,n)}}function Cl(e,t){try{var s=e.ref;if(s!==null){switch(e.tag){case 26:case 27:case 5:var n=e.stateNode;break;case 30:n=e.stateNode;break;default:n=e.stateNode}typeof s=="function"?e.refCleanup=s(n):s.current=n}}catch(o){qe(e,t,o)}}function Ss(e,t){var s=e.ref,n=e.refCleanup;if(s!==null)if(typeof n=="function")try{n()}catch(o){qe(e,t,o)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(o){qe(e,t,o)}else s.current=null}function rm(e){var t=e.type,s=e.memoizedProps,n=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":s.autoFocus&&n.focus();break e;case"img":s.src?n.src=s.src:s.srcSet&&(n.srcset=s.srcSet)}}catch(o){qe(e,e.return,o)}}function gc(e,t,s){try{var n=e.stateNode;Xx(n,e.type,s,t),n[zt]=t}catch(o){qe(e,e.return,o)}}function om(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&xa(e.type)||e.tag===4}function xc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||om(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&xa(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function yc(e,t,s){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(e,t):(t=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,t.appendChild(e),s=s._reactRootContainer,s!=null||t.onclick!==null||(t.onclick=Rs));else if(n!==4&&(n===27&&xa(e.type)&&(s=e.stateNode,t=null),e=e.child,e!==null))for(yc(e,t,s),e=e.sibling;e!==null;)yc(e,t,s),e=e.sibling}function qi(e,t,s){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?s.insertBefore(e,t):s.appendChild(e);else if(n!==4&&(n===27&&xa(e.type)&&(s=e.stateNode),e=e.child,e!==null))for(qi(e,t,s),e=e.sibling;e!==null;)qi(e,t,s),e=e.sibling}function cm(e){var t=e.stateNode,s=e.memoizedProps;try{for(var n=e.type,o=t.attributes;o.length;)t.removeAttributeNode(o[0]);Nt(t,n,s),t[xt]=e,t[zt]=s}catch(c){qe(e,e.return,c)}}var Ys=!1,it=!1,bc=!1,um=typeof WeakSet=="function"?WeakSet:Set,ht=null;function Cx(e,t){if(e=e.containerInfo,Hc=ir,e=Nd(e),fo(e)){if("selectionStart"in e)var s={start:e.selectionStart,end:e.selectionEnd};else e:{s=(s=e.ownerDocument)&&s.defaultView||window;var n=s.getSelection&&s.getSelection();if(n&&n.rangeCount!==0){s=n.anchorNode;var o=n.anchorOffset,c=n.focusNode;n=n.focusOffset;try{s.nodeType,c.nodeType}catch{s=null;break e}var d=0,y=-1,_=-1,q=0,F=0,ee=e,Y=null;t:for(;;){for(var X;ee!==s||o!==0&&ee.nodeType!==3||(y=d+o),ee!==c||n!==0&&ee.nodeType!==3||(_=d+n),ee.nodeType===3&&(d+=ee.nodeValue.length),(X=ee.firstChild)!==null;)Y=ee,ee=X;for(;;){if(ee===e)break t;if(Y===s&&++q===o&&(y=d),Y===c&&++F===n&&(_=d),(X=ee.nextSibling)!==null)break;ee=Y,Y=ee.parentNode}ee=X}s=y===-1||_===-1?null:{start:y,end:_}}else s=null}s=s||{start:0,end:0}}else s=null;for($c={focusedElem:e,selectionRange:s},ir=!1,ht=t;ht!==null;)if(t=ht,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ht=e;else for(;ht!==null;){switch(t=ht,c=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(s=0;s<e.length;s++)o=e[s],o.ref.impl=o.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&c!==null){e=void 0,s=t,o=c.memoizedProps,c=c.memoizedState,n=s.stateNode;try{var he=Va(s.type,o);e=n.getSnapshotBeforeUpdate(he,c),n.__reactInternalSnapshotBeforeUpdate=e}catch(Ne){qe(s,s.return,Ne)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,s=e.nodeType,s===9)Gc(e);else if(s===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Gc(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(u(163))}if(e=t.sibling,e!==null){e.return=t.return,ht=e;break}ht=t.return}}function dm(e,t,s){var n=s.flags;switch(s.tag){case 0:case 11:case 15:Gs(e,s),n&4&&Sl(5,s);break;case 1:if(Gs(e,s),n&4)if(e=s.stateNode,t===null)try{e.componentDidMount()}catch(d){qe(s,s.return,d)}else{var o=Va(s.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(o,t,e.__reactInternalSnapshotBeforeUpdate)}catch(d){qe(s,s.return,d)}}n&64&&lm(s),n&512&&Cl(s,s.return);break;case 3:if(Gs(e,s),n&64&&(e=s.updateQueue,e!==null)){if(t=null,s.child!==null)switch(s.child.tag){case 27:case 5:t=s.child.stateNode;break;case 1:t=s.child.stateNode}try{Kd(e,t)}catch(d){qe(s,s.return,d)}}break;case 27:t===null&&n&4&&cm(s);case 26:case 5:Gs(e,s),t===null&&n&4&&rm(s),n&512&&Cl(s,s.return);break;case 12:Gs(e,s);break;case 31:Gs(e,s),n&4&&hm(e,s);break;case 13:Gs(e,s),n&4&&pm(e,s),n&64&&(e=s.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(s=zx.bind(null,s),ey(e,s))));break;case 22:if(n=s.memoizedState!==null||Ys,!n){t=t!==null&&t.memoizedState!==null||it,o=Ys;var c=it;Ys=n,(it=t)&&!c?Zs(e,s,(s.subtreeFlags&8772)!==0):Gs(e,s),Ys=o,it=c}break;case 30:break;default:Gs(e,s)}}function fm(e){var t=e.alternate;t!==null&&(e.alternate=null,fm(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Kr(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 Qe=null,Dt=!1;function Vs(e,t,s){for(s=s.child;s!==null;)mm(e,t,s),s=s.sibling}function mm(e,t,s){if(Et&&typeof Et.onCommitFiberUnmount=="function")try{Et.onCommitFiberUnmount(ka,s)}catch{}switch(s.tag){case 26:it||Ss(s,t),Vs(e,t,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:it||Ss(s,t);var n=Qe,o=Dt;xa(s.type)&&(Qe=s.stateNode,Dt=!1),Vs(e,t,s),zl(s.stateNode),Qe=n,Dt=o;break;case 5:it||Ss(s,t);case 6:if(n=Qe,o=Dt,Qe=null,Vs(e,t,s),Qe=n,Dt=o,Qe!==null)if(Dt)try{(Qe.nodeType===9?Qe.body:Qe.nodeName==="HTML"?Qe.ownerDocument.body:Qe).removeChild(s.stateNode)}catch(c){qe(s,t,c)}else try{Qe.removeChild(s.stateNode)}catch(c){qe(s,t,c)}break;case 18:Qe!==null&&(Dt?(e=Qe,lh(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,s.stateNode),qn(e)):lh(Qe,s.stateNode));break;case 4:n=Qe,o=Dt,Qe=s.stateNode.containerInfo,Dt=!0,Vs(e,t,s),Qe=n,Dt=o;break;case 0:case 11:case 14:case 15:ua(2,s,t),it||ua(4,s,t),Vs(e,t,s);break;case 1:it||(Ss(s,t),n=s.stateNode,typeof n.componentWillUnmount=="function"&&im(s,t,n)),Vs(e,t,s);break;case 21:Vs(e,t,s);break;case 22:it=(n=it)||s.memoizedState!==null,Vs(e,t,s),it=n;break;default:Vs(e,t,s)}}function hm(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{qn(e)}catch(s){qe(t,t.return,s)}}}function pm(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{qn(e)}catch(s){qe(t,t.return,s)}}function kx(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new um),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new um),t;default:throw Error(u(435,e.tag))}}function Hi(e,t){var s=kx(e);t.forEach(function(n){if(!s.has(n)){s.add(n);var o=Bx.bind(null,e,n);n.then(o,o)}})}function Ut(e,t){var s=t.deletions;if(s!==null)for(var n=0;n<s.length;n++){var o=s[n],c=e,d=t,y=d;e:for(;y!==null;){switch(y.tag){case 27:if(xa(y.type)){Qe=y.stateNode,Dt=!1;break e}break;case 5:Qe=y.stateNode,Dt=!1;break e;case 3:case 4:Qe=y.stateNode.containerInfo,Dt=!0;break e}y=y.return}if(Qe===null)throw Error(u(160));mm(c,d,o),Qe=null,Dt=!1,c=o.alternate,c!==null&&(c.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)gm(t,e),t=t.sibling}var gs=null;function gm(e,t){var s=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Ut(t,e),Lt(e),n&4&&(ua(3,e,e.return),Sl(3,e),ua(5,e,e.return));break;case 1:Ut(t,e),Lt(e),n&512&&(it||s===null||Ss(s,s.return)),n&64&&Ys&&(e=e.updateQueue,e!==null&&(n=e.callbacks,n!==null&&(s=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=s===null?n:s.concat(n))));break;case 26:var o=gs;if(Ut(t,e),Lt(e),n&512&&(it||s===null||Ss(s,s.return)),n&4){var c=s!==null?s.memoizedState:null;if(n=e.memoizedState,s===null)if(n===null)if(e.stateNode===null){e:{n=e.type,s=e.memoizedProps,o=o.ownerDocument||o;t:switch(n){case"title":c=o.getElementsByTagName("title")[0],(!c||c[Wn]||c[xt]||c.namespaceURI==="http://www.w3.org/2000/svg"||c.hasAttribute("itemprop"))&&(c=o.createElement(n),o.head.insertBefore(c,o.querySelector("head > title"))),Nt(c,n,s),c[xt]=e,mt(c),n=c;break e;case"link":var d=gh("link","href",o).get(n+(s.href||""));if(d){for(var y=0;y<d.length;y++)if(c=d[y],c.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&c.getAttribute("rel")===(s.rel==null?null:s.rel)&&c.getAttribute("title")===(s.title==null?null:s.title)&&c.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){d.splice(y,1);break t}}c=o.createElement(n),Nt(c,n,s),o.head.appendChild(c);break;case"meta":if(d=gh("meta","content",o).get(n+(s.content||""))){for(y=0;y<d.length;y++)if(c=d[y],c.getAttribute("content")===(s.content==null?null:""+s.content)&&c.getAttribute("name")===(s.name==null?null:s.name)&&c.getAttribute("property")===(s.property==null?null:s.property)&&c.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&c.getAttribute("charset")===(s.charSet==null?null:s.charSet)){d.splice(y,1);break t}}c=o.createElement(n),Nt(c,n,s),o.head.appendChild(c);break;default:throw Error(u(468,n))}c[xt]=e,mt(c),n=c}e.stateNode=n}else xh(o,e.type,e.stateNode);else e.stateNode=ph(o,n,e.memoizedProps);else c!==n?(c===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):c.count--,n===null?xh(o,e.type,e.stateNode):ph(o,n,e.memoizedProps)):n===null&&e.stateNode!==null&&gc(e,e.memoizedProps,s.memoizedProps)}break;case 27:Ut(t,e),Lt(e),n&512&&(it||s===null||Ss(s,s.return)),s!==null&&n&4&&gc(e,e.memoizedProps,s.memoizedProps);break;case 5:if(Ut(t,e),Lt(e),n&512&&(it||s===null||Ss(s,s.return)),e.flags&32){o=e.stateNode;try{on(o,"")}catch(he){qe(e,e.return,he)}}n&4&&e.stateNode!=null&&(o=e.memoizedProps,gc(e,o,s!==null?s.memoizedProps:o)),n&1024&&(bc=!0);break;case 6:if(Ut(t,e),Lt(e),n&4){if(e.stateNode===null)throw Error(u(162));n=e.memoizedProps,s=e.stateNode;try{s.nodeValue=n}catch(he){qe(e,e.return,he)}}break;case 3:if(sr=null,o=gs,gs=er(t.containerInfo),Ut(t,e),gs=o,Lt(e),n&4&&s!==null&&s.memoizedState.isDehydrated)try{qn(t.containerInfo)}catch(he){qe(e,e.return,he)}bc&&(bc=!1,xm(e));break;case 4:n=gs,gs=er(e.stateNode.containerInfo),Ut(t,e),Lt(e),gs=n;break;case 12:Ut(t,e),Lt(e);break;case 31:Ut(t,e),Lt(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Hi(e,n)));break;case 13:Ut(t,e),Lt(e),e.child.flags&8192&&e.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(Yi=_t()),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Hi(e,n)));break;case 22:o=e.memoizedState!==null;var _=s!==null&&s.memoizedState!==null,q=Ys,F=it;if(Ys=q||o,it=F||_,Ut(t,e),it=F,Ys=q,Lt(e),n&8192)e:for(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,o&&(s===null||_||Ys||it||Ga(e)),s=null,t=e;;){if(t.tag===5||t.tag===26){if(s===null){_=s=t;try{if(c=_.stateNode,o)d=c.style,typeof d.setProperty=="function"?d.setProperty("display","none","important"):d.display="none";else{y=_.stateNode;var ee=_.memoizedProps.style,Y=ee!=null&&ee.hasOwnProperty("display")?ee.display:null;y.style.display=Y==null||typeof Y=="boolean"?"":(""+Y).trim()}}catch(he){qe(_,_.return,he)}}}else if(t.tag===6){if(s===null){_=t;try{_.stateNode.nodeValue=o?"":_.memoizedProps}catch(he){qe(_,_.return,he)}}}else if(t.tag===18){if(s===null){_=t;try{var X=_.stateNode;o?ih(X,!0):ih(_.stateNode,!1)}catch(he){qe(_,_.return,he)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;s===t&&(s=null),t=t.return}s===t&&(s=null),t.sibling.return=t.return,t=t.sibling}n&4&&(n=e.updateQueue,n!==null&&(s=n.retryQueue,s!==null&&(n.retryQueue=null,Hi(e,s))));break;case 19:Ut(t,e),Lt(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Hi(e,n)));break;case 30:break;case 21:break;default:Ut(t,e),Lt(e)}}function Lt(e){var t=e.flags;if(t&2){try{for(var s,n=e.return;n!==null;){if(om(n)){s=n;break}n=n.return}if(s==null)throw Error(u(160));switch(s.tag){case 27:var o=s.stateNode,c=xc(e);qi(e,c,o);break;case 5:var d=s.stateNode;s.flags&32&&(on(d,""),s.flags&=-33);var y=xc(e);qi(e,y,d);break;case 3:case 4:var _=s.stateNode.containerInfo,q=xc(e);yc(e,q,_);break;default:throw Error(u(161))}}catch(F){qe(e,e.return,F)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function xm(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;xm(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Gs(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)dm(e,t.alternate,t),t=t.sibling}function Ga(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:ua(4,t,t.return),Ga(t);break;case 1:Ss(t,t.return);var s=t.stateNode;typeof s.componentWillUnmount=="function"&&im(t,t.return,s),Ga(t);break;case 27:zl(t.stateNode);case 26:case 5:Ss(t,t.return),Ga(t);break;case 22:t.memoizedState===null&&Ga(t);break;case 30:Ga(t);break;default:Ga(t)}e=e.sibling}}function Zs(e,t,s){for(s=s&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var n=t.alternate,o=e,c=t,d=c.flags;switch(c.tag){case 0:case 11:case 15:Zs(o,c,s),Sl(4,c);break;case 1:if(Zs(o,c,s),n=c,o=n.stateNode,typeof o.componentDidMount=="function")try{o.componentDidMount()}catch(q){qe(n,n.return,q)}if(n=c,o=n.updateQueue,o!==null){var y=n.stateNode;try{var _=o.shared.hiddenCallbacks;if(_!==null)for(o.shared.hiddenCallbacks=null,o=0;o<_.length;o++)Qd(_[o],y)}catch(q){qe(n,n.return,q)}}s&&d&64&&lm(c),Cl(c,c.return);break;case 27:cm(c);case 26:case 5:Zs(o,c,s),s&&n===null&&d&4&&rm(c),Cl(c,c.return);break;case 12:Zs(o,c,s);break;case 31:Zs(o,c,s),s&&d&4&&hm(o,c);break;case 13:Zs(o,c,s),s&&d&4&&pm(o,c);break;case 22:c.memoizedState===null&&Zs(o,c,s),Cl(c,c.return);break;case 30:break;default:Zs(o,c,s)}t=t.sibling}}function vc(e,t){var s=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==s&&(e!=null&&e.refCount++,s!=null&&dl(s))}function Nc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&dl(e))}function xs(e,t,s,n){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)ym(e,t,s,n),t=t.sibling}function ym(e,t,s,n){var o=t.flags;switch(t.tag){case 0:case 11:case 15:xs(e,t,s,n),o&2048&&Sl(9,t);break;case 1:xs(e,t,s,n);break;case 3:xs(e,t,s,n),o&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&dl(e)));break;case 12:if(o&2048){xs(e,t,s,n),e=t.stateNode;try{var c=t.memoizedProps,d=c.id,y=c.onPostCommit;typeof y=="function"&&y(d,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(_){qe(t,t.return,_)}}else xs(e,t,s,n);break;case 31:xs(e,t,s,n);break;case 13:xs(e,t,s,n);break;case 23:break;case 22:c=t.stateNode,d=t.alternate,t.memoizedState!==null?c._visibility&2?xs(e,t,s,n):kl(e,t):c._visibility&2?xs(e,t,s,n):(c._visibility|=2,En(e,t,s,n,(t.subtreeFlags&10256)!==0||!1)),o&2048&&vc(d,t);break;case 24:xs(e,t,s,n),o&2048&&Nc(t.alternate,t);break;default:xs(e,t,s,n)}}function En(e,t,s,n,o){for(o=o&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var c=e,d=t,y=s,_=n,q=d.flags;switch(d.tag){case 0:case 11:case 15:En(c,d,y,_,o),Sl(8,d);break;case 23:break;case 22:var F=d.stateNode;d.memoizedState!==null?F._visibility&2?En(c,d,y,_,o):kl(c,d):(F._visibility|=2,En(c,d,y,_,o)),o&&q&2048&&vc(d.alternate,d);break;case 24:En(c,d,y,_,o),o&&q&2048&&Nc(d.alternate,d);break;default:En(c,d,y,_,o)}t=t.sibling}}function kl(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var s=e,n=t,o=n.flags;switch(n.tag){case 22:kl(s,n),o&2048&&vc(n.alternate,n);break;case 24:kl(s,n),o&2048&&Nc(n.alternate,n);break;default:kl(s,n)}t=t.sibling}}var _l=8192;function Tn(e,t,s){if(e.subtreeFlags&_l)for(e=e.child;e!==null;)bm(e,t,s),e=e.sibling}function bm(e,t,s){switch(e.tag){case 26:Tn(e,t,s),e.flags&_l&&e.memoizedState!==null&&fy(s,gs,e.memoizedState,e.memoizedProps);break;case 5:Tn(e,t,s);break;case 3:case 4:var n=gs;gs=er(e.stateNode.containerInfo),Tn(e,t,s),gs=n;break;case 22:e.memoizedState===null&&(n=e.alternate,n!==null&&n.memoizedState!==null?(n=_l,_l=16777216,Tn(e,t,s),_l=n):Tn(e,t,s));break;default:Tn(e,t,s)}}function vm(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function El(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var s=0;s<t.length;s++){var n=t[s];ht=n,jm(n,e)}vm(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Nm(e),e=e.sibling}function Nm(e){switch(e.tag){case 0:case 11:case 15:El(e),e.flags&2048&&ua(9,e,e.return);break;case 3:El(e);break;case 12:El(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,$i(e)):El(e);break;default:El(e)}}function $i(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var s=0;s<t.length;s++){var n=t[s];ht=n,jm(n,e)}vm(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:ua(8,t,t.return),$i(t);break;case 22:s=t.stateNode,s._visibility&2&&(s._visibility&=-3,$i(t));break;default:$i(t)}e=e.sibling}}function jm(e,t){for(;ht!==null;){var s=ht;switch(s.tag){case 0:case 11:case 15:ua(8,s,t);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var n=s.memoizedState.cachePool.pool;n!=null&&n.refCount++}break;case 24:dl(s.memoizedState.cache)}if(n=s.child,n!==null)n.return=s,ht=n;else e:for(s=e;ht!==null;){n=ht;var o=n.sibling,c=n.return;if(fm(n),n===s){ht=null;break e}if(o!==null){o.return=c,ht=o;break e}ht=c}}}var _x={getCacheForType:function(e){var t=bt(at),s=t.data.get(e);return s===void 0&&(s=e(),t.data.set(e,s)),s},cacheSignal:function(){return bt(at).controller.signal}},Ex=typeof WeakMap=="function"?WeakMap:Map,De=0,Ve=null,_e=null,Ae=0,Le=0,Jt=null,da=!1,An=!1,jc=!1,Xs=0,Fe=0,fa=0,Za=0,wc=0,It=0,Mn=0,Tl=null,qt=null,Sc=!1,Yi=0,wm=0,Vi=1/0,Gi=null,ma=null,ct=0,ha=null,Rn=null,Qs=0,Cc=0,kc=null,Sm=null,Al=0,_c=null;function Ft(){return(De&2)!==0&&Ae!==0?Ae&-Ae:C.T!==null?Oc():Xr()}function Cm(){if(It===0)if((Ae&536870912)===0||Re){var e=Pa;Pa<<=1,(Pa&3932160)===0&&(Pa=262144),It=e}else It=536870912;return e=Qt.current,e!==null&&(e.flags|=32),It}
vendor: 4,101 bytes, line 8
8function Ht(e,t,s){(e===Ve&&(Le===2||Le===9)||e.cancelPendingCommit!==null)&&(On(e,0),pa(e,Ae,It,!1)),Ke(e,s),((De&2)===0||e!==Ve)&&(e===Ve&&((De&2)===0&&(Za|=s),Fe===4&&pa(e,Ae,It,!1)),Cs(e))}function km(e,t,s){if((De&6)!==0)throw Error(u(327));var n=!s&&(t&127)===0&&(t&e.expiredLanes)===0||Xe(e,t),o=n?Mx(e,t):Tc(e,t,!0),c=n;do{if(o===0){An&&!n&&pa(e,t,0,!1);break}else{if(s=e.current.alternate,c&&!Tx(s)){o=Tc(e,t,!1),c=!1;continue}if(o===2){if(c=t,e.errorRecoveryDisabledLanes&c)var d=0;else d=e.pendingLanes&-536870913,d=d!==0?d:d&536870912?536870912:0;if(d!==0){t=d;e:{var y=e;o=Tl;var _=y.current.memoizedState.isDehydrated;if(_&&(On(y,d).flags|=256),d=Tc(y,d,!1),d!==2){if(jc&&!_){y.errorRecoveryDisabledLanes|=c,Za|=c,o=4;break e}c=qt,qt=o,c!==null&&(qt===null?qt=c:qt.push.apply(qt,c))}o=d}if(c=!1,o!==2)continue}}if(o===1){On(e,0),pa(e,t,0,!0);break}e:{switch(n=e,c=o,c){case 0:case 1:throw Error(u(345));case 4:if((t&4194048)!==t)break;case 6:pa(n,t,It,!da);break e;case 2:qt=null;break;case 3:case 5:break;default:throw Error(u(329))}if((t&62914560)===t&&(o=Yi+300-_t(),10<o)){if(pa(n,t,It,!da),we(n,0,!0)!==0)break e;Qs=t,n.timeoutHandle=ah(_m.bind(null,n,s,qt,Gi,Sc,t,It,Za,Mn,da,c,"Throttled",-0,0),o);break e}_m(n,s,qt,Gi,Sc,t,It,Za,Mn,da,c,null,-0,0)}}break}while(!0);Cs(e)}function _m(e,t,s,n,o,c,d,y,_,q,F,ee,Y,X){if(e.timeoutHandle=-1,ee=t.subtreeFlags,ee&8192||(ee&16785408)===16785408){ee={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Rs},bm(t,c,ee);var he=(c&62914560)===c?Yi-_t():(c&4194048)===c?wm-_t():0;if(he=my(ee,he),he!==null){Qs=c,e.cancelPendingCommit=he(Bm.bind(null,e,t,c,s,n,o,d,y,_,F,ee,null,Y,X)),pa(e,c,d,!q);return}}Bm(e,t,c,s,n,o,d,y,_)}function Tx(e){for(var t=e;;){var s=t.tag;if((s===0||s===11||s===15)&&t.flags&16384&&(s=t.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var n=0;n<s.length;n++){var o=s[n],c=o.getSnapshot;o=o.value;try{if(!Zt(c(),o))return!1}catch{return!1}}if(s=t.child,t.subtreeFlags&16384&&s!==null)s.return=t,t=s;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function pa(e,t,s,n){t&=~wc,t&=~Za,e.suspendedLanes|=t,e.pingedLanes&=~t,n&&(e.warmLanes|=t),n=e.expirationTimes;for(var o=t;0<o;){var c=31-jt(o),d=1<<c;n[c]=-1,o&=~d}s!==0&&Ea(e,s,t)}function Zi(){return(De&6)===0?(Ml(0),!1):!0}function Ec(){if(_e!==null){if(Le===0)var e=_e.return;else e=_e,Ds=Da=null,Go(e),wn=null,ml=0,e=_e;for(;e!==null;)nm(e.alternate,e),e=e.return;_e=null}}function On(e,t){var s=e.timeoutHandle;s!==-1&&(e.timeoutHandle=-1,Jx(s)),s=e.cancelPendingCommit,s!==null&&(e.cancelPendingCommit=null,s()),Qs=0,Ec(),Ve=e,_e=s=zs(e.current,null),Ae=t,Le=0,Jt=null,da=!1,An=Xe(e,t),jc=!1,Mn=It=wc=Za=fa=Fe=0,qt=Tl=null,Sc=!1,(t&8)!==0&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var o=31-jt(n),c=1<<o;t|=e[o],n&=~c}return Xs=t,fi(),s}function Em(e,t){Ce=null,C.H=Nl,t===jn||t===vi?(t=Vd(),Le=3):t===Ro?(t=Vd(),Le=4):Le=t===ic?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Jt=t,_e===null&&(Fe=1,zi(e,ns(t,e.current)))}function Tm(){var e=Qt.current;return e===null?!0:(Ae&4194048)===Ae?os===null:(Ae&62914560)===Ae||(Ae&536870912)!==0?e===os:!1}function Am(){var e=C.H;return C.H=Nl,e===null?Nl:e}function Mm(){var e=C.A;return C.A=_x,e}function Xi(){Fe=4,da||(Ae&4194048)!==Ae&&Qt.current!==null||(An=!0),(fa&134217727)===0&&(Za&134217727)===0||Ve===null||pa(Ve,Ae,It,!1)}function Tc(e,t,s){var n=De;De|=2;var o=Am(),c=Mm();(Ve!==e||Ae!==t)&&(Gi=null,On(e,t)),t=!1;var d=Fe;e:do try{if(Le!==0&&_e!==null){var y=_e,_=Jt;switch(Le){case 8:Ec(),d=6;break e;case 3:case 2:case 9:case 6:Qt.current===null&&(t=!0);var q=Le;if(Le=0,Jt=null,zn(e,y,_,q),s&&An){d=0;break e}break;default:q=Le,Le=0,Jt=null,zn(e,y,_,q)}}Ax(),d=Fe;break}catch(F){Em(e,F)}while(!0);return t&&e.shellSuspendCounter++,Ds=Da=null,De=n,C.H=o,C.A=c,_e===null&&(Ve=null,Ae=0,fi()),d}function Ax(){for(;_e!==null;)Rm(_e)}function Mx(e,t){var s=De;De|=2;var n=Am(),o=Mm();
vendor: 4,138 bytes, line 8
8Ve!==e||Ae!==t?(Gi=null,Vi=_t()+500,On(e,t)):An=Xe(e,t);e:do try{if(Le!==0&&_e!==null){t=_e;var c=Jt;t:switch(Le){case 1:Le=0,Jt=null,zn(e,t,c,1);break;case 2:case 9:if($d(c)){Le=0,Jt=null,Om(t);break}t=function(){Le!==2&&Le!==9||Ve!==e||(Le=7),Cs(e)},c.then(t,t);break e;case 3:Le=7;break e;case 4:Le=5;break e;case 7:$d(c)?(Le=0,Jt=null,Om(t)):(Le=0,Jt=null,zn(e,t,c,7));break;case 5:var d=null;switch(_e.tag){case 26:d=_e.memoizedState;case 5:case 27:var y=_e;if(d?yh(d):y.stateNode.complete){Le=0,Jt=null;var _=y.sibling;if(_!==null)_e=_;else{var q=y.return;q!==null?(_e=q,Qi(q)):_e=null}break t}}Le=0,Jt=null,zn(e,t,c,5);break;case 6:Le=0,Jt=null,zn(e,t,c,6);break;case 8:Ec(),Fe=6;break e;default:throw Error(u(462))}}Rx();break}catch(F){Em(e,F)}while(!0);return Ds=Da=null,C.H=n,C.A=o,De=s,_e!==null?0:(Ve=null,Ae=0,fi(),Fe)}function Rx(){for(;_e!==null&&!kt();)Rm(_e)}function Rm(e){var t=sm(e.alternate,e,Xs);e.memoizedProps=e.pendingProps,t===null?Qi(e):_e=t}function Om(e){var t=e,s=t.alternate;switch(t.tag){case 15:case 0:t=If(s,t,t.pendingProps,t.type,void 0,Ae);break;case 11:t=If(s,t,t.pendingProps,t.type.render,t.ref,Ae);break;case 5:Go(t);default:nm(s,t),t=_e=Ad(t,Xs),t=sm(s,t,Xs)}e.memoizedProps=e.pendingProps,t===null?Qi(e):_e=t}function zn(e,t,s,n){Ds=Da=null,Go(t),wn=null,ml=0;var o=t.return;try{if(vx(e,o,t,s,Ae)){Fe=1,zi(e,ns(s,e.current)),_e=null;return}}catch(c){if(o!==null)throw _e=o,c;Fe=1,zi(e,ns(s,e.current)),_e=null;return}t.flags&32768?(Re||n===1?e=!0:An||(Ae&536870912)!==0?e=!1:(da=e=!0,(n===2||n===9||n===3||n===6)&&(n=Qt.current,n!==null&&n.tag===13&&(n.flags|=16384))),zm(t,e)):Qi(t)}function Qi(e){var t=e;do{if((t.flags&32768)!==0){zm(t,da);return}e=t.return;var s=wx(t.alternate,t,Xs);if(s!==null){_e=s;return}if(t=t.sibling,t!==null){_e=t;return}_e=t=e}while(t!==null);Fe===0&&(Fe=5)}function zm(e,t){do{var s=Sx(e.alternate,e);if(s!==null){s.flags&=32767,_e=s;return}if(s=e.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!t&&(e=e.sibling,e!==null)){_e=e;return}_e=e=s}while(e!==null);Fe=6,_e=null}function Bm(e,t,s,n,o,c,d,y,_){e.cancelPendingCommit=null;do Ki();while(ct!==0);if((De&6)!==0)throw Error(u(327));if(t!==null){if(t===e.current)throw Error(u(177));if(c=t.lanes|t.childLanes,c|=xo,Mt(e,s,c,d,y,_),e===Ve&&(_e=Ve=null,Ae=0),Rn=t,ha=e,Qs=s,Cc=c,kc=o,Sm=n,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Dx(Ca,function(){return Hm(),null})):(e.callbackNode=null,e.callbackPriority=0),n=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||n){n=C.T,C.T=null,o=H.p,H.p=2,d=De,De|=4;try{Cx(e,t,s)}finally{De=d,H.p=o,C.T=n}}ct=1,Dm(),Um(),Lm()}}function Dm(){if(ct===1){ct=0;var e=ha,t=Rn,s=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||s){s=C.T,C.T=null;var n=H.p;H.p=2;var o=De;De|=4;try{gm(t,e);var c=$c,d=Nd(e.containerInfo),y=c.focusedElem,_=c.selectionRange;if(d!==y&&y&&y.ownerDocument&&vd(y.ownerDocument.documentElement,y)){if(_!==null&&fo(y)){var q=_.start,F=_.end;if(F===void 0&&(F=q),"selectionStart"in y)y.selectionStart=q,y.selectionEnd=Math.min(F,y.value.length);else{var ee=y.ownerDocument||document,Y=ee&&ee.defaultView||window;if(Y.getSelection){var X=Y.getSelection(),he=y.textContent.length,Ne=Math.min(_.start,he),Ye=_.end===void 0?Ne:Math.min(_.end,he);!X.extend&&Ne>Ye&&(d=Ye,Ye=Ne,Ne=d);var z=bd(y,Ne),M=bd(y,Ye);if(z&&M&&(X.rangeCount!==1||X.anchorNode!==z.node||X.anchorOffset!==z.offset||X.focusNode!==M.node||X.focusOffset!==M.offset)){var L=ee.createRange();L.setStart(z.node,z.offset),X.removeAllRanges(),Ne>Ye?(X.addRange(L),X.extend(M.node,M.offset)):(L.setEnd(M.node,M.offset),X.addRange(L))}}}}for(ee=[],X=y;X=X.parentNode;)X.nodeType===1&&ee.push({element:X,left:X.scrollLeft,top:X.scrollTop});for(typeof y.focus=="function"&&y.focus(),y=0;y<ee.length;y++){var W=ee[y];W.element.scrollLeft=W.left,W.element.scrollTop=W.top}}ir=!!Hc,$c=Hc=null}finally{De=o,H.p=n,C.T=s}}e.current=t,ct=2}}function Um(){if(ct===2){ct=0;var e=ha,t=Rn,s=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||s){s=C.T,C.T=null;var n=H.p;H.p=2;var o=De;De|=4;try{dm(e,t.alternate,t)}finally{De=o,H.p=n,C.T=s}}ct=3}}
vendor: 9,832 bytes, line 8
8function Lm(){if(ct===4||ct===3){ct=0,Is();var e=ha,t=Rn,s=Qs,n=Sm;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?ct=5:(ct=0,Rn=ha=null,qm(e,e.pendingLanes));var o=e.pendingLanes;if(o===0&&(ma=null),hs(s),t=t.stateNode,Et&&typeof Et.onCommitFiberRoot=="function")try{Et.onCommitFiberRoot(ka,t,void 0,(t.current.flags&128)===128)}catch{}if(n!==null){t=C.T,o=H.p,H.p=2,C.T=null;try{for(var c=e.onRecoverableError,d=0;d<n.length;d++){var y=n[d];c(y.value,{componentStack:y.stack})}}finally{C.T=t,H.p=o}}(Qs&3)!==0&&Ki(),Cs(e),o=e.pendingLanes,(s&261930)!==0&&(o&42)!==0?e===_c?Al++:(Al=0,_c=e):Al=0,Ml(0)}}function qm(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,dl(t)))}function Ki(){return Dm(),Um(),Lm(),Hm()}function Hm(){if(ct!==5)return!1;var e=ha,t=Cc;Cc=0;var s=hs(Qs),n=C.T,o=H.p;try{H.p=32>s?32:s,C.T=null,s=kc,kc=null;var c=ha,d=Qs;if(ct=0,Rn=ha=null,Qs=0,(De&6)!==0)throw Error(u(331));var y=De;if(De|=4,Nm(c.current),ym(c,c.current,d,s),De=y,Ml(0,!1),Et&&typeof Et.onPostCommitFiberRoot=="function")try{Et.onPostCommitFiberRoot(ka,c)}catch{}return!0}finally{H.p=o,C.T=n,qm(e,t)}}function $m(e,t,s){t=ns(s,t),t=lc(e.stateNode,t,2),e=ra(e,t,2),e!==null&&(Ke(e,2),Cs(e))}function qe(e,t,s){if(e.tag===3)$m(e,e,s);else for(;t!==null;){if(t.tag===3){$m(t,e,s);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(ma===null||!ma.has(n))){e=ns(s,e),s=Yf(2),n=ra(t,s,2),n!==null&&(Vf(s,n,t,e),Ke(n,2),Cs(n));break}}t=t.return}}function Ac(e,t,s){var n=e.pingCache;if(n===null){n=e.pingCache=new Ex;var o=new Set;n.set(t,o)}else o=n.get(t),o===void 0&&(o=new Set,n.set(t,o));o.has(s)||(jc=!0,o.add(s),e=Ox.bind(null,e,t,s),t.then(e,e))}function Ox(e,t,s){var n=e.pingCache;n!==null&&n.delete(t),e.pingedLanes|=e.suspendedLanes&s,e.warmLanes&=~s,Ve===e&&(Ae&s)===s&&(Fe===4||Fe===3&&(Ae&62914560)===Ae&&300>_t()-Yi?(De&2)===0&&On(e,0):wc|=s,Mn===Ae&&(Mn=0)),Cs(e)}function Ym(e,t){t===0&&(t=wt()),e=Oa(e,t),e!==null&&(Ke(e,t),Cs(e))}function zx(e){var t=e.memoizedState,s=0;t!==null&&(s=t.retryLane),Ym(e,s)}function Bx(e,t){var s=0;switch(e.tag){case 31:case 13:var n=e.stateNode,o=e.memoizedState;o!==null&&(s=o.retryLane);break;case 19:n=e.stateNode;break;case 22:n=e.stateNode._retryCache;break;default:throw Error(u(314))}n!==null&&n.delete(t),Ym(e,s)}function Dx(e,t){return Kn(e,t)}var Ji=null,Bn=null,Mc=!1,Ii=!1,Rc=!1,ga=0;function Cs(e){e!==Bn&&e.next===null&&(Bn===null?Ji=Bn=e:Bn=Bn.next=e),Ii=!0,Mc||(Mc=!0,Lx())}function Ml(e,t){if(!Rc&&Ii){Rc=!0;do for(var s=!1,n=Ji;n!==null;){if(e!==0){var o=n.pendingLanes;if(o===0)var c=0;else{var d=n.suspendedLanes,y=n.pingedLanes;c=(1<<31-jt(42|e)+1)-1,c&=o&~(d&~y),c=c&201326741?c&201326741|1:c?c|2:0}c!==0&&(s=!0,Xm(n,c))}else c=Ae,c=we(n,n===Ve?c:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),(c&3)===0||Xe(n,c)||(s=!0,Xm(n,c));n=n.next}while(s);Rc=!1}}function Ux(){Vm()}function Vm(){Ii=Mc=!1;var e=0;ga!==0&&Kx()&&(e=ga);for(var t=_t(),s=null,n=Ji;n!==null;){var o=n.next,c=Gm(n,t);c===0?(n.next=null,s===null?Ji=o:s.next=o,o===null&&(Bn=s)):(s=n,(e!==0||(c&3)!==0)&&(Ii=!0)),n=o}ct!==0&&ct!==5||Ml(e),ga!==0&&(ga=0)}function Gm(e,t){for(var s=e.suspendedLanes,n=e.pingedLanes,o=e.expirationTimes,c=e.pendingLanes&-62914561;0<c;){var d=31-jt(c),y=1<<d,_=o[d];_===-1?((y&s)===0||(y&n)!==0)&&(o[d]=ft(y,t)):_<=t&&(e.expiredLanes|=y),c&=~y}if(t=Ve,s=Ae,s=we(e,e===t?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n=e.callbackNode,s===0||e===t&&(Le===2||Le===9)||e.cancelPendingCommit!==null)return n!==null&&n!==null&&Jn(n),e.callbackNode=null,e.callbackPriority=0;if((s&3)===0||Xe(e,s)){if(t=s&-s,t===e.callbackPriority)return t;switch(n!==null&&Jn(n),hs(s)){case 2:case 8:s=Pl;break;case 32:s=Ca;break;case 268435456:s=As;break;default:s=Ca}return n=Zm.bind(null,e),s=Kn(s,n),e.callbackPriority=t,e.callbackNode=s,t}return n!==null&&n!==null&&Jn(n),e.callbackPriority=2,e.callbackNode=null,2}function Zm(e,t){if(ct!==0&&ct!==5)return e.callbackNode=null,e.callbackPriority=0,null;var s=e.callbackNode;if(Ki()&&e.callbackNode!==s)return null;var n=Ae;return n=we(e,e===Ve?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n===0?null:(km(e,n,t),Gm(e,_t()),e.callbackNode!=null&&e.callbackNode===s?Zm.bind(null,e):null)}function Xm(e,t){if(Ki())return null;km(e,t,!0)}function Lx(){Ix(function(){(De&6)!==0?Kn(Sa,Ux):Vm()})}function Oc(){if(ga===0){var e=vn;e===0&&(e=Wa,Wa<<=1,(Wa&261888)===0&&(Wa=256)),ga=e}return ga}function Qm(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:ni(""+e)}function Km(e,t){var s=t.ownerDocument.createElement("input");return s.name=t.name,s.value=t.value,e.id&&s.setAttribute("form",e.id),t.parentNode.insertBefore(s,t),e=new FormData(e),s.parentNode.removeChild(s),e}function qx(e,t,s,n,o){if(t==="submit"&&s&&s.stateNode===o){var c=Qm((o[zt]||null).action),d=n.submitter;d&&(t=(t=d[zt]||null)?Qm(t.formAction):d.getAttribute("formAction"),t!==null&&(c=t,d=null));var y=new oi("action","action",null,n,o);e.push({event:y,listeners:[{instance:null,listener:function(){if(n.defaultPrevented){if(ga!==0){var _=d?Km(o,d):new FormData(o);Po(s,{pending:!0,data:_,method:o.method,action:c},null,_)}}else typeof c=="function"&&(y.preventDefault(),_=d?Km(o,d):new FormData(o),Po(s,{pending:!0,data:_,method:o.method,action:c},c,_))},currentTarget:o}]})}}for(var zc=0;zc<go.length;zc++){var Bc=go[zc],Hx=Bc.toLowerCase(),$x=Bc[0].toUpperCase()+Bc.slice(1);ps(Hx,"on"+$x)}ps(Sd,"onAnimationEnd"),ps(Cd,"onAnimationIteration"),ps(kd,"onAnimationStart"),ps("dblclick","onDoubleClick"),ps("focusin","onFocus"),ps("focusout","onBlur"),ps(ax,"onTransitionRun"),ps(nx,"onTransitionStart"),ps(lx,"onTransitionCancel"),ps(_d,"onTransitionEnd"),ln("onMouseEnter",["mouseout","mouseover"]),ln("onMouseLeave",["mouseout","mouseover"]),ln("onPointerEnter",["pointerout","pointerover"]),ln("onPointerLeave",["pointerout","pointerover"]),Ta("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ta("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ta("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ta("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ta("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ta("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Rl="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(" "),Yx=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Rl));function Jm(e,t){t=(t&4)!==0;for(var s=0;s<e.length;s++){var n=e[s],o=n.event;n=n.listeners;e:{var c=void 0;if(t)for(var d=n.length-1;0<=d;d--){var y=n[d],_=y.instance,q=y.currentTarget;if(y=y.listener,_!==c&&o.isPropagationStopped())break e;c=y,o.currentTarget=q;try{c(o)}catch(F){di(F)}o.currentTarget=null,c=_}else for(d=0;d<n.length;d++){if(y=n[d],_=y.instance,q=y.currentTarget,y=y.listener,_!==c&&o.isPropagationStopped())break e;c=y,o.currentTarget=q;try{c(o)}catch(F){di(F)}o.currentTarget=null,c=_}}}}function Ee(e,t){var s=t[Qr];s===void 0&&(s=t[Qr]=new Set);var n=e+"__bubble";s.has(n)||(Im(t,e,2,!1),s.add(n))}function Dc(e,t,s){var n=0;t&&(n|=4),Im(s,e,n,t)}var Fi="_reactListening"+Math.random().toString(36).slice(2);function Uc(e){if(!e[Fi]){e[Fi]=!0,Yu.forEach(function(s){s!=="selectionchange"&&(Yx.has(s)||Dc(s,!1,e),Dc(s,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Fi]||(t[Fi]=!0,Dc("selectionchange",!1,t))}}function Im(e,t,s,n){switch(Ch(t)){case 2:var o=gy;break;case 8:o=xy;break;default:o=Wc}s=o.bind(null,t,s,e),o=void 0,!so||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),n?o!==void 0?e.addEventListener(t,s,{capture:!0,passive:o}):e.addEventListener(t,s,!0):o!==void 0?e.addEventListener(t,s,{passive:o}):e.addEventListener(t,s,!1)}function Lc(e,t,s,n,o){var c=n;if((t&1)===0&&(t&2)===0&&n!==null)e:for(;;){if(n===null)return;var d=n.tag;if(d===3||d===4){var y=n.stateNode.containerInfo;if(y===o)break;if(d===4)for(d=n.return;d!==null;){var _=d.tag;if((_===3||_===4)&&d.stateNode.containerInfo===o)return;d=d.return}for(;y!==null;){if(d=sn(y),d===null)return;if(_=d.tag,_===5||_===6||_===26||_===27){n=c=d;continue e}y=y.parentNode}}n=n.return}ed(function(){var q=c,F=eo(s),ee=[];e:{var Y=Ed.get(e);if(Y!==void 0){var X=oi,he=e;switch(e){case"keypress":if(ii(s)===0)break e;case"keydown":case"keyup":X=Bg;break;case"focusin":he="focus",X=io;break;case"focusout":he="blur",X=io;break;case"beforeblur":case"afterblur":X=io;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":X=ad;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":X=wg;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":X=Lg;break;case Sd:case Cd:case kd:X=kg;break;case _d:X=Hg;break;case"scroll":case"scrollend":X=Ng;break;case"wheel":X=Yg;break;case"copy":case"cut":case"paste":X=Eg;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":X=ld;break;case"toggle":case"beforetoggle":X=Gg}var Ne=(t&4)!==0,Ye=!Ne&&(e==="scroll"||e==="scrollend"),z=Ne?Y!==null?Y+"Capture":null:Y;Ne=[];for(var M=q,L;M!==null;){var W=M;if(L=W.stateNode,W=W.tag,W!==5&&W!==26&&W!==27||L===null||z===null||(W=el(M,z),W!=null&&Ne.pu
vendor: 1,152 bytes, line 8
8sh(Ol(M,W,L))),Ye)break;M=M.return}0<Ne.length&&(Y=new X(Y,he,null,s,F),ee.push({event:Y,listeners:Ne}))}}if((t&7)===0){e:{if(Y=e==="mouseover"||e==="pointerover",X=e==="mouseout"||e==="pointerout",Y&&s!==Pr&&(he=s.relatedTarget||s.fromElement)&&(sn(he)||he[tn]))break e;if((X||Y)&&(Y=F.window===F?F:(Y=F.ownerDocument)?Y.defaultView||Y.parentWindow:window,X?(he=s.relatedTarget||s.toElement,X=q,he=he?sn(he):null,he!==null&&(Ye=h(he),Ne=he.tag,he!==Ye||Ne!==5&&Ne!==27&&Ne!==6)&&(he=null)):(X=null,he=q),X!==he)){if(Ne=ad,W="onMouseLeave",z="onMouseEnter",M="mouse",(e==="pointerout"||e==="pointerover")&&(Ne=ld,W="onPointerLeave",z="onPointerEnter",M="pointer"),Ye=X==null?Y:Pn(X),L=he==null?Y:Pn(he),Y=new Ne(W,M+"leave",X,s,F),Y.target=Ye,Y.relatedTarget=L,W=null,sn(F)===q&&(Ne=new Ne(z,M+"enter",he,s,F),Ne.target=L,Ne.relatedTarget=Ye,W=Ne),Ye=W,X&&he)t:{for(Ne=Vx,z=X,M=he,L=0,W=z;W;W=Ne(W))L++;W=0;for(var ve=M;ve;ve=Ne(ve))W++;for(;0<L-W;)z=Ne(z),L--;for(;0<W-L;)M=Ne(M),W--;for(;L--;){if(z===M||M!==null&&z===M.alternate){Ne=z;break t}z=Ne(z),M=Ne(M)}Ne=null}else Ne=null;X!==null&&Fm(ee,Y,X,Ne,!1),he!==null&&Ye!==null&&Fm(ee,Ye,he,Ne,!0)}}
vendor: 5,196 bytes, lines 8-9
8e:{if(Y=q?Pn(q):window,X=Y.nodeName&&Y.nodeName.toLowerCase(),X==="select"||X==="input"&&Y.type==="file")var ze=md;else if(dd(Y))if(hd)ze=ex;else{ze=Wg;var ge=Fg}else X=Y.nodeName,!X||X.toLowerCase()!=="input"||Y.type!=="checkbox"&&Y.type!=="radio"?q&&Wr(q.elementType)&&(ze=md):ze=Pg;if(ze&&(ze=ze(e,q))){fd(ee,ze,s,F);break e}ge&&ge(e,Y,q),e==="focusout"&&q&&Y.type==="number"&&q.memoizedProps.value!=null&&Fr(Y,"number",Y.value)}switch(ge=q?Pn(q):window,e){case"focusin":(dd(ge)||ge.contentEditable==="true")&&(fn=ge,mo=q,ol=null);break;case"focusout":ol=mo=fn=null;break;case"mousedown":ho=!0;break;case"contextmenu":case"mouseup":case"dragend":ho=!1,jd(ee,s,F);break;case"selectionchange":if(sx)break;case"keydown":case"keyup":jd(ee,s,F)}var ke;if(oo)e:{switch(e){case"compositionstart":var Me="onCompositionStart";break e;case"compositionend":Me="onCompositionEnd";break e;case"compositionupdate":Me="onCompositionUpdate";break e}Me=void 0}else dn?cd(e,s)&&(Me="onCompositionEnd"):e==="keydown"&&s.keyCode===229&&(Me="onCompositionStart");Me&&(id&&s.locale!=="ko"&&(dn||Me!=="onCompositionStart"?Me==="onCompositionEnd"&&dn&&(ke=td()):(ea=F,ao="value"in ea?ea.value:ea.textContent,dn=!0)),ge=Wi(q,Me),0<ge.length&&(Me=new nd(Me,e,null,s,F),ee.push({event:Me,listeners:ge}),ke?Me.data=ke:(ke=ud(s),ke!==null&&(Me.data=ke)))),(ke=Xg?Qg(e,s):Kg(e,s))&&(Me=Wi(q,"onBeforeInput"),0<Me.length&&(ge=new nd("onBeforeInput","beforeinput",null,s,F),ee.push({event:ge,listeners:Me}),ge.data=ke)),qx(ee,e,q,s,F)}Jm(ee,t)})}function Ol(e,t,s){return{instance:e,listener:t,currentTarget:s}}function Wi(e,t){for(var s=t+"Capture",n=[];e!==null;){var o=e,c=o.stateNode;if(o=o.tag,o!==5&&o!==26&&o!==27||c===null||(o=el(e,s),o!=null&&n.unshift(Ol(e,o,c)),o=el(e,t),o!=null&&n.push(Ol(e,o,c))),e.tag===3)return n;e=e.return}return[]}function Vx(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Fm(e,t,s,n,o){for(var c=t._reactName,d=[];s!==null&&s!==n;){var y=s,_=y.alternate,q=y.stateNode;if(y=y.tag,_!==null&&_===n)break;y!==5&&y!==26&&y!==27||q===null||(_=q,o?(q=el(s,c),q!=null&&d.unshift(Ol(s,q,_))):o||(q=el(s,c),q!=null&&d.push(Ol(s,q,_)))),s=s.return}d.length!==0&&e.push({event:t,listeners:d})}var Gx=/\r\n?/g,Zx=/\u0000|\uFFFD/g;function Wm(e){return(typeof e=="string"?e:""+e).replace(Gx,`
9`).replace(Zx,"")}function Pm(e,t){return t=Wm(t),Wm(e)===t}function $e(e,t,s,n,o,c){switch(s){case"children":typeof n=="string"?t==="body"||t==="textarea"&&n===""||on(e,n):(typeof n=="number"||typeof n=="bigint")&&t!=="body"&&on(e,""+n);break;case"className":si(e,"class",n);break;case"tabIndex":si(e,"tabindex",n);break;case"dir":case"role":case"viewBox":case"width":case"height":si(e,s,n);break;case"style":Wu(e,n,c);break;case"data":if(t!=="object"){si(e,"data",n);break}case"src":case"href":if(n===""&&(t!=="a"||s!=="href")){e.removeAttribute(s);break}if(n==null||typeof n=="function"||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(s);break}n=ni(""+n),e.setAttribute(s,n);break;case"action":case"formAction":if(typeof n=="function"){e.setAttribute(s,"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}else typeof c=="function"&&(s==="formAction"?(t!=="input"&&$e(e,t,"name",o.name,o,null),$e(e,t,"formEncType",o.formEncType,o,null),$e(e,t,"formMethod",o.formMethod,o,null),$e(e,t,"formTarget",o.formTarget,o,null)):($e(e,t,"encType",o.encType,o,null),$e(e,t,"method",o.method,o,null),$e(e,t,"target",o.target,o,null)));if(n==null||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(s);break}n=ni(""+n),e.setAttribute(s,n);break;case"onClick":n!=null&&(e.onclick=Rs);break;case"onScroll":n!=null&&Ee("scroll",e);break;case"onScrollEnd":n!=null&&Ee("scrollend",e);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(u(61));if(s=n.__html,s!=null){if(o.children!=null)throw Error(u(60));e.innerHTML=s}}break;case"multiple":e.multiple=n&&typeof n!="function"&&typeof n!="symbol";break;case"muted":e.muted=n&&typeof n!="function"&&typeof n!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(n==null||typeof n=="function"||typeof n=="boolean"||typeof n=="symbol"){e.removeAttribute("xlink:href");break}s=ni(""+n),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":n!=null&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(s,""+n):e.removeAttribute(s);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
9ine":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":n&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(s,""):e.removeAttribute(s);break;case"capture":case"download":n===!0?e.setAttribute(s,""):n!==!1&&n!=null&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(s,n):e.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":n!=null&&typeof n!="function"&&typeof n!="symbol"&&!isNaN(n)&&1<=n?e.setAttribute(s,n):e.removeAttribute(s);break;case"rowSpan":case"start":n==null||typeof n=="function"||typeof n=="symbol"||isNaN(n)?e.removeAttribute(s):e.setAttribute(s,n);break;case"popover":Ee("beforetoggle",e),Ee("toggle",e),ti(e,"popover",n);break;case"xlinkActuate":Ms(e,"http://www.w3.org/1999/xlink","xlink:actuate",n);break;case"xlinkArcrole":Ms(e,"http://www.w3.org/1999/xlink","xlink:arcrole",n);break;case"xlinkRole":Ms(e,"http://www.w3.org/1999/xlink","xlink:role",n);break;case"xlinkShow":Ms(e,"http://www.w3.org/1999/xlink","xlink:show",n);break;case"xlinkTitle":Ms(e,"http://www.w3.org/1999/xlink","xlink:title",n);break;case"xlinkType":Ms(e,"http://www.w3.org/1999/xlink","xlink:type",n);break;case"xmlBase":Ms(e,"http://www.w3.org/XML/1998/namespace","xml:base",n);break;case"xmlLang":Ms(e,"http://www.w3.org/XML/1998/namespace","xml:lang",n);break;case"xmlSpace":Ms(e,"http://www.w3.org/XML/1998/namespace","xml:space",n);break;case"is":ti(e,"is",n);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=bg.get(s)||s,ti(e,s,n))}}function qc(e,t,s,n,o,c){switch(s){case"style":Wu(e,n,c);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(u(61));if(s=n.__html,s!=null){if(o.children!=null)throw Error(u(60));e.innerHTML=s}}break;case"children":typeof n=="string"?on(e,n):(typeof n=="number"||typeof n=="bigint")&&on(e,""+n);break;case"onScroll":n!=null&&Ee("scroll",e);break;case"onScrollEnd":n!=null&&Ee("scrollend",e);break;case"onClick":n!=null&&(e.onclick=Rs);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Vu.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(o=s.endsWith("Capture"),t=s.slice(2,o?s.length-7:void 0),c=e[zt]||null,c=c!=null?c[s]:null,typeof c=="function"&&e.removeEventListener(t,c,o),typeof n=="function")){typeof c!="function"&&c!==null&&(s in e?e[s]=null:e.hasAttribute(s)&&e.removeAttribute(s)),e.addEventListener(t,n,o);break e}s in e?e[s]=n:n===!0?e.setAttribute(s,""):ti(e,s,n)}}}function Nt(e,t,s){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ee("error",e),Ee("load",e);var n=!1,o=!1,c;for(c in s)if(s.hasOwnProperty(c)){var d=s[c];if(d!=null)switch(c){case"src":n=!0;break;case"srcSet":o=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(u(137,t));default:$e(e,t,c,d,s,null)}}o&&$e(e,t,"srcSet",s.srcSet,s,null),n&&$e(e,t,"src",s.src,s,null);return;case"input":Ee("invalid",e);var y=c=d=o=null,_=null,q=null;for(n in s)if(s.hasOwnProperty(n)){var F=s[n];if(F!=null)switch(n){case"name":o=F;break;case"type":d=F;break;case"checked":_=F;break;case"defaultChecked":q=F;break;case"value":c=F;break;case"defaultValue":y=F;break;case"children":case"dangerouslySetInnerHTML":if(F!=null)throw Error(u(137,t));break;default:$e(e,t,n,F,s,null)}}Ku(e,c,y,_,q,d,o,!1);return;case"select":Ee("invalid",e),n=d=c=null;for(o in s)if(s.hasOwnProperty(o)&&(y=s[o],y!=null))switch(o){case"value":c=y;break;case"defaultValue":d=y;break;case"multiple":n=y;default:$e(e,t,o,y,s,null)}t=c,s=d,e.multiple=!!n,t!=null?rn(e,!!n,t,!1):s!=null&&rn(e,!!n,s,!0);return;case"textarea":Ee("invalid",e),c=o=n=null;for(d in s)if(s.hasOwnProperty(d)&&(y=s[d],y!=null))switch(d){case"value":n=y;break;case"defaultValue":o=y;break;case"children":c=y;break;case"dangerouslySetInnerHTML":if(y!=null)throw Error(u(91));break;default:$e(e,t,d,y,s,null)}Iu(e,n,o,c);return;case"option":for(_ in s)s.hasOwnProperty(_)&&(n=s[_],n!=null)&&(_==="selected"?e.selected=n&&typeof n!="function"&&typeof n!="symbol":$e(e,t,_,n,s,null));return;case"dialog":Ee("beforetoggle",e),Ee("toggle",e),Ee("cancel",e),Ee("close",e);break;case"iframe":case"object":Ee("load",e);break;case"video":case"audio":for(n=0;n<Rl.length;
vendor: 4,136 bytes, line 9
9n++)Ee(Rl[n],e);break;case"image":Ee("error",e),Ee("load",e);break;case"details":Ee("toggle",e);break;case"embed":case"source":case"link":Ee("error",e),Ee("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(q in s)if(s.hasOwnProperty(q)&&(n=s[q],n!=null))switch(q){case"children":case"dangerouslySetInnerHTML":throw Error(u(137,t));default:$e(e,t,q,n,s,null)}return;default:if(Wr(t)){for(F in s)s.hasOwnProperty(F)&&(n=s[F],n!==void 0&&qc(e,t,F,n,s,void 0));return}}for(y in s)s.hasOwnProperty(y)&&(n=s[y],n!=null&&$e(e,t,y,n,s,null))}function Xx(e,t,s,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var o=null,c=null,d=null,y=null,_=null,q=null,F=null;for(X in s){var ee=s[X];if(s.hasOwnProperty(X)&&ee!=null)switch(X){case"checked":break;case"value":break;case"defaultValue":_=ee;default:n.hasOwnProperty(X)||$e(e,t,X,null,n,ee)}}for(var Y in n){var X=n[Y];if(ee=s[Y],n.hasOwnProperty(Y)&&(X!=null||ee!=null))switch(Y){case"type":c=X;break;case"name":o=X;break;case"checked":q=X;break;case"defaultChecked":F=X;break;case"value":d=X;break;case"defaultValue":y=X;break;case"children":case"dangerouslySetInnerHTML":if(X!=null)throw Error(u(137,t));break;default:X!==ee&&$e(e,t,Y,X,n,ee)}}Ir(e,d,y,_,q,F,c,o);return;case"select":X=d=y=Y=null;for(c in s)if(_=s[c],s.hasOwnProperty(c)&&_!=null)switch(c){case"value":break;case"multiple":X=_;default:n.hasOwnProperty(c)||$e(e,t,c,null,n,_)}for(o in n)if(c=n[o],_=s[o],n.hasOwnProperty(o)&&(c!=null||_!=null))switch(o){case"value":Y=c;break;case"defaultValue":y=c;break;case"multiple":d=c;default:c!==_&&$e(e,t,o,c,n,_)}t=y,s=d,n=X,Y!=null?rn(e,!!s,Y,!1):!!n!=!!s&&(t!=null?rn(e,!!s,t,!0):rn(e,!!s,s?[]:"",!1));return;case"textarea":X=Y=null;for(y in s)if(o=s[y],s.hasOwnProperty(y)&&o!=null&&!n.hasOwnProperty(y))switch(y){case"value":break;case"children":break;default:$e(e,t,y,null,n,o)}for(d in n)if(o=n[d],c=s[d],n.hasOwnProperty(d)&&(o!=null||c!=null))switch(d){case"value":Y=o;break;case"defaultValue":X=o;break;case"children":break;case"dangerouslySetInnerHTML":if(o!=null)throw Error(u(91));break;default:o!==c&&$e(e,t,d,o,n,c)}Ju(e,Y,X);return;case"option":for(var he in s)Y=s[he],s.hasOwnProperty(he)&&Y!=null&&!n.hasOwnProperty(he)&&(he==="selected"?e.selected=!1:$e(e,t,he,null,n,Y));for(_ in n)Y=n[_],X=s[_],n.hasOwnProperty(_)&&Y!==X&&(Y!=null||X!=null)&&(_==="selected"?e.selected=Y&&typeof Y!="function"&&typeof Y!="symbol":$e(e,t,_,Y,n,X));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 Ne in s)Y=s[Ne],s.hasOwnProperty(Ne)&&Y!=null&&!n.hasOwnProperty(Ne)&&$e(e,t,Ne,null,n,Y);for(q in n)if(Y=n[q],X=s[q],n.hasOwnProperty(q)&&Y!==X&&(Y!=null||X!=null))switch(q){case"children":case"dangerouslySetInnerHTML":if(Y!=null)throw Error(u(137,t));break;default:$e(e,t,q,Y,n,X)}return;default:if(Wr(t)){for(var Ye in s)Y=s[Ye],s.hasOwnProperty(Ye)&&Y!==void 0&&!n.hasOwnProperty(Ye)&&qc(e,t,Ye,void 0,n,Y);for(F in n)Y=n[F],X=s[F],!n.hasOwnProperty(F)||Y===X||Y===void 0&&X===void 0||qc(e,t,F,Y,n,X);return}}for(var z in s)Y=s[z],s.hasOwnProperty(z)&&Y!=null&&!n.hasOwnProperty(z)&&$e(e,t,z,null,n,Y);for(ee in n)Y=n[ee],X=s[ee],!n.hasOwnProperty(ee)||Y===X||Y==null&&X==null||$e(e,t,ee,Y,n,X)}function eh(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Qx(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,s=performance.getEntriesByType("resource"),n=0;n<s.length;n++){var o=s[n],c=o.transferSize,d=o.initiatorType,y=o.duration;if(c&&y&&eh(d)){for(d=0,y=o.responseEnd,n+=1;n<s.length;n++){var _=s[n],q=_.startTime;if(q>y)break;var F=_.transferSize,ee=_.initiatorType;F&&eh(ee)&&(_=_.responseEnd,d+=F*(_<y?1:(y-q)/(_-q)))}if(--n,t+=8*(c+d)/(o.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Hc=null,$c=null;
vendor: 8,324 bytes, line 9
9function Pi(e){return e.nodeType===9?e:e.ownerDocument}function th(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 sh(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Yc(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Vc=null;function Kx(){var e=window.event;return e&&e.type==="popstate"?e===Vc?!1:(Vc=e,!0):(Vc=null,!1)}var ah=typeof setTimeout=="function"?setTimeout:void 0,Jx=typeof clearTimeout=="function"?clearTimeout:void 0,nh=typeof Promise=="function"?Promise:void 0,Ix=typeof queueMicrotask=="function"?queueMicrotask:typeof nh<"u"?function(e){return nh.resolve(null).then(e).catch(Fx)}:ah;function Fx(e){setTimeout(function(){throw e})}function xa(e){return e==="head"}function lh(e,t){var s=t,n=0;do{var o=s.nextSibling;if(e.removeChild(s),o&&o.nodeType===8)if(s=o.data,s==="/$"||s==="/&"){if(n===0){e.removeChild(o),qn(t);return}n--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")n++;else if(s==="html")zl(e.ownerDocument.documentElement);else if(s==="head"){s=e.ownerDocument.head,zl(s);for(var c=s.firstChild;c;){var d=c.nextSibling,y=c.nodeName;c[Wn]||y==="SCRIPT"||y==="STYLE"||y==="LINK"&&c.rel.toLowerCase()==="stylesheet"||s.removeChild(c),c=d}}else s==="body"&&zl(e.ownerDocument.body);s=o}while(s);qn(t)}function ih(e,t){var s=e;e=0;do{var n=s.nextSibling;if(s.nodeType===1?t?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(t?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),n&&n.nodeType===8)if(s=n.data,s==="/$"){if(e===0)break;e--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||e++;s=n}while(s)}function Gc(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var s=t;switch(t=t.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":Gc(s),Kr(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}e.removeChild(s)}}function Wx(e,t,s,n){for(;e.nodeType===1;){var o=s;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!n&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(n){if(!e[Wn])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(c=e.getAttribute("rel"),c==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(c!==o.rel||e.getAttribute("href")!==(o.href==null||o.href===""?null:o.href)||e.getAttribute("crossorigin")!==(o.crossOrigin==null?null:o.crossOrigin)||e.getAttribute("title")!==(o.title==null?null:o.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(c=e.getAttribute("src"),(c!==(o.src==null?null:o.src)||e.getAttribute("type")!==(o.type==null?null:o.type)||e.getAttribute("crossorigin")!==(o.crossOrigin==null?null:o.crossOrigin))&&c&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var c=o.name==null?null:""+o.name;if(o.type==="hidden"&&e.getAttribute("name")===c)return e}else return e;if(e=cs(e.nextSibling),e===null)break}return null}function Px(e,t,s){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!s||(e=cs(e.nextSibling),e===null))return null;return e}function rh(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=cs(e.nextSibling),e===null))return null;return e}function Zc(e){return e.data==="$?"||e.data==="$~"}function Xc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function ey(e,t){var s=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||s.readyState!=="loading")t();else{var n=function(){t(),s.removeEventListener("DOMContentLoaded",n)};s.addEventListener("DOMContentLoaded",n),e._reactRetry=n}}function cs(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var Qc=null;function oh(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var s=e.data;if(s==="/$"||s==="/&"){if(t===0)return cs(e.nextSibling);t--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||t++}e=e.nextSibling}return null}function ch(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var s=e.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(t===0)return e;t--}else s!=="/$"&&s!=="/&"||t++}e=e.previousSibling}return null}function uh(e,t,s){switch(t=Pi(s),e){case"html":if(e=t.documentElement,!e)throw Error(u(452));return e;case"head":if(e=t.head,!e)throw Error(u(453));return e;case"body":if(e=t.body,!e)throw Error(u(454));return e;default:throw Error(u(451))}}function zl(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Kr(e)}var us=new Map,dh=new Set;function er(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Ks=H.d;H.d={f:ty,r:sy,D:ay,C:ny,L:ly,m:iy,X:oy,S:ry,M:cy};function ty(){var e=Ks.f(),t=Zi();return e||t}function sy(e){var t=an(e);t!==null&&t.tag===5&&t.type==="form"?Ef(t):Ks.r(e)}var Dn=typeof document>"u"?null:document;function fh(e,t,s){var n=Dn;if(n&&typeof t=="string"&&t){var o=ss(t);o='link[rel="'+e+'"][href="'+o+'"]',typeof s=="string"&&(o+='[crossorigin="'+s+'"]'),dh.has(o)||(dh.add(o),e={rel:e,crossOrigin:s,href:t},n.querySelector(o)===null&&(t=n.createElement("link"),Nt(t,"link",e),mt(t),n.head.appendChild(t)))}}function ay(e){Ks.D(e),fh("dns-prefetch",e,null)}function ny(e,t){Ks.C(e,t),fh("preconnect",e,t)}function ly(e,t,s){Ks.L(e,t,s);var n=Dn;if(n&&e&&t){var o='link[rel="preload"][as="'+ss(t)+'"]';t==="image"&&s&&s.imageSrcSet?(o+='[imagesrcset="'+ss(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(o+='[imagesizes="'+ss(s.imageSizes)+'"]')):o+='[href="'+ss(e)+'"]';var c=o;switch(t){case"style":c=Un(e);break;case"script":c=Ln(e)}us.has(c)||(e=p({rel:"preload",href:t==="image"&&s&&s.imageSrcSet?void 0:e,as:t},s),us.set(c,e),n.querySelector(o)!==null||t==="style"&&n.querySelector(Bl(c))||t==="script"&&n.querySelector(Dl(c))||(t=n.createElement("link"),Nt(t,"link",e),mt(t),n.head.appendChild(t)))}}function iy(e,t){Ks.m(e,t);var s=Dn;if(s&&e){var n=t&&typeof t.as=="string"?t.as:"script",o='link[rel="modulepreload"][as="'+ss(n)+'"][href="'+ss(e)+'"]',c=o;switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":c=Ln(e)}if(!us.has(c)&&(e=p({rel:"modulepreload",href:e},t),us.set(c,e),s.querySelector(o)===null)){switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(Dl(c)))return}n=s.createElement("link"),Nt(n,"link",e),mt(n),s.head.appendChild(n)}}}function ry(e,t,s){Ks.S(e,t,s);var n=Dn;if(n&&e){var o=nn(n).hoistableStyles,c=Un(e);t=t||"default";var d=o.get(c);if(!d){var y={loading:0,preload:null};if(d=n.querySelector(Bl(c)))y.loading=5;else{e=p({rel:"stylesheet",href:e,"data-precedence":t},s),(s=us.get(c))&&Kc(e,s);var _=d=n.createElement("link");mt(_),Nt(_,"link",e),_._p=new Promise(function(q,F){_.onload=q,_.onerror=F}),_.addEventListener("load",function(){y.loading|=1}),_.addEventListener("error",function(){y.loading|=2}),y.loading|=4,tr(d,t,n)}d={type:"stylesheet",instance:d,count:1,state:y},o.set(c,d)}}}function oy(e,t){Ks.X(e,t);var s=Dn;if(s&&e){var n=nn(s).hoistableScripts,o=Ln(e),c=n.get(o);c||(c=s.querySelector(Dl(o)),c||(e=p({src:e,async:!0},t),(t=us.get(o))&&Jc(e,t),c=s.createElement("script"),mt(c),Nt(c,"link",e),s.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},n.set(o,c))}}function cy(e,t){Ks.M(e,t);var s=Dn;if(s&&e){var n=nn(s).hoistableScripts,o=Ln(e),c=n.get(o);c||(c=s.querySelector(Dl(o)),c||(e=p({src:e,async:!0,type:"module"},t),(t=us.get(o))&&Jc(e,t),c=s.createElement("script"),mt(c),Nt(c,"link",e),s.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},n.set(o,c))}}
vendor: 4,821 bytes, line 9
9function mh(e,t,s,n){var o=(o=ue.current)?er(o):null;if(!o)throw Error(u(446));switch(e){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(t=Un(s.href),s=nn(o).hoistableStyles,n=s.get(t),n||(n={type:"style",instance:null,count:0,state:null},s.set(t,n)),n):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){e=Un(s.href);var c=nn(o).hoistableStyles,d=c.get(e);if(d||(o=o.ownerDocument||o,d={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},c.set(e,d),(c=o.querySelector(Bl(e)))&&!c._p&&(d.instance=c,d.state.loading=5),us.has(e)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},us.set(e,s),c||uy(o,e,s,d.state))),t&&n===null)throw Error(u(528,""));return d}if(t&&n!==null)throw Error(u(529,""));return null;case"script":return t=s.async,s=s.src,typeof s=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Ln(s),s=nn(o).hoistableScripts,n=s.get(t),n||(n={type:"script",instance:null,count:0,state:null},s.set(t,n)),n):{type:"void",instance:null,count:0,state:null};default:throw Error(u(444,e))}}function Un(e){return'href="'+ss(e)+'"'}function Bl(e){return'link[rel="stylesheet"]['+e+"]"}function hh(e){return p({},e,{"data-precedence":e.precedence,precedence:null})}function uy(e,t,s,n){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?n.loading=1:(t=e.createElement("link"),n.preload=t,t.addEventListener("load",function(){return n.loading|=1}),t.addEventListener("error",function(){return n.loading|=2}),Nt(t,"link",s),mt(t),e.head.appendChild(t))}function Ln(e){return'[src="'+ss(e)+'"]'}function Dl(e){return"script[async]"+e}function ph(e,t,s){if(t.count++,t.instance===null)switch(t.type){case"style":var n=e.querySelector('style[data-href~="'+ss(s.href)+'"]');if(n)return t.instance=n,mt(n),n;var o=p({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return n=(e.ownerDocument||e).createElement("style"),mt(n),Nt(n,"style",o),tr(n,s.precedence,e),t.instance=n;case"stylesheet":o=Un(s.href);var c=e.querySelector(Bl(o));if(c)return t.state.loading|=4,t.instance=c,mt(c),c;n=hh(s),(o=us.get(o))&&Kc(n,o),c=(e.ownerDocument||e).createElement("link"),mt(c);var d=c;return d._p=new Promise(function(y,_){d.onload=y,d.onerror=_}),Nt(c,"link",n),t.state.loading|=4,tr(c,s.precedence,e),t.instance=c;case"script":return c=Ln(s.src),(o=e.querySelector(Dl(c)))?(t.instance=o,mt(o),o):(n=s,(o=us.get(c))&&(n=p({},s),Jc(n,o)),e=e.ownerDocument||e,o=e.createElement("script"),mt(o),Nt(o,"link",n),e.head.appendChild(o),t.instance=o);case"void":return null;default:throw Error(u(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(n=t.instance,t.state.loading|=4,tr(n,s.precedence,e));return t.instance}function tr(e,t,s){for(var n=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),o=n.length?n[n.length-1]:null,c=o,d=0;d<n.length;d++){var y=n[d];if(y.dataset.precedence===t)c=y;else if(c!==o)break}c?c.parentNode.insertBefore(e,c.nextSibling):(t=s.nodeType===9?s.head:s,t.insertBefore(e,t.firstChild))}function Kc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Jc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var sr=null;function gh(e,t,s){if(sr===null){var n=new Map,o=sr=new Map;o.set(s,n)}else o=sr,n=o.get(s),n||(n=new Map,o.set(s,n));if(n.has(e))return n;for(n.set(e,null),s=s.getElementsByTagName(e),o=0;o<s.length;o++){var c=s[o];if(!(c[Wn]||c[xt]||e==="link"&&c.getAttribute("rel")==="stylesheet")&&c.namespaceURI!=="http://www.w3.org/2000/svg"){var d=c.getAttribute(t)||"";d=e+d;var y=n.get(d);y?y.push(c):n.set(d,[c])}}return n}function xh(e,t,s){e=e.ownerDocument||e,e.head.insertBefore(s,t==="title"?e.querySelector("head > title"):null)}function dy(e,t,s){if(s===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!0;case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function yh(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function fy(e,t,s,n){if(s.type==="stylesheet"&&(typeof n.media!="str
9ing"||matchMedia(n.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var o=Un(n.href),c=t.querySelector(Bl(o));if(c){t=c._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=ar.bind(e),t.then(e,e)),s.state.loading|=4,s.instance=c,mt(c);return}c=t.ownerDocument||t,n=hh(n),(o=us.get(o))&&Kc(n,o),c=c.createElement("link"),mt(c);var d=c;d._p=new Promise(function(y,_){d.onload=y,d.onerror=_}),Nt(c,"link",n),s.instance=c}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(s,t),(t=s.state.preload)&&(s.state.loading&3)===0&&(e.count++,s=ar.bind(e),t.addEventListener("load",s),t.addEventListener("error",s))}}var Ic=0;function my(e,t){return e.stylesheets&&e.count===0&&lr(e,e.stylesheets),0<e.count||0<e.imgCount?function(s){var n=setTimeout(function(){if(e.stylesheets&&lr(e,e.stylesheets),e.unsuspend){var c=e.unsuspend;e.unsuspend=null,c()}},6e4+t);0<e.imgBytes&&Ic===0&&(Ic=62500*Qx());var o=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&lr(e,e.stylesheets),e.unsuspend)){var c=e.unsuspend;e.unsuspend=null,c()}},(e.imgBytes>Ic?50:800)+t);return e.unsuspend=s,function(){e.unsuspend=null,clearTimeout(n),clearTimeout(o)}}:null}function ar(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)lr(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var nr=null;function lr(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,nr=new Map,t.forEach(hy,e),nr=null,ar.call(e))}function hy(e,t){if(!(t.state.loading&4)){var s=nr.get(e);if(s)var n=s.get(null);else{s=new Map,nr.set(e,s);for(var o=e.querySelectorAll("link[data-precedence],style[data-precedence]"),c=0;c<o.length;c++){var d=o[c];(d.nodeName==="LINK"||d.getAttribute("media")!=="not all")&&(s.set(d.dataset.precedence,d),n=d)}n&&s.set(null,n)}o=t.instance,d=o.getAttribute("data-precedence"),c=s.get(d)||n,c===n&&s.set(null,o),s.set(d,o),this.count++,n=ar.bind(this),o.addEventListener("load",n),o.addEventListener("error",n),c?c.parentNode.insertBefore(o,c.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(o,e.firstChild)),t.state.loading|=4}}var Ul={$$typeof:D,Provider:null,Consumer:null,_currentValue:re,_currentValue2:re,_threadCount:0};function py(e,t,s,n,o,c,d,y,_){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=Ws(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ws(0),this.hiddenUpdates=Ws(null),this.identifierPrefix=n,this.onUncaughtError=o,this.onCaughtError=c,this.onRecoverableError=d,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=_,this.incompleteTransitions=new Map}function bh(e,t,s,n,o,c,d,y,_,q,F,ee){return e=new py(e,t,s,d,_,q,F,ee,y),t=1,c===!0&&(t|=24),c=Xt(3,null,null,t),e.current=c,c.stateNode=e,t=To(),t.refCount++,e.pooledCache=t,t.refCount++,c.memoizedState={element:n,isDehydrated:s,cache:t},Oo(c),e}function vh(e){return e?(e=pn,e):pn}function Nh(e,t,s,n,o,c){o=vh(o),n.context===null?n.context=o:n.pendingContext=o,n=ia(t),n.payload={element:s},c=c===void 0?null:c,c!==null&&(n.callback=c),s=ra(e,n,t),s!==null&&(Ht(s,e,t),pl(s,e,t))}function jh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var s=e.retryLane;e.retryLane=s!==0&&s<t?s:t}}function Fc(e,t){jh(e,t),(e=e.alternate)&&jh(e,t)}function wh(e){if(e.tag===13||e.tag===31){var t=Oa(e,67108864);t!==null&&Ht(t,e,67108864),Fc(e,67108864)}}function Sh(e){if(e.tag===13||e.tag===31){var t=Ft();t=en(t);var s=Oa(e,t);s!==null&&Ht(s,e,t),Fc(e,t)}}var ir=!0;function gy(e,t,s,n){var o=C.T;C.T=null;var c=H.p;try{H.p=2,Wc(e,t,s,n)}finally{H.p=c,C.T=o}}function xy(e,t,s,n){var o=C.T;C.T=null;var c=H.p;try{H.p=8,Wc(e,t,s,n)}finally{H.p=c,C.T=o}}function Wc(e,t,s,n){if(ir){var o=Pc(n);if(o===null)Lc(e,t,n,rr,s),kh(e,n);else if(by(o,e,t,s,n))n.stopPropagation();else if(kh(e,n),t&4&&-1<yy.indexOf(e)){for(;o!==null;){var c=an(o);if(c!==null)switch(c.tag){case 3:if(c=c.stateNode,c.current.memoizedState.isDehydrated){var d=Ns(c.pendingLanes);if(d!==0){var y=c;for(y.pendingLanes|=2,y.entangledLanes|=2;d;){var _=1<<31-jt(d);y.entanglements[1]|=_,d&=~_}Cs(c),(De&6)===0&&(Vi=_t()+500,Ml(0))}}break;
vendor: 6,895 bytes, line 9
9case 31:case 13:y=Oa(c,2),y!==null&&Ht(y,c,2),Zi(),Fc(c,2)}if(c=Pc(n),c===null&&Lc(e,t,n,rr,s),c===o)break;o=c}o!==null&&n.stopPropagation()}else Lc(e,t,n,null,s)}}function Pc(e){return e=eo(e),eu(e)}var rr=null;function eu(e){if(rr=null,e=sn(e),e!==null){var t=h(e);if(t===null)e=null;else{var s=t.tag;if(s===13){if(e=g(t),e!==null)return e;e=null}else if(s===31){if(e=w(t),e!==null)return e;e=null}else if(s===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return rr=e,null}function Ch(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(Gr()){case Sa:return 2;case Pl:return 8;case Ca:case In:return 32;case As:return 268435456;default:return 32}default:return 32}}var tu=!1,ya=null,ba=null,va=null,Ll=new Map,ql=new Map,Na=[],yy="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 kh(e,t){switch(e){case"focusin":case"focusout":ya=null;break;case"dragenter":case"dragleave":ba=null;break;case"mouseover":case"mouseout":va=null;break;case"pointerover":case"pointerout":Ll.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ql.delete(t.pointerId)}}function Hl(e,t,s,n,o,c){return e===null||e.nativeEvent!==c?(e={blockedOn:t,domEventName:s,eventSystemFlags:n,nativeEvent:c,targetContainers:[o]},t!==null&&(t=an(t),t!==null&&wh(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function by(e,t,s,n,o){switch(t){case"focusin":return ya=Hl(ya,e,t,s,n,o),!0;case"dragenter":return ba=Hl(ba,e,t,s,n,o),!0;case"mouseover":return va=Hl(va,e,t,s,n,o),!0;case"pointerover":var c=o.pointerId;return Ll.set(c,Hl(Ll.get(c)||null,e,t,s,n,o)),!0;case"gotpointercapture":return c=o.pointerId,ql.set(c,Hl(ql.get(c)||null,e,t,s,n,o)),!0}return!1}function _h(e){var t=sn(e.target);if(t!==null){var s=h(t);if(s!==null){if(t=s.tag,t===13){if(t=g(s),t!==null){e.blockedOn=t,Hu(e.priority,function(){Sh(s)});return}}else if(t===31){if(t=w(s),t!==null){e.blockedOn=t,Hu(e.priority,function(){Sh(s)});return}}else if(t===3&&s.stateNode.current.memoizedState.isDehydrated){e.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}e.blockedOn=null}function or(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var s=Pc(e.nativeEvent);if(s===null){s=e.nativeEvent;var n=new s.constructor(s.type,s);Pr=n,s.target.dispatchEvent(n),Pr=null}else return t=an(s),t!==null&&wh(t),e.blockedOn=s,!1;t.shift()}return!0}function Eh(e,t,s){or(e)&&s.delete(t)}function vy(){tu=!1,ya!==null&&or(ya)&&(ya=null),ba!==null&&or(ba)&&(ba=null),va!==null&&or(va)&&(va=null),Ll.forEach(Eh),ql.forEach(Eh)}function cr(e,t){e.blockedOn===t&&(e.blockedOn=null,tu||(tu=!0,l.unstable_scheduleCallback(l.unstable_NormalPriority,vy)))}var ur=null;function Th(e){ur!==e&&(ur=e,l.unstable_scheduleCallback(l.unstable_NormalPriority,function(){ur===e&&(ur=null);for(var t=0;t<e.length;t+=3){var s=e[t],n=e[t+1],o=e[t+2];if(typeof n!="function"){if(eu(n||s)===null)continue;break}var c=an(s);c!==null&&(e.splice(t,3),t-=3,Po(c,{pending:!0,data:o,method:s.method,action:n},n,o))}}))}function qn(e){function t(_){return cr(_,e)}ya!==null&&cr(ya,e),ba!==null&&cr(ba,e),va!==null&&cr(va,e),Ll.forEach(t),ql.forEach(t);for(var s=0;s<Na.length;s++){var n=Na[s];n.blockedOn===e&&(n.blockedOn=null)}for(;0<Na.length&&(s=Na[0],s.blockedOn===null);)_h(s),s.blockedOn===null&&Na.shift();if(s=(e.ownerDocument||e).$$reactFormReplay,s!=null)for(n=0;n<s.length;n+=3){var o=s[n],c=s[n+1],d=o[zt]||null;if(typeof c=="function")d||Th(s);else if(d){var y=null;if(c&&c.hasAttribute("formAction")){if(o=c,d=c[zt]||null)y=d.formAction;else if(eu(o)!==null)continue}else y=d.action;typeof y=="function"?s[n+1]=y:(s.splice(n,3),n-=3),Th(s)}}}function Ah(){function e(c){c.canIntercept&&c.info==="react-transition"&&c.intercept({handler:function(){return new Promise(function(d){return o=d})},focusReset:"manual",scroll:"manual"})}function t(){o!==null&&(o(),o=null),n||setTimeout(s,20)}function s(){if(!n&&!navigation.transition){var c=navigation.currentEntry;c&&c.url!=null&&navigation.navigate(c.url,{state:c.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var n=!1,o=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(s,100),function(){n=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),o!==null&&(o(),o=null)}}}function su(e){this._internalRoot=e}dr.prototype.render=su.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(u(409));var s=t.current,n=Ft();Nh(s,n,e,t,null,null)},dr.prototype.unmount=su.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Nh(e.current,2,null,e,null,null),Zi(),t[tn]=null}};function dr(e){this._internalRoot=e}dr.prototype.unstable_scheduleHydration=function(e){if(e){var t=Xr();e={blockedOn:null,target:e,priority:t};for(var s=0;s<Na.length&&t!==0&&t<Na[s].priority;s++);Na.splice(s,0,e),s===0&&_h(e)}};var Mh=i.version;if(Mh!=="19.2.7")throw Error(u(527,Mh,"19.2.7"));H.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(u(188)):(e=Object.keys(e).join(","),Error(u(268,e)));return e=x(t),e=e!==null?N(e):null,e=e===null?null:e.stateNode,e};var Ny={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:C,reconcilerVersion:"19.2.7"};
vendor: 4,433 bytes, line 9
9if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var fr=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!fr.isDisabled&&fr.supportsFiber)try{ka=fr.inject(Ny),Et=fr}catch{}}return Yl.createRoot=function(e,t){if(!f(e))throw Error(u(299));var s=!1,n="",o=Lf,c=qf,d=Hf;return t!=null&&(t.unstable_strictMode===!0&&(s=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(c=t.onCaughtError),t.onRecoverableError!==void 0&&(d=t.onRecoverableError)),t=bh(e,1,!1,null,null,s,n,null,o,c,d,Ah),e[tn]=t.current,Uc(e),new su(t)},Yl.hydrateRoot=function(e,t,s){if(!f(e))throw Error(u(299));var n=!1,o="",c=Lf,d=qf,y=Hf,_=null;return s!=null&&(s.unstable_strictMode===!0&&(n=!0),s.identifierPrefix!==void 0&&(o=s.identifierPrefix),s.onUncaughtError!==void 0&&(c=s.onUncaughtError),s.onCaughtError!==void 0&&(d=s.onCaughtError),s.onRecoverableError!==void 0&&(y=s.onRecoverableError),s.formState!==void 0&&(_=s.formState)),t=bh(e,1,!0,t,s??null,n,o,_,c,d,y,Ah),t.context=vh(null),s=t.current,n=Ft(),n=en(n),o=ia(n),o.callback=null,ra(s,o,n),s=n,t.current.lanes=s,Ke(t,s),Cs(t),e[tn]=t.current,Uc(e),new dr(t)},Yl.version="19.2.7",Yl}var $h;function Ay(){if($h)return lu.exports;$h=1;function l(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(i){console.error(i)}}return l(),lu.exports=Ty(),lu.exports}var My=Ay(),Ry=Sp();const Oy=wp(Ry);function zy(l){if(typeof document>"u")return;let i=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",i.appendChild(r),r.styleSheet?r.styleSheet.cssText=l:r.appendChild(document.createTextNode(l))}const By=l=>{switch(l){case"success":return Ly;case"info":return Hy;case"warning":return qy;case"error":return $y;default:return null}},Dy=Array(12).fill(0),Uy=({visible:l,className:i})=>oe.createElement("div",{className:["sonner-loading-wrapper",i].filter(Boolean).join(" "),"data-visible":l},oe.createElement("div",{className:"sonner-spinner"},Dy.map((r,u)=>oe.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${u}`})))),Ly=oe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},oe.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),qy=oe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},oe.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),Hy=oe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},oe.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),$y=oe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},oe.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),Yy=oe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},oe.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),oe.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),Vy=()=>{const[l,i]=oe.useState(document.hidden);return oe.useEffect(()=>{const r=()=>{i(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),l};let gu=1;class Gy{constructor(){this.subscribe=i=>(this.subscribers.push(i),()=>{const r=this.subscribers.indexOf(i);this.subscribers.splice(r,1)}),this.publish=i=>
vendor: 3,616 bytes, line 9
9{this.subscribers.forEach(r=>r(i))},this.addToast=i=>{this.publish(i),this.toasts=[...this.toasts,i]},this.create=i=>{var r;const{message:u,...f}=i,h=typeof i?.id=="number"||((r=i.id)==null?void 0:r.length)>0?i.id:gu++,g=this.toasts.find(b=>b.id===h),w=i.dismissible===void 0?!0:i.dismissible;return this.dismissedToasts.has(h)&&this.dismissedToasts.delete(h),g?this.toasts=this.toasts.map(b=>b.id===h?(this.publish({...b,...i,id:h,title:u}),{...b,...i,id:h,dismissible:w,title:u}):b):this.addToast({title:u,...f,dismissible:w,id:h}),h},this.dismiss=i=>(i?(this.dismissedToasts.add(i),requestAnimationFrame(()=>this.subscribers.forEach(r=>r({id:i,dismiss:!0})))):this.toasts.forEach(r=>{this.subscribers.forEach(u=>u({id:r.id,dismiss:!0}))}),i),this.message=(i,r)=>this.create({...r,message:i}),this.error=(i,r)=>this.create({...r,message:i,type:"error"}),this.success=(i,r)=>this.create({...r,type:"success",message:i}),this.info=(i,r)=>this.create({...r,type:"info",message:i}),this.warning=(i,r)=>this.create({...r,type:"warning",message:i}),this.loading=(i,r)=>this.create({...r,type:"loading",message:i}),this.promise=(i,r)=>{if(!r)return;let u;r.loading!==void 0&&(u=this.create({...r,promise:i,type:"loading",message:r.loading,description:typeof r.description!="function"?r.description:void 0}));const f=Promise.resolve(i instanceof Function?i():i);let h=u!==void 0,g;const w=f.then(async x=>{if(g=["resolve",x],oe.isValidElement(x))h=!1,this.create({id:u,type:"default",message:x});else if(Xy(x)&&!x.ok){h=!1;const p=typeof r.error=="function"?await r.error(`HTTP error! status: ${x.status}`):r.error,E=typeof r.description=="function"?await r.description(`HTTP error! status: ${x.status}`):r.description,$=typeof p=="object"&&!oe.isValidElement(p)?p:{message:p};this.create({id:u,type:"error",description:E,...$})}else if(x instanceof Error){h=!1;const p=typeof r.error=="function"?await r.error(x):r.error,E=typeof r.description=="function"?await r.description(x):r.description,$=typeof p=="object"&&!oe.isValidElement(p)?p:{message:p};this.create({id:u,type:"error",description:E,...$})}else if(r.success!==void 0){h=!1;const p=typeof r.success=="function"?await r.success(x):r.success,E=typeof r.description=="function"?await r.description(x):r.description,$=typeof p=="object"&&!oe.isValidElement(p)?p:{message:p};this.create({id:u,type:"success",description:E,...$})}}).catch(async x=>{if(g=["reject",x],r.error!==void 0){h=!1;const N=typeof r.error=="function"?await r.error(x):r.error,p=typeof r.description=="function"?await r.description(x):r.description,I=typeof N=="object"&&!oe.isValidElement(N)?N:{message:N};this.create({id:u,type:"error",description:p,...I})}}).finally(()=>{h&&(this.dismiss(u),u=void 0),r.finally==null||r.finally.call(r)}),b=()=>new Promise((x,N)=>w.then(()=>g[0]==="reject"?N(g[1]):x(g[1])).catch(N));return typeof u!="string"&&typeof u!="number"?{unwrap:b}:Object.assign(u,{unwrap:b})},this.custom=(i,r)=>{const u=r?.id||gu++;return this.create({jsx:i(u),id:u,...r}),u},this.getActiveToasts=()=>this.toasts.filter(i=>!this.dismissedToasts.has(i.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const $t=new Gy,Zy=(l,i)=>{const r=i?.id||gu++;return $t.addToast({title:l,...i,id:r}),r},Xy=l=>l&&typeof l=="object"&&"ok"in l&&typeof l.ok=="boolean"&&"status"in l&&typeof l.status=="number",Qy=Zy,Ky=()=>$t.toasts,Jy=()=>$t.getActiveToasts(),B=Object.assign(Qy,{success:$t.success,info:$t.info,warning:$t.warning,error:$t.error,custom:$t.custom,message:$t.message,promise:$t.promise,dismiss:$t.dismiss,loading:$t.loading},{getHistory:Ky,getToasts:Jy});zy
vendor: 14,873 bytes, line 9
9("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function 
vendor: 949 bytes, line 9
9mr(l){return l.label!==void 0}const Iy=3,Fy="24px",Wy="16px",Yh=4e3,Py=356,eb=14,tb=45,sb=200;function ks(...l){return l.filter(Boolean).join(" ")}function ab(l){const[i,r]=l.split("-"),u=[];return i&&u.push(i),r&&u.push(r),u}const nb=l=>{var i,r,u,f,h,g,w,b,x;const{invert:N,toast:p,unstyled:E,interacting:I,setHeights:$,visibleToasts:V,heights:P,index:G,toasts:O,expanded:D,removeToast:R,defaultRichColors:Z,closeButton:k,style:T,cancelButtonStyle:A,actionButtonStyle:se,className:J="",descriptionClassName:Q="",duration:te,position:ne,gap:ie,expandByDefault:ae,classNames:C,icons:H,closeButtonAriaLabel:re="Close toast"}=l,[de,xe]=oe.useState(null),[v,j]=oe.useState(null),[S,U]=oe.useState(!1),[le,ue]=oe.useState(!1),[pe,ye]=oe.useState(!1),[je,Ue]=oe.useState(!1),[gt,Ct]=oe.useState(!1),[Ts,me]=oe.useState(0),[ce,Te]=oe.useState(0),st=oe.useRef(p.duration||te||Yh),fs=oe.useRef(null),Gt=oe.useRef(null),Kn=G===0,Jn=G+1<=V,kt=p.type,Is=p.dism
vendor: 5,366 bytes, line 9
9issible!==!1,_t=p.className||"",Gr=p.descriptionClassName||"",Sa=oe.useMemo(()=>P.findIndex(we=>we.toastId===p.id)||0,[P,p.id]),Pl=oe.useMemo(()=>{var we;return(we=p.closeButton)!=null?we:k},[p.closeButton,k]),Ca=oe.useMemo(()=>p.duration||te||Yh,[p.duration,te]),In=oe.useRef(0),As=oe.useRef(0),ei=oe.useRef(0),Fs=oe.useRef(null),[ka,Et]=ne.split("-"),ms=oe.useMemo(()=>P.reduce((we,Xe,ft)=>ft>=Sa?we:we+Xe.height,0),[P,Sa]),jt=Vy(),Zr=p.invert||N,Fn=kt==="loading";As.current=oe.useMemo(()=>Sa*ie+ms,[Sa,ms]),oe.useEffect(()=>{st.current=Ca},[Ca]),oe.useEffect(()=>{U(!0)},[]),oe.useEffect(()=>{const we=Gt.current;if(we){const Xe=we.getBoundingClientRect().height;return Te(Xe),$(ft=>[{toastId:p.id,height:Xe,position:p.position},...ft]),()=>$(ft=>ft.filter(wt=>wt.toastId!==p.id))}},[$,p.id]),oe.useLayoutEffect(()=>{if(!S)return;const we=Gt.current,Xe=we.style.height;we.style.height="auto";const ft=we.getBoundingClientRect().height;we.style.height=Xe,Te(ft),$(wt=>wt.find(Ke=>Ke.toastId===p.id)?wt.map(Ke=>Ke.toastId===p.id?{...Ke,height:ft}:Ke):[{toastId:p.id,height:ft,position:p.position},...wt])},[S,p.title,p.description,$,p.id,p.jsx,p.action,p.cancel]);const vs=oe.useCallback(()=>{ue(!0),me(As.current),$(we=>we.filter(Xe=>Xe.toastId!==p.id)),setTimeout(()=>{R(p)},sb)},[p,R,$,As]);oe.useEffect(()=>{if(p.promise&&kt==="loading"||p.duration===1/0||p.type==="loading")return;let we;return D||I||jt?(()=>{if(ei.current<In.current){const wt=new Date().getTime()-In.current;st.current=st.current-wt}ei.current=new Date().getTime()})():st.current!==1/0&&(In.current=new Date().getTime(),we=setTimeout(()=>{p.onAutoClose==null||p.onAutoClose.call(p,p),vs()},st.current)),()=>clearTimeout(we)},[D,I,p,kt,jt,vs]),oe.useEffect(()=>{p.delete&&(vs(),p.onDismiss==null||p.onDismiss.call(p,p))},[vs,p.delete]);function Wa(){var we;if(H?.loading){var Xe;return oe.createElement("div",{className:ks(C?.loader,p==null||(Xe=p.classNames)==null?void 0:Xe.loader,"sonner-loader"),"data-visible":kt==="loading"},H.loading)}return oe.createElement(Uy,{className:ks(C?.loader,p==null||(we=p.classNames)==null?void 0:we.loader),visible:kt==="loading"})}const Pa=p.icon||H?.[kt]||By(kt);var _a,Ns;return oe.createElement("li",{tabIndex:0,ref:Gt,className:ks(J,_t,C?.toast,p==null||(i=p.classNames)==null?void 0:i.toast,C?.default,C?.[kt],p==null||(r=p.classNames)==null?void 0:r[kt]),"data-sonner-toast":"","data-rich-colors":(_a=p.richColors)!=null?_a:Z,"data-styled":!(p.jsx||p.unstyled||E),"data-mounted":S,"data-promise":!!p.promise,"data-swiped":gt,"data-removed":le,"data-visible":Jn,"data-y-position":ka,"data-x-position":Et,"data-index":G,"data-front":Kn,"data-swiping":pe,"data-dismissible":Is,"data-type":kt,"data-invert":Zr,"data-swipe-out":je,"data-swipe-direction":v,"data-expanded":!!(D||ae&&S),"data-testid":p.testId,style:{"--index":G,"--toasts-before":G,"--z-index":O.length-G,"--offset":`${le?Ts:As.current}px`,"--initial-height":ae?"auto":`${ce}px`,...T,...p.style},onDragEnd:()=>{ye(!1),xe(null),Fs.current=null},onPointerDown:we=>{we.button!==2&&(Fn||!Is||(fs.current=new Date,me(As.current),we.target.setPointerCapture(we.pointerId),we.target.tagName!=="BUTTON"&&(ye(!0),Fs.current={x:we.clientX,y:we.clientY})))},onPointerUp:()=>{var we,Xe,ft;if(je||!Is)return;Fs.current=null;const wt=Number(((we=Gt.current)==null?void 0:we.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Ws=Number(((Xe=Gt.current)==null?void 0:Xe.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Ke=new Date().getTime()-((ft=fs.current)==null?void 0:ft.getTime()),Mt=de==="x"?wt:Ws,Ea=Math.abs(Mt)/Ke;if(Math.abs(Mt)>=tb||Ea>.11){me(As.current),p.onDismiss==null||p.onDismiss.call(p,p),j(de==="x"?wt>0?"right":"left":Ws>0?"down":"up"),vs(),Ue(!0);return}else{var Rt,Ot;(Rt=Gt.current)==null||Rt.style.setProperty("--swipe-amount-x","0px"),(Ot=Gt.current)==null||Ot.style.setProperty("--swipe-amount-y","0px")}Ct(!1),ye(!1),xe(null)},onPointerMove:we=>{var Xe,ft,wt;if(!Fs.current||!Is||((Xe=window.getSelection())==null?void 0:Xe.toString().length)>0)return;const Ke=we.clientY-Fs.current.y,Mt=we.clientX-Fs.current.x;var Ea;const Rt=(Ea=l.swipeDirections)!=null?Ea:ab(ne);!de&&(Math.abs(Mt)>1||Math.abs(Ke)>1)&&xe(Math.abs(Mt)>Math.abs(Ke)?"x":"y");let Ot={x:0,y:0};const en=hs=>1/(1.5+Math.abs(hs)/20);if(de==="y"){if(Rt.includes("top")||Rt.includes("bottom"))if(Rt.includes("top")&&Ke<0||Rt.includes("bottom")&&Ke>0)Ot.y=Ke;else{const hs=Ke*en(Ke);Ot.y=Math.abs(hs)<Math.abs(Ke)?hs:Ke}}else if(de==="x"&&(Rt.includes("left")||Rt.includes("right")))if(Rt.includes("left")&&Mt<0||Rt.includes("right")&&Mt>0)Ot.x=Mt;else{const hs=Mt*en(Mt);Ot.x=Math.abs(hs)<Math.abs(Mt)?hs:Mt}(Math.abs(Ot.x)>0||Math.abs(Ot.y)>0)&&Ct(!0),(ft=Gt.current)==null||ft.style.setProperty("--swipe-amount-x",`${Ot.x}px`),(wt=Gt.current)==null||wt.style.setProperty("--swipe-amount-y",`${Ot.y}px`)}},Pl&&!p.jsx&&kt!=="loading"?oe.createElement("button",{"aria-label":re,"data-disabled":Fn,"data-close-button":!0,onClick:Fn||!Is?()=>{}:()=>{vs(),p.onDismiss==null||p.onDismiss.call(p,p)},className:ks(C?.closeButton,p==null||(u=p.classNames)==null?void 0:u.closeButton)},(Ns=H?.close)!=null?Ns:Yy):null,(kt||p.icon||p.promise)&&p.icon!==null&&(H?.[kt]!==null||p.icon)?oe.createElement("div",{"data-icon":"",className:ks(C?.icon,p==null||(f=p.classNames)==null?void 0:f.icon)}
vendor: 5,587 bytes, line 9
9,p.promise||p.type==="loading"&&!p.icon?p.icon||Wa():null,p.type!=="loading"?Pa:null):null,oe.createElement("div",{"data-content":"",className:ks(C?.content,p==null||(h=p.classNames)==null?void 0:h.content)},oe.createElement("div",{"data-title":"",className:ks(C?.title,p==null||(g=p.classNames)==null?void 0:g.title)},p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title),p.description?oe.createElement("div",{"data-description":"",className:ks(Q,Gr,C?.description,p==null||(w=p.classNames)==null?void 0:w.description)},typeof p.description=="function"?p.description():p.description):null),oe.isValidElement(p.cancel)?p.cancel:p.cancel&&mr(p.cancel)?oe.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||A,onClick:we=>{mr(p.cancel)&&Is&&(p.cancel.onClick==null||p.cancel.onClick.call(p.cancel,we),vs())},className:ks(C?.cancelButton,p==null||(b=p.classNames)==null?void 0:b.cancelButton)},p.cancel.label):null,oe.isValidElement(p.action)?p.action:p.action&&mr(p.action)?oe.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||se,onClick:we=>{mr(p.action)&&(p.action.onClick==null||p.action.onClick.call(p.action,we),!we.defaultPrevented&&vs())},className:ks(C?.actionButton,p==null||(x=p.classNames)==null?void 0:x.actionButton)},p.action.label):null)};function Vh(){if(typeof window>"u"||typeof document>"u")return"ltr";const l=document.documentElement.getAttribute("dir");return l==="auto"||!l?window.getComputedStyle(document.documentElement).direction:l}function lb(l,i){const r={};return[l,i].forEach((u,f)=>{const h=f===1,g=h?"--mobile-offset":"--offset",w=h?Wy:Fy;function b(x){["top","right","bottom","left"].forEach(N=>{r[`${g}-${N}`]=typeof x=="number"?`${x}px`:x})}typeof u=="number"||typeof u=="string"?b(u):typeof u=="object"?["top","right","bottom","left"].forEach(x=>{u[x]===void 0?r[`${g}-${x}`]=w:r[`${g}-${x}`]=typeof u[x]=="number"?`${u[x]}px`:u[x]}):b(w)}),r}const ib=oe.forwardRef(function(i,r){const{id:u,invert:f,position:h="bottom-right",hotkey:g=["altKey","KeyT"],expand:w,closeButton:b,className:x,offset:N,mobileOffset:p,theme:E="light",richColors:I,duration:$,style:V,visibleToasts:P=Iy,toastOptions:G,dir:O=Vh(),gap:D=eb,icons:R,containerAriaLabel:Z="Notifications"}=i,[k,T]=oe.useState([]),A=oe.useMemo(()=>u?k.filter(S=>S.toasterId===u):k.filter(S=>!S.toasterId),[k,u]),se=oe.useMemo(()=>Array.from(new Set([h].concat(A.filter(S=>S.position).map(S=>S.position)))),[A,h]),[J,Q]=oe.useState([]),[te,ne]=oe.useState(!1),[ie,ae]=oe.useState(!1),[C,H]=oe.useState(E!=="system"?E:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),re=oe.useRef(null),de=g.join("+").replace(/Key/g,"").replace(/Digit/g,""),xe=oe.useRef(null),v=oe.useRef(!1),j=oe.useCallback(S=>{T(U=>{var le;return(le=U.find(ue=>ue.id===S.id))!=null&&le.delete||$t.dismiss(S.id),U.filter(({id:ue})=>ue!==S.id)})},[]);return oe.useEffect(()=>$t.subscribe(S=>{if(S.dismiss){requestAnimationFrame(()=>{T(U=>U.map(le=>le.id===S.id?{...le,delete:!0}:le))});return}setTimeout(()=>{Oy.flushSync(()=>{T(U=>{const le=U.findIndex(ue=>ue.id===S.id);return le!==-1?[...U.slice(0,le),{...U[le],...S},...U.slice(le+1)]:[S,...U]})})})}),[k]),oe.useEffect(()=>{if(E!=="system"){H(E);return}if(E==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?H("dark"):H("light")),typeof window>"u")return;const S=window.matchMedia("(prefers-color-scheme: dark)");try{S.addEventListener("change",({matches:U})=>{H(U?"dark":"light")})}catch{S.addListener(({matches:le})=>{try{H(le?"dark":"light")}catch(ue){console.error(ue)}})}},[E]),oe.useEffect(()=>{k.length<=1&&ne(!1)},[k]),oe.useEffect(()=>{const S=U=>{var le;if(g.every(ye=>U[ye]||U.code===ye)){var pe;ne(!0),(pe=re.current)==null||pe.focus()}U.code==="Escape"&&(document.activeElement===re.current||(le=re.current)!=null&&le.contains(document.activeElement))&&ne(!1)};return document.addEventListener("keydown",S),()=>document.removeEventListener("keydown",S)},[g]),oe.useEffect(()=>{if(re.current)return()=>{xe.current&&(xe.current.focus({preventScroll:!0}),xe.current=null,v.current=!1)}},[re.current]),oe.createElement("section",{ref:r,"aria-label":`${Z} ${de}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},se.map((S,U)=>{var le;const[ue,pe]=S.split("-");return A.length?oe.createElement("ol",{key:S,dir:O==="auto"?Vh():O,tabIndex:-1,ref:re,className:x,"data-sonner-toaster":!0,"data-sonner-theme":C,"data-y-position":ue,"data-x-position":pe,style:{"--front-toast-height":`${((le=J[0])==null?void 0:le.height)||0}px`,"--width":`${Py}px`,"--gap":`${D}px`,...V,...lb(N,p)},onBlur:ye=>{v.current&&!ye.currentTarget.contains(ye.relatedTarget)&&(v.current=!1,xe.current&&(xe.current.focus({preventScroll:!0}),xe.current=null))},onFocus:ye=>{ye.target instanceof HTMLElement&&ye.target.dataset.dismissible==="false"||v.current||(v.current=!0,xe.current=ye.relatedTarget)},onMouseEnter:()=>ne(!0),onMouseMove:()=>ne(!0),onMouseLeave:()=>{ie||ne(!1)},onDragEnd:()=>ne(!1),onPointerDown:ye=>{ye.target instanceof HTMLElement&&ye.target.dataset.dismissible==="false"||ae(!0)},onPointerUp:()=>ae(!1)},A.filter(ye=>!ye.position&&U===0||ye.position===S).map((ye,je)=>{var Ue,gt;return oe.createElement(nb,{key:ye.id,icons:R,index:je,toast:ye,defaultRichColors:I,duration:(Ue=G?.duration)!=null?Ue:$,className:G?.className,descriptionClassName:G?.descriptionClassName,invert:f,visibleToasts:P,closeButton:(gt=G?.closeButton)!=null?gt:b,
9interacting:ie,position:S,style:G?.style,unstyled:G?.unstyled,classNames:G?.classNames,cancelButtonStyle:G?.cancelButtonStyle,actionButtonStyle:G?.actionButtonStyle,closeButtonAriaLabel:G?.closeButtonAriaLabel,removeToast:j,toasts:A.filter(Ct=>Ct.position==ye.position),heights:J.filter(Ct=>Ct.position==ye.position),setHeights:Q,expandByDefault:w,gap:D,expanded:te,swipeDirections:i.swipeDirections})})):null}))});class tt extends Error{status;code;data;constructor(i,r,u,f){super(u||r),this.status=i,this.code=r,this.data=f??null}}function Cr(l){if(!(l instanceof tt)||l.code!=="suspended")return!1;const i=l.data&&l.data.until?new Date(l.data.until):null,r=i&&!Number.isNaN(i.getTime())?i.toLocaleDateString("en-US",{month:"long",day:"numeric"}):null;return B.error(r?`Your account is in a timeout until ${r}.`:"Your account is in a timeout right now."),!0}async function Vl(l,i,r){const u=await fetch(i,{method:l,credentials:"include",headers:r!==void 0?{"Content-Type":"application/json"}:void 0,body:r!==void 0?JSON.stringify(r):void 0});let f=null;try{f=await u.json()}catch{}if(!u.ok||f&&f.success===!1)throw new tt(u.status,f&&(f.error||f.code)||`http_${u.status}`,f&&f.message,f);return f}const K={get:l=>Vl("GET",l),post:(l,i)=>Vl("POST",l,i),put:(l,i)=>Vl("PUT",l,i),patch:(l,i)=>Vl("PATCH",l,i),del:l=>Vl("DELETE",l)};async function Rr(l){const i=new FormData;l.forEach(f=>i.append("photos",f));const r=await fetch("/api/neighborhood/uploads",{method:"POST",credentials:"include",body:i}),u=await r.json().catch(()=>null);if(!r.ok||!u||u.success===!1)throw new tt(r.status,u&&u.error||"upload_failed",u&&u.message);return u.urls}const Es=Object.create(null);Es.open="0";Es.close="1";Es.ping="2";Es.pong="3";Es.message="4";Es.upgrade="5";Es.noop="6";const Nr=Object.create(null);Object.keys(Es).forEach(l=>{Nr[Es[l]]=l});const xu={type:"error",data:"parser error"},Cp=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",kp=typeof ArrayBuffer=="function",_p=l=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(l):l&&l.buffer instanceof ArrayBuffer,Tu=({type:l,data:i},r,u)=>Cp&&i instanceof Blob?r?u(i):Gh(i,u):kp&&(i instanceof ArrayBuffer||_p(i))?r?u(i):Gh(new Blob([i]),u):u(Es[l]+(i||"")),Gh=(l,i)=>{const r=new FileReader;return r.onload=function(){const u=r.result.split(",")[1];i("b"+(u||""))},r.readAsDataURL(l)};function Zh(l){return l instanceof Uint8Array?l:l instanceof ArrayBuffer?new Uint8Array(l):new Uint8Array(l.buffer,l.byteOffset,l.byteLength)}let cu;function rb(l,i){if(Cp&&l.data instanceof Blob)return l.data.arrayBuffer().then(Zh).then(i);if(kp&&(l.data instanceof ArrayBuffer||_p(l.data)))return i(Zh(l.data));Tu(l,!1,r=>{cu||(cu=new TextEncoder),i(cu.encode(r))})}const Xh="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Xl=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let l=0;l<Xh.length;l++)Xl[Xh.charCodeAt(l)]=l;const ob=l=>{let i=l.length*.75,r=l.length,u,f=0,h,g,w,b;l[l.length-1]==="="&&(i--,l[l.length-2]==="="&&i--);const x=new ArrayBuffer(i),N=new Uint8Array(x);for(u=0;u<r;u+=4)h=Xl[l.charCodeAt(u)],g=Xl[l.charCodeAt(u+1)],w=Xl[l.charCodeAt(u+2)],b=Xl[l.charCodeAt(u+3)],N[f++]=h<<2|g>>4,N[f++]=(g&15)<<4|w>>2,N[f++]=(w&3)<<6|b&63;return x},cb=typeof ArrayBuffer=="function",Au=(l,i)=>{if(typeof l!="string")return{type:"message",data:Ep(l,i)};const r=l.charAt(0);return r==="b"?{type:"message",data:ub(l.substring(1),i)}:Nr[r]?l.length>1?{type:Nr[r],data:l.substring(1)}:{type:Nr[r]}:xu},ub=(l,i)=>{if(cb){const r=ob(l);return Ep(r,i)}else return{base64:!0,data:l}},Ep=(l,i)=>i==="blob"?l instanceof Blob?l:new Blob([l]):l instanceof ArrayBuffer?l:l.buffer,Tp="�",db=(l,i)=>{const r=l.length,u=new Array(r);let f=0;l.forEach((h,g)=>{Tu(h,!1,w=>{u[g]=w,++f===r&&i(u.join(Tp))})})},fb=(l,i)=>{const r=l.split(Tp),u=[];for(let f=0;f<r.length;f++){const h=Au(r[f],i);if(u.push(h),h.type==="error")break}return u};function mb(){return new TransformStream({transform(l,i){rb(l,r=>{const u=r.length;let f;if(u<126)f=new Uint8Array(1),new DataView(f.buffer).setUint8(0,u);
vendor: 20,212 bytes, line 9
9else if(u<65536){f=new Uint8Array(3);const h=new DataView(f.buffer);h.setUint8(0,126),h.setUint16(1,u)}else{f=new Uint8Array(9);const h=new DataView(f.buffer);h.setUint8(0,127),h.setBigUint64(1,BigInt(u))}l.data&&typeof l.data!="string"&&(f[0]|=128),i.enqueue(f),i.enqueue(r)})}})}let uu;function hr(l){return l.reduce((i,r)=>i+r.length,0)}function pr(l,i){if(l[0].length===i)return l.shift();const r=new Uint8Array(i);let u=0;for(let f=0;f<i;f++)r[f]=l[0][u++],u===l[0].length&&(l.shift(),u=0);return l.length&&u<l[0].length&&(l[0]=l[0].slice(u)),r}function hb(l,i){uu||(uu=new TextDecoder);const r=[];let u=0,f=-1,h=!1;return new TransformStream({transform(g,w){for(r.push(g);;){if(u===0){if(hr(r)<1)break;const b=pr(r,1);h=(b[0]&128)===128,f=b[0]&127,f<126?u=3:f===126?u=1:u=2}else if(u===1){if(hr(r)<2)break;const b=pr(r,2);f=new DataView(b.buffer,b.byteOffset,b.length).getUint16(0),u=3}else if(u===2){if(hr(r)<8)break;const b=pr(r,8),x=new DataView(b.buffer,b.byteOffset,b.length),N=x.getUint32(0);if(N>Math.pow(2,21)-1){w.enqueue(xu);break}f=N*Math.pow(2,32)+x.getUint32(4),u=3}else{if(hr(r)<f)break;const b=pr(r,f);w.enqueue(Au(h?b:uu.decode(b),i)),u=0}if(f===0||f>l){w.enqueue(xu);break}}}})}const Ap=4;function rt(l){if(l)return pb(l)}function pb(l){for(var i in rt.prototype)l[i]=rt.prototype[i];return l}rt.prototype.on=rt.prototype.addEventListener=function(l,i){return this._callbacks=this._callbacks||{},(this._callbacks["$"+l]=this._callbacks["$"+l]||[]).push(i),this};rt.prototype.once=function(l,i){function r(){this.off(l,r),i.apply(this,arguments)}return r.fn=i,this.on(l,r),this};rt.prototype.off=rt.prototype.removeListener=rt.prototype.removeAllListeners=rt.prototype.removeEventListener=function(l,i){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var r=this._callbacks["$"+l];if(!r)return this;if(arguments.length==1)return delete this._callbacks["$"+l],this;for(var u,f=0;f<r.length;f++)if(u=r[f],u===i||u.fn===i){r.splice(f,1);break}return r.length===0&&delete this._callbacks["$"+l],this};rt.prototype.emit=function(l){this._callbacks=this._callbacks||{};for(var i=new Array(arguments.length-1),r=this._callbacks["$"+l],u=1;u<arguments.length;u++)i[u-1]=arguments[u];if(r){r=r.slice(0);for(var u=0,f=r.length;u<f;++u)r[u].apply(this,i)}return this};rt.prototype.emitReserved=rt.prototype.emit;rt.prototype.listeners=function(l){return this._callbacks=this._callbacks||{},this._callbacks["$"+l]||[]};rt.prototype.hasListeners=function(l){return!!this.listeners(l).length};const Or=typeof Promise=="function"&&typeof Promise.resolve=="function"?i=>Promise.resolve().then(i):(i,r)=>r(i,0),ds=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),gb="arraybuffer";function Mp(l,...i){return i.reduce((r,u)=>(l.hasOwnProperty(u)&&(r[u]=l[u]),r),{})}const xb=ds.setTimeout,yb=ds.clearTimeout;function zr(l,i){i.useNativeTimers?(l.setTimeoutFn=xb.bind(ds),l.clearTimeoutFn=yb.bind(ds)):(l.setTimeoutFn=ds.setTimeout.bind(ds),l.clearTimeoutFn=ds.clearTimeout.bind(ds))}const bb=1.33;function vb(l){return typeof l=="string"?Nb(l):Math.ceil((l.byteLength||l.size)*bb)}function Nb(l){let i=0,r=0;for(let u=0,f=l.length;u<f;u++)i=l.charCodeAt(u),i<128?r+=1:i<2048?r+=2:i<55296||i>=57344?r+=3:(u++,r+=4);return r}function Rp(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function jb(l){let i="";for(let r in l)l.hasOwnProperty(r)&&(i.length&&(i+="&"),i+=encodeURIComponent(r)+"="+encodeURIComponent(l[r]));return i}function wb(l){let i={},r=l.split("&");for(let u=0,f=r.length;u<f;u++){let h=r[u].split("=");i[decodeURIComponent(h[0])]=decodeURIComponent(h[1])}return i}class Sb extends Error{constructor(i,r,u){super(i),this.description=r,this.context=u,this.type="TransportError"}}class Mu extends rt{constructor(i){super(),this.writable=!1,zr(this,i),this.opts=i,this.query=i.query,this.socket=i.socket,this.supportsBinary=!i.forceBase64}onError(i,r,u){return super.emitReserved("error",new Sb(i,r,u)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(i){this.readyState==="open"&&this.write(i)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(i){const r=Au(i,this.socket.binaryType);this.onPacket(r)}onPacket(i){super.emitReserved("packet",i)}onClose(i){this.readyState="closed",super.emitReserved("close",i)}pause(i){}createUri(i,r={}){return i+"://"+this._hostname()+this._port()+this.opts.path+this._query(r)}_hostname(){const i=this.opts.hostname;return i.indexOf(":")===-1?i:"["+i+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(i){const r=jb(i);return r.length?"?"+r:""}}class Cb extends Mu{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(i){this.readyState="pausing";const r=()=>{this.readyState="paused",i()};if(this._polling||!this.writable){let u=0;this._polling&&(u++,this.once("pollComplete",function(){--u||r()})),this.writable||(u++,this.once("drain",function(){--u||r()}))}else r()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(i){const r=u=>{if(this.readyState==="opening"&&u.type==="open"&&this.onOpen(),u.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(u)};fb(i,this.socket.binaryType).forEach(r),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const i=()=>{this.write([{type:"close"}])};this.readyState==="open"?i():this.once("open",i)}write(i){this.writable=!1,db(i,r=>{this.doWrite(r,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const i=this.opts.secure?"https":"http",r=this.query||{};return this.opts.timestampRequests!==!1&&(r[this.opts.timestampParam]=Rp()),!this.supportsBinary&&!r.sid&&(r.b64=1),this.createUri(i,r)}}let Op=!1;try{Op=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const kb=Op;function _b(){}class Eb extends Cb{constructor(i){if(super(i),typeof location<"u"){const r=location.protocol==="https:";let u=location.port;u||(u=r?"443":"80"),this.xd=typeof location<"u"&&i.hostname!==location.hostname||u!==i.port}}doWrite(i,r){const u=this.request({method:"POST",data:i});u.on("success",r),u.on("error",(f,h)=>{this.onError("xhr post error",f,h)})}doPoll(){const i=this.request();i.on("data",this.onData.bind(this)),i.on("error",(r,u)=>{this.onError("xhr poll error",r,u)}),this.pollXhr=i}}class _s extends rt{constructor(i,r,u){super(),this.createRequest=i,zr(this,u),this._opts=u,this._method=u.method||"GET",this._uri=r,this._data=u.data!==void 0?u.data:null,this._create()}_create(){var i;const r=Mp(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");r.xdomain=!!this._opts.xd;const u=this._xhr=this.createRequest(r);try{u.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){u.setDisableHeaderCheck&&u.setDisableHeaderCheck(!0);for(let f in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(f)&&u.setRequestHeader(f,this._opts.extraHeaders[f])}}catch{}if(this._method==="POST")try{u.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{u.setRequestHeader("Accept","*/*")}catch{}(i=this._opts.cookieJar)===null||i===void 0||i.addCookies(u),"withCredentials"in u&&(u.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(u.timeout=this._opts.requestTimeout),u.onreadystatechange=()=>{var f;u.readyState===3&&((f=this._opts.cookieJar)===null||f===void 0||f.parseCookies(u.getResponseHeader("set-cookie"))),u.readyState===4&&(u.status===200||u.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof u.status=="number"?u.status:0)},0))},u.send(this._data)}catch(f){this.setTimeoutFn(()=>{this._onError(f)},0);return}typeof document<"u"&&(this._index=_s.requestsCount++,_s.requests[this._index]=this)}_onError(i){this.emitReserved("error",i,this._xhr),this._cleanup(!0)}_cleanup(i){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=_b,i)try{this._xhr.abort()}catch{}typeof document<"u"&&delete _s.requests[this._index],this._xhr=null}}_onLoad(){const i=this._xhr.responseText;i!==null&&(this.emitReserved("data",i),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}_s.requestsCount=0;_s.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Qh);else if(typeof addEventListener=="function"){const l="onpagehide"in ds?"pagehide":"unload";addEventListener(l,Qh,!1)}}function Qh(){for(let l in _s.requests)_s.requests.hasOwnProperty(l)&&_s.requests[l].abort()}const Tb=(function(){const l=zp({xdomain:!1});return l&&l.responseType!==null})();class Ab extends Eb{constructor(i){super(i);const r=i&&i.forceBase64;this.supportsBinary=Tb&&!r}request(i={}){return Object.assign(i,{xd:this.xd},this.opts),new _s(zp,this.uri(),i)}}function zp(l){const i=l.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!i||kb))return new XMLHttpRequest}catch{}if(!i)try{return new ds[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const Bp=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class Mb extends Mu{get name(){return"websocket"}doOpen(){const i=this.uri(),r=this.opts.protocols,u=Bp?{}:Mp(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(u.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(i,r,u)}catch(f){return this.emitReserved("error",f)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=i=>this.onClose({description:"websocket connection closed",context:i}),this.ws.onmessage=i=>this.onData(i.data),this.ws.onerror=i=>this.onError("websocket error",i)}write(i){this.writable=!1;for(let r=0;r<i.length;r++){const u=i[r],f=r===i.length-1;Tu(u,this.supportsBinary,h=>{try{this.doWrite(u,h)}catch{}f&&Or(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const i=this.opts.secure?"wss":"ws",r=this.query||{};return this.opts.timestampRequests&&(r[this.opts.timestampParam]=Rp()),this.supportsBinary||(r.b64=1),this.createUri(i,r)}}const du=ds.WebSocket||ds.MozWebSocket;class Rb extends Mb{createSocket(i,r,u){return Bp?new du(i,r,u):r?new du(i,r):new du(i)}doWrite(i,r){this.ws.send(r)}}class Ob extends Mu{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(i){return this.emitReserved("error",i)}this._transport.closed.then(()=>{this.onClose()}).catch(i=>{this.onError("webtransport error",i)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(i=>{const r=hb(Number.MAX_SAFE_INTEGER,this.socket.binaryType),u=i.readable.pipeThrough(r).getReader(),f=mb();f.readable.pipeTo(i.writable),this._writer=f.writable.getWriter();const h=()=>{u.read().then(({done:w,value:b})=>{w||(this.onPacket(b),h())}).catch(w=>{})};h();const g={type:"open"};this.query.sid&&(g.data=`{"sid":"${this.query.sid}"}`),this._writer.write(g).then(()=>this.onOpen())})})}write(i){this.writable=!1;for(let r=0;r<i.length;r++){const u=i[r],f=r===i.length-1;this._writer.write(u).then(()=>{f&&Or(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var i;(i=this._transport)===null||i===void 0||i.close()}}const zb={websocket:Rb,webtransport:Ob,polling:Ab},Bb=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Db=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function yu(l){if(l.length>8e3)throw"URI too long";const i=l,r=l.indexOf("["),u=l.indexOf("]");r!=-1&&u!=-1&&(l=l.substring(0,r)+l.substring(r,u).replace(/:/g,";")+l.substring(u,l.length));let f=Bb.exec(l||""),h={},g=14;for(;g--;)h[Db[g]]=f[g]||"";return r!=-1&&u!=-1&&(h.source=i,h.host=h.host.substring(1,h.host.length-1).replace(/;/g,":"),h.authority=h.authority.replace("[","").replace("]","").replace(/;/g,":"),h.ipv6uri=!0),h.pathNames=Ub(h,h.path),h.queryKey=Lb(h,h.query),h}function Ub(l,i){const r=/\/{2,9}/g,u=i.replace(r,"/").split("/");return(i.slice(0,1)=="/"||i.length===0)&&u.splice(0,1),i.slice(-1)=="/"&&u.splice(u.length-1,1),u}function Lb(l,i){const r={};return i.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(u,f,h){f&&(r[f]=h)}),r}const bu=typeof addEventListener=="function"&&typeof removeEventListener=="function",jr=[];bu&&addEventListener("offline",()=>{jr.forEach(l=>l())},!1);class wa extends rt{constructor(i,r){if(super(),this.binaryType=gb,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,i&&typeof i=="object"&&(r=i,i=null),i){const u=yu(i);r.hostname=u.host,r.secure=u.protocol==="https"||u.protocol==="wss",r.port=u.port,u.query&&(r.query=u.query)}else r.host&&(r.hostname=yu(r.host).host);zr(this,r),this.secure=r.secure!=null?r.secure:typeof location<"u"&&location.protocol==="https:",r.hostname&&!r.port&&(r.port=this.secure?"443":"80"),this.hostname=r.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=r.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},r.transports.forEach(u=>{const f=u.prototype.name;this.transports.push(f),this._transportsByName[f]=u}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},r),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=wb(this.opts.query)),bu&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},jr.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(i){const r=Object.assign({},this.opts.query);r.EIO=Ap,r.transport=i,this.id&&(r.sid=this.id);const u=Object.assign({},this.opts,{query:r,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[i]);return new this._transportsByName[i](u)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const i=this.opts.rememberUpgrade&&wa.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const r=this.createTransport(i);r.open(),this.setTransport(r)}setTransport(i){this.transport&&this.transport.removeAllListeners(),this.transport=i,i.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",r=>this._onClose("transport close",r))}onOpen(){this.readyState="open",wa.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(i){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",i),this.emitReserved("heartbeat"),i.type){case"open":this.onHandshake(JSON.parse(i.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const r=new Error("server error");r.code=i.data,this._onError(r);break;case"message":this.emitReserved("data",i.data),this.emitReserved("message",i.data);break}}onHandshake(i){this.emitReserved("handshake",i),this.id=i.sid,this.transport.query.sid=i.sid,this._pingInterval=i.pingInterval,this._pingTimeout=i.pingTimeout,this._maxPayload=i.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const i=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+i,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},i),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const i=this._getWritablePackets();this.transport.send(i),this._prevBufferLen=i.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let r=1;for(let u=0;u<this.writeBuffer.length;u++){const f=this.writeBuffer[u].data;if(f&&(r+=vb(f)),u>0&&r>this._maxPayload)return this.writeBuffer.slice(0,u);r+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const i=Date.now()>this._pingTimeoutTime;return i&&(this._pingTimeoutTime=0,Or(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),i}write(i,r,u){return this._sendPacket("message",i,r,u),this}send(i,r,u){return this._sendPacket("message",i,r,u),this}_sendPacket(i,r,u,f){if(typeof r=="function"&&(f=r,r=void 0),typeof u=="function"&&(f=u,u=null),this.readyState==="closing"||this.readyState==="closed")return;u=u||{},u.compress=u.compress!==!1;const h={type:i,data:r,options:u};this.emitReserved("packetCreate",h),this.writeBuffer.push(h),f&&this.once("flush",f),this.flush()}close(){const i=()=>{this._onClose("forced close"),this.transport.close()},r=()=>{this.off("upgrade",r),this.off("upgradeError",r),i()},u=()=>{this.once("upgrade",r),this.once("upgradeError",r)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?u():i()}):this.upgrading?u():i()),this}_onError(i){if(wa.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",i),this._onClose("transport error",i)}_onClose(i,r){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),bu&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const u=jr.indexOf(this._offlineEventListener);u!==-1&&jr.splice(u,1)}this.readyState="closed",this.id=null,this.emitReserved("close",i,r),this.writeBuffer=[],this._prevBufferLen=0}}}wa.protocol=Ap;class qb extends wa{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let i=0;i<this._upgrades.length;i++)this._probe(this._upgrades[i])}_probe(i){let r=this.createTransport(i),u=!1;wa.priorWebsocketSuccess=!1;const f=()=>{u||(r.send([{type:"ping",data:"probe"}]),r.once("packet",p=>{if(!u)if(p.type==="pong"&&p.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",r),!r)return;wa.priorWebsocketSuccess=r.name==="websocket",this.transport.pause(()=>{u||this.readyState!=="closed"&&(N(),this.setTransport(r),r.send([{type:"upgrade"}
vendor: 10,501 bytes, line 9
9]),this.emitReserved("upgrade",r),r=null,this.upgrading=!1,this.flush())})}else{const E=new Error("probe error");E.transport=r.name,this.emitReserved("upgradeError",E)}}))};function h(){u||(u=!0,N(),r.close(),r=null)}const g=p=>{const E=new Error("probe error: "+p);E.transport=r.name,h(),this.emitReserved("upgradeError",E)};function w(){g("transport closed")}function b(){g("socket closed")}function x(p){r&&p.name!==r.name&&h()}const N=()=>{r.removeListener("open",f),r.removeListener("error",g),r.removeListener("close",w),this.off("close",b),this.off("upgrading",x)};r.once("open",f),r.once("error",g),r.once("close",w),this.once("close",b),this.once("upgrading",x),this._upgrades.indexOf("webtransport")!==-1&&i!=="webtransport"?this.setTimeoutFn(()=>{u||r.open()},200):r.open()}onHandshake(i){this._upgrades=this._filterUpgrades(i.upgrades),super.onHandshake(i)}_filterUpgrades(i){const r=[];for(let u=0;u<i.length;u++)~this.transports.indexOf(i[u])&&r.push(i[u]);return r}}let Hb=class extends qb{constructor(i,r={}){const u=typeof i=="object",f=u?{...i}:{...r};(!f.transports||f.transports&&typeof f.transports[0]=="string")&&(f.transports=(f.transports||["polling","websocket","webtransport"]).map(h=>zb[h]).filter(h=>!!h)),super(u?f:i,f)}};function $b(l,i="",r){let u=l;r=r||typeof location<"u"&&location,l==null&&(l=r.protocol+"//"+r.host),typeof l=="string"&&(l.charAt(0)==="/"&&(l.charAt(1)==="/"?l=r.protocol+l:l=r.host+l),/^(https?|wss?):\/\//.test(l)||(typeof r<"u"?l=r.protocol+"//"+l:l="https://"+l),u=yu(l)),u.port||(/^(http|ws)$/.test(u.protocol)?u.port="80":/^(http|ws)s$/.test(u.protocol)&&(u.port="443")),u.path=u.path||"/";const h=u.host.indexOf(":")!==-1?"["+u.host+"]":u.host;return u.id=u.protocol+"://"+h+":"+u.port+i,u.href=u.protocol+"://"+h+(r&&r.port===u.port?"":":"+u.port),u}const Yb=typeof ArrayBuffer=="function",Vb=l=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(l):l.buffer instanceof ArrayBuffer,Dp=Object.prototype.toString,Gb=typeof Blob=="function"||typeof Blob<"u"&&Dp.call(Blob)==="[object BlobConstructor]",Zb=typeof File=="function"||typeof File<"u"&&Dp.call(File)==="[object FileConstructor]";function Ru(l){return Yb&&(l instanceof ArrayBuffer||Vb(l))||Gb&&l instanceof Blob||Zb&&l instanceof File}function wr(l,i){if(!l||typeof l!="object")return!1;if(Array.isArray(l)){for(let r=0,u=l.length;r<u;r++)if(wr(l[r]))return!0;return!1}if(Ru(l))return!0;if(l.toJSON&&typeof l.toJSON=="function"&&arguments.length===1)return wr(l.toJSON(),!0);for(const r in l)if(Object.prototype.hasOwnProperty.call(l,r)&&wr(l[r]))return!0;return!1}function Xb(l){const i=[],r=l.data,u=l;return u.data=vu(r,i),u.attachments=i.length,{packet:u,buffers:i}}function vu(l,i){if(!l)return l;if(Ru(l)){const r={_placeholder:!0,num:i.length};return i.push(l),r}else if(Array.isArray(l)){const r=new Array(l.length);for(let u=0;u<l.length;u++)r[u]=vu(l[u],i);return r}else if(typeof l=="object"&&!(l instanceof Date)){const r={};for(const u in l)Object.prototype.hasOwnProperty.call(l,u)&&(r[u]=vu(l[u],i));return r}return l}function Qb(l,i){return l.data=Nu(l.data,i),delete l.attachments,l}function Nu(l,i){if(!l)return l;if(l&&l._placeholder===!0){if(typeof l.num=="number"&&l.num>=0&&l.num<i.length)return i[l.num];throw new Error("illegal attachments")}else if(Array.isArray(l))for(let r=0;r<l.length;r++)l[r]=Nu(l[r],i);else if(typeof l=="object")for(const r in l)Object.prototype.hasOwnProperty.call(l,r)&&(l[r]=Nu(l[r],i));return l}const Kb=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var Oe;(function(l){l[l.CONNECT=0]="CONNECT",l[l.DISCONNECT=1]="DISCONNECT",l[l.EVENT=2]="EVENT",l[l.ACK=3]="ACK",l[l.CONNECT_ERROR=4]="CONNECT_ERROR",l[l.BINARY_EVENT=5]="BINARY_EVENT",l[l.BINARY_ACK=6]="BINARY_ACK"})(Oe||(Oe={}));class Jb{constructor(i){this.replacer=i}encode(i){return(i.type===Oe.EVENT||i.type===Oe.ACK)&&wr(i)?this.encodeAsBinary({type:i.type===Oe.EVENT?Oe.BINARY_EVENT:Oe.BINARY_ACK,nsp:i.nsp,data:i.data,id:i.id}):[this.encodeAsString(i)]}encodeAsString(i){let r=""+i.type;return(i.type===Oe.BINARY_EVENT||i.type===Oe.BINARY_ACK)&&(r+=i.attachments+"-"),i.nsp&&i.nsp!=="/"&&(r+=i.nsp+","),i.id!=null&&(r+=i.id),i.data!=null&&(r+=JSON.stringify(i.data,this.replacer)),r}encodeAsBinary(i){const r=Xb(i),u=this.encodeAsString(r.packet),f=r.buffers;return f.unshift(u),f}}class Ou extends rt{constructor(i){super(),this.opts=Object.assign({reviver:void 0,maxAttachments:10},typeof i=="function"?{reviver:i}:i)}add(i){let r;if(typeof i=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");r=this.decodeString(i);const u=r.type===Oe.BINARY_EVENT;u||r.type===Oe.BINARY_ACK?(r.type=u?Oe.EVENT:Oe.ACK,this.reconstructor=new Ib(r),r.attachments===0&&super.emitReserved("decoded",r)):super.emitReserved("decoded",r)}else if(Ru(i)||i.base64)if(this.reconstructor)r=this.reconstructor.takeBinaryData(i),r&&(this.reconstructor=null,super.emitReserved("decoded",r));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+i)}decodeString(i){let r=0;const u={type:Number(i.charAt(0))};if(Oe[u.type]===void 0)throw new Error("unknown packet type "+u.type);if(u.type===Oe.BINARY_EVENT||u.type===Oe.BINARY_ACK){const h=r+1;for(;i.charAt(++r)!=="-"&&r!=i.length;);const g=i.substring(h,r);if(g!=Number(g)||i.charAt(r)!=="-")throw new Error("Illegal attachments");const w=Number(g);if(!Fb(w)||w<0)throw new Error("Illegal attachments");if(w>this.opts.maxAttachments)throw new Error("too many attachments");u.attachments=w}if(i.charAt(r+1)==="/"){const h=r+1;for(;++r&&!(i.charAt(r)===","||r===i.length););u.nsp=i.substring(h,r)}else u.nsp="/";const f=i.charAt(r+1);if(f!==""&&Number(f)==f){const h=r+1;for(;++r;){const g=i.charAt(r);if(g==null||Number(g)!=g){--r;break}if(r===i.length)break}u.id=Number(i.substring(h,r+1))}if(i.charAt(++r)){const h=this.tryParse(i.substr(r));if(Ou.isPayloadValid(u.type,h))u.data=h;else throw new Error("invalid payload")}return u}tryParse(i){try{return JSON.parse(i,this.opts.reviver)}catch{return!1}}static isPayloadValid(i,r){switch(i){case Oe.CONNECT:return Kh(r);case Oe.DISCONNECT:return r===void 0;case Oe.CONNECT_ERROR:return typeof r=="string"||Kh(r);case Oe.EVENT:case Oe.BINARY_EVENT:return Array.isArray(r)&&(typeof r[0]=="number"||typeof r[0]=="string"&&Kb.indexOf(r[0])===-1);case Oe.ACK:case Oe.BINARY_ACK:return Array.isArray(r)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class Ib{constructor(i){this.packet=i,this.buffers=[],this.reconPack=i}takeBinaryData(i){if(this.buffers.push(i),this.buffers.length===this.reconPack.attachments){const r=Qb(this.reconPack,this.buffers);return this.finishedReconstruction(),r}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const Fb=Number.isInteger||function(l){return typeof l=="number"&&isFinite(l)&&Math.floor(l)===l};function Kh(l){return Object.prototype.toString.call(l)==="[object Object]"}const Wb=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Ou,Encoder:Jb,get PacketType(){return Oe}},Symbol.toStringTag,{value:"Module"}));function ys(l,i,r){return l.on(i,r),function(){l.off(i,r)}}const Pb=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Up extends rt{constructor(i,r,u){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=i,this.nsp=r,u&&u.auth&&(this.auth=u.auth),this._opts=Object.assign({},u),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const i=this.io;this.subs=[ys(i,"open",this.onopen.bind(this)),ys(i,"packet",this.onpacket.bind(this)),ys(i,"error",this.onerror.bind(this)),ys(i,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...i){return i.unshift("message"),this.emit.apply(this,i),this}emit(i,...r){var u,f,h;if(Pb.hasOwnProperty(i))throw new Error('"'+i.toString()+'" is a reserved event name');if(r.unshift(i),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(r),this;const g={type:Oe.EVENT,data:r};if(g.options={},g.options.compress=this.flags.compress!==!1,typeof r[r.length-1]=="function"){const N=this.ids++,p=r.pop();this._registerAckCallback(N,p),g.id=N}const w=(f=(u=this.io.engine)===null||u===void 0?void 0:u.transport)===null||f===void 0?void 0:f.writable,b=this.connected&&!(!((h=this.io.engine)===null||h===void 0)&&h._hasPingExpired());return this.flags.volatile&&!w||(b?(this.notifyOutgoingListeners(g),this.packet(g)):this.sendBuffer.push(g)),this.flags={},this}_registerAckCallback(i,r){var u;const f=(u=this.flags.timeout)!==null&&u!==void 0?u:this._opts.ackTimeout;if(f===void 0){this.acks[i]=r;return}const h=this.io.setTimeoutFn(()=>{delete this.acks[i];for(let w=0;w<this.sendBuffer.length;w++)this.sendBuffer[w].id===i&&this.sendBuffer.splice(w,1);r.call(this,new Error("operation has timed out"))},f),g=(...w)=>{this.io.clearTimeoutFn(h),r.apply(this,w)};g.withError=!0,this.acks[i]=g}emitWithAck(i,...r){return new Promise((u,f)=>{const h=(g,w)=>g?f(g):u(w);h.withError=!0,r.push(h),this.emit(i,...r)})}_addToQueue(i){let r;typeof i[i.length-1]=="function"&&(r=i.pop());const u={id:this._queueSeq++,tryCount:0,pending:!1,args:i,flags:Object.assign({fromQueue:!0},this.flags)};i.push((f,...h)=>(this._queue[0],f!==null?u.tryCount>this._opts.retries&&(this._queue.shift(),r&&r(f)):(this._queue.shift(),r&&r(null,...h)),u.pending=!1,this._drainQueue())),this._queue.push(u),this._drainQueue()}_drainQueue(i=!1){if(!this.connected||this._queue.length===0)return;const r=this._queue[0];r.pending&&!i||(r.pending=!0,r.tryCount++,this.flags=r.flags,this.emit.apply(this,r.args))}packet(i){i.nsp=this.nsp,this.io._packet(i)}onopen(){typeof this.auth=="function"?this.auth(i=>{this._sendConnectPacket(i)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(i){this.packet({type:Oe.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},i):i})}onerror(i){this.connected||this.emitReserved("connect_error",i)}onclose(i,r){this.connected=!1,delete this.id,this.emitReserved("disconnect",i,r),this._clearAcks()}
vendor: 6,791 bytes, line 9
9_clearAcks(){Object.keys(this.acks).forEach(i=>{if(!this.sendBuffer.some(u=>String(u.id)===i)){const u=this.acks[i];delete this.acks[i],u.withError&&u.call(this,new Error("socket has been disconnected"))}})}onpacket(i){if(i.nsp===this.nsp)switch(i.type){case Oe.CONNECT:i.data&&i.data.sid?this.onconnect(i.data.sid,i.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case Oe.EVENT:case Oe.BINARY_EVENT:this.onevent(i);break;case Oe.ACK:case Oe.BINARY_ACK:this.onack(i);break;case Oe.DISCONNECT:this.ondisconnect();break;case Oe.CONNECT_ERROR:this.destroy();const u=new Error(i.data.message);u.data=i.data.data,this.emitReserved("connect_error",u);break}}onevent(i){const r=i.data||[];i.id!=null&&r.push(this.ack(i.id)),this.connected?this.emitEvent(r):this.receiveBuffer.push(Object.freeze(r))}emitEvent(i){if(this._anyListeners&&this._anyListeners.length){const r=this._anyListeners.slice();for(const u of r)u.apply(this,i)}super.emit.apply(this,i),this._pid&&i.length&&typeof i[i.length-1]=="string"&&(this._lastOffset=i[i.length-1])}ack(i){const r=this;let u=!1;return function(...f){u||(u=!0,r.packet({type:Oe.ACK,id:i,data:f}))}}onack(i){const r=this.acks[i.id];typeof r=="function"&&(delete this.acks[i.id],r.withError&&i.data.unshift(null),r.apply(this,i.data))}onconnect(i,r){this.id=i,this.recovered=r&&this._pid===r,this._pid=r,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(i=>this.emitEvent(i)),this.receiveBuffer=[],this.sendBuffer.forEach(i=>{this.notifyOutgoingListeners(i),this.packet(i)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(i=>i()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Oe.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(i){return this.flags.compress=i,this}get volatile(){return this.flags.volatile=!0,this}timeout(i){return this.flags.timeout=i,this}onAny(i){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(i),this}prependAny(i){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(i),this}offAny(i){if(!this._anyListeners)return this;if(i){const r=this._anyListeners;for(let u=0;u<r.length;u++)if(i===r[u])return r.splice(u,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(i){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(i),this}prependAnyOutgoing(i){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(i),this}offAnyOutgoing(i){if(!this._anyOutgoingListeners)return this;if(i){const r=this._anyOutgoingListeners;for(let u=0;u<r.length;u++)if(i===r[u])return r.splice(u,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(i){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const r=this._anyOutgoingListeners.slice();for(const u of r)u.apply(this,i.data)}}}function Gn(l){l=l||{},this.ms=l.min||100,this.max=l.max||1e4,this.factor=l.factor||2,this.jitter=l.jitter>0&&l.jitter<=1?l.jitter:0,this.attempts=0}Gn.prototype.duration=function(){var l=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var i=Math.random(),r=Math.floor(i*this.jitter*l);l=(Math.floor(i*10)&1)==0?l-r:l+r}return Math.min(l,this.max)|0};Gn.prototype.reset=function(){this.attempts=0};Gn.prototype.setMin=function(l){this.ms=l};Gn.prototype.setMax=function(l){this.max=l};Gn.prototype.setJitter=function(l){this.jitter=l};class ju extends rt{constructor(i,r){var u;super(),this.nsps={},this.subs=[],i&&typeof i=="object"&&(r=i,i=void 0),r=r||{},r.path=r.path||"/socket.io",this.opts=r,zr(this,r),this.reconnection(r.reconnection!==!1),this.reconnectionAttempts(r.reconnectionAttempts||1/0),this.reconnectionDelay(r.reconnectionDelay||1e3),this.reconnectionDelayMax(r.reconnectionDelayMax||5e3),this.randomizationFactor((u=r.randomizationFactor)!==null&&u!==void 0?u:.5),this.backoff=new Gn({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(r.timeout==null?2e4:r.timeout),this._readyState="closed",this.uri=i;const f=r.parser||Wb;this.encoder=new f.Encoder,this.decoder=new f.Decoder,this._autoConnect=r.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(i){return arguments.length?(this._reconnection=!!i,i||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(i){return i===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=i,this)}reconnectionDelay(i){var r;return i===void 0?this._reconnectionDelay:(this._reconnectionDelay=i,(r=this.backoff)===null||r===void 0||r.setMin(i),this)}randomizationFactor(i){var r;return i===void 0?this._randomizationFactor:(this._randomizationFactor=i,(r=this.backoff)===null||r===void 0||r.setJitter(i),this)}reconnectionDelayMax(i){var r;return i===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=i,(r=this.backoff)===null||r===void 0||r.setMax(i),this)}timeout(i){return arguments.length?(this._timeout=i,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(i){if(~this._readyState.indexOf("open"))return this;this.engine=new Hb(this.uri,this.opts);const r=this.engine,u=this;this._readyState="opening",this.skipReconnect=!1;const f=ys(r,"open",function(){u.onopen(),i&&i()}),h=w=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",w),i?i(w):this.maybeReconnectOnOpen()},g=ys(r,"error",h);if(this._timeout!==!1){const w=this._timeout,b=this.setTimeoutFn(()=>{f(),h(new Error("timeout")),r.close()},w);this.opts.autoUnref&&b.unref(),this.subs.push(()=>{this.clearTimeoutFn(b)})}return this.subs.push(f),this.subs.push(g),this}connect(i){return this.open(i)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const i=this.engine;this.subs.push(ys(i,"ping",this.onping.bind(this)),ys(i,"data",this.ondata.bind(this)),ys(i,"error",this.onerror.bind(this)),ys(i,"close",this.onclose.bind(this)),ys(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(i){try{this.decoder.add(i)}catch(r){this.onclose("parse error",r)}}ondecoded(i){Or(()=>{this.emitReserved("packet",i)},this.setTimeoutFn)}onerror(i){this.emitReserved("error",i)}socket(i,r){let u=this.nsps[i];
9return u?this._autoConnect&&!u.active&&u.connect():(u=new Up(this,i,r),this.nsps[i]=u),u}_destroy(i){const r=Object.keys(this.nsps);for(const u of r)if(this.nsps[u].active)return;this._close()}_packet(i){const r=this.encoder.encode(i);for(let u=0;u<r.length;u++)this.engine.write(r[u],i.options)}cleanup(){this.subs.forEach(i=>i()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(i,r){var u;this.cleanup(),(u=this.engine)===null||u===void 0||u.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",i,r),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const i=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const r=this.backoff.duration();this._reconnecting=!0;const u=this.setTimeoutFn(()=>{i.skipReconnect||(this.emitReserved("reconnect_attempt",i.backoff.attempts),!i.skipReconnect&&i.open(f=>{f?(i._reconnecting=!1,i.reconnect(),this.emitReserved("reconnect_error",f)):i.onreconnect()}))},r);this.opts.autoUnref&&u.unref(),this.subs.push(()=>{this.clearTimeoutFn(u)})}}onreconnect(){const i=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",i)}}const Gl={};function Sr(l,i){typeof l=="object"&&(i=l,l=void 0),i=i||{};const r=$b(l,i.path||"/socket.io"),u=r.source,f=r.id,h=r.path,g=Gl[f]&&h in Gl[f].nsps,w=i.forceNew||i["force new connection"]||i.multiplex===!1||g;let b;return w?b=new ju(u,i):(Gl[f]||(Gl[f]=new ju(u,i)),b=Gl[f]),r.query&&!i.query&&(i.query=r.queryKey),b.socket(r.path,i)}Object.assign(Sr,{Manager:ju,Socket:Up,io:Sr,connect:Sr});let Ka=null;function Js(){return Ka||(Ka=Sr("/neighborhood",{path:"/socket.io",withCredentials:!0})),Ka}function e0(){return Ka}function t0(){Ka&&(Ka.disconnect(),Ka=null)}const Lp=m.createContext(null);function s0({children:l}){const[i,r]=m.useState("loading"),[u,f]=m.useState(null),[h,g]=m.useState(null),[w,b]=m.useState(null),[x,N]=m.useState(null),[p,E]=m.useState([]),[I,$]=m.useState(!1),[V,P]=m.useState(!1),[G,O]=m.useState([]),[D,R]=m.useState(0),[Z,k]=m.useState(0),T=m.useRef(!1),A=m.useRef(!1),se=m.useCallback(async()=>{try{const ie=await K.get("/api/neighborhood/me");if(ie.role==="operator"){f(ie.operator),r("operator");return}if(!ie.member&&!ie.needsAddress&&!A.current){A.current=!0;try{const ae=[ie.homeowner.firstName,ie.homeowner.lastName].filter(Boolean).join(" ").trim()||"Neighbor";await K.post("/api/neighborhood/join",{displayName:ae}),await se();return}catch{}}g(ie.homeowner),b(ie.member),N(ie.neighborhood),E(ie.followed||[]),$(!!ie.needsAddress),P(!!ie.isModerator),r(ie.member?"ready":"needsOnboarding")}catch(ie){ie&&(ie.status===401||ie.status===403)||console.error("me bootstrap failed",ie),f(null),g(null),b(null),N(null),E([]),P(!1),r("signedOut")}},[]),J=m.useCallback(async()=>{try{const ie=await K.get("/api/neighborhood/notifications");O(ie.notifications),R(ie.unreadCount)}catch{}},[]),Q=m.useCallback(async()=>{try{const ie=await K.get("/api/neighborhood/threads/unread-count");k(ie.unread||0)}catch{}},[]),te=m.useCallback(async()=>{R(0),O(ie=>ie.map(ae=>ae.readAt?ae:{...ae,readAt:new Date().toISOString()}));try{await K.post("/api/neighborhood/notifications/read",{all:!0})}catch{J()}},[J]),ne=m.useCallback(async()=>{await Promise.allSettled([K.post("/api/session/destroy"),K.post("/api/admin/auth/logout")]),t0(),T.current=!1,f(null),g(null),b(null),N(null),E([]),$(!1),P(!1),O([]),R(0),k(0),r("signedOut")},[]);return m.useEffect(()=>{se()},[se]),m.useEffect(()=>{if(i!=="ready"||T.current)return;T.current=!0;const ie=Js(),ae=({notification:re})=>{O(de=>de.some(xe=>xe.id===re.id)?de:[re,...de]),R(de=>de+1)},C=()=>J(),H=()=>Q();return ie.on("notification:new",ae),ie.on("notification:refresh",C),ie.on("message:new",H),J(),Q(),()=>{ie.off("notification:new",ae),ie.off("notification:refresh",C),ie.off("message:new",H)}},[i,J,Q]),a.jsx(Lp.Provider,{value:{status:i,operator:u,homeowner:h,member:w,neighborhood:x,followed:p,needsAddress:I,isModerator:V,notifications:G,unreadNotifications:D,dmUnread:Z,refreshMe:se,refreshNotifications:J,refreshDmUnread:Q,markAllNotificationsRead:te,signOut:ne},children:l})}function ot(){const l=m.useContext(Lp);
vendor: 5,857 bytes, line 9
9if(!l)throw new Error("useApp outside AppProvider");return l}const a0=l=>l.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),n0=l=>l.replace(/^([A-Z])|[\s-_]+(\w)/g,(i,r,u)=>u?u.toUpperCase():r.toLowerCase()),Jh=l=>{const i=n0(l);return i.charAt(0).toUpperCase()+i.slice(1)},qp=(...l)=>l.filter((i,r,u)=>!!i&&i.trim()!==""&&u.indexOf(i)===r).join(" ").trim(),l0=l=>{for(const i in l)if(i.startsWith("aria-")||i==="role"||i==="title")return!0};var i0={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const r0=m.forwardRef(({color:l="currentColor",size:i=24,strokeWidth:r=2,absoluteStrokeWidth:u,className:f="",children:h,iconNode:g,...w},b)=>m.createElement("svg",{ref:b,...i0,width:i,height:i,stroke:l,strokeWidth:u?Number(r)*24/Number(i):r,className:qp("lucide",f),...!h&&!l0(w)&&{"aria-hidden":"true"},...w},[...g.map(([x,N])=>m.createElement(x,N)),...Array.isArray(h)?h:[h]]));const fe=(l,i)=>{const r=m.forwardRef(({className:u,...f},h)=>m.createElement(r0,{ref:h,iconNode:i,className:qp(`lucide-${a0(Jh(l))}`,`lucide-${l}`,u),...f}));return r.displayName=Jh(l),r};const o0=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]],c0=fe("archive",o0);const u0=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],At=fe("arrow-left",u0);const d0=[["path",{d:"M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z",key:"3c2336"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],f0=fe("badge-check",d0);const m0=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]],Hp=fe("ban",m0);const h0=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M22 8c0-2.3-.8-4.3-2-6",key:"5bb3ad"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}],["path",{d:"M4 2C2.8 3.7 2 5.7 2 8",key:"tap9e0"}]],p0=fe("bell-ring",h0);const g0=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],Br=fe("bell",g0);const x0=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],$p=fe("book-open",x0);const y0=[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z",key:"1fy3hk"}]],Ih=fe("bookmark",y0);const b0=[["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M9 7.13v-1a3.003 3.003 0 1 1 6 0v1",key:"d7y7pr"}],["path",{d:"M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6",key:"xs1cw7"}],["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M6.53 9C4.6 8.8 3 7.1 3 5",key:"32zzws"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"M3 21c0-2.1 1.7-3.9 3.8-4",key:"4p0ekp"}],["path",{d:"M20.97 5c0 2.1-1.6 3.8-3.5 4",key:"18gb23"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M17.2 17c2.1.1 3.8 1.9 3.8 4",key:"k3fwyw"}]],v0=fe("bug",b0);const N0=[["path",{d:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",key:"1b4qmf"}],["path",{d:"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2",key:"i71pzd"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2",key:"10jefs"}],["path",{d:"M10 6h4",key:"1itunk"}],["path",{d:"M10 10h4",key:"tcdvrf"}],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]],j0=fe("building-2",N0);const w0=[["path",{d:"M16 14v2.2l1.6 1",key:"fo4ql5"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5",key:"1osxxc"}],["path",{d:"M3 10h5",key:"r794hk"}],["path",{d:"M8 2v4",key:"1cmpym"}],["circle",{cx:"16",cy:"16",r:"6",key:"qoo3c4"}]],kr=fe("calendar-clock",w0);const S0=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]],Dr=fe("calendar-days",S0);const C0=[["path",{d:"M16 19h6",key:"xwg31i"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M19 16v6",key:"tddt3s"}],["path",{d:"M21 12.598V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h8.5",key:"1glfrc"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 2v4",key:"1cmpym"}]],k0=fe("calendar-plus",C0);const _0=[["path",{d:"M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z",key:"1tc9qg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]],E0=fe("camera",_0);const T0=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],zu=fe("chart-column",T0);const A0=[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]],M0=fe("check-check",A0);const R0=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Il=fe("check",R0);const O0=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],z0=fe("chevron-left",O0);const B0=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Fh=fe("chevron-right",B0);const D0=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],U0=fe("circle-question-mark",D0);
9const L0=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]],Yp=fe("clipboard-list",L0);const q0=[["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],H0=fe("compass",q0);const $0=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Vp=fe("copy",$0);const Y0=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],V0=fe("ellipsis",Y0);const G0=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],Gp=fe("external-link",G0);const Z0=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],X0=fe("eye",Z0);const Q0=[["path",{d:"M18 2h-3a5 5 0 0 0-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 0 1 1-1h3z",key:"1jg4f8"}]],K0=fe("facebook",Q0);const J0=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],I0=fe("file-text",J0);const F0=[["path",{d:"M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528",key:"1jaruq"}]],Zn=fe("flag",F0);const W0=[["path",{d:"m14.5 12.5-8 8a2.119 2.119 0 1 1-3-3l8-8",key:"15492f"}],["path",{d:"m16 16 6-6",key:"vzrcl6"}],["path",{d:"m8 8 6-6",key:"18bi4p"}],["path",{d:"m9 7 8 8",key:"5jnvq1"}],["path",{d:"m21 11-8-8",key:"z4y7zo"}]],P0=fe("gavel",W0);const e1=[["rect",{x:"3",y:"8",width:"18",height:"4",rx:"1",key:"bkv52"}],["path",{d:"M12 8v13",key:"1c76mn"}],["path",{d:"M19 12v7a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-7",key:"6wjy6b"}],["path",{d:"M7.5 8a2.5 2.5 0 0 1 0-5A4.8 8 0 0 1 12 8a4.8 8 0 0 1 4.5-5 2.5 2.5 0 0 1 0 5",key:"1ihvrl"}]],Bu=fe("gift",e1);const t1=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],Zp=fe("globe",t1);const s1=[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}]],Ur=fe("heart",s1);const a1=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]],Xp=fe("house",a1);const n1=[["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}],["path",{d:"M10.41 10.41a2 2 0 1 1-2.83-2.83",key:"1bzlo9"}],["line",{x1:"13.5",x2:"6",y1:"13.5",y2:"21",key:"1q0aeu"}],["line",{x1:"18",x2:"21",y1:"12",y2:"15",key:"5mozeu"}],["path",{d:"M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59",key:"mmje98"}],["path",{d:"M21 15V5a2 2 0 0 0-2-2H9",key:"43el77"}]],Qp=fe("image-off",n1);const l1=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],Du=fe("image",l1);const i1=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],r1=fe("key-round",i1);const o1=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],c1=fe("layout-dashboard",o1);
9const u1=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],wu=fe("link-2",u1);const d1=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],Ql=fe("lock",d1);const f1=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],Kp=fe("log-out",f1);const m1=[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]],Lr=fe("mail",m1);const h1=[["path",{d:"M22 17a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9.5C2 7 4 5 6.5 5H18c2.2 0 4 1.8 4 4v8Z",key:"1lbycx"}],["polyline",{points:"15,9 18,9 18,11",key:"1pm9c0"}],["path",{d:"M6.5 5C9 5 11 7 11 9.5V17a2 2 0 0 1-2 2",key:"15i455"}],["line",{x1:"6",x2:"7",y1:"10",y2:"10",key:"1e2scm"}]],p1=fe("mailbox",h1);const g1=[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]],Xn=fe("map-pin",g1);const x1=[["path",{d:"M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z",key:"169xi5"}],["path",{d:"M15 5.764v15",key:"1pn4in"}],["path",{d:"M9 3.236v15",key:"1uimfh"}]],y1=fe("map",x1);const b1=[["path",{d:"M11 6a13 13 0 0 0 8.4-2.8A1 1 0 0 1 21 4v12a1 1 0 0 1-1.6.8A13 13 0 0 0 11 14H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2z",key:"q8bfy3"}],["path",{d:"M6 14a12 12 0 0 0 2.4 7.2 2 2 0 0 0 3.2-2.4A8 8 0 0 1 10 14",key:"1853fq"}],["path",{d:"M8 6v8",key:"15ugcq"}]],v1=fe("megaphone",b1);const N1=[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]],qr=fe("message-circle",N1);const j1=[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]],Fl=fe("message-square",j1);const w1=[["path",{d:"M15 18h-5",key:"95g1m2"}],["path",{d:"M18 14h-8",key:"sponae"}],["path",{d:"M4 22h16a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2H8a2 2 0 0 0-2 2v16a2 2 0 0 1-4 0v-9a2 2 0 0 1 2-2h2",key:"39pd36"}],["rect",{width:"8",height:"4",x:"10",y:"6",rx:"1",key:"aywv1n"}]],S1=fe("newspaper",w1);const C1=[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",key:"1ykcvy"}]],k1=fe("pen-line",C1);const _1=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],Jp=fe("pencil",_1);const E1=[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]],Ja=fe("phone",E1);const T1=[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]],Ip=fe("pin",T1);const A1=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Qn=fe("plus",A1);const M1=[["path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478",key:"1fwjs5"}],["path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134",key:"ehdyv1"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],R1=fe("radio",M1);const O1=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],Wl=fe("refresh-cw",O1);const z1=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Yn=fe("search",z1);const B1=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],Vn=fe("send",B1);const D1=[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]],Fp=fe("share-2",D1);const U1=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",ke
9y:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],es=fe("shield-check",U1);const L1=[["path",{d:"M7 18v-6a5 5 0 1 1 10 0v6",key:"pcx96s"}],["path",{d:"M5 21a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-1a2 2 0 0 0-2-2H7a2 2 0 0 0-2 2z",key:"1b4s83"}],["path",{d:"M21 12h1",key:"jtio3y"}],["path",{d:"M18.5 4.5 18 5",key:"g5sp9y"}],["path",{d:"M2 12h1",key:"1uaihz"}],["path",{d:"M12 2v1",key:"11qlp1"}],["path",{d:"m4.929 4.929.707.707",key:"1i51kw"}],["path",{d:"M12 12v6",key:"3ahymv"}]],Uu=fe("siren",L1);const q1=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],Hr=fe("star",q1);const H1=[["path",{d:"m2 7 4.41-4.41A2 2 0 0 1 7.83 2h8.34a2 2 0 0 1 1.42.59L22 7",key:"ztvudi"}],["path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8",key:"1b2hhj"}],["path",{d:"M15 22v-4a2 2 0 0 0-2-2h-2a2 2 0 0 0-2 2v4",key:"2ebpfo"}],["path",{d:"M2 7h20",key:"1fcdvo"}],["path",{d:"M22 7v3a2 2 0 0 1-2 2a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 16 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 12 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 8 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 4 12a2 2 0 0 1-2-2V7",key:"6c3vgh"}]],Vt=fe("store",H1);const $1=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]],Su=fe("tag",$1);const Y1=[["path",{d:"M2 9a3 3 0 0 1 0 6v2a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2a3 3 0 0 1 0-6V7a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2Z",key:"qn84l0"}],["path",{d:"M13 5v2",key:"dyzc3o"}],["path",{d:"M13 17v2",key:"1ont0d"}],["path",{d:"M13 11v2",key:"1wjjxi"}]],V1=fe("ticket",Y1);const G1=[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]],Wp=fe("trash-2",G1);const Z1=[["path",{d:"M22 4s-.7 2.1-2 3.4c1.6 10-9.4 17.3-18 11.6 2.2.1 4.4-.6 6-2C3 15.5.5 9.6 3 5c2.2 2.6 5.6 4.1 9 4-.9-4.2 4-6.6 7-3.8 1.1 0 3-1.2 3-1.2z",key:"pff0z6"}]],X1=fe("twitter",Z1);const Q1=[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]],K1=fe("undo-2",Q1);const J1=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]],I1=fe("user-plus",J1);const F1=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"17",x2:"22",y1:"8",y2:"13",key:"3nzzx3"}],["line",{x1:"22",x2:"17",y1:"8",y2:"13",key:"1swrse"}]],W1=fe("user-x",F1);const P1=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],Ia=fe("users",P1);const ev=[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]],Pp=fe("volume-x",ev);const tv=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]],sv=fe("wrench",tv);const av=[["path",{d:"M18 6 6 18",key:"1bl5f8"}
9],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],We=fe("x",av),nv="/neighborhood/assets/dlm-neighborhood-logo-DkrGrvfT.png";function Fa({size:l=40,className:i=""}){return a.jsx("img",{src:nv,width:l,height:l,alt:"DLM Neighborhood",className:`rounded-full shrink-0 ${i}`,style:{width:l,height:l}})}function Kl({className:l=""}){return a.jsxs("div",{className:`nbh-poweredby ${l}`,children:["Powered by"," ",a.jsx("a",{href:"https://dlmpropertygroup.com",target:"_blank",rel:"noopener noreferrer",children:"DLM Property Management"})]})}const lv=/https?:\/\/[^\s<>"')]+\.(?:mp4|webm)(?:\?[^\s<>"')]*)?/gi;function $r(l){if(!l)return{text:l,videos:[]};const i=[],r=l.replace(lv,f=>(i.includes(f)||i.push(f),""));return i.length?{text:r.replace(/[ \t]+(\n|$)/g,"$1").replace(/\n{3,}/g,`
10
11`).trim(),videos:i}:{text:l,videos:i}}function iv(l){return l.split(/[?#]/)[0].replace(/\.(?:mp4|webm)$/i,"-poster.jpg")}const rv=new Set(["dealmate.ai","dlmpropertygroup.com","dlmneighborhood.com","dlmneighborhood.ai","myhomeinbox.ai"]);function Wh(l){try{const i=new URL(l),r=i.hostname.toLowerCase().replace(/^www\./,"");if(r===window.location.hostname.toLowerCase().replace(/^www\./,"")||rv.has(r))return i.pathname+i.search}catch{}return l}function Yr({url:l,className:i=""}){const[r,u]=m.useState(void 0),f=Wh(l);return m.useEffect(()=>{const h=Wh(iv(l)),g=new Image;return g.onload=()=>u(h),g.src=h,()=>{g.onload=null}},[l]),a.jsx("video",{src:f,controls:!0,preload:"metadata",playsInline:!0,poster:r,onClick:h=>h.stopPropagation(),className:`w-full max-h-96 rounded-2xl border bg-black ${i}`.trim()})}function eg(){const{refreshMe:l}=ot(),[i,r]=m.useState("phone"),[u,f]=m.useState(""),[h,g]=m.useState(""),[w,b]=m.useState(!1),[x,N]=m.useState([]),[p,E]=m.useState(null),[I,$]=m.useState([]),[V]=m.useState(()=>{try{return new URLSearchParams(window.location.search).get("ct")}catch{return null}}),P=async()=>{if(V)try{await K.post("/api/homeowners/claim/ct-adopt",{token:V})}catch{}};m.useEffect(()=>{K.get((()=>{try{const D=new URLSearchParams(window.location.search).get("c");return"/api/neighborhood/official/public"+(D?"?c="+encodeURIComponent(D):"")}catch{return"/api/neighborhood/official/public"}})()).then(D=>N((D.posts||[]).slice(0,2))).catch(()=>{})},[]),m.useEffect(()=>{try{const D=new URLSearchParams(window.location.search).get("ct");if(!D)return;K.get(`/api/homeowners/claim/signin-hint?t=${encodeURIComponent(D)}`).then(R=>{R.hasPhone&&R.hint&&E(R.hint),R.hasPhone&&R.hints&&R.hints.length&&$(R.hints)}).catch(()=>{})}catch{}},[]);const G=async D=>{if(D.preventDefault(),!w){b(!0);try{const R=await K.post("/api/phone/send-code",{phone:u});if(R.alreadyVerified&&R.homeownerId){B.success("Welcome back!"),await P(),await l();return}if(R.alreadyVerified){B.error("Could not start your session. Please try again.");return}B("Code sent",{description:"Check your phone for a 6-digit code"}),r("code")}catch(R){const Z=R instanceof tt&&R.code==="rate_limited"?"Please wait 2 minutes before requesting another code.":R instanceof tt&&R.code==="invalid_phone_format"?"Please enter a valid 10-digit phone number.":"Couldn't send the code. Please try again.";B.error(Z)}finally{b(!1)}}},O=async D=>{if(D.preventDefault(),!w){b(!0);try{await K.post("/api/phone/verify-code",{phone:u,code:h}),B.success("Phone verified"),await P(),await l()}catch{B.error("That code didn't match. Please try again.")}finally{b(!1)}}};return a.jsx("div",{className:"min-h-screen w-full flex items-center justify-center px-4 py-8",children:a.jsxs("div",{className:"w-full max-w-[420px]",children:[x.length>0&&a.jsx("div",{className:"mb-4 space-y-3",children:x.map(D=>{const{text:R,videos:Z}=$r(D.body);return a.jsxs("div",{className:"rounded-3xl bg-card border p-4 shadow-[var(--shadow-warm)]",children:[a.jsxs("div",{className:"flex items-center gap-1.5 mb-1.5",children:[a.jsx(es,{className:"w-4 h-4 text-primary shrink-0","aria-hidden":"true"}),a.jsx("span",{className:"text-xs font-bold uppercase tracking-wide text-primary",children:D.author?.displayName||"DLM Property Management"})]}),D.title&&a.jsx("div",{className:"text-sm font-semibold mb-1",children:D.title}),R&&a.jsx("p",{className:"text-sm text-muted-foreground whitespace-pre-wrap",children:R}),Z.map(k=>a.jsx(Yr,{url:k,className:"mt-2"},k)),a.jsx("p",{className:"text-[11px] text-muted-foreground mt-2",children:"Sign in below to join and comment."})]},D.id)})}),a.jsx("div",{className:"rounded-3xl bg-card border overflow-hidden shadow-[var(--shadow-warm)]",children:a.jsxs("div",{className:"p-6 space-y-5",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(F
11a,{size:44,className:"shadow-[var(--shadow-warm)]"}),a.jsxs("div",{className:"leading-tight",children:[a.jsx("h1",{className:"text-2xl font-semibold tracking-tight font-display",children:"Neighborhood"}),a.jsx("p",{className:"text-[10px] uppercase tracking-[0.14em] text-muted-foreground",children:"Deals in your community"})]})]}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Know what deals are taking place in your community. Sign in with your phone number to join the people who live nearby."}),i==="phone"?a.jsxs("form",{onSubmit:G,className:"space-y-3",children:[p&&a.jsxs("div",{className:"rounded-2xl bg-accent/40 border px-4 py-2.5 text-xs text-accent-foreground space-y-1",children:[a.jsxs("div",{children:["Numbers we have on file for your home:"," ",a.jsx("span",{className:"font-semibold",children:(I.length?I:[p]).join(", ")})]}),a.jsx("div",{className:"text-[11px] opacity-80",children:"Enter whichever is yours, or the mobile you use today. Your home is claimed to you either way."})]}),a.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 rounded-2xl bg-muted/60 border focus-within:ring-2 focus-within:ring-primary/30",children:[a.jsx(Ja,{className:"w-4 h-4 text-muted-foreground shrink-0"}),a.jsx("input",{type:"tel",autoComplete:"tel",inputMode:"numeric",value:u,onChange:D=>f(D.target.value),placeholder:"(555) 555-1234",className:"flex-1 bg-transparent outline-none text-sm"})]}),a.jsx("button",{type:"submit",disabled:w||u.replace(/\D/g,"").length<10,className:"w-full py-3 rounded-2xl bg-primary text-primary-foreground font-medium text-sm disabled:opacity-50",children:w?"Sending…":"Continue"}),a.jsx("a",{href:"https://dealmate.ai/neighborhood-for-businesses.html",className:"block w-full text-center py-2 text-xs text-muted-foreground hover:text-foreground underline",children:"Own a business? See how it works"})]}):a.jsxs("form",{onSubmit:O,className:"space-y-3",children:[a.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 rounded-2xl bg-muted/60 border focus-within:ring-2 focus-within:ring-primary/30",children:[a.jsx(r1,{className:"w-4 h-4 text-muted-foreground shrink-0"}),a.jsx("input",{type:"text",inputMode:"numeric",autoComplete:"one-time-code",value:h,onChange:D=>g(D.target.value.replace(/\D/g,"").slice(0,6)),placeholder:"6-digit code",className:"flex-1 bg-transparent outline-none text-sm tracking-[0.3em]"})]}),a.jsx("button",{type:"submit",disabled:w||h.length<4,className:"w-full py-3 rounded-2xl bg-primary text-primary-foreground font-medium text-sm disabled:opacity-50",children:w?"Verifying…":"Verify"}),a.jsxs("button",{type:"button",onClick:()=>r("phone"),className:"w-full py-2 text-xs text-muted-foreground flex items-center justify-center gap-1 hover:text-foreground",children:[a.jsx(z0,{className:"w-3.5 h-3.5"})," Different number"]})]})]})}),a.jsx("p",{className:"text-center text-[11px] text-muted-foreground mt-4",children:"We'll text a one-time code to verify it's you. Standard rates may apply."}),a.jsx(Kl,{className:"pt-4"})]})})}function ov(){const{homeowner:l,needsAddress:i,refreshMe:r,signOut:u}=ot(),f=[l?.firstName,l?.lastName].filter(Boolean).join(" ").trim()||"",[h,g]=m.useState(i),[w,b]=m.useState(f),[x,N]=m.useState(""),[p,E]=m.useState(l?.city||""),[I,$]=m.useState(l?.state||""),[V,P]=m.useState(""),[G,O]=m.useState(!1),D=T=>{const A=T instanceof tt?T.code:"";return A==="unmappable_address"?"We couldn't place that address in a neighborhood yet. Please double-check it.":A==="no_address"?"We need your home address first. Please enter it below.":A==="banned"?"This account can't join the neighborhood. Contact support if you think this is a mistake.":"Couldn't join your neighborhood. Please try again."},R=async T=>{if(T.preventDefault(),!G){O(!0);try{const A=await K.post("/api/neighborhood/address",{address:x,city:p,state:I,zip:V,displayName:w.trim()||"Neighbor"});B.success(`Welcome to ${A.neighborhood.name}!`),await r()}catch(A){B.error(D(A))}finally{O(!1)}}},Z=async T=>{if(T.preventDefault(),!G){O(!0);try{const A=await K.post("/api/neighborhood/join",{displayName:w.trim()||"Neighbor"});B.success(`Welcome to ${A.neighborhood.name}!`),await r()}catch(A){A instanceof tt&&A.code==="no_address"&&g(!0),B.error(D(A))}finally{O(!1)}}},k="w-full px-4 py-2.5 rounded-xl bg-background border outline-none text-sm focus:ring-2 focus:ring-primary/30";return a.jsx("div",{className:"min-h-screen w-full flex items-center justify-center px-4 py-8",children:a.jsxs("form",{onSubmit:h?R:Z,className:"w-full max-w-[440px] rounded-3xl bg-card border p-6 shadow-[var(--shadow-warm)] space-y-5",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(F
11a,{size:44,className:"shadow-[var(--shadow-warm)]"}),a.jsxs("div",{className:"leading-tight",children:[a.jsx("h1",{className:"text-2xl font-semibold tracking-tight font-display",children:"Join your neighborhood"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:h?"Tell us where home is":"Set up how neighbors will see you"})]})]}),h?a.jsxs("div",{className:"space-y-2 rounded-2xl bg-accent/30 border border-accent p-4",children:[a.jsxs("p",{className:"text-xs font-medium flex items-center gap-1.5",children:[a.jsx(Ia,{className:"w-3.5 h-3.5"})," Tell neighbors what to call you."]}),a.jsx("input",{value:w,onChange:T=>b(T.target.value.slice(0,100)),placeholder:'Your name, e.g. "Maya Chen"',className:k,autoComplete:"name",required:!0}),a.jsxs("p",{className:"text-xs font-medium flex items-center gap-1.5 pt-1",children:[a.jsx(Xn,{className:"w-3.5 h-3.5"})," Where's home? We use your address to place you with your neighbors."]}),a.jsx("input",{value:x,onChange:T=>N(T.target.value),placeholder:"Street address, e.g. 12 Maple Lane",className:k,autoComplete:"street-address",required:!0}),a.jsxs("div",{className:"grid grid-cols-[1fr_64px_88px] gap-2",children:[a.jsx("input",{value:p,onChange:T=>E(T.target.value),placeholder:"City",className:k,autoComplete:"address-level2"}),a.jsx("input",{value:I,onChange:T=>$(T.target.value.toUpperCase().slice(0,2)),placeholder:"ST",maxLength:2,className:k,autoComplete:"address-level1"}),a.jsx("input",{value:V,onChange:T=>P(T.target.value.replace(/\D/g,"").slice(0,5)),placeholder:"Zip",inputMode:"numeric",className:k,autoComplete:"postal-code",required:!0})]})]}):a.jsxs("div",{className:"space-y-2 rounded-2xl bg-accent/30 border border-accent p-4",children:[a.jsxs("p",{className:"text-xs font-medium flex items-center gap-1.5",children:[a.jsx(Ia,{className:"w-3.5 h-3.5"})," Your neighbors are waiting. Tell them what to call you."]}),a.jsx("input",{value:w,onChange:T=>b(T.target.value.slice(0,100)),placeholder:'e.g. "Maya Chen" or "The Patels"',className:k,required:!0})]}),a.jsx("button",{type:"submit",disabled:G||(h?!w.trim()||!x.trim()||V.length<5:!w.trim()),className:"w-full py-3 rounded-2xl bg-primary text-primary-foreground font-medium text-sm disabled:opacity-50",children:G?"Joining…":"Join my neighborhood"}),a.jsx("button",{type:"button",onClick:u,className:"w-full text-xs text-muted-foreground hover:text-foreground",children:"Sign out"})]})})}const Ph=["bg-[oklch(0.88_0.06_38)] text-[oklch(0.32_0.09_38)]","bg-[oklch(0.88_0.05_145)] text-[oklch(0.30_0.08_145)]","bg-[oklch(0.89_0.05_70)] text-[oklch(0.32_0.08_55)]","bg-[oklch(0.87_0.06_20)] text-[oklch(0.32_0.10_20)]","bg-[oklch(0.88_0.05_220)] text-[oklch(0.30_0.08_240)]","bg-[oklch(0.89_0.05_300)] text-[oklch(0.32_0.08_310)]"];function cv(l){let i=0;for(let r=0;r<l.length;r++)i=i*31+l.charCodeAt(r)>>>0;return Ph[i%Ph.length]}function ut({name:l,initials:i,src:r,size:u=40,online:f,className:h=""}){const g=cv(l);return a.jsxs("span",{className:`relative inline-grid place-items-center rounded-full font-semibold tracking-tight overflow-hidden ${g} ${h}`,style:{width:u,height:u,fontSize:Math.round(u*.38)},children:[r?a.jsx("img",{src:r,alt:l,className:"w-full h-full object-cover"}):i,f&&a.jsx("span",{className:"absolute bottom-0 right-0 w-2.5 h-2.5 rounded-full bg-[var(--sage)] ring-2 ring-card"})]})}function Je(l){if(!l)return"";const i=new Date(l).getTime();if(Number.isNaN(i))return"";const r=Math.max(0,Math.floor((Date.now()-i)/1e3));if(r<60)return"now";const u=Math.floor(r/60);if(u<60)return`${u}m`;const f=Math.floor(u/60);if(f<24)return`${f}h`;const h=Math.floor(f/24);return h===1?"yesterday":h<7?`${h}d`:`${Math.floor(h/7)}w`}function Lu(l){const i=l%100===0;return(l/100).toLocaleString("en-US",{style:"currency",currency:"USD",minimumFractionDigits:i?0:2,maximumFractionDigits:i?0:2})}function dt(l){const i=(l||"").trim().split(/\s+/).filter(Boolean);return i.length?i.length===1?i[0].slice(0,2).toUpperCase():(i[0][0]+i[i.length-1][0]).toUpperCase():"?"}const pt="/neighborhood";function uv(l){switch(l.view){case"home":return`${pt}/`;case"post":return`${pt}/post/${l.id}`;case"market":return`${pt}/market`;case"listing":return`${pt}/market/${l.id}`;case"discover":return`${pt}/discover${l.sub?`/${l.sub}`:""}`;case"group":return`${pt}/group/${l.id}`;case"event":return`${pt}/event/${l.id}`;case"business":return`${pt}/business/${l.id}`;case"messages":return`${pt}/messages`;case"thread":return`${pt}/messages/${l.id}`;case"neighbors":return`${pt}/neighbors`;case"profile":return`${pt}/neighbors/${l.id}`;case"search":return`${pt}/search${l.q?`?q=${encodeURIComponent(l.q)}`:""}`;case"settings":return`${pt}/settings`;case"moderation":return`${pt}/moderation`;case"dlm":return`${pt}/dlm`}}
11function dv(l,i){let r=l.startsWith(pt)?l.slice(pt.length):l;r=r.replace(/\/+$/,"")||"/";const u=r.split("/").filter(Boolean),f=h=>{const g=parseInt(h||"",10);return Number.isFinite(g)&&g>0?g:null};if(u.length===0)return{view:"home"};switch(u[0]){case"post":{const h=f(u[1]);return h?{view:"post",id:h}:{view:"home"}}case"market":{const h=f(u[1]);return h?{view:"listing",id:h}:{view:"market"}}case"discover":{const h=u[1];return h==="groups"||h==="events"||h==="sale"||h==="recs"||h==="map"?{view:"discover",sub:h}:{view:"discover"}}case"group":{const h=f(u[1]);return h?{view:"group",id:h}:{view:"discover",sub:"groups"}}case"event":{const h=f(u[1]);return h?{view:"event",id:h}:{view:"discover",sub:"events"}}case"business":{const h=f(u[1]);return h?{view:"business",id:h}:{view:"discover",sub:"recs"}}case"messages":{const h=f(u[1]);return h?{view:"thread",id:h}:{view:"messages"}}case"neighbors":{const h=f(u[1]);return h?{view:"profile",id:h}:{view:"neighbors"}}case"search":return{view:"search",q:new URLSearchParams(i).get("q")||void 0};case"settings":return{view:"settings"};case"moderation":return{view:"moderation"};case"dlm":return{view:"dlm"};default:return{view:"home"}}}const Cu=new Set;function ep(){return dv(window.location.pathname,window.location.search)}function be(l,i){const r=uv(l);i?.replace?window.history.replaceState({},"",r):window.history.pushState({},"",r),Cu.forEach(u=>u(l))}function fv(){const[l,i]=m.useState(()=>ep());return m.useEffect(()=>{const r=()=>i(ep()),u=f=>i(f);return window.addEventListener("popstate",r),Cu.add(u),()=>{window.removeEventListener("popstate",r),Cu.delete(u)}},[]),l}const mv={home:{view:"home"},market:{view:"market"},discover:{view:"discover"},messages:{view:"messages"},neighbors:{view:"neighbors"}};function hv(l){switch(l.view){case"market":case"business":return"market";case"discover":case"group":case"event":case"listing":return"discover";case"messages":case"thread":return"messages";case"neighbors":case"profile":return"neighbors";default:return"home"}}function pv(l){be(mv[l])}const gv={home:"Your feed",market:"Local pros near you",discover:"Around you",messages:"Your conversations",neighbors:"The people nearby"};function _r({count:l,className:i=""}){return l<=0?null:a.jsx("span",{className:`min-w-[18px] h-[18px] px-1 rounded-full bg-destructive text-destructive-foreground text-[10px] font-semibold grid place-items-center tabular-nums ${i}`,children:l>99?"99+":l})}function xv({tab:l,onBell:i,onProfile:r}){const{member:u,neighborhood:f,unreadNotifications:h}=ot(),g=u?.displayName||"You";return a.jsxs("header",{className:"px-5 pt-6 pb-3 flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Fa,{size:40}),a.jsxs("div",{className:"leading-tight",children:[a.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:"Neighborhood"}),a.jsx("p",{className:"text-[10px] uppercase tracking-[0.14em] text-muted-foreground truncate max-w-[180px]",children:f?.name||gv[l]})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("button",{onClick:()=>be({view:"search"}),className:"w-10 h-10 rounded-full bg-card border grid place-items-center hover:bg-accent/40 transition","aria-label":"Search",children:a.jsx(Yn,{className:"w-4 h-4"})}),a.jsxs("button",{onClick:i,className:"relative w-10 h-10 rounded-full bg-card border grid place-items-center hover:bg-accent/40 transition","aria-label":"Notifications",children:[a.jsx(Br,{className:"w-4 h-4"}),a.jsx(_r,{count:h,className:"absolute -top-1 -right-1"})]}),a.jsx("button",{onClick:r||(()=>be({view:"settings"})),"aria-label":"Your profile and settings",className:"hover:opacity-80 transition",children:a.jsx(ut,{name:g,initials:dt(g),src:u?.avatarUrl,size:40})})]})]})}const tg=[{id:"home",label:"Home",icon:a.jsx(Xp,{className:"w-5 h-5"})},{id:"market",label:"Market",icon:a.jsx(Vt,{className:"w-5 h-5"})},{id:"discover",label:"Discover",icon:a.jsx(H0,{className:"w-5 h-5"})},{id:"messages",label:"Messages",icon:a.jsx(Fl,{className:"w-5 h-5"})},{id:"neighbors",label:"Neighbors",icon:a.jsx(Ia,{className:"w-5 h-5"})},{id:"mailbox",label:"Mailbox",icon:a.jsx(Lr,{className:"w-5 h-5"}),href:"/myhomeinbox/?as=resident"}];function sg(l){if(l.href){window.location.href=l.href;return}pv(l.id)}function yv({tab:l,onBell:i,onProfile:r}){const{member:u,neighborhood:f,unreadNotifications:h,dmUnread:g}=ot();return a.jsxs("aside",{className:"sticky top-8 self-start space-y-6",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(F
11a,{size:44,className:"shadow-[var(--shadow-warm)]"}),a.jsxs("div",{className:"leading-tight",children:[a.jsx("h1",{className:"text-2xl font-semibold tracking-tight font-display",children:"Neighborhood"}),a.jsx("p",{className:"text-[10px] uppercase tracking-[0.14em] text-muted-foreground truncate max-w-[150px]",children:f?.name||"Deals in your community"})]})]}),a.jsx("nav",{className:"space-y-1",children:tg.map(w=>{const b=l===w.id;return a.jsxs("button",{onClick:()=>sg(w),className:`w-full flex items-center gap-3 px-4 py-3 rounded-2xl text-sm font-medium transition ${b?"bg-primary text-primary-foreground shadow-[var(--shadow-warm)]":"text-foreground/80 hover:bg-accent/40"}`,children:[w.icon,a.jsx("span",{children:w.label}),w.id==="messages"&&a.jsx(_r,{count:g,className:"ml-auto"})]},w.id)})}),a.jsxs("button",{onClick:()=>be({view:"search"}),className:"w-full flex items-center gap-3 px-4 py-3 rounded-2xl border bg-card hover:bg-accent/40 transition text-sm",children:[a.jsx(Yn,{className:"w-4 h-4"})," Search"]}),a.jsxs("button",{onClick:i,className:"w-full flex items-center gap-3 px-4 py-3 rounded-2xl border bg-card hover:bg-accent/40 transition text-sm",children:[a.jsx(Br,{className:"w-4 h-4"})," Notifications",a.jsx(_r,{count:h,className:"ml-auto"})]}),a.jsx("button",{onClick:r||(()=>be({view:"settings"})),className:"w-full text-left rounded-3xl bg-card border p-4 shadow-sm hover:border-primary/40 transition",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(ut,{name:u?.displayName||"You",initials:dt(u?.displayName||"You"),src:u?.avatarUrl,size:40}),a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{className:"font-semibold text-sm truncate",children:u?.displayName||"You"}),a.jsx("div",{className:"text-xs text-muted-foreground truncate",children:f?.name||""})]})]})})]})}function bv({tab:l}){const{dmUnread:i}=ot();return a.jsx("nav",{className:"fixed bottom-3 left-1/2 -translate-x-1/2 w-[calc(100%-1.5rem)] max-w-[416px] z-40 lg:hidden",children:a.jsx("div",{className:"bg-card/95 backdrop-blur border rounded-full shadow-[var(--shadow-warm)] px-2 py-1.5 flex items-center justify-between",children:tg.map(r=>{const u=l===r.id;return a.jsxs("button",{onClick:()=>sg(r),className:`relative flex-1 flex flex-col items-center gap-0.5 py-1.5 rounded-full transition ${u?"text-primary-foreground bg-primary":"text-muted-foreground hover:text-foreground"}`,children:[a.jsxs("span",{className:"relative",children:[r.icon,r.id==="messages"&&a.jsx(_r,{count:i,className:"absolute -top-1.5 -right-2.5"})]}),a.jsx("span",{className:"text-[10px] font-semibold",children:r.label})]},r.id)})})})}function vv(l){if(l.refType==="post"&&l.refId){const i=Number(l.refId);if(Number.isFinite(i)&&i>0)return{view:"post",id:i}}if(l.refType==="page"&&l.refId){const i=Number(l.refId);if(Number.isFinite(i)&&i>0)return{view:"business",id:i}}return null}function Nv({open:l,onClose:i}){const{notifications:r,unreadNotifications:u,markAllNotificationsRead:f}=ot();return m.useEffect(()=>{if(!l)return;const h=g=>{g.key==="Escape"&&i()};return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[l,i]),l?a.jsxs("div",{className:"fixed inset-0 z-50",children:[a.jsx("button",{className:"absolute inset-0 bg-foreground
11/25 backdrop-blur-[2px]",onClick:i,"aria-label":"Close"}),a.jsxs("aside",{className:"absolute right-0 top-0 h-full w-full max-w-sm bg-card border-l shadow-[var(--shadow-warm)] flex flex-col animate-in slide-in-from-right duration-200",children:[a.jsxs("header",{className:"px-5 pt-5 pb-3 flex items-center justify-between border-b",children:[a.jsxs("div",{className:"flex items-center gap-2.5",children:[a.jsx("span",{className:"w-9 h-9 rounded-xl bg-accent/50 grid place-items-center",children:a.jsx(Br,{className:"w-4 h-4 text-primary"})}),a.jsxs("div",{className:"leading-tight",children:[a.jsx("h2",{className:"font-semibold font-display tracking-tight",children:"Notifications"}),a.jsx("p",{className:"text-[11px] text-muted-foreground",children:u>0?`${u} unread`:"You are all caught up"})]})]}),a.jsx("button",{onClick:i,className:"w-9 h-9 rounded-full hover:bg-muted grid place-items-center text-muted-foreground","aria-label":"Close notifications",children:a.jsx(We,{className:"w-4 h-4"})})]}),u>0&&a.jsx("div",{className:"px-5 py-2.5 border-b",children:a.jsxs("button",{onClick:f,className:"flex items-center gap-1.5 text-xs font-semibold text-primary hover:underline",children:[a.jsx(Il,{className:"w-3.5 h-3.5"})," Mark all read"]})}),a.jsxs("div",{className:"flex-1 overflow-y-auto p-3 space-y-1.5",children:[r.length===0&&a.jsx("p",{className:"text-sm text-muted-foreground text-center py-10",children:"Nothing yet. When neighbors react or reply, you will see it here."}),r.map(h=>{const g=vv(h),w=!h.readAt,b=a.jsxs(a.Fragment,{children:[a.jsx("span",{className:`mt-1.5 w-2 h-2 rounded-full shrink-0 ${w?"bg-primary":"bg-transparent"}`,"aria-hidden":!0}),a.jsxs("span",{className:"flex-1 min-w-0",children:[a.jsx("span",{className:`block text-sm leading-snug ${w?"font-medium":"text-foreground/80"}`,children:h.body}),a.jsx("span",{className:"block text-[11px] text-muted-foreground mt-0.5",children:Je(h.createdAt)})]})]}),x=`w-full flex items-start gap-2.5 px-3 py-2.5 rounded-2xl text-left transition ${w?"bg-accent/30 hover:bg-accent/45":"hover:bg-muted"}`;return g?a.jsx("button",{className:x,onClick:()=>{i(),be(g)},children:b},h.id):a.jsx("div",{className:x,children:b},h.id)})]})]})]}):null}function jv(){const{status:l,homeowner:i}=ot(),[r,u]=m.useState(!1),[f,h]=m.useState("optional"),[g,w]=m.useState(10),[b,x]=m.useState(0),[N,p]=m.useState([]),[E,I]=m.useState({}),[$,V]=m.useState(!1),[P,G]=m.useState(!0);if(m.useEffect(()=>{const Z=i?.id;l!=="ready"||!Z||Promise.all([fetch("/api/myhomeinbox/neighbors/progress",{credentials:"include"}).then(k=>k.json()),fetch("/api/myhomeinbox/platform-features",{credentials:"include"}).then(k=>k.json()).catch(()=>null)]).then(async([k,T])=>{const A=T&&T.features&&T.features.invitePrompt||"optional";if(A==="off"||(h(A==="required"?"required":"optional"),!k||!k.success))return;const se=(k.streetTotal||0)>0&&(k.streetClaimed||0)/k.streetTotal>=.5;if(!((k.invited||0)>0||k.rewarded||se)){w(k.threshold||10),x(k.claimed||0),u(!0);try{const Q=await(await fetch("/api/myhomeinbox/neighbors/invitable",{credentials:"include"})).json();if(Q&&Q.success){const te=Q.neighbors||[];p(te);const ne={};te.forEach(ie=>{ie.lastInvitedAt||(ne[ie.id]=!0)}),I(ne)}}catch{}G(!1)}}).catch(()=>{})},[l,i?.id]),!r)return null;const O=Object.keys(E).filter(Z=>E[Number(Z)]).map(Number),D=Math.min(100,Math.round(b/g*100)),R=async()=>{if(!O.length){B.error("Select at least one neighbor.");return}V(!0);try{const k=await(await fetch("/api/myhomeinbox/neighbors/invite",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({ids:O})})).json();k&&k.success?(B.success(k.sent>0?`Invited ${k.sent} neighbor${k.sent===1?"":"s"}. We'll text you as they claim.`:"Those neighbors were already invited recently."),u(!1)):k&&k.error==="daily_cap"?(B.error("You've reached today's invite limit. More tomorrow!"),u(!1)):B.error("Could not send invites. Please try again.")}catch{B.error("Could not send invites. Please try again.")}V(!1)};return a.jsxs("div",{className:"fixed inset-0 z-50 grid place-items-center p-4 overflow-y-auto",role:"dialog","aria-modal":"true",children:[a.jsx("div",{className:"absolute inset-0 bg-foreground
11/40",onClick:f==="optional"?()=>u(!1):void 0}),a.jsxs("div",{className:"relative w-full max-w-md rounded-3xl bg-card border shadow-[var(--shadow-warm)] p-5 my-8",children:[a.jsxs("div",{className:"flex items-start gap-2.5 mb-2",children:[a.jsx("span",{className:"w-9 h-9 rounded-xl bg-primary/15 grid place-items-center shrink-0 text-primary",children:a.jsx(Bu,{className:"w-4 h-4"})}),a.jsxs("div",{children:[a.jsx("h3",{className:"font-semibold font-display tracking-tight",children:"Bring your neighbors in"}),a.jsxs("p",{className:"text-xs text-muted-foreground mt-0.5",children:["When ",g," neighbors claim their mailboxes, yours is free forever. ",b>0?`${b} of ${g} so far.`:""]})]})]}),b>0&&a.jsx("div",{className:"h-2 rounded-full bg-muted overflow-hidden mb-3",children:a.jsx("div",{className:"h-full bg-primary",style:{width:D+"%"}})}),P?a.jsxs("div",{className:"animate-pulse space-y-2 my-3",children:[a.jsx("div",{className:"h-8 rounded-xl bg-muted"}),a.jsx("div",{className:"h-8 rounded-xl bg-muted"})]}):N.length===0?a.jsxs("div",{className:"my-3",children:[a.jsx("p",{className:"text-sm text-muted-foreground",children:"No invitable neighbors found for your street right now."}),a.jsx("button",{onClick:()=>u(!1),className:"mt-3 w-full px-4 py-2.5 rounded-full border bg-card text-xs font-medium",children:"Continue"})]}):a.jsx("div",{className:"max-h-56 overflow-y-auto space-y-1.5 my-3",children:N.map(Z=>a.jsxs("label",{className:"flex items-center gap-2.5 bg-muted/40 rounded-xl px-3 py-2 cursor-pointer",children:[a.jsx("input",{type:"checkbox",checked:!!E[Z.id],onChange:k=>I({...E,[Z.id]:k.target.checked}),className:"w-4 h-4 accent-[var(--primary)]"}),a.jsx("span",{className:"flex-1 min-w-0 text-sm font-medium truncate",children:Z.name}),a.jsx("span",{className:"text-[11px] text-muted-foreground shrink-0",children:Z.houseNumber?"#"+Z.houseNumber:""})]},Z.id))}),N.length>0&&!P&&a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("button",{onClick:R,disabled:$,className:"flex-1 px-4 py-2.5 rounded-full bg-primary text-primary-foreground text-xs font-semibold disabled:opacity-50",children:$?"Sending...":`Invite ${O.length||""} neighbor${O.length===1?"":"s"}`}),f==="optional"&&a.jsx("button",{onClick:()=>u(!1),className:"px-4 py-2.5 rounded-full border bg-card text-xs font-medium",children:"Maybe later"})]})]})]})}const wv=5,tp=2;function Sv(l,i){const r=l.slice(0,i),u=r.lastIndexOf("@");if(u<0||u>0&&!/\s/.test(r[u-1]))return null;const f=r.slice(u+1);return f.includes(`
12`)||f.length>60?null:{start:u,query:f}}function ag({value:l,onChange:i,mentions:r,onMentionsChange:u,placeholder:f,className:h,rows:g=2}){const[w,b]=m.useState([]),[x,N]=m.useState(null),p=m.useRef(null),E=m.useRef(null),I=G=>{const O=r.filter(D=>G.includes(`@${D.name}`));O.length!==r.length&&u(O)},$=()=>{const G=p.current;if(!G)return N(null);N(Sv(G.value,G.selectionStart??G.value.length))};m.useEffect(()=>{if(E.current&&window.clearTimeout(E.current),!x||x.query.trim().length<tp){b([]);return}const G=x.query.trim();return E.current=window.setTimeout(()=>{K.get(`/api/neighborhood/pages?q=${encodeURIComponent(G)}&limit=6`).then(O=>b(O.pages||[])).catch(()=>b([]))},250),()=>{E.current&&window.clearTimeout(E.current)}},[x?.query]);const V=G=>{const O=p.current;if(!O||!x)return;const D=O.selectionStart??l.length,R=`${l.slice(0,x.start)}@${G.name} ${l.slice(D)}`;i(R),!r.some(Z=>Z.pageId===G.id)&&r.length<wv&&u([...r,{pageId:G.id,name:G.name}]),N(null),b([]),requestAnimationFrame(()=>{O.focus();const Z=x.start+G.name.length+2;O.setSelectionRange(Z,Z)})},P=x!=null&&x.query.trim().length>=tp&&w.length>0;return a.jsxs("div",{className:"relative flex-1 min-w-0",children:[a.jsx("textarea",{ref:p,value:l,onChange:G=>{i(G.target.value),I(G.target.value),requestAnimationFrame($)},onKeyUp:$,onClick:$,onBlur:()=>window.setTimeout(()=>N(null),150),placeholder:f,className:h,rows:g}),P&&a.jsxs("div",{className:"absolute left-0 right-0 top-full mt-1 z-30 bg-card border rounded-2xl shadow-[var(--shadow-bubble)] p-1.5 max-h-56 overflow-y-auto",children:[a.jsx("div",{className:"px-2.5 py-1 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Tag a business"}),w.map(G=>a.jsxs("button",{type:"button",onMouseDown:O=>{O.preventDefault(),V(G)},className:"w-full flex items-center gap-2.5 px-2.5 py-2 rounded-xl hover:bg-muted text-left",children:[a.jsx("span",{className:"w-7 h-7 rounded-lg bg-primary/10 text-primary grid place-items-center shrink-0",children:a.jsx(Vt,{className:"w-3.5 h-3.5"})}),a.jsxs("span",{className:"min-w-0",children:[a.jsx("span",{className:"block text-xs font-semibold truncate",children:G.name}),a.jsxs("span",{className:"block text-[10px] text-muted-foreground truncate",children:[G.categoryName?`${G.categoryName} · `:"",G.recommendCount>0?`${G.recommendCount} neighbor recommendations`:"No recommendations yet"]})]})]},G.id))]})]})}const sp=6,fu=2,ap=6;let gr=null;function Cv(){return gr||(gr=K.get("/api/neighborhood/categories").then(l=>l.categories).catch(l=>{throw gr=null,l})),gr}const kv=[{id:"info",label:"Info"},{id:"advisory",label:"Advisory"},{id:"emergency",label:"Emergency"}];function ng({onPosted:l,groupId:i}){const{member:r,neighborhood:u}=ot(),f=r?.displayName||"You",[h,g]=m.useState(""),[w,b]=m.useState([]),[x,N]=m.useState([]),[p,E]=m.useState(null),[I,$]=m.useState([]),[V,P]=m.useState(!1),[G,O]=m.useState("advisory"),[D,R]=m.useState(!1),[Z,k]=m.useState(["",""]),[T,A]=m.useState(!1),[se,J]=m.useState(!1),Q=m.useRef(null),te=p!=null&&x.find(S=>S.id===p)?.slug==="recommendations";m.useEffect(()=>{let S=!0;return Cv().then(U=>S&&N(U)).catch(()=>{}),()=>{S=!1}},[]);const ne=S=>{S&&$(U=>{const le=[...U];
12for(const ue of Array.from(S)){if(le.length>=sp){B.error(`Up to ${sp} photos per post.`);break}ue.type.startsWith("image/")&&le.push({file:ue,preview:URL.createObjectURL(ue)})}return le})},ie=S=>{$(U=>(URL.revokeObjectURL(U[S].preview),U.filter((le,ue)=>ue!==S)))},ae=()=>{P(S=>(S||R(!1),!S))},C=()=>{R(S=>(S||P(!1),!S))},H=(S,U)=>k(le=>le.map((ue,pe)=>pe===S?U:ue)),re=()=>k(S=>S.length>=ap?S:[...S,""]),de=S=>k(U=>U.length<=fu?U:U.filter((le,ue)=>ue!==S)),xe=Z.map(S=>S.trim()).filter(Boolean),v=!T&&(D?h.trim().length>0&&xe.length>=fu:h.trim().length>0||I.length>0),j=async()=>{if(v){A(!0);try{let S=[];I.length&&(S=await Rr(I.map(le=>le.file)));const U=await K.post("/api/neighborhood/posts",{body:h.trim(),kind:D?"poll":V?"urgent":"post",...D?{pollOptions:xe}:{},...V?{severity:G}:{},...p?{categoryId:p}:{},...S.length?{mediaUrls:S}:{},...i?{groupId:i}:{},...w.length?{mentionPageIds:w.map(le=>le.pageId)}:{},...te&&se&&!i&&!D&&!V?{audience:"nearby"}:{}});l(U.post),I.forEach(le=>URL.revokeObjectURL(le.preview)),$([]),g(""),b([]),E(null),P(!1),O("advisory"),R(!1),k(["",""]),B.success(D?"Poll posted.":V?"Alert posted.":i?"Posted to the group.":"Posted to your neighborhood.")}catch(S){Cr(S)||B.error("Couldn't publish your post. Please try again.")}finally{A(!1)}}};return a.jsxs("section",{className:"rounded-3xl bg-card border p-4 shadow-sm",children:[a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx(ut,{name:f,initials:dt(f),src:r?.avatarUrl,size:36}),a.jsx(ag,{value:h,onChange:g,mentions:w,onMentionsChange:b,placeholder:te?"Ask your neighbors who to hire. They can tag businesses with @ in the replies.":i?"Share something with the group...":`Share something with ${u?.name||"your neighborhood"}...`,className:"w-full resize-none bg-transparent outline-none text-sm min-h-[44px] placeholder:text-muted-foreground",rows:2})]}),x.length>0&&a.jsx("div",{className:"flex flex-wrap gap-1.5 mt-2 pl-12",children:x.map(S=>{const U=p===S.id;return a.jsx("button",{onClick:()=>E(U?null:S.id),className:`px-3 py-1 rounded-full text-[11px] font-medium border transition ${U?"bg-primary text-primary-foreground border-primary":"bg-card text-muted-foreground hover:bg-accent/40"}`,children:S.label},S.id)})}),te&&!i&&!D&&!V&&a.jsx("div",{className:"mt-2 pl-12",children:a.jsx("button",{type:"button",onClick:()=>J(S=>!S),className:`px-3 py-1 rounded-full text-[11px] font-medium border transition ${se?"bg-primary text-primary-foreground border-primary":"bg-card text-muted-foreground hover:bg-accent/40"}`,"aria-pressed":se,children:"Also ask nearby neighborhoods"})}),I.length>0&&a.jsx("div",{className:"flex gap-2 mt-3 pl-12 flex-wrap",children:I.map((S,U)=>a.jsxs("div",{className:"relative",children:[a.jsx("img",{src:S.preview,alt:"",className:"w-16 h-16 rounded-xl object-cover border"}),a.jsx("button",{onClick:()=>ie(U),className:"absolute -top-1.5 -right-1.5 w-5 h-5 rounded-full bg-foreground text-background grid place-items-center","aria-label":"Remove photo",children:a.jsx(We,{className:"w-3 h-3"})})]},S.preview))}),D&&a.jsxs("div",{className:"mt-3 pl-12 space-y-1.5",children:[Z.map((S,U)=>a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("input",{value:S,onChange:le=>H(U,le.target.value),placeholder:`Option ${U+1}`,maxLength:80,className:"flex-1 bg-muted/60 rounded-xl px-3 py-2 text-sm outline-none focus:ring-2 focus:ring-primary/30 placeholder:text-muted-foreground"}),Z.length>fu&&a.jsx("button",{onClick:()=>de(U),className:"w-7 h-7 rounded-full hover:bg-muted grid place-items-center text-muted-foreground shrink-0","aria-label":`Remove option ${U+1}`,children:a.jsx(We,{className:"w-3.5 h-3.5"})})]},U)),Z.length<ap&&a.jsxs("button",{onClick:re,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-xl text-[11px] font-medium text-muted-foreground hover:bg-muted transition",children:[a.jsx(Qn,{className:"w-3.5 h-3.5"})," Add option"]})]}),V&&a.jsxs("div",{className:"mt-3 pl-12 flex items-center gap-1.5 flex-wrap",children:[a.jsx("span",{className:"text-[11px] font-medium text-muted-foreground mr-1",children:"Severity"}),kv.map(S=>{const U=G===S.id;return a.jsx("button",{onClick:()=>O(S.id),className:`px-3 py-1 rounded-full text-[11px] font-medium border transition ${U?S.id==="emergency"?"bg-destructive text-destructive-foreground border-destructive":"bg-primary text-primary-foreground border-primary":"bg-card text-muted-foreground hover:bg-accent/40"}`,children:S.label},S.id)})]}),a.jsxs("div",{className:"flex items-center justify-between mt-3 pt-3 border-t",children:[a.jsxs("div",{className:"flex items-center gap-1 text-muted-foreground",children:[a.jsx("input",{ref:Q,type:"file",accept:"image/*",multiple:!0,className:"hidden",onChange:S=>{ne(S.target.files),S.target.value=""}}),a.jsx("button",{onClick:()=>Q.current?.click(),className:"w-8 h-8 rounded-lg hover:bg-muted grid place-items-center","aria-label":"Add photos",children:a.jsx(Du,{className:"w-4 h-4"})}),a.jsxs("button",{onClick:C,className:`flex items-center gap-1.5 px-2.5 h-8 rounded-lg text-[11px] font-medium transition ${D?"bg-primary/10 text-primary":"hover:bg-muted"}`,"aria-pressed":D,children:[a.jsx(zu,{className:"w-4 h-4"})," Poll"]}),a.jsxs("button",{onClick:ae,className:`flex items-center gap-1.5 px-2.5 h-8 rounded-lg text-[11px] font-medium transition ${V?"bg-destructive/10 text-destructive":"hover:bg-muted"}`,"aria-pressed":V,children:[a.jsx(Uu,{className:"w-4 h-4"})," Urgent alert"]})]}),a.jsx("button",{onClick:j,disabled:!v,className:"px-4 py-2 rounded-full bg-primary text-primary-foreground text-xs font-semibold disabled:opacity-50 transition",children:T?"Posting...":D?"Post poll":V?"Post alert":"Post"})]})]})}function lg({text:l,mentions:i}){const r=i||[];if(!r.length||!l)return a.jsx(a.Fragment,{children:l});const u=[...r].sort((w,b)=>b.name.length-w.name.length),f=[];let h=l,g=0;for(;h;){let w=null;for(const x of u){const N=h.indexOf(`@${x.name}`);N>=0&&(w===null||N<w.idx)&&(w={idx:N,tag:x})}if(!w){f.push(h);break}w.idx>0&&f.push(h.slice(0,w.idx));const{tag:b}=w;f.push(a.jsxs("button",{type:"button",onClick:x=>{x.stopPropagation(),be({view:"business",id:b.pageId})},className:"text-primary font-semibold hover:underline",children:["@",b.name]},g++)),h=h.slice(w.idx+b.name.length+1)}return a.jsx(a.Fragment,{children:f})}function _v({postId:l,poll:i,onPollChange:r}){const[u,f]=m.useState(!1),h=i.options.reduce((b,x)=>b+x.voteCount,0),g=i.myOptionId!=null,w=async b=>{if(!(u||b===i.myOptionId)){f(!0);try{const x=await K.post(`/api/neighborhood/posts/${l}/vote`,{optionId:b});r(x.poll)}catch{B.error("Couldn't record your vote.")}finally{f(!1)}}};return a.jsxs("div",{className:"mt-3 rounded-2xl border bg-muted/30 p-3",children:[a.jsxs("div",{className:"flex items-center gap-1.5 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground mb-2",children:[a.jsx(zu,{className:"w-3.5 h-3.5"}),a.jsx("span",{children:"Poll"}),a.jsx("span",{className:"normal-case tracking-normal font-normal",children:h===1?"1 vote":`${h} votes`})]}),a.jsx("div",{className:"space-y-1.5",children:i.options.map(b=>{const x=b.id===i.myOptionId,N=h>0?Math.round(b.voteCount/h*100):0;return g?a.jsxs("button",{onClick:()=>w(b.id),disabled:u,className:`relative w-full text-left px-3.5 py-2 rounded-xl border overflow-hidden text-sm transition disabled:opacity-50 ${x?"border-primary/60 bg-card":"bg-card hover:border-primary/40"}`,"aria-pressed":x,children:[a.jsx("span",{className:`absolute inset-y-0 left-0 ${x?"bg-primary/20":"bg-muted"}`,style:{width:`${N}%`}}),a.jsxs("span",{className:"relative flex items-center gap-1.5",children:[a.jsx("span",{className:`flex-1 min-w-0 truncate ${x?"font-semibold":"font-medium"}`,children:b.label}),x&&a.jsx(Il,{className:"w-3.5 h-3.5 text-primary shrink-0","aria-label":"Your vote"}),a.jsxs("span",{className:"text-xs text-muted-foreground tabular-nums shrink-0",children:[N,"% (",b.voteCount,")"]})]})]},b.id):a.jsx("button",{onClick:()=>w(b.id),disabled:u,className:"w-full text-left px-3.5 py-2 rounded-xl border bg-card text-sm font-medium hover:border-primary/50 hover:bg-accent/30 transition disabled:opacity-50",children:b.label},b.id)})}),g&&a.jsx("p",{className:"mt-2 text-[11px] text-muted-foreground",children:"Tap another option to change your vote."})]})}const Ev=[{id:"uncivil",label:"Uncivil or hurtful"},{id:"discrimination",label:"Discrimination"},{id:"misinformation",label:"Misinformation"},{id:"spam",label:"Spam or scam"},{id:"unsafe",label:"Unsafe or dangerous"},{id:"privacy",label:"Private information"},{id:"other",label:"Something else"}],Tv={post:"post",comment:"comment",listing:"listing",message:"message",member:"neighbor",event:"event",group:"group"};function Vr({contentType:l,contentId:i,onClose:r}){const[u,f]=m.useState(null),[h,g]=m.useState(""),[w,b]=m.useState(!1);m.useEffect(()=>{const N=p=>{p.key==="Escape"&&r()};return document.addEventListener("keydown",N),()=>document.removeEventListener("keydown",N)},[r]);const x=async()=>
12{if(!(!u||w)){b(!0);try{(await K.post("/api/neighborhood/report",{contentType:l,contentId:i,reason:u,...h.trim()?{detail:h.trim()}:{}})).duplicate?B.info("You already reported this."):B.success("Thanks. A moderator will take a look."),r()}catch{B.error("Couldn't send your report. Please try again.")}finally{b(!1)}}};return a.jsxs("div",{className:"fixed inset-0 z-50 grid place-items-center p-4",children:[a.jsx("button",{className:"absolute inset-0 bg-foreground/25 backdrop-blur-[2px]",onClick:r,"aria-label":"Close"}),a.jsxs("div",{className:"relative w-full max-w-sm bg-card border rounded-3xl shadow-[var(--shadow-warm)] p-5 max-h-[85vh] overflow-y-auto",children:[a.jsxs("header",{className:"flex items-center justify-between mb-3",children:[a.jsxs("div",{className:"flex items-center gap-2.5",children:[a.jsx("span",{className:"w-9 h-9 rounded-xl bg-accent/50 grid place-items-center",children:a.jsx(Zn,{className:"w-4 h-4 text-primary"})}),a.jsxs("div",{className:"leading-tight",children:[a.jsxs("h2",{className:"font-semibold font-display tracking-tight",children:["Report this ",Tv[l]]}),a.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Only moderators will see your report."})]})]}),a.jsx("button",{onClick:r,className:"w-9 h-9 rounded-full hover:bg-muted grid place-items-center text-muted-foreground shrink-0","aria-label":"Close report form",children:a.jsx(We,{className:"w-4 h-4"})})]}),a.jsx("div",{className:"space-y-1",role:"radiogroup","aria-label":"Reason",children:Ev.map(N=>{const p=u===N.id;return a.jsxs("button",{onClick:()=>f(N.id),role:"radio","aria-checked":p,className:`w-full flex items-center gap-2.5 px-3 py-2.5 rounded-2xl text-left text-sm transition ${p?"bg-primary/10 text-primary font-semibold":"hover:bg-muted font-medium"}`,children:[a.jsx("span",{className:`w-4 h-4 rounded-full border-2 grid place-items-center shrink-0 ${p?"border-primary":"border-muted-foreground/40"}`,children:p&&a.jsx("span",{className:"w-2 h-2 rounded-full bg-primary"})}),N.label]},N.id)})}),a.jsx("textarea",{value:h,onChange:N=>g(N.target.value),placeholder:"Anything else a moderator should know? (optional)",rows:3,maxLength:500,className:"mt-3 w-full resize-none bg-muted/60 rounded-xl px-3 py-2 text-sm outline-none focus:ring-2 focus:ring-primary/30 placeholder:text-muted-foreground"}),a.jsxs("div",{className:"mt-3 flex items-center justify-end gap-2",children:[a.jsx("button",{onClick:r,className:"px-4 py-2 rounded-full bg-muted text-xs font-medium",children:"Cancel"}),a.jsx("button",{onClick:x,disabled:!u||w,className:"px-4 py-2 rounded-full bg-primary text-primary-foreground text-xs font-semibold disabled:opacity-50 transition",children:w?"Sending...":"Send report"})]})]})]})}function Av(l){return`${window.location.origin}/neighborhood/post/${l}`}function Mv(l){const i=l.author?.displayName||"A neighbor",r=(l.title||l.body||"").slice(0,120);return`${i} on Neighborhood: ${r}`}function Rv({post:l,onClose:i}){const r=Av(l.id),u=Mv(l),f=l.author?.displayName||"Neighborhood",h=typeof navigator<"u"&&!!navigator.share;m.useEffect(()=>{const N=p=>{p.key==="Escape"&&i()};return document.addEventListener("keydown",N),()=>document.removeEventListener("keydown",N)},[i]);const g=async()=>{try{await navigator.clipboard.writeText(r),B.success("Link copied"),i()}catch{B.error("Could not copy the link.")}},w=async()=>{try{await navigator.share({title:"Neighborhood",text:u,url:r}),i()}catch{}},b=N=>{window.open(N,"_blank","noopener"),i()},x=[...h?[{label:"Share via apps",icon:a.jsx(Fp,{className:"w-4 h-4"}),onClick:w}]:[],{label:"Copy link",icon:a.jsx(wu,{className:"w-4 h-4"}),onClick:g},{label:"Text message",icon:a.jsx(Fl,{className:"w-4 h-4"}),onClick:()=>b(`sms:?&body=${encodeURIComponent(`${u} ${r}`)}`)},{label:"Email",icon:a.jsx(Lr,{className:"w-4 h-4"}),onClick:()=>b(`mailto:?subject=${encodeURIComponent("From my Neighborhood feed")}&body=${encodeURIComponent(`${u}
13
14${r}`)}`)},{label:"Facebook",icon:a.jsx(K0,{className:"w-4 h-4"}),onClick:()=>b(`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(r)}`)},{label:"X",icon:a.jsx(X1,{className:"w-4 h-4"}),onClick:()=>b(`https://twitter.com/intent/tweet?text=${encodeURIComponent(u)}&url=${encodeURIComponent(r)}`)}];return a.jsxs("div",{className:"fixed inset-0 z-50 flex items-end lg:items-center justify-center",role:"dialog","aria-modal":"true",children:[a.jsx("button",{className:"absolute inset-0 bg-foreground
14/25 backdrop-blur-[2px]",onClick:i,"aria-label":"Close"}),a.jsxs("div",{className:"relative w-full lg:max-w-md bg-card border rounded-t-3xl lg:rounded-3xl shadow-[var(--shadow-bubble)] p-5 pb-7 lg:pb-5",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"font-semibold font-display tracking-tight text-lg",children:"Share this post"}),a.jsx("button",{onClick:i,className:"w-8 h-8 rounded-full hover:bg-muted grid place-items-center text-muted-foreground","aria-label":"Close share sheet",children:a.jsx(We,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"rounded-2xl bg-muted/50 border p-3 flex gap-3 items-start mb-4",children:[l.mediaUrls.length>0&&a.jsx("img",{src:l.mediaUrls[0],alt:"",className:"w-14 h-14 rounded-xl object-cover border shrink-0"}),a.jsxs("div",{className:"min-w-0",children:[a.jsx("p",{className:"text-sm leading-snug line-clamp-2",children:l.title||l.body}),a.jsxs("div",{className:"flex items-center gap-1.5 mt-1.5",children:[a.jsx(ut,{name:f,initials:dt(f),src:l.author?.avatarUrl,size:18}),a.jsx("span",{className:"text-[11px] text-muted-foreground truncate",children:f})]})]})]}),a.jsx("div",{className:"space-y-1",children:x.map(N=>a.jsxs("button",{onClick:N.onClick,className:"w-full flex items-center gap-3 px-3 py-2.5 rounded-xl hover:bg-muted text-left text-sm font-medium",children:[a.jsx("span",{className:"w-9 h-9 rounded-full bg-accent/50 grid place-items-center text-accent-foreground shrink-0",children:N.icon}),N.label]},N.label))})]})]})}const np=340,Ov=6,lp={info:"Info",advisory:"Advisory",emergency:"Emergency"};function zv(l){return l.kind==="urgent"||l.kind==="agency_alert"}function bs(l){return Number(l??0)>=2}function Bv({urls:l}){if(!l.length)return null;const i=l.length===1?"grid-cols-1":l.length===2||l.length===4?"grid-cols-2":"grid-cols-3";return a.jsx("div",{className:`mt-3 grid gap-1.5 ${i}`,children:l.slice(0,6).map(r=>a.jsx("img",{src:r,alt:"",loading:"lazy",className:`w-full rounded-2xl object-cover border ${l.length===1?"max-h-96":"aspect-square"}`},r))})}function qu({post:l,clamp:i=!0,onReact:r,onDelete:u,onOpenComments:f,onPollChange:h}){const{member:g,neighborhood:w}=ot(),[b,x]=m.useState(!1),[N,p]=m.useState(!1),[E,I]=m.useState(!1),[$,V]=m.useState(!1),[P,G]=m.useState(!1),O=m.useRef(null),D=!!(g&&l.author&&l.author.memberId===g.id),R=zv(l),Z=l.severity==="emergency";m.useEffect(()=>{if(!N)return;const te=ne=>{O.current&&!O.current.contains(ne.target)&&(p(!1),I(!1))};return document.addEventListener("mousedown",te),()=>document.removeEventListener("mousedown",te)},[N]);const{text:k,videos:T}=$r(l.body),A=i&&!b&&(k.length>np||k.split(`
15`).length>Ov),se=A?k.slice(0,np).trimEnd():k,J=l.kind==="business"?l.businessPage:null,Q=J?.name||l.author?.displayName||"Neighborhood";return a.jsxs("article",{className:`rounded-3xl bg-card border p-4 lg:p-5 shadow-sm ${R?Z?"border-l-4 border-l-destructive":"border-l-4 border-l-[oklch(0.72_0.15_70)]":""}`,children:[a.jsxs("header",{className:"flex items-center gap-3",children:[a.jsxs("button",{type:"button",onClick:()=>{l.kind==="official"?be({view:"dlm"}):J?be({view:"business",id:J.id}):l.author&&be({view:"profile",id:l.author.memberId})},disabled:l.kind!=="official"&&!J&&!l.author,className:"flex items-center gap-3 flex-1 min-w-0 text-left rounded-xl -m-1 p-1 hover:bg-muted/60 transition disabled:hover:bg-transparent","aria-label":l.kind==="official"?"View the DLM Property Management profile":J?`View the ${J.name} business page`:`View ${Q}'s profile`,children:[J?a.jsx("span",{className:"w-10 h-10 rounded-full bg-primary/10 text-primary grid place-items-center shrink-0",children:a.jsx(Vt,{className:"w-4.5 h-4.5"})}):a.jsx(ut,{name:Q,initials:dt(Q),src:l.author?.avatarUrl,size:40}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[a.jsx("span",{className:"text-sm font-semibold truncate",children:Q}),l.kind==="official"?a.jsxs("span",{className:"flex items-center gap-1 text-[10px] font-bold uppercase tracking-wide text-primary shrink-0",children:[a.jsx(es,{className:"w-3.5 h-3.5","aria-hidden":"true"})," Official"]}):l.author&&bs(l.author.verificationTier)&&a.jsx(es,{className:"w-3.5 h-3.5 text-primary shrink-0","aria-label":"Verified neighbor"})]}),a.jsxs("div",{className:"text-[11px] text-muted-foreground flex items-center gap-1.5 flex-wrap",children:[a.jsx("span",{children:Je(l.createdAt)}),l.editedAt&&a.jsx("span",{children:"(edited)"}),l.kind==="sponsored"&&a.jsx("span",{className:"uppercase tracking-wide",children:"Sponsored"}),J&&a.jsx("span",{className:"uppercase tracking-wide",children:"Business update"}),l.audience==="nearby"&&l.neighborhoodName&&w&&l.neighborhoodId!==w.id&&a.jsxs("span",{children:["from ",l.neighborhoodName]})]})]})]}),l.isPinned&&a.jsxs("span",{className:"flex items-center gap-1 text-[10px] font-semibold uppercase tracking-wide text-primary",children:[a.jsx(Ip,{className:"w-3 h-3"})," Pinned"]}),g&&a.jsxs("div",{className:"relative",ref:O,children:[a.jsx("button",{onClick:()=>{p(te=>!te),I(!1)},className:"w-8 h-8 rounded-full hover:bg-muted grid place-items-center text-muted-foreground","aria-label":"Post options",children:a.jsx(V0,{className:"w-4 h-4"})}),N&&a.jsx("div",{className:"absolute right-0 top-full mt-1 z-30 bg-card border rounded-2xl shadow-[var(--shadow-bubble)] p-1.5 w-44",children:D?E?a.jsxs("div",{className:"p-2",children:[a.jsx("p",{className:"text-xs font-medium mb-2",children:"Delete this post?"}),a.jsxs("div",{className:"flex gap-1.5",children:[a.jsx("button",{onClick:()=>{p(!1),I(!1),u()},className:"flex-1 px-2 py-1.5 rounded-lg bg-destructive text-destructive-foreground text-xs font-semibold",children:"Delete"}),a.jsx("button",{onClick:()=>I(!1),className:"flex-1 px-2 py-1.5 rounded-lg bg-muted text-xs font-medium",children:"Cancel"})]})]}):a.jsxs("button",{onClick:()=>I(!0),className:"w-full flex items-center gap-2 px-3 py-2 rounded-xl hover:bg-muted text-left text-xs font-medium text-destructive",children:[a.jsx(Wp,{className:"w-3.5 h-3.5"})," Delete post"]}):a.jsxs("button",{onClick:()=>{p(!1),V(!0)},className:"w-full flex items-center gap-2 px-3 py-2 rounded-xl hover:bg-muted text-left text-xs font-medium",children:[a.jsx(Zn,{className:"w-3.5 h-3.5"})," Report post"]})})]})]}),(R||l.categoryLabel)&&a.jsxs("div",{className:"mt-2.5 flex items-center gap-1.5 flex-wrap",children:[R&&a.jsxs("span",{className:`px-2.5 py-0.5 rounded-full text-[10px] font-semibold uppercase tracking-wide ${Z?"bg-destructive/10 text-destructive":"bg-[oklch(0.72_0.15_70_/_0.15)] text-[oklch(0.5_0.12_60)]"}`,children:[l.kind==="agency_alert"?"Agency alert":"Urgent",l.severity&&lp[l.severity]?` · ${lp[l.severity]}`:""]}),l.categoryLabel&&a.jsx("span",{className:"px-2.5 py-0.5 rounded-full bg-accent/50 text-accent-foreground text-[10px] font-semibold",children:l.categoryLabel})]}),l.title&&a.jsx("h3",{className:"mt-2.5 font-semibold font-display tracking-tight text-[16px]",children:l.title}),se&&a.jsxs("p",{className:`${l.title?"mt-1.5":"mt-2.5"} text-[15px] leading-relaxed whitespace-pre-wrap`,children:[a.jsx(lg,{text:se,mentions:l.mentions}),A&&a.jsxs(a.Fragment,{children:["... ",a.jsx("button",{onClick:()=>x(!0),className:"text-primary font-medium hover:underline",children:"See more"})]})]}),T.map(te=>a.jsx(Yr,{url:te,className:"mt-3"},te)),l.kind==="poll"&&l.poll&&a.jsx(_v,{postId:l.id,poll:l.poll,onPollChange:h||(()=>{})}),a.jsx(Bv,{urls:l.mediaUrls}),J&&a.jsxs("div",{className:"mt-3 flex items-center gap-2 flex-wrap",children:[J.phone&&a.jsxs("a",{href:`tel:+1${String(J.phone).replace(/\D/g,"").slice(-10)}`,className:"flex items-center gap-2 px-4 py-2 rounded-full bg-primary text-primary-foreground text-xs font-semibold transition",children:[a.jsx(Ja,{className:"w-3.5 h-3.5"})," Call"]}),a.jsxs("a",{href:"/myhomeinbox/?as=resident&tab=request",className:"flex items-center gap-2 px-4 py-2 rounded-full border bg-card text-xs font-semibold hover:bg-accent/40 transition",children:[a.jsx(Yp,{className:"w-3.5 h-3.5"})," Request service"]})]}),a.jsxs("footer",{className:"mt-3 pt-3 border-t flex items-center gap-1 text-xs text-muted-foreground",children:[a.jsxs("button",{onClick:r,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-full hover:bg-muted transition","aria-pressed":!!l.reactedByMe,children:[a.jsx(Ur,{className:`w-4 h-4 ${l.reactedByMe?"fill-primary text-primary":""}`}),a.jsx("span",{className:l.reactedByMe?"text-primary font-medium":"",children:l.reactionCount})]}),a.jsxs("button",{onClick:f,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-full hover:bg-muted transition",disabled:!f,children:[a.jsx(qr,{className:"w-4 h-4"}),a.jsx("span",{children:l.commentCount})]}),a.jsxs("button",{onClick:()=>G(!0),className:"ml-auto flex items-center gap-1.5 px-3 py-1.5 rounded-full hover:bg-muted transition","aria-label":"Share this post",children:[a.jsx(Fp,{className:"w-4 h-4"}),a.jsx("span",{children:"Share"})]})]}),$&&a.jsx(Vr,{contentType:"post",contentId:l.id,onClose:()=>V(!1)}),P&&a.jsx(Rv,{post:l,onClose:()=>G(!1)})]})}function ig({slot:l}){const i=m.useRef(!1);m.useEffect(()=>{i.current||(i.current=!0,K.post(`/api/neighborhood/sponsored/${l.campaignId}/track`,{kind:"impression"}).catch(()=>{}))},[l.campaignId]);const r=()=>{K.post(`/api/neighborhood/sponsored/${l.campaignId}/track`,{kind:"click"}).catch(()=>{}),l.ctaUrl&&window.open(l.ctaUrl,"_blank","noopener,noreferrer")};return a.jsxs("article",{className:"rounded-3xl bg-card border p-4 lg:p-5 shadow-sm",children:[a.jsx("div",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:"Sponsored"}),a.jsx("div",{className:"text-sm font-semibold mt-1",children:l.businessName}),a.jsx("h3",{className:"mt-1.5 font-semibold font-display tracking-tight text-[16px]",children:l.headline}),l.body&&a.jsx("p",{className:"mt-1 text-[15px] leading-relaxed whitespace-pre-wrap",children:l.body}),l.mediaUrl&&a.jsx("img",{src:l.mediaUrl,alt:"",loading:"lazy",className:"mt-3 w-full rounded-2xl object-cover border max-h-72"}),l.ctaUrl&&a.jsx("div",{className:"mt-3",children:a.jsxs("button",{onClick:r,className:"inline-flex items-center gap-1.5 px-4 py-2 rounded-full bg-primary text-primary-foreground text-xs font-semibold transition",children:[l.ctaLabel||"Learn more",a.jsx(Gp,{className:"w-3.5 h-3.5"})]})})]})}function Jl({rating:l,size:i=14,className:r=""}){const u=Math.round(Number(l)||0);return a.jsx("span",{className:`inline-flex items-center gap-0.5 ${r}`,"aria-label":l!=null?`${Number(l).toFixed(1)} out of 5`:"Not rated yet",children:[1,2,3,4,5].map(f=>a.jsx(Hr,{style:{width:i,height:i},className:f<=u?"fill-[oklch(0.72_0.15_70)] text-[oklch(0.72_0.15_70)]":"text-muted-foreground
15/40"},f))})}function Dv({value:l,onChange:i}){return a.jsxs("div",{className:"flex items-center gap-1",children:[[1,2,3,4,5].map(r=>a.jsx("button",{type:"button",onClick:()=>i(l===r?null:r),className:"w-8 h-8 grid place-items-center rounded-full hover:bg-muted transition","aria-label":`${r} star${r===1?"":"s"}`,"aria-pressed":l!=null&&r<=l,children:a.jsx(Hr,{className:`w-5 h-5 ${l!=null&&r<=l?"fill-[oklch(0.72_0.15_70)] text-[oklch(0.72_0.15_70)]":"text-muted-foreground/50"}`})},r)),a.jsx("span",{className:"text-[11px] text-muted-foreground ml-1",children:l?`${l}/5`:"Optional"})]})}function Uv({pages:l}){return a.jsxs("section",{className:"rounded-3xl bg-card border p-4 shadow-sm",children:[a.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground mb-2.5",children:"Neighbors recommend"}),a.jsx("div",{className:"space-y-1.5",children:l.map(i=>{const r=i.avgRating??i.platformRating??null;return a.jsxs("div",{className:"flex items-center gap-2.5 rounded-2xl hover:bg-muted/60 transition px-1.5 py-1.5",children:[a.jsxs("button",{onClick:()=>be({view:"business",id:i.id}),className:"flex items-center gap-2.5 flex-1 min-w-0 text-left",children:[a.jsx("span",{className:"w-9 h-9 rounded-xl bg-primary/10 text-primary grid place-items-center shrink-0",children:a.jsx(Vt,{className:"w-4 h-4"})}),a.jsxs("span",{className:"min-w-0",children:[a.jsx("span",{className:"block text-sm font-semibold truncate",children:i.name}),a.jsxs("span",{className:"flex items-center gap-1.5 text-[11px] text-muted-foreground",children:[r!=null&&a.jsx(Jl,{rating:r,size:11}),a.jsx("span",{className:"truncate",children:i.recommendCount>0?i.recommendCount===1?"1 neighbor recommendation":`${i.recommendCount} neighbor recommendations`:i.categoryName||"Local pro"})]})]})]}),i.phone&&a.jsxs("a",{href:`tel:+1${String(i.phone).replace(/\D/g,"").slice(-10)}`,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-full bg-primary text-primary-foreground text-[11px] font-semibold shrink-0",children:[a.jsx(Ja,{className:"w-3 h-3"})," Call"]})]},i.id)})})]})}const ip=20,rg="nbh_dismissed_alerts";function ku(){try{return new Set(JSON.parse(sessionStorage.getItem(rg)||"[]"))}catch{return new Set}}function Lv(l){const i=ku();i.add(l);try{sessionStorage.setItem(rg,JSON.stringify([...i]))}catch{}}function qv(){const{neighborhood:l}=ot(),[i,r]=m.useState([]),[u,f]=m.useState(!1),[h,g]=m.useState(!1),[w,b]=m.useState(!1),[x,N]=m.useState([]),[p,E]=m.useState(null),[I,$]=m.useState([]),[V,P]=m.useState(()=>ku());m.useEffect(()=>{K.get(`/api/neighborhood/feed?limit=${ip}`).then(k=>{r(k.posts),f(k.hasMore),E(k.sponsored||null),$(k.popularBusinesses||[])}).catch(()=>B.error("Couldn't load the feed.")).finally(()=>g(!0)),K.get("/api/neighborhood/feed/alerts").then(k=>N(k.alerts)).catch(()=>{})},[]),m.useEffect(()=>{const k=Js(),T=({post:ne})=>r(ie=>ie.some(ae=>ae.id===ne.id)?ie:[ne,...ie]),A=({postId:ne})=>{r(ie=>ie.filter(ae=>ae.id!==ne)),N(ie=>ie.filter(ae=>ae.id!==ne))},se=({postId:ne,reactionCount:ie})=>r(ae=>ae.map(C=>C.id===ne?{...C,reactionCount:ie}:C)),J=({postId:ne,commentCount:ie})=>r(ae=>ae.map(C=>C.id===ne?{...C,commentCount:ie}:C)),Q=({postId:ne,commentCount:ie})=>r(ae=>ae.map(C=>C.id===ne?{...C,commentCount:ie}:C)),te=({postId:ne,poll:ie})=>r(ae=>ae.map(C=>C.id===ne&&C.poll?{...C,poll:{...C.poll,options:ie.options}}:C));return k.on("post:new",T),k.on("post:removed",A),k.on("reaction:update",se),k.on("comment:new",J),k.on("comment:removed",Q),k.on("poll:update",te),()=>{k.off("post:new",T),k.off("post:removed",A),k.off("reaction:update",se),k.off("comment:new",J),k.off("comment:removed",Q),k.off("poll:update",te)}},[]);const G=m.useCallback(async()=>{if(!(w||!i.length)){b(!0);try{const k=i[i.length-1],T=await K.get(`/api/neighborhood/feed?before=${encodeURIComponent(k.id)}&limit=${ip}`);r(A=>{const se=new Set(A.map(J=>J.id));return[...A,...T.posts.filter(J=>!se.has(J.id))]}),f(T.hasMore)}catch{B.error("Couldn't load more posts.")}finally{b(!1)}}},[w,i]),O=async k=>{r(T=>T.map(A=>A.id===k?{...A,reactedByMe:!A.reactedByMe,reactionCount:A.reactionCount+(A.reactedByMe?-1:1)}:A));try{const T=await K.post(`/api/neighborhood/posts/${k}/react`);r(A=>A.map(se=>se.id===k?{...se,reactedByMe:T.reacted,reactionCount:T.reactionCount}:se))}catch{r(T=>T.map(A=>A.id===k?{...A,reactedByMe:!A.reactedByMe,reactionCount:A.reactionCount+(A.reactedByMe?-1:1)}:A)),B.error("Couldn't update your reaction.")}},D=async k=>{const T=i;r(A=>A.filter(se=>se.id!==k));try{await K.del(`/api/neighborhood/posts/${k}`),B.success("Post deleted.")}catch{r(T),B.error("Couldn't delete the post.")}},R=k=>{Lv(k),P(ku())},Z=x.filter(k=>!V.has(k.id));return a.jsxs("div",{className:"space-y-4 pb-6",children:[Z.map(k=>{const T=k.severity==="emergency";return a.jsx("section",{className:`rounded-3xl border p-4 shadow-sm ${T?"bg-destructive/10 border-destructive/40":"bg-[oklch(0.72_0.15_70_/_0.12)] border-[oklch(0.72_0.15_70_/_0.4)]"}`,children:a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx("span",{className:`w-9 h-9 rounded-xl grid place-items-center shrink-0 ${T?"bg-destructive text-destructive-foreground":"bg-[oklch(0.72_0.15_70)] text-white"}`,children:a.jsx(Uu,{className:"w-4 h-4"})}),a.jsxs("button",{onClick:()=>
15be({view:"post",id:Number(k.id)}),className:"flex-1 min-w-0 text-left",children:[a.jsxs("div",{className:"flex items-center gap-2 text-[10px] font-semibold uppercase tracking-wide",children:[a.jsx("span",{className:T?"text-destructive":"text-[oklch(0.5_0.12_60)]",children:k.kind==="agency_alert"?"Agency alert":"Urgent"}),a.jsx("span",{className:"text-muted-foreground normal-case tracking-normal font-normal",children:Je(k.createdAt)})]}),k.title&&a.jsx("div",{className:"font-semibold text-sm mt-0.5 truncate",children:k.title}),a.jsx("p",{className:"text-sm text-foreground/90 mt-0.5 line-clamp-2",children:k.body})]}),a.jsx("button",{onClick:()=>R(k.id),className:"w-7 h-7 rounded-full hover:bg-foreground/10 grid place-items-center text-muted-foreground shrink-0","aria-label":"Dismiss alert",children:a.jsx(We,{className:"w-4 h-4"})})]})},k.id)}),a.jsx(ng,{onPosted:k=>r(T=>T.some(A=>A.id===k.id)?T:[k,...T])}),h&&i.length===0&&a.jsxs("section",{className:"rounded-3xl bg-card border p-6 text-center shadow-sm",children:[a.jsx("div",{className:"mx-auto w-12 h-12 rounded-2xl bg-accent/50 grid place-items-center mb-3",children:a.jsx(S1,{className:"w-5 h-5 text-primary"})}),a.jsxs("h3",{className:"font-semibold font-display tracking-tight",children:["Quiet in ",l?.name||"your neighborhood"," so far"]}),a.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Be the first to share something with your neighbors."})]}),i.map((k,T)=>a.jsxs("div",{className:"space-y-4",children:[a.jsx(qu,{post:k,onReact:()=>O(k.id),onDelete:()=>D(k.id),onOpenComments:()=>be({view:"post",id:Number(k.id)}),onPollChange:A=>r(se=>se.map(J=>J.id===k.id?{...J,poll:A}:J))}),p&&(T===2||i.length<3&&T===i.length-1)&&a.jsx(ig,{slot:p}),I.length>0&&(T===5||i.length<6&&T===i.length-1)&&a.jsx(Uv,{pages:I})]},k.id)),u&&a.jsx("button",{onClick:G,disabled:w,className:"w-full py-3 rounded-3xl bg-card border text-sm font-medium text-muted-foreground hover:bg-accent/40 transition disabled:opacity-50 shadow-sm",children:w?"Loading...":"Load more"})]})}const rp=2;function Hv(){window.history.length>1?window.history.back():be({view:"home"})}function $v({id:l}){const{member:i}=ot(),r=String(l),[u,f]=m.useState(null),[h,g]=m.useState([]),[w,b]=m.useState([]),[x,N]=m.useState([]),[p,E]=m.useState(!1),[I,$]=m.useState(!1),[V,P]=m.useState(""),[G,O]=m.useState([]),[D,R]=m.useState([]),[Z,k]=m.useState(null),[T,A]=m.useState(!1),[se,J]=m.useState(null),Q=m.useRef(null);m.useEffect(()=>{let v=!0;return E(!1),$(!1),f(null),g([]),b([]),N([]),k(null),K.get(`/api/neighborhood/posts/${r}`).then(j=>{v&&(f(j.post),g(j.comments),b(j.suggestedPages||[]),N(j.myRecommendedPageIds||[]))}).catch(()=>v&&$(!0)).finally(()=>v&&E(!0)),()=>{v=!1}},[r]),m.useEffect(()=>{const v=Js(),j=({postId:pe,comment:ye,commentCount:je})=>{pe===r&&(g(Ue=>Ue.some(gt=>gt.id===ye.id)?Ue:[...Ue,ye]),f(Ue=>Ue&&{...Ue,commentCount:je}))},S=({postId:pe,commentId:ye,commentCount:je})=>{pe===r&&(g(Ue=>Ue.filter(gt=>gt.id!==ye)),f(Ue=>Ue&&{...Ue,commentCount:je}))},U=({postId:pe,reactionCount:ye})=>{pe===r&&f(je=>je&&{...je,reactionCount:ye})},le=({postId:pe})=>{pe===r&&(B.info("This post was removed."),be({view:"home"},{replace:!0}))},ue=({postId:pe,poll:ye})=>{pe===r&&f(je=>je&&je.poll?{...je,poll:{...je.poll,options:ye.options}}:je)};return v.on("comment:new",j),v.on("comment:removed",S),v.on("reaction:update",U),v.on("post:removed",le),v.on("poll:update",ue),()=>{v.off("comment:new",j),v.off("comment:removed",S),v.off("reaction:update",U),v.off("post:removed",le),v.off("poll:update",ue)}},[r]);const te=m.useMemo(()=>{const v=new Map;for(const S of h){if(!S.parentCommentId)continue;const U=v.get(S.parentCommentId)||[];U.push(S),v.set(S.parentCommentId,U)}const j=S=>{const U=[],le=ue=>{for(const pe of v.get(ue)||[])U.push(pe),le(pe.id)};return le(S),U};return h.filter(S=>!S.parentCommentId).map(S=>({comment:S,replies:j(S.id)}))},[h]),ne=async()=>{if(u){f(v=>v&&{...v,reactedByMe:!v.reactedByMe,reactionCount:v.reactionCount+(v.reactedByMe?-1:1)});try{const v=await K.post(`/api/neighborhood/posts/${r}/react`);f(j=>j&&{...j,reactedByMe:v.reacted,reactionCount:v.reactionCount})}catch{f(v=>v&&{...v,reactedByMe:!v.reactedByMe,reactionCount:v.reactionCount+(v.reactedByMe?-1:1)}),B.error("Couldn't update your reaction.")}}},ie=async()=>{try{await K.del(`/api/neighborhood/posts/${r}`),B.success("Post deleted."),be({view:"home"},{replace:!0})}catch{B.error("Couldn't delete the post.")}},ae=v=>{v&&R(j=>{const S=[...j];for(const U of Array.from(v)){if(S.length>=rp){B.error(`Up to ${rp} photos per comment.`);break}
15U.type.startsWith("image/")&&S.push({file:U,preview:URL.createObjectURL(U)})}return S})},C=v=>{R(j=>(URL.revokeObjectURL(j[v].preview),j.filter((S,U)=>U!==v)))},H=async()=>{if(!(T||!V.trim()&&!D.length)){A(!0);try{let v=[];D.length&&(v=await Rr(D.map(S=>S.file)));const j=await K.post(`/api/neighborhood/posts/${r}/comments`,{body:V.trim(),...Z?{parentCommentId:Z.id}:{},...v.length?{mediaUrls:v}:{},...G.length?{mentionPageIds:G.map(S=>S.pageId)}:{}});g(S=>S.some(U=>U.id===j.comment.id)?S:[...S,j.comment]),f(S=>S&&{...S,commentCount:j.commentCount}),j.comment.mentions.length&&b(S=>{const U=[...S];for(const le of j.comment.mentions){const ue=U.find(pe=>pe.pageId===le.pageId);ue?ue.mentionCount+=1:U.push({pageId:le.pageId,name:le.name,mentionCount:1,recommendCount:0,avgRating:null,isClaimed:!1})}return U}),D.forEach(S=>URL.revokeObjectURL(S.preview)),R([]),P(""),O([]),k(null)}catch(v){Cr(v)||B.error("Couldn't add your comment.")}finally{A(!1)}}},re=async v=>{const j=h;g(S=>S.filter(U=>U.id!==v));try{const S=await K.del(`/api/neighborhood/comments/${v}`);f(U=>U&&{...U,commentCount:S.commentCount})}catch{g(j),B.error("Couldn't delete the comment.")}},de=v=>{k(v)},xe=async(v,j,S)=>{N(U=>U.includes(v.pageId)?U:[...U,v.pageId]);try{await K.post(`/api/neighborhood/pages/${v.pageId}/recommend`,{rating:j,body:S||"Recommended in a neighborhood conversation.",sourcePostId:r}),B.success(`You recommended ${v.name}.`)}catch(U){N(le=>le.filter(ue=>ue!==v.pageId)),Cr(U)||B.error("Couldn't save your recommendation.")}};return a.jsxs("div",{className:"space-y-4 pb-6",children:[a.jsxs("button",{onClick:Hv,className:"flex items-center gap-2 text-sm font-medium text-muted-foreground hover:text-foreground transition",children:[a.jsx(At,{className:"w-4 h-4"})," Back"]}),!p&&a.jsxs("section",{className:"rounded-3xl bg-card border p-6 shadow-sm animate-pulse",children:[a.jsx("div",{className:"h-4 w-1/3 rounded bg-muted"}),a.jsx("div",{className:"h-3 w-2/3 rounded bg-muted mt-3"}),a.jsx("div",{className:"h-3 w-1/2 rounded bg-muted mt-2"})]}),p&&(I||!u)&&a.jsxs("section",{className:"rounded-3xl bg-card border p-6 text-center shadow-sm",children:[a.jsx("h3",{className:"font-semibold font-display tracking-tight",children:"This post is no longer available"}),a.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"It may have been removed by its author."})]}),u&&a.jsxs(a.Fragment,{children:[a.jsx(qu,{post:u,clamp:!1,onReact:ne,onDelete:ie,onPollChange:v=>f(j=>j&&{...j,poll:v})}),w.length>0&&a.jsxs("section",{className:"rounded-3xl bg-card border p-4 shadow-sm",children:[a.jsx("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground mb-2.5",children:"Neighbors suggested"}),a.jsx("div",{className:"flex flex-wrap gap-2",children:w.map(v=>a.jsxs("button",{onClick:()=>be({view:"business",id:v.pageId}),className:"flex items-center gap-2 pl-2.5 pr-3 py-1.5 rounded-full border bg-card hover:bg-accent/40 transition",children:[a.jsx("span",{className:"w-6 h-6 rounded-lg bg-primary/10 text-primary grid place-items-center shrink-0",children:a.jsx(Vt,{className:"w-3.5 h-3.5"})}),a.jsx("span",{className:"text-xs font-semibold",children:v.name}),v.mentionCount>1&&a.jsxs("span",{className:"text-[10px] text-muted-foreground",children:[v.mentionCount," neighbors"]}),v.avgRating!=null&&a.jsxs("span",{className:"flex items-center gap-0.5 text-[10px] text-muted-foreground",children:[a.jsx(Hr,{className:"w-3 h-3 fill-[oklch(0.8_0.15_85)] text-[oklch(0.8_0.15_85)]"}),v.avgRating.toFixed(1)]})]},v.pageId))})]}),a.jsxs("section",{className:"rounded-3xl bg-card border p-4 lg:p-5 shadow-sm",children:[a.jsx("h4",{className:"text-sm font-semibold mb-3",children:u.commentCount===1?"1 comment":`${u.commentCount} comments`}),te.length===0&&a.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"No comments yet. Say something to your neighbors."}),a.jsx("div",{className:"space-y-3",children:te.map(({comment:v,replies:j})=>a.jsxs("div",{children:[a.jsx(op,{comment:v,mine:v.author.memberId===i?.id,myRecommended:x,onRecommend:xe,onReply:()=>de(v),onDelete:()=>re(v.id),onReport:()=>J(v)}),j.length>0&&a.jsx("div",{className:"ml-9 mt-2 space-y-2 border-l-2 border-border/70 pl-3",children:j.map(S=>a.jsx(op,{comment:S,mine:S.author.memberId===i?.id,myRecommended:x,onRecommend:xe,onReply:()=>de(S),onDelete:()=>re(S.id),onReport:()=>J(S)},S.id))})]},v.id))}),a.jsxs("div",{className:"mt-4 pt-3 border-t",children:[Z&&a.jsxs("div",{className:"flex items-center gap-2 mb-2 text-xs text-muted-foreground",children:[a.jsxs("span",{children:["Replying to ",a.jsx("span",{className:"font-semibold text-foreground",children:Z.author.displayName})]}),a.jsx("button",{onClick:()=>k(null),className:"w-5 h-5 rounded-full hover:bg-muted grid place-items-center","aria-label":"Cancel reply",children:a.jsx(We,{className:"w-3 h-3"})})]}),D.length>0&&a.jsx("div",{className:"flex gap-2 mb-2 flex-wrap",children:D.map((v,j)=>a.jsxs("div",{className:"relative",children:[a.jsx("img",{src:v.preview,alt:"",className:"w-14 h-14 roun
15ded-xl object-cover border"}),a.jsx("button",{onClick:()=>C(j),className:"absolute -top-1.5 -right-1.5 w-5 h-5 rounded-full bg-foreground text-background grid place-items-center","aria-label":"Remove photo",children:a.jsx(We,{className:"w-3 h-3"})})]},v.preview))}),a.jsxs("form",{onSubmit:v=>{v.preventDefault(),H()},className:"flex items-end gap-2",children:[a.jsx("input",{ref:Q,type:"file",accept:"image/*",multiple:!0,className:"hidden",onChange:v=>{ae(v.target.files),v.target.value=""}}),a.jsx("button",{type:"button",onClick:()=>Q.current?.click(),className:"w-9 h-9 rounded-full hover:bg-muted grid place-items-center text-muted-foreground shrink-0","aria-label":"Add photos",children:a.jsx(Du,{className:"w-4 h-4"})}),a.jsx(ag,{value:V,onChange:P,mentions:G,onMentionsChange:O,placeholder:Z?`Reply to ${Z.author.displayName}...`:"Add a comment... use @ to tag a business",className:"w-full bg-muted/60 rounded-2xl px-4 py-2 text-sm outline-none focus:ring-2 focus:ring-primary/30 resize-none",rows:1}),a.jsx("button",{type:"submit",disabled:T||!V.trim()&&!D.length,className:"w-9 h-9 rounded-full bg-primary text-primary-foreground grid place-items-center disabled:opacity-50 shrink-0","aria-label":"Send comment",children:a.jsx(Vn,{className:"w-4 h-4"})})]})]})]}),se&&a.jsx(Vr,{contentType:"comment",contentId:se.id,onClose:()=>J(null)})]})]})}function op({comment:l,mine:i,myRecommended:r,onRecommend:u,onReply:f,onDelete:h,onReport:g}){const[w,b]=m.useState(!1),x=l.author.displayName,N=i?(l.mentions||[]).filter(p=>!r.includes(p.pageId)):[];return a.jsxs("div",{className:"flex items-start gap-2.5",children:[a.jsx(ut,{name:x,initials:dt(x),src:l.author.avatarUrl,size:28}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"bg-muted/60 rounded-2xl px-3 py-2",children:[a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("span",{className:"text-xs font-semibold truncate",children:x}),bs(l.author.verificationTier)&&a.jsx(es,{className:"w-3 h-3 text-primary shrink-0","aria-label":"Verified neighbor"}),a.jsx("span",{className:"text-[10px] text-muted-foreground shrink-0",children:Je(l.createdAt)})]}),l.body&&a.jsx("p",{className:"text-sm leading-relaxed whitespace-pre-wrap mt-0.5",children:a.jsx(lg,{text:l.body,mentions:l.mentions})}),(l.mediaUrls||[]).length>0&&a.jsx("div",{className:"flex gap-1.5 mt-1.5",children:l.mediaUrls.map(p=>a.jsx("img",{src:p,alt:"",loading:"lazy",className:"w-28 h-28 rounded-xl object-cover border"},p))})]}),N.map(p=>a.jsx(Yv,{page:p,onRate:E=>u(p,E,l.body)},p.pageId)),a.jsxs("div",{className:"flex items-center gap-3 mt-1 pl-1 text-[11px] text-muted-foreground",children:[a.jsx("button",{onClick:f,className:"font-medium hover:text-foreground transition",children:"Reply"}),!i&&a.jsxs("button",{onClick:g,className:"flex items-center gap-1 hover:text-foreground transition","aria-label":"Report comment",children:[a.jsx(Zn,{className:"w-3 h-3"})," Report"]}),i&&(w?a.jsxs("span",{className:"flex items-center gap-2",children:[a.jsx("button",{onClick:h,className:"font-semibold text-destructive hover:underline",children:"Delete"}),a.jsx("button",{onClick:()=>b(!1),className:"hover:text-foreground",children:"Cancel"})]}):a.jsxs("button",{onClick:()=>b(!0),className:"flex items-center gap-1 hover:text-destructive transition",children:[a.jsx(Wp,{className:"w-3 h-3"})," Delete"]}))]})]})]})}function Yv({page:l,onRate:i}){const[r,u]=m.useState(0);return a.jsxs("div",{className:"mt-1.5 flex items-center gap-2 flex-wrap rounded-2xl border border-primary/25 bg-primary/5 px-3 py-2",children:[a.jsxs("span",{className:"text-[11px] font-medium",children:["Would you recommend ",l.name,"?"]}),a.jsx("span",{className:"flex items-center gap-0.5",onMouseLeave:()=>u(0),children:[1,2,3,4,5].map(f=>a.jsx("button",{type:"button",onClick:()=>i(f),onMouseEnter:()=>u(f),className:"p-0.5","aria-label":`Rate ${f} of 5 stars`,children:a.jsx(Hr,{className:`w-4 h-4 transition ${r>=f?"fill-[oklch(0.8_0.15_85)] text-[oklch(0.8_0.15_85)]":"text-muted-foreground/50"}`})},f))})]})}function og(){const[l,i]=m.useState(null);return m.useEffect(()=>{K.get("/api/neighborhood/sponsored/slot").then(r=>i(r.sponsored||null)).catch(()=>{})},[]),l?a.jsx(ig,{slot:l}):null}const Vv=300,Gv=20,Zv=10;let xr=null;function Xv(){return xr||(xr=K.get("/api/neighborhood/businesses/categories").then(l=>l.categories).catch(l=>{throw xr=null,l})),xr}function cp(l,i,r){const u=new URLSearchParams;return i&&u.set("categoryId",String(i)),l&&u.set("q",l),r&&u.set("offset",String(r)),u.set("limit",String(Gv)),`/api/neighborhood/businesses?${u.toString()}`}function Qv({b:l}
15){const i=[l.city,l.stateCode].filter(Boolean).join(", "),r=l.recommendCount>0;return a.jsx("button",{onClick:()=>be({view:"business",id:l.id}),className:"w-full text-left rounded-3xl bg-card border p-4 shadow-sm hover:border-primary/40 transition",children:a.jsxs("div",{className:"flex items-start gap-3",children:[l.photoUrl?a.jsx("img",{src:l.photoUrl,alt:"",loading:"lazy",className:"w-14 h-14 rounded-2xl object-cover border shrink-0"}):a.jsx("span",{className:"w-14 h-14 rounded-2xl bg-accent/50 grid place-items-center text-primary shrink-0",children:l.categoryName?a.jsx(sv,{className:"w-5 h-5"}):a.jsx(Vt,{className:"w-5 h-5"})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-1.5 min-w-0 flex-wrap",children:[a.jsx("span",{className:"text-sm font-semibold truncate",children:l.name}),l.categoryName&&a.jsx("span",{className:"px-2 py-0.5 rounded-full bg-accent/50 text-accent-foreground text-[10px] font-semibold shrink-0",children:l.categoryName})]}),i&&a.jsx("div",{className:"text-[11px] text-muted-foreground mt-0.5 truncate",children:i}),(r||l.platformRating!=null)&&a.jsxs("div",{className:"flex items-center gap-1.5 mt-1.5",children:[a.jsx(Jl,{rating:r?l.avgRating:l.platformRating}),!r&&l.platformRating!=null&&a.jsxs("span",{className:"text-[11px] text-muted-foreground",children:["(",l.platformRatingCount,")"]})]}),r&&a.jsx("div",{className:"text-[11px] text-primary font-medium mt-0.5",children:l.recommendCount===1?"1 neighbor recommendation":`${l.recommendCount} neighbor recommendations`}),l.licensedInsured&&a.jsx("div",{className:"text-[10px] text-muted-foreground mt-0.5",children:"Licensed and insured"})]})]})})}function Kv(){const[l,i]=m.useState([]),[r,u]=m.useState(null),[f,h]=m.useState(""),[g,w]=m.useState([]),[b,x]=m.useState([]),[N,p]=m.useState(0),[E,I]=m.useState(!1),[$,V]=m.useState(!1),P=m.useRef(0);m.useEffect(()=>{let O=!0;return Xv().then(D=>O&&i(D.slice(0,Zv))).catch(()=>{}),K.get("/api/neighborhood/pages/following").then(D=>O&&x(D.pages||[])).catch(()=>{}),()=>{O=!1}},[]),m.useEffect(()=>{const O=f.trim(),D=++P.current,R=setTimeout(async()=>{try{const Z=await K.get(cp(O,r,0));if(P.current!==D)return;w(Z.businesses),p(Z.total)}catch{P.current===D&&B.error("Couldn't load local businesses.")}finally{P.current===D&&I(!0)}},O?Vv:0);return()=>clearTimeout(R)},[f,r]);const G=async()=>{if($)return;V(!0);const O=P.current;try{const D=await K.get(cp(f.trim(),r,g.length));if(P.current!==O)return;w(R=>{const Z=new Set(R.map(k=>k.id));return[...R,...D.businesses.filter(k=>!Z.has(k.id))]}),p(D.total)}catch{B.error("Couldn't load more businesses.")}finally{V(!1)}};return a.jsxs("div",{className:"space-y-4 pb-6",children:[a.jsxs("div",{className:"px-1",children:[a.jsx("h2",{className:"font-semibold font-display tracking-tight text-lg",children:"Trusted local pros"}),a.jsx("p",{className:"text-sm text-muted-foreground mt-0.5",children:"Businesses that serve your area."})]}),b.length>0&&a.jsxs("section",{className:"rounded-3xl bg-card border p-4 shadow-sm",children:[a.jsxs("h3",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground mb-2.5 flex items-center gap-1.5",children:[a.jsx(Ur,{className:"w-3.5 h-3.5 text-primary"})," Businesses you follow"]}),a.jsx("div",{className:"flex gap-2 overflow-x-auto pb-0.5 -mx-1 px-1",children:b.map(O=>a.jsxs("button",{onClick:()=>be({view:"business",id:O.id}),className:"flex items-center gap-2 pl-2 pr-3 py-1.5 rounded-full border bg-card hover:bg-accent/40 transition whitespace-nowrap shrink-0",children:[a.jsx("span",{className:"w-6 h-6 rounded-lg bg-primary/10 text-primary grid place-items-center shrink-0",children:a.jsx(Vt,{className:"w-3.5 h-3.5"})}),a.jsx("span",{className:"text-xs font-semibold",children:O.name})]},O.id))})]}),a.jsxs("div",{className:"flex items-center gap-2 bg-card border rounded-full px-4 py-2.5 focus-within:ring-2 focus-within:ring-primary/30",children:[a.jsx(Yn,{className:"w-4 h-4 text-muted-foreground shrink-0"}),a.jsx("input",{value:f,onChange:O=>h(O.target.value),placeholder:"Search lawn care, HVAC, pressure washing...",className:"flex-1 min-w-0 bg-transparent text-sm outline-none placeholder:text-muted-foreground"}),f&&a.jsx("button",{onClick:()=>h(""),className:"w-6 h-6 rounded-full hover:bg-muted grid place-items-center text-muted-foreground shrink-0","aria-label":"Clear search",children:a.jsx(We,{className:"w-3.5 h-3.5"})})]}),a.jsxs("div",{className:"flex items-center gap-1.5 overflow-x-auto pb-0.5 -mx-1 px-1 lg:flex-wrap lg:overflow-visible",children:[a.jsx("button",{onClick:()=>u(null),className:`px-3.5 py-1.5 rounded-full text-xs font-semibold border transition whitespace-nowrap shrink-0 ${r===null?"bg-primary text-primary-foreground border-primary":"bg-card text-muted-foreground hover:bg-accent/40"}`,"aria-pressed":r===null,children:"All"}),l.map(O=>{const D=r===O.id;return a.jsx("button",{onClick:()=>u(D?null:O.id),className:`px-3.5 py-1.5 rounded-full text-xs font-semibold border transition whitespace-nowrap shrink-0 ${D?"bg-primary text-primary-foreground border-primary":"bg-card text-muted-foreground hover:bg-accent/40"}`,"aria-pressed":D,children:O.name},O.id)})]}),a.jsx(og,{}),!E&&a.jsx("section",{className:"rounded-3xl bg-card border p-4 shadow-sm space-y-4 animate-pulse",children:[0,1,2].map(O=>a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-14 h-14 roun
15ded-2xl bg-muted shrink-0"}),a.jsxs("div",{className:"flex-1 space-y-2",children:[a.jsx("div",{className:"h-3 w-1/3 rounded bg-muted"}),a.jsx("div",{className:"h-3 w-2/3 rounded bg-muted"})]})]},O))}),E&&g.length===0&&a.jsxs("section",{className:"rounded-3xl bg-card border p-6 text-center shadow-sm",children:[a.jsx("div",{className:"mx-auto w-12 h-12 rounded-2xl bg-accent/50 grid place-items-center mb-3",children:a.jsx(Vt,{className:"w-5 h-5 text-primary"})}),a.jsx("h3",{className:"font-semibold font-display tracking-tight",children:f.trim()||r?"No businesses matched":"No businesses yet"}),a.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:f.trim()||r?"Try a different search or category.":"Local pros for your area will show up here."})]}),g.map(O=>a.jsx(Qv,{b:O},O.id)),E&&g.length<N&&a.jsx("button",{onClick:G,disabled:$,className:"w-full py-3 rounded-3xl bg-card border text-sm font-medium text-muted-foreground hover:bg-accent/40 transition disabled:opacity-50 shadow-sm",children:$?"Loading...":"Show more"})]})}const up={new:"New",like_new:"Like new",good:"Good",fair:"Fair"};function mu(){window.history.length>1?window.history.back():be({view:"discover",sub:"sale"})}function Jv({id:l}){const{member:i}=ot(),[r,u]=m.useState(null),[f,h]=m.useState(!1),[g,w]=m.useState(!1),[b,x]=m.useState(!1),[N,p]=m.useState(!1),[E,I]=m.useState(!1),[$,V]=m.useState(null),[P,G]=m.useState(!1);m.useEffect(()=>{let A=!0;return u(null),h(!1),w(!1),V(null),K.get(`/api/neighborhood/listings/${l}`).then(se=>A&&u(se.listing)).catch(()=>A&&w(!0)).finally(()=>A&&h(!0)),()=>{A=!1}},[l]),m.useEffect(()=>{const A=Js(),se=({listingId:J,status:Q})=>u(te=>te&&te.id===J?{...te,status:Q}:te);return A.on("listing:update",se),()=>{A.off("listing:update",se)}},[]);const O=async()=>{if(!(!r||b)){x(!0);try{const A=await K.post(`/api/neighborhood/listings/${r.id}/save`);u(se=>se&&{...se,savedByMe:A.saved,saveCount:A.saveCount})}catch{B.error("Couldn't save the listing.")}finally{x(!1)}}},D=async()=>{if(!(!r||N)){p(!0);try{const A=await K.post(`/api/neighborhood/listings/${r.id}/message-seller`);be({view:"thread",id:Number(A.thread.id)})}catch(A){A instanceof tt&&A.code==="own_listing"?B.error("This is your own listing."):A instanceof tt&&A.code==="verification_required"?B.error("Verify your profile to message sellers."):B.error("Couldn't start the conversation.")}finally{p(!1)}}},R=async A=>{if(!(!r||E)){I(!0),V(null);try{const se=await K.post(`/api/neighborhood/listings/${r.id}/status`,{status:A});u(J=>J&&{...J,status:se.status}),B.success(A==="sold"?"Marked as sold.":A==="removed"?"Listing removed.":"Listing is live again."),A==="removed"&&mu()}catch{B.error("Couldn't update the listing.")}finally{I(!1)}}};if(f&&(g||!r))return a.jsxs("div",{className:"space-y-4 pb-6",children:[a.jsxs("button",{onClick:mu,className:"flex items-center gap-2 text-sm font-medium text-muted-foreground hover:text-foreground transition",children:[a.jsx(At,{className:"w-4 h-4"})," Back"]}),a.jsxs("section",{className:"rounded-3xl bg-card border p-6 text-center shadow-sm",children:[a.jsx("h3",{className:"font-semibold font-display tracking-tight",children:"This listing is not available"}),a.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"It may have been removed, or the link is wrong."})]})]});if(!r)return a.jsx("div",{className:"space-y-4 pb-6",children:a.jsxs("section",{className:"rounded-3xl bg-card border shadow-sm overflow-hidden animate-pulse",children:[a.jsx("div",{className:"aspect-square bg-muted"}),a.jsxs("div",{className:"p-4 space-y-3",children:[a.jsx("div",{className:"h-4 w-1/3 rounded bg-muted"}),a.jsx("div",{className:"h-3 w-2/3 rounded bg-muted"})]})]})});const Z=!!(i&&r.seller&&r.seller.memberId===i.id),k=r.seller?.displayName||"A neighbor",T=r.status==="sold";return a.jsxs("div",{className:"space-y-4 pb-6",children:[a.jsxs("button",{onClick:mu,className:"flex items-center gap-2 text-sm font-medium text-muted-foreground hover:text-foreground transition",children:[a.jsx(At,{className:"w-4 h-4"})," Back to For sale"]}),a.jsxs("section",{className:"rounded-3xl bg-card border shadow-sm overflow-hidden",children:[a.jsxs("div",{className:"relative",children:[r.mediaUrls.length>0?a.jsx("div",{className:"space-y-1",children:r.mediaUrls.map(A=>a.jsx("img",{src:A,alt:"",className:"w-full max-h-[420px] object-cover",loading:"lazy"},A))}):a.jsx("div",{className:"aspect-[4/3] bg-muted/50 grid place-items-center text-muted-foreground",children:a.jsx(Qp,{className:"w-8 h-8"})}),T&&a.jsx("span",{className:"absolute top-3 left-3 px-3 py-1.5 rounded-full bg-foreground
15/85 text-background text-xs font-semibold uppercase tracking-wide",children:"Sold"})]}),a.jsxs("div",{className:"p-4 lg:p-5",children:[a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("div",{className:"text-lg font-semibold",children:r.isFree?a.jsx("span",{className:"inline-block px-2.5 py-1 rounded-full bg-primary/10 text-primary text-sm font-semibold",children:"Free"}):Lu(r.priceCents)}),a.jsx("h2",{className:"font-semibold font-display tracking-tight text-lg mt-1",children:r.title}),a.jsxs("div",{className:"text-[11px] text-muted-foreground mt-1 flex items-center gap-1.5 flex-wrap",children:[a.jsxs("span",{children:["Listed ",Je(r.createdAt)]}),r.categoryLabel&&a.jsx("span",{className:"px-2 py-0.5 rounded-full bg-accent/50 text-accent-foreground font-semibold",children:r.categoryLabel}),r.condition&&up[r.condition]&&a.jsx("span",{className:"px-2 py-0.5 rounded-full bg-muted font-semibold",children:up[r.condition]})]})]}),a.jsxs("button",{onClick:O,disabled:b,className:`flex items-center gap-1.5 px-3 py-1.5 rounded-full border text-xs font-semibold transition disabled:opacity-50 shrink-0 ${r.savedByMe?"bg-primary/10 text-primary border-primary/40":"text-muted-foreground hover:bg-muted"}`,"aria-pressed":!!r.savedByMe,children:[a.jsx(Ih,{className:`w-4 h-4 ${r.savedByMe?"fill-primary":""}`}),r.savedByMe?"Saved":"Save"]})]}),r.description&&a.jsx("p",{className:"text-[15px] leading-relaxed whitespace-pre-wrap mt-3",children:r.description}),a.jsxs("div",{className:"flex items-center gap-3 mt-3 text-[11px] text-muted-foreground",children:[a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx(X0,{className:"w-3.5 h-3.5"})," ",r.viewCount," ",r.viewCount===1?"view":"views"]}),a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx(Ih,{className:"w-3.5 h-3.5"})," ",r.saveCount," ",r.saveCount===1?"save":"saves"]})]}),a.jsxs("div",{className:"mt-4 pt-3 border-t flex items-center gap-3",children:[a.jsx(ut,{name:k,initials:dt(k),src:r.seller?.avatarUrl,size:40}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[a.jsx("span",{className:"text-sm font-semibold truncate",children:k}),r.seller&&bs(r.seller.verificationTier)&&a.jsx(es,{className:"w-3.5 h-3.5 text-primary shrink-0","aria-label":"Verified neighbor"})]}),a.jsx("div",{className:"text-[11px] text-muted-foreground",children:Z?"Your listing":"Seller"})]}),!Z&&a.jsxs("button",{onClick:D,disabled:N,className:"flex items-center gap-1.5 px-4 py-2 rounded-full bg-primary text-primary-foreground text-xs font-semibold disabled:opacity-50 shrink-0",children:[a.jsx(qr,{className:"w-4 h-4"}),N?"Opening...":"Message seller"]})]}),!Z&&a.jsx("div",{className:"mt-4 pt-3 border-t",children:a.jsxs("button",{onClick:()=>G(!0),className:"flex items-center gap-1.5 text-[11px] font-medium text-muted-foreground hover:text-foreground transition",children:[a.jsx(Zn,{className:"w-3 h-3"})," Report this listing"]})}),Z&&a.jsx("div",{className:"mt-4 pt-3 border-t",children:$?a.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[a.jsx("span",{className:"text-xs font-medium flex-1 min-w-[140px]",children:$==="sold"?"Mark this listing as sold?":"Remove this listing?"}),a.jsx("button",{onClick:()=>R($),disabled:E,className:`px-3 py-1.5 rounded-full text-xs font-semibold disabled:opacity-50 ${$==="removed"?"bg-destructive text-destructive-foreground":"bg-primary text-primary-foreground"}`,children:$==="sold"?"Mark as sold":"Remove"}),a.jsx("button",{onClick:()=>V(null),className:"px-3 py-1.5 rounded-full bg-muted text-xs font-medium",children:"Cancel"})]}):a.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[r.status==="active"&&a.jsx("button",{onClick:()=>V("sold"),disabled:E,className:"px-3.5 py-1.5 rounded-full bg-primary text-primary-foreground text-xs font-semibold disabled:opacity-50",children:"Mark as sold"}),T&&a.jsx("button",{onClick:()=>R("active"),disabled:E,className:"px-3.5 py-1.5 rounded-full bg-primary text-primary-foreground text-xs font-semibold disabled:opacity-50",children:"Relist"}),a.jsx("button",{onClick:()=>V("removed"),disabled:E,className:"px-3.5 py-1.5 rounded-full border text-xs font-semibold text-destructive hover:bg-destructive/10 transition disabled:opacity-50",children:"Remove"})]})})]})]}),P&&a.jsx(Vr,{contentType:"listing",contentId:r.id,onClose:()=>G(!1)})]})}const dp=6,Iv=[{id:"new",label:"New"},{id:"like_new",label:"Like new"},{id:"good",label:"Good"},{id:"fair",label:"Fair"}];let yr=null;function Fv(){return yr||(yr=K.get("/api/neighborhood/listings/categories").then(l=>l.categories).catch(l=>{throw yr=null,l})),yr}function Wv(l){const i=l.replace(/[$,\s]/g,"");if(!i||!/^\d+(\.\d{1,2})?$/.test(i))return null;const r=Math.round(parseFloat(i)*100);return Number.isFinite(r)&&r>0?r:null}function Pv({categories:l,onCreated:i,onClose:r}){const[u,f]=m.useState(""),[h,g]=m.useState(""),[w,b]=m.useState(""),[x,N]=m.useState(!1),[p,E]=m.useState(null),[I,$]=m.useState(null),[V,P]=m.useState([]),[G,O]=m.useState(!1),D=A=>{A&&P(se=>{const J=[...se];for(const Q of Array.from(A)){if(J.length>=dp){B.error(`Up to ${dp}
15 photos per listing.`);break}Q.type.startsWith("image/")&&J.push({file:Q,preview:URL.createObjectURL(Q)})}return J})},R=A=>{P(se=>(URL.revokeObjectURL(se[A].preview),se.filter((J,Q)=>Q!==A)))},Z=Wv(w),k=!G&&u.trim().length>0&&(x||Z!==null),T=async()=>{if(k){O(!0);try{let A=[];V.length&&(A=await Rr(V.map(J=>J.file)));const se=await K.post("/api/neighborhood/listings",{title:u.trim(),...h.trim()?{description:h.trim()}:{},isFree:x,...x?{}:{priceCents:Z},...p?{categoryId:p}:{},...I?{condition:I}:{},...A.length?{mediaUrls:A}:{}});V.forEach(J=>URL.revokeObjectURL(J.preview)),i(se.listing),B.success("Listing published.")}catch(A){A instanceof tt&&A.code==="address_verification_required"?B.error("Address verification required to sell in the market."):B.error("Couldn't publish your listing.")}finally{O(!1)}}};return a.jsxs("section",{className:"rounded-3xl bg-card border p-4 shadow-sm space-y-3",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h3",{className:"font-semibold font-display tracking-tight text-sm",children:"Sell something"}),a.jsx("button",{onClick:r,className:"w-7 h-7 rounded-full hover:bg-muted grid place-items-center text-muted-foreground","aria-label":"Close",children:a.jsx(We,{className:"w-4 h-4"})})]}),a.jsx("input",{value:u,onChange:A=>f(A.target.value),placeholder:"What are you selling?",maxLength:120,className:"w-full bg-muted/60 rounded-xl px-3 py-2 text-sm outline-none focus:ring-2 focus:ring-primary/30 placeholder:text-muted-foreground"}),a.jsx("textarea",{value:h,onChange:A=>g(A.target.value),placeholder:"Add details neighbors will want to know (optional)",rows:2,className:"w-full resize-none bg-muted/60 rounded-xl px-3 py-2 text-sm outline-none focus:ring-2 focus:ring-primary/30 placeholder:text-muted-foreground"}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("div",{className:`flex items-center gap-1 bg-muted/60 rounded-xl px-3 py-2 flex-1 ${x?"opacity-40":""}`,children:[a.jsx("span",{className:"text-sm text-muted-foreground",children:"$"}),a.jsx("input",{value:w,onChange:A=>b(A.target.value),placeholder:"Price",inputMode:"decimal",disabled:x,className:"flex-1 min-w-0 bg-transparent outline-none text-sm placeholder:text-muted-foreground"})]}),a.jsxs("button",{onClick:()=>N(A=>!A),className:`flex items-center gap-1.5 px-3.5 py-2 rounded-xl text-xs font-semibold border transition ${x?"bg-primary text-primary-foreground border-primary":"bg-card text-muted-foreground hover:bg-accent/40"}`,"aria-pressed":x,children:[a.jsx(Bu,{className:"w-3.5 h-3.5"})," Free"]})]}),l.length>0&&a.jsx("div",{className:"flex flex-wrap gap-1.5",children:l.map(A=>{const se=p===A.id;return a.jsx("button",{onClick:()=>E(se?null:A.id),className:`px-3 py-1 rounded-full text-[11px] font-medium border transition ${se?"bg-primary text-primary-foreground border-primary":"bg-card text-muted-foreground hover:bg-accent/40"}`,children:A.label},A.id)})}),a.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[a.jsx("span",{className:"text-[11px] font-medium text-muted-foreground mr-1",children:"Condition"}),Iv.map(A=>{const se=I===A.id;return a.jsx("button",{onClick:()=>$(se?null:A.id),className:`px-3 py-1 rounded-full text-[11px] font-medium border transition ${se?"bg-primary text-primary-foreground border-primary":"bg-card text-muted-foreground hover:bg-accent/40"}`,children:A.label},A.id)})]}),V.length>0&&a.jsx("div",{className:"flex gap-2 flex-wrap",children:V.map((A,se)=>a.jsxs("div",{className:"relative",children:[a.jsx("img",{src:A.preview,alt:"",className:"w-16 h-16 rounded-xl object-cover border"}),a.jsx("button",{onClick:()=>R(se),className:"absolute -top-1.5 -right-1.5 w-5 h-5 rounded-full bg-foreground text-background grid place-items-center","aria-label":"Remove photo",children:a.jsx(We,{className:"w-3 h-3"})})]},A.preview))}),a.jsxs("div",{className:"flex items-center justify-between pt-3 border-t",children:[a.jsxs("label",{className:"w-8 h-8 rounded-lg hover:bg-muted grid place-items-center text-muted-foreground cursor-pointer",children:[a.jsx(Du,{className:"w-4 h-4"}),a.jsx("input",{type:"file",accept:"image/*",multiple:!0,className:"hidden",onChange:A=>{D(A.target.files),A.target.value=""}})]}),a.jsx("button",{onClick:T,disabled:!k,className:"px-4 py-2 rounded-full bg-primary text-primary-foreground text-xs font-semibold disabled:opacity-50 transition",children:G?"Publishing...":"Publish listing"})]})]})}function eN(){const[l,i]=m.useState([]),[r,u]=m.useState(null),[f,h]=m.useState(!1),[g,w]=m.useState([]),[b,x]=m.useState(!1),[N,p]=m.useState(!1),[E,I]=m.useState(!1),[$,V]=m.useState(!1);m.useEffect(()=>{let O=!0;return Fv().then(D=>O&&i(D)).catch(()=>{}),()=>{O=!1}},[]);const P=m.useCallback(O=>{const D=new URLSearchParams;r&&D.set("categoryId",String(r)),f&&D.set("free","1"),O&&D.set("before",O);const R=D.toString();return`/api/neighborhood/listings${R?`?${R}`:""}`},[r,f]);m.useEffect(()=>{let O=!0;return p(!1),K.get(P()).then(D=>{O&&(w(D.listings),x(D.hasMore))}).catch(()=>O&&B.error("Couldn't load the market.")).finally(()=>O&&p(!0)),()=>{O=!1}},[P]),m.useEffect(()=>{const O=Js(),D=({listing:Z})=>w(k=>k.some(T=>T.id===Z.id)||r&&Z.categoryId!==r||f&&!Z.isFree?k:[Z,...k]),R=({listingId:Z,status:k})=>w(T=>k==="removed"?T.filter(A=>A.id!==Z):T.map(A=>A.id===Z?{...A,status:k}:A));return O.on("listing:new",D),O.on("listing:update",R),()=>{O.off("listing:new",D),O.off("listing:update",R)}},[r,f]);const G=m.useCallback(async()=>
15{if(!(E||!g.length)){I(!0);try{const O=g[g.length-1],D=await K.get(P(O.id));w(R=>{const Z=new Set(R.map(k=>k.id));return[...R,...D.listings.filter(k=>!Z.has(k.id))]}),x(D.hasMore)}catch{B.error("Couldn't load more listings.")}finally{I(!1)}}},[E,g,P]);return a.jsxs("div",{className:"space-y-4",children:[$?a.jsx(Pv,{categories:l,onCreated:O=>{w(D=>D.some(R=>R.id===O.id)?D:[O,...D]),V(!1)},onClose:()=>V(!1)}):a.jsxs("button",{onClick:()=>V(!0),className:"w-full flex items-center justify-center gap-2 py-3 rounded-3xl bg-card border text-sm font-medium text-muted-foreground hover:bg-accent/40 transition shadow-sm",children:[a.jsx(Su,{className:"w-4 h-4"})," Sell something"]}),a.jsxs("div",{className:"flex items-center gap-1.5 overflow-x-auto pb-0.5 -mx-1 px-1",children:[a.jsxs("button",{onClick:()=>h(O=>!O),className:`flex items-center gap-1.5 px-3.5 py-1.5 rounded-full text-xs font-semibold border transition whitespace-nowrap shrink-0 ${f?"bg-primary text-primary-foreground border-primary":"bg-card text-muted-foreground hover:bg-accent/40"}`,"aria-pressed":f,children:[a.jsx(Bu,{className:"w-3.5 h-3.5"})," Free"]}),l.map(O=>{const D=r===O.id;return a.jsx("button",{onClick:()=>u(D?null:O.id),className:`px-3.5 py-1.5 rounded-full text-xs font-semibold border transition whitespace-nowrap shrink-0 ${D?"bg-primary text-primary-foreground border-primary":"bg-card text-muted-foreground hover:bg-accent/40"}`,"aria-pressed":D,children:O.label},O.id)})]}),!N&&a.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-3 gap-3 animate-pulse",children:[0,1,2,3].map(O=>a.jsxs("div",{className:"rounded-3xl bg-card border shadow-sm overflow-hidden",children:[a.jsx("div",{className:"aspect-square bg-muted"}),a.jsxs("div",{className:"p-3 space-y-2",children:[a.jsx("div",{className:"h-3 w-1/2 rounded bg-muted"}),a.jsx("div",{className:"h-3 w-3/4 rounded bg-muted"})]})]},O))}),N&&g.length===0&&a.jsxs("section",{className:"rounded-3xl bg-card border p-6 text-center shadow-sm",children:[a.jsx("div",{className:"mx-auto w-12 h-12 rounded-2xl bg-accent/50 grid place-items-center mb-3",children:a.jsx(Su,{className:"w-5 h-5 text-primary"})}),a.jsx("h3",{className:"font-semibold font-display tracking-tight",children:"Nothing for sale right now"}),a.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:f||r?"No listings match these filters yet.":"Be the first neighbor to list something."})]}),N&&g.length>0&&a.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-3 gap-3",children:g.map(O=>a.jsxs("button",{onClick:()=>be({view:"listing",id:Number(O.id)}),className:"text-left rounded-3xl bg-card border shadow-sm overflow-hidden hover:border-primary/40 transition",children:[a.jsxs("div",{className:"relative aspect-square bg-muted/50",children:[O.mediaUrls[0]?a.jsx("img",{src:O.mediaUrls[0],alt:"",loading:"lazy",className:"w-full h-full object-cover"}):a.jsx("div",{className:"w-full h-full grid place-items-center text-muted-foreground",children:a.jsx(Qp,{className:"w-6 h-6"})}),O.status==="sold"&&a.jsx("span",{className:"absolute top-2 left-2 px-2.5 py-1 rounded-full bg-foreground
15/85 text-background text-[10px] font-semibold uppercase tracking-wide",children:"Sold"})]}),a.jsxs("div",{className:"p-3",children:[a.jsx("div",{className:"text-sm font-semibold",children:O.isFree?a.jsx("span",{className:"inline-block px-2 py-0.5 rounded-full bg-primary/10 text-primary text-[11px] font-semibold",children:"Free"}):Lu(O.priceCents)}),a.jsx("div",{className:"text-xs font-medium mt-1 line-clamp-2",children:O.title}),a.jsx("div",{className:"text-[11px] text-muted-foreground mt-1",children:Je(O.createdAt)})]})]},O.id))}),b&&a.jsx("button",{onClick:G,disabled:E,className:"w-full py-3 rounded-3xl bg-card border text-sm font-medium text-muted-foreground hover:bg-accent/40 transition disabled:opacity-50 shadow-sm",children:E?"Loading...":"Load more"})]})}const tN="modulepreload",sN=function(l){return"/neighborhood/"+l},fp={},aN=function(i,r,u){let f=Promise.resolve();if(r&&r.length>0){let b=function(x){return Promise.all(x.map(N=>Promise.resolve(N).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const g=document.querySelector("meta[property=csp-nonce]"),w=g?.nonce||g?.getAttribute("nonce");f=b(r.map(x=>{if(x=sN(x),x in fp)return;fp[x]=!0;const N=x.endsWith(".css"),p=N?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${x}"]${p}`))return;const E=document.createElement("link");if(E.rel=N?"stylesheet":tN,N||(E.as="script"),E.crossOrigin="",E.href=x,w&&E.setAttribute("nonce",w),document.head.appendChild(E),N)return new Promise((I,$)=>{E.addEventListener("load",I),E.addEventListener("error",()=>$(new Error(`Unable to preload CSS for ${x}`)))})}))}function h(g){const w=new Event("vite:preloadError",{cancelable:!0});if(w.payload=g,window.dispatchEvent(w),!w.defaultPrevented)throw g}return f.then(g=>{for(const w of g||[])w.status==="rejected"&&h(w.reason);return i().catch(h)})};function nN(){const[l,i]=m.useState(null),[r,u]=m.useState(!1),f=m.useRef(null),h=m.useRef(null);return m.useEffect(()=>{let g=!0;return K.get("/api/neighborhood/map").then(w=>g&&i(w.map)).catch(()=>g&&B.error("Couldn't load the neighborhood map.")).finally(()=>g&&u(!0)),()=>{g=!1}},[]),m.useEffect(()=>{const g=l?.centroid;if(!g||!f.current||h.current)return;let w=!1;return(async()=>{const b=(await aN(async()=>{const{default:N}=await import("./leaflet-src-BXQnTGpk.js").then(p=>p.l);return{default:N}},[])).default;if(w||!f.current||h.current)return;const x=b.map(f.current,{scrollWheelZoom:!1,attributionControl:!0}).setView([g.lat,g.lng],15);b.tileLayer("https://tile.openstreetmap.org/{z}/{x}/{y}.png",{maxZoom:19,attribution:'&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'}).addTo(x),b.circle([g.lat,g.lng],{radius:400,color:"oklch(0.55 0.12 145)",fillColor:"oklch(0.55 0.12 145)",fillOpacity:.12,weight:2}).addTo(x),b.circleMarker([g.lat,g.lng],{radius:7,color:"oklch(0.55 0.12 145)",fillColor:"oklch(0.55 0.12 145)",fillOpacity:.9,weight:2}).addTo(x).bindPopup(l.neighborhood.name),h.current=x})(),()=>{w=!0,h.current&&(h.current.remove(),h.current=null)}},[l]),a.jsxs("div",{className:"space-y-4",children:[!r&&a.jsx("div",{className:"rounded-3xl bg-card border shadow-sm h-64 animate-pulse"}),r&&l?.centroid&&a.jsx("section",{className:"rounded-3xl bg-card border shadow-sm overflow-hidden",children:a.jsx("div",{ref:f,className:"h-64 w-full z-0","aria-label":`Map of ${l.neighborhood.name}`})}),r&&l&&!l.centroid&&a.jsxs("section",{className:"rounded-3xl bg-card border p-6 text-center shadow-sm",children:[a.jsx("div",{className:"mx-auto w-12 h-12 rounded-2xl bg-accent/50 grid place-items-center mb-3",children:a.jsx(y1,{className:"w-5 h-5 text-primary"})}),a.jsx("h3",{className:"font-semibold font-display tracking-tight",children:"Map preview unavailable"}),a.jsxs("p",{className:"text-sm text-muted-foreground mt-1",children:["We don't have a pin for ",l.neighborhood.name," yet. The street list below still works."]})]}),r&&l&&l.streets.length>0&&a.jsxs("section",{className:"rounded-3xl bg-card border p-4 shadow-sm",children:[a.jsxs("h3",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground mb-2",children:["Streets in ",l.neighborhood.name]}),a.jsx("div",{className:"divide-y",children:l.streets.map((g,w)=>a.jsxs("div",{className:"flex items-center gap-2 py-2.5",children:[a.jsx(Xn,{className:"w-3.5 h-3.5 text-muted-foreground shrink-0"}),a.jsx("span",{className:"text-sm font-medium truncate flex-1",children:g.name}),g.homeCount!=null&&a.jsx("span",{className:"px-2.5 py-0.5 rounded-full bg-accent/50 text-accent-foreground text-[10px] font-semibold shrink-0 tabular-nums",children:g.homeCount===1?"1 home":`${g.homeCount.toLocaleStr
15ing("en-US")} homes`})]},`${g.name}-${g.zip5||w}`))})]}),r&&l&&l.streets.length===0&&l.centroid&&a.jsx("p",{className:"text-xs text-muted-foreground text-center",children:"No street data for this neighborhood yet."})]})}const lN=300;function iN({onClose:l}){const[i,r]=m.useState(""),[u,f]=m.useState(!1),h=async()=>{const g=i.trim();if(!(!g||u)){f(!0);try{const w=await K.post("/api/neighborhood/pages",{name:g});B.success("Business added."),be({view:"business",id:w.page.id})}catch{B.error("Couldn't add that business.")}finally{f(!1)}}};return a.jsxs("section",{className:"rounded-3xl bg-card border p-4 shadow-sm space-y-3",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h3",{className:"font-semibold font-display tracking-tight text-sm",children:"Add a business"}),a.jsx("button",{onClick:l,className:"w-7 h-7 rounded-full hover:bg-muted grid place-items-center text-muted-foreground","aria-label":"Close",children:a.jsx(We,{className:"w-4 h-4"})})]}),a.jsx("input",{value:i,onChange:g=>r(g.target.value),placeholder:"Business name",maxLength:120,className:"w-full bg-muted/60 rounded-xl px-3 py-2 text-sm outline-none focus:ring-2 focus:ring-primary/30 placeholder:text-muted-foreground"}),a.jsx("div",{className:"flex justify-end",children:a.jsx("button",{onClick:h,disabled:!i.trim()||u,className:"px-4 py-2 rounded-full bg-primary text-primary-foreground text-xs font-semibold disabled:opacity-50 transition",children:u?"Adding...":"Add business"})})]})}function rN(){const[l,i]=m.useState(""),[r,u]=m.useState([]),[f,h]=m.useState(!1),[g,w]=m.useState(!1),b=m.useRef(0);return m.useEffect(()=>{const x=l.trim(),N=++b.current,p=setTimeout(async()=>{try{const E=await K.get(`/api/neighborhood/pages${x?`?q=${encodeURIComponent(x)}`:""}`);if(b.current!==N)return;u(E.pages)}catch{b.current===N&&B.error("Couldn't load businesses.")}finally{b.current===N&&h(!0)}},x?lN:0);return()=>clearTimeout(p)},[l]),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center gap-2 bg-card border rounded-full px-4 py-2.5 focus-within:ring-2 focus-within:ring-primary/30",children:[a.jsx(Yn,{className:"w-4 h-4 text-muted-foreground shrink-0"}),a.jsx("input",{value:l,onChange:x=>i(x.target.value),placeholder:"Search local businesses",className:"flex-1 min-w-0 bg-transparent text-sm outline-none placeholder:text-muted-foreground"}),l&&a.jsx("button",{onClick:()=>i(""),className:"w-6 h-6 rounded-full hover:bg-muted grid place-items-center text-muted-foreground shrink-0","aria-label":"Clear search",children:a.jsx(We,{className:"w-3.5 h-3.5"})})]}),a.jsx(og,{}),g?a.jsx(iN,{onClose:()=>w(!1)}):a.jsxs("button",{onClick:()=>w(!0),className:"w-full flex items-center justify-center gap-2 py-3 rounded-3xl bg-card border text-sm font-medium text-muted-foreground hover:bg-accent/40 transition shadow-sm",children:[a.jsx(Qn,{className:"w-4 h-4"})," Add a business"]}),!f&&a.jsx("section",{className:"rounded-3xl bg-card border p-4 shadow-sm space-y-3 animate-pulse",children:[0,1,2].map(x=>a.jsxs("div",{className:"space-y-2",children:[a.jsx("div",{className:"h-3 w-1/3 rounded bg-muted"}),a.jsx("div",{className:"h-3 w-2/3 rounded bg-muted"})]},x))}),f&&r.length===0&&a.jsxs("section",{className:"rounded-3xl bg-card border p-6 text-center shadow-sm",children:[a.jsx("div",{className:"mx-auto w-12 h-12 rounded-2xl bg-accent/50 grid place-items-center mb-3",children:a.jsx(Vt,{className:"w-5 h-5 text-primary"})}),a.jsx("h3",{className:"font-semibold font-display tracking-tight",children:l.trim()?"No businesses matched":"No businesses yet"}),a.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:l.trim()?"Try a different name, or add it so neighbors can recommend it.":"Add a local business your neighbors should know about."})]}),r.map(x=>a.jsx("button",{onClick:()=>be({view:"business",id:x.id}),className:"w-full text-left rounded-3xl bg-card border p-4 shadow-sm hover:border-primary/40 transition",children:a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx("span",{className:"w-11 h-11 rounded-2xl bg-accent/50 grid place-items-center text-primary shrink-0",children:a.jsx(Vt,{className:"w-5 h-5"})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("div",{className:"text-sm font-semibold truncate",children:x.name}),a.jsx("div",{className:"text-[11px] text-muted-foreground mt-0.5 truncate",children:[x.categoryName,[x.city,x.stateCode].filter(
15Boolean).join(", ")].filter(Boolean).join(" · ")||"Local business"}),a.jsxs("div",{className:"flex items-center gap-2 mt-1.5",children:[a.jsx(Jl,{rating:x.avgRating}),a.jsx("span",{className:"text-[11px] text-muted-foreground",children:x.recommendCount===1?"1 recommendation":`${x.recommendCount} recommendations`})]})]})]})},x.id))]})}const oN=[{id:"recs",label:"Recommendations"},{id:"groups",label:"Groups"},{id:"events",label:"Events"},{id:"sale",label:"For sale"},{id:"map",label:"Map"}];function cN(l){const i=new Date(l),r=i.toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric"}),u=i.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit"});return`${r} at ${u}`}function uN({onCreated:l,onClose:i}){const[r,u]=m.useState(""),[f,h]=m.useState(""),[g,w]=m.useState("public"),[b,x]=m.useState(!1),N=async()=>{const p=r.trim();if(!(!p||b)){x(!0);try{const E=await K.post("/api/neighborhood/groups",{name:p,...f.trim()?{description:f.trim()}:{},privacy:g});l(E.group),B.success("Group created.")}catch(E){E instanceof tt&&E.code==="address_verification_required"?B.error("Address verification required to create groups."):B.error("Couldn't create the group.")}finally{x(!1)}}};return a.jsxs("section",{className:"rounded-3xl bg-card border p-4 shadow-sm space-y-3",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h3",{className:"font-semibold font-display tracking-tight text-sm",children:"Start a group"}),a.jsx("button",{onClick:i,className:"w-7 h-7 rounded-full hover:bg-muted grid place-items-center text-muted-foreground","aria-label":"Close",children:a.jsx(We,{className:"w-4 h-4"})})]}),a.jsx("input",{value:r,onChange:p=>u(p.target.value),placeholder:"Group name",maxLength:80,className:"w-full bg-muted/60 rounded-xl px-3 py-2 text-sm outline-none focus:ring-2 focus:ring-primary/30 placeholder:text-muted-foreground"}),a.jsx("textarea",{value:f,onChange:p=>h(p.target.value),placeholder:"What is this group about? (optional)",rows:2,className:"w-full resize-none bg-muted/60 rounded-xl px-3 py-2 text-sm outline-none focus:ring-2 focus:ring-primary/30 placeholder:text-muted-foreground"}),a.jsxs("div",{className:"flex items-center gap-1.5",children:[["public","private"].map(p=>{const E=g===p;return a.jsxs("button",{onClick:()=>w(p),className:`flex items-center gap-1.5 px-3 py-1.5 rounded-full text-[11px] font-medium border transition ${E?"bg-primary text-primary-foreground border-primary":"bg-card text-muted-foreground hover:bg-accent/40"}`,"aria-pressed":E,children:[p==="private"&&a.jsx(Ql,{className:"w-3 h-3"}),p==="public"?"Public":"Private"]},p)}),a.jsx("span",{className:"text-[11px] text-muted-foreground ml-1",children:g==="public"?"Anyone nearby can join.":"Members must be approved."})]}),a.jsx("div",{className:"flex justify-end",children:a.jsx("button",{onClick:N,disabled:!r.trim()||b,className:"px-4 py-2 rounded-full bg-primary text-primary-foreground text-xs font-semibold disabled:opacity-50 transition",children:b?"Creating...":"Create group"})})]})}function dN(){const[l,i]=m.useState([]),[r,u]=m.useState(!1),[f,h]=m.useState(!1),[g,w]=m.useState(null);m.useEffect(()=>{let x=!0;return K.get("/api/neighborhood/groups").then(N=>x&&i(N.groups)).catch(()=>x&&B.error("Couldn't load groups.")).finally(()=>x&&u(!0)),()=>{x=!1}},[]);const b=async x=>{if(!g){w(x.id);try{const N=await K.post(`/api/neighborhood/groups/${x.id}/join`);i(p=>p.map(E=>E.id===x.id?{...E,myStatus:N.myStatus,myRole:N.myStatus==="active"?"member":E.myRole,memberCount:N.myStatus==="active"?E.memberCount+1:E.memberCount}:E)),B.success(N.myStatus==="pending"?"Join request sent.":`You joined ${x.name}.`)}catch{B.error("Couldn't join the group.")}finally{w(null)}}};return a.jsxs("div",{className:"space-y-4",children:[f?a.jsx(uN,{onCreated:x=>{i(N=>[x,...N.filter(p=>p.id!==x.id)]),h(!1)},onClose:()=>h(!1)}):a.jsxs("button",{onClick:()=>h(!0),className:"w-full flex items-center justify-center gap-2 py-3 rounded-3xl bg-card border text-sm font-medium text-muted-foreground hover:bg-accent/40 transition shadow-sm",children:[a.jsx(Qn,{className:"w-4 h-4"})," Start a group"]}),!r&&a.jsx("section",{className:"rounded-3xl bg-card border p-4 shadow-sm space-y-3 animate-pulse",children:[0,1,2].map(x=>a.jsxs("div",{className:"space-y-2",children:[a.jsx("div",{className:"h-3 w-1/3 rounded bg-muted"}),a.jsx("div",{className:"h-3 w-2/3 rounded bg-muted"})]},x))}),r&&l.length===0&&a.jsxs("section",{className:"rounded-3xl bg-card border p-6 text-center shadow-sm",children:[a.jsx("div",{className:"mx-auto w-12 h-12 rounded-2xl bg-accent/50 grid place-items-center mb-3",children:a.jsx(Ia,{className:"w-5 h-5 text-primary"})}),a.jsx("h3",{className:"font-semibold font-display tracking-tight",children:"No groups yet"}),a.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Start the first group for your neighborhood."})]}),l.map(x=>{const N=x.myStatus==="active",p=x.myStatus==="pending",E=x.myStatus==="banned";return a.jsx("section",{className:"rounded-3xl bg-card border p-4 shadow-sm",children:a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsxs("button",{onClick:()=>be({view:"group",id:x.id}),className:"flex-1 min-w-0 text-left",children:[a.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[a.jsx("span",{className:"text-sm font-semibold truncate",children:x.name}),x.privacy==="private"&&a.jsx(Ql,{className:"w-3.5 h-3.5 text-muted-foreground shrink-0","aria-label":"Private group"})]}),a.jsxs("div",{className:"text-[11px] text-muted-foreground mt-0.5",children:[x.memberCount===1?"1 member":`${x.memberCount} members`,x.myRole==="owner"?" · You are the owner":""]}
15),x.description&&a.jsx("p",{className:"text-sm text-foreground/90 mt-1.5 line-clamp-2",children:x.description})]}),!E&&(N?a.jsx("button",{onClick:()=>be({view:"group",id:x.id}),className:"px-3.5 py-1.5 rounded-full bg-muted text-xs font-semibold text-foreground/80 shrink-0",children:"Joined"}):p?a.jsx("span",{className:"px-3.5 py-1.5 rounded-full border text-xs font-semibold text-muted-foreground shrink-0",children:"Pending"}):a.jsx("button",{onClick:()=>b(x),disabled:g===x.id,className:"px-3.5 py-1.5 rounded-full bg-primary text-primary-foreground text-xs font-semibold disabled:opacity-50 shrink-0",children:x.privacy==="private"?"Ask to join":"Join"}))]})},x.id)})]})}function fN({onCreated:l,onClose:i}){const[r,u]=m.useState(""),[f,h]=m.useState(""),[g,w]=m.useState(""),[b,x]=m.useState(""),[N,p]=m.useState(""),[E,I]=m.useState(!1),$=async()=>{if(!r.trim()||!b||E)return;const V=new Date(b);if(Number.isNaN(V.getTime())){B.error("Pick a valid start time.");return}if(N&&new Date(N).getTime()<=V.getTime()){B.error("The end time must be after the start.");return}I(!0);try{const P=await K.post("/api/neighborhood/events",{title:r.trim(),...f.trim()?{description:f.trim()}:{},...g.trim()?{locationText:g.trim()}:{},startsAt:V.toISOString(),...N?{endsAt:new Date(N).toISOString()}:{}});l(P.event),B.success("Event published.")}catch(P){P instanceof tt&&P.code==="address_verification_required"?B.error("Address verification required to host events."):B.error("Couldn't create the event.")}finally{I(!1)}};return a.jsxs("section",{className:"rounded-3xl bg-card border p-4 shadow-sm space-y-3",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h3",{className:"font-semibold font-display tracking-tight text-sm",children:"Host an event"}),a.jsx("button",{onClick:i,className:"w-7 h-7 rounded-full hover:bg-muted grid place-items-center text-muted-foreground","aria-label":"Close",children:a.jsx(We,{className:"w-4 h-4"})})]}),a.jsx("input",{value:r,onChange:V=>u(V.target.value),placeholder:"Event title",maxLength:120,className:"w-full bg-muted/60 rounded-xl px-3 py-2 text-sm outline-none focus:ring-2 focus:ring-primary/30 placeholder:text-muted-foreground"}),a.jsx("textarea",{value:f,onChange:V=>h(V.target.value),placeholder:"What should neighbors know? (optional)",rows:2,className:"w-full resize-none bg-muted/60 rounded-xl px-3 py-2 text-sm outline-none focus:ring-2 focus:ring-primary/30 placeholder:text-muted-foreground"}),a.jsx("input",{value:g,onChange:V=>w(V.target.value),placeholder:"Location (optional)",maxLength:160,className:"w-full bg-muted/60 rounded-xl px-3 py-2 text-sm outline-none focus:ring-2 focus:ring-primary/30 placeholder:text-muted-foreground"}),a.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:[a.jsxs("label",{className:"block",children:[a.jsx("span",{className:"text-[11px] font-medium text-muted-foreground",children:"Starts"}),a.jsx("input",{type:"datetime-local",value:b,onChange:V=>x(V.target.value),className:"mt-0.5 w-full bg-muted/60 rounded-xl px-3 py-2 text-sm outline-none focus:ring-2 focus:ring-primary/30"})]}),a.jsxs("label",{className:"block",children:[a.jsx("span",{className:"text-[11px] font-medium text-muted-foreground",children:"Ends (optional)"}),a.jsx("input",{type:"datetime-local",value:N,onChange:V=>p(V.target.value),className:"mt-0.5 w-full bg-muted/60 rounded-xl px-3 py-2 text-sm outline-none focus:ring-2 focus:ring-primary/30"})]})]}),a.jsx("div",{className:"flex justify-end",children:a.jsx("button",{onClick:$,disabled:!r.trim()||!b||E,className:"px-4 py-2 rounded-full bg-primary text-primary-foreground text-xs font-semibold disabled:opacity-50 transition",children:E?"Publishing...":"Publish event"})})]})}function mN(){const[l,i]=m.useState([]),[r,u]=m.useState(!1),[f,h]=m.useState(!1);return m.useEffect(()=>{let g=!0;return K.get("/api/neighborhood/events").then(w=>g&&i(w.events)).catch(()=>g&&B.error("Couldn't load events.")).finally(()=>g&&u(!0)),()=>{g=!1}},[]),m.useEffect(()=>{const g=Js(),w=p=>[...p].sort((E,I)=>new Date(E.startsAt).getTime()-new Date(I.startsAt).getTime()),b=({event:p})=>i(E=>E.some(I=>I.id===p.id)?E:w([...E,p])),x=({eventId:p,rsvpYes:E,rsvpMaybe:I})=>i($=>$.map(V=>V.id===p?{...V,rsvpYes:E,rsvpMaybe:I}:V)),N=({eventId:p})=>i(E=>E.map(I=>I.id===p?{...I,isCancelled:!0}:I));return g.on("event:new",b),g.on("event:rsvp",x),g.on("event:cancelled",N),(
15)=>{g.off("event:new",b),g.off("event:rsvp",x),g.off("event:cancelled",N)}},[]),a.jsxs("div",{className:"space-y-4",children:[f?a.jsx(fN,{onCreated:g=>{i(w=>[...w.filter(b=>b.id!==g.id),g].sort((b,x)=>new Date(b.startsAt).getTime()-new Date(x.startsAt).getTime())),h(!1)},onClose:()=>h(!1)}):a.jsxs("button",{onClick:()=>h(!0),className:"w-full flex items-center justify-center gap-2 py-3 rounded-3xl bg-card border text-sm font-medium text-muted-foreground hover:bg-accent/40 transition shadow-sm",children:[a.jsx(k0,{className:"w-4 h-4"})," Host an event"]}),!r&&a.jsx("section",{className:"rounded-3xl bg-card border p-4 shadow-sm space-y-3 animate-pulse",children:[0,1].map(g=>a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-12 h-12 rounded-2xl bg-muted shrink-0"}),a.jsxs("div",{className:"flex-1 space-y-2",children:[a.jsx("div",{className:"h-3 w-1/3 rounded bg-muted"}),a.jsx("div",{className:"h-3 w-2/3 rounded bg-muted"})]})]},g))}),r&&l.length===0&&a.jsxs("section",{className:"rounded-3xl bg-card border p-6 text-center shadow-sm",children:[a.jsx("div",{className:"mx-auto w-12 h-12 rounded-2xl bg-accent/50 grid place-items-center mb-3",children:a.jsx(Dr,{className:"w-5 h-5 text-primary"})}),a.jsx("h3",{className:"font-semibold font-display tracking-tight",children:"Nothing on the calendar"}),a.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Host the first event for your neighbors."})]}),l.map(g=>{const w=new Date(g.startsAt);return a.jsx("button",{onClick:()=>be({view:"event",id:g.id}),className:"w-full text-left rounded-3xl bg-card border p-4 shadow-sm hover:border-primary/40 transition",children:a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx("div",{className:`w-12 h-12 rounded-2xl grid place-items-center shrink-0 leading-none ${g.isCancelled?"bg-muted text-muted-foreground":"bg-accent/50 text-accent-foreground"}`,children:a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"text-[9px] font-semibold uppercase tracking-wide",children:w.toLocaleDateString("en-US",{month:"short"})}),a.jsx("div",{className:"text-base font-bold tabular-nums",children:w.getDate()})]})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[a.jsx("span",{className:`text-sm font-semibold truncate ${g.isCancelled?"line-through text-muted-foreground":""}`,children:g.title}),g.isCancelled&&a.jsx("span",{className:"px-2 py-0.5 rounded-full bg-destructive/10 text-destructive text-[10px] font-semibold uppercase tracking-wide shrink-0",children:"Cancelled"})]}),a.jsx("div",{className:"text-[11px] text-muted-foreground mt-0.5",children:cN(g.startsAt)}),g.locationText&&a.jsxs("div",{className:"flex items-center gap-1 text-[11px] text-muted-foreground mt-0.5 min-w-0",children:[a.jsx(Xn,{className:"w-3 h-3 shrink-0"}),a.jsx("span",{className:"truncate",children:g.locationText})]}),a.jsxs("div",{className:"flex items-center gap-2 mt-1.5 text-[11px] text-muted-foreground",children:[a.jsxs("span",{children:[g.rsvpYes," going",g.rsvpMaybe>0?` · ${g.rsvpMaybe} maybe`:""]}),g.myRsvp==="yes"&&a.jsx("span",{className:"px-2 py-0.5 rounded-full bg-primary/10 text-primary font-semibold",children:"You are going"}),g.myRsvp==="maybe"&&a.jsx("span",{className:"px-2 py-0.5 rounded-full bg-accent/50 text-accent-foreground font-semibold",children:"Maybe"})]})]})]})},g.id)})]})}function hN({sub:l="recs"}){return a.jsxs("div",{className:"space-y-4 pb-6",children:[a.jsx("div",{className:"flex items-center gap-1.5 overflow-x-auto pb-0.5 -mx-1 px-1",children:oN.map(i=>{const r=l===i.id;return a.jsx("button",{onClick:()=>be({view:"discover",sub:i.id}),className:`flex items-center gap-1.5 px-3.5 py-1.5 rounded-full text-xs font-semibold border transition whitespace-nowrap shrink-0 ${r?"bg-primary text-primary-foreground border-primary":"bg-card text-muted-foreground hover:bg-accent/40"}`,"aria-pressed":r,children:i.label},i.id)})}),l==="groups"&&a.jsx(dN,{}),l==="events"&&a.jsx(mN,{}),l==="sale"&&a.jsx(eN,{}),l==="recs"&&a.jsx(rN,{}),l==="map"&&a.jsx(nN,{})]})}const mp=20;function hp(){window.history.length>1?window.history.back():be({view:"discover",sub:"groups"})}function pN({id:l}){const[i,r]=m.useState(null),[u,f]=m.useState(!1),[h,g]=m.useState(!1),[w,b]=m.useState(!1),[x,N]=m.useState(!1),[p,E]=m.useState([]),[I,$]=m.useState(!1),[V,P]=m.useState(!1),[G,O]=m.useState(!1),D=!!i?.canRead;m.useEffect(()=>{let ae=!0;return r(null),f(!1),g(!1),E([]),$(!1),P(!1),K.get(`/api/neighborhood/groups/${l}`).then(C=>ae&&r(C.group)).catch(()=>ae&&g(!0)).finally(()=>ae&&f(!0)),()=>{ae=!1}},[l]),m.useEffect(()=>{if(!D)return;let ae=!0;return K.get(`/api/neighborhood/groups/${l}/feed?limit=${mp}`).then(C=>{ae&&(E(C.posts),P(C.hasMore))}).catch(()=>ae&&B.error("Couldn't load the group feed.")).finally(()=>ae&&$(!0)),()=>{ae=!1}},[l,D]);const R=m.useCallback(async()=>
15{if(!(G||!p.length)){O(!0);try{const ae=p[p.length-1],C=await K.get(`/api/neighborhood/groups/${l}/feed?before=${encodeURIComponent(ae.id)}&limit=${mp}`);E(H=>{const re=new Set(H.map(de=>de.id));return[...H,...C.posts.filter(de=>!re.has(de.id))]}),P(C.hasMore)}catch{B.error("Couldn't load more posts.")}finally{O(!1)}}},[l,G,p]),Z=async()=>{if(!(!i||w)){b(!0);try{const ae=await K.post(`/api/neighborhood/groups/${i.id}/join`);B.success(ae.myStatus==="pending"?"Join request sent.":`You joined ${i.name}.`);const C=await K.get(`/api/neighborhood/groups/${i.id}`);r(C.group)}catch{B.error("Couldn't join the group.")}finally{b(!1)}}},k=async()=>{if(!(!i||w)){b(!0),N(!1);try{await K.post(`/api/neighborhood/groups/${i.id}/leave`),B.success(`You left ${i.name}.`);const ae=await K.get(`/api/neighborhood/groups/${i.id}`);r(ae.group),E([]),$(!1)}catch{B.error("Couldn't leave the group.")}finally{b(!1)}}},T=async(ae,C)=>{if(!i)return;const H=i;r({...i,pendingRequests:(i.pendingRequests||[]).filter(re=>re.memberId!==ae),memberCount:C?i.memberCount+1:i.memberCount});try{await K.post(`/api/neighborhood/groups/${i.id}/approve`,{memberId:ae,approve:C}),B.success(C?"Request approved.":"Request declined.")}catch{r(H),B.error("Couldn't update the request.")}},A=async ae=>{E(C=>C.map(H=>H.id===ae?{...H,reactedByMe:!H.reactedByMe,reactionCount:H.reactionCount+(H.reactedByMe?-1:1)}:H));try{const C=await K.post(`/api/neighborhood/posts/${ae}/react`);E(H=>H.map(re=>re.id===ae?{...re,reactedByMe:C.reacted,reactionCount:C.reactionCount}:re))}catch{E(C=>C.map(H=>H.id===ae?{...H,reactedByMe:!H.reactedByMe,reactionCount:H.reactionCount+(H.reactedByMe?-1:1)}:H)),B.error("Couldn't update your reaction.")}},se=async ae=>{const C=p;E(H=>H.filter(re=>re.id!==ae));try{await K.del(`/api/neighborhood/posts/${ae}`),B.success("Post deleted.")}catch{E(C),B.error("Couldn't delete the post.")}};if(u&&(h||!i))return a.jsxs("div",{className:"space-y-4 pb-6",children:[a.jsxs("button",{onClick:hp,className:"flex items-center gap-2 text-sm font-medium text-muted-foreground hover:text-foreground transition",children:[a.jsx(At,{className:"w-4 h-4"})," Back"]}),a.jsxs("section",{className:"rounded-3xl bg-card border p-6 text-center shadow-sm",children:[a.jsx("h3",{className:"font-semibold font-display tracking-tight",children:"This group is not available"}),a.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"It may have been removed, or the link is wrong."})]})]});if(!i)return a.jsx("div",{className:"space-y-4 pb-6",children:a.jsxs("section",{className:"rounded-3xl bg-card border p-4 shadow-sm space-y-3 animate-pulse",children:[a.jsx("div",{className:"h-4 w-1/2 roun
15ded bg-muted"}),a.jsx("div",{className:"h-3 w-1/3 rounded bg-muted"}),a.jsx("div",{className:"h-3 w-2/3 rounded bg-muted"})]})});const J=i.myStatus==="active",Q=i.myStatus==="pending",te=i.myStatus==="banned",ne=i.myRole==="owner",ie=i.pendingRequests||[];return a.jsxs("div",{className:"space-y-4 pb-6",children:[a.jsxs("button",{onClick:hp,className:"flex items-center gap-2 text-sm font-medium text-muted-foreground hover:text-foreground transition",children:[a.jsx(At,{className:"w-4 h-4"})," Back"]}),a.jsxs("section",{className:"rounded-3xl bg-card border p-4 lg:p-5 shadow-sm",children:[a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx("span",{className:"w-11 h-11 rounded-2xl bg-accent/50 grid place-items-center shrink-0",children:i.privacy==="private"?a.jsx(Ql,{className:"w-5 h-5 text-primary"}):a.jsx(Ia,{className:"w-5 h-5 text-primary"})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("h2",{className:"font-semibold font-display tracking-tight text-lg truncate",children:i.name}),a.jsxs("div",{className:"text-[11px] text-muted-foreground mt-0.5",children:[i.privacy==="private"?"Private group":"Public group"," ·"," ",i.memberCount===1?"1 member":`${i.memberCount} members`,ne?" · You are the owner":""]})]}),!te&&(ne?null:J?x?a.jsxs("span",{className:"flex items-center gap-1.5 shrink-0",children:[a.jsx("button",{onClick:k,disabled:w,className:"px-3 py-1.5 rounded-full bg-destructive text-destructive-foreground text-xs font-semibold disabled:opacity-50",children:"Leave"}),a.jsx("button",{onClick:()=>N(!1),className:"px-3 py-1.5 rounded-full bg-muted text-xs font-medium",children:"Cancel"})]}):a.jsx("button",{onClick:()=>N(!0),className:"px-3.5 py-1.5 rounded-full border text-xs font-semibold text-muted-foreground hover:bg-muted transition shrink-0",children:"Leave"}):Q?a.jsx("span",{className:"px-3.5 py-1.5 rounded-full border text-xs font-semibold text-muted-foreground shrink-0",children:"Pending"}):a.jsx("button",{onClick:Z,disabled:w,className:"px-3.5 py-1.5 rounded-full bg-primary text-primary-foreground text-xs font-semibold disabled:opacity-50 shrink-0",children:i.privacy==="private"?"Ask to join":"Join"}))]}),i.description&&a.jsx("p",{className:"text-sm text-foreground/90 mt-3",children:i.description})]}),ne&&ie.length>0&&a.jsxs("section",{className:"rounded-3xl bg-card border p-4 shadow-sm",children:[a.jsx("h3",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground mb-2",children:"Join requests"}),a.jsx("div",{className:"space-y-2",children:ie.map(ae=>a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("div",{className:"text-sm font-medium truncate",children:ae.displayName}),a.jsxs("div",{className:"text-[11px] text-muted-foreground",children:["Requested ",Je(ae.requestedAt)]})]}),a.jsxs("button",{onClick:()=>T(ae.memberId,!0),className:"flex items-center gap-1 px-3 py-1.5 rounded-full bg-primary text-primary-foreground text-xs font-semibold",children:[a.jsx(Il,{className:"w-3.5 h-3.5"})," Approve"]}),a.jsxs("button",{onClick:()=>T(ae.memberId,!1),className:"flex items-center gap-1 px-3 py-1.5 rounded-full bg-muted text-xs font-medium",children:[a.jsx(We,{className:"w-3.5 h-3.5"})," Decline"]})]},ae.memberId))})]}),!D&&a.jsxs("section",{className:"rounded-3xl bg-card border p-6 text-center shadow-sm",children:[a.jsx("div",{className:"mx-auto w-12 h-12 rounded-2xl bg-accent/50 grid place-items-center mb-3",children:a.jsx(Ql,{className:"w-5 h-5 text-primary"})}),a.jsx("h3",{className:"font-semibold font-display tracking-tight",children:"This group is private"}),a.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Ask to join to see what members are sharing."})]}),D&&a.jsxs(a.Fragment,{children:[J&&a.jsx(ng,{groupId:i.id,onPosted:ae=>E(C=>C.some(H=>H.id===ae.id)?C:[ae,...C])}),I&&p.length===0&&a.jsxs("section",{className:"rounded-3xl bg-card border p-6 text-center shadow-sm",children:[a.jsx("h3",{className:"font-semibold font-display tracking-tight",children:"Quiet in here so far"}),a.jsxs("p",{className:"text-sm text-muted-foreground mt-1",children:["Be the first to post in ",i.name,"."]})]}),p.map(ae=>a.jsx(qu,{post:ae,onReact:()=>A(ae.id),onDelete:()=>se(ae.id),onOpenComments:()=>be({view:"post",id:Number(ae.id)}),onPollChange:C=>E(H=>H.map(re=>re.id===ae.id?{...re,poll:C}:re))},ae.id)),V&&a.jsx("button",{onClick:R,disabled:G,className:"w-full py-3 rounded-3xl bg-card border text-sm font-medium text-muted-foreground hover:bg-accent/40 transition disabled:opacity-50 shadow-sm",children:G?"Loading...":"Load more"})]})]})}function pp(){window.history.length>1?window.history.back():be({view:"discover",sub:"events"})}function gN(l){return new Date(l).toLocaleDateString("en-US",{weekday:"long",month:"long",day:"numeric"})}function gp(l){return new Date(l).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit"})}const xN=[{id:"yes",label:"Going",icon:a.jsx(Il,{className:"w-4 h-4"})},{id:"maybe",label:"Maybe",icon:a.jsx(U0,{className:"w-4 h-4"})},{id:"no",label:"Not going",icon:a.jsx(We,{className:"w-4 h-4"})}];function yN({id:l}){const{member:i}=ot(),[r,u]=m.useState(null),[f,h]=m.useState([]),[g,w]=m.useState(!1),[b,x]=m.useState(!1),[N,p]=m.useState(!1),[E,I]=m.useState(!1),[$,V]=m.useState(!1);m.useEffect(()=>{let k=!0;return u(null),h([]),w(!1),x(!1),K.get(`/api/neighborhood/events/${l}`).then(T=>{k&&(u(T.event),h(T.attendees))}).catch(()=>k&&x(!0)).finally(()=>k&&w(!0)),()=>{k=!1}},[l]),m.useEffect(()=>{const k=Js(),T=({eventId:se,rsvpYes:J,rsvpMaybe:Q})=>u(te=>te&&te.id===se?{...te,rsvpYes:J,rsvpMaybe:Q}:te),A=({eventId:se})=>u(J=>J&&J.id===se?{...J,isCancelled:!0}:J);return k.on("event:rsvp",T),k.on("event:cancelled",A),()=>{k.off("event:rsvp",T),k.off("event:cancelled",A)}},[]);const P=async k=>
15{if(!(!r||N||r.myRsvp===k)){p(!0);try{const T=await K.post(`/api/neighborhood/events/${r.id}/rsvp`,{status:k});u(A=>A&&{...A,myRsvp:T.myRsvp,rsvpYes:T.rsvpYes,rsvpMaybe:T.rsvpMaybe}),h(A=>{const se=A.filter(J=>J.memberId!==i?.id);return(k==="yes"||k==="maybe")&&i?[...se,{memberId:i.id,displayName:i.displayName,avatarUrl:i.avatarUrl,status:k}]:se})}catch{B.error("Couldn't save your RSVP.")}finally{p(!1)}}},G=async()=>{if(!(!r||$)){V(!0),I(!1);try{await K.post(`/api/neighborhood/events/${r.id}/cancel`),u(k=>k&&{...k,isCancelled:!0}),B.success("Event cancelled.")}catch{B.error("Couldn't cancel the event.")}finally{V(!1)}}};if(g&&(b||!r))return a.jsxs("div",{className:"space-y-4 pb-6",children:[a.jsxs("button",{onClick:pp,className:"flex items-center gap-2 text-sm font-medium text-muted-foreground hover:text-foreground transition",children:[a.jsx(At,{className:"w-4 h-4"})," Back"]}),a.jsxs("section",{className:"rounded-3xl bg-card border p-6 text-center shadow-sm",children:[a.jsx("h3",{className:"font-semibold font-display tracking-tight",children:"This event is not available"}),a.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"It may have been removed, or the link is wrong."})]})]});if(!r)return a.jsx("div",{className:"space-y-4 pb-6",children:a.jsxs("section",{className:"rounded-3xl bg-card border p-4 shadow-sm space-y-3 animate-pulse",children:[a.jsx("div",{className:"h-4 w-2/3 rounded bg-muted"}),a.jsx("div",{className:"h-3 w-1/2 rounded bg-muted"}),a.jsx("div",{className:"h-3 w-1/3 rounded bg-muted"})]})});const O=!!(i&&r.host&&r.host.memberId===i.id),D=r.host?.displayName||"A neighbor",R=f.filter(k=>k.status==="yes"),Z=f.filter(k=>k.status==="maybe");return a.jsxs("div",{className:"space-y-4 pb-6",children:[a.jsxs("button",{onClick:pp,className:"flex items-center gap-2 text-sm font-medium text-muted-foreground hover:text-foreground transition",children:[a.jsx(At,{className:"w-4 h-4"})," Back"]}),r.isCancelled&&a.jsx("section",{className:"rounded-3xl border border-destructive/40 bg-destructive/10 p-4 shadow-sm",children:a.jsx("p",{className:"text-sm font-semibold text-destructive",children:"This event has been cancelled."})}),a.jsxs("section",{className:"rounded-3xl bg-card border p-4 lg:p-5 shadow-sm",children:[a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx("span",{className:"w-11 h-11 rounded-2xl bg-accent/50 grid place-items-center shrink-0",children:a.jsx(Dr,{className:"w-5 h-5 text-primary"})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("h2",{className:`font-semibold font-display tracking-tight text-lg ${r.isCancelled?"line-through text-muted-foreground":""}`,children:r.title}),a.jsxs("div",{className:"text-sm text-foreground/90 mt-1",children:[gN(r.startsAt),a.jsxs("span",{className:"text-muted-foreground",children:[" · ",gp(r.startsAt),r.endsAt?` to ${gp(r.endsAt)}`:""]})]}),r.locationText&&a.jsxs("div",{className:"flex items-center gap-1.5 text-sm text-muted-foreground mt-1 min-w-0",children:[a.jsx(Xn,{className:"w-3.5 h-3.5 shrink-0"}),a.jsx("span",{className:"truncate",children:r.locationText})]}),a.jsxs("div",{className:"flex items-center gap-2 mt-2.5",children:[a.jsx(ut,{name:D,initials:dt(D),src:r.host?.avatarUrl,size:24}),a.jsxs("span",{className:"text-[11px] text-muted-foreground",children:["Hosted by ",O?"you":D]})]})]})]}),r.description&&a.jsx("p",{className:"text-[15px] leading-relaxed whitespace-pre-wrap mt-3",children:r.description}),!r.isCancelled&&a.jsxs("div",{className:"mt-4 pt-3 border-t",children:[a.jsxs("div",{className:"text-[11px] text-muted-foreground mb-2",children:[r.rsvpYes," going",r.rsvpMaybe>0?` · ${r.rsvpMaybe} maybe`:""]}),a.jsx("div",{className:"flex items-center gap-1.5 flex-wrap",children:xN.map(k=>{const T=r.myRsvp===k.id;return a.jsxs("button",{onClick:()=>P(k.id),disabled:N,className:`flex items-center gap-1.5 px-3.5 py-2 rounded-full text-xs font-semibold border transition disabled:opacity-50 ${T?k.id==="no"?"bg-muted border-transparent text-foreground":"bg-primary text-primary-foreground border-primary":"bg-card text-muted-foreground hover:bg-accent/40"}`,"aria-pressed":T,children:[k.icon,k.label]},k.id)})})]}),O&&!r.isCancelled&&a.jsx("div",{className:"mt-3 pt-3 border-t",children:E?a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-xs font-medium flex-1",children:"Cancel this event for everyone?"}),a.jsx("button",{onClick:G,disabled:$,className:"px-3 py-1.5 rounded-full bg-destructive text-destructive-foreground text-xs font-semibold disabled:opacity-50",children:"Cancel event"}),a.jsx("button",{onClick:()=>I(!1),className:"px-3 py-1.5 rounded-full bg-muted text-xs font-medium",children:"Keep it"})]}):a.jsx("button",{onClick:()=>I(!0),className:"text-xs font-semibold text-destructive hover:underline",children:"Cancel this event"})})]}),(R.length>0||Z.length>0)&&a.jsxs("section",{className:"rounded-3xl bg-card border p-4 shadow-sm space-y-3",children:[R.length>0&&a.jsxs("div",{children:[a.jsxs("h3",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground mb-2",children:["Going (",R.length,")"]}),a.jsx("div",{className:"flex flex-wrap gap-2",children:R.map(k=>a.jsxs("span",{className:"flex items-center gap-1.5 pl-1 pr-2.5 py-1 rounded-full bg-muted/60",children:[a.jsx(ut,{name:k.displayName,initials:dt(k.displayName),src:k.avatarUrl,size:22}),a.jsx("span",{className:"text-xs font-medium",children:k.displayName})]},k.memberId))})]}),Z.length>0&&a.jsxs("div",{children:[a.jsxs("h3",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground mb-2",children:["Maybe (",Z.length,")"]}),a.jsx("div",{className:"flex flex-wrap gap-2",children:Z.map(k=>a.jsxs("span",{className:"flex items-center gap-1.5 pl-1 pr-2.5 py-1 rounded-full bg-muted/60",children:[a.jsx(ut,{name:k.displayName,initials:dt(k.displayName),src:k.avatarUrl,size:22}),a.jsx("span",{className:"text-xs font-medium",children:k.displayName})]},k.memberId))})]})]})]})}function bN(){const[l,i]=m.useState([]),[r,u]=m.useState(!1),f=m.useCallback(async()=>{try{const h=await K.get("/api/neighborhood/threads");i(h.threads)}catch{r||B.error("Couldn't load your messages.")}finally{u(!0)}},[]);return m.useEffect(()=>{f()},[f]),m.useEffect(()=>{const h=Js(),g=()=>f();return h.on("message:new",g),()=>{h.off("message:new",g)}},[f]),a.jsxs("div",{className:"space-y-4 pb-6",children:[!r&&a.jsx("section",{className:"rounded-3xl bg-card border p-4 shadow-sm space-y-3 animate-pulse",children:[0,1,2].map(h=>a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-11 h-11 rounded-full bg-muted shrink-0"}),a.jsxs("div",{className:"flex-1 space-y-2",children:[a.jsx("div",{className:"h-3 w-1/3 rounded bg-muted"}),a.jsx("div",{className:"h-3 w-2/3 rounded bg-muted"})]})]},h))}),r&&l.length===0&&a.jsxs("section",{className:"rounded-3xl bg-card border p-6 text-center shadow-sm",children:[a.jsx("div",{className:"mx-auto w-12 h-12 rounded-2xl bg-accent/50 grid place-items-center mb-3",children:a.jsx(Fl,{className:"w-5 h-5 text-primary"})}),a.jsx("h3",{className:"font-semibold font-display tracking-tight",children:"No conversations yet"}),a.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Message a neighbor from their profile and it will show up here."})]}),r&&l.length>0&&a.jsx("section",{className:"rounded-3xl bg-card border shadow-sm overflow-hidden divide-y",children:l.map(h=>{const g=h.name||"Neighbor";return a.jsxs("button",{onClick:()=>be({view:"thread",id:Number(h.id)}),className:"w-full flex items-center gap-3 px-4 py-3.5 text-left hover:bg-accent/30 transition",children:[a.jsx(ut,{name:g,initials:dt(g),src:h.otherMember?.avatarUrl,size:44}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:`text-sm truncate ${h.unread>0?"font-semibold":"font-medium"}`,children:g}),a.jsx("span",{className:"ml-auto text-[11px] text-muted-foreground shrink-0",children:Je(h.lastMessageAt)}
15)]}),a.jsxs("div",{className:"flex items-center gap-2 mt-0.5",children:[a.jsx("span",{className:`text-xs truncate ${h.unread>0?"text-foreground font-medium":"text-muted-foreground"}`,children:h.lastMessage===""?"Message removed":h.lastMessage||"No messages yet"}),h.unread>0&&a.jsx("span",{className:"ml-auto min-w-[18px] h-[18px] px-1 rounded-full bg-primary text-primary-foreground text-[10px] font-semibold grid place-items-center tabular-nums shrink-0",children:h.unread>99?"99+":h.unread})]})]})]},h.id)})})]})}const xp=50;function yp(){window.history.length>1?window.history.back():be({view:"messages"})}function hu(l){const i=new Date(l),r=new Date,u=g=>new Date(g.getFullYear(),g.getMonth(),g.getDate()).getTime(),f=Math.round((u(r)-u(i))/864e5);if(f===0)return"Today";if(f===1)return"Yesterday";const h=i.getFullYear()===r.getFullYear()?{month:"short",day:"numeric"}:{month:"short",day:"numeric",year:"numeric"};return i.toLocaleDateString("en-US",h)}function vN(l){return new Date(l).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit"})}function NN({id:l}){const{member:i,refreshDmUnread:r}=ot(),u=String(l),f=i?.id,[h,g]=m.useState([]),[w,b]=m.useState(null),[x,N]=m.useState(!1),[p,E]=m.useState(!1),[I,$]=m.useState(!1),[V,P]=m.useState(!1),[G,O]=m.useState(""),[D,R]=m.useState(!1),Z=m.useRef(null),k=m.useRef(null),T=m.useRef(0),A=m.useRef(!1),se=ne=>{const ie=Number(ne);!ie||ie<=T.current||(T.current=ie,K.post(`/api/neighborhood/threads/${u}/read`,{messageId:ne}).then(()=>r()).catch(()=>{}))};m.useEffect(()=>{let ne=!0;T.current=0,g([]),b(null),N(!1),E(!1),$(!1),K.get(`/api/neighborhood/threads/${u}/messages`).then(C=>{if(!ne)return;g(C.messages),$(C.messages.length>=xp);const H=C.messages[C.messages.length-1];H&&se(H.id)}).catch(()=>ne&&E(!0)).finally(()=>ne&&N(!0)),K.get("/api/neighborhood/threads").then(C=>{ne&&b(C.threads.find(H=>H.id===u)||null)}).catch(()=>{});const ie=Js();ie.emit("thread:subscribe",{threadId:u},()=>{});const ae=({message:C})=>{C.threadId===u&&(g(H=>H.some(re=>re.id===C.id)?H:[...H,C]),C.sender.memberId!==f&&se(C.id))};return ie.on("message:new",ae),()=>{ne=!1,ie.off("message:new",ae),e0()?.emit("thread:unsubscribe",{threadId:u})}},[u]),m.useEffect(()=>{if(A.current){A.current=!1;return}k.current?.scrollIntoView({block:"end"})},[h]);const J=async()=>{if(V||!h.length)return;P(!0);const ne=Z.current,ie=ne?ne.scrollHeight:0;try{const ae=h[0],C=await K.get(`/api/neighborhood/threads/${u}/messages?before=${encodeURIComponent(ae.id)}`);A.current=!0,g(H=>{const re=new Set(H.map(de=>de.id));return[...C.messages.filter(de=>!re.has(de.id)),...H]}),$(C.messages.length>=xp),requestAnimationFrame(()=>{ne&&(ne.scrollTop+=ne.scrollHeight-ie)})}catch{B.error("Couldn't load earlier messages.")}finally{P(!1)}},Q=async()=>{const ne=G.trim();if(!(!ne||D)){R(!0);try{const ie=await K.post(`/api/neighborhood/threads/${u}/messages`,{body:ne});g(ae=>ae.some(C=>C.id===ie.message.id)?ae:[...ae,ie.message]),O("")}catch(ie){Cr(ie)||B.error("Couldn't send your message.")}finally{R(!1)}}},te=w?.name||"Conversation";return x&&p?a.jsxs("div",{className:"space-y-4 pb-6",children:[a.jsxs("button",{onClick:yp,className:"flex items-center gap-2 text-sm font-medium text-muted-foreground hover:text-foreground transition",children:[a.jsx(At,{className:"w-4 h-4"})," Back"]}),a.jsxs("section",{className:"rounded-3xl bg-card border p-6 text-center shadow-sm",children:[a.jsx("h3",{className:"font-semibold font-display tracking-tight",children:"This conversation is not available"}),a.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"It may have been removed, or the link is wrong."})]})]}):a.jsxs("section",{className:"rounded-3xl bg-card border shadow-sm flex flex-col overflow-hidden h-[calc(100dvh-200px)] lg:h-[calc(100vh-160px)]",children:[a.jsxs("header",{className:"flex items-center gap-2 px-3 py-2.5 border-b shrink-0",children:[a.jsx("button",{onClick:yp,className:"w-9 h-9 rounded-full hover:bg-muted grid place-items-center text-muted-foreground","aria-label":"Back to messages",children:a.jsx(At,{className:"w-4 h-4"})}),a.jsx(ut,{name:te,initials:dt(te),src:w?.otherMember?.avatarUrl,size:36}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("div",{className:"text-sm font-semibold truncate",children:te}),a.jsx("div",{className:"text-[11px] text-muted-foreground",children:"Private conversation"})]})]}),a.jsxs("div",{ref:Z,className:"flex-1 overflow-y-auto px-3 py-3 space-y-1.5",children:[I&&a.jsx("button",{onClick:J,disabled:V,className:"w-full py-2 rounded-full text-xs font-medium text-muted-foreground hover:bg-muted transition disabled:opacity-50",children:V?"Loading...":"Load earlier"}),!x&&a.jsxs("div",{className:"space-y-2 animate-pulse pt-2",children:[a.jsx("div",{className:"h-8 w-2/3 rounded-2xl bg-muted"}
15),a.jsx("div",{className:"h-8 w-1/2 rounded-2xl bg-muted ml-auto"}),a.jsx("div",{className:"h-8 w-3/5 rounded-2xl bg-muted"})]}),x&&h.length===0&&a.jsx("div",{className:"py-10 text-center",children:a.jsxs("p",{className:"text-sm text-muted-foreground",children:["No messages yet. Say hello to ",w?.otherMember?.displayName||"your neighbor","."]})}),h.map((ne,ie)=>{const ae=ne.sender.memberId===f,C=h[ie-1],H=!C||hu(C.createdAt)!==hu(ne.createdAt);return a.jsxs("div",{children:[H&&a.jsxs("div",{className:"flex items-center gap-3 py-2",children:[a.jsx("span",{className:"flex-1 border-t"}),a.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:hu(ne.createdAt)}),a.jsx("span",{className:"flex-1 border-t"})]}),a.jsx("div",{className:`flex ${ae?"justify-end":"justify-start"}`,children:a.jsxs("div",{className:`max-w-[78%] rounded-2xl px-3.5 py-2 ${ae?"bg-primary text-primary-foreground rounded-br-md":"bg-muted rounded-bl-md"}`,children:[ne.mediaUrls.map(re=>a.jsx("img",{src:re,alt:"",className:"rounded-xl max-h-60 mb-1",loading:"lazy"},re)),ne.isDeleted?a.jsx("p",{className:"text-sm italic opacity-70",children:"Message removed"}):ne.body&&a.jsx("p",{className:"text-sm leading-relaxed whitespace-pre-wrap break-words",children:ne.body}),a.jsx("div",{className:`text-[10px] mt-0.5 ${ae?"text-primary-foreground/70":"text-muted-foreground"}`,children:vN(ne.createdAt)})]})})]},ne.id)}),a.jsx("div",{ref:k})]}),a.jsxs("form",{onSubmit:ne=>{ne.preventDefault(),Q()},className:"flex items-end gap-2 px-3 py-2.5 border-t shrink-0",children:[a.jsx("textarea",{value:G,onChange:ne=>O(ne.target.value),onKeyDown:ne=>{ne.key==="Enter"&&!ne.shiftKey&&(ne.preventDefault(),Q())},placeholder:"Type a message...",rows:1,className:"flex-1 resize-none bg-muted/60 rounded-2xl px-4 py-2.5 text-sm outline-none focus:ring-2 focus:ring-primary/30 placeholder:text-muted-foreground max-h-28"}),a.jsx("button",{type:"submit",disabled:D||!G.trim(),className:"w-10 h-10 rounded-full bg-primary text-primary-foreground grid place-items-center disabled:opacity-50 shrink-0","aria-label":"Send message",children:a.jsx(Vn,{className:"w-4 h-4"})})]})]})}const bp=30,jN=12,wN={moderator:"Moderator",lead:"Neighborhood lead"},SN={invite_not_found:"That code doesn't match any invite.",already_claimed:"That invite was already used.",invite_expired:"That invite has expired.",own_invite:"You can't redeem your own invite."};function CN({onClose:l}){const{refreshMe:i}=ot(),[r,u]=m.useState([]),[f,h]=m.useState(!1),[g,w]=m.useState(null),[b,x]=m.useState(!1),[N,p]=m.useState(!1),[E,I]=m.useState(""),[$,V]=m.useState(!1),P=m.useCallback(async()=>{try{const R=await K.get("/api/neighborhood/invites");u(R.invites)}catch{}finally{h(!0)}},[]);m.useEffect(()=>{P()},[P]);const G=async()=>{if(!b){x(!0);try{const R=await K.post("/api/neighborhood/invites",{channel:"link"});w(R.invite),p(!1),P()}catch{B.error("Couldn't create an invite link.")}finally{x(!1)}}},O=async()=>{if(g)try{await navigator.clipboard.writeText(g.url),p(!0),B.success("Invite link copied.")}catch{B.error("Couldn't copy the link. Long-press to copy it instead.")}},D=async()=>{const R=E.trim();if(!(!R||$)){V(!0);try{const Z=await K.post("/api/neighborhood/invites/redeem",{code:R});I(""),Z.upgraded?(B.success("Address confirmed. You are fully verified."),i()):B.success("Invite accepted.")}catch(Z){const k=Z instanceof tt?SN[Z.code]:null;B.error(k||"Couldn't redeem that code.")}finally{V(!1)}}};return a.jsxs("section",{className:"rounded-3xl bg-card border p-4 shadow-sm space-y-3",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h3",{className:"font-semibold font-display tracking-tight text-sm",children:"Invite neighbors"}),a.jsx("button",{onClick:l,className:"w-7 h-7 rounded-full hover:bg-muted grid place-items-center text-muted-foreground","aria-label":"Close",children:a.jsx(We,{className:"w-4 h-4"})})]}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Share a link with someone on your street. When they join with it, their address gets confirmed faster."}),g?a.jsxs("div",{className:"flex items-center gap-2 bg-muted/60 rounded-xl px-3 py-2",children:[a.jsx(wu,{className:"w-4 h-4 text-muted-foreground shrink-0"}),a.jsx("span",{className:"text-xs font-medium truncate flex-1",title:g.url,children:g.url}),a.jsxs("button",{onClick:O,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-full bg-primary text-primary-foreground text-[11px] font-semibold shrink-0",children:[N?a.jsx(Il,{className:"w-3 h-3"}):a.jsx(Vp,{className:"w-3 h-3"}),N?"Copied":"Copy"]})]}):a.jsxs("button",{onClick:G,disabled:b,className:"w-full flex items-center justify-center gap-2 py-2.5 rounded-full bg-primary text-primary-foreground text-xs font-semibold disabled:opacity-50 transition",children:[a.jsx(wu,{className:"w-4 h-4"}),b?"Creating...":"Create an invite link"]}),f&&r.length>0&&a.jsxs("div",{className:"space-y-1.5",children:[a.jsx("div",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Your inv
15ites"}),r.map(R=>a.jsxs("div",{className:"flex items-center gap-2 text-xs bg-muted/40 rounded-xl px-3 py-2",children:[a.jsx(V1,{className:"w-3.5 h-3.5 text-muted-foreground shrink-0"}),a.jsx("span",{className:"font-mono font-medium tracking-wide",children:R.code}),a.jsx("span",{className:"text-muted-foreground",children:Je(R.createdAt)}),a.jsx("span",{className:"ml-auto shrink-0",children:R.claimedBy?a.jsxs("span",{className:"px-2 py-0.5 rounded-full bg-primary/10 text-primary font-semibold",children:["Claimed by ",R.claimedBy.displayName]}):R.expiresAt&&new Date(R.expiresAt).getTime()<Date.now()?a.jsx("span",{className:"px-2 py-0.5 rounded-full bg-muted text-muted-foreground font-semibold",children:"Expired"}):a.jsx("span",{className:"px-2 py-0.5 rounded-full bg-accent/50 text-accent-foreground font-semibold",children:"Waiting"})})]},R.code))]}),a.jsxs("div",{className:"pt-2 border-t space-y-1.5",children:[a.jsx("div",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Have an invite code?"}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("input",{value:E,onChange:R=>I(R.target.value),placeholder:"Enter the code",maxLength:40,className:"flex-1 min-w-0 bg-muted/60 rounded-xl px-3 py-2 text-sm outline-none focus:ring-2 focus:ring-primary/30 placeholder:text-muted-foreground"}),a.jsx("button",{onClick:D,disabled:!E.trim()||$,className:"px-4 py-2 rounded-full bg-primary text-primary-foreground text-xs font-semibold disabled:opacity-50 shrink-0 transition",children:$?"Checking...":"Redeem"})]})]})]})}function kN(){const[l,i]=m.useState(null),[r,u]=m.useState(!1);if(m.useEffect(()=>{let g=!0;return K.get("/api/neighborhood/residents").then(w=>g&&i(w)).catch(()=>{}),()=>{g=!1}},[]),!l||l.residents.length===0)return null;const f=r?l.residents:l.residents.slice(0,jN),h=l.residents.length-f.length;return a.jsxs("section",{className:"rounded-3xl bg-card border p-4 shadow-sm",children:[a.jsxs("div",{className:"flex items-baseline justify-between gap-2 flex-wrap",children:[a.jsxs("h3",{className:"font-semibold font-display tracking-tight text-sm",children:["On ",l.streetName]}),a.jsxs("span",{className:"text-[11px] text-muted-foreground",children:[l.counts.homes===1?"1 home":`${l.counts.homes} homes`,", ",l.counts.members," on Neighborhood"]})]}),a.jsx("div",{className:"mt-2 divide-y",children:f.map(g=>{const w=a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"w-9 h-9 rounded-lg bg-muted grid place-items-center text-[11px] font-semibold tabular-nums shrink-0",children:g.houseNumber}),a.jsx("span",{className:"text-sm font-medium truncate",children:g.name}),g.isMember&&bs(g.verificationTier??0)&&a.jsx(es,{className:"w-3.5 h-3.5 text-primary shrink-0","aria-label":"Verified neighbor"}),g.isMe&&a.jsx("span",{className:"px-2 py-0.5 rounded-full bg-primary/10 text-primary text-[10px] font-semibold shrink-0",children:"You"})]});return g.isMember&&g.memberId?a.jsx("button",{onClick:()=>be({view:"profile",id:g.memberId}),className:"w-full flex items-center gap-3 py-2 text-left hover:bg-accent/20 transition rounded-lg px-1 -mx-1",children:w},g.homeownerId):a.jsx("div",{className:"flex items-center gap-3 py-2 px-1 -mx-1",children:w},g.homeownerId)})}),h>0&&a.jsxs("button",{onClick:()=>u(!0),className:"mt-2 w-full py-2 rounded-full border bg-card text-xs font-semibold text-muted-foreground hover:bg-accent/40 transition",children:["Show all ",l.counts.homes," homes"]})]})}function _N({n:l}){const i=wN[l.role];return a.jsx("button",{onClick:()=>be({view:"profile",id:l.memberId}),className:"w-full text-left rounded-3xl bg-card border p-4 shadow-sm hover:border-primary/40 transition",children:a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx(ut,{name:l.displayName,initials:dt(l.displayName),src:l.avatarUrl,size:44}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-1.5 min-w-0 flex-wrap",children:[a.jsx("span",{className:"text-sm font-semibold truncate",children:l.displayName}),bs(l.verificationTier)&&a.jsx(es,{className:"w-3.5 h-3.5 text-primary shrink-0","aria-label":"Verified neighbor"}),i&&a.jsx("span",{className:"px-2 py-0.5 rounded-full bg-accent/50 text-accent-foreground text-[10px] font-semibold shrink-0",children:i})]}),a.jsx("div",{className:"text-[11px] text-muted-foreground mt-0.5",children:l.lastSeenAt?`Active ${Je(l.lastSeenAt)}`:`Joined ${Je(l.joinedAt)}`}
15),l.bio&&a.jsx("p",{className:"text-sm text-foreground/90 mt-1.5 line-clamp-2",children:l.bio})]})]})})}function EN(){const[l,i]=m.useState([]),[r,u]=m.useState(0),[f,h]=m.useState(!1),[g,w]=m.useState(!1),[b,x]=m.useState(!1);m.useEffect(()=>{let p=!0;return K.get(`/api/neighborhood/neighbors?offset=0&limit=${bp}`).then(E=>{p&&(i(E.neighbors),u(E.total))}).catch(()=>p&&B.error("Couldn't load your neighbors.")).finally(()=>p&&h(!0)),()=>{p=!1}},[]);const N=async()=>{if(!g){w(!0);try{const p=await K.get(`/api/neighborhood/neighbors?offset=${l.length}&limit=${bp}`);i(E=>{const I=new Set(E.map($=>$.memberId));return[...E,...p.neighbors.filter($=>!I.has($.memberId))]}),u(p.total)}catch{B.error("Couldn't load more neighbors.")}finally{w(!1)}}};return a.jsxs("div",{className:"space-y-4 pb-6",children:[a.jsx(kN,{}),f&&a.jsxs("div",{className:"flex items-center gap-2 px-1",children:[a.jsx(Ia,{className:"w-4 h-4 text-primary"}),a.jsx("span",{className:"text-sm font-semibold",children:r===1?"1 neighbor":`${r.toLocaleString("en-US")} neighbors`}),a.jsx("span",{className:"text-xs text-muted-foreground",children:"in your neighborhood"})]}),b?a.jsx(CN,{onClose:()=>x(!1)}):a.jsxs("button",{onClick:()=>x(!0),className:"w-full flex items-center justify-center gap-2 py-3 rounded-3xl bg-card border text-sm font-medium text-muted-foreground hover:bg-accent/40 transition shadow-sm",children:[a.jsx(I1,{className:"w-4 h-4"})," Invite neighbors"]}),!f&&a.jsx("section",{className:"rounded-3xl bg-card border p-4 shadow-sm space-y-3 animate-pulse",children:[0,1,2].map(p=>a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-11 h-11 rounded-full bg-muted shrink-0"}),a.jsxs("div",{className:"flex-1 space-y-2",children:[a.jsx("div",{className:"h-3 w-1/3 rounded bg-muted"}),a.jsx("div",{className:"h-3 w-2/3 rounded bg-muted"})]})]},p))}),f&&l.length===0&&a.jsxs("section",{className:"rounded-3xl bg-card border p-6 text-center shadow-sm",children:[a.jsx("div",{className:"mx-auto w-12 h-12 rounded-2xl bg-accent/50 grid place-items-center mb-3",children:a.jsx(p1,{className:"w-5 h-5 text-primary"})}),a.jsx("h3",{className:"font-semibold font-display tracking-tight",children:"It's quiet so far"}),a.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"You are among the first here. Invite a neighbor to get things going."})]}),l.map(p=>a.jsx(_N,{n:p},p.memberId)),f&&l.length<r&&a.jsx("button",{onClick:N,disabled:g,className:"w-full py-3 rounded-3xl bg-card border text-sm font-medium text-muted-foreground hover:bg-accent/40 transition shadow-sm disabled:opacity-50",children:g?"Loading...":"Show more"})]})}async function TN(l){try{const i=await K.post("/api/neighborhood/dm",{memberId:l});return be({view:"thread",id:Number(i.thread.id)}),!0}catch(i){return i instanceof tt&&i.code==="verification_required"?B.error("Verify your profile to message neighbors."):i instanceof tt&&i.code==="address_verification_required"?B.error("Verify your address to message neighbors outside your neighborhood."):i instanceof tt&&i.code==="member_not_found"?B.error("That neighbor is no longer available."):B.error("Couldn't start the conversation."),!1}}
15function AN(){window.history.length>1?window.history.back():be({view:"neighbors"})}function MN(l){const i=new Date(l);return Number.isNaN(i.getTime())?"":i.toLocaleDateString("en-US",{month:"long",year:"numeric"})}function pu({value:l,label:i}){return a.jsxs("div",{className:"flex-1 text-center",children:[a.jsx("div",{className:"text-lg font-bold tabular-nums font-display",children:l.toLocaleString("en-US")}),a.jsx("div",{className:"text-[11px] text-muted-foreground",children:i})]})}function RN({id:l}){const{member:i}=ot(),[r,u]=m.useState(null),[f,h]=m.useState(!1),[g,w]=m.useState(!1),[b,x]=m.useState(!1),[N,p]=m.useState(!1),[E,I]=m.useState(!1),[$,V]=m.useState(!1),[P,G]=m.useState(!1),[O,D]=m.useState(null),[R,Z]=m.useState(!1),k=!!(i&&i.id===l);m.useEffect(()=>{let J=!0;return u(null),h(!1),w(!1),x(!1),K.get(`/api/neighborhood/members/${l}`).then(Q=>J&&u(Q.profile)).catch(Q=>{J&&(Q instanceof tt&&Q.code==="not_a_neighbor"?w(!0):x(!0))}).finally(()=>J&&h(!0)),()=>{J=!1}},[l]),m.useEffect(()=>{if(k)return;let J=!0;return V(!1),G(!1),D(null),K.get("/api/neighborhood/blocks").then(Q=>{J&&(V(Q.blocks.some(te=>te.memberId===l)),G(Q.mutes.some(te=>te.memberId===l)))}).catch(()=>{}),()=>{J=!1}},[l,k]);const T=async()=>{N||(p(!0),await TN(l),p(!1))},A=async J=>{if(!R){Z(!0),D(null);try{const Q=await K.post("/api/neighborhood/blocks",{memberId:l,blocked:J});V(Q.blocked),B.success(Q.blocked?"Blocked. You will no longer see each other's posts or messages.":"Unblocked. You can see each other again.")}catch{B.error("Couldn't update the block.")}finally{Z(!1)}}},se=async J=>{if(!R){Z(!0),D(null);try{const Q=await K.post("/api/neighborhood/mutes",{memberId:l,muted:J});G(Q.muted),B.success(Q.muted?"Muted. Their posts stay out of your feed.":"Unmuted. Their posts are back.")}catch{B.error("Couldn't update the mute.")}finally{Z(!1)}}};return a.jsxs("div",{className:"space-y-4 pb-6",children:[a.jsxs("button",{onClick:AN,className:"flex items-center gap-1.5 text-sm font-medium text-muted-foreground hover:text-foreground transition",children:[a.jsx(At,{className:"w-4 h-4"})," Neighbors"]}),!f&&a.jsxs("section",{className:"rounded-3xl bg-card border p-6 shadow-sm animate-pulse space-y-3",children:[a.jsx("div",{className:"mx-auto w-20 h-20 rounded-full bg-muted"}),a.jsx("div",{className:"h-4 w-1/3 mx-auto rounded bg-muted"}),a.jsx("div",{className:"h-3 w-1/2 mx-auto rounded bg-muted"})]}),f&&(g||b)&&a.jsxs("section",{className:"rounded-3xl bg-card border p-6 text-center shadow-sm",children:[a.jsx("div",{className:"mx-auto w-12 h-12 rounded-2xl bg-accent/50 grid place-items-center mb-3",children:a.jsx(W1,{className:"w-5 h-5 text-primary"})}),a.jsx("h3",{className:"font-semibold font-display tracking-tight",children:g?"Not in your neighborhood":"Profile unavailable"}),a.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:g?"You can only view profiles of people who share a neighborhood with you.":"This neighbor's profile couldn't be loaded."})]}),r&&a.jsxs(a.Fragment,{children:[a.jsxs("section",{className:"rounded-3xl bg-card border p-6 shadow-sm text-center",children:[a.jsx(ut,{name:r.displayName,initials:dt(r.displayName),src:r.avatarUrl,size:80,className:"mx-auto"}),a.jsxs("div",{className:"mt-3 flex items-center justify-center gap-1.5",children:[a.jsx("h2",{className:"text-lg font-semibold font-display tracking-tight",children:r.displayName}),bs(r.verificationTier)&&a.jsx(es,{className:"w-4 h-4 text-primary shrink-0","aria-label":"Verified neighbor"})]}),a.jsxs("p",{className:"text-[11px] text-muted-foreground mt-0.5",children:["Member since ",MN(r.joinedAt),r.lastSeenAt?` · Active ${Je(r.lastSeenAt)}`:""]}),r.bio&&a.jsx("p",{className:"text-sm text-foreground/90 mt-3 whitespace-pre-wrap",children:r.bio}),a.jsxs("div",{className:"mt-4 pt-4 border-t flex items-center",children:[a.jsx(pu,{value:r.stats.posts,label:r.stats.posts===1?"Post":"Posts"}),a.jsx(pu,{value:r.stats.comments,label:r.stats.comments===1?"Comment":"Comments"}),a.jsx(pu,{value:r.stats.recommendations,label:r.stats.recommendations===1?"Recommendation":"Recommendations"})]}),a.jsx("div",{className:"mt-4",children:k?a.jsxs("button",{onClick:()=>be({view:"settings"}),className:"inline-flex items-center gap-2 px-5 py-2.5 rounded-full bg-primary text-primary-foreground text-xs font-semibold transition",children:[a.jsx(Jp,{className:"w-3.5 h-3.5"})," Edit profile"]}):a.jsxs("button",{onClick:T,disabled:N,className:"inline-flex items-center gap-2 px-5 py-2.5 rounded-full bg-primary text-primary-foreground text-xs font-semibold disabled:opacity-50 transition",children:[a.jsx(Fl,{className:"w-3.5 h-3.5"})," Message"]})}),!k&&a.jsx("div",{className:"mt-3 pt-3 border-t",children:O?a.jsxs("div",{className:"flex items-center justify-center gap-2 flex-wrap text-xs",children:[a.jsx("span",{className:"font-medium",children:O==="block"?`Block ${r.displayName}? You will no longer see each other.`:`Mute ${r.displayName}? Their posts leave your feed.`}),a.jsx("button",{onClick:()=>O==="block"?A(!0):se(!0),disabled:R,className:"px-3 py-1.5 rounded-full bg-destructive text-destructive-foreground font-semibold disabled:opacity-50",children:O==="block"?"Block":"Mute"}),a.jsx("button",{onClick:()=>D(null),className:"px-3 py-1.5 rounded-full bg-muted font-medium",children:"Cancel"})]}):a.jsxs("div",{className:"flex items-center justify-center gap-2 flex-wrap",children:[a.jsxs("button",{onClick:()=>P?se(!1):D("mute"),disabled:R,className:"inline-flex items-center gap-1.5 px-3.5 py-1.5 rounded-full border text-[11px] font-semibold text-muted-foreground hover:text-foreground hover:bg-muted transition disabled:opacity-50",children:[a.jsx(Pp,{className:"w-3 h-3"})," ",P?"Unmute":"Mute"]}),a.jsxs("button",{onClick:()=>$?A(!1):D("block"),disabled:R,className:"inline-flex items-center gap-1.5 px-3.5 py-1.5 rounded-full border text-[11px] font-semibold text-muted-foreground hover:text-destructive hover:bg-destructive/10 transition disabled:opacity-50",children:[a.jsx(Hp,{className:"w-3 h-3"})," ",$?"Unblock":"Block"]}),a.jsxs("button",{onClick:()=>I(!0),className:"inline-flex items-center gap-1.5 px-3.5 py-1.5 rounded-full border text-[11px] font-semibold text-muted-foreground hover:text-foreground hover:bg-muted transition",children:[a.jsx(Zn,{className:"w-3 h-3"})," Report"]})]})})]}),r.neighborhoods.length>0&&a.jsxs("section",{className:"rounded-3xl bg-card border p-4 shadow-sm",children:[a.jsx("h3",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground mb-2",children:"Neighborhoods"}),a.jsx("div",{className:"flex items-center gap-1.5 flex-wrap",children:r.neighborhoods.map(J=>a.jsxs("span",{className:`inline-flex items-center gap-1.5 px-3 py-1.5 rounded-full text-[11px] font-semibold ${J.isHome?"bg-primary/10 text-primary":"bg-accent/50 text-accent-foreground"}`,children:[J.isHome&&a.jsx(Xp,{className:"w-3 h-3"}),J.name]},J.id))})]}),E&&a.jsx(Vr,{contentType:"member",contentId:l,onClose:()=>I(!1)})]})]})}function ON(){window.history.length>1?window.history.back():be({view:"home"})}
15function zN(l){return bs(l)?{title:"Fully verified",detail:"Your address is confirmed. Neighbors see the verified badge next to your name."}:Number(l??0)>=1?{title:"Partially verified",detail:"Your account is confirmed but your address isn't yet. Redeem a neighbor's invite or check again after updating your details."}:{title:"Not verified yet",detail:"Verify your address to unlock messaging, groups, and the verified badge."}}function BN(l){const i="=".repeat((4-l.length%4)%4),r=(l+i).replace(/-/g,"+").replace(/_/g,"/"),u=window.atob(r),f=new Uint8Array(new ArrayBuffer(u.length));for(let h=0;h<u.length;h++)f[h]=u.charCodeAt(h);return f}const DN=[{id:"off",label:"Off"},{id:"daily",label:"Daily"},{id:"weekly",label:"Weekly"}];function UN({body:l}){const i=l.split(/\n{2,}/).map(r=>r.trim()).filter(Boolean);return a.jsx("div",{className:"space-y-3",children:i.map((r,u)=>{const f=r.split(`
16`).map(g=>g.trim()).filter(Boolean);if(f.every(g=>/^[-*]\s+/.test(g)))return a.jsx("ul",{className:"list-disc pl-5 space-y-1 text-sm leading-relaxed",children:f.map((g,w)=>a.jsx("li",{children:g.replace(/^[-*]\s+/,"")},w))},u);const h=/^(#{1,6})\s+(.*)$/.exec(f[0]);return h&&f.length===1?a.jsx("h4",{className:"font-semibold font-display tracking-tight text-sm",children:h[2]},u):a.jsx("p",{className:"text-sm leading-relaxed whitespace-pre-wrap",children:r.replace(/^#{1,6}\s+/,"")},u)})})}function LN({onClose:l}){const[i,r]=m.useState(null),[u,f]=m.useState(!1),[h,g]=m.useState(!1);m.useEffect(()=>{let b=!0;return K.get("/api/neighborhood/guidelines").then(x=>b&&r(x.guidelines)).catch(()=>b&&B.error("Couldn't load the guidelines.")).finally(()=>b&&f(!0)),()=>{b=!1}},[]),m.useEffect(()=>{const b=x=>{x.key==="Escape"&&l()};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[l]);const w=async()=>{if(!(!i||h)){g(!0);try{await K.post("/api/neighborhood/guidelines/accept",{version:i.version}),B.success("Thanks for agreeing to the guidelines."),l()}catch{B.error("Couldn't record your agreement.")}finally{g(!1)}}};return a.jsxs("div",{className:"fixed inset-0 z-50 grid place-items-center p-4",children:[a.jsx("button",{className:"absolute inset-0 bg-foreground
16/25 backdrop-blur-[2px]",onClick:l,"aria-label":"Close"}),a.jsxs("div",{className:"relative w-full max-w-md bg-card border rounded-3xl shadow-[var(--shadow-warm)] flex flex-col max-h-[85vh]",children:[a.jsxs("header",{className:"px-5 pt-5 pb-3 flex items-center justify-between border-b",children:[a.jsxs("div",{className:"flex items-center gap-2.5",children:[a.jsx("span",{className:"w-9 h-9 rounded-xl bg-accent/50 grid place-items-center",children:a.jsx($p,{className:"w-4 h-4 text-primary"})}),a.jsxs("div",{className:"leading-tight",children:[a.jsx("h2",{className:"font-semibold font-display tracking-tight",children:"Community guidelines"}),i&&a.jsxs("p",{className:"text-[11px] text-muted-foreground",children:["Version ",i.version]})]})]}),a.jsx("button",{onClick:l,className:"w-9 h-9 rounded-full hover:bg-muted grid place-items-center text-muted-foreground shrink-0","aria-label":"Close guidelines",children:a.jsx(We,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"flex-1 overflow-y-auto px-5 py-4",children:[!u&&a.jsxs("div",{className:"animate-pulse space-y-2",children:[a.jsx("div",{className:"h-3 w-2/3 rounded bg-muted"}),a.jsx("div",{className:"h-3 w-full rounded bg-muted"}),a.jsx("div",{className:"h-3 w-1/2 rounded bg-muted"})]}),u&&i&&a.jsx(UN,{body:i.body}),u&&!i&&a.jsx("p",{className:"text-sm text-muted-foreground",children:"The guidelines couldn't be loaded right now."})]}),i&&a.jsx("footer",{className:"px-5 py-3 border-t flex justify-end",children:a.jsx("button",{onClick:w,disabled:h,className:"px-5 py-2 rounded-full bg-primary text-primary-foreground text-xs font-semibold disabled:opacity-50 transition",children:h?"Saving...":"I agree"})})]})]})}function qN(){const[l,i]=m.useState(""),[r,u]=m.useState(!1),[f,h]=m.useState(null),g=async()=>{if(!(r||l.trim().length<10)){u(!0);try{const w=await K.post("/api/neighborhood/report-bug",{description:l.trim(),page:window.location.pathname});h(w.ticketNumber),i(""),B.success("Bug report filed. Thank you!")}catch{B.error("Could not send the report. Please try again.")}finally{u(!1)}}};return a.jsxs("section",{className:"rounded-3xl bg-card border p-4 shadow-sm space-y-3",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(v0,{className:"w-4 h-4 text-muted-foreground"}),a.jsx("h3",{className:"font-semibold font-display tracking-tight text-sm",children:"Report a bug"})]}),f?a.jsxs("p",{className:"text-sm text-muted-foreground",children:["Thanks! Your report is in as ",a.jsx("span",{className:"font-semibold text-foreground",children:f}),". We read every one, and fixes usually land fast."]}):a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Something broken or acting strange? Tell us what happened and where."}),a.jsx("textarea",{value:l,onChange:w=>i(w.target.value),rows:3,maxLength:2e3,placeholder:"What went wrong?",className:"w-full bg-muted/60 rounded-xl px-3 py-2 text-sm outline-none focus:ring-2 focus:ring-primary/30 placeholder:text-muted-foreground resize-y"}),a.jsx("button",{onClick:g,disabled:r||l.trim().length<10,className:"px-4 py-2 rounded-full bg-primary text-primary-foreground text-xs font-semibold disabled:opacity-50",children:r?"Sending...":"Send report"})]})]})}function HN(){const{member:l,isModerator:i,refreshMe:r,signOut:u}=ot(),[f,h]=m.useState(l?.displayName||""),[g,w]=m.useState(l?.bio||""),[b,x]=m.useState(!!l?.showOnMap),[N,p]=m.useState(l?.avatarUrl||null),[E,I]=m.useState(!1),[$,V]=m.useState(!1),[P,G]=m.useState(!1),[O,D]=m.useState(!1),R=m.useRef(null),[Z,k]=m.useState(null),[T,A]=m.useState(!1),[se]=m.useState(()=>"serviceWorker"in navigator&&"PushManager"in window),[J,Q]=m.useState(!1),[te,ne]=m.useState(!1),[ie,ae]=m.useState([]),[C,H]=m.useState([]),[re,de]=m.useState(!1),[xe,v]=m.useState(null),[j,S]=m.useState(!1);m.useEffect(()=>{let me=!0;return K.get("/api/neighborhood/notifications/prefs").then(ce=>me&&k(ce.prefs)).catch(()=>{}),K.get("/api/neighborhood/blocks").then(ce=>{me&&(ae(ce.blocks),H(ce.mutes))}).catch(()=>{}).finally(()=>me&&de(!0)),()=>{me=!1}},[]),m.useEffect(()=>{se&&navigator.serviceWorker.getRegistration("/neighborhood/").then(me=>me?.pushManager.getSubscription()).then(me=>Q(!!me)).catch(()=>{})},[se]);const U=async()=>
16{if(!te){ne(!0);try{if(J){const ce=await(await navigator.serviceWorker.getRegistration("/neighborhood/"))?.pushManager.getSubscription();ce&&(await K.post("/api/neighborhood/push/unsubscribe",{endpoint:ce.endpoint}).catch(()=>{}),await ce.unsubscribe()),Q(!1),B.success("Push notifications turned off.")}else{if(await Notification.requestPermission()!=="granted"){B.error("Your browser blocked notifications. Check the site settings.");return}const{publicKey:ce}=await K.get("/api/neighborhood/push/public-key"),st=await(await navigator.serviceWorker.register("/neighborhood/sw.js",{scope:"/neighborhood/"})).pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:BN(ce)}),fs=st.toJSON();await K.post("/api/neighborhood/push/subscribe",{endpoint:st.endpoint,keys:fs.keys}),Q(!0),B.success("Push notifications are on.")}}catch{B.error("Couldn't update push notifications.")}finally{ne(!1)}}},le=async me=>{if(T)return;const ce=Z;k(me),A(!0);try{const Te=await K.put("/api/neighborhood/notifications/prefs",me);k(Te.prefs)}catch{k(ce),B.error("Couldn't save your notification settings.")}finally{A(!1)}},ue=async me=>{if(!xe){v(me.memberId);try{await K.post("/api/neighborhood/blocks",{memberId:me.memberId,blocked:!1}),ae(ce=>ce.filter(Te=>Te.memberId!==me.memberId)),B.success(`Unblocked ${me.displayName}.`)}catch{B.error("Couldn't unblock them.")}finally{v(null)}}},pe=async me=>{if(!xe){v(me.memberId);try{await K.post("/api/neighborhood/mutes",{memberId:me.memberId,muted:!1}),H(ce=>ce.filter(Te=>Te.memberId!==me.memberId)),B.success(`Unmuted ${me.displayName}.`)}catch{B.error("Couldn't unmute them.")}finally{v(null)}}},ye=async me=>{const ce=me?.[0];if(ce){if(!ce.type.startsWith("image/")){B.error("Pick an image file.");return}I(!0);try{const[Te]=await Rr([ce]);p(Te)}catch{B.error("Couldn't upload that photo.")}finally{I(!1),R.current&&(R.current.value="")}}},je=async()=>{const me=f.trim();if(!(!me||$)){V(!0);try{await K.put("/api/neighborhood/profile",{displayName:me,bio:g.trim(),showOnMap:b,...N!==(l?.avatarUrl||null)?{avatarUrl:N}:{}}),await r(),B.success("Profile saved.")}catch{B.error("Couldn't save your profile.")}finally{V(!1)}}},Ue=async()=>{if(!P){G(!0);try{(await K.post("/api/neighborhood/verify/refresh")).upgraded?(B.success("Address confirmed. You are fully verified."),await r()):B.info("No change yet. Your verification level is the same.")}catch{B.error("Couldn't check your verification.")}finally{G(!1)}}},gt=async()=>{O||(D(!0),await u())},Ct=zN(l?.verificationTier),Ts=f.trim()||l?.displayName||"You";return a.jsxs("div",{className:"space-y-4 pb-6",children:[a.jsxs("button",{onClick:ON,className:"flex items-center gap-1.5 text-sm font-medium text-muted-foreground hover:text-foreground transition",children:[a.jsx(At,{className:"w-4 h-4"})," Back"]}),a.jsxs("section",{className:"rounded-3xl bg-card border p-4 shadow-sm space-y-3",children:[a.jsx("h3",{className:"font-semibold font-display tracking-tight text-sm",children:"Your profile"}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsxs("div",{className:"relative shrink-0",children:[a.jsx(ut,{name:Ts,initials:dt(Ts),src:N,size:64}),a.jsx("button",{onClick:()=>R.current?.click(),disabled:E,className:"absolute -bottom-1 -right-1 w-7 h-7 rounded-full bg-primary text-primary-foreground grid place-items-center border-2 border-card disabled:opacity-50","aria-label":"Change photo",children:a.jsx(E0,{className:"w-3.5 h-3.5"})}),a.jsx("input",{ref:R,type:"file",accept:"image/*",className:"hidden",onChange:me=>ye(me.target.files)})]}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("div",{className:"text-xs text-muted-foreground",children:E?"Uploading photo...":"Tap the camera to change your photo."}),N&&a.jsxs("button",{onClick:()=>p(null),className:"mt-1 inline-flex items-center gap-1 text-[11px] font-medium text-muted-foreground hover:text-destructive transition",children:[a.jsx(We,{className:"w-3 h-3"})," Remove photo"]})]})]}),a.jsxs("label",{className:"block",children:[a.jsx("span",{className:"text-[11px] font-medium text-muted-foreground",children:"Display name"}),a.jsx("input",{value:f,onChange:me=>h(me.target.value),placeholder:"Your name",maxLength:80,className:"mt-0.5 w-full bg-muted/60 rounded-xl px-3 py-2 text-sm outline-none focus:ring-2 focus:ring-primary/30 placeholder:text-muted-foreground"})]}),a.jsxs("label",{className:"block",children:[a.jsx("span",{className:"text-[11px] font-medium text-muted-foreground",children:"Bio"}),a.jsx("textarea",{value:g,onChange:me=>
16w(me.target.value),placeholder:"A line or two about you (optional)",rows:3,maxLength:280,className:"mt-0.5 w-full resize-none bg-muted/60 rounded-xl px-3 py-2 text-sm outline-none focus:ring-2 focus:ring-primary/30 placeholder:text-muted-foreground"})]}),a.jsxs("button",{onClick:()=>x(me=>!me),className:"w-full flex items-center gap-3 bg-muted/40 rounded-xl px-3 py-2.5 text-left",role:"switch","aria-checked":b,children:[a.jsx(Xn,{className:"w-4 h-4 text-muted-foreground shrink-0"}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("div",{className:"text-sm font-medium",children:"Show me on the map"}),a.jsx("div",{className:"text-[11px] text-muted-foreground",children:"Neighbors can see roughly where you are."})]}),a.jsx("span",{className:`w-10 h-6 rounded-full p-0.5 transition shrink-0 ${b?"bg-primary":"bg-muted-foreground/30"}`,children:a.jsx("span",{className:`block w-5 h-5 rounded-full bg-card shadow transition-transform ${b?"translate-x-4":""}`})})]}),a.jsx("div",{className:"flex justify-end",children:a.jsx("button",{onClick:je,disabled:!f.trim()||$||E,className:"px-4 py-2 rounded-full bg-primary text-primary-foreground text-xs font-semibold disabled:opacity-50 transition",children:$?"Saving...":"Save changes"})})]}),a.jsxs("section",{className:"rounded-3xl bg-card border p-4 shadow-sm space-y-3",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(es,{className:`w-4 h-4 ${bs(l?.verificationTier)?"text-primary":"text-muted-foreground"}`}),a.jsx("h3",{className:"font-semibold font-display tracking-tight text-sm",children:Ct.t
16itle})]}),a.jsx("p",{className:"text-sm text-muted-foreground",children:Ct.detail}),!bs(l?.verificationTier)&&a.jsxs("button",{onClick:Ue,disabled:P,className:"flex items-center gap-2 px-4 py-2 rounded-full border bg-card text-xs font-semibold hover:bg-accent/40 disabled:opacity-50 transition",children:[a.jsx(Wl,{className:`w-3.5 h-3.5 ${P?"animate-spin":""}`}),P?"Checking...":"Check verification again"]})]}),Z&&a.jsxs("section",{className:"rounded-3xl bg-card border p-4 shadow-sm space-y-3",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(p0,{className:"w-4 h-4 text-muted-foreground"}),a.jsx("h3",{className:"font-semibold font-display tracking-tight text-sm",children:"Notifications"})]}),a.jsxs("div",{children:[a.jsx("div",{className:"text-[11px] font-medium text-muted-foreground mb-1.5",children:"Email digest"}),a.jsx("div",{className:"flex items-center gap-1.5",children:DN.map(me=>{const ce=Z.emailDigest===me.id;return a.jsx("button",{onClick:()=>le({...Z,emailDigest:me.id}),disabled:T,className:`px-3.5 py-1.5 rounded-full text-[11px] font-medium border transition disabled:opacity-50 ${ce?"bg-primary text-primary-foreground border-primary":"bg-card text-muted-foreground hover:bg-accent/40"}`,children:me.label},me.id)})}),a.jsx("p",{className:"text-[11px] text-muted-foreground mt-1.5",children:"A short email with what happened in your neighborhood."})]}),a.jsxs("button",{onClick:()=>le({...Z,emailUrgent:!Z.emailUrgent}),disabled:T,className:"w-full flex items-center gap-3 bg-muted/40 rounded-xl px-3 py-2.5 text-left disabled:opacity-50",role:"switch","aria-checked":Z.emailUrgent,children:[a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("div",{className:"text-sm font-medium",children:"Urgent alert emails"}),a.jsx("div",{className:"text-[11px] text-muted-foreground",children:"Email me right away when there is an urgent alert nearby."})]}),a.jsx("span",{className:`w-10 h-6 rounded-full p-0.5 transition shrink-0 ${Z.emailUrgent?"bg-primary":"bg-muted-foreground/30"}`,children:a.jsx("span",{className:`block w-5 h-5 rounded-full bg-card shadow transition-transform ${Z.emailUrgent?"translate-x-4":""}`})})]}),se&&a.jsxs("button",{onClick:U,disabled:te,className:"w-full flex items-center gap-3 bg-muted/40 rounded-xl px-3 py-2.5 text-left disabled:opacity-50",role:"switch","aria-checked":J,children:[a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("div",{className:"text-sm font-medium",children:"Push notifications"}),a.jsx("div",{className:"text-[11px] text-muted-foreground",children:"Get notified on this device about replies, businesses you follow, and urgent alerts."})]}),a.jsx("span",{className:`w-10 h-6 rounded-full p-0.5 transition shrink-0 ${J?"bg-primary":"bg-muted-foreground/30"}`,children:a.jsx("span",{className:`block w-5 h-5 rounded-full bg-card shadow transition-transform ${J?"translate-x-4":""}`})})]})]}),re&&a.jsxs("section",{className:"rounded-3xl bg-card border p-4 shadow-sm space-y-3",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Hp,{className:"w-4 h-4 text-muted-foreground"}),a.jsx("h3",{className:"font-semibold font-display tracking-tight text-sm",children:"Privacy"})]}),a.jsxs("div",{children:[a.jsx("div",{className:"text-[11px] font-medium text-muted-foreground mb-1.5",children:"Blocked neighbors"}),ie.length===0&&a.jsx("p",{className:"text-sm text-muted-foreground",children:"You haven't blocked anyone."}),a.jsx("div",{className:"space-y-1.5",children:ie.map(me=>a.jsxs("div",{className:"flex items-center gap-2 bg-muted/40 rounded-xl px-3 py-2",children:[a.jsx("span",{className:"flex-1 min-w-0 text-sm font-medium truncate",children:me.displayName}),a.jsx("button",{onClick:()=>ue(me),disabled:xe===me.memberId,className:"px-3 py-1 rounded-full border text-[11px] font-semibold text-muted-foreground hover:text-foreground hover:bg-muted transition disabled:opacity-50",children:"Unblock"})]},me.memberId))})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"text-[11px] font-medium text-muted-foreground mb-1.5 flex items-center gap-1",children:[a.jsx(Pp,{className:"w-3 h-3"})," Muted neighbors"]}),C.length===0&&a.jsx("p",{className:"text-sm text-muted-foreground",children:"You haven't muted anyone."}),a.jsx("div",{className:"space-y-1.5",children:C.map(me=>a.jsxs("div",{className:"flex items-center gap-2 bg-muted/40 rounded-xl px-3 py-2",children:[a.jsx("span",{className:"flex-1 min-w-0 text-sm font-medium truncate",children:me.displayName}),a.jsx("button",{onClick:()=>pe(me),disabled:xe===me.memberId,className:"px-3 py-1 rounded-full border text-[11px] font-semibold text-muted-foreground hover:text-foreground hover:bg-muted transition disabled:opacity-50",children:"Unmute"})]},me.memberId))})]})]}),a.jsxs("section",{className:"rounded-3xl bg-card border p-2 shadow-sm",children:[a.jsxs("button",{onClick:()=>S(!0),className:"w-full flex items-center gap-3 px-3 py-2.5 rounded-2xl hover:bg-muted transition text-left",children:[a.jsx($p,{className:"w-4 h-4 text-muted-foreground shrink-0"}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("div",{className:"text-sm font-medium",children:"Community guidelines"}),a.jsx("div",{className:"text-[11px] text-muted-foreground",children:"How we keep the neighborhood kind."})]}),a.jsx(Fh,{className:"w-4 h-4 text-muted-foreground shrink-0"})]}),i&&a.jsxs("button",{onClick:()=>be({view:"moderation"}),className:"w-full flex items-center gap-3 px-3 py-2.5 rounded-2xl hover:bg-muted transition text-left",children:[a.jsx(P0,{className:"w-4 h-4 text-muted-foreground shrink-0"}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("div",{className:"text-sm font-medium",children:"Moderation queue"}),a.jsx("div",{className:"text-[11px] text-muted-foreground",children:"Review reports from your neighbors."})]}),a.jsx(Fh,{className:"w-4 h-4 text-muted-foreground shrink-0"})]})]}),a.jsx(qN,{}),a.jsx("section",{className:"rounded-3xl bg-card border p-4 shadow-sm",children:a.jsxs("button",{onClick:gt,disabled:O,className:"w-full flex items-center justify-center gap-2 py-2.5 rounded-full bg-destructive/10 text-destructive text-xs font-semibold hover:bg-destructive/15 disabled:opacity-50 transition",children:[a.jsx(Kp,{className:"w-4 h-4"}),O?"Signing out...":"Sign out"]})}),j&&a.jsx(LN,{onClose:()=>S(!1)})]})}function $N(){window.history.length>1?window.history.back():be({view:"home"})}const cg={uncivil:"Uncivil or hurtful",discrimination:"Discrimination",misinformation:"Misinformation",spam:"Spam or scam",unsafe:"Unsafe or dangerous",privacy:"Private information",other:"Something else"},vp=[{id:"dismiss",label:"Dismiss"}
16,{id:"remove_content",label:"Remove content",destructive:!0},{id:"warn",label:"Warn author"},{id:"restore",label:"Restore"}],YN={dismiss:"Report dismissed.",remove_content:"Content removed.",warn:"Author warned.",restore:"Content restored."};function VN(){const{isModerator:l}=ot(),[i,r]=m.useState([]),[u,f]=m.useState(!1),[h,g]=m.useState(null),[w,b]=m.useState(null);m.useEffect(()=>{if(!l){f(!0);return}let p=!0;return K.get("/api/neighborhood/moderation/reports?status=new").then(E=>p&&r(E.reports)).catch(()=>p&&B.error("Couldn't load the moderation queue.")).finally(()=>p&&f(!0)),()=>{p=!1}},[l]);const x=async(p,E)=>{if(h)return;g(p.id),b(null);const I=i;r($=>$.filter(V=>V.id!==p.id));try{await K.post(`/api/neighborhood/moderation/reports/${p.id}/resolve`,{action:E}),B.success(YN[E])}catch{r(I),B.error("Couldn't resolve the report.")}finally{g(null)}},N=p=>{if(p.contentType==="post"){const E=Number(p.contentId);Number.isFinite(E)&&E>0&&be({view:"post",id:E})}};return a.jsxs("div",{className:"space-y-4 pb-6",children:[a.jsxs("button",{onClick:$N,className:"flex items-center gap-1.5 text-sm font-medium text-muted-foreground hover:text-foreground transition",children:[a.jsx(At,{className:"w-4 h-4"})," Back"]}),a.jsxs("header",{className:"flex items-center gap-2.5",children:[a.jsx("span",{className:"w-10 h-10 rounded-2xl bg-accent/50 grid place-items-center",children:a.jsx(es,{className:"w-5 h-5 text-primary"})}),a.jsxs("div",{className:"leading-tight",children:[a.jsx("h2",{className:"text-lg font-semibold font-display tracking-tight",children:"Moderation queue"}),a.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Reports from your neighbors."})]})]}),!l&&u&&a.jsxs("section",{className:"rounded-3xl bg-card border p-6 text-center shadow-sm",children:[a.jsx("h3",{className:"font-semibold font-display tracking-tight",children:"For moderators"}),a.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"This page is for neighborhood moderators. If you think that should be you, reach out to support."})]}),l&&!u&&a.jsxs("section",{className:"rounded-3xl bg-card border p-6 shadow-sm animate-pulse space-y-3",children:[a.jsx("div",{className:"h-4 w-1/3 rounded bg-muted"}),a.jsx("div",{className:"h-3 w-2/3 rounded bg-muted"})]}),l&&u&&i.length===0&&a.jsxs("section",{className:"rounded-3xl bg-card border p-6 text-center shadow-sm",children:[a.jsx("h3",{className:"font-semibold font-display tracking-tight",children:"All clear"}),a.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"No open reports right now. Nice neighborhood."})]}),l&&i.map(p=>a.jsxs("section",{className:"rounded-3xl bg-card border p-4 shadow-sm space-y-3",children:[a.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[a.jsx("span",{className:"px-2.5 py-0.5 rounded-full bg-destructive/10 text-destructive text-[10px] font-semibold uppercase tracking-wide",children:cg[p.reason]||p.reason}),a.jsxs("span",{className:"px-2.5 py-0.5 rounded-full bg-muted text-[10px] font-semibold capitalize",children:[p.contentType," #",p.contentId]}),a.jsx("span",{className:"text-[11px] text-muted-foreground ml-auto",children:Je(p.createdAt)})]}),p.detail&&a.jsx("p",{className:"text-sm leading-relaxed whitespace-pre-wrap",children:p.detail}),a.jsxs("div",{className:"text-[11px] text-muted-foreground",children:["Reported by ",p.reporter?.displayName||"a neighbor"]}),p.contentType==="post"&&a.jsxs("button",{onClick:()=>N(p),className:"flex items-center gap-1.5 text-xs font-semibold text-primary hover:underline",children:[a.jsx(Gp,{className:"w-3.5 h-3.5"})," View the post"]}),a.jsx("div",{className:"pt-2 border-t",children:w?.id===p.id?a.jsxs("div",{className:"flex items-center gap-2 flex-wrap text-xs",children:[a.jsxs("span",{className:"font-medium flex-1 min-w-[120px]",children:[vp.find(E=>E.id===w.action)?.label,"?"]}),a.jsx("button",{onClick:()=>x(p,w.action),disabled:h===p.id,className:`px-3 py-1.5 rounded-full font-semibold disabled:opacity-50 ${w.action==="remove_content"?"bg-destructive text-destructive-foreground":"bg-primary text-primary-foreground"}`,children:"Confirm"}),a.jsx("button",{onClick:()=>b(null),className:"px-3 py-1.5 rounded-full bg-muted font-medium",children:"Cancel"})]}):a.jsx("div",{className:"flex items-center gap-1.5 flex-wrap",children:vp.map(E=>a.jsx("button",{onClick:()=>b({id:p.id,action:E.id}),disabled:h===p.id,className:`px-3 py-1.5 rounded-full border text-[11px] font-semibold transition disabled:opacity-50 ${E.destructive?"text-destructive hover:bg-destructive/10":"text-muted-foreground hover:text-foreground hover:bg-muted"}`,children:E.label},E.id))})})]}
16,p.id))]})}const GN=300,br=2;function ZN(){window.history.length>1?window.history.back():be({view:"home"})}function XN(l){return!l.posts.length&&!l.listings.length&&!l.groups.length&&!l.events.length&&!l.pages.length&&!l.neighbors.length}function Hn({title:l,children:i}){return a.jsxs("section",{className:"space-y-1.5",children:[a.jsx("h3",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground px-1",children:l}),a.jsx("div",{className:"rounded-3xl bg-card border shadow-sm overflow-hidden divide-y",children:i})]})}function Zl({icon:l,onClick:i,children:r}){return a.jsxs("button",{onClick:i,className:"w-full flex items-center gap-3 px-4 py-3 text-left hover:bg-accent/30 transition",children:[a.jsx("span",{className:"w-9 h-9 rounded-xl bg-accent/50 grid place-items-center text-primary shrink-0",children:l}),a.jsx("span",{className:"flex-1 min-w-0",children:r})]})}function QN({q:l}){const[i,r]=m.useState(l||""),[u,f]=m.useState(null),[h,g]=m.useState(!1),w=m.useRef(null),b=m.useRef(0);m.useEffect(()=>{w.current?.focus()},[]),m.useEffect(()=>{const N=i.trim();if(N.length<br){f(null),g(!1);return}g(!0);const p=++b.current,E=setTimeout(async()=>{try{const I=await K.get(`/api/neighborhood/search?q=${encodeURIComponent(N)}`);if(b.current!==p)return;f(I.results),be({view:"search",q:N},{replace:!0})}catch{b.current===p&&f(null)}finally{b.current===p&&g(!1)}},GN);return()=>clearTimeout(E)},[i]);const x=i.trim();return a.jsx("div",{className:"fixed inset-0 z-50 bg-background overflow-y-auto",children:a.jsxs("div",{className:"mx-auto w-full max-w-[560px] px-4 pt-5 pb-10 space-y-4",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("button",{onClick:ZN,className:"w-10 h-10 rounded-full bg-card border grid place-items-center hover:bg-accent/40 transition shrink-0","aria-label":"Back",children:a.jsx(At,{className:"w-4 h-4"})}),a.jsxs("div",{className:"flex-1 flex items-center gap-2 bg-card border rounded-full px-4 py-2.5 focus-within:ring-2 focus-within:ring-primary/30",children:[a.jsx(Yn,{className:"w-4 h-4 text-muted-foreground shrink-0"}),a.jsx("input",{ref:w,value:i,onChange:N=>r(N.target.value),placeholder:"Search your neighborhood",className:"flex-1 min-w-0 bg-transparent text-sm outline-none placeholder:text-muted-foreground"}),i&&a.jsx("button",{onClick:()=>{r(""),w.current?.focus()},className:"w-6 h-6 rounded-full hover:bg-muted grid place-items-center text-muted-foreground shrink-0","aria-label":"Clear search",children:a.jsx(We,{className:"w-3.5 h-3.5"})})]})]}),x.length<br&&a.jsxs("section",{className:"rounded-3xl bg-card border p-6 text-center shadow-sm",children:[a.jsx("div",{className:"mx-auto w-12 h-12 rounded-2xl bg-accent/50 grid place-items-center mb-3",children:a.jsx(Yn,{className:"w-5 h-5 text-primary"})}),a.jsx("h3",{className:"font-semibold font-display tracking-tight",children:"Search everything nearby"}),a.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Posts, the market, groups, events, businesses and neighbors. Type at least two characters."})]}),x.length>=br&&h&&!u&&a.jsx("section",{className:"rounded-3xl bg-card border p-4 shadow-sm space-y-3 animate-pulse",children:[0,1,2].map(N=>a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-9 h-9 rounded-xl bg-muted shrink-0"}),a.jsxs("div",{className:"flex-1 space-y-2",children:[a.jsx("div",{className:"h-3 w-1/3 rounded bg-muted"}),a.jsx("div",{className:"h-3 w-2/3 rounded bg-muted"})]})]},N))}),x.length>=br&&u&&XN(u)&&!h&&a.jsxs("section",{className:"rounded-3xl bg-card border p-6 text-center shadow-sm",children:[a.jsxs("h3",{className:"font-semibold font-display tracking-tight",children:['Nothing matched "',x,'"']}),a.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Try a different word or a shorter one."})]}),u&&u.posts.length>0&&a.jsx(Hn,{title:"Posts",children:u.posts.map(N=>a.jsxs(Zl,{icon:a.jsx(I0,{className:"w-4 h-4"}),onClick:()=>be({view:"post",id:Number(N.id)}),children:[a.jsx("span",{className:"block text-sm font-semibold truncate",children:N.title||N.body.slice(0,80)}),a.jsxs("span",{className:"block text-[11px] text-muted-foreground truncate",children:[N.authorName?`${N.authorName} · `:"",Je(N.createdAt)]})]},N.id))}),u&&u.listings.length>0&&a.jsx(Hn,{title:"Market",children:u.listings.map(N=>a.jsxs(Zl,{icon:a.jsx(Su,{className:"w-4 h-4"}),onClick:()=>be({view:"listing",id:Number(N.id)}),children:[a.jsx("span",{className:"block text-sm font-semibold truncate",children:N.title}),a.jsxs("span",{className:"block text-[11px] text-muted-foreground",children:[N.isFree?"Free":Lu(N.priceCents)," · ",Je(N.createdAt)]})]},N.id))}),u&&u.groups.length>0&&a.jsx(Hn,{title:"Groups",children:u.groups.map(N=>a.jsxs(Zl,{icon:a.jsx(Ia,{className:"w-4 h-4"}),onClick:()=>be({view:"group",id:N.id}),children:[a.jsxs("span",{className:"flex items-center gap-1.5 min-w-0",children:[a.jsx("span",{className:"text-sm font-semibold truncate",children:N.name}),N.privacy==="private"&&a.jsx(Ql,{className:"w-3 h-3 text-muted-foreground shrink-0"})]}),a.jsx("span",{className:"block text-[11px] text-muted-foreground",children:N.memberCount===1?"1 member":`${N.memberCount} members`})]},N.id))}),u&&u.events.length>0&&a.jsx(Hn,{title:"Events",children:u.events.map(N=>a.jsxs(Zl,{icon:a.jsx(Dr,{className:"w-4 h-4"}),onClick:()=>be({view:"event",id:N.id}),children:[a.jsx("span",{className:"block text-sm font-semibold truncate",children:N.title}),a.jsxs("span",{className:"flex items-center gap-1 text-[11px] text-muted-foreground min-w-0",children:[new Date(N.startsAt).toLocaleDateString("en-US",{month:"short",day:"numeric"}),N.locationText&&a.jsxs(a.Fragment,{children:[a.jsx(Xn,{className:"w-3 h-3 shrink-0"}),a.jsx("span",{className:"truncate",children:N.locationText})]})]})]},N.id))}),u&&u.pages.length>0&&a.jsx(Hn,{title:"Businesses",children:u.pages.map(N=>a.jsxs(Zl,{icon:a.jsx(Vt,{className:"w-4 h-4"}),onClick:()=>be({view:"business",id:N.id}),children:[a.jsx("span",{className:"block text-sm font-semibold truncate",children:N.name}),a.jsxs("span",{className:"block text-[11px] text-muted-foreground",children:[N.recommendCount===1?"1 recommendation":`${N.recommendCount} recommendations`,N.avgRating!=null?` · ${Number(N.avgRating).toFixed(1)} rating`:""]})]},N.id))}),u&&u.neighbors.length>0&&a.jsx(Hn,{title:"Neighbors",children:u.neighbors.map(N=>a.jsxs("button",{onClick:()=>be({view:"profile",id:N.memberId}),className:"w-full flex items-center gap-3 px-4 py-3 text-left hover:bg-accent/30 transition",children:[a.jsx(ut,{name:N.displayName,initials:dt(N.displayName),src:N.avatarUrl,size:36}),a.jsxs("span",{className:"flex items-center gap-1.5 min-w-0",children:[a.jsx("span",{className:"text-sm font-semibold truncate",children:N.displayName}),bs(N.verificationTier)&&a.jsx(es,{className:"w-3.5 h-3.5 text-primary shrink-0","aria-label":"Verified neighbor"})]})]},N.memberId))})]})})}function KN(l){return`tel:+1${String(l).replace(/\D/g,"").slice(-10)}`}function JN(l){const i=String(l).replace(/\D/g,"").slice(-10);return i.length===10?`(${i.slice(0,3)}) ${i.slice(3,6)}-${i.slice(6)}`:l}function IN(l){const i=String(l).trim();return/^https?:\/\//i.test(i)?i:`https://${i}`}function FN(){window.history.length>1?window.history.back():be({view:"discover",sub:"recs"})}function WN({pageId:l,onCreated:i,onClose:r}){const[u,f]=m.useState(null),[h,g]=m.useState(""),[w,b]=m.useState(!1),x=async()=>{const N=h.trim();if(!(!N||w)){b(!0);try{const p=await K.post(`/api/neighborhood/pages/${l}/recommend`,{...u?{rating:u}:{},body:N});i(p.recommendation),B.success("Recommendation posted.")}catch(p){p instanceof tt&&p.code==="address_verification_required"?B.error("Address verification required to recommend businesses."):B.error("Couldn't post your recommendation.")}finally{b(!1)}}};return a.jsxs("section",{className:"rounded-3xl bg-card border p-4 shadow-sm space-y-3",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h3",{className:"font-semibold font-display tracking-tight text-sm",children:"Recommend this business"}),a.jsx("button",{onClick:r,className:"w-7 h-7 rounded-full hover:bg-muted grid place-items-center text-muted-foreground","aria-label":"Close",children:a.jsx(We,{className:"w-4 h-4"})})]}),a.jsx(Dv,{value:u,onChange:f}),a.jsx("textarea",{value:h,onChange:N=>g(N.target.value),placeholder:"What was your experience like?",rows:3,maxLength:2e3,className:"w-full resize-none bg-muted/60 rounded-xl px-3 py-2 text-sm outline-none focus:ring-2 focus:ring-primary/30 placeholder:text-muted-foreground"}),a.jsx("div",{className:"flex justify-end",children:a.jsx("button",{onClick:x,disabled:!h.trim()||w,className:"px-4 py-2 rounded-full bg-primary text-primary-foreground text-xs font-semibold disabled:opacity-50 transition",children:w?"Posting...":"Post recommendation"})})]})}function PN({id:l}){const[i,r]=m.useState(null),[u,f]=m.useState(null),[h,g]=m.useState([]),[w,b]=m.useState([]),[x,N]=m.useState(!1),[p,E]=m.useState(!1),[I,$]=m.useState(!1),[V,P]=m.useState(!1);m.useEffect(()=>{let R=!0;return r(null),f(null),g([]),b([]),N(!1),E(!1),P(!1),K.get(`/api/neighborhood/pages/${l}`).then(Z=>{R&&(r(Z.page),f(Z.business||null),g(Z.recommendations))}).catch(()=>R&&E(!0)).finally(()=>R&&N(!0)),K.get(`/api/neighborhood/pages/${l}/mentions`).then(Z=>R&&b(Z.mentions||[])).catch(()=>{}),()=>{R=!1}},[l]);const G=async()=>
16{if(!(!i||I)){$(!0);try{const R=await K.post(`/api/neighborhood/pages/${i.id}/follow`);r(Z=>Z&&{...Z,followedByMe:R.followed}),B.success(R.followed?`Following ${i.name}.`:`Unfollowed ${i.name}.`)}catch{B.error("Couldn't update your follow.")}finally{$(!1)}}},O=R=>{g(Z=>[R,...Z.filter(k=>k.id!==R.id)]),P(!1),r(Z=>{if(!Z)return Z;const k=[R,...h].filter(A=>A.rating!=null),T=k.length?k.reduce((A,se)=>A+Number(se.rating),0)/k.length:Z.avgRating;return{...Z,recommendCount:Z.recommendCount+1,avgRating:T}})},D=i?[i.categoryName,[i.city,i.stateCode].filter(Boolean).join(", ")].filter(Boolean).join(" · "):"";return a.jsxs("div",{className:"space-y-4 pb-6",children:[a.jsxs("button",{onClick:FN,className:"flex items-center gap-1.5 text-sm font-medium text-muted-foreground hover:text-foreground transition",children:[a.jsx(At,{className:"w-4 h-4"})," Recommendations"]}),!x&&a.jsxs("section",{className:"rounded-3xl bg-card border p-6 shadow-sm animate-pulse space-y-3",children:[a.jsx("div",{className:"h-4 w-1/2 rounded bg-muted"}),a.jsx("div",{className:"h-3 w-1/3 rounded bg-muted"}),a.jsx("div",{className:"h-3 w-2/3 rounded bg-muted"})]}),x&&p&&a.jsxs("section",{className:"rounded-3xl bg-card border p-6 text-center shadow-sm",children:[a.jsx("div",{className:"mx-auto w-12 h-12 rounded-2xl bg-accent/50 grid place-items-center mb-3",children:a.jsx(Vt,{className:"w-5 h-5 text-primary"})}),a.jsx("h3",{className:"font-semibold font-display tracking-tight",children:"Business not found"}),a.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"This page may have been removed."})]}),i&&a.jsxs(a.Fragment,{children:[a.jsxs("section",{className:"rounded-3xl bg-card border overflow-hidden shadow-sm",children:[u?.photoUrl&&a.jsx("img",{src:u.photoUrl,alt:"",className:"w-full h-40 object-cover border-b",onError:R=>{R.currentTarget.style.display="none"}}),a.jsxs("div",{className:"p-5",children:[a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx("span",{className:"w-12 h-12 rounded-2xl bg-accent/50 grid place-items-center text-primary shrink-0",children:a.jsx(Vt,{className:"w-5 h-5"})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("h2",{className:"text-lg font-semibold font-display tracking-tight",children:i.name}),D&&a.jsx("div",{className:"text-[11px] text-muted-foreground mt-0.5",children:D}),a.jsxs("div",{className:"flex items-center gap-2 mt-1.5 flex-wrap",children:[a.jsx(Jl,{rating:i.avgRating??u?.platformRating??null}),(i.avgRating??u?.platformRating)!=null&&a.jsx("span",{className:"text-xs font-semibold tabular-nums",children:Number(i.avgRating??u?.platformRating).toFixed(1)}),a.jsxs("span",{className:"text-[11px] text-muted-foreground",children:[i.recommendCount===1?"1 recommendation":`${i.recommendCount} recommendations`,i.avgRating==null&&u?.platformRating!=null&&u.platformRatingCount>0?` · ${u.platformRatingCount} platform ${u.platformRatingCount===1?"review":"reviews"}`:""]})]}),(u?.licensedInsured||(u?.yearsInBusiness??0)>0)&&a.jsxs("div",{className:"flex items-center gap-3 mt-1.5 flex-wrap text-[11px] text-muted-foreground",children:[u?.licensedInsured&&a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx(f0,{className:"w-3.5 h-3.5 text-primary"})," Licensed and insured"]}),(u?.yearsInBusiness??0)>0&&a.jsxs("span",{children:[u.yearsInBusiness," ",u.yearsInBusiness===1?"year":"years"," in business"]})]})]})]}),u?.description&&a.jsx("p",{className:"text-sm text-foreground/90 mt-3 whitespace-pre-wrap",children:u.description}),a.jsxs("div",{className:"mt-4 flex items-center gap-2 flex-wrap",children:[i.phone&&a.jsxs("a",{href:KN(i.phone),className:"flex items-center gap-2 px-4 py-2 rounded-full bg-primary text-primary-foreground text-xs font-semibold transition",children:[a.jsx(Ja,{className:"w-3.5 h-3.5"})," Call"]}),a.jsxs("a",{href:"/myhomeinbox/?as=resident&tab=request",className:"flex items-center gap-2 px-4 py-2 rounded-full border bg-card text-xs font-semibold hover:bg-accent/40 transition",children:[a.jsx(Yp,{className:"w-3.5 h-3.5"})," Request service"]}),i.website&&a.jsxs("a",{href:IN(i.website),target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 px-4 py-2 rounded-full border bg-card text-xs font-semibold hover:bg-accent/40 transition",children:[a.jsx(Zp,{className:"w-3.5 h-3.5"})," Website"]}),a.jsxs("button",{onClick:G,disabled:I,className:`flex items-center gap-2 px-4 py-2 rounded-full text-xs font-semibold disabled:opacity-50 transition ${i.followedByMe?"bg-muted text-foreground
16/80":"border bg-card hover:bg-accent/40"}`,"aria-pressed":i.followedByMe,children:[a.jsx(Ur,{className:`w-3.5 h-3.5 ${i.followedByMe?"fill-primary text-primary":""}`}),i.followedByMe?"Following":"Follow"]}),!V&&a.jsxs("button",{onClick:()=>P(!0),className:"flex items-center gap-2 px-4 py-2 rounded-full border bg-card text-xs font-semibold hover:bg-accent/40 transition",children:[a.jsx(k1,{className:"w-3.5 h-3.5"})," Recommend"]})]}),i.phone&&a.jsxs("div",{className:"mt-3 pt-3 border-t text-xs text-muted-foreground flex items-center gap-2",children:[a.jsx(Ja,{className:"w-3.5 h-3.5 shrink-0"}),a.jsx("span",{children:JN(i.phone)})]})]})]}),V&&a.jsx(WN,{pageId:i.id,onCreated:O,onClose:()=>P(!1)}),w.length>0&&a.jsxs("section",{className:"rounded-3xl bg-card border p-4 shadow-sm",children:[a.jsxs("h3",{className:"font-semibold font-display tracking-tight text-sm mb-2.5 flex items-center gap-1.5",children:[a.jsx(qr,{className:"w-4 h-4 text-primary"})," Neighbors are talking"]}),a.jsx("div",{className:"space-y-2",children:w.map(R=>a.jsxs("button",{onClick:()=>be({view:"post",id:Number(R.postId)}),className:"w-full text-left rounded-2xl bg-muted/50 hover:bg-muted px-3 py-2.5 transition",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(ut,{name:R.author.displayName,initials:dt(R.author.displayName),src:R.author.avatarUrl,size:24}),a.jsx("span",{className:"text-xs font-semibold truncate",children:R.author.displayName}),a.jsx("span",{className:"text-[10px] text-muted-foreground shrink-0",children:Je(R.createdAt)})]}),R.snippet&&a.jsx("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-2 whitespace-pre-wrap",children:R.snippet})]},R.id))})]}),h.length===0&&a.jsxs("section",{className:"rounded-3xl bg-card border p-6 text-center shadow-sm",children:[a.jsx("h3",{className:"font-semibold font-display tracking-tight",children:"No recommendations yet"}),a.jsxs("p",{className:"text-sm text-muted-foreground mt-1",children:["Be the first neighbor to vouch for ",i.name,"."]})]}),h.map(R=>a.jsxs("section",{className:"rounded-3xl bg-card border p-4 shadow-sm",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(ut,{name:R.author.displayName,initials:dt(R.author.displayName),src:R.author.avatarUrl,size:36}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("button",{onClick:()=>be({view:"profile",id:R.author.memberId}),className:"text-sm font-semibold truncate hover:underline",children:R.author.displayName}),a.jsxs("div",{className:"flex items-center gap-2 text-[11px] text-muted-foreground",children:[R.rating!=null&&a.jsx(Jl,{rating:R.rating,size:12}),a.jsx("span",{children:Je(R.createdAt)})]})]})]}),a.jsx("p",{className:"text-sm text-foreground/90 mt-2.5 whitespace-pre-wrap",children:R.body}),R.ownerResponse&&a.jsxs("div",{className:"mt-2.5 rounded-2xl bg-accent/30 border border-accent px-3 py-2.5",children:[a.jsxs("div",{className:"text-[11px] font-semibold text-foreground/80",children:["Response from ",i.name,R.ownerResponseAt&&a.jsxs("span",{className:"font-normal text-muted-foreground",children:[" · ",Je(R.ownerResponseAt)]})]}),a.jsx("p",{className:"text-sm text-foreground/90 mt-1 whitespace-pre-wrap",children:R.ownerResponse})]})]},R.id))]})]})}const Yt="/api/admin/nextdoor",Xa="w-full bg-muted/60 rounded-xl px-3 py-2 text-sm outline-none focus:ring-2 focus:ring-primary/30 placeholder:text-muted-foreground",$n=l=>`px-3.5 py-1.5 rounded-full text-[11px] font-medium border transition ${l?"bg-primary text-primary-foreground border-primary":"bg-card text-muted-foreground hover:bg-accent/40"}`,e2=["AL","AK","AZ","AR","CA","CO","CT","DE","DC","FL","GA","HI","ID","IL","IN","IA","KS","KY","LA","ME","MD","MA","MI","MN","MS","MO","MT","NE","NV","NH","NJ","NM","NY","NC","ND","OH","OK","OR","PA","RI","SC","SD","TN","TX","UT","VT","VA","WA","WV","WI","WY"],t2={feed_bell_residents_only:"Feed pins and app notifications only go to residents. Turn those channels off for a business broadcast.",no_channels:"Pick at least one channel first.",empty_body:"Write a message first.",not_editable:"That broadcast can't be edited anymore.",already_sent:"That broadcast already went out.",bad_schedule_time:"The schedule time must be in the future."};function Qa(l,i){const r=l instanceof tt?l.code:"";B.error(t2[r]||i)}function s2(l){const i=new Set;for(const r of l.split(/[,\s]+/)){const u=r.trim();/^\d{5}
16$/.test(u)&&i.add(u)}return Array.from(i)}function Er(l,i){const r=l.audience==="residents"?"Residents":"Businesses";let u;l.targetStates&&l.targetStates.length>0?u=l.targetStates.length===1?l.targetStates[0]:`${l.targetStates[0]} + ${l.targetStates.length-1} ${l.targetStates.length===2?"state":"states"}`:l.targetZips&&l.targetZips.length>0?u=`${l.targetZips.length} ${l.targetZips.length===1?"ZIP":"ZIPs"}`:l.targetNeighborhoodIds&&l.targetNeighborhoodIds.length>0?u=`${l.targetNeighborhoodIds.length} ${l.targetNeighborhoodIds.length===1?"neighborhood":"neighborhoods"}`:u=l.audience==="residents"?"all neighborhoods":"everywhere";let f="";if(l.audience==="businesses"&&l.targetCategoryIds&&l.targetCategoryIds.length>0){const h=l.targetCategoryIds,g=i(h[0]);h.length===1?f=`, ${g||"1 category"}`:g?f=`, ${g} + ${h.length-1} ${h.length===2?"category":"categories"}`:f=`, ${h.length} categories`}return`${r}, ${u}${f}`}function _u(l){const i=l.audience==="residents"?l.matched===1?"resident":"residents":l.matched===1?"business":"businesses",r=`Reaches ${l.matched.toLocaleString("en-US")} ${i} (${l.smsable.toLocaleString("en-US")} can get texts, ${l.emailable.toLocaleString("en-US")} can get email)`;return l.audience==="residents"?`${r} across ${l.neighborhoods.toLocaleString("en-US")} ${l.neighborhoods===1?"neighborhood":"neighborhoods"}.`:`${r}.`}function a2(l){const i=l.delivery;if(!i)return null;const r=[];return l.channels.sms&&r.push(`SMS ${(i.smsSent??0).toLocaleString("en-US")} sent${i.smsQueued?`, ${i.smsQueued.toLocaleString("en-US")} queued`:""}.`),l.channels.email&&r.push(`Email ${(i.emailSent??0).toLocaleString("en-US")} sent${i.emailQueued?`, ${i.emailQueued.toLocaleString("en-US")} queued`:""}.`),r.length?r.join(" "):null}const Np={draft:{label:"Draft",cls:"bg-muted text-muted-foreground"},scheduled:{label:"Scheduled",cls:"bg-accent/60 text-accent-foreground"},sending:{label:"Sending",cls:"bg-primary/10 text-primary animate-pulse"},sent:{label:"Sent",cls:"bg-primary/15 text-primary"},cancelled:{label:"Cancelled",cls:"bg-muted text-muted-foreground/70"}},ug=[{key:"feed",label:"Feed pin",Icon:Ip},{key:"bell",label:"App notification",Icon:Br},{key:"sms",label:"Text message",Icon:Fl},{key:"email",label:"Email",Icon:Lr}];function n2({channels:l}){return a.jsx("span",{className:"flex items-center gap-1.5",children:ug.map(({key:i,label:r,Icon:u})=>a.jsx("span",{title:`${r}${l[i]?"":" off"}`,children:a.jsx(u,{className:`w-3.5 h-3.5 ${l[i]?"text-foreground/70":"text-muted-foreground/30"}`,"aria-hidden":"true"})},i))})}function l2(l){const i=l.audience==="residents",r={audience:l.audience,body:l.body.trim(),channels:{feed:i&&l.channels.feed,bell:i&&l.channels.bell,sms:l.channels.sms,email:l.channels.email}};return l.title.trim()&&(r.title=l.title.trim()),l.geoMode==="states"&&l.states.length&&(r.targetStates=l.states),l.geoMode==="zips"&&l.zips.length&&(r.targetZips=l.zips),!i&&l.categoryIds.length&&(r.targetCategoryIds=l.categoryIds),l.channels.sms&&l.smsBody.trim()&&(r.smsBody=l.smsBody.trim()),l.channels.email&&l.emailSubject.trim()&&(r.emailSubject=l.emailSubject.trim()),r}function i2(l){return{audience:l.audience,...l.targetStates?.length?{targetStates:l.targetStates}:{},...l.targetZips?.length?{targetZips:l.targetZips}:{},...l.targetNeighborhoodIds?.length?{targetNeighborhoodIds:l.targetNeighborhoodIds}:{},...l.targetCategoryIds?.length?{targetCategoryIds:l.targetCategoryIds}:{},body:l.body||"preview",channels:{sms:!0,email:!0}}}function dg(l){const i=ug.filter(r=>l[r.key]).map(r=>r.label);return i.length?i.join(", "):"No channels"}function r2({seed:l,categories:i,categoryName:r,onClose:u,onSaved:f}){const h=l.id??null,[g,w]=m.useState(l.audience||"residents"),[b,x]=m.useState(l.targetStates?.length?"states":l.targetZips?.length?"zips":"everywhere"),[N,p]=m.useState(l.targetStates||[]),[E,I]=m.useState((l.targetZips||[]).join(", ")),[$,V]=m.useState(l.targetCategoryIds||[]),[P,G]=m.useState(l.title||""),[O,D]=m.useState(l.body||""),[R,Z]=m.useState({feed:l.channels?.feed??!0,bell:l.channels?.bell??!0,sms:l.channels?.sms??!1,email:l.channels?.email??!1}),[k,T]=m.useState(l.smsBody||""),[A,se]=m.useState(l.emailSubject||""),[J,Q]=m.useState(!1),[te,ne]=m.useState(""),[ie,ae]=m.useState(!1),[C,H]=m.useState(!1),re=m.useMemo(()=>s2(E),[E]),de=g==="residents",xe=de&&(R.feed||R.bell)||R.sms||R.email,[v,j]=m.useState(null),[S,U]=m.useState(!1),le=N.join(","),ue=re.join(","),pe=$.join(",");m.useEffect(()=>{let ce=!1;const Te=setTimeout(()=>{U(!0),K.post(`${Yt}/broadcasts/preview`,{audience:g,...b==="states"&&N.length?{targetStates:N}:{},...b==="zips"&&re.length?{targetZips:re}:{},...!de&&$.length?{targetCategoryIds:$}:{},body:"preview",channels:{sms:!0,email:!0}}).then(st=>{ce||j(st)}
16).catch(()=>{ce||j(null)}).finally(()=>{ce||U(!1)})},500);return()=>{ce=!0,clearTimeout(Te)}},[g,b,le,ue,pe]);const ye=()=>l2({audience:g,geoMode:b,states:N,zips:re,categoryIds:$,title:P,body:O,channels:R,smsBody:k,emailSubject:A}),je=()=>O.trim()?xe?b==="states"&&N.length===0?(B.error("Pick at least one state, or switch to Everywhere."),!1):b==="zips"&&re.length===0?(B.error("Paste at least one 5-digit ZIP code, or switch to Everywhere."),!1):!0:(B.error("Pick at least one channel first."),!1):(B.error("Write a message first."),!1),Ue=async()=>{try{return(h?await K.put(`${Yt}/broadcasts/${h}`,ye()):await K.post(`${Yt}/broadcasts`,ye())).broadcast}catch(ce){return Qa(ce,"Couldn't save the broadcast."),null}},gt=async()=>{if(C||!O.trim())return;H(!0);const ce=await Ue();H(!1),ce&&(B.success("Draft saved."),f(),u())},Ct=async()=>{if(C)return;H(!0);const ce=await Ue();if(!ce){H(!1);return}try{await K.post(`${Yt}/broadcasts/${ce.id}/send`,{}),B.success("Broadcast is on its way."),f(),u()}catch(Te){Qa(Te,"Couldn't send the broadcast."),f()}finally{H(!1)}},Ts=async()=>{if(C)return;const ce=new Date(te);if(!te||Number.isNaN(ce.getTime())||ce.getTime()<=Date.now()){B.error("The schedule time must be in the future.");return}if(!je())return;H(!0);const Te=await Ue();if(!Te){H(!1);return}try{await K.post(`${Yt}/broadcasts/${Te.id}/send`,{scheduledAt:ce.toISOString()}),B.success(`Scheduled for ${ce.toLocaleString("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}.`),f(),u()}catch(st){Qa(st,"Couldn't schedule the broadcast."),f()}finally{H(!1)}},me={audience:g,targetStates:b==="states"?N:null,targetZips:b==="zips"?re:null,targetNeighborhoodIds:null,targetCategoryIds:de?null:$};return ie?a.jsxs("section",{className:"rounded-3xl bg-card border p-4 shadow-sm space-y-3",children:[a.jsx("div",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"Confirm and send"}),a.jsx("div",{className:"text-sm font-semibold",children:Er(me,r)}),a.jsx("p",{className:"text-sm text-muted-foreground",children:v?_u(v):S?"Checking reach...":"Reach estimate unavailable."}),a.jsxs("p",{className:"text-sm",children:[a.jsx("span",{className:"text-muted-foreground",children:"Channels: "}),dg({feed:de&&R.feed,bell:de&&R.bell,sms:R.sms,email:R.email})]}),P.trim()&&a.jsx("div",{className:"text-sm font-medium",children:P.trim()}),a.jsx("p",{className:"text-sm text-muted-foreground whitespace-pre-wrap line-clamp-4",children:O.trim()}),a.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[a.jsx("button",{onClick:()=>ae(!1),className:"px-4 py-2 rounded-full bg-muted text-xs font-medium",children:"Back"}),a.jsxs("button",{onClick:Ct,disabled:C,className:"flex items-center gap-1.5 px-4 py-2 rounded-full bg-primary text-primary-foreground text-xs font-semibold disabled:opacity-50",children:[a.jsx(Vn,{className:"w-3.5 h-3.5"})," ",C?"Sending...":"Confirm and send"]})]})]}):a.jsxs("section",{className:"rounded-3xl bg-card border p-4 shadow-sm space-y-3",children:[a.jsx("div",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:h?"Edit broadcast":"New broadcast"}),a.jsxs("div",{children:[a.jsx("span",{className:"text-[11px] font-medium text-muted-foreground",children:"Audience"}),a.jsxs("div",{className:"flex items-center gap-1.5 mt-1",children:[a.jsx("button",{onClick:()=>w("residents"),className:$n(de),children:"Residents"}),a.jsx("button",{onClick:()=>w("businesses"),className:$n(!de),children:"Businesses"})]})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-[11px] font-medium text-muted-foreground",children:"Where"}),a.jsxs("div",{className:"flex items-center gap-1.5 mt-1 flex-wrap",children:[a.jsx("button",{onClick:()=>x("everywhere"),className:$n(b==="everywhere"),children:"Everywhere"}),a.jsx("button",{onClick:()=>x("states"),className:$n(b==="states"),children:"By state"}),a.jsx("button",{onClick:()=>x("zips"),className:$n(b==="zips"),children:"By ZIP codes"})]}),b==="states"&&a.jsx("div",{className:"flex items-center gap-1 flex-wrap mt-2",children:e2.map(ce=>{const Te=N.includes(ce);return a.jsx("button",{onClick:()=>p(st=>Te?st.filter(fs=>fs!==ce):[...st,ce]),className:`px-2 py-1 rounded-lg text-[10px] font-semibold border transition ${Te?"bg-primary text-primary-foreground border-primary":"bg-card text-muted-foreground hover:bg-accent/40"}`,children:ce},ce)})}),b==="zips"&&a.jsxs("div",{className:"mt-2 space-y-1",children:[a.jsx("textarea",{value:E,onChange:ce=>I(ce.target.value),placeholder:"Paste ZIP codes, separated by commas, spaces, or new lines",rows:3,className:`${Xa} resize-y`}),a.jsxs("div",{className:"text-[11px] text-muted-foreground",children:[re.length," ",re.length===1?"ZIP code":"ZIP codes"," recognized"]})]}),!de&&a.jsxs("div",{className:"mt-2",children:[a.jsx("span",{className:"text-[11px] font-medium text-muted-foreground",children:"Categories (optional, all when none picked)"}),i&&i.length>0?a.jsx("div",{className:"flex items-center gap-1.5 flex-wrap mt-1",children:i.map(ce=>{const Te=$.includes(ce.id);return a.jsx("button",{onClick:()=>V(st=>Te?st.filter(fs=>fs!==ce.id):[...st,ce.id]),className:$n(Te),children:ce.name},ce.id)})}):a.jsx("div",{className:"text-[11px] text-muted-foreground mt-1",children:"Category list unavailable."})]})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-[11px] font-medium text-muted-foreground",children:"Channels"}),a.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-4 gap-y-1.5 mt-1",children:[a.jsxs("label",{className:`flex items-center gap-2 text-sm ${de?"":"op
16acity-50"}`,children:[a.jsx("input",{type:"checkbox",checked:de&&R.feed,disabled:!de,onChange:ce=>Z(Te=>({...Te,feed:ce.target.checked})),className:"w-4 h-4 accent-primary"}),"Pin to neighborhood feeds"]}),a.jsxs("label",{className:`flex items-center gap-2 text-sm ${de?"":"opacity-50"}`,children:[a.jsx("input",{type:"checkbox",checked:de&&R.bell,disabled:!de,onChange:ce=>Z(Te=>({...Te,bell:ce.target.checked})),className:"w-4 h-4 accent-primary"}),"App notification"]}),a.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[a.jsx("input",{type:"checkbox",checked:R.sms,onChange:ce=>Z(Te=>({...Te,sms:ce.target.checked})),className:"w-4 h-4 accent-primary"}),"Text message"]}),a.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[a.jsx("input",{type:"checkbox",checked:R.email,onChange:ce=>Z(Te=>({...Te,email:ce.target.checked})),className:"w-4 h-4 accent-primary"}),"Email"]})]}),!de&&a.jsx("p",{className:"text-[11px] text-muted-foreground mt-1",children:"Feed pins and app notifications are for residents only. Business broadcasts go out by text and email."}),R.sms&&a.jsxs("div",{className:"mt-2 space-y-1",children:[a.jsx("span",{className:"text-[11px] font-medium text-muted-foreground",children:"SMS text (falls back to the message when empty)"}),a.jsx("textarea",{value:k,onChange:ce=>T(ce.target.value),placeholder:"Short text version of the message",rows:2,maxLength:300,className:`${Xa} resize-y`}),a.jsxs("div",{className:"flex items-center justify-between text-[11px] text-muted-foreground",children:[a.jsx("span",{children:"Reply STOP to opt out is added automatically."}),a.jsxs("span",{className:"tabular-nums",children:[k.length,"/300"]})]})]}),R.email&&a.jsxs("label",{className:"block mt-2",children:[a.jsx("span",{className:"text-[11px] font-medium text-muted-foreground",children:"Email subject (falls back to the title when empty)"}),a.jsx("input",{value:A,onChange:ce=>se(ce.target.value),placeholder:"Subject line",maxLength:200,className:`mt-0.5 ${Xa}`})]})]}),a.jsx("input",{value:P,onChange:ce=>G(ce.target.value),placeholder:"Title (optional)",maxLength:200,className:Xa}),a.jsx("textarea",{value:O,onChange:ce=>D(ce.target.value),placeholder:"What should people know?",rows:4,maxLength:4e3,className:`${Xa} resize-y`}),a.jsx("p",{className:"text-[11px] text-muted-foreground",children:S?"Checking reach...":v?_u(v):"Reach estimate unavailable."}),J&&a.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[a.jsx("input",{type:"datetime-local",value:te,onChange:ce=>ne(ce.target.value),className:`${Xa} max-w-[240px]`}),a.jsxs("button",{onClick:Ts,disabled:C||!te,className:"flex items-center gap-1.5 px-4 py-2 rounded-full bg-primary text-primary-foreground text-xs font-semibold disabled:opacity-50",children:[a.jsx(kr,{className:"w-3.5 h-3.5"})," ",C?"Scheduling...":"Confirm schedule"]})]}),a.jsxs("div",{className:"flex items-center justify-end gap-2 pt-1 flex-wrap",children:[a.jsx("button",{onClick:u,className:"px-4 py-2 rounded-full bg-muted text-xs font-medium",children:"Cancel"}),a.jsx("button",{onClick:gt,disabled:C||!O.trim(),className:"px-4 py-2 rounded-full border bg-card text-xs font-semibold hover:bg-accent/40 disabled:opacity-50",children:"Save draft"}),a.jsxs("button",{onClick:()=>Q(ce=>!ce),disabled:C,className:"flex items-center gap-1.5 px-4 py-2 rounded-full border bg-card text-xs font-semibold hover:bg-accent/40 disabled:opacity-50",children:[a.jsx(kr,{className:"w-3.5 h-3.5"})," Schedule"]}),a.jsxs("button",{onClick:()=>{je()&&ae(!0)},disabled:C,className:"flex items-center gap-1.5 px-4 py-2 rounded-full bg-primary text-primary-foreground text-xs font-semibold disabled:opacity-50",children:[a.jsx(Vn,{className:"w-3.5 h-3.5"})," Send now"]})]})]})}const o2=[{key:"queued",label:"Queued"},{key:"sent",label:"Sent"},{key:"failed",label:"Failed"},{key:"suppressed",label:"Suppressed"},{key:"cancelled",label:"Cancelled"}];function c2({detail:l,categoryName:i,onCancel:r,cancelling:u}){const f=l.delivery?.sms,h=l.delivery?.email,g=(f?.queued||0)+(h?.queued||0)>0,w=!!(f||h);return a.jsxs("div",{className:"mt-3 pt-3 border-t space-y-3",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Message"}),l.title&&a.jsx("div",{className:"text-sm font-semibold mt-1",children:l.title}),a.jsx("p",{className:"text-sm whitespace-pre-wrap mt-1",children:l.body}),l.smsBody&&a.jsxs("p",{className:"text-[11px] text-muted-foreground mt-2",children:[a.jsx("span",{className:"font-semibold",children:"SMS text:"})," ",l.smsBody]}),l.emailSubject&&a.jsxs("p",{className:"text-[11px] text-muted-foreground mt-1",children:[a.jsx("span",{className:"font-semibold",children:"Email subject:"})," ",l.emailSubject]})]}),a.jsxs("div",{children:[a.jsx("div",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Targeting"}),a.jsx("p",{className:"text-sm mt-1",children:Er(l,i)}),l.targetStates&&l.targetStates.length>1&&a.jsxs("p",{className:"text-[11px] text-muted-foreground mt-0.5",children:["States: ",l.targetStates.join(", ")
16]}),l.targetZips&&l.targetZips.length>0&&a.jsxs("p",{className:"text-[11px] text-muted-foreground mt-0.5 break-words",children:["ZIPs: ",l.targetZips.join(", ")]}),typeof l.recipientsResolved=="number"&&a.jsxs("p",{className:"text-[11px] text-muted-foreground mt-0.5",children:[l.recipientsResolved.toLocaleString("en-US")," recipients resolved"]})]}),w&&a.jsxs("div",{children:[a.jsx("div",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Delivery"}),a.jsxs("table",{className:"mt-1 text-sm w-full max-w-[360px]",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"text-[11px] text-muted-foreground text-left",children:[a.jsx("th",{className:"font-medium py-1 pr-4"}),f&&a.jsx("th",{className:"font-medium py-1 pr-4",children:"SMS"}),h&&a.jsx("th",{className:"font-medium py-1",children:"Email"})]})}),a.jsx("tbody",{children:o2.filter(b=>f&&f[b.key]!=null||h&&h[b.key]!=null).map(b=>a.jsxs("tr",{className:"border-t",children:[a.jsx("td",{className:"py-1 pr-4 text-muted-foreground",children:b.label}),f&&a.jsx("td",{className:"py-1 pr-4 tabular-nums",children:(f[b.key]??0).toLocaleString("en-US")}),h&&a.jsx("td",{className:"py-1 tabular-nums",children:(h[b.key]??0).toLocaleString("en-US")})]},b.key))})]})]}),l.post&&a.jsxs("p",{className:"text-[11px] text-muted-foreground",children:["Feed post: ",l.post.reactionCount.toLocaleString("en-US")," ",l.post.reactionCount===1?"reaction":"reactions",", ",l.post.commentCount.toLocaleString("en-US")," ",l.post.commentCount===1?"comment":"comments",l.post.isDeleted?" (removed)":""]}),g&&l.status!=="cancelled"&&a.jsx("button",{onClick:r,disabled:u,className:"px-3.5 py-1.5 rounded-full border text-[11px] font-semibold text-destructive hover:bg-destructive/10 transition disabled:opacity-50",children:u?"Cancelling...":"Cancel queued deliveries"})]})}function u2(){const[l,i]=m.useState([]),[r,u]=m.useState(!1),[f,h]=m.useState(0),[g,w]=m.useState(null),[b,x]=m.useState(null);m.useEffect(()=>{K.get("/api/neighborhood/businesses/categories").then(j=>x(j.categories||[])).catch(()=>x(null))},[]);const N=m.useCallback(j=>b?.find(S=>S.id===j)?.name||null,[b]),[p,E]=m.useState(null),[I,$]=m.useState(null),[V,P]=m.useState(null),[G,O]=m.useState(""),[D,R]=m.useState(null),[Z,k]=m.useState({}),[T,A]=m.useState(null),[se,J]=m.useState(null),Q=m.useCallback(()=>{u(!1),Promise.all([K.get(`${Yt}/broadcasts`).then(j=>i(j.broadcasts||[])),K.get(`${Yt}/broadcasts/queued-email-count`).then(j=>h(j.queued||0)).catch(()=>h(0))]).catch(()=>B.error("Couldn't load broadcasts.")).finally(()=>u(!0))},[]);m.useEffect(()=>{Q()},[Q]);const te=m.useMemo(()=>[...l].sort((j,S)=>new Date(S.createdAt).getTime()-new Date(j.createdAt).getTime()),[l]),ne=j=>{P(null),E(j.id),$(null),K.post(`${Yt}/broadcasts/preview`,i2(j)).then($).catch(()=>$(null))},ie=async j=>{if(!T){A(j.id);try{await K.post(`${Yt}/broadcasts/${j.id}/send`,{}),B.success("Broadcast is on its way."),E(null),Q()}catch(S){Qa(S,"Couldn't send the broadcast.")}finally{A(null)}}},ae=async j=>{if(T)return;const S=new Date(G);if(!G||Number.isNaN(S.getTime())||S.getTime()<=Date.now()){B.error("The schedule time must be in the future.");return}A(j.id);try{await K.post(`${Yt}/broadcasts/${j.id}/send`,{scheduledAt:S.toISOString()}),B.success(`Scheduled for ${S.toLocaleString("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}.`),P(null),O(""),Q()}catch(U){Qa(U,"Couldn't schedule the broadcast.")}finally{A(null)}},C=async(j,S)=>{if(!(T||!j.postId)){A(j.id);try{S?await K.del(`${Yt}/official/${j.postId}`):await K.post(`${Yt}/official/${j.postId}/restore`,{}),i(U=>U.map(le=>le.id===j.id?{...le,postArchived:S}:le)),B.success(S?"Archived. It is off the feed and the landing page. Restore is on this row.":"Back in the feed.")}catch(U){Qa(U,S?"Couldn't archive the post.":"Couldn't restore the post.")}finally{A(null)}}},H=async j=>{if(!T){J(null),A(j.id);try{await K.post(`${Yt}/broadcasts/${j.id}/cancel`),B.success("Broadcast cancelled."),k(S=>{const U={...S};return delete U[j.id],U}),Q()}catch(S){Qa(S,"Couldn't cancel the broadcast.")}finally{A(null)}}},re=j=>{if(D===j.id){R(null);return}R(j.id),K.get(`${Yt}/broadcasts/${j.id}`).then(S=>k(U=>({...U,[j.id]:S.broadcast}))).catch(()=>B.error("Couldn't load the broadcast details."))},de=j=>{w({audience:j.audience,targetStates:j.targetStates,targetZips:j.targetZips,targetCategoryIds:j.targetCategoryIds,title:j.title,body:j.body,smsB
16ody:j.smsBody,emailSubject:j.emailSubject,channels:j.channels}),window.scrollTo({top:0,behavior:"smooth"})},xe=j=>{w({id:j.id,audience:j.audience,targetStates:j.targetStates,targetZips:j.targetZips,targetCategoryIds:j.targetCategoryIds,title:j.title,body:j.body,smsBody:j.smsBody,emailSubject:j.emailSubject,channels:j.channels}),window.scrollTo({top:0,behavior:"smooth"})},v="flex items-center gap-1.5 px-3 py-1.5 rounded-full border text-[11px] font-semibold text-muted-foreground hover:text-foreground hover:bg-muted transition disabled:opacity-50";return a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between gap-2 flex-wrap",children:[a.jsx("h2",{className:"font-semibold font-display tracking-tight",children:"Broadcast Center"}),a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("button",{onClick:Q,className:"w-8 h-8 rounded-full border bg-card grid place-items-center hover:bg-accent/40 transition","aria-label":"Refresh broadcasts",children:a.jsx(Wl,{className:`w-3.5 h-3.5 ${r?"":"animate-spin"}`})}),a.jsxs("button",{onClick:()=>w(g&&!g.id?null:{}),className:"flex items-center gap-1.5 px-3.5 py-2 rounded-full bg-primary text-primary-foreground text-xs font-semibold transition",children:[a.jsx(Qn,{className:"w-3.5 h-3.5"})," New broadcast"]})]})]}),f>0&&a.jsxs("div",{className:"rounded-2xl border border-amber-500/40 bg-amber-500/10 px-4 py-3 text-sm text-amber-700",children:[f.toLocaleString("en-US")," ",f===1?"email is":"emails are"," queued and will send when email service resumes."]}),g&&a.jsx(r2,{seed:g,categories:b,categoryName:N,onClose:()=>w(null),onSaved:Q},g.id??"new"),r&&te.length===0&&a.jsxs("section",{className:"rounded-3xl bg-card border p-6 text-center shadow-sm",children:[a.jsx("h3",{className:"font-semibold font-display tracking-tight",children:"No broadcasts yet"}),a.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Compose one to reach residents or businesses."})]}),te.map(j=>{const S=Np[j.status]||Np.draft,U=j.status==="draft"||j.status==="scheduled",le=(j.delivery?.smsQueued||0)+(j.delivery?.emailQueued||0),ue=a2(j),pe=Z[j.id];return a.jsxs("section",{className:"rounded-3xl bg-card border p-4 shadow-sm",children:[a.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[a.jsx("span",{className:`px-2.5 py-0.5 rounded-full text-[10px] font-semibold uppercase tracking-wide ${S.cls}`,children:S.label}),a.jsx("span",{className:"text-sm font-semibold",children:Er(j,N)}),j.postArchived&&a.jsx("span",{className:"px-2.5 py-0.5 rounded-full text-[10px] font-semibold uppercase tracking-wide bg-muted text-muted-foreground",children:"Archived"}),a.jsx("span",{className:"ml-auto",children:a.jsx(n2,{channels:j.channels})})]}),a.jsxs("p",{className:"text-sm text-muted-foreground mt-1.5 line-clamp-2 whitespace-pre-wrap",children:[j.title?a.jsxs("span",{className:"font-medium text-foreground",children:[j.title,". "]}):null,j.body]}),j.status==="scheduled"&&j.scheduledAt&&a.jsxs("p",{className:"text-[11px] text-muted-foreground mt-1.5",children:["Scheduled for"," ",new Date(j.scheduledAt).toLocaleString("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})]}),ue&&(j.status==="sent"||j.status==="sending")&&a.jsx("p",{className:"text-[11px] text-muted-foreground mt-1.5",children:ue}),a.jsxs("p",{className:"text-[11px] text-muted-foreground mt-1.5",children:[j.createdBy?`${j.createdBy}, `:"",Je(j.createdAt)]}),a.jsx("div",{className:"mt-3 pt-3 border-t",children:p===j.id?a.jsxs("div",{className:"space-y-2",children:[a.jsx("div",{className:"text-sm font-medium",children:Er(j,N)}),a.jsx("p",{className:"text-sm text-muted-foreground",children:I?_u(I):"Checking reach..."}),a.jsxs("p",{className:"text-[11px] text-muted-foreground",children:["Channels: ",dg(j.channels)]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("button",{onClick:()=>ie(j),disabled:T===j.id,className:"flex items-center gap-1.5 px-3.5 py-1.5 rounded-full bg-primary text-primary-foreground text-[11px] font-semibold disabled:opacity-50",children:[a.jsx(Vn,{className:"w-3.5 h-3.5"})," ",T===j.id?"Sending...":"Confirm and send"]}),a.jsx("button",{onClick:()=>E(null),className:"px-3 py-1.5 rounded-full bg-muted text-[11px] font-medium",children:"Back"})]})]}):V===j.id?a.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[a.jsx("input",{type:"datetime-local",value:G,onChange:ye=>O(ye.target.value),className:`${Xa} max-w-[240px]`}),a.jsxs("button",{onClick:()=>ae(j),disabled:T===j.id||!G,className:"flex items-center gap-1.5 px-3.5 py-1.5 rounded-full bg-primary text-primary-foreground text-[11px] font-semibold disabled:opacity-50",children:[a.jsx(kr,{className:"w-3.5 h-3.5"}
16)," ",T===j.id?"Scheduling...":"Confirm schedule"]}),a.jsx("button",{onClick:()=>P(null),className:"px-3 py-1.5 rounded-full bg-muted text-[11px] font-medium",children:"Back"})]}):a.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[U&&a.jsxs(a.Fragment,{children:[a.jsxs("button",{onClick:()=>xe(j),className:v,children:[a.jsx(Jp,{className:"w-3.5 h-3.5"})," Edit"]}),a.jsxs("button",{onClick:()=>ne(j),disabled:T===j.id,className:v,children:[a.jsx(Vn,{className:"w-3.5 h-3.5"})," Send now"]}),a.jsxs("button",{onClick:()=>{E(null),O(""),P(j.id)},disabled:T===j.id,className:v,children:[a.jsx(kr,{className:"w-3.5 h-3.5"})," ",j.status==="scheduled"?"Reschedule":"Schedule"]})]}),!U&&a.jsxs(a.Fragment,{children:[a.jsx("button",{onClick:()=>re(j),className:v,children:D===j.id?"Hide details":"View details"}),a.jsxs("button",{onClick:()=>de(j),className:v,children:[a.jsx(Vp,{className:"w-3.5 h-3.5"})," Duplicate"]})]}),j.postId&&j.postArchived!=null&&a.jsx("button",{onClick:()=>C(j,!j.postArchived),disabled:T===j.id,className:v,children:j.postArchived?a.jsxs(a.Fragment,{children:[a.jsx(K1,{className:"w-3.5 h-3.5"})," Restore to feed"]}):a.jsxs(a.Fragment,{children:[a.jsx(c0,{className:"w-3.5 h-3.5"})," Archive from feed"]})}),(U||j.status==="sending"||j.status==="sent"&&le>0)&&(se===j.id?a.jsxs("span",{className:"flex items-center gap-1.5 flex-wrap",children:[a.jsx("span",{className:"text-[11px] text-muted-foreground",children:j.status==="sending"||j.status==="sent"?"Stops queued deliveries and removes the feed post.":"Cancel this broadcast?"}),a.jsx("button",{onClick:()=>H(j),disabled:T===j.id,className:"px-3 py-1.5 rounded-full bg-destructive text-destructive-foreground text-[11px] font-semibold disabled:opacity-50",children:"Confirm cancel"}),a.jsx("button",{onClick:()=>J(null),className:"px-3 py-1.5 rounded-full bg-muted text-[11px] font-medium",children:"Back"})]}):a.jsx("button",{onClick:()=>J(j.id),disabled:T===j.id,className:"px-3 py-1.5 rounded-full border text-[11px] font-semibold text-destructive hover:bg-destructive/10 transition disabled:opacity-50",children:"Cancel"}))]})}),D===j.id&&pe&&a.jsx(c2,{detail:pe,categoryName:N,onCancel:()=>H(pe),cancelling:T===j.id})]},j.id)})]})}const Pt="/api/admin/nextdoor",jp=[{id:"overview",label:"Overview",icon:a.jsx(c1,{className:"w-4 h-4"})},{id:"broadcasts",label:"Broadcasts",icon:a.jsx(R1,{className:"w-4 h-4"})},{id:"announcements",label:"Announcements",icon:a.jsx(Vt,{className:"w-4 h-4"})},{id:"moderation",label:"Moderation",icon:a.jsx(Zn,{className:"w-4 h-4"})},{id:"sponsored",label:"Sponsored",icon:a.jsx(v1,{className:"w-4 h-4"})},{id:"agencies",label:"Agencies",icon:a.jsx(j0,{className:"w-4 h-4"})}];function d2(l){return l.business_name||l.businessName||"Unknown business"}function Tr(l){const i=l.zip_list??l.zipList??l.target_zips??l.targetZips;return i?Array.isArray(i)?i.join(", "):String(i):""}function Ar(l){return l.split(/[,\s]+/).map(i=>i.trim()).filter(Boolean)}const Wt="w-full bg-muted/60 rounded-xl px-3 py-2 text-sm outline-none focus:ring-2 focus:ring-primary/30 placeholder:text-muted-foreground",Mr=l=>`px-3.5 py-1.5 rounded-full text-[11px] font-medium border transition ${l?"bg-primary text-primary-foreground border-primary":"bg-card text-muted-foreground hover:bg-accent/40"}`;function f2(){const[l,i]=m.useState(null),[r,u]=m.useState(0),[f,h]=m.useState(!1),g=m.useCallback(()=>{h(!1),Promise.all([K.get(`${Pt}/stats`).then(b=>i(b.stats)),K.get(`${Pt}/broadcasts/queued-email-count`).then(b=>u(b.queued||0)).catch(()=>u(0))]).catch(()=>B.error("Couldn't load the stats.")).finally(()=>h(!0))},[]);m.useEffect(()=>{g()},[g]);const w=[{label:"Neighborhoods",value:l?.neighborhoods},{label:"Members",value:l?.members},{label:"Posts",value:l?.posts},{label:"Active listings",value:l?.activeListings},{label:"Open reports",value:l?.openReports,alert:(l?.openReports||0)>0},{label:"Queued emails",value:r,amber:r>0}];return a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h2",{className:"font-semibold font-display tracking-tight",children:"Platform overview"}),a.jsxs("button",{onClick:g,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-full border bg-card text-xs font-medium hover:bg-accent/40 transition",children:[a.jsx(Wl,{className:`w-3.5 h-3.5 ${f?"":"animate-spin"}`})," Refresh"]})]}),a.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-3",children:w.map(b=>a.jsxs("div",{className:`rounded-3xl bg-card border p-4 shadow-sm ${b.alert?"border-destructive/40":b.amber?"border-amber-500/40":""}`,children:[a.jsx("div",{className:`text-2xl font-bold tabular-nums font-display ${b.alert?"text-destructive":b.amber?"text-amber-600":""}
16`,children:f&&l?(b.value??0).toLocaleString("en-US"):"-"}),a.jsx("div",{className:"text-[11px] text-muted-foreground mt-0.5",children:b.label})]},b.label))})]})}const vr=[{id:"dismiss",label:"Dismiss"},{id:"remove_content",label:"Remove content",destructive:!0},{id:"warn",label:"Warn"},{id:"strike",label:"Strike",destructive:!0},{id:"mute_3d",label:"Mute 3 days",destructive:!0},{id:"suspend_30d",label:"Suspend 30 days",destructive:!0},{id:"ban",label:"Ban",destructive:!0},{id:"restore",label:"Restore"}];function m2(){const[l,i]=m.useState("new"),[r,u]=m.useState([]),[f,h]=m.useState(!1),[g,w]=m.useState(null),[b,x]=m.useState({}),[N,p]=m.useState(null),E=m.useCallback(()=>{h(!1),K.get(`${Pt}/moderation/reports?status=${l}`).then($=>u($.reports)).catch(()=>B.error("Couldn't load reports.")).finally(()=>h(!0))},[l]);m.useEffect(()=>{E()},[E]);const I=async($,V)=>{if(g)return;w($.id),p(null);const P=r;u(G=>G.filter(O=>O.id!==$.id));try{const G=(b[$.id]||"").trim(),O=await K.post(`${Pt}/moderation/reports/${$.id}/resolve`,{action:V,...G?{note:G}:{}}),D=typeof O.ladder=="string"||typeof O.ladder=="number"?String(O.ladder):O.ladder?JSON.stringify(O.ladder):"";B.success(`Resolved with ${vr.find(R=>R.id===V)?.label||V}.${D?` Ladder: ${D}`:""}`)}catch{u(P),B.error("Couldn't resolve the report.")}finally{w(null)}};return a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between gap-2 flex-wrap",children:[a.jsx("h2",{className:"font-semibold font-display tracking-tight",children:"Report queue"}),a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("button",{onClick:()=>i("new"),className:Mr(l==="new"),children:"New"}),a.jsx("button",{onClick:()=>i(""),className:Mr(l===""),children:"All"}),a.jsx("button",{onClick:E,className:"w-8 h-8 rounded-full border bg-card grid place-items-center hover:bg-accent/40 transition","aria-label":"Refresh reports",children:a.jsx(Wl,{className:`w-3.5 h-3.5 ${f?"":"animate-spin"}`})})]})]}),f&&r.length===0&&a.jsxs("section",{className:"rounded-3xl bg-card border p-6 text-center shadow-sm",children:[a.jsx("h3",{className:"font-semibold font-display tracking-tight",children:"Nothing in the queue"}),a.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"No reports match this filter."})]}),r.map($=>a.jsxs("section",{className:"rounded-3xl bg-card border p-4 shadow-sm space-y-3",children:[a.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[a.jsx("span",{className:"px-2.5 py-0.5 rounded-full bg-destructive/10 text-destructive text-[10px] font-semibold uppercase tracking-wide",children:cg[$.reason]||$.reason}),a.jsxs("span",{className:"px-2.5 py-0.5 rounded-full bg-muted text-[10px] font-semibold capitalize",children:[$.contentType," #",$.contentId]}),a.jsx("span",{className:"px-2.5 py-0.5 rounded-full bg-accent/50 text-accent-foreground text-[10px] font-semibold capitalize",children:$.status}),a.jsx("span",{className:"text-[11px] text-muted-foreground ml-auto",children:Je($.createdAt)})]}),$.detail&&a.jsx("p",{className:"text-sm leading-relaxed whitespace-pre-wrap",children:$.detail}),a.jsxs("div",{className:"text-[11px] text-muted-foreground",children:["Reported by ",$.reporter?.displayName||"a neighbor"]}),a.jsx("input",{value:b[$.id]||"",onChange:V=>x(P=>({...P,[$.id]:V.target.value})),placeholder:"Resolution note (optional)",maxLength:500,className:Wt}),a.jsx("div",{className:"pt-2 border-t",children:N?.id===$.id?a.jsxs("div",{className:"flex items-center gap-2 flex-wrap text-xs",children:[a.jsxs("span",{className:"font-medium flex-1 min-w-[140px]",children:[vr.find(V=>V.id===N.action)?.label," on ",$.contentType," #",$.contentId,"?"]}),a.jsx("button",{onClick:()=>I($,N.action),disabled:g===$.id,className:`px-3 py-1.5 rounded-full font-semibold disabled:opacity-50 ${vr.find(V=>V.id===N.action)?.destructive?"bg-destructive text-destructive-foreground":"bg-primary text-primary-foreground"}`,children:"Confirm"}),a.jsx("button",{onClick:()=>p(null),className:"px-3 py-1.5 rounded-full bg-muted font-medium",children:"Cancel"})]}):a.jsx("div",{className:"flex items-center gap-1.5 flex-wrap",children:vr.map(V=>a.jsx("button",{onClick:()=>p({id:$.id,action:V.id}),disabled:g===$.id,className:`px-3 py-1.5 rounded-full border text-[11px] font-semibold transition disabled:opacity-50 ${V.destructive?"text-destructive hover:bg-destructive/10":"text-muted-foreground hover:text-foreground hover:bg-muted"}`,children:V.label},V.id))})})]},$.id))]})}function h2(){const[l,i]=m.useState([]),[r,u]=m.useState(!1),[f,h]=m.useState(!1),[g,w]=m.useState(!1),[b,x]=m.useState(null),[N,p]=m.useState(""),[E,I]=m.useState(""),[$,V]=m.useState(""),[P,G]=m.useState(""),[O,D]=m.useState(""),[R,Z]=m.useState(""),[k,T]=m.useState(""),A=m.useCallback(()=>{u(!1),K.get(`${Pt}/sponsored`).then(Q=>i(Q.campaigns)).catch(()=>B.error("Couldn't load campaigns.")).finally(()=>u(!0))},[]);m.useEffect(()=>{A()},[A]);const se=async()=>{const Q=parseInt(N.trim(),10);if(!(!Q||!E.trim()||!$.trim()||g)){w(!0);try{await K.post(`${Pt}/sponsored`,{businessId:Q,headline:E.trim(),body:$.trim(),...P.trim()?{ctaLabel:P.trim()}:{},...O.trim()?{ctaUrl:O.trim()}:{},...Ar(R).length?{targetZips:Ar(R)}:{},...parseInt(k.trim(),10)>0?{dailyCap:parseInt(k.trim(),10)}:{}}),B.success("Campaign created."),p(""),I(""),V(""),G(""),D(""),Z(""),T(""),h(!1),A()}catch(te){te instanceof tt&&te.code==="not_a_paying_business"?B.error("That business is not an active paid member."):B.error("Couldn't create the campaign.")}finally{w(!1)}}}
16,J=async(Q,te)=>{if(!b){x(Q.id);try{await K.post(`${Pt}/sponsored/${Q.id}/status`,{status:te}),i(ne=>ne.map(ie=>ie.id===Q.id?{...ie,status:te}:ie)),B.success(te==="active"?"Campaign activated.":te==="paused"?"Campaign paused.":"Campaign ended.")}catch{B.error("Couldn't update the campaign.")}finally{x(null)}}};return a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between gap-2 flex-wrap",children:[a.jsx("h2",{className:"font-semibold font-display tracking-tight",children:"Sponsored campaigns"}),a.jsxs("button",{onClick:()=>h(Q=>!Q),className:"flex items-center gap-1.5 px-3.5 py-2 rounded-full bg-primary text-primary-foreground text-xs font-semibold transition",children:[a.jsx(Qn,{className:"w-3.5 h-3.5"})," New campaign"]})]}),f&&a.jsxs("section",{className:"rounded-3xl bg-card border p-4 shadow-sm space-y-2.5",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-2.5",children:[a.jsxs("label",{className:"block",children:[a.jsx("span",{className:"text-[11px] font-medium text-muted-foreground",children:"Business ID (paying member)"}),a.jsx("input",{value:N,onChange:Q=>p(Q.target.value),placeholder:"e.g. 1823",inputMode:"numeric",className:`mt-0.5 ${Wt}`})]}),a.jsxs("label",{className:"block",children:[a.jsx("span",{className:"text-[11px] font-medium text-muted-foreground",children:"Headline"}),a.jsx("input",{value:E,onChange:Q=>I(Q.target.value),placeholder:"What the card leads with",maxLength:120,className:`mt-0.5 ${Wt}`})]})]}),a.jsxs("label",{className:"block",children:[a.jsx("span",{className:"text-[11px] font-medium text-muted-foreground",children:"Body"}),a.jsx("textarea",{value:$,onChange:Q=>
16V(Q.target.value),placeholder:"A sentence or two of copy",rows:3,maxLength:500,className:`mt-0.5 resize-none ${Wt}`})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-2.5",children:[a.jsxs("label",{className:"block",children:[a.jsx("span",{className:"text-[11px] font-medium text-muted-foreground",children:"CTA label (optional)"}),a.jsx("input",{value:P,onChange:Q=>G(Q.target.value),placeholder:"Learn more",maxLength:40,className:`mt-0.5 ${Wt}`})]}),a.jsxs("label",{className:"block",children:[a.jsx("span",{className:"text-[11px] font-medium text-muted-foreground",children:"CTA URL (optional)"}),a.jsx("input",{value:O,onChange:Q=>D(Q.target.value),placeholder:"https://...",className:`mt-0.5 ${Wt}`})]}),a.jsxs("label",{className:"block",children:[a.jsx("span",{className:"text-[11px] font-medium text-muted-foreground",children:"Target ZIPs, comma separated (optional)"}),a.jsx("input",{value:R,onChange:Q=>Z(Q.target.value),placeholder:"78660, 75035",className:`mt-0.5 ${Wt}`})]}),a.jsxs("label",{className:"block",children:[a.jsx("span",{className:"text-[11px] font-medium text-muted-foreground",children:"Daily impression cap (optional)"}),a.jsx("input",{value:k,onChange:Q=>T(Q.target.value),placeholder:"e.g. 500",inputMode:"numeric",className:`mt-0.5 ${Wt}`})]})]}),a.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[a.jsx("button",{onClick:()=>h(!1),className:"px-4 py-2 rounded-full bg-muted text-xs font-medium",children:"Cancel"}),a.jsx("button",{onClick:se,disabled:g||!parseInt(N.trim(),10)||!E.trim()||!$.trim(),className:"px-4 py-2 rounded-full bg-primary text-primary-foreground text-xs font-semibold disabled:opacity-50 transition",children:g?"Creating...":"Create campaign"})]})]}),r&&l.length===0&&a.jsxs("section",{className:"rounded-3xl bg-card border p-6 text-center shadow-sm",children:[a.jsx("h3",{className:"font-semibold font-display tracking-tight",children:"No campaigns yet"}),a.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Create one for a paying business to start."})]}),l.map(Q=>a.jsxs("section",{className:"rounded-3xl bg-card border p-4 shadow-sm",children:[a.jsxs("div",{className:"flex items-start gap-3 flex-wrap",children:[a.jsxs("div",{className:"flex-1 min-w-[220px]",children:[a.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[a.jsx("span",{className:"text-sm font-semibold",children:d2(Q)}),a.jsx("span",{className:`px-2 py-0.5 rounded-full text-[10px] font-semibold uppercase tracking-wide ${Q.status==="active"?"bg-primary/10 text-primary":Q.status==="paused"?"bg-muted text-muted-foreground":"bg-destructive/10 text-destructive"}`,children:Q.status})]}),a.jsx("div",{className:"text-sm font-medium mt-1",children:Q.headline}),a.jsx("p",{className:"text-sm text-muted-foreground mt-0.5 line-clamp-2",children:Q.body}),Tr(Q)&&a.jsxs("div",{className:"text-[11px] text-muted-foreground mt-1",children:["ZIPs: ",Tr(Q)]})]}),a.jsxs("div",{className:"flex items-center gap-4 text-center shrink-0",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-lg font-bold tabular-nums font-display",children:(Q.impressions||0).toLocaleString("en-US")}),a.jsxs("div",{className:"text-[10px] text-muted-foreground flex items-center gap-1 justify-center",children:[a.jsx(zu,{className:"w-3 h-3"})," Impressions"]})]}),a.jsxs("div",{children:[a.jsx("div",{className:"text-lg font-bold tabular-nums font-display",children:(Q.clicks||0).toLocaleString("en-US")}),a.jsx("div",{className:"text-[10px] text-muted-foreground",children:"Clicks"})]})]})]}),a.jsxs("div",{className:"mt-3 pt-3 border-t flex items-center gap-1.5 flex-wrap",children:[Q.status!=="active"&&Q.status!=="ended"&&a.jsx("button",{onClick:()=>J(Q,"active"),disabled:b===Q.id,className:"px-3.5 py-1.5 rounded-full bg-primary text-primary-foreground text-[11px] font-semibold disabled:opacity-50",children:"Activate"}),Q.status==="active"&&a.jsx("button",{onClick:()=>J(Q,"paused"),disabled:b===Q.id,className:"px-3.5 py-1.5 rounded-full border text-[11px] font-semibold text-muted-foreground hover:text-foreground hover:bg-muted transition disabled:opacity-50",children:"Pause"}),Q.status!=="ended"&&a.jsx("button",{onClick:()=>J(Q,"ended"),disabled:b===Q.id,className:"px-3.5 py-1.5 rounded-full border text-[11px] font-semibold text-destructive hover:bg-destructive/10 transition disabled:opacity-50",children:"End"})]})]},Q.id))]})}const p2=[{id:"police",label:"Police"},{id:"fire",label:"Fire"},{id:"city",label:"City"},{id:"utility",label:"Utility"},{id:"school",label:"School"}],g2=[{id:"info",label:"Info"},{id:"advisory",label:"Advisory"},{id:"emergency",label:"Emergency"}];function x2(){const[l,i]=m.useState([]),[r,u]=m.useState(!1),[f,h]=m.useState(!1),[g,w]=m.useState(!1),[b,x]=m.useState(""),[N,p]=m.useState("city"),[E,I]=m.useState(""),[$,V]=m.useState(null),[P,G]=m.useState(""),[O,D]=m.useState(""),[R,Z]=m.useState("advisory"),[k,T]=m.useState(!1),A=m.useCallback(()=>{u(!1),K.get(`${Pt}/agencies`).then(te=>
16i(te.agencies)).catch(()=>B.error("Couldn't load agencies.")).finally(()=>u(!0))},[]);m.useEffect(()=>{A()},[A]);const se=async()=>{const te=Ar(E);if(!(!b.trim()||te.length===0||g)){w(!0);try{await K.post(`${Pt}/agencies`,{name:b.trim(),kind:N,zipList:te}),B.success("Agency created."),x(""),p("city"),I(""),h(!1),A()}catch{B.error("Couldn't create the agency.")}finally{w(!1)}}},J=te=>{V(ne=>ne===te?null:te),G(""),D(""),Z("advisory")},Q=async te=>{if(!(!O.trim()||k)){T(!0);try{const ne=await K.post(`${Pt}/agencies/${te.id}/alert`,{...P.trim()?{title:P.trim()}:{},body:O.trim(),severity:R});B.success(`Alert posted to ${ne.neighborhoodsPosted} ${ne.neighborhoodsPosted===1?"neighborhood":"neighborhoods"}.`),V(null)}catch{B.error("Couldn't post the alert.")}finally{T(!1)}}};return a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between gap-2 flex-wrap",children:[a.jsx("h2",{className:"font-semibold font-display tracking-tight",children:"Civic agencies"}),a.jsxs("button",{onClick:()=>h(te=>!te),className:"flex items-center gap-1.5 px-3.5 py-2 rounded-full bg-primary text-primary-foreground text-xs font-semibold transition",children:[a.jsx(Qn,{className:"w-3.5 h-3.5"})," New agency"]})]}),f&&a.jsxs("section",{className:"rounded-3xl bg-card border p-4 shadow-sm space-y-2.5",children:[a.jsxs("label",{className:"block",children:[a.jsx("span",{className:"text-[11px] font-medium text-muted-foreground",children:"Agency name"}),a.jsx("input",{value:b,onChange:te=>x(te.target.value),placeholder:"e.g. Pflugerville Police Department",maxLength:120,className:`mt-0.5 ${Wt}`})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-[11px] font-medium text-muted-foreground",children:"Kind"}),a.jsx("div",{className:"flex items-center gap-1.5 flex-wrap mt-1",children:p2.map(te=>a.jsx("button",{onClick:()=>p(te.id),className:Mr(N===te.id),children:te.label},te.id))})]}),a.jsxs("label",{className:"block",children:[a.jsx("span",{className:"text-[11px] font-medium text-muted-foreground",children:"ZIP codes, comma separated"}),a.jsx("input",{value:E,onChange:te=>I(te.target.value),placeholder:"78660, 78664",className:`mt-0.5 ${Wt}`})]}),a.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[a.jsx("button",{onClick:()=>h(!1),className:"px-4 py-2 rounded-full bg-muted text-xs font-medium",children:"Cancel"}),a.jsx("button",{onClick:se,disabled:g||!b.trim()||Ar(E).length===0,className:"px-4 py-2 rounded-full bg-primary text-primary-foreground text-xs font-semibold disabled:opacity-50 transition",children:g?"Creating...":"Create agency"})]})]}),r&&l.length===0&&a.jsxs("section",{className:"rounded-3xl bg-card border p-6 text-center shadow-sm",children:[a.jsx("h3",{className:"font-semibold font-display tracking-tight",children:"No agencies yet"}),a.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Add police, fire, city, utility, or school accounts."})]}),l.map(te=>a.jsxs("section",{className:"rounded-3xl bg-card border p-4 shadow-sm",children:[a.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[a.jsxs("div",{className:"flex-1 min-w-[200px]",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-sm font-semibold",children:te.name}),a.jsx("span",{className:"px-2 py-0.5 rounded-full bg-accent/50 text-accent-foreground text-[10px] font-semibold capitalize",children:te.kind})]}),Tr(te)&&a.jsxs("div",{className:"text-[11px] text-muted-foreground mt-0.5",children:["ZIPs: ",Tr(te)]})]}),a.jsxs("button",{onClick:()=>J(te.id),className:"flex items-center gap-1.5 px-3.5 py-1.5 rounded-full border text-[11px] font-semibold text-muted-foreground hover:text-foreground hover:bg-muted transition shrink-0",children:[a.jsx(Uu,{className:"w-3.5 h-3.5"})," Send alert"]})]}),$===te.id&&a.jsxs("div",{className:"mt-3 pt-3 border-t space-y-2.5",children:[a.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[a.jsx("span",{className:"text-[11px] font-medium text-muted-foreground mr-1",children:"Severity"}),g2.map(ne=>{const ie=R===ne.id;return a.jsx("button",{onClick:()=>Z(ne.id),className:`px-3 py-1 rounded-full text-[11px] font-medium border transition ${ie?ne.id==="emergency"?"bg-destructive text-destructive-foreground border-destructive":"bg-primary text-primary-foreground border-primary":"bg-card text-muted-foreground hover:bg-accent/40"}`,children:ne.label},ne.id)})]}),a.jsx("input",{value:P,onChange:ne=>G(ne.target.value),placeholder:"Title (optional)",maxLength:140,className:Wt}),a.jsx("textarea",{value:O,onChange:ne=>D(ne.target.value),placeholder:"What should neighbors know?",rows:3,maxLength:2e3,className:`resize-none ${Wt}`}),a.jsxs("div",{className:"flex justify-end gap-2",children:[a.jsx("button",{onClick:()=>V(null),className:"px-4 py-2 rounded-full bg-muted text-xs font-medium",children:"Cancel"}),a.jsx("button",{onClick:()=>Q(te),disabled:k||!O.trim(),className:`px-4 py-2 rounded-full text-xs font-semibold disabled:opacity-50 transition ${R==="emergency"?"bg-destructive text-destructive-foreground":"bg-primary text-primary-foreground"}`,children:k?"Posting...":"Post alert"})]})]})]},te.id))]})}const y2={not_paying_anymore:"no longer a paying member",no_service_zips:"no service ZIP codes on file",already_reviewed:"already reviewed",not_found:"no longer in the queue"};function b2(){const[l,i]=m.useState("pending"),[r,u]=m.useState([]),[f,h]=m.useState(!1),[g,w]=m.useState(null),[b,x]=m.useState(""),[N,p]=m.useState(!1),[E,I]=m.useState([]),[$,V]=m.useState(!1),P=m.useCallback(()=>{h(!1),I([]),V(!1),K.get(`${Pt}/announcements?status=${l}`).then(T=>u(T.announcements||[])).catch(()=>B.error("Couldn't load announcements.")).finally(()=>h(!0))},[l]);m.useEffect(()=>{P()},[P]);const G=l==="pending",O=G&&r.length>0&&E.length===r.length,D=T=>I(A=>A.includes(T)?A.filter(se=>se!==T):[...A,T]),R=()=>I(O?[]:r.map(T=>T.id)),Z=async()=>
16{if(!(N||!E.length)){p(!0);try{const T=await K.post(`${Pt}/announcements/bulk-review`,{ids:E,action:"approve"}),A=new Set(E.filter(se=>!T.failed.some(J=>J.id===se)));if(u(se=>se.filter(J=>!A.has(J.id))),I([]),V(!1),T.failedCount===0)B.success(`Approved and published ${T.succeeded}. ${T.businessesNotified} ${T.businessesNotified===1?"business was":"businesses were"} notified by text and email.`);else{const se=T.failed.map(J=>y2[J.code]||J.code).filter((J,Q,te)=>te.indexOf(J)===Q).join(", ");B.warning(`Approved ${T.succeeded} of ${T.requested}. ${T.failedCount} skipped: ${se}.`)}}catch{B.error("Couldn't approve the selected announcements.")}finally{p(!1)}}},k=async(T,A,se)=>{if(!N){p(!0);try{await K.post(`${Pt}/announcements/${T}/review`,{action:A,...se?{reason:se}:{}}),B.success(A==="approve"?"Announcement approved and published.":"Announcement rejected."),w(null),x(""),u(J=>J.filter(Q=>Q.id!==T)),I(J=>J.filter(Q=>Q!==T))}catch(J){B.error(J instanceof tt&&J.code==="not_paying_anymore"?"This business is no longer a paying member.":"Couldn't review the announcement.")}finally{p(!1)}}};return a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-2",children:[a.jsxs("div",{children:[a.jsx("h2",{className:"font-semibold font-display tracking-tight",children:"Business announcements"}),a.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Updates from paying businesses. Approval publishes into the feeds of neighborhoods in their service area."})]}),a.jsxs("div",{className:"flex items-center gap-1.5",children:[["pending","approved","rejected"].map(T=>a.jsx("button",{onClick:()=>i(T),className:Mr(l===T),children:T==="pending"?"Pending":T==="approved"?"Approved":"Rejected"},T)),a.jsxs("button",{onClick:P,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-full border bg-card text-xs font-medium hover:bg-accent/40 transition",children:[a.jsx(Wl,{className:`w-3.5 h-3.5 ${f?"":"animate-spin"}`})," Refresh"]})]})]}),G&&r.length>0&&a.jsx("section",{className:"rounded-3xl bg-card border p-3 shadow-sm sticky top-2 z-10",children:a.jsxs("div",{className:"flex items-center justify-between gap-3 flex-wrap",children:[a.jsxs("label",{className:"flex items-center gap-2 cursor-pointer select-none",children:[a.jsx("input",{type:"checkbox",checked:O,onChange:R,className:"w-4 h-4 rounded accent-[var(--primary)] cursor-pointer"}),a.jsx("span",{className:"text-sm font-medium",children:O?"Clear selection":`Select all ${r.length}`}),E.length>0&&a.jsxs("span",{className:"text-xs text-muted-foreground",children:[E.length," selected"]})]}),E.length>0&&($?a.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[a.jsxs("span",{className:"text-xs text-muted-foreground",children:["Publishes ",E.length," to resident feeds and texts and emails each business."]}),a.jsx("button",{onClick:Z,disabled:N,className:"px-4 py-2 rounded-full bg-primary text-primary-foreground text-xs font-semibold disabled:opacity-50",children:N?"Approving...":`Yes, approve ${E.length}`}),a.jsx("button",{onClick:()=>V(!1),disabled:N,className:"px-4 py-2 rounded-full border bg-card text-xs font-semibold hover:bg-accent/40 disabled:opacity-50",children:"Cancel"})]}):a.jsxs("button",{onClick:()=>V(!0),disabled:N,className:"flex items-center gap-1.5 px-4 py-2 rounded-full bg-primary text-primary-foreground text-xs font-semibold disabled:opacity-50",children:[a.jsx(M0,{className:"w-3.5 h-3.5"}),"Approve selected (",E.length,")"]}))]})}),f&&r.length===0&&a.jsx("section",{className:"rounded-3xl bg-card border p-6 text-center shadow-sm",children:a.jsx("p",{className:"text-sm text-muted-foreground",children:l==="pending"?"No announcements waiting for review.":`No ${l} announcements.`})}),r.map(T=>a.jsxs("section",{className:`rounded-3xl bg-card border p-4 shadow-sm transition ${E.includes(T.id)?"ring-2 ring-primary/40 border-primary/40":""}`,children:[a.jsxs("div",{className:"flex items-start justify-between gap-3 flex-wrap",children:[a.jsxs("div",{className:"min-w-0 flex gap-3",children:[G&&a.jsx("input",{type:"checkbox",checked:E.includes(T.id),onChange:()=>D(T.id),"aria-label":`Select ${T.businessName||T.pageName||"announcement"}`,className:"w-4 h-4 mt-1 shrink-0 rounded accent-[var(--primary)] cursor-pointer"}),a.jsxs("div",{className:"min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[a.jsx("span",{className:"text-sm font-semibold",children:T.businessName||T.pageName||"Business"}),a.jsx("span",{className:"text-[11px] text-muted-foreground",children:Je(T.createdAt)})]}),a.jsx("h3",{className:"text-sm font-semibold mt-1.5",children:T.title}
16),a.jsx("p",{className:"text-sm text-foreground/90 mt-1 whitespace-pre-wrap",children:T.body}),T.mediaUrl&&a.jsx("img",{src:T.mediaUrl,alt:"",className:"mt-2 w-40 h-28 rounded-xl object-cover border"}),T.rejectReason&&a.jsxs("p",{className:"text-xs text-destructive mt-1.5",children:["Rejected: ",T.rejectReason]})]})]}),l==="pending"&&a.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[a.jsx("button",{onClick:()=>k(T.id,"approve"),disabled:N,className:"px-4 py-2 rounded-full bg-primary text-primary-foreground text-xs font-semibold disabled:opacity-50",children:"Approve and publish"}),a.jsx("button",{onClick:()=>w(g===T.id?null:T.id),disabled:N,className:"px-4 py-2 rounded-full border bg-card text-xs font-semibold hover:bg-accent/40 disabled:opacity-50",children:"Reject"})]})]}),g===T.id&&a.jsxs("div",{className:"mt-3 pt-3 border-t flex items-center gap-2",children:[a.jsx("input",{value:b,onChange:A=>x(A.target.value),placeholder:"Reason shown to the business (optional)",maxLength:300,className:Wt}),a.jsx("button",{onClick:()=>k(T.id,"reject",b.trim()||void 0),disabled:N,className:"px-4 py-2 rounded-full bg-destructive text-destructive-foreground text-xs font-semibold disabled:opacity-50 shrink-0",children:"Confirm reject"})]})]},T.id))]})}function v2(){const{operator:l,signOut:i}=ot(),[r,u]=m.useState(()=>{try{const f=new URLSearchParams(window.location.search).get("tab");if(f==="official")return"broadcasts";if(f&&jp.some(h=>h.id===f))return f}catch{}return"overview"});return a.jsx("div",{className:"min-h-screen w-full",children:a.jsxs("div",{className:"mx-auto w-full max-w-[1080px] px-4 lg:px-8 py-8 space-y-5",children:[a.jsxs("header",{className:"flex items-center justify-between gap-3 flex-wrap",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(Fa,{size:44}),a.jsxs("div",{className:"leading-tight",children:[a.jsx("h1",{className:"text-2xl font-semibold tracking-tight font-display",children:"Neighborhood staff console"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:l?.name||"Staff"})]})]}),a.jsxs("button",{onClick:i,className:"flex items-center gap-2 px-4 py-2.5 rounded-2xl border bg-card hover:bg-accent/40 transition text-sm font-medium",children:[a.jsx(Kp,{className:"w-4 h-4"})," Sign out"]})]}),a.jsx("nav",{className:"flex items-center gap-1.5 flex-wrap",children:jp.map(f=>{const h=r===f.id;return a.jsxs("button",{onClick:()=>u(f.id),className:`flex items-center gap-2 px-4 py-2.5 rounded-2xl text-sm font-medium transition ${h?"bg-primary text-primary-foreground shadow-[var(--shadow-warm)]":"bg-card border text-foreground/80 hover:bg-accent/40"}`,children:[f.icon,f.label]},f.id)})}),r==="overview"&&a.jsx(f2,{}),r==="broadcasts"&&a.jsx(u2,{}),r==="announcements"&&a.jsx(b2,{}),r==="moderation"&&a.jsx(m2,{}),r==="sponsored"&&a.jsx(h2,{}),r==="agencies"&&a.jsx(x2,{}),a.jsx(Kl,{className:"pt-2"})]})})}function N2({id:l}){const[i,r]=m.useState(null),[u,f]=m.useState(!1),[h,g]=m.useState(!1);if(m.useEffect(()=>{let b=!0;return K.get(`/api/neighborhood/posts/${l}/public`).then(x=>b&&r(x.post)).catch(()=>b&&f(!0)),()=>{b=!1}},[l]),h||u)return a.jsx(eg,{});const w=i?$r(i.body):null;return a.jsx("div",{className:"min-h-screen w-full flex items-center justify-center px-4 py-10",children:a.jsxs("div",{className:"w-full max-w-[440px]",children:[a.jsxs("div",{className:"flex items-center justify-center gap-2 mb-4",children:[a.jsx(Fa,{size:36}),a.jsx("span",{className:"text-lg font-semibold font-display tracking-tight",children:"Neighborhood"})]}),i?a.jsxs("article",{className:"rounded-3xl bg-card border p-5 shadow-[var(--shadow-warm)]",children:[a.jsxs("header",{className:"flex items-center gap-3",children:[a.jsx(ut,{name:i.author.displayName,initials:dt(i.author.displayName),src:i.author.avatarUrl,size:40}),a.jsxs("div",{className:"min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("span",{className:"text-sm font-semibold truncate",children:i.author.displayName}),(i.author.isOfficial||bs(i.author.verificationTier??0))&&a.jsx(es,{className:"w-3.5 h-3.5 text-primary shrink-0","aria-label":"Verified"})]}),a.jsxs("div",{className:"text-[11px] text-muted-foreground",children:[i.neighborhoodName?`${i.neighborhoodName} · `:"",Je(i.createdAt)]})]})]}),i.title&&a.jsx("h3",{className:"mt-3 font-semibold font-display tracking-tight text-[16px]",children:i.title}),w?.text&&a.jsx("p",{className:`${i.title?"mt-1.5":"mt-3"} text-[15px] leading-relaxed whitespace-pre-wrap`,children:w.text}),w?.videos.map(b=>a.jsx(Yr,{url:b,className:"mt-3"},b)),i.mediaUrl&&a.jsx("img",{src:i.mediaUrl,alt:"",className:"mt-3 w-full rounded-2xl object-cover border max-h-80"}),a.jsxs("div",{className:"mt-3 pt-3 border-t flex items-center gap-4 text-xs text-muted-foreground",children:[a.jsxs("span",{className:"flex items-center gap-1.5",children:[a.jsx(Ur,{className:"w-4 h-4"})," ",i.reactionCount]}),a.jsxs("span",{className:"flex items-center gap-1.5",children:[a.jsx(qr,{className:"w-4 h-4"})," ",i.commentCount]})]})]}):a.jsxs("div",{className:"rounded-3xl bg-card border p-5 shadow-sm animate-pulse space-y-3",children:[a.jsx("div",{className:"h-4 w-1/3 rounded bg-muted"}),a.jsx("div",{className:"h-3 w-full rounded bg-muted"}),a.jsx("div",{className:"h-3 w-2/3 rounded bg-muted"})]}),a.jsxs("div",{className:"mt-4 rounded-3xl bg-card border p-5 text-center shadow-sm",children:[a.jsx("h2",{className:"font-semibold font-display tracking-tight",children:"A neighbor shared this with you"}),a.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Sign in with your phone number to see the whole conversation and join the people who live nearby."}),a.jsx("button",{onClick:()=>g(!0),className:"mt-3 w-full py-3 rounded-2xl bg-primary text-primary-foreground font-medium text-sm",children:"Continue to Neighborhood"})]}),a.jsx(Kl,{className:"pt-4"})]})})}const j2="(888) 774-4497",w2="tel:+18887744497",S2="https://dlmpropertygroup.com",C2="https://dlmpropertygroup.com/DLMEvents.html";function k2(){window.history.length>1?window.history.back():be({view:"home"})}function _2(){const[l,i]=m.useState([]);return m.useEffect(()=>{K.get("/api/neighborhood/official/public").then(r=>i(r.posts||[])).catch(()=>{})},[]),a.jsxs("div",{className:"space-y-4 pb-6",children:[a.jsxs("button",{onClick:k2,className:"flex items-center gap-1.5 text-sm font-medium text-muted-foreground hover:text-foreground transition",children:[a.jsx(At,{className:"w-4 h-4"})," Back"]}),a.jsxs("section",{className:"rounded-3xl bg-card border p-5 shadow-sm",children:[a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx(F
16a,{size:56}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[a.jsx("h2",{className:"text-lg font-semibold font-display tracking-tight",children:"DLM Property Management"}),a.jsxs("span",{className:"flex items-center gap-1 text-[10px] font-bold uppercase tracking-wide text-primary",children:[a.jsx(es,{className:"w-3.5 h-3.5","aria-hidden":"true"})," Official"]})]}),a.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"The team behind Neighborhood. We connect residents with trusted local pros, fund community programs and giveaways, and keep your digital mailbox running."})]})]}),a.jsxs("div",{className:"mt-4 flex items-center gap-2 flex-wrap",children:[a.jsxs("a",{href:w2,className:"flex items-center gap-2 px-4 py-2 rounded-full bg-primary text-primary-foreground text-xs font-semibold transition",children:[a.jsx(Ja,{className:"w-3.5 h-3.5"})," Call us"]}),a.jsxs("a",{href:S2,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 px-4 py-2 rounded-full border bg-card text-xs font-semibold hover:bg-accent/40 transition",children:[a.jsx(Zp,{className:"w-3.5 h-3.5"})," Website"]}),a.jsxs("a",{href:C2,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 px-4 py-2 rounded-full border bg-card text-xs font-semibold hover:bg-accent/40 transition",children:[a.jsx(Dr,{className:"w-3.5 h-3.5"})," Events and giveaways"]}),a.jsxs("a",{href:"/myhomeinbox/?as=resident&tab=inbox",className:"flex items-center gap-2 px-4 py-2 rounded-full border bg-card text-xs font-semibold hover:bg-accent/40 transition",children:[a.jsx(Lr,{className:"w-3.5 h-3.5"})," Your mailbox"]})]}),a.jsxs("div",{className:"mt-3 pt-3 border-t text-xs text-muted-foreground flex items-center gap-2",children:[a.jsx(Ja,{className:"w-3.5 h-3.5 shrink-0"}),a.jsx("span",{children:j2}),a.jsx("span",{className:"text-muted-foreground/60",children:"Ava, our assistant, answers day and night."})]})]}),a.jsxs("div",{children:[a.jsx("h3",{className:"font-semibold font-display tracking-tight text-sm px-1 mb-2",children:"Recent announcements"}),a.jsxs("div",{className:"space-y-3",children:[l.length===0&&a.jsx("section",{className:"rounded-3xl bg-card border p-5 text-center shadow-sm",children:a.jsx("p",{className:"text-sm text-muted-foreground",children:"No announcements right now. Check back soon."})}),l.map(r=>{const{text:u,videos:f}=$r(r.body);return a.jsxs("div",{role:"button",tabIndex:0,onClick:()=>be({view:"post",id:Number(r.id)}),onKeyDown:h=>{h.key==="Enter"&&be({view:"post",id:Number(r.id)})},className:"w-full text-left rounded-3xl bg-card border p-4 shadow-sm hover:bg-accent/20 transition cursor-pointer",children:[r.title&&a.jsx("div",{className:"text-sm font-semibold",children:r.title}),u&&a.jsx("p",{className:"text-sm text-muted-foreground line-clamp-3 mt-1 whitespace-pre-wrap",children:u}),f.map(h=>a.jsx(Yr,{url:h,className:"mt-2"},h)),a.jsx("div",{className:"text-[11px] text-muted-foreground mt-2",children:Je(r.createdAt)})]},r.id)})]})]})]})}function E2({route:l}){switch(l.view){case"post":return a.jsx($v,{id:l.id});case"market":return a.jsx(Kv,{});case"listing":return a.jsx(Jv,{id:l.id});case"discover":return a.jsx(hN,{sub:l.sub});case"group":return a.jsx(pN,{id:l.id});case"event":return a.jsx(yN,{id:l.id});case"business":return a.jsx(PN,{id:l.id});case"messages":return a.jsx(bN,{});case"thread":return a.jsx(NN,{id:l.id});case"neighbors":return a.jsx(EN,{});case"profile":return a.jsx(RN,{id:l.id});case"settings":return a.jsx(HN,{});case"moderation":return a.jsx(VN,{});case"dlm":return a.jsx(_2,{});case"search":return a.jsx(QN,{q:l.q});default:return a.jsx(qv,{})}}function T2(){const{status:l}=ot(),i=fv(),[r,u]=m.useState(!1);if(l==="loading")return a.jsx("div",{className:"min-h-screen grid place-items-center",children:a.jsx("div",{className:"w-10 h-10 rounded-2xl bg-primary animate-pulse"})});if(l==="signedOut")return i.view==="post"?a.jsx(N2,{id:i.id}):a.jsx(eg,{});if(l==="operator")return a.jsx(v2,{});if(l==="needsOnboarding")return a.jsx(ov,{});const f=hv(i),h=a.jsx(E2,{route:i});return a.jsxs("div",{className:"min-h-screen w-full",children:[a.jsx(jv,{}),a.jsxs("div",{className:"lg:hidden mx-auto w-full max-w-[440px] min-h-screen flex flex-col relative pb-24",children:[a.jsx(xv,{tab:f,onBell:()=>u(!0)}),a.jsxs("main",{className:"flex-1 px-4",children:[h,a.jsx(Kl,{})]}),a.jsx(bv,{tab:f})]}),a.jsxs("div",{className:"hidden lg:grid lg:grid-cols-[220px_minmax(0,1fr)] gap-10 max-w-[1040px] mx-auto px-8 py-10 min-h-screen",children:[a.jsx(yv,{tab:f,onBell:()=>u(!0)}),a.jsxs("main",{className:"min-w-0 max-w-[680px] w-full mx-auto",children:[h,a.jsx(Kl,{className:"pt-6"})]})]}),a.jsx(Nv,{open:r,onClose:()=>u(!1)})]})}function A2(){return a.jsxs(s0,{children:[a.jsx(ib,{position:"top-center",richColors:!0}),a.jsx(T2,{})]})}My.createRoot(document.getElementById("root")).render(a.jsx(m.StrictMode,{children:a.jsx(A2,{})}));export{wp as g};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.