vendor: 20,529 bytes, lines 1-3
1var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var l=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=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,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},ee=Object.prototype.hasOwnProperty;function te(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function ne(e,t){return te(e.type,t,e.props)}function re(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function T(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var ie=/\/+/g;function ae(e,t){return typeof e==`object`&&e&&e.key!=null?T(``+e.key):t.toString(36)}function oe(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function se(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,se(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+ae(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(ie,`$&/`)+`/`),se(o,r,i,``,function(e){return e})):o!=null&&(re(o)&&(o=ne(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(ie,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+ae(a,u),c+=se(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+ae(a,u++),c+=se(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return se(oe(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function ce(e,t,n){if(e==null)return e;var r=[],i=0;return se(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function le(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var E=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&&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)},D={map:ce,forEach:function(e,t,n){ce(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ce(e,function(){t++}),t},toArray:function(e){return ce(e,function(e){return e})||[]},only:function(e){if(!re(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=D,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!ee.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return te(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)ee.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return te(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=re,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:le}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,E)}catch(e){E(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.7`})),u=o(((e,t)=>{t.exports=l()})),d=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,re());else{var t=n(l);t!==null&&ae(x,t.startTime-e)}}var S=!1,C=-1,w=5,ee=-1;function te(){return g?!0:!(e.unstable_now()-ee<w)}function ne(){if(g=!1,S){var t=e.unstable_now();ee=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&te());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&ae(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?re():S=!1}}}var re;if(typeof y==`function`)re=function(){y(ne)};else if(typeof MessageChannel<`u`){var T=new MessageChannel,ie=T.port2;T.port1.onmessage=ne,re=function(){ie.postMessage(null)}}else re=function(){_(ne,0)};function ae(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,ae(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,re()))),r},e.unstable_shouldYield=te,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),f=o(((e,t)=>{t.exports=d()})),p=o((e=>{var t=u();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=c(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.7`})),m=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=p()})),h=o((e=>{var t=f(),n=u(),r=m();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function s(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 c(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 l(e){if(o(e)!==e)throw Error(i(188))}function d(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function p(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=p(e),t!==null)return t;e=e.sibling}return null}var h=Object.assign,g=Symbol.for(`react.element`),_=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),S=Symbol.for(`react.consumer`),C=Symbol.for(`react.context`),w=Symbol.for(`react.forward_ref`),ee=Symbol.for(`react.suspense`),te=Symbol.for(`react.suspense_list`),ne=Symbol.for(`react.memo`),re=Symbol.for(`react.lazy`),T=Symbol.for(`react.activity`),ie=Symbol.for(`react.memo_cache_sentinel`),ae=Symbol.iterator;function oe(e){return typeof e!=`object`||!e?null:(e=ae&&e[ae]||e[`@@iterator`],typeof e==`function`?e:null)}var se=Symbol.for(`react.client.reference`);function ce(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===se?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case ee:return`Suspense`;case te:return`SuspenseList`;case T:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case C:return e.displayName||`Context`;case S:return(e._context.displayName||`Context`)+`.Consumer`;case w:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case ne:return t=e.displayName||null,t===null?ce(e.type)||`Memo`:t;case re:t=e._payload,e=e._init;try{return ce(e(t))}catch{}}return null}var le=Array.isArray,E=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,D=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ue={pending:!1,data:null,method:null,action:null},de=[],fe=-1;function pe(e){return{current:e}}function me(e){0>fe||(e.current=de[fe],de[fe]=null,fe--)}function he(e,t){fe++,de[fe]=e.current,e.current=t}var ge=pe(null),_e=pe(null),ve=pe(null),ye=pe(null);function be(e,t){switch(he(ve,t),he(_e,e),he(ge,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Jd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Jd(t),e=Yd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}me(ge),he(ge,e)}function xe(){me(ge),me(_e),me(ve)}function Se(e){e.memoizedState!==null&&he(ye,e);var t=ge.current,n=Yd(t,e.type);t!==n&&(he(_e,e),he(ge,n))}function Ce(e){_e.current===e&&(me(ge),me(_e)),ye.current===e&&(me(ye),ap._currentValue=ue)}var we,Te;function Ee(e){if(we===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);we=t&&t[1]||``,Te=-1<e.stack.indexOf(` 2 at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return` 3`+we+e+Te}var De=!1;function Oe(e,t){if(!e||De)return``;De=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}
vendor: 13,127 bytes, lines 3-8
3else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(` 4`),l=s.split(` 5`);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=` 6`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{De=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Ee(n):``}function ke(e,t){switch(e.tag){case 26:case 27:case 5:return Ee(e.type);case 16:return Ee(`Lazy`);case 13:return e.child!==t&&t!==null?Ee(`Suspense Fallback`):Ee(`Suspense`);case 19:return Ee(`SuspenseList`);case 0:case 15:return Oe(e.type,!1);case 11:return Oe(e.type.render,!1);case 1:return Oe(e.type,!0);case 31:return Ee(`Activity`);default:return``}}function Ae(e){try{var t=``,n=null;do t+=ke(e,n),n=e,e=e.return;while(e);return t}catch(e){return` 7Error generating stack: `+e.message+` 8`+e.stack}}var je=Object.prototype.hasOwnProperty,Me=t.unstable_scheduleCallback,Ne=t.unstable_cancelCallback,Pe=t.unstable_shouldYield,Fe=t.unstable_requestPaint,Ie=t.unstable_now,Le=t.unstable_getCurrentPriorityLevel,Re=t.unstable_ImmediatePriority,ze=t.unstable_UserBlockingPriority,Be=t.unstable_NormalPriority,Ve=t.unstable_LowPriority,He=t.unstable_IdlePriority,Ue=t.log,We=t.unstable_setDisableYieldValue,Ge=null,Ke=null;function qe(e){if(typeof Ue==`function`&&We(e),Ke&&typeof Ke.setStrictMode==`function`)try{Ke.setStrictMode(Ge,e)}catch{}}var Je=Math.clz32?Math.clz32:Ze,Ye=Math.log,Xe=Math.LN2;function Ze(e){return e>>>=0,e===0?32:31-(Ye(e)/Xe|0)|0}var Qe=256,$e=262144,et=4194304;function tt(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 nt(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=tt(n))):i=tt(o):i=tt(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=tt(n))):i=tt(o)):i=tt(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function rt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function it(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 at(){var e=et;return et<<=1,!(et&62914560)&&(et=4194304),e}function ot(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function st(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ct(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Je(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&<(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function lt(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Je(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function ut(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Je(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function dt(e,t){var n=t&-t;return n=n&42?1:ft(n),(n&(e.suspendedLanes|t))===0?n:0}function ft(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 pt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function mt(){var e=D.p;return e===0?(e=window.event,e===void 0?32:xp(e.type)):e}function ht(e,t){var n=D.p;try{return D.p=e,t()}finally{D.p=n}}var gt=Math.random().toString(36).slice(2),O=`__reactFiber$`+gt,_t=`__reactProps$`+gt,vt=`__reactContainer$`+gt,yt=`__reactEvents$`+gt,bt=`__reactListeners$`+gt,xt=`__reactHandles$`+gt,St=`__reactResources$`+gt,Ct=`__reactMarker$`+gt;function wt(e){delete e[O],delete e[_t],delete e[yt],delete e[bt],delete e[xt]}function Tt(e){var t=e[O];if(t)return t;for(var n=e.parentNode;n;){if(t=n[vt]||n[O]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=vf(e);e!==null;){if(n=e[O])return n;e=vf(e)}return t}e=n,n=e.parentNode}return null}function Et(e){if(e=e[O]||e[vt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Dt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function Ot(e){var t=e[St];return t||=e[St]={hoistableStyles:new Map,hoistableScripts:new Map},t}function kt(e){e[Ct]=!0}var At=new Set,jt={};function Mt(e,t){Nt(e,t),Nt(e+`Capture`,t)}function Nt(e,t){for(jt[e]=t,e=0;e<t.length;e++)At.add(t[e])}var Pt=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]*$`),Ft={},It={};function Lt(e){return je.call(It,e)?!0:je.call(Ft,e)?!1:Pt.test(e)?It[e]=!0:(Ft[e]=!0,!1)}function Rt(e,t,n){if(Lt(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}function zt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,``+n)}}function Bt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function Vt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Ht(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Ut(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Wt(e){if(!e._valueTracker){var t=Ht(e)?`checked`:`value`;e._valueTracker=Ut(e,t,``+e[t])}}function Gt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Ht(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function Kt(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var qt=/[\n"\\]/g;function k(e){return e.replace(qt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Jt(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Vt(t)):e.value!==``+Vt(t)&&(e.value=``+Vt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Xt(e,o,Vt(n)):Xt(e,o,Vt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Vt(s):e.removeAttribute(`name`)}function Yt(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){Wt(e);return}n=n==null?``:``+Vt(n),t=t==null?n:``+Vt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),Wt(e)}function Xt(e,t,n){t===`number`&&Kt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Zt(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Vt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Qt(e,t,n){if(t!=null&&(t=``+Vt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Vt(n)}function $t(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(le(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Vt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Wt(e)}function en(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var tn=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 nn(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||tn.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function rn(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&nn(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&nn(e,o,t[o])}function an(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 on=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`],[`
8clipPath`,`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-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`]]),sn=/^[\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 cn(e){return sn.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function ln(){}var un=null;function dn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var fn=null,pn=null;function mn(e){var t=Et(e);if(t&&(e=t.stateNode)){var n=e[_t]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Jt(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+k(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[_t]||null;if(!a)throw Error(i(90));Jt(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Gt(r)}break a;case`textarea`:Qt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Zt(e,!!n.multiple,t,!1)}}}var hn=!1;function gn(e,t,n){if(hn)return e(t,n);hn=!0;try{return e(t)}finally{if(hn=!1,(fn!==null||pn!==null)&&(Ou(),fn&&(t=fn,e=pn,pn=fn=null,mn(t),e)))for(t=0;t<e.length;t++)mn(e[t])}}function _n(e,t){var n=e.stateNode;if(n===null)return null;var r=n[_t]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=!(e===`button`||e===`input`||e===`select`||e===`textarea`)),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var vn=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),yn=!1;if(vn)try{var bn={};Object.defineProperty(bn,"passive",{get:function(){yn=!0}
vendor: 151,881 bytes, lines 8-9
8}),window.addEventListener(`test`,bn,bn),window.removeEventListener(`test`,bn,bn)}catch{yn=!1}var xn=null,Sn=null,Cn=null;function wn(){if(Cn)return Cn;var e,t=Sn,n=t.length,r,i=`value`in xn?xn.value:xn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return Cn=i.slice(e,1<r?1-r:void 0)}function Tn(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 En(){return!0}function Dn(){return!1}function On(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?En:Dn,this.isPropagationStopped=Dn,this}return h(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=En)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=En)},persist:function(){},isPersistent:En}),t}var kn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},An=On(kn),jn=h({},kn,{view:0,detail:0}),Mn=On(jn),Nn,Pn,Fn,In=h({},jn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Kn,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!==Fn&&(Fn&&e.type===`mousemove`?(Nn=e.screenX-Fn.screenX,Pn=e.screenY-Fn.screenY):Pn=Nn=0,Fn=e),Nn)},movementY:function(e){return`movementY`in e?e.movementY:Pn}}),Ln=On(In),Rn=On(h({},In,{dataTransfer:0})),zn=On(h({},jn,{relatedTarget:0})),Bn=On(h({},kn,{animationName:0,elapsedTime:0,pseudoElement:0})),A=On(h({},kn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Vn=On(h({},kn,{data:0})),Hn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Un={8:`Backspace`,9:`Tab`,12:`Clear`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,45:`Insert`,46:`Delete`,112:`F1`,113:`F2`,114:`F3`,115:`F4`,116:`F5`,117:`F6`,118:`F7`,119:`F8`,120:`F9`,121:`F10`,122:`F11`,123:`F12`,144:`NumLock`,145:`ScrollLock`,224:`Meta`},Wn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Gn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Wn[e])?!!t[e]:!1}function Kn(){return Gn}var qn=On(h({},jn,{key:function(e){if(e.key){var t=Hn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=Tn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Un[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Kn,charCode:function(e){return e.type===`keypress`?Tn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?Tn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Jn=On(h({},In,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Yn=On(h({},jn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Kn})),Xn=On(h({},kn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Zn=On(h({},In,{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})),Qn=On(h({},kn,{newState:0,oldState:0})),$n=[9,13,27,32],er=vn&&`CompositionEvent`in window,tr=null;vn&&`documentMode`in document&&(tr=document.documentMode);var nr=vn&&`TextEvent`in window&&!tr,rr=vn&&(!er||tr&&8<tr&&11>=tr),ir=` `,ar=!1;function j(e,t){switch(e){case`keyup`:return $n.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function or(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var sr=!1;function M(e,t){switch(e){case`compositionend`:return or(t);case`keypress`:return t.which===32?(ar=!0,ir):null;case`textInput`:return e=t.data,e===ir&&ar?null:e;default:return null}}function cr(e,t){if(sr)return e===`compositionend`||!er&&j(e,t)?(e=wn(),Cn=Sn=xn=null,sr=!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 rr&&t.locale!==`ko`?null:t.data;default:return null}}var lr={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 ur(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!lr[e.type]:t===`textarea`}function dr(e,t,n,r){fn?pn?pn.push(r):pn=[r]:fn=r,t=Md(t,`onChange`),0<t.length&&(n=new An(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var fr=null,pr=null;function mr(e){Td(e,0)}function hr(e){if(Gt(Dt(e)))return e}function gr(e,t){if(e===`change`)return t}var _r=!1;if(vn){var vr;if(vn){var yr=`oninput`in document;if(!yr){var br=document.createElement(`div`);br.setAttribute(`oninput`,`return;`),yr=typeof br.oninput==`function`}vr=yr}else vr=!1;_r=vr&&(!document.documentMode||9<document.documentMode)}function xr(){fr&&(fr.detachEvent(`onpropertychange`,Sr),pr=fr=null)}function Sr(e){if(e.propertyName===`value`&&hr(pr)){var t=[];dr(t,pr,e,dn(e)),gn(mr,t)}}function Cr(e,t,n){e===`focusin`?(xr(),fr=t,pr=n,fr.attachEvent(`onpropertychange`,Sr)):e===`focusout`&&xr()}function wr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return hr(pr)}function Tr(e,t){if(e===`click`)return hr(t)}function Er(e,t){if(e===`input`||e===`change`)return hr(t)}function Dr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Or=typeof Object.is==`function`?Object.is:Dr;function kr(e,t){if(Or(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!je.call(t,i)||!Or(e[i],t[i]))return!1}return!0}function Ar(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function jr(e,t){var n=Ar(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Ar(n)}}function Mr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Mr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Nr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Kt(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Kt(e.document)}return t}function Pr(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 Fr=vn&&`documentMode`in document&&11>=document.documentMode,Ir=null,Lr=null,Rr=null,zr=!1;function Br(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;zr||Ir==null||Ir!==Kt(r)||(r=Ir,`selectionStart`in r&&Pr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Rr&&kr(Rr,r)||(Rr=r,r=Md(Lr,`onSelect`),0<r.length&&(t=new An(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Ir)))}function Vr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Hr={animationend:Vr(`Animation`,`AnimationEnd`),animationiteration:Vr(`Animation`,`AnimationIteration`),animationstart:Vr(`Animation`,`AnimationStart`),transitionrun:Vr(`Transition`,`TransitionRun`),transitionstart:Vr(`Transition`,`TransitionStart`),transitioncancel:Vr(`Transition`,`TransitionCancel`),transitionend:Vr(`Transition`,`TransitionEnd`)},Ur={},Wr={};vn&&(Wr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Hr.animationend.animation,delete Hr.animationiteration.animation,delete Hr.animationstart.animation),`TransitionEvent`in window||delete Hr.transitionend.transition);function Gr(e){if(Ur[e])return Ur[e];if(!Hr[e])return e;var t=Hr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Wr)return Ur[e]=t[n];return e}var Kr=Gr(`animationend`),qr=Gr(`animationiteration`),Jr=Gr(`animationstart`),Yr=Gr(`transitionrun`),Xr=Gr(`transitionstart`),Zr=Gr(`transitioncancel`),Qr=Gr(`transitionend`),$r=new Map,ei=`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(` `);ei.push(`scrollEnd`);function ti(e,t){$r.set(e,t),Mt(t,[e])}var ni=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&&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)},ri=[],ii=0,ai=0;function oi(){for(var e=ii,t=ai=ii=0;t<e;){var n=ri[t];ri[t++]=null;var r=ri[t];ri[t++]=null;var i=ri[t];ri[t++]=null;var a=ri[t];if(ri[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&ui(n,i,a)}}function si(e,t,n,r){ri[ii++]=e,ri[ii++]=t,ri[ii++]=n,ri[ii++]=r,ai|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function ci(e,t,n,r){return si(e,t,n,r),di(e)}function li(e,t){return si(e,null,null,t),di(e)}function ui(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Je(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function di(e){if(50<yu)throw yu=0,bu=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var fi={};function pi(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function mi(e,t,n,r){return new pi(e,t,n,r)}function hi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function gi(e,t){var n=e.alternate;return n===null?(n=mi(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function _i(e,t){e.flags&=65011714;var n=e.alternate;return n===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=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function vi(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)hi(e)&&(s=1);else if(typeof e==`string`)s=Xf(e,n,ge.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case T:return e=mi(31,n,t,a),e.elementType=T,e.lanes=o,e;case y:return yi(n.children,a,o,t);case b:s=8,a|=24;break;case x:return e=mi(12,n,t,a|2),e.elementType=x,e.lanes=o,e;case ee:return e=mi(13,n,t,a),e.elementType=ee,e.lanes=o,e;case te:return e=mi(19,n,t,a),e.elementType=te,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case C:s=10;break a;case S:s=9;break a;case w:s=11;break a;case ne:s=14;break a;case re:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=mi(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function yi(e,t,n,r){return e=mi(7,e,r,t),e.lanes=n,e}function bi(e,t,n){return e=mi(6,e,null,t),e.lanes=n,e}function xi(e){var t=mi(18,null,null,0);return t.stateNode=e,t}function Si(e,t,n){return t=mi(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Ci=new WeakMap;function wi(e,t){if(typeof e==`object`&&e){var n=Ci.get(e);return n===void 0?(t={value:e,source:t,stack:Ae(t)},Ci.set(e,t),t):n}return{value:e,source:t,stack:Ae(t)}}var Ti=[],Ei=0,Di=null,Oi=0,ki=[],Ai=0,ji=null,Mi=1,Ni=``;function Pi(e,t){Ti[Ei++]=Oi,Ti[Ei++]=Di,Di=e,Oi=t}function Fi(e,t,n){ki[Ai++]=Mi,ki[Ai++]=Ni,ki[Ai++]=ji,ji=e;var r=Mi;e=Ni;var i=32-Je(r)-1;r&=~(1<<i),n+=1;var a=32-Je(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Mi=1<<32-Je(t)+i|n<<i|r,Ni=a+e}else Mi=1<<a|n<<i|r,Ni=e}function Ii(e){e.return!==null&&(Pi(e,1),Fi(e,1,0))}function Li(e){for(;e===Di;)Di=Ti[--Ei],Ti[Ei]=null,Oi=Ti[--Ei],Ti[Ei]=null;for(;e===ji;)ji=ki[--Ai],ki[Ai]=null,Ni=ki[--Ai],ki[Ai]=null,Mi=ki[--Ai],ki[Ai]=null}function Ri(e,t){ki[Ai++]=Mi,ki[Ai++]=Ni,ki[Ai++]=ji,Mi=t.id,Ni=t.overflow,ji=e}var zi=null,Bi=null,N=!1,Vi=null,Hi=!1,Ui=Error(i(519));function Wi(e){throw Xi(wi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Ui}function Gi(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[O]=e,t[_t]=r,n){case`dialog`:q(`cancel`,t),q(`close`,t);break;case`iframe`:case`object`:case`embed`:q(`load`,t);break;case`video`:case`audio`:for(n=0;n<Cd.length;n++)q(Cd[n],t);break;case`source`:q(`error`,t);break;case`img`:case`image`:case`link`:q(`error`,t),q(`load`,t);break;case`details`:q(`toggle`,t);break;case`input`:q(`invalid`,t),Yt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:q(`invalid`,t);break;case`textarea`:q(`invalid`,t),$t(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||Rd(t.textContent,n)?(r.popover!=null&&(q(`beforetoggle`,t),q(`toggle`,t)),r.onScroll!=null&&q(`scroll`,t),r.onScrollEnd!=null&&q(`scrollend`,t),r.onClick!=null&&(t.onclick=ln),t=!0):t=!1,t||Wi(e,!0)}function Ki(e){for(zi=e.return;zi;)switch(zi.tag){case 5:case 31:case 13:Hi=!1;return;case 27:case 3:Hi=!0;return;default:zi=zi.return}}function qi(e){if(e!==zi)return!1;if(!N)return Ki(e),N=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||Xd(e.type,e.memoizedProps)),n=!n),n&&Bi&&Wi(e),Ki(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Bi=_f(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Bi=_f(e)}else t===27?(t=Bi,af(e.type)?(e=gf,gf=null,Bi=e):Bi=t):Bi=zi?hf(e.stateNode.nextSibling):null;return!0}function Ji(){Bi=zi=null,N=!1}function Yi(){var e=Vi;return e!==null&&(au===null?au=e:au.push.apply(au,e),Vi=null),e}function Xi(e){Vi===null?Vi=[e]:Vi.push(e)}var Zi=pe(null),Qi=null,$i=null;function ea(e,t,n){he(Zi,t._currentValue),t._currentValue=n}function ta(e){e._currentValue=Zi.current,me(Zi)}function na(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function ra(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),na(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),na(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function ia(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;Or(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===ye.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[ap]:e.push(ap))}a=a.return}e!==null&&ra(t,e,n,r),t.flags|=262144}function aa(e){for(e=e.firstContext;e!==null;){if(!Or(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function oa(e){Qi=e,$i=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function P(e){return ca(Qi,e)}function sa(e,t){return Qi===null&&oa(e),ca(e,t)}function ca(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},$i===null){if(e===null)throw Error(i(308));$i=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else $i=$i.next=t;return n}var la=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},ua=t.unstable_scheduleCallback,da=t.unstable_NormalPriority,fa={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function pa(){return{controller:new la,data:new Map,refCount:0}}function ma(e){e.refCount--,e.refCount===0&&ua(da,function(){e.controller.abort()})}var ha=null,ga=0,_a=0,va=null;function ya(e,t){if(ha===null){var n=ha=[];ga=0,_a=K(),va={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return ga++,t.then(ba,ba),t}function ba(){if(--ga===0&&ha!==null){va!==null&&(va.status=`fulfilled`);var e=ha;ha=null,_a=0,va=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function xa(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var Sa=E.S;E.S=function(e,t){cu=Ie(),typeof t==`object`&&t&&typeof t.then==`function`&&ya(e,t),Sa!==null&&Sa(e,t)};var Ca=pe(null);function wa(){var e=Ca.current;return e===null?Gl.pooledCache:e}function Ta(e,t){t===null?he(Ca,Ca.current):he(Ca,t.pool)}function Ea(){var e=wa();return e===null?null:{parent:fa._currentValue,pool:e}}var Da=Error(i(460)),Oa=Error(i(474)),ka=Error(i(542)),Aa={then:function(){}};function ja(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Ma(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(ln,ln),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Ia(e),e;default:if(typeof t.status==`string`)t.then(ln,ln);else{if(e=Gl,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Ia(e),e}throw Pa=t,Da}}function Na(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Pa=e,Da):e}}var Pa=null;function Fa(){if(Pa===null)throw Error(i(459));var e=Pa;return Pa=null,e}function Ia(e){if(e===Da||e===ka)throw Error(i(483))}var La=null,Ra=0;function za(e){var t=Ra;return Ra+=1,La===null&&(La=[]),Ma(La,e,t)}function Ba(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Va(e,t){throw t.$$typeof===g?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Ha(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=gi(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=bi(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===y?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===re&&Na(i)===t.type)?(t=a(t,n.props),Ba(t,n),t.return=e,t):(t=vi(n.type,n.key,n.props,null,e.mode,r),Ba(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=Si(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=yi(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=bi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case _:return n=vi(t.type,t.key,t.props,null,e.mode,n),Ba(n,t),n.return=e,n;case v:return t=Si(t,e.mode,n),t.return=e,t;case re:return t=Na(t),f(e,t,n)}if(le(t)||oe(t))return t=yi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,za(t),n);if(t.$$typeof===C)return f(e,sa(e,t),n);Va(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case _:return n.key===i?l(e,t,n,r):null;case v:return n.key===i?u(e,t,n,r):null;case re:return n=Na(n),p(e,t,n,r)}if(le(n)||oe(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,za(n),r);if(n.$$typeof===C)return p(e,t,sa(e,n),r);Va(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case _:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case v:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case re:return r=Na(r),m(e,t,n,r,i)}if(le(r)||oe(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,za(r),i);if(r.$$typeof===C)return m(e,t,n,sa(t,r),i);Va(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),N&&Pi(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return N&&Pi(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),N&&Pi(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),N&&Pi(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return N&&Pi(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),N&&Pi(a,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===y&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case _:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===y){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===re&&Na(l)===r.type){n(e,r.sibling),c=a(r,o.props),Ba(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===y?(c=yi(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=vi(o.type,o.key,o.props,null,e.mode,c),Ba(c,o),c.return=e,e=c)}return s(e);case v:a:{for(l=o.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}else{n(e,r);break}else t(e,r);r=r.sibling}c=Si(o,e.mode,c),c.return=e,e=c}return s(e);case re:return o=Na(o),b(e,r,o,c)}if(le(o))return h(e,r,o,c);if(oe(o)){if(l=oe(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,za(o),c);if(o.$$typeof===C)return b(e,r,sa(e,o),c);Va(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=bi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Ra=0;var i=b(e,t,n,r);return La=null,i}catch(t){if(t===Da||t===ka)throw t;var a=mi(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Ua=Ha(!0),Wa=Ha(!1),Ga=!1;function Ka(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function qa(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 Ja(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ya(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,V&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=di(e),ui(e,null,n),t}return si(e,r,t,n),di(e)}function Xa(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ut(e,n)}}function Za(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Qa=!1;function $a(){if(Qa){var e=va;if(e!==null)throw e}}function eo(e,t,n,r){Qa=!1;var i=e.updateQueue;Ga=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(U&f)===f:(r&f)===f){f!==0&&f===_a&&(Qa=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(m=g.payload,typeof m==`function`){d=m.call(_,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=g.payload,f=typeof m==`function`?m.call(_,d,f):m,f==null)break a;d=h({},d,f);break a;case 2:Ga=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),$l|=o,e.lanes=o,e.memoizedState=d}}function to(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function no(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)to(n[e],t)}var F=pe(null),ro=pe(0);function io(e,t){e=Zl,he(ro,e),he(F,t),Zl=e|t.baseLanes}function ao(){he(ro,Zl),he(F,F.current)}function oo(){Zl=ro.current,me(F),me(ro)}var I=pe(null),so=null;function co(e){var t=e.alternate;he(mo,mo.current&1),he(I,e),so===null&&(t===null||F.current!==null||t.memoizedState!==null)&&(so=e)}function lo(e){he(mo,mo.current),he(I,e),so===null&&(so=e)}function uo(e){e.tag===22?(he(mo,mo.current),he(I,e),so===null&&(so=e)):fo(e)}function fo(){he(mo,mo.current),he(I,I.current)}function po(e){me(I),so===e&&(so=null),me(mo)}var mo=pe(0);function ho(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||ff(n)||pf(n)))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)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 go=0,L=null,_o=null,vo=null,yo=!1,bo=!1,xo=!1,So=0,Co=0,wo=null,To=0;function Eo(){throw Error(i(321))}function Do(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Or(e[n],t[n]))return!1;return!0}function Oo(e,t,n,r,i,a){return go=a,L=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,E.H=e===null||e.memoizedState===null?Gs:Ks,xo=!1,a=n(r,i),xo=!1,bo&&(a=Ao(t,n,r,i)),ko(e),a}function ko(e){E.H=Ws;var t=_o!==null&&_o.next!==null;if(go=0,vo=_o=L=null,yo=!1,Co=0,wo=null,t)throw Error(i(300));e===null||lc||(e=e.dependencies,e!==null&&aa(e)&&(lc=!0))}function Ao(e,t,n,r){L=e;var a=0;do{if(bo&&(wo=null),Co=0,bo=!1,25<=a)throw Error(i(301));if(a+=1,vo=_o=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}E.H=qs,o=t(n,r)}while(bo);return o}function jo(){var e=E.H,t=e.useState()[0];return t=typeof t.then==`function`?Ro(t):t,e=e.useState()[0],(_o===null?null:_o.memoizedState)!==e&&(L.flags|=1024),t}function Mo(){var e=So!==0;return So=0,e}function No(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Po(e){if(yo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}yo=!1}go=0,vo=_o=L=null,bo=!1,Co=So=0,wo=null}function Fo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return vo===null?L.memoizedState=vo=e:vo=vo.next=e,vo}function Io(){if(_o===null){var e=L.alternate;e=e===null?null:e.memoizedState}else e=_o.next;var t=vo===null?L.memoizedState:vo.next;if(t!==null)vo=t,_o=e;else{if(e===null)throw L.alternate===null?Error(i(467)):Error(i(310));_o=e,e={memoizedState:_o.memoizedState,baseState:_o.baseState,baseQueue:_o.baseQueue,queue:_o.queue,next:null},vo===null?L.memoizedState=vo=e:vo=vo.next=e}return vo}function Lo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ro(e){var t=Co;return Co+=1,wo===null&&(wo=[]),e=Ma(wo,e,t),t=L,(vo===null?t.memoizedState:vo.next)===null&&(t=t.alternate,E.H=t===null||t.memoizedState===null?Gs:Ks),e}function zo(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Ro(e);if(e.$$typeof===C)return P(e)}throw Error(i(438,String(e)))}function Bo(e){var t=null,n=L.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=L.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=Lo(),L.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=ie;return t.index++,n}function Vo(e,t){return typeof t==`function`?t(e):t}function Ho(e){return Uo(Io(),_o,e)}function Uo(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(go&f)===f:(U&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===_a&&(d=!0);else if((go&p)===p){u=u.next,p===_a&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,L.lanes|=p,$l|=p;f=u.action,xo&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,L.lanes|=f,$l|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Or(o,e.memoizedState)&&(lc=!0,d&&(n=va,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Wo(e){var t=Io(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);Or(o,t.memoizedState)||(lc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Go(e,t,n){var r=L,a=Io(),o=N;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Or((_o||a).memoizedState,n);if(s&&(a.memoizedState=n,lc=!0),a=a.queue,gs(Jo.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||vo!==null&&vo.memoizedState.tag&1){if(r.flags|=2048,fs(9,{destroy:void 0},qo.bind(null,r,a,n,t),null),Gl===null)throw Error(i(349));o||go&127||Ko(r,t,n)}return n}function Ko(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=L.updateQueue,t===null?(t=Lo(),L.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function qo(e,t,n,r){t.value=n,t.getSnapshot=r,Yo(t)&&Xo(e)}function Jo(e,t,n){return n(function(){Yo(t)&&Xo(e)})}function Yo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Or(e,n)}catch{return!0}}function Xo(e){var t=li(e,2);t!==null&&Cu(t,e,2)}function Zo(e){var t=Fo();if(typeof e==`function`){var n=e;if(e=n(),xo){qe(!0);try{n()}finally{qe(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vo,lastRenderedState:e},t}function Qo(e,t,n,r){return e.baseState=n,Uo(e,_o,typeof r==`function`?r:Vo)}function $o(e,t,n,r,a){if(Vs(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};E.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,es(t,o)):(o.next=n.next,t.pending=n.next=o)}}function es(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=E.T,o={};E.T=o;try{var s=n(i,r),c=E.S;c!==null&&c(o,s),ts(e,t,s)}catch(n){rs(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),E.T=a}}else try{a=n(i,r),ts(e,t,a)}catch(n){rs(e,t,n)}}function ts(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){ns(e,t,n)},function(n){return rs(e,t,n)}):ns(e,t,n)}function ns(e,t,n){t.status=`fulfilled`,t.value=n,is(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,es(e,n)))}function rs(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,is(t),t=t.next;while(t!==r)}e.action=null}function is(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function as(e,t){return t}function ss(e,t){if(N){var n=Gl.formState;if(n!==null){a:{var r=L;if(N){if(Bi){b:{for(var i=Bi,a=Hi;i.nodeType!==8;){if(!a){i=null;break b}if(i=hf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Bi=hf(i.nextSibling),r=i.data===`F!`;break a}}Wi(r)}r=!1}r&&(t=n[0])}}return n=Fo(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:as,lastRenderedState:t},n.queue=r,n=Rs.bind(null,L,r),r.dispatch=n,r=Zo(!1),a=Bs.bind(null,L,!1,r.queue),r=Fo(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=$o.bind(null,L,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function cs(e){return ls(Io(),_o,e)}function ls(e,t,n){if(t=Uo(e,t,as)[0],e=Ho(Vo)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=Ro(t)}catch(e){throw e===Da?ka:e}else r=t;t=Io();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(L.flags|=2048,fs(9,{destroy:void 0},us.bind(null,i,n),null)),[r,a,e]}function us(e,t){e.action=t}function ds(e){var t=Io(),n=_o;if(n!==null)return ls(t,n,e);Io(),t=t.memoizedState,n=Io();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function fs(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=L.updateQueue,t===null&&(t=Lo(),L.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function R(){return Io().memoizedState}function ps(e,t,n,r){var i=Fo();L.flags|=e,i.memoizedState=fs(1|t,{destroy:void 0},n,r===void 0?null:r)}function ms(e,t,n,r){var i=Io();r=r===void 0?null:r;var a=i.memoizedState.inst;_o!==null&&r!==null&&Do(r,_o.memoizedState.deps)?i.memoizedState=fs(t,a,n,r):(L.flags|=e,i.memoizedState=fs(1|t,a,n,r))}function hs(e,t){ps(8390656,8,e,t)}function gs(e,t){ms(2048,8,e,t)}function _s(e){L.flags|=4;var t=L.updateQueue;if(t===null)t=Lo(),L.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function vs(e){var t=Io().memoizedState;return _s({ref:t,nextImpl:e}),function(){if(V&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function ys(e,t){return ms(4,2,e,t)}function bs(e,t){return ms(4,4,e,t)}function xs(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Ss(e,t,n){n=n==null?null:n.concat([e]),ms(4,4,xs.bind(null,t,e),n)}function Cs(){}function ws(e,t){var n=Io();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Do(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Ts(e,t){var n=Io();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Do(t,r[1]))return r[0];if(r=e(),xo){qe(!0);try{e()}finally{qe(!1)}}return n.memoizedState=[r,t],r}function Es(e,t,n){return n===void 0||go&1073741824&&!(U&261930)?e.memoizedState=t:(e.memoizedState=n,e=Su(),L.lanes|=e,$l|=e,n)}function Ds(e,t,n,r){return Or(n,t)?n:F.current===null?!(go&42)||go&1073741824&&!(U&261930)?(lc=!0,e.memoizedState=n):(e=Su(),L.lanes|=e,$l|=e,t):(e=Es(e,n,r),Or(e,t)||(lc=!0),e)}function Os(e,t,n,r,i){var a=D.p;D.p=a!==0&&8>a?a:8;var o=E.T,s={};E.T=s,Bs(e,!1,t,n);try{var c=i(),l=E.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?zs(e,t,xa(c,r),xu(e)):zs(e,t,r,xu(e))}catch(n){zs(e,t,{then:function(){},status:`rejected`,reason:n},xu())}finally{D.p=a,o!==null&&s.types!==null&&(o.types=s.types),E.T=o}}function ks(){}function As(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=js(e).queue;Os(e,a,t,ue,n===null?ks:function(){return Ms(e),n(r)})}function js(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ue,baseState:ue,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vo,lastRenderedState:ue},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ms(e){var t=js(e);t.next===null&&(t=e.alternate.memoizedState),zs(e,t.next.queue,{},xu())}function Ns(){return P(ap)}function Ps(){return Io().memoizedState}function Fs(){return Io().memoizedState}function Is(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=xu();e=Ja(n);var r=Ya(t,e,n);r!==null&&(Cu(r,t,n),Xa(r,t,n)),t={cache:pa()},e.payload=t;return}t=t.return}}function Ls(e,t,n){var r=xu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Vs(e)?Hs(t,n):(n=ci(e,t,n,r),n!==null&&(Cu(n,e,r),Us(n,t,r)))}function Rs(e,t,n){zs(e,t,n,xu())}function zs(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Vs(e))Hs(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Or(s,o))return si(e,t,i,0),Gl===null&&oi(),!1}catch{}if(n=ci(e,t,i,r),n!==null)return Cu(n,e,r),Us(n,t,r),!0}return!1}function Bs(e,t,n,r){if(r={lane:2,revertLane:K(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Vs(e)){if(t)throw Error(i(479))}else t=ci(e,n,r,2),t!==null&&Cu(t,e,2)}function Vs(e){var t=e.alternate;return e===L||t!==null&&t===L}function Hs(e,t){bo=yo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Us(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ut(e,n)}}var Ws={readContext:P,use:zo,useCallback:Eo,useContext:Eo,useEffect:Eo,useImperativeHandle:Eo,useLayoutEffect:Eo,useInsertionEffect:Eo,useMemo:Eo,useReducer:Eo,useRef:Eo,useState:Eo,useDebugValue:Eo,useDeferredValue:Eo,useTransition:Eo,useSyncExternalStore:Eo,useId:Eo,useHostTransitionStatus:Eo,useFormState:Eo,useActionState:Eo,useOptimistic:Eo,useMemoCache:Eo,useCacheRefresh:Eo};Ws.useEffectEvent=Eo;var Gs={readContext:P,use:zo,useCallback:function(e,t){return Fo().memoizedState=[e,t===void 0?null:t],e},useContext:P,useEffect:hs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),ps(4194308,4,xs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ps(4194308,4,e,t)},useInsertionEffect:function(e,t){ps(4,2,e,t)},useMemo:function(e,t){var n=Fo();t=t===void 0?null:t;var r=e();if(xo){qe(!0);try{e()}finally{qe(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Fo();if(n!==void 0){var i=n(t);if(xo){qe(!0);try{n(t)}finally{qe(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=Ls.bind(null,L,e),[r.memoizedState,e]},useRef:function(e){var t=Fo();return e={current:e},t.memoizedState=e},useState:function(e){e=Zo(e);var t=e.queue,n=Rs.bind(null,L,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Cs,useDeferredValue:function(e,t){return Es(Fo(),e,t)},useTransition:function(){var e=Zo(!1);return e=Os.bind(null,L,e.queue,!0,!1),Fo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=L,a=Fo();if(N){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Gl===null)throw Error(i(349));U&127||Ko(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,hs(Jo.bind(null,r,o,e),[e]),r.flags|=2048,fs(9,{destroy:void 0},qo.bind(null,r,o,n,t),null),n},useId:function(){var e=Fo(),t=Gl.identifierPrefix;if(N){var n=Ni,r=Mi;n=(r&~(1<<32-Je(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=So++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=To++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Ns,useFormState:ss,useActionState:ss,useOptimistic:function(e){var t=Fo();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Bs.bind(null,L,!0,n),n.dispatch=t,[e,t]},useMemoCache:Bo,useCacheRefresh:function(){return Fo().memoizedState=Is.bind(null,L)},useEffectEvent:function(e){var t=Fo(),n={impl:e};return t.memoizedState=n,function(){if(V&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Ks={readContext:P,use:zo,useCallback:ws,useContext:P,useEffect:gs,useImperativeHandle:Ss,useInsertionEffect:ys,useLayoutEffect:bs,useMemo:Ts,useReducer:Ho,useRef:R,useState:function(){return Ho(Vo)},useDebugValue:Cs,useDeferredValue:function(e,t){return Ds(Io(),_o.memoizedState,e,t)},useTransition:function(){var e=Ho(Vo)[0],t=Io().memoizedState;return[typeof e==`boolean`?e:Ro(e),t]},useSyncExternalStore:Go,useId:Ps,useHostTransitionStatus:Ns,useFormState:cs,useActionState:cs,useOptimistic:function(e,t){return Qo(Io(),_o,e,t)},useMemoCache:Bo,useCacheRefresh:Fs};Ks.useEffectEvent=vs;var qs={readContext:P,use:zo,useCallback:ws,useContext:P,useEffect:gs,useImperativeHandle:Ss,useInsertionEffect:ys,useLayoutEffect:bs,useMemo:Ts,useReducer:Wo,useRef:R,useState:function(){return Wo(Vo)},useDebugValue:Cs,useDeferredValue:function(e,t){var n=Io();return _o===null?Es(n,e,t):Ds(n,_o.memoizedState,e,t)},useTransition:function(){var e=Wo(Vo)[0],t=Io().memoizedState;return[typeof e==`boolean`?e:Ro(e),t]},useSyncExternalStore:Go,useId:Ps,useHostTransitionStatus:Ns,useFormState:ds,useActionState:ds,useOptimistic:function(e,t){var n=Io();return _o===null?(n.baseState=e,[e,n.queue.dispatch]):Qo(n,_o,e,t)},useMemoCache:Bo,useCacheRefresh:Fs};qs.useEffectEvent=vs;function Js(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:h({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Ys={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=xu(),i=Ja(r);i.payload=t,n!=null&&(i.callback=n),t=Ya(e,i,r),t!==null&&(Cu(t,e,r),Xa(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=xu(),i=Ja(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Ya(e,i,r),t!==null&&(Cu(t,e,r),Xa(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=xu(),r=Ja(n);r.tag=2,t!=null&&(r.callback=t),t=Ya(e,r,n),t!==null&&(Cu(t,e,n),Xa(t,e,n))}};function Xs(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!kr(n,r)||!kr(i,a):!0}function Zs(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Ys.enqueueReplaceState(t,t.state,null)}function Qs(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=h({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function $s(e){ni(e)}function ec(e){console.error(e)}function tc(e){ni(e)}function nc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function rc(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function ic(e,t,n){return n=Ja(n),n.tag=3,n.payload={element:null},n.callback=function(){nc(e,t)},n}function ac(e){return e=Ja(e),e.tag=3,e}function oc(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){rc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){rc(t,n,r),typeof i!=`function`&&(du===null?du=new Set([this]):du.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function sc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&ia(t,n,a,!0),n=I.current,n!==null){switch(n.tag){case 31:case 13:return so===null?Fu():n.alternate===null&&Ql===0&&(Ql=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Aa?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),$u(e,r,a)),!1;case 22:return n.flags|=65536,r===Aa?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),$u(e,r,a)),!1}throw Error(i(435,n.tag))}return $u(e,r,a),Fu(),!1}if(N)return t=I.current,t===null?(r!==Ui&&(t=Error(i(423),{cause:r}),Xi(wi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=wi(r,n),a=ic(e.stateNode,r,a),Za(e,a),Ql!==4&&(Ql=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Ui&&(e=Error(i(422),{cause:r}),Xi(wi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=wi(o,n),iu===null?iu=[o]:iu.push(o),Ql!==4&&(Ql=2),t===null)return!0;r=wi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=ic(n.stateNode,r,e),Za(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(du===null||!du.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=ac(a),oc(a,e,n,r),Za(n,a),!1}n=n.return}while(n!==null);return!1}var cc=Error(i(461)),lc=!1;function uc(e,t,n,r){t.child=e===null?Wa(t,null,n,r):Ua(t,e.child,n,r)}function dc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return oa(t),r=Oo(e,t,n,o,a,i),s=Mo(),e!==null&&!lc?(No(e,t,i),z(e,t,i)):(N&&s&&Ii(t),t.flags|=1,uc(e,t,r,i),t.child)}function fc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!hi(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,pc(e,t,a,r,i)):(e=vi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Fc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?kr:n,n(o,r)&&e.ref===t.ref)return z(e,t,i)}return t.flags|=1,e=gi(a,r),e.ref=t.ref,e.return=t,t.child=e}function pc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(kr(a,r)&&e.ref===t.ref)if(lc=!1,t.pendingProps=r=a,Fc(e,i))e.flags&131072&&(lc=!0);else return t.lanes=e.lanes,z(e,t,i)}return xc(e,t,n,r,i)}function mc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return gc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ta(t,a===null?null:a.cachePool),a===null?ao():io(t,a),uo(t);else return r=t.lanes=536870912,gc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Ta(t,null),ao(),fo(t)):(Ta(t,a.cachePool),io(t,a),fo(t),t.memoizedState=null);return uc(e,t,i,n),t.child}function hc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function gc(e,t,n,r,i){var a=wa();return a=a===null?null:{parent:fa._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Ta(t,null),ao(),uo(t),e!==null&&ia(e,t,r,!0),t.childLanes=i,null}function _c(e,t){return t=Ac({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function vc(e,t,n){return Ua(t,e.child,null,n),e=_c(t,t.pendingProps),e.flags|=2,po(t),t.memoizedState=null,e}function yc(e,t,n){var r=t.pendingProps,a=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(N){if(r.mode===`hidden`)return e=_c(t,r),t.lanes=536870912,hc(null,e);if(lo(t),(e=Bi)?(e=df(e,Hi),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ji===null?null:{id:Mi,overflow:Ni},retryLane:536870912,hydrationErrors:null},n=xi(e),n.return=t,t.child=n,zi=t,Bi=null)):e=null,e===null)throw Wi(t);return t.lanes=536870912,null}return _c(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(lo(t),a)if(t.flags&256)t.flags&=-257,t=vc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(lc||ia(e,t,n,!1),a=(n&e.childLanes)!==0,lc||a){if(r=Gl,r!==null&&(s=dt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,li(e,s),Cu(r,e,s),cc;Fu(),t=vc(e,t,n)}else e=o.treeContext,Bi=hf(s.nextSibling),zi=t,N=!0,Vi=null,Hi=!1,e!==null&&Ri(t,e),t=_c(t,r),t.flags|=4096;return t}return e=gi(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function bc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function xc(e,t,n,r,i){return oa(t),n=Oo(e,t,n,r,void 0,i),r=Mo(),e!==null&&!lc?(No(e,t,i),z(e,t,i)):(N&&r&&Ii(t),t.flags|=1,uc(e,t,n,i),t.child)}function Sc(e,t,n,r,i,a){return oa(t),t.updateQueue=null,n=Ao(t,r,n,i),ko(e),r=Mo(),e!==null&&!lc?(No(e,t,a),z(e,t,a)):(N&&r&&Ii(t),t.flags|=1,uc(e,t,n,a),t.child)}function Cc(e,t,n,r,i){if(oa(t),t.stateNode===null){var a=fi,o=n.contextType;typeof o==`object`&&o&&(a=P(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Ys,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Ka(t),o=n.contextType,a.context=typeof o==`object`&&o?P(o):fi,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Js(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&Ys.enqueueReplaceState(a,a.state,null),eo(t,r,a,i),$a(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Qs(n,s);a.props=c;var l=a.context,u=n.contextType;o=fi,typeof u==`object`&&u&&(o=P(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Zs(t,a,r,o),Ga=!1;var f=t.memoizedState;a.state=f,eo(t,r,a,i),$a(),l=t.memoizedState,s||f!==l||Ga?(typeof d==`function`&&(Js(t,n,d,r),l=t.memoizedState),(c=Ga||Xs(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,qa(e,t),o=t.memoizedProps,u=Qs(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=fi,typeof l==`object`&&l&&(c=P(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Zs(t,a,r,c),Ga=!1,f=t.memoizedState,a.state=f,eo(t,r,a,i),$a();var p=t.memoizedState;o!==d||f!==p||Ga||e!==null&&e.dependencies!==null&&aa(e.dependencies)?(typeof s==`function`&&(Js(t,n,s,r),p=t.memoizedState),(u=Ga||Xs(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&aa(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,bc(e,t),r=(t.flags&128)!=0,a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Ua(t,e.child,null,i),t.child=Ua(t,null,n,i)):uc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=z(e,t,i),e}function wc(e,t,n,r){return Ji(),t.flags|=256,uc(e,t,n,r),t.child}var Tc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ec(e){return{baseLanes:e,cachePool:Ea()}}function Dc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=nu),e}function Oc(e,t,n){var r=t.pendingProps,a=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(mo.current&2)!=0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(N){if(a?co(t):fo(t),(e=Bi)?(e=df(e,Hi),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ji===null?null:{id:Mi,overflow:Ni},retryLane:536870912,hydrationErrors:null},n=xi(e),n.return=t,t.child=n,zi=t,Bi=null)):e=null,e===null)throw Wi(t);return pf(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(fo(t),a=t.mode,c=Ac({mode:`hidden`,children:c},a),r=yi(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=Ec(n),r.childLanes=Dc(e,s,n),t.memoizedState=Tc,hc(null,r)):(co(t),kc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(co(t),t.flags&=-257,t=jc(e,t,n)):t.memoizedState===null?(fo(t),c=r.fallback,a=t.mode,r=Ac({mode:`visible`,children:r.children},a),c=yi(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Ua(t,e.child,null,n),r=t.child,r.memoizedState=Ec(n),r.childLanes=Dc(e,s,n),t.memoizedState=Tc,t=hc(null,r)):(fo(t),t.child=e.child,t.flags|=128,t=null);else if(co(t),pf(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,Xi({value:r,source:null,stack:null}),t=jc(e,t,n)}else if(lc||ia(e,t,n,!1),s=(n&e.childLanes)!==0,lc||s){if(s=Gl,s!==null&&(r=dt(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,li(e,r),Cu(s,e,r),cc;ff(c)||Fu(),t=jc(e,t,n)}else ff(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Bi=hf(c.nextSibling),zi=t,N=!0,Vi=null,Hi=!1,e!==null&&Ri(t,e),t=kc(t,r.children),t.flags|=4096);return t}return a?(fo(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=gi(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=yi(c,a,n,null),c.flags|=2):c=gi(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,hc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=Ec(n):(a=c.cachePool,a===null?a=Ea():(l=fa._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=Dc(e,s,n),t.memoizedState=Tc,hc(e.child,r)):(co(t),n=e.child,e=n.sibling,n=gi(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function kc(e,t){return t=Ac({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Ac(e,t){return e=mi(22,e,null,t),e.lanes=0,e}function jc(e,t,n){return Ua(t,e.child,null,n),e=kc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Mc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),na(e.return,t,n)}function Nc(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function Pc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=mo.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,he(mo,o),uc(e,t,r,n),r=N?Oi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Mc(e,n,t);else if(e.tag===19)Mc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&ho(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Nc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&ho(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Nc(t,!0,n,null,a,r);break;case`together`:Nc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function z(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),$l|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(ia(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=gi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=gi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Fc(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&aa(e))):!0}function Ic(e,t,n){switch(t.tag){case 3:be(t,t.stateNode.containerInfo),ea(t,fa,e.memoizedState.cache),Ji();break;case 27:case 5:Se(t);break;case 4:be(t,t.stateNode.containerInfo);break;case 10:ea(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,lo(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(co(t),e=z(e,t,n),e===null?null:e.sibling):Oc(e,t,n):(co(t),t.flags|=128,null);co(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(ia(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Pc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),he(mo,mo.current),r)break;return null;case 22:return t.lanes=0,mc(e,t,n,t.pendingProps);case 24:ea(t,fa,e.memoizedState.cache)}return z(e,t,n)}function Lc(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)lc=!0;else{if(!Fc(e,n)&&!(t.flags&128))return lc=!1,Ic(e,t,n);lc=!!(e.flags&131072)}else lc=!1,N&&t.flags&1048576&&Fi(t,Oi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Na(t.elementType),t.type=e,typeof e==`function`)hi(e)?(r=Qs(e,r),t.tag=1,t=Cc(null,t,e,r,n)):(t.tag=0,t=xc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===w){t.tag=11,t=dc(null,t,e,r,n);break a}else if(a===ne){t.tag=14,t=fc(null,t,e,r,n);break a}}throw t=ce(e)||e,Error(i(306,t,``))}}return t;case 0:return xc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Qs(r,t.pendingProps),Cc(e,t,r,a,n);case 3:a:{if(be(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,qa(e,t),eo(t,r,null,n);var s=t.memoizedState;if(r=s.cache,ea(t,fa,r),r!==o.cache&&ra(t,[fa],n,!0),$a(),r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=wc(e,t,r,n);break a}else if(r!==a){a=wi(Error(i(424)),t),Xi(a),t=wc(e,t,r,n);break a}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(Bi=hf(e.firstChild),zi=t,N=!0,Vi=null,Hi=!0,n=Wa(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Ji(),r===a){t=z(e,t,n);break a}uc(e,t,r,n)}t=t.child}return t;case 26:return bc(e,t),e===null?(n=If(t.type,null,t.pendingProps,null))?t.memoizedState=n:N||(n=t.type,e=t.pendingProps,r=qd(ve.current).createElement(n),r[O]=t,r[_t]=e,Vd(r,n,e),kt(r),t.stateNode=r):t.memoizedState=If(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Se(t),e===null&&N&&(r=t.stateNode=yf(t.type,t.pendingProps,ve.current),zi=t,Hi=!0,a=Bi,af(t.type)?(gf=a,Bi=hf(r.firstChild)):Bi=a),uc(e,t,t.pendingProps.children,n),bc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&N&&((a=r=Bi)&&(r=lf(r,t.type,t.pendingProps,Hi),r===null?a=!1:(t.stateNode=r,zi=t,Bi=hf(r.firstChild),Hi=!1,a=!0)),a||Wi(t)),Se(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Xd(a,o)?r=null:s!==null&&Xd(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=Oo(e,t,jo,null,null,n),ap._currentValue=a),bc(e,t),uc(e,t,r,n),t.child;case 6:return e===null&&N&&((e=n=Bi)&&(n=uf(n,t.pendingProps,Hi),n===null?e=!1:(t.stateNode=n,zi=t,Bi=null,e=!0)),e||Wi(t)),null;case 13:return Oc(e,t,n);case 4:return be(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ua(t,null,r,n):uc(e,t,r,n),t.child;case 11:return dc(e,t,t.type,t.pendingProps,n);case 7:return uc(e,t,t.pendingProps,n),t.child;case 8:return uc(e,t,t.pendingProps.children,n),t.child;case 12:return uc(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,ea(t,t.type,r.value),uc(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,oa(t),a=P(a),r=r(a),t.flags|=1,uc(e,t,r,n),t.child;case 14:return fc(e,t,t.type,t.pendingProps,n);case 15:return pc(e,t,t.type,t.pendingProps,n);case 19:return Pc(e,t,n);case 31:return yc(e,t,n);case 22:return mc(e,t,n,t.pendingProps);case 24:return oa(t),r=P(fa),e===null?(a=wa(),a===null&&(a=Gl,o=pa(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Ka(t),ea(t,fa,a)):((e.lanes&n)!==0&&(qa(e,t),eo(t,null,null,n),$a()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,ea(t,fa,r),r!==a.cache&&ra(t,[fa],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),ea(t,fa,r))),uc(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Rc(e){e.flags|=4}function zc(e,t,n,r,i){if((t=(e.mode&32)!=0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(Mu())e.flags|=8192;else throw Pa=Aa,Oa}else e.flags&=-16777217}function Bc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Zf(t))if(Mu())e.flags|=8192;else throw Pa=Aa,Oa}function Vc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:at(),e.lanes|=t,ru|=t)}function Hc(e,t){if(!N)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Uc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Wc(e,t,n){var r=t.pendingProps;switch(Li(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Uc(t),null;case 1:return Uc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),ta(fa),xe(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(qi(t)?Rc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Yi())),Uc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(Rc(t),o===null?(Uc(t),zc(t,a,null,r,n)):(Uc(t),Bc(t,o))):o?o===e.memoizedState?(Uc(t),t.flags&=-16777217):(Rc(t),Uc(t),Bc(t,o)):(e=e.memoizedProps,e!==r&&Rc(t),Uc(t),zc(t,a,e,r,n)),null;case 27:if(Ce(t),n=ve.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Rc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Uc(t),null}e=ge.current,qi(t)?Gi(t,e):(e=yf(a,r,n),t.stateNode=e,Rc(t))}return Uc(t),null;case 5:if(Ce(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Rc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Uc(t),null}if(o=ge.current,qi(t))Gi(t,o);else{var s=qd(ve.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[O]=t,o[_t]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Vd(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Rc(t)}}return Uc(t),zc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Rc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=ve.current,qi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=zi,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[O]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Rd(e.nodeValue,n)),e||Wi(t,!0)}else e=qd(e).createTextNode(r),e[O]=t,t.stateNode=e}return Uc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=qi(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[O]=t}else Ji(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Uc(t),e=!1}else n=Yi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(po(t),t):(po(t),null);if(t.flags&128)throw Error(i(558))}return Uc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=qi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[O]=t}else Ji(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Uc(t),a=!1}else a=Yi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(po(t),t):(po(t),null)}return po(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Vc(t,t.updateQueue),Uc(t),null);case 4:return xe(),e===null&&Od(t.stateNode.containerInfo),Uc(t),null;case 10:return ta(t.type),Uc(t),null;case 19:if(me(mo),r=t.memoizedState,r===null)return Uc(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)Hc(r,!1);else{if(Ql!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=ho(e),o!==null){for(t.flags|=128,Hc(r,!1),e=o.updateQueue,t.updateQueue=e,Vc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)_i(n,e),n=n.sibling;return he(mo,mo.current&1|2),N&&Pi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ie()>lu&&(t.flags|=128,a=!0,Hc(r,!1),t.lanes=4194304)}else{if(!a)if(e=ho(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Vc(t,e),Hc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!N)return Uc(t),null}else 2*Ie()-r.renderingStartTime>lu&&n!==536870912&&(t.flags|=128,a=!0,Hc(r,!1),t.lanes=4194304);r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Uc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Ie(),e.sibling=null,n=mo.current,he(mo,a?n&1|2:n&1),N&&Pi(t,r.treeForkCount),e);case 22:case 23:return po(t),oo(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Uc(t),t.subtreeFlags&6&&(t.flags|=8192)):Uc(t),n=t.updateQueue,n!==null&&Vc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&me(Ca),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ta(fa),Uc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Gc(e,t){switch(Li(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ta(fa),xe(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Ce(t),null;case 31:if(t.memoizedState!==null){if(po(t),t.alternate===null)throw Error(i(340));Ji()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(po(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Ji()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return me(mo),null;case 4:return xe(),null;case 10:return ta(t.type),null;case 22:case 23:return po(t),oo(),e!==null&&me(Ca),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ta(fa),null;case 25:return null;default:return null}}function Kc(e,t){switch(Li(t),t.tag){case 3:ta(fa),xe();break;case 26:case 27:case 5:Ce(t);break;case 4:xe();break;case 31:t.memoizedState!==null&&po(t);break;case 13:po(t);break;case 19:me(mo);break;case 10:ta(t.type);break;case 22:case 23:po(t),oo(),e!==null&&me(Ca);break;case 24:ta(fa)}}function qc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){W(t,t.return,e)}}function Jc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){W(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){W(t,t.return,e)}}function Yc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{no(t,n)}catch(t){W(e,e.return,t)}}}function Xc(e,t,n){n.props=Qs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){W(e,t,n)}}function Zc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){W(e,t,n)}}function Qc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){W(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){W(e,t,n)}else n.current=null}function $c(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){W(e,e.return,t)}}function el(e,t,n){try{var r=e.stateNode;Hd(r,e.type,n,t),r[_t]=t}catch(t){W(e,e.return,t)}}function tl(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&af(e.type)||e.tag===4}function nl(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||tl(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&&af(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function rl(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=ln));else if(r!==4&&(r===27&&af(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(rl(e,t,n),e=e.sibling;e!==null;)rl(e,t,n),e=e.sibling}function il(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&af(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(il(e,t,n),e=e.sibling;e!==null;)il(e,t,n),e=e.sibling}function al(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Vd(t,r,n),t[O]=e,t[_t]=n}catch(t){W(e,e.return,t)}}var ol=!1,sl=!1,cl=!1,ll=typeof WeakSet==`function`?WeakSet:Set,ul=null;function dl(e,t){if(e=e.containerInfo,Gd=mp,e=Nr(e),Pr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(Kd={focusedElem:e,selectionRange:n},mp=!1,ul=t;ul!==null;)if(t=ul,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,ul=e;else for(;ul!==null;){switch(t=ul,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=Qs(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){W(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)cf(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:cf(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,ul=e;break}ul=t.return}}function fl(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:El(e,n),r&4&&qc(5,n);break;case 1:if(El(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){W(n,n.return,e)}else{var i=Qs(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){W(n,n.return,e)}}r&64&&Yc(n),r&512&&Zc(n,n.return);break;case 3:if(El(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{no(e,t)}catch(e){W(n,n.return,e)}}break;case 27:t===null&&r&4&&al(n);case 26:case 5:El(e,n),t===null&&r&4&&$c(n),r&512&&Zc(n,n.return);break;case 12:El(e,n);break;case 31:El(e,n),r&4&&_l(e,n);break;case 13:El(e,n),r&4&&vl(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=nd.bind(null,n),mf(e,n))));break;case 22:if(r=n.memoizedState!==null||ol,!r){t=t!==null&&t.memoizedState!==null||sl,i=ol;var a=sl;ol=r,(sl=t)&&!a?Ol(e,n,(n.subtreeFlags&8772)!=0):El(e,n),ol=i,sl=a}break;case 30:break;default:El(e,n)}}function pl(e){var t=e.alternate;t!==null&&(e.alternate=null,pl(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&wt(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 B=null,ml=!1;function hl(e,t,n){for(n=n.child;n!==null;)gl(e,t,n),n=n.sibling}function gl(e,t,n){if(Ke&&typeof Ke.onCommitFiberUnmount==`function`)try{Ke.onCommitFiberUnmount(Ge,n)}catch{}switch(n.tag){case 26:sl||Qc(n,t),hl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:sl||Qc(n,t);var r=B,i=ml;af(n.type)&&(B=n.stateNode,ml=!1),hl(e,t,n),bf(n.stateNode),B=r,ml=i;break;case 5:sl||Qc(n,t);case 6:if(r=B,i=ml,B=null,hl(e,t,n),B=r,ml=i,B!==null)if(ml)try{(B.nodeType===9?B.body:B.nodeName===`HTML`?B.ownerDocument.body:B).removeChild(n.stateNode)}catch(e){W(n,t,e)}else try{B.removeChild(n.stateNode)}catch(e){W(n,t,e)}break;case 18:B!==null&&(ml?(e=B,of(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Bp(e)):of(B,n.stateNode));break;case 4:r=B,i=ml,B=n.stateNode.containerInfo,ml=!0,hl(e,t,n),B=r,ml=i;break;case 0:case 11:case 14:case 15:Jc(2,n,t),sl||Jc(4,n,t),hl(e,t,n);break;case 1:sl||(Qc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Xc(n,t,r)),hl(e,t,n);break;case 21:hl(e,t,n);break;case 22:sl=(r=sl)||n.memoizedState!==null,hl(e,t,n),sl=r;break;default:hl(e,t,n)}}function _l(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Bp(e)}catch(e){W(t,t.return,e)}}}function vl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Bp(e)}catch(e){W(t,t.return,e)}}function yl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new ll),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new ll),t;default:throw Error(i(435,e.tag))}}function bl(e,t){var n=yl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=rd.bind(null,e,t);t.then(r,r)}})}function xl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(af(c.type)){B=c.stateNode,ml=!1;break a}break;case 5:B=c.stateNode,ml=!1;break a;case 3:case 4:B=c.stateNode.containerInfo,ml=!0;break a}c=c.return}if(B===null)throw Error(i(160));gl(o,s,a),B=null,ml=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Cl(t,e),t=t.sibling}var Sl=null;function Cl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:xl(t,e),wl(e),r&4&&(Jc(3,e,e.return),qc(3,e),Jc(5,e,e.return));break;case 1:xl(t,e),wl(e),r&512&&(sl||n===null||Qc(n,n.return)),r&64&&ol&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=Sl;if(xl(t,e),wl(e),r&512&&(sl||n===null||Qc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[Ct]||o[O]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Vd(o,r,n),o[O]=e,kt(o),r=o;break a;case`link`:var s=Jf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),Vd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=Jf(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),Vd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[O]=e,kt(o),r=o}e.stateNode=r}else Yf(a,e.type,e.stateNode);else e.stateNode=Uf(a,r,e.memoizedProps);else o===r?r===null&&e.stateNode!==null&&el(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Yf(a,e.type,e.stateNode):Uf(a,r,e.memoizedProps))}break;case 27:xl(t,e),wl(e),r&512&&(sl||n===null||Qc(n,n.return)),n!==null&&r&4&&el(e,e.memoizedProps,n.memoizedProps);break;case 5:if(xl(t,e),wl(e),r&512&&(sl||n===null||Qc(n,n.return)),e.flags&32){a=e.stateNode;try{en(a,``)}catch(t){W(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,el(e,a,n===null?a:n.memoizedProps)),r&1024&&(cl=!0);break;case 6:if(xl(t,e),wl(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){W(e,e.return,t)}}break;case 3:if(qf=null,a=Sl,Sl=Cf(t.containerInfo),xl(t,e),Sl=a,wl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Bp(t.containerInfo)}catch(t){W(e,e.return,t)}cl&&(cl=!1,Tl(e));break;case 4:r=Sl,Sl=Cf(e.stateNode.containerInfo),xl(t,e),wl(e),Sl=r;break;case 12:xl(t,e),wl(e);break;case 31:xl(t,e),wl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,bl(e,r)));break;case 13:xl(t,e),wl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(su=Ie()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,bl(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=ol,d=sl;if(ol=u||a,sl=d||l,xl(t,e),sl=d,ol=u,wl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||ol||sl||Dl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){W(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){W(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?sf(m,!0):sf(l.stateNode,!1)}catch(e){W(l,l.return,e)}}}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 a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,bl(e,n))));break;case 19:xl(t,e),wl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,bl(e,r)));break;case 30:break;case 21:break;default:xl(t,e),wl(e)}}function wl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(tl(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;il(e,nl(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(en(o,``),n.flags&=-33),il(e,nl(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;rl(e,nl(e),s);break;default:throw Error(i(161))}}catch(t){W(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Tl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Tl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function El(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)fl(e,t.alternate,t),t=t.sibling}function Dl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Jc(4,t,t.return),Dl(t);break;case 1:Qc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Xc(t,t.return,n),Dl(t);break;case 27:bf(t.stateNode);case 26:case 5:Qc(t,t.return),Dl(t);break;case 22:t.memoizedState===null&&Dl(t);break;case 30:Dl(t);break;default:Dl(t)}e=e.sibling}}function Ol(e,t,n){for(n&&=(t.subtreeFlags&8772)!=0,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:Ol(i,a,n),qc(4,a);break;case 1:if(Ol(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){W(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)to(c[i],s)}catch(e){W(r,r.return,e)}}n&&o&64&&Yc(a),Zc(a,a.return);break;case 27:al(a);case 26:case 5:Ol(i,a,n),n&&r===null&&o&4&&$c(a),Zc(a,a.return);break;case 12:Ol(i,a,n);break;case 31:Ol(i,a,n),n&&o&4&&_l(i,a);break;case 13:Ol(i,a,n),n&&o&4&&vl(i,a);break;case 22:a.memoizedState===null&&Ol(i,a,n),Zc(a,a.return);break;case 30:break;default:Ol(i,a,n)}t=t.sibling}}function kl(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&ma(n))}function Al(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ma(e))}function jl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Ml(e,t,n,r),t=t.sibling}function Ml(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:jl(e,t,n,r),i&2048&&qc(9,t);break;case 1:jl(e,t,n,r);break;case 3:jl(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ma(e)));break;case 12:if(i&2048){jl(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){W(t,t.return,e)}}else jl(e,t,n,r);break;case 31:jl(e,t,n,r);break;case 13:jl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?jl(e,t,n,r):(a._visibility|=2,Nl(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?jl(e,t,n,r):Pl(e,t),i&2048&&kl(o,t);break;case 24:jl(e,t,n,r),i&2048&&Al(t.alternate,t);break;default:jl(e,t,n,r)}}function Nl(e,t,n,r,i){for(i&&=(t.subtreeFlags&10256)!=0||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Nl(a,o,s,c,i),qc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Nl(a,o,s,c,i)):u._visibility&2?Nl(a,o,s,c,i):Pl(a,o),i&&l&2048&&kl(o.alternate,o);break;case 24:Nl(a,o,s,c,i),i&&l&2048&&Al(o.alternate,o);break;default:Nl(a,o,s,c,i)}t=t.sibling}}function Pl(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Pl(n,r),i&2048&&kl(r.alternate,r);break;case 24:Pl(n,r),i&2048&&Al(r.alternate,r);break;default:Pl(n,r)}t=t.sibling}}var Fl=8192;function Il(e,t,n){if(e.subtreeFlags&Fl)for(e=e.child;e!==null;)Ll(e,t,n),e=e.sibling}function Ll(e,t,n){switch(e.tag){case 26:Il(e,t,n),e.flags&Fl&&e.memoizedState!==null&&Qf(n,Sl,e.memoizedState,e.memoizedProps);break;case 5:Il(e,t,n);break;case 3:case 4:var r=Sl;Sl=Cf(e.stateNode.containerInfo),Il(e,t,n),Sl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Fl,Fl=16777216,Il(e,t,n),Fl=r):Il(e,t,n));break;default:Il(e,t,n)}}function Rl(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 zl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];ul=r,Hl(r,e)}Rl(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Bl(e),e=e.sibling}function Bl(e){switch(e.tag){case 0:case 11:case 15:zl(e),e.flags&2048&&Jc(9,e,e.return);break;case 3:zl(e);break;case 12:zl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Vl(e)):zl(e);break;default:zl(e)}}function Vl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];ul=r,Hl(r,e)}Rl(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Jc(8,t,t.return),Vl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Vl(t));break;default:Vl(t)}e=e.sibling}}function Hl(e,t){for(;ul!==null;){var n=ul;switch(n.tag){case 0:case 11:case 15:Jc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:ma(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,ul=r;else a:for(n=e;ul!==null;){r=ul;var i=r.sibling,a=r.return;if(pl(r),r===n){ul=null;break a}if(i!==null){i.return=a,ul=i;break a}ul=a}}}var Ul={getCacheForType:function(e){var t=P(fa),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return P(fa).controller.signal}},Wl=typeof WeakMap==`function`?WeakMap:Map,V=0,Gl=null,H=null,U=0,Kl=0,ql=null,Jl=!1,Yl=!1,Xl=!1,Zl=0,Ql=0,$l=0,eu=0,tu=0,nu=0,ru=0,iu=null,au=null,ou=!1,su=0,cu=0,lu=1/0,uu=null,du=null,fu=0,pu=null,mu=null,hu=0,gu=0,_u=null,vu=null,yu=0,bu=null;function xu(){return V&2&&U!==0?U&-U:E.T===null?mt():K()}function Su(){if(nu===0)if(!(U&536870912)||N){var e=$e;$e<<=1,!($e&3932160)&&($e=262144),nu=e}else nu=536870912;return e=I.current,e!==null&&(e.flags|=32),nu}function Cu(e,t,n){(e===Gl&&(Kl===2||Kl===9)||e.cancelPendingCommit!==null)&&(Au(e,0),Du(e,U,nu,!1)),st(e,n),(!(V&2)||e!==Gl)&&(e===Gl&&(!(V&2)&&(eu|=n),Ql===4&&Du(e,U,nu,!1)),dd(e))}function wu(e,t,n){if(V&6)throw Error(i(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||rt(e,t),a=r?Ru(e,t):Iu(e,t,!0),o=r;do{if(a===0){Yl&&!r&&Du(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!Eu(n)){a=Iu(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=iu;var l=c.current.memoizedState.isDehydrated;if(l&&(Au(c,s).flags|=256),s=Iu(c,s,!1),s!==2){if(Xl&&!l){c.errorRecoveryDisabledLanes|=o,eu|=o,a=4;break a}o=au,au=a,o!==null&&(au===null?au=o:au.push.apply(au,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Au(e,0),Du(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:Du(r,t,nu,!Jl);break a;case 2:au=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=su+300-Ie(),10<a)){if(Du(r,t,nu,!Jl),nt(r,0,!0)!==0)break a;hu=t,r.timeoutHandle=$d(Tu.bind(null,r,n,au,uu,ou,t,nu,eu,ru,Jl,o,`Throttled`,-0,0),a);break a}Tu(r,n,au,uu,ou,t,nu,eu,ru,Jl,o,null,-0,0)}}break}while(1);dd(e)}function Tu(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ln},Ll(t,a,d);var m=(a&62914560)===a?su-Ie():(a&4194048)===a?cu-Ie():0;if(m=ep(d,m),m!==null){hu=a,e.cancelPendingCommit=m(Gu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),Du(e,a,o,!l);return}}Gu(e,t,a,n,r,i,o,s,c)}function Eu(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Or(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;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 Du(e,t,n,r){t&=~tu,t&=~eu,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Je(i),o=1<<a;r[a]=-1,i&=~o}n!==0&<(e,n,t)}function Ou(){return V&6?!0:(fd(0,!1),!1)}function ku(){if(H!==null){if(Kl===0)var e=H.return;else e=H,$i=Qi=null,Po(e),La=null,Ra=0,e=H;for(;e!==null;)Kc(e.alternate,e),e=e.return;H=null}}function Au(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,ef(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),hu=0,ku(),Gl=e,H=n=gi(e.current,null),U=t,Kl=0,ql=null,Jl=!1,Yl=rt(e,t),Xl=!1,ru=nu=tu=eu=$l=Ql=0,au=iu=null,ou=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Je(r),a=1<<i;t|=e[i],r&=~a}return Zl=t,oi(),n}function ju(e,t){L=null,E.H=Ws,t===Da||t===ka?(t=Fa(),Kl=3):t===Oa?(t=Fa(),Kl=4):Kl=t===cc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,ql=t,H===null&&(Ql=1,nc(e,wi(t,e.current)))}function Mu(){var e=I.current;return e===null?!0:(U&4194048)===U?so===null:(U&62914560)===U||U&536870912?e===so:!1}function Nu(){var e=E.H;return E.H=Ws,e===null?Ws:e}function Pu(){var e=E.A;return E.A=Ul,e}function Fu(){Ql=4,Jl||(U&4194048)!==U&&I.current!==null||(Yl=!0),!($l&134217727)&&!(eu&134217727)||Gl===null||Du(Gl,U,nu,!1)}function Iu(e,t,n){var r=V;V|=2;var i=Nu(),a=Pu();(Gl!==e||U!==t)&&(uu=null,Au(e,t)),t=!1;var o=Ql;a:do try{if(Kl!==0&&H!==null){var s=H,c=ql;switch(Kl){case 8:ku(),o=6;break a;case 3:case 2:case 9:case 6:I.current===null&&(t=!0);var l=Kl;if(Kl=0,ql=null,Hu(e,s,c,l),n&&Yl){o=0;break a}break;default:l=Kl,Kl=0,ql=null,Hu(e,s,c,l)}}Lu(),o=Ql;break}catch(t){ju(e,t)}while(1);return t&&e.shellSuspendCounter++,$i=Qi=null,V=r,E.H=i,E.A=a,H===null&&(Gl=null,U=0,oi()),o}function Lu(){for(;H!==null;)Bu(H)}function Ru(e,t){var n=V;V|=2;var r=Nu(),a=Pu();Gl!==e||U!==t?(uu=null,lu=Ie()+500,Au(e,t)):Yl=rt(e,t);a:do try{if(Kl!==0&&H!==null){t=H;var o=ql;b:switch(Kl){case 1:Kl=0,ql=null,Hu(e,t,o,1);break;case 2:case 9:if(ja(o)){Kl=0,ql=null,Vu(t);break}t=function(){Kl!==2&&Kl!==9||Gl!==e||(Kl=7),dd(e)},o.then(t,t);break a;case 3:Kl=7;break a;case 4:Kl=5;break a;case 7:ja(o)?(Kl=0,ql=null,Vu(t)):(Kl=0,ql=null,Hu(e,t,o,7));break;case 5:var s=null;switch(H.tag){case 26:s=H.memoizedState;case 5:case 27:var c=H;if(s?Zf(s):c.stateNode.complete){Kl=0,ql=null;var l=c.sibling;if(l!==null)H=l;else{var u=c.return;u===null?H=null:(H=u,Uu(u))}break b}}Kl=0,ql=null,Hu(e,t,o,5);break;case 6:Kl=0,ql=null,Hu(e,t,o,6);break;case 8:ku(),Ql=6;break a;default:throw Error(i(462))}}zu();break}catch(t){ju(e,t)}while(1);return $i=Qi=null,E.H=r,E.A=a,V=n,H===null?(Gl=null,U=0,oi(),Ql):0}function zu(){for(;H!==null&&!Pe();)Bu(H)}function Bu(e){var t=Lc(e.alternate,e,Zl);e.memoizedProps=e.pendingProps,t===null?Uu(e):H=t}function Vu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Sc(n,t,t.pendingProps,t.type,void 0,U);break;case 11:t=Sc(n,t,t.pendingProps,t.type.render,t.ref,U);break;case 5:Po(t);default:Kc(n,t),t=H=_i(t,Zl),t=Lc(n,t,Zl)}e.memoizedProps=e.pendingProps,t===null?Uu(e):H=t}function Hu(e,t,n,r){$i=Qi=null,Po(t),La=null,Ra=0;var i=t.return;try{if(sc(e,i,t,n,U)){Ql=1,nc(e,wi(n,e.current)),H=null;return}}catch(t){if(i!==null)throw H=i,t;Ql=1,nc(e,wi(n,e.current)),H=null;return}t.flags&32768?(N||r===1?e=!0:Yl||U&536870912?e=!1:(Jl=e=!0,(r===2||r===9||r===3||r===6)&&(r=I.current,r!==null&&r.tag===13&&(r.flags|=16384))),Wu(t,e)):Uu(t)}function Uu(e){var t=e;do{if(t.flags&32768){Wu(t,Jl);return}e=t.return;var n=Wc(t.alternate,t,Zl);if(n!==null){H=n;return}if(t=t.sibling,t!==null){H=t;return}H=t=e}while(t!==null);Ql===0&&(Ql=5)}function Wu(e,t){do{var n=Gc(e.alternate,e);if(n!==null){n.flags&=32767,H=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){H=e;return}H=e=n}while(e!==null);Ql=6,H=null}function Gu(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Xu();while(fu!==0);if(V&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=ai,ct(e,n,o,s,c,l),e===Gl&&(H=Gl=null,U=0),mu=t,pu=e,hu=n,gu=o,_u=a,vu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,id(Be,function(){return Zu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=E.T,E.T=null,a=D.p,D.p=2,s=V,V|=4;try{dl(e,t,n)}finally{V=s,D.p=a,E.T=r}}fu=1,Ku(),qu(),Ju()}}function Ku(){if(fu===1){fu=0;var e=pu,t=mu,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=E.T,E.T=null;var r=D.p;D.p=2;var i=V;V|=4;try{Cl(t,e);var a=Kd,o=Nr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&Mr(s.ownerDocument.documentElement,s)){if(c!==null&&Pr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=jr(s,h),v=jr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}mp=!!Gd,Kd=Gd=null}finally{V=i,D.p=r,E.T=n}}e.current=t,fu=2}}function qu(){if(fu===2){fu=0;var e=pu,t=mu,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=E.T,E.T=null;var r=D.p;D.p=2;var i=V;V|=4;try{fl(e,t.alternate,t)}finally{V=i,D.p=r,E.T=n}}fu=3}}function Ju(){if(fu===4||fu===3){fu=0,Fe();var e=pu,t=mu,n=hu,r=vu;t.subtreeFlags&10256||t.flags&10256?fu=5:(fu=0,mu=pu=null,Yu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(du=null),pt(n),t=t.stateNode,Ke&&typeof Ke.onCommitFiberRoot==`function`)try{Ke.onCommitFiberRoot(Ge,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=E.T,i=D.p,D.p=2,E.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{E.T=t,D.p=i}}hu&3&&Xu(),dd(e),i=e.pendingLanes,n&261930&&i&42?e===bu?yu++:(yu=0,bu=e):yu=0,fd(0,!1)}}function Yu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ma(t)))}function Xu(){return Ku(),qu(),Ju(),Zu()}function Zu(){if(fu!==5)return!1;var e=pu,t=gu;gu=0;var n=pt(hu),r=E.T,a=D.p;try{D.p=32>n?32:n,E.T=null,n=_u,_u=null;var o=pu,s=hu;if(fu=0,mu=pu=null,hu=0,V&6)throw Error(i(331));var c=V;if(V|=4,Bl(o.current),Ml(o,o.current,s,n),V=c,fd(0,!1),Ke&&typeof Ke.onPostCommitFiberRoot==`function`)try{Ke.onPostCommitFiberRoot(Ge,o)}catch{}return!0}finally{D.p=a,E.T=r,Yu(e,t)}}function Qu(e,t,n){t=wi(n,t),t=ic(e.stateNode,t,2),e=Ya(e,t,2),e!==null&&(st(e,2),dd(e))}function W(e,t,n){if(e.tag===3)Qu(e,e,n);else for(;t!==null;){if(t.tag===3){Qu(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(du===null||!du.has(r))){e=wi(n,e),n=ac(2),r=Ya(t,n,2),r!==null&&(oc(n,r,t,e),st(r,2),dd(r));break}}t=t.return}}function $u(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Wl;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Xl=!0,i.add(n),e=ed.bind(null,e,t,n),t.then(e,e))}function ed(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Gl===e&&(U&n)===n&&(Ql===4||Ql===3&&(U&62914560)===U&&300>Ie()-su?!(V&2)&&Au(e,0):tu|=n,ru===U&&(ru=0)),dd(e)}function td(e,t){t===0&&(t=at()),e=li(e,t),e!==null&&(st(e,t),dd(e))}function nd(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),td(e,n)}function rd(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),td(e,n)}function id(e,t){return Me(e,t)}var ad=null,od=null,sd=!1,cd=!1,ld=!1,ud=0;function dd(e){e!==od&&e.next===null&&(od===null?ad=od=e:od=od.next=e),cd=!0,sd||(sd=!0,_d())}function fd(e,t){if(!ld&&cd){ld=!0;do for(var n=!1,r=ad;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Je(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,gd(r,a))}else a=U,a=nt(r,r===Gl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||rt(r,a)||(n=!0,gd(r,a));r=r.next}while(n);ld=!1}}function G(){pd()}function pd(){cd=sd=!1;var e=0;ud!==0&&Qd()&&(e=ud);for(var t=Ie(),n=null,r=ad;r!==null;){var i=r.next,a=md(r,t);a===0?(r.next=null,n===null?ad=i:n.next=i,i===null&&(od=n)):(n=r,(e!==0||a&3)&&(cd=!0)),r=i}fu!==0&&fu!==5||fd(e,!1),ud!==0&&(ud=0)}function md(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Je(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=it(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Gl,n=U,n=nt(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Kl===2||Kl===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Ne(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||rt(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Ne(r),pt(n)){case 2:case 8:n=ze;break;case 32:n=Be;break;case 268435456:n=He;break;default:n=Be}return r=hd.bind(null,e),n=Me(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Ne(r),e.callbackPriority=2,e.callbackNode=null,2}function hd(e,t){if(fu!==0&&fu!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Xu()&&e.callbackNode!==n)return null;var r=U;return r=nt(e,e===Gl?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(wu(e,r,t),md(e,Ie()),e.callbackNode!=null&&e.callbackNode===n?hd.bind(null,e):null)}function gd(e,t){if(Xu())return null;wu(e,t,!0)}function _d(){nf(function(){V&6?Me(Re,G):pd()})}function K(){if(ud===0){var e=_a;e===0&&(e=Qe,Qe<<=1,!(Qe&261888)&&(Qe=256)),ud=e}return ud}function vd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:cn(``+e)}function yd(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function bd(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=vd((i[_t]||null).action),o=r.submitter;o&&(t=(t=o[_t]||null)?vd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new An(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(ud!==0){var e=o?yd(i,o):new FormData(i);As(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?yd(i,o):new FormData(i),As(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var xd=0;xd<ei.length;xd++){var Sd=ei[xd];ti(Sd.toLowerCase(),`on`+(Sd[0].toUpperCase()+Sd.slice(1)))}ti(Kr,`onAnimationEnd`),ti(qr,`onAnimationIteration`),ti(Jr,`onAnimationStart`),ti(`dblclick`,`onDoubleClick`),ti(`focusin`,`onFocus`),ti(`focusout`,`onBlur`),ti(Yr,`onTransitionRun`),ti(Xr,`onTransitionStart`),ti(Zr,`onTransitionCancel`),ti(Qr,`onTransitionEnd`),Nt(`onMouseEnter`,[`mouseout`,`mouseover`]),Nt(`onMouseLeave`,[`mouseout`,`mouseover`]),Nt(`onPointerEnter`,[`pointerout`,`pointerover`]),Nt(`onPointerLeave`,[`pointerout`,`pointerover`]),Mt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Mt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Mt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Mt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Mt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Mt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Cd=`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(` `),wd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Cd));function Td(e,t){t=(t&4)!=0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){ni(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){ni(e)}i.currentTarget=null,a=c}}}}function q(e,t){var n=t[yt];n===void 0&&(n=t[yt]=new Set);var r=e+`__bubble`;n.has(r)||(kd(t,e,2,!1),n.add(r))}function Ed(e,t,n){var r=0;t&&(r|=4),kd(n,e,r,t)}var Dd=`_reactListening`+Math.random().toString(36).slice(2);function Od(e){if(!e[Dd]){e[Dd]=!0,At.forEach(function(t){t!==`selectionchange`&&(wd.has(t)||Ed(t,!1,e),Ed(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Dd]||(t[Dd]=!0,Ed(`selectionchange`,!1,t))}}function kd(e,t,n,r){switch(xp(t)){case 2:var i=hp;break;case 8:i=gp;break;default:i=_p}n=i.bind(null,t,n,e),i=void 0,!yn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Ad(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=Tt(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}gn(function(){var r=a,i=dn(n),s=[];a:{var c=$r.get(e);if(c!==void 0){var l=An,u=e;switch(e){case`keypress`:if(Tn(n)===0)break a;case`keydown`:case`keyup`:l=qn;break;case`focusin`:u=`focus`,l=zn;break;case`focusout`:u=`blur`,l=zn;break;case`beforeblur`:case`afterblur`:l=zn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=Ln;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Rn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Yn;break;case Kr:case qr:case Jr:l=Bn;break;case Qr:l=Xn;break;case`scroll`:case`scrollend`:l=Mn;break;case`wheel`:l=Zn;break;case`copy`:case`cut`:case`paste`:l=A;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Jn;break;case`toggle`:case`beforetoggle`:l=Qn}var d=(t&4)!=0,f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=_n(m,p),g!=null&&d.push(jd(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==un&&(u=n.relatedTarget||n.fromElement)&&(Tt(u)||u[vt]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?Tt(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=Ln,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Jn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:Dt(l),h=u==null?c:Dt(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,Tt(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=Nd,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&Pd(s,c,l,d,!1),u!==null&&f!==null&&Pd(s,f,u,d,!0)}}a:{if(c=r?Dt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=gr;else if(ur(c))if(_r)v=Er;else{v=wr;var y=Cr}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&an(r.elementType)&&(v=gr):v=Tr;if(v&&=v(e,r)){dr(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&Xt(c,`number`,c.value)}switch(y=r?Dt(r):window,e){case`focusin`:(ur(y)||y.contentEditable===`true`)&&(Ir=y,Lr=r,Rr=null);break;case`focusout`:Rr=Lr=Ir=null;break;case`mousedown`:zr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:zr=!1,Br(s,n,i);break;case`selectionchange`:if(Fr)break;case`keydown`:case`keyup`:Br(s,n,i)}var b;if(er)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else sr?j(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(rr&&n.locale!==`ko`&&(sr||x!==`onCompositionStart`?x===`onCompositionEnd`&&sr&&(b=wn()):(xn=i,Sn=`value`in xn?xn.value:xn.textContent,sr=!0)),y=Md(r,x),0<y.length&&(x=new Vn(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=or(n),b!==null&&(x.data=b)))),(b=nr?M(e,n):cr(e,n))&&(x=Md(r,`onBeforeInput`),0<x.length&&(y=new Vn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),bd(s,e,r,n,i)}Td(s,t)})}function jd(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Md(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=_n(e,n),i!=null&&r.unshift(jd(e,i,a)),i=_n(e,t),i!=null&&r.push(jd(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Nd(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Pd(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=_n(n,a),l!=null&&o.unshift(jd(n,l,c))):i||(l=_n(n,a),l!=null&&o.push(jd(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Fd=/\r\n?/g,Id=/\u0000|\uFFFD/g;function Ld(e){return(typeof e==`string`?e:``+e).replace(Fd,` 9`).replace(Id,``)}function Rd(e,t){return t=Ld(t),Ld(e)===t}function zd(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||en(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&en(e,``+r);break;case`className`:zt(e,`class`,r);break;case`tabIndex`:zt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:zt(e,n,r);break;case`style`:rn(e,r,o);break;case`data`:if(t!==`object`){zt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=cn(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}else typeof o==`function`&&(n===`formAction`?(t!==`input`&&zd(e,t,`name`,a.name,a,null),zd(e,t,`formEncType`,a.formEncType,a,null),zd(e,t,`formMethod`,a.formMethod,a,null),zd(e,t,`formTarget`,a.formTarget,a,null)):(zd(e,t,`encType`,a.encType,a,null),zd(e,t,`method`,a.method,a,null),zd(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=cn(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=ln);break;case`onScroll`:r!=null&&q(`scroll`,e);break;case`onScrollEnd`:r!=null&&q(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=cn(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:q(`beforetoggle`,e),q(`toggle`,e),Rt(e,`popover`,r);break;case`xlinkActuate`:Bt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Bt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Bt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Bt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Bt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Bt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Bt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Bt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Bt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Rt(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=on.get(n)||n,Rt(e,n,r))}}function Bd(e,t,n,r,a,o){switch(n){case`style`:rn(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?en(e,r):(typeof r==`number`||typeof r==`bigint`)&&en(e,``+r);break;case`onScroll`:r!=null&&q(`scroll`,e);break;case`onScrollEnd`:r!=null&&q(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=ln);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!jt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[_t]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):Rt(e,n,r)}}}function Vd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:q(`error`,e),q(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:zd(e,t,o,s,n,null)}}a&&zd(e,t,`srcSet`,n.srcSet,n,null),r&&zd(e,t,`src`,n.src,n,null);return;case`input`:q(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:zd(e,t,r,d,n,null)}}Yt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in q(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:zd(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Zt(e,!!r,n,!0):Zt(e,!!r,t,!1);return;case`textarea`:for(s in q(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:zd(e,t,s,c,n,null)}$t(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:zd(e,t,l,r,n,null)}return;case`dialog`:q(`beforetoggle`,e),q(`toggle`,e),q(`cancel`,e),q(`close`,e);break;case`iframe`:case`object`:q(`load`,e);break;case`video`:case`audio`:for(r=0;r<Cd.length;r++)q(Cd[r],e);break;case`image`:q(`error`,e),q(`load`,e);break;case`details`:q(`toggle`,e);break;case`embed`:case`source`:case`link`:q(`error`,e),q(`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(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:zd(e,t,u,r,n,null)}return;default:if(an(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Bd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&zd(e,t,c,r,n,null))}function Hd(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||zd(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&zd(e,t,p,m,r,f)}}Jt(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||zd(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&zd(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Zt(e,!!n,n?[]:``,!1):Zt(e,!!n,t,!0)):Zt(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:zd(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&zd(e,t,s,a,r,o)}Qt(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:zd(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:zd(e,t,l,p,r,m)}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 g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&zd(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:zd(e,t,u,p,r,m)}return;default:if(an(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Bd(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||Bd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&zd(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||zd(e,t,f,p,r,m)}function Ud(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Wd(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Ud(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Ud(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.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 Gd=null,Kd=null;function qd(e){return e.nodeType===9?e:e.ownerDocument}function Jd(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 Yd(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 Xd(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 Zd=null;function Qd(){var e=window.event;return e&&e.type===`popstate`?e===Zd?!1:(Zd=e,!0):(Zd=null,!1)}var $d=typeof setTimeout==`function`?setTimeout:void 0,ef=typeof clearTimeout==`function`?clearTimeout:void 0,tf=typeof Promise==`function`?Promise:void 0,nf=typeof queueMicrotask==`function`?queueMicrotask:tf===void 0?$d:function(e){return tf.resolve(null).then(e).catch(rf)};function rf(e){setTimeout(function(){throw e})}function af(e){return e===`head`}function of(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Bp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)bf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,bf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[Ct]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&bf(e.ownerDocument.body);n=i}while(n);Bp(t)}function sf(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8)if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++;n=r}while(n)}function cf(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:cf(n),wt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function lf(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r)if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e;else if(!e[Ct])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=hf(e.nextSibling),e===null)break}return null}function uf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=hf(e.nextSibling),e===null))return null;return e}function df(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=hf(e.nextSibling),e===null))return null;return e}function ff(e){return e.data===`$?`||e.data===`$~`}function pf(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function mf(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function hf(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 gf=null;function _f(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return hf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function vf(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function yf(e,t,n){switch(t=qd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function bf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);wt(e)}var xf=new Map,Sf=new Set;function Cf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var wf=D.d;D.d={f:Tf,r:Ef,D:kf,C:Af,L:jf,m:Mf,X:Pf,S:Nf,M:Ff};function Tf(){var e=wf.f(),t=Ou();return e||t}function Ef(e){var t=Et(e);t!==null&&t.tag===5&&t.type===`form`?Ms(t):wf.r(e)}var Df=typeof document>`u`?null:document;function Of(e,t,n){var r=Df;if(r&&typeof t==`string`&&t){var i=k(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Sf.has(i)||(Sf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Vd(t,`link`,e),kt(t),r.head.appendChild(t)))}}function kf(e){wf.D(e),Of(`dns-prefetch`,e,null)}function Af(e,t){wf.C(e,t),Of(`preconnect`,e,t)}function jf(e,t,n){wf.L(e,t,n);var r=Df;if(r&&e&&t){var i=`link[rel="preload"][as="`+k(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+k(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+k(n.imageSizes)+`"]`)):i+=`[href="`+k(e)+`"]`;var a=i;switch(t){case`style`:a=Lf(e);break;case`script`:a=Vf(e)}xf.has(a)||(e=h({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),xf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Rf(a))||t===`script`&&r.querySelector(Hf(a))||(t=r.createElement(`link`),Vd(t,`link`,e),kt(t),r.head.appendChild(t)))}}function Mf(e,t){wf.m(e,t);var n=Df;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+k(r)+`"][href="`+k(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Vf(e)}if(!xf.has(a)&&(e=h({rel:`modulepreload`,href:e},t),xf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Hf(a)))return}r=n.createElement(`link`),Vd(r,`link`,e),kt(r),n.head.appendChild(r)}}}function Nf(e,t,n){wf.S(e,t,n);var r=Df;if(r&&e){var i=Ot(r).hoistableStyles,a=Lf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Rf(a)))s.loading=5;else{e=h({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=xf.get(a))&&Gf(e,n);var c=o=r.createElement(`link`);kt(c),Vd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Wf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Pf(e,t){wf.X(e,t);var n=Df;if(n&&e){var r=Ot(n).hoistableScripts,i=Vf(e),a=r.get(i);a||(a=n.querySelector(Hf(i)),a||(e=h({src:e,async:!0},t),(t=xf.get(i))&&Kf(e,t),a=n.createElement(`script`),kt(a),Vd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Ff(e,t){wf.M(e,t);var n=Df;if(n&&e){var r=Ot(n).hoistableScripts,i=Vf(e),a=r.get(i);a||(a=n.querySelector(Hf(i)),a||(e=h({src:e,async:!0,type:`module`},t),(t=xf.get(i))&&Kf(e,t),a=n.createElement(`script`),kt(a),Vd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function If(e,t,n,r){var a=(a=ve.current)?Cf(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Lf(n.href),n=Ot(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Lf(n.href);var o=Ot(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Rf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),xf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},xf.set(e,n),o||Bf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Vf(n),n=Ot(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Lf(e){return`href="`+k(e)+`"`}function Rf(e){return`link[rel="stylesheet"][`+e+`]`}function zf(e){return h({},e,{"data-precedence":e.precedence,precedence:null})}function Bf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Vd(t,`link`,n),kt(t),e.head.appendChild(t))}function Vf(e){return`[src="`+k(e)+`"]`}function Hf(e){return`script[async]`+e}function Uf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+k(n.href)+`"]`);if(r)return t.instance=r,kt(r),r;var a=h({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),kt(r),Vd(r,`style`,a),Wf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Lf(n.href);var o=e.querySelector(Rf(a));if(o)return t.state.loading|=4,t.instance=o,kt(o),o;r=zf(n),(a=xf.get(a))&&Gf(r,a),o=(e.ownerDocument||e).createElement(`link`),kt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Vd(o,`link`,r),t.state.loading|=4,Wf(o,n.precedence,e),t.instance=o;case`script`:return o=Vf(n.src),(a=e.querySelector(Hf(o)))?(t.instance=a,kt(a),a):(r=n,(a=xf.get(o))&&(r=h({},n),Kf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),kt(a),Vd(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Wf(r,n.precedence,e));return t.instance}function Wf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Gf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Kf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var qf=null;function Jf(e,t,n){if(qf===null){var r=new Map,i=qf=new Map;i.set(n,r)}else i=qf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[Ct]||a[O]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Yf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Xf(e,t,n){if(n===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;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!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 Zf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Qf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Lf(r.href),a=t.querySelector(Rf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=tp.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,kt(a);return}a=t.ownerDocument||t,r=zf(r),(i=xf.get(i))&&Gf(r,i),a=a.createElement(`link`),kt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Vd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=tp.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var $f=0;function ep(e,t){return e.stylesheets&&e.count===0&&rp(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&rp(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&$f===0&&($f=62500*Wd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&rp(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>$f?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function tp(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)rp(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var np=null;function rp(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,np=new Map,t.forEach(ip,e),np=null,tp.call(e))}function ip(e,t){if(!(t.state.loading&4)){var n=np.get(e);if(n)var r=n.get(null);else{n=new Map,np.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=tp.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var ap={$$typeof:C,Provider:null,Consumer:null,_currentValue:ue,_currentValue2:ue,_threadCount:0};function op(e,t,n,r,i,a,o,s,c){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=ot(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ot(0),this.hiddenUpdates=ot(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function sp(e,t,n,r,i,a,o,s,c,l,u,d){return e=new op(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=mi(3,null,null,t),e.current=a,a.stateNode=e,t=pa(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Ka(a),e}function cp(e){return e?(e=fi,e):fi}function lp(e,t,n,r,i,a){i=cp(i),r.context===null?r.context=i:r.pendingContext=i,r=Ja(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Ya(e,r,t),n!==null&&(Cu(n,e,t),Xa(n,e,t))}function up(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function dp(e,t){up(e,t),(e=e.alternate)&&up(e,t)}function fp(e){if(e.tag===13||e.tag===31){var t=li(e,67108864);t!==null&&Cu(t,e,67108864),dp(e,67108864)}}function pp(e){if(e.tag===13||e.tag===31){var t=xu();t=ft(t);var n=li(e,t);n!==null&&Cu(n,e,t),dp(e,t)}}var mp=!0;function hp(e,t,n,r){var i=E.T;E.T=null;var a=D.p;try{D.p=2,_p(e,t,n,r)}finally{D.p=a,E.T=i}}function gp(e,t,n,r){var i=E.T;E.T=null;var a=D.p;try{D.p=8,_p(e,t,n,r)}finally{D.p=a,E.T=i}}function _p(e,t,n,r){if(mp){var i=vp(r);if(i===null)Ad(e,t,r,yp,n),Ap(e,r);else if(Mp(i,e,t,n,r))r.stopPropagation();else if(Ap(e,r),t&4&&-1<kp.indexOf(e)){for(;i!==null;){var a=Et(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=tt(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Je(o);s.entanglements[1]|=c,o&=~c}dd(a),!(V&6)&&(lu=Ie()+500,fd(0,!1))}}break;case 31:case 13:s=li(a,2),s!==null&&Cu(s,a,2),Ou(),dp(a,2)}if(a=vp(r),a===null&&Ad(e,t,r,yp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Ad(e,t,r,null,n)}}function vp(e){return e=dn(e),bp(e)}var yp=null;function bp(e){if(yp=null,e=Tt(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return yp=e,null}function xp(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(Le()){case Re:return 2;case ze:return 8;case Be:case Ve:return 32;case He:return 268435456;default:return 32}default:return 32}}var Sp=!1,Cp=null,wp=null,Tp=null,Ep=new Map,Dp=new Map,Op=[],kp=`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 Ap(e,t){switch(e){case`focusin`:case`focusout`:Cp=null;break;case`dragenter`:case`dragleave`:wp=null;break;case`mouseover`:case`mouseout`:Tp=null;break;case`pointerover`:case`pointerout`:Ep.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Dp.delete(t.pointerId)}}function jp(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Et(t),t!==null&&fp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Mp(e,t,n,r,i){switch(t){case`focusin`:return Cp=jp(Cp,e,t,n,r,i),!0;case`dragenter`:return wp=jp(wp,e,t,n,r,i),!0;case`mouseover`:return Tp=jp(Tp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Ep.set(a,jp(Ep.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Dp.set(a,jp(Dp.get(a)||null,e,t,n,r,i)),!0}return!1}function Np(e){var t=Tt(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,ht(e.priority,function(){pp(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,ht(e.priority,function(){pp(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Pp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=vp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);un=r,n.target.dispatchEvent(r),un=null}else return t=Et(n),t!==null&&fp(t),e.blockedOn=n,!1;t.shift()}return!0}function Fp(e,t,n){Pp(e)&&n.delete(t)}function Ip(){Sp=!1,Cp!==null&&Pp(Cp)&&(Cp=null),wp!==null&&Pp(wp)&&(wp=null),Tp!==null&&Pp(Tp)&&(Tp=null),Ep.forEach(Fp),Dp.forEach(Fp)}function Lp(e,n){e.blockedOn===n&&(e.blockedOn=null,Sp||(Sp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Ip)))}var Rp=null;function zp(e){Rp!==e&&(Rp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Rp===e&&(Rp=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(bp(r||n)===null)continue;break}var a=Et(n);a!==null&&(e.splice(t,3),t-=3,As(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Bp(e){function t(t){return Lp(t,e)}Cp!==null&&Lp(Cp,e),wp!==null&&Lp(wp,e),Tp!==null&&Lp(Tp,e),Ep.forEach(t),Dp.forEach(t);for(var n=0;n<Op.length;n++){var r=Op[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Op.length&&(n=Op[0],n.blockedOn===null);)Np(n),n.blockedOn===null&&Op.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[_t]||null;if(typeof a==`function`)o||zp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[_t]||null)s=o.formAction;else if(bp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),zp(n)}}}function Vp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Hp(e){this._internalRoot=e}Up.prototype.render=Hp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;lp(n,xu(),e,t,null,null)},Up.prototype.unmount=Hp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;lp(e.current,2,null,e,null,null),Ou(),t[vt]=null}};function Up(e){this._internalRoot=e}Up.prototype.unstable_scheduleHydration=function(e){if(e){var t=mt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Op.length&&t!==0&&t<Op[n].priority;n++);Op.splice(n,0,e),n===0&&Np(e)}};var Wp=n.version;if(Wp!==`19.2.7`)throw Error(i(527,Wp,`19.2.7`));D.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=d(t),e=e===null?null:p(e),e=e===null?null:e.stateNode,e};var Gp={bundleType:0,version:`19.2.7`,rendererPackageName:`react-dom`,currentDispatcherRef:E,reconcilerVersion:`19.2.7`};
9if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var J=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!J.isDisabled&&J.supportsFiber)try{Ge=J.inject(Gp),Ke=J}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=$s,s=ec,c=tc;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=sp(e,1,!1,null,null,n,r,null,o,s,c,Vp),e[vt]=t.current,Od(e),new Hp(t)}})),g=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=h()})),_=c(u(),1),v=g(),y=`modulepreload`,b=function(e){return`/`+e},x={},S=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,new URL(`../../../src/node/plugins/importAnalysisBuild.ts`,import.meta.url)).href}r=o(t.map(t=>{if(t=b(t,n),t=s(t),t in x)return;x[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:y,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},C=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,w=/^[\\/]{2}/;function ee(e,t){return t+e.replace(/\\/g,`/`)}var te=`popstate`;function ne(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function re(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return se(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:ce(t)}return E(t,n,null,e)}function T(e,t){if(e===!1||e==null)throw Error(t)}function ie(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function ae(){return Math.random().toString(36).substring(2,10)}function oe(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function se(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?le(t):t,state:n,key:t&&t.key||r||ae(),mask:i}}function ce({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function le(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function E(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=`PUSH`;let r=ne(e)?e:se(h.location,e,t);n&&n(r,e),l=u()+1;let d=oe(r,l),f=h.createHref(r.mask||r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=`REPLACE`;let r=ne(e)?e:se(h.location,e,t);n&&n(r,e),l=u();let i=oe(r,l),d=h.createHref(r.mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return D(i,e)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(te,d),c=e,()=>{i.removeEventListener(te,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}function D(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),T(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:ce(t);return i=i.replace(/ $/,`%20`),!n&&w.test(i)&&(i=r+i),new URL(i,r)}function ue(e,t,n=`/`){return de(e,t,n,!1)}function de(e,t,n,r,i){let a=je((typeof t==`string`?le(t):t).pathname||`/`,n);if(a==null)return null;let o=i??pe(e),s=null,c=Ae(a);for(let e=0;s==null&&e<o.length;++e)s=Ee(o[e],c,r);return s}function fe(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function pe(e){let t=me(e);return ge(t),t}function me(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;T(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}
9" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=ze([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(T(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),me(e.children,t,u,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:we(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=ke(e.relativePath,e.caseSensitive,t===u.length-1);return{...e,matcher:n,compiledParams:r}})})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of he(e.path))a(e,t,!0,n)}),t}function he(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=he(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function ge(e){e.sort((e,t)=>e.score===t.score?Te(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var _e=/^:[\w-]+$/,ve=3,ye=2,be=1,xe=10,Se=-2,Ce=e=>e===`*`;function we(e,t){let n=e.split(`/`),r=n.length;return n.some(Ce)&&(r+=Se),t&&(r+=ye),n.filter(e=>!Ce(e)).reduce((e,t)=>e+(_e.test(t)?ve:t===``?be:xe),r)}function Te(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function Ee(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u={path:s.relativePath,caseSensitive:s.caseSensitive,end:c},d=s.matcher&&s.compiledParams?Oe(u,l,s.matcher,s.compiledParams):De(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=De({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;
9Object.assign(i,d.params),o.push({params:i,pathname:ze([a,d.pathname]),pathnameBase:Ve(ze([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=ze([a,d.pathnameBase]))}return o}function De(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=ke(e.path,e.caseSensitive,e.end);return Oe(e,t,n,r)}function Oe(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,`$1`),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let i=s[r];return n&&!i?e[t]=void 0:e[t]=(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function ke(e,t=!1,n=!0){ie(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function Ae(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return ie(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function je(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}function Me(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?le(e):e,a;return n?(n=Re(n),a=n.startsWith(`/`)?Ne(n.substring(1),`/`):Ne(n,t)):a=t,{pathname:a,search:He(r),hash:Ue(i)}}function Ne(e,t){let n=Be(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function Pe(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Fe(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function Ie(e){let t=Fe(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function Le(e,t,n,r=!1){let i;typeof e==`string`?i=le(e):(i={...e},T(!i.pathname||!i.pathname.includes(`?`),Pe(`?`,`pathname`,`search`,i)),T(!i.pathname||!i.pathname.includes(`#`),Pe(`#`,`pathname`,`hash`,i)),T(!i.search||!i.search.includes(`#`),Pe(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=Me(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var Re=e=>e.replace(/[\\/]{2,}/g,`/`),ze=e=>Re(e.join(`/`)),Be=e=>e.replace(/\/+$/,``),Ve=e=>Be(e).replace(/^\/*/,`/`),He=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,Ue=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,We=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function Ge(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function Ke(e){return ze(e.map(e=>e.route.path).filter(Boolean))||`/`}var qe=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function Je(e,t){let n=e;if(typeof n!=`string`||!C.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(qe)try{let e=new URL(window.location.href),r=w.test(n)?new URL(ee(n,e.protocol)):new URL(n),a=je(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{ie(!1,`<Link to="${n}">
9 contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var Ye=[`POST`,`PUT`,`PATCH`,`DELETE`];new Set(Ye);var Xe=[`GET`,...Ye];new Set(Xe);var Ze=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function Qe(e){try{return Ze.includes(new URL(e).protocol)}catch{return!1}}var $e=_.createContext(null);$e.displayName=`DataRouter`;var et=_.createContext(null);et.displayName=`DataRouterState`;var tt=_.createContext(!1);function nt(){return _.useContext(tt)}var rt=_.createContext({isTransitioning:!1});rt.displayName=`ViewTransition`;var it=_.createContext(new Map);it.displayName=`Fetchers`;var at=_.createContext(null);at.displayName=`Await`;var ot=_.createContext(null);ot.displayName=`Navigation`;var st=_.createContext(null);st.displayName=`Location`;var ct=_.createContext({outlet:null,matches:[],isDataRoute:!1});ct.displayName=`Route`;var lt=_.createContext(null);lt.displayName=`RouteError`;var ut=`REACT_ROUTER_ERROR`,dt=`REDIRECT`,ft=`ROUTE_ERROR_RESPONSE`;function pt(e){if(e.startsWith(`${ut}:${dt}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function mt(e){if(e.startsWith(`${ut}:${ft}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new We(t.status,t.statusText,t.data)}catch{}}function ht(e,{relative:t}={}){T(gt(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=_.useContext(ot),{hash:i,pathname:a,search:o}=wt(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:ze([n,a])),r.createHref({pathname:s,search:o,hash:i})}function gt(){return _.useContext(st)!=null}function O(){return T(gt(),`useLocation() may be used only in the context of a <Router> component.`),_.useContext(st).location}var _t=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function vt(e){_.useContext(ot).static||_.useLayoutEffect(e)}function yt(){let{isDataRoute:e}=_.useContext(ct);return e?Ut():bt()}function bt(){T(gt(),`useNavigate() may be used only in the context of a <Router> component.`);let e=_.useContext($e),{basename:t,navigator:n}=_.useContext(ot),{matches:r}=_.useContext(ct),{pathname:i}=O(),a=JSON.stringify(Ie(r)),o=_.useRef(!1);return vt(()=>{o.current=!0}),_.useCallback((r,s={})=>{if(ie(o.current,_t),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=Le(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:ze([t,c.pathname])),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}var xt=_.createContext(null);function St(e){let t=_.useContext(ct).outlet;return _.useMemo(()=>t&&_.createElement(xt.Provider,{value:e},t),[t,e])}function Ct(){let{matches:e}=_.useContext(ct);return e[e.length-1]?.params??{}}function wt(e,{relative:t}={}){let{matches:n}=_.useContext(ct),{pathname:r}=O(),i=JSON.stringify(Ie(n));return _.useMemo(()=>Le(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function Tt(e,t){return Et(e,t)}function Et(e,t,n){T(gt(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=_.useContext(ot),{matches:i}=_.useContext(ct),a=i[i.length-1],o=a?a.params:{},s=a?a.pathname:`/`,c=a?a.pathnameBase:`/`,l=a&&a.route;{let e=l&&l.path||``;Gt(s,!l||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${s}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render. 10 11Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let u=O(),d;if(t){let e=typeof t==`string`?le(t):t;T(c===`/`||e.pathname?.startsWith(c),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${e.pathname}" was given in the \`location\` prop.`),d=e}else d=u;let f=d.pathname||`/`,p=f;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);p=`/`+f.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let m=n&&n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):ue(e,{pathname:p});ie(l||m!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),ie(m==null||m[m.length-1].route.element!==void 0||m[m.length-1].route.Component!==void 0||m[m.length-1].route.lazy!==void 0,`Matched leaf route at location "${d.pathname}${d.search}${d.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let h=Nt(m&&m.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:ze([c,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:ze([c,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&h?_.createElement(st.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...d},navigationType:`POP`}},h):h}function Dt(){let e=Ht(),t=Ge(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=_.createElement(_.Fragment,null,_.createElement(`p`,null,`ð¿ Hey developer ð`),_.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,_.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,_.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),_.createElement(_.Fragment,null,_.createElement(`h2`,null,`Unexpected Application
11Error!`),_.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?_.createElement(`pre`,{style:i},n):null,o)}var Ot=_.createElement(Dt,null),kt=class extends _.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=mt(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:_.createElement(ct.Provider,{value:this.props.routeContext},_.createElement(lt.Provider,{value:e,children:this.props.component}));return this.context?_.createElement(jt,{error:e},t):t}};kt.contextType=tt;var At=new WeakMap;function jt({children:e,error:t}){let{basename:n}=_.useContext(ot);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=pt(t.digest);if(e){let r=At.get(t);if(r)throw r;let i=Je(e.location,n),a=i.absoluteURL||i.to;if(Qe(a))throw Error(`Invalid redirect location`);if(qe&&!At.get(t))if(i.isExternal||e.reloadDocument)window.location.href=a;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:e.replace}));throw At.set(t,n),n}return _.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${a}`})}}return e}function Mt({routeContext:e,match:t,children:n}){let r=_.useContext($e);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),_.createElement(ct.Provider,{value:e},n)}function Nt(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);T(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,l=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:Ke(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let u,d=!1,f=null,p=null;r&&(u=a&&n.route.id?a[n.route.id]:void 0,f=n.route.errorElement||Ot,o&&(s<0&&c===0?(Gt(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):s===c&&(d=!0,p=n.route.hydrateFallbackElement||null)));let m=t.concat(i.slice(0,c+1)),h=()=>{let t;return t=u?f:d?p:n.route.Component?_.createElement(n.route.Component,null):n.route.element?n.route.element:e,_.createElement(Mt,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?_.createElement(kt,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:l}):h()},null)}function Pt(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Ft(e){let t=_.useContext($e);return T(t,Pt(e)),t}function It(e){let t=_.useContext(et);return T(t,Pt(e)),t}function Lt(e){let t=_.useContext(ct);return T(t,Pt(e)),t}function Rt(e){let t=Lt(e),n=t.matches[t.matches.length-1];return T(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function zt(){return Rt(`useRouteId`)}function Bt(){let e=It(`useNavigation`);return _.useMemo(()=>{let{matches:t,historyAction:n,...r}=e.navigation;return r},[e.navigation])}function Vt(){let{matches:e,loaderData:t}=It(`useMatches`);return _.useMemo(()=>e.map(e=>fe(e,t)),[e,t])}function Ht(){let e=_.useContext(lt),t=It(`useRouteError`),n=Rt(`useRouteError`);return e===void 0?t.errors?.[n]:e}function Ut(){let{router:e}=Ft(`useNavigate`),t=Rt(`useNavigate`),n=_.useRef(!1);return vt(()=>{n.current=!0}),_.useCallback(async(r,i={})=>{ie(n.current,_t),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var Wt={};function Gt(e,t,n){!t&&!Wt[e]&&(Wt[e]=!0,ie(!1,n))}_.memo(Kt);function Kt({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return Et(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function qt(e){return St(e.context)}function k(e){T(!1,`A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.`)}function Jt({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){T(!gt(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=_.useMemo(()=>({basename:s,navigator:i,static:a,useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=le(n));let{pathname:l=`/`,search:u=``,hash:d=``,state:f=null,key:p=`default`,mask:m}=n,h=_.useMemo(()=>{let e=je(l,s);return e==null?null:{location:{pathname:e,search:u,hash:d,state:f,key:p,mask:m},navigationType:r}},[s,l,u,d,f,p,r,m]);
11return ie(h!=null,`<Router basename="${s}"> is not able to match the URL "${l}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),h==null?null:_.createElement(ot.Provider,{value:c},_.createElement(st.Provider,{children:t,value:h}))}function Yt({children:e,location:t}){return Tt(Xt(e),t)}_.Component;function Xt(e,t=[]){let n=[];return _.Children.forEach(e,(e,r)=>{if(!_.isValidElement(e))return;let i=[...t,r];if(e.type===_.Fragment){n.push.apply(n,Xt(e.props.children,i));return}T(e.type===k,`[${typeof e.type==`string`?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),T(!e.props.index||!e.props.children,`An index route cannot have child routes.`);let a={id:e.props.id||i.join(`-`),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,middleware:e.props.middleware,loader:e.props.loader,action:e.props.action,hydrateFallbackElement:e.props.hydrateFallbackElement,HydrateFallback:e.props.HydrateFallback,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:e.props.hasErrorBoundary===!0||e.props.ErrorBoundary!=null||e.props.errorElement!=null,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=Xt(e.props.children,i)),n.push(a)}),n}var Zt=`get`,Qt=`application/x-www-form-urlencoded`;function $t(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function en(e){return $t(e)&&e.tagName.toLowerCase()===`button`}function tn(e){return $t(e)&&e.tagName.toLowerCase()===`form`}function nn(e){return $t(e)&&e.tagName.toLowerCase()===`input`}function rn(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function an(e,t){return e.button===0&&(!t||t===`_self`)&&!rn(e)}function on(e=``){return new URLSearchParams(typeof e==`string`||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(e=>[n,e]):[[n,r]])},[]))}function sn(e,t){let n=on(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var cn=null;function ln(){if(cn===null)try{new FormData(document.createElement(`form`),0),cn=!1}catch{cn=!0}return cn}var un=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function dn(e){return e!=null&&!un.has(e)?(ie(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Qt}"`),null):e}function fn(e,t){let n,r,i,a,o;if(tn(e)){let o=e.getAttribute(`action`);r=o?je(o,t):null,n=e.getAttribute(`method`)||Zt,i=dn(e.getAttribute(`enctype`))||Qt,a=new FormData(e)}else if(en(e)||nn(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?je(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||Zt,i=dn(e.getAttribute(`formenctype`))||dn(o.getAttribute(`enctype`))||Qt,a=new FormData(o,e),!ln()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if($t(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=Zt,r=null,i=Qt,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var pn={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},mn=/[&><\u2028\u2029]/g;function hn(e){return e.replace(mn,e=>pn[e])}function gn(e,t){if(e===!1||e==null)throw Error(t)}function _n(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return n?i.pathname.endsWith(`/`)?i.pathname=`${i.pathname}_.${r}`:i.pathname=`${i.pathname}.${r}`:i.pathname===`/`?i.pathname=`_root.${r}`:t&&je(i.pathname,t)===`/`?i.pathname=`${Be(t)}/_root.${r}`:i.pathname=`${Be(i.pathname)}.${r}`,i}async function vn(e,t){if(e.id in t)return t[e.id];try{let n=await S(()=>import(e.module),[]);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.
11isSpaMode,window.location.reload(),new Promise(()=>{})}}function yn(e){return e!=null&&typeof e.page==`string`}function bn(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function xn(e,t,n){return En((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await vn(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(bn).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function Sn(e,t,n,r,i,a){let o=(e,t)=>n[t]?e.route.id!==n[t].route.id:!0,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function Cn(e,t,{includeHydrateFallback:n}={}){return wn(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function wn(e){return[...new Set(e)]}function Tn(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function En(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!yn(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(Tn(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function Dn(){let e=_.useContext($e);return gn(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function On(){let e=_.useContext(et);return gn(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var kn=_.createContext(void 0);kn.displayName=`FrameworkContext`;function An(){let e=_.useContext(kn);return gn(e,`You must render this element inside a <HydratedRouter> element`),e}function jn(e,t){let n=_.useContext(kn),[r,i]=_.useState(!1),[a,o]=_.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:d}=t,f=_.useRef(null);_.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),_.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let p=()=>{i(!0)},m=()=>{i(!1),o(!1)};return n?e===`intent`?[a,f,{onFocus:Mn(s,p),onBlur:Mn(c,m),onMouseEnter:Mn(l,p),onMouseLeave:Mn(u,m),onTouchStart:Mn(d,p)}]:[a,f,{}]:[!1,f,{}]}function Mn(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function Nn({page:e,...t}){let n=nt(),{nonce:r}=An(),{router:i}=Dn(),a=_.useMemo(()=>ue(i.routes,e,i.basename),[i.routes,e,i.basename]);return a?(t.nonce==null&&r&&(t={...t,nonce:r}),n?_.createElement(Fn,{page:e,matches:a,...t}):_.createElement(In,{page:e,matches:a,...t})):null}function Pn(e){let{manifest:t,routeModules:n}=An(),[r,i]=_.useState([]);return _.useEffect(()=>{let r=!1;return xn(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function Fn({page:e,matches:t,...n}){let r=O(),{future:i}=An(),{basename:a}=Dn(),o=_.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=_n(e,a,i.v8_trailingSlashAwareDataRequests,`rsc`),o=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?o=!0:s.push(e.route.id);return o&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[a,i.v8_trailingSlashAwareDataRequests,e,r,t]);return _.createElement(_.Fragment,null,o.map(e=>_.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function In({page:e,matches:t,...n}){let r=O(),{future:i,manifest:a,routeModules:o}=An(),{basename:s}=Dn(),{loaderData:c,matches:l}=On(),u=_.useMemo(()=>Sn(e,t,l,a,r,`data`),[e,t,l,a,r]),d=_.useMemo(()=>Sn(e,t,l,a,r,`assets`),[e,t,l,a,r]),f=_.useMemo(()=>
11{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,l=!1;if(t.forEach(e=>{let t=a.routes[e.route.id];!t||!t.hasLoader||(!u.some(t=>t.route.id===e.route.id)&&e.route.id in c&&o[e.route.id]?.shouldRevalidate||t.hasClientLoader?l=!0:n.add(e.route.id))}),n.size===0)return[];let d=_n(e,s,i.v8_trailingSlashAwareDataRequests,`data`);return l&&n.size>0&&d.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[d.pathname+d.search]},[s,i.v8_trailingSlashAwareDataRequests,c,r,a,u,t,e,o]),p=_.useMemo(()=>Cn(d,a),[d,a]),m=Pn(d);return _.createElement(_.Fragment,null,f.map(e=>_.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),p.map(e=>_.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),m.map(({key:e,link:t})=>_.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function Ln(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}_.Component;var Rn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{Rn&&(window.__reactRouterVersion=`7.18.0`)}catch{}function zn({basename:e,children:t,useTransitions:n,window:r}){let i=_.useRef();i.current??=re({window:r,v5Compat:!0});let a=i.current,[o,s]=_.useState({action:a.action,location:a.location}),c=_.useCallback(e=>{n===!1?s(e):_.startTransition(()=>s(e))},[n]);return _.useLayoutEffect(()=>a.listen(c),[a,c]),_.createElement(Jt,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a,useTransitions:n})}function Bn({basename:e,children:t,history:n,useTransitions:r}){let[i,a]=_.useState({action:n.action,location:n.location}),o=_.useCallback(e=>{r===!1?a(e):_.startTransition(()=>a(e))},[r]);return _.useLayoutEffect(()=>n.listen(o),[n,o]),_.createElement(Jt,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:n,useTransitions:r})}Bn.displayName=`unstable_HistoryRouter`;var A=_.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,mask:o,state:s,target:c,to:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m){let{basename:h,navigator:g,useTransitions:v}=_.useContext(ot),y=typeof l==`string`&&C.test(l),b=Je(l,h);l=b.to;let x=ht(l,{relative:r}),S=O(),w=null;if(o){let e=Le(o,[],S.mask?S.mask.pathname:`/`,!0);h!==`/`&&(e.pathname=e.pathname===`/`?h:ze([h,e.pathname])),w=g.createHref(e)}let[ee,te,ne]=jn(n,p),re=qn(l,{replace:a,mask:o,state:s,target:c,preventScrollReset:u,relative:r,viewTransition:d,defaultShouldRevalidate:f,useTransitions:v});function T(t){e&&e(t),t.defaultPrevented||re(t)}let ie=!(b.isExternal||i),ae=_.createElement(`a`,{...p,...ne,href:(ie?w:void 0)||b.absoluteURL||x,onClick:ie?T:e,ref:Ln(m,te),target:c,"data-discover":!y&&t===`render`?`true`:void 0});return ee&&!y?_.createElement(_.Fragment,null,ae,_.createElement(Nn,{page:x})):ae});A.displayName=`Link`;var Vn=_.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let u=wt(a,{relative:c.relative}),d=O(),f=_.useContext(et),{navigator:p,basename:m}=_.useContext(ot),h=f!=null&&ir(u)&&o===!0,g=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,v=d.pathname,y=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;t||(v=v.toLowerCase(),y=y?y.toLowerCase():null,g=g.toLowerCase()),y&&m&&(y=je(y,m)||y);let b=g!==`/`&&g.endsWith(`/`)?g.length-1:g.length,x=v===g||!r&&v.startsWith(g)&&v.charAt(b)===`/`,S=y!=null&&(y===g||!r&&y.startsWith(g)&&y.charAt(g.length)===`/`),C={isActive:x,isPending:S,isTransitioning:h},w=x?e:void 0,ee;ee=typeof n==`function`?n(C):[n,x?`active`:null,S?`pending`:null,h?`transitioning`:null].filter(Boolean).join(` `);let te=typeof i==`function`?i(C):i;return _.createElement(A,{...c,"aria-current":w,className:ee,ref:l,style:te,to:a,viewTransition:o},typeof s==`function`?s(C):s)});Vn.displayName=`NavLink`;var Hn=_.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=Zt,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m)=>{let{useTransitions:h}=_.useContext(ot),g=Zn(),v=Qn(s,{relative:l}),y=o.toLowerCase()===`get`?`get`:`post`,b=typeof s==`string`&&C.test(s);return _.createElement(`form`,{ref:m,method:y,action:v,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,p=()=>g(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f});h&&n!==!1?_.startTransition(()=>p()):p()},...p,"data-discover":!b&&e===`render`?`true`:void 0})});Hn.displayName=`Form`;function Un({getKey:e,storageKey:t,...n}){let r=_.useContext(kn),{basename:i}=_.useContext(ot),a=O(),o=Vt();nr({getKey:e,storageKey:t});let s=_.useMemo(()=>
11{if(!r||!e)return null;let t=tr(a,o,i,e);return t===a.key?null:t},[]);if(!r||r.isSpaMode)return null;let c=((e,t)=>{if(!window.history.state||!window.history.state.key){let e=Math.random().toString(32).slice(2);window.history.replaceState({key:e},``)}try{let n=JSON.parse(sessionStorage.getItem(e)||`{}`)[t||window.history.state.key];typeof n==`number`&&window.scrollTo(0,n)}catch(t){console.error(t),sessionStorage.removeItem(e)}}).toString();return n.nonce==null&&r?.nonce&&(n.nonce=r.nonce),_.createElement(`script`,{...n,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${c})(${hn(JSON.stringify(t||$n))}, ${hn(JSON.stringify(s))})`}})}Un.displayName=`ScrollRestoration`;function Wn(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Gn(e){let t=_.useContext($e);return T(t,Wn(e)),t}function Kn(e){let t=_.useContext(et);return T(t,Wn(e)),t}function qn(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c,useTransitions:l}={}){let u=yt(),d=O(),f=wt(e,{relative:o});return _.useCallback(p=>{if(an(p,t)){p.preventDefault();let t=n===void 0?ce(d)===ce(f):n,m=()=>u(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c});l?_.startTransition(()=>m()):m()}},[d,u,f,n,r,i,t,e,a,o,s,c,l])}function Jn(e){ie(typeof URLSearchParams<`u`,"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=_.useRef(on(e)),n=_.useRef(!1),r=O(),i=_.useMemo(()=>sn(r.search,n.current?null:t.current),[r.search]),a=yt();return[i,_.useCallback((e,t)=>{let r=on(typeof e==`function`?e(new URLSearchParams(i)):e);n.current=!0,a(`?`+r,t)},[a,i])]}var Yn=0,Xn=()=>`__${String(++Yn)}__`;function Zn(){let{router:e}=Gn(`useSubmit`),{basename:t}=_.useContext(ot),n=zt(),r=e.fetch,i=e.navigate;return _.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=fn(e,t);a.navigate===!1?await r(a.fetcherKey||Xn(),n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync}):await i(a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function Qn(e,{relative:t}={}){let{basename:n}=_.useContext(ot),r=_.useContext(ct);T(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...wt(e||`.`,{relative:t})},o=O();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:ze([n,a.pathname])),ce(a)}var $n=`react-router-scroll-positions`,er={};function tr(e,t,n,r){let i=null;return r&&(i=r(n===`/`?e:{...e,pathname:je(e.pathname,n)||e.pathname},t)),i??=e.key,i}function nr({getKey:e,storageKey:t}={}){let{router:n}=Gn(`useScrollRestoration`),{restoreScrollPosition:r,preventScrollReset:i}=Kn(`useScrollRestoration`),{basename:a}=_.useContext(ot),o=O(),s=Vt(),c=Bt();_.useEffect(()=>(window.history.scrollRestoration=`manual`,()=>{window.history.scrollRestoration=`auto`}),[]),rr(_.useCallback(()=>{if(c.state===`idle`){let t=tr(o,s,a,e);er[t]=window.scrollY}try{sessionStorage.setItem(t||$n,JSON.stringify(er))}catch(e){ie(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${e}).`)}window.history.scrollRestoration=`auto`},[c.state,e,a,o,s,t])),typeof document<`u`&&(_.useLayoutEffect(()=>{try{let e=sessionStorage.getItem(t||$n);e&&(er=JSON.parse(e))}catch{}},[t]),_.useLayoutEffect(()=>{let t=n?.enableScrollRestoration(er,()=>window.scrollY,e?(t,n)=>tr(t,n,a,e):void 0);return()=>t&&t()},[n,a,e]),_.useLayoutEffect(()=>{if(r!==!1){if(typeof r==`number`){window.scrollTo(0,r);return}try{if(o.hash){let e=document.getElementById(decodeURIComponent(o.hash.slice(1)));if(e){e.scrollIntoView();return}}}catch{ie(!1,`"${o.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}i!==!0&&window.scrollTo(0,0)}},[o,r,i]))}function rr(e,t){let{capture:n}=t||{};_.useEffect(()=>{let t=n==null?void 0:{capture:n};return window.addEventListener(`pagehide`,e,t),()=>{window.removeEventListener(`pagehide`,e,t)}},[e,n])}function ir(e,{relative:t}={}){let n=_.useContext(rt);T(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Gn(`useViewTransitionState`),i=wt(e,{relative:t});if(!n.isTransitioning)return!1;let a=je(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=je(n.nextLocation.pathname,r)||n.nextLocation.pathname;return De(i.pathname,o)!=null||De(i.pathname,a)!=null}var ar=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),j=o(((e,t)=>{t.exports=ar()}))(),or=class extends _.Component{constructor(e){super(e),this.state={hasError:!1,error:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}render(){return this.state.hasError?(0,j.jsx)(`div`,{style:{minHeight:`100vh`,display:`flex`,alignItems:`center`,justifyContent:`center`,padding:24,background:`#F9F9F9`},children:(0,j.jsxs)(`div`,{style:{maxWidth:480,textAlign:`center`},children:[(0,j.jsx)(`div`,{style:{fontSize:48,marginBottom:16},children:`â ï¸`}),(0,j.jsx)(`h1`,{style:{fontSize:24,fontWeight:900,color:`#111`,marginBottom:10},children:`Something went wrong`}),(0,j.jsx)(`p`,{style:{fontSize:14,color:`#6B7280`,lineHeight:1.7,marginBottom:28},children:`We hit an unexpected error. Please refresh the page or go back to the home page.`}),(0,j.jsxs)(`div`,{style:{display:`flex`,gap:12,justifyContent:`center`},children:[(0,j.jsx)(`button`,{onClick:()=>window.location.reload(),style:{background:`#C0392B`,color:`#fff`,fontWeight:700,fontSize:14,padding:`11px 24px`,borderRadius:999,border:`none`,cursor:`pointer`},children:`Refresh Page`}),(0,j.jsx)(`a`,{href:`/`,style:{background:`#F3F4F6`,color:`#374151`,fontWeight:600,fontSize:14,padding:`11px 24px`,borderRadius:999,textDecoration:`none`},children:`Go Home`})]})]})}):this.props.children}};function sr(){let{pathname:e}=O();return(0,_.useEffect)(()=>{window.scrollTo(0,0)},[e]),null}function M({children:e,className:t=``,style:n={}}){return(0,j.jsx)(`div`,{style:{maxWidth:1280,margin:`0 auto`,padding:`0 32px`,...n},className:t,children:e})}function cr(){let[e,t]=(0,_.useState)(typeof window<`u`?window.innerWidth:1200);return(0,_.useEffect)(()=>{let e=()=>t(window.innerWidth);return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),e}function lr(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function ur(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})}var dr=e=>e?(...t)=>e(...t):(...e)=>
11fetch(...e),fr=class extends Error{constructor(e,t=`FunctionsError`,n){super(e),this.name=t,this.context=n}toJSON(){return{name:this.name,message:this.message,context:this.context}}},pr=class extends fr{constructor(e){super(`Failed to send a request to the Edge Function`,`FunctionsFetchError`,e)}},mr=class extends fr{constructor(e){super(`Relay Error invoking the Edge Function`,`FunctionsRelayError`,e)}},hr=class extends fr{constructor(e){super(`Edge Function returned a non-2xx status code`,`FunctionsHttpError`,e)}},gr;(function(e){e.Any=`any`,e.ApNortheast1=`ap-northeast-1`,e.ApNortheast2=`ap-northeast-2`,e.ApSouth1=`ap-south-1`,e.ApSoutheast1=`ap-southeast-1`,e.ApSoutheast2=`ap-southeast-2`,e.CaCentral1=`ca-central-1`,e.EuCentral1=`eu-central-1`,e.EuWest1=`eu-west-1`,e.EuWest2=`eu-west-2`,e.EuWest3=`eu-west-3`,e.SaEast1=`sa-east-1`,e.UsEast1=`us-east-1`,e.UsWest1=`us-west-1`,e.UsWest2=`us-west-2`})(gr||={});var _r=class{constructor(e,{headers:t={},customFetch:n,region:r=gr.Any}={}){this.url=e,this.headers=t,this.region=r,this.fetch=dr(n)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e){return ur(this,arguments,void 0,function*(e,t={}){let n,r;try{let{headers:i,method:a,body:o,signal:s,timeout:c}=t,l={},{region:u}=t;u||=this.region;let d=new URL(`${this.url}/${e}`);u&&u!==`any`&&(l[`x-region`]=u,d.searchParams.set(`forceFunctionRegion`,u));let f;o&&(i&&!Object.prototype.hasOwnProperty.call(i,`Content-Type`)||!i)?typeof Blob<`u`&&o instanceof Blob||o instanceof ArrayBuffer?(l[`Content-Type`]=`application/octet-stream`,f=o):typeof o==`string`?(l[`Content-Type`]=`text/plain`,f=o):typeof FormData<`u`&&o instanceof FormData?f=o:(l[`Content-Type`]=`application/json`,f=JSON.stringify(o)):f=o&&typeof o!=`string`&&!(typeof Blob<`u`&&o instanceof Blob)&&!(o instanceof ArrayBuffer)&&!(typeof FormData<`u`&&o instanceof FormData)?JSON.stringify(o):o;let p=s;c&&(r=new AbortController,n=setTimeout(()=>r.abort(),c),s?(p=r.signal,s.addEventListener(`abort`,()=>r.abort())):p=r.signal);let m=yield this.fetch(d.toString(),{method:a||`POST`,headers:Object.assign(Object.assign(Object.assign({},l),this.headers),i),body:f,signal:p}).catch(e=>{throw new pr(e)}),h=m.headers.get(`x-relay-error`);if(h&&h===`true`)throw new mr(m);if(!m.ok)throw new hr(m);let g=(m.headers.get(`Content-Type`)??`text/plain`).split(`;`)[0].trim(),_;return _=g===`application/json`?yield m.json():g===`application/octet-stream`||g===`application/pdf`?yield m.blob():g===`text/event-stream`?m:g===`multipart/form-data`?yield m.formData():yield m.text(),{data:_,error:null,response:m}}catch(e){return{data:null,error:e,response:e instanceof hr||e instanceof mr?e.context:void 0}}finally{n&&clearTimeout(n)}})}},vr=3,yr=e=>Math.min(1e3*2**e,3e4),br=[520,503],xr=[`GET`,`HEAD`,`OPTIONS`],Sr=class extends Error{constructor(e){super(e.message),this.name=`PostgrestError`,this.details=e.details,this.hint=e.hint,this.co
11de=e.code}toJSON(){return{name:this.name,message:this.message,details:this.details,hint:this.hint,code:this.code}}};function Cr(e,t){return new Promise(n=>{if(t?.aborted){n();return}let r=setTimeout(()=>{t?.removeEventListener(`abort`,i),n()},e);function i(){clearTimeout(r),n()}t?.addEventListener(`abort`,i)})}function wr(e,t,n,r){return!(!r||n>=vr||!xr.includes(e)||!br.includes(t))}var Tr=class{constructor(e){this.shouldThrowOnError=!1,this.retryEnabled=!0,this.method=e.method,this.url=e.url,this.headers=new Headers(e.headers),this.schema=e.schema,this.body=e.body,this.shouldThrowOnError=e.shouldThrowOnError??!1,this.signal=e.signal,this.isMaybeSingle=e.isMaybeSingle??!1,this.shouldStripNulls=e.shouldStripNulls??!1,this.urlLengthLimit=e.urlLengthLimit??8e3,this.retryEnabled=e.retry??!0,e.fetch?this.fetch=e.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}stripNulls(){if(this.headers.get(`Accept`)===`text/csv`)throw Error(`stripNulls() cannot be used with csv()`);return this.shouldStripNulls=!0,this}setHeader(e,t){return this.headers=new Headers(this.headers),this.headers.set(e,t),this}retry(e){return this.retryEnabled=e,this}then(e,t){var n=this;if(this.schema===void 0||([`GET`,`HEAD`].includes(this.method)?this.headers.set(`Accept-Profile`,this.schema):this.headers.set(`Content-Profile`,this.schema)),this.method!==`GET`&&this.method!==`HEAD`&&this.headers.set(`Content-Type`,`application/json`),this.shouldStripNulls){let e=this.headers.get(`Accept`);e===`application/vnd.pgrst.object+json`?this.headers.set(`Accept`,`application/vnd.pgrst.object+json;nulls=stripped`):(!e||e===`application/json`)&&this.headers.set(`Accept`,`application/vnd.pgrst.array+json;nulls=stripped`)}let r=this.fetch,i=(async()=>{let e=0;for(;;){let t={};n.headers.forEach((e,n)=>{t[n]=e}),e>0&&(t[`X-Retry-Count`]=String(e));let i;try{i=await r(n.url.toString(),{method:n.method,headers:t,body:JSON.stringify(n.body,(e,t)=>typeof t==`bigint`?t.toString():t),signal:n.signal})}catch(t){if(t?.name===`AbortError`||t?.code===`ABORT_ERR`||!xr.includes(n.method))throw t;if(n.retryEnabled&&e<vr){let t=yr(e);e++,await Cr(t,n.signal);continue}throw t}if(wr(n.method,i.status,e,n.retryEnabled)){let t=i.headers?.get(`Retry-After`)??null,r=t===null?yr(e):Math.max(0,parseInt(t,10)||0)*1e3;await i.text(),e++,await Cr(r,n.signal);continue}return await n.processResponse(i)}})();return this.shouldThrowOnError||(i=i.catch(e=>{let t=``,n=``,r=``,i=e?.cause;if(i){let n=i?.message??``,r=i?.code??``;t=`${e?.name??`FetchError`}: ${e?.message}`,t+=`\n\nCaused by: ${i?.name??`Error`}: ${n}`,r&&(t+=` (${r})`),i?.stack&&(t+=`\n${i.stack}`)}else t=e?.stack??``;let a=this.url.toString().length;return e?.name===`AbortError`||e?.code===`ABORT_ERR`?(r=``,n=`Request was aborted (timeout or manual cancellation)`,a>this.urlLengthLimit&&(n+=`. Note: Your request URL is ${a} characters, which may exceed server limits. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [many IDs])), consider using an RPC function to pass values server-side.`)):(i?.name===`HeadersOverflowError`||i?.code===`UND_ERR_HEADERS_OVERFLOW`)&&(r=``,n=`HTTP headers exceeded server limits (typically 16KB)`,a>this.urlLengthLimit&&(n+=`. Your request URL is ${a} characters. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [200+ IDs])), consider using an RPC function instead.`)),{success:!1,error:{message:`${e?.name??`FetchError`}: ${e?.message}`,details:t,hint:n,code:r},data:null,count:null,status:0,statusText:``}})),i.then(e,t)}async processResponse(e){var t=this;let n=null,r=null,i=null,a=e.status,o=e.statusText;if(e.ok){if(t.method!==`HEAD`){let i=await e.text();if(i!==``)if(t.headers.get(`Accept`)===`text/csv`)r=i;else if(t.headers.get(`Accept`)&&t.headers.get(`Accept`)?.includes(`application/vnd.pgrst.plan+text`))r=i;else try{r=JSON.parse(i)}catch{if(n={message:i},r=null,t.shouldThrowOnError)throw new Sr({message:i,details:``,hint:``,code:``})}}let s=t.headers.get(`Prefer`)?.match(/count=(exact|planned|estimated)/),c=e.headers.get(`content-range`)?.split(`/`);s&&c&&c.length>1&&(i=parseInt(c[1])),t.isMaybeSingle&&Array.isArray(r)&&(r.length>1?(n={code:`PGRST116`,details:`Results contain ${r.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:`JSON object requested, multiple (or no) rows returned`},r=null,i=null,a=406,o=`Not Acceptable`):r=r.length===1?r[0]:null)}else{let i=await e.text();try{n=JSON.parse(i),Array.isArray(n)&&e.status===404&&(r=[],n=null,a=200,o=`OK`)}
vendor: 10,009 bytes, line 11
11catch{e.status===404&&i===``?(a=204,o=`No Content`):n={message:i}}if(n&&t.shouldThrowOnError)throw new Sr(n)}return{success:n===null,error:n,data:r,count:i,status:a,statusText:o}}returns(){return this}overrideTypes(){return this}},Er=class extends Tr{throwOnError(){return super.throwOnError()}select(e){let t=!1,n=(e??`*`).split(``).map(e=>/\s/.test(e)&&!t?``:(e===`"`&&(t=!t),e)).join(``);return this.url.searchParams.set(`select`,n),this.headers.append(`Prefer`,`return=representation`),this}order(e,{ascending:t=!0,nullsFirst:n,foreignTable:r,referencedTable:i=r}={}){let a=i?`${i}.order`:`order`,o=this.url.searchParams.get(a);return this.url.searchParams.set(a,`${o?`${o},`:``}${e}.${t?`asc`:`desc`}${n===void 0?``:n?`.nullsfirst`:`.nullslast`}`),this}limit(e,{foreignTable:t,referencedTable:n=t}={}){let r=n===void 0?`limit`:`${n}.limit`;return this.url.searchParams.set(r,`${e}`),this}range(e,t,{foreignTable:n,referencedTable:r=n}={}){let i=r===void 0?`offset`:`${r}.offset`,a=r===void 0?`limit`:`${r}.limit`;return this.url.searchParams.set(i,`${e}`),this.url.searchParams.set(a,`${t-e+1}`),this}abortSignal(e){return this.signal=e,this}single(){return this.headers.set(`Accept`,`application/vnd.pgrst.object+json`),this}maybeSingle(){return this.isMaybeSingle=!0,this}csv(){return this.headers.set(`Accept`,`text/csv`),this}geojson(){return this.headers.set(`Accept`,`application/geo+json`),this}explain({analyze:e=!1,verbose:t=!1,settings:n=!1,buffers:r=!1,wal:i=!1,format:a=`text`}={}){let o=[e?`analyze`:null,t?`verbose`:null,n?`settings`:null,r?`buffers`:null,i?`wal`:null].filter(Boolean).join(`|`),s=this.headers.get(`Accept`)??`application/json`;return this.headers.set(`Accept`,`application/vnd.pgrst.plan+${a}; for="${s}"; options=${o};`),this}rollback(){return this.headers.append(`Prefer`,`tx=rollback`),this}returns(){return this}maxAffected(e){return this.headers.append(`Prefer`,`handling=strict`),this.headers.append(`Prefer`,`max-affected=${e}`),this}},Dr=RegExp(`[,()]`),Or=class extends Er{throwOnError(){return super.throwOnError()}eq(e,t){return this.url.searchParams.append(e,`eq.${t}`),this}neq(e,t){return this.url.searchParams.append(e,`neq.${t}`),this}gt(e,t){return this.url.searchParams.append(e,`gt.${t}`),this}gte(e,t){return this.url.searchParams.append(e,`gte.${t}`),this}lt(e,t){return this.url.searchParams.append(e,`lt.${t}`),this}lte(e,t){return this.url.searchParams.append(e,`lte.${t}`),this}like(e,t){return this.url.searchParams.append(e,`like.${t}`),this}likeAllOf(e,t){return this.url.searchParams.append(e,`like(all).{${t.join(`,`)}}`),this}likeAnyOf(e,t){return this.url.searchParams.append(e,`like(any).{${t.join(`,`)}}`),this}ilike(e,t){return this.url.searchParams.append(e,`ilike.${t}`),this}ilikeAllOf(e,t){return this.url.searchParams.append(e,`ilike(all).{${t.join(`,`)}}`),this}ilikeAnyOf(e,t){return this.url.searchParams.append(e,`ilike(any).{${t.join(`,`)}}`),this}regexMatch(e,t){return this.url.searchParams.append(e,`match.${t}`),this}regexIMatch(e,t){return this.url.searchParams.append(e,`imatch.${t}`),this}is(e,t){return this.url.searchParams.append(e,`is.${t}`),this}isDistinct(e,t){return this.url.searchParams.append(e,`isdistinct.${t}`),this}in(e,t){let n=Array.from(new Set(t)).map(e=>typeof e==`string`&&Dr.test(e)?`"${e}"`:`${e}`).join(`,`);return this.url.searchParams.append(e,`in.(${n})`),this}notIn(e,t){let n=Array.from(new Set(t)).map(e=>typeof e==`string`&&Dr.test(e)?`"${e}"`:`${e}`).join(`,`);return this.url.searchParams.append(e,`not.in.(${n})`),this}contains(e,t){return typeof t==`string`?this.url.searchParams.append(e,`cs.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cs.{${t.join(`,`)}}`):this.url.searchParams.append(e,`cs.${JSON.stringify(t)}`),this}containedBy(e,t){return typeof t==`string`?this.url.searchParams.append(e,`cd.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cd.{${t.join(`,`)}}`):this.url.searchParams.append(e,`cd.${JSON.stringify(t)}`),this}rangeGt(e,t){return this.url.searchParams.append(e,`sr.${t}`),this}rangeGte(e,t){return this.url.searchParams.append(e,`nxl.${t}`),this}rangeLt(e,t){return this.url.searchParams.append(e,`sl.${t}`),this}rangeLte(e,t){return this.url.searchParams.append(e,`nxr.${t}`),this}rangeAdjacent(e,t){return this.url.searchParams.append(e,`adj.${t}`),this}overlaps(e,t){return typeof t==`string`?this.url.searchParams.append(e,`ov.${t}`):this.url.searchParams.append(e,`ov.{${t.join(`,`)}}`),this}textSearch(e,t,{config:n,type:r}={}){let i=``;r===`plain`?i=`pl`:r===`phrase`?i=`ph`:r===`websearch`&&(i=`w`);let a=n===void 0?``:`(${n})`;return this.url.searchParams.append(e,`${i}fts${a}.${t}`),this}match(e){return Object.entries(e).filter(([e,t])=>t!==void 0).forEach(([e,t])=>{this.url.searchParams.append(e,`eq.${t}`)}),this}not(e,t,n){return this.url.searchParams.append(e,`not.${t}.${n}`),this}or(e,{foreignTable:t,referencedTable:n=t}={}){let r=n?`${n}.or`:`or`;return this.url.searchParams.append(r,`(${e})`),this}filter(e,t,n){return this.url.searchParams.append(e,`${t}.${n}`),this}},kr=class{constructor(e,{headers:t={},schema:n,fetch:r,urlLengthLimit:i=8e3,retry:a}){this.url=e,this.headers=new Headers(t),this.schema=n,this.fetch=r,this.urlLengthLimit=i,this.retry=a}cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(e,t){let{head:n=!1,count:r}=t??{},i=n?`HEAD`:`GET`,a=!1,o=(e??`*`).split(``).map(e=>/\s/.test(e)&&!a?``:(e===`"`&&(a=!a),e)).join(``),{url:s,headers:c}=this.cloneRequestState();return s.searchParams.set(`select`,o),r&&c.append(`Prefer`,`count=${r}`),new Or({method:i,url:s,headers:c,schema:this.schema,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}insert(e,{count:t,defaultToNull:n=!0}={}){let{url:r,headers:i}=this.cloneRequestState();if(t&&i.append(`Prefer`,`count=${t}`),n||i.append(`Prefer`,`missing=default`),Array.isArray(e)){let t=e.reduce((e,t)=>e.concat(Object.keys(t)),[]);if(t.length>0){let e=[...new Set(t)].map(e=>`"${e}"`);r.searchParams.set(`columns`,e.join(`,`))}}return new Or({method:`POST`,url:r,headers:i,schema:this.schema,body:e,fetch:this.fetch??fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}upsert(e,{onConflict:t,ignoreDuplicates:n=!1,count:r,defaultToNull:i=!0}={}){let{url:a,headers:o}=this.cloneRequestState();if(o.append(`Prefer`,`resolution=${n?`ignore`:`merge`}-duplicates`),t!==void 0&&a.searchParams.set(`on_conflict`,t),r&&o.append(`Prefer`,`count=${r}`),i||o.append(`Prefer`,`missing=default`),Array.isArray(e)){let t=e.reduce((e,t)=>e.concat(Object.keys(t)),[]);if(t.length>0){let e=[...new Set(t)].map(e=>`"${e}"`);a.searchParams.set(`columns`,e.join(`,`))}}return new Or({method:`POST`,url:a,headers:o,schema:this.schema,body:e,fetch:this.fetch??fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}update(e,{count:t}={}){let{url:n,headers:r}=this.cloneRequestState();return t&&r.append(`Prefer`,`count=${t}`),new Or({method:`PATCH`,url:n,headers:r,schema:this.schema,body:e,fetch:this.fetch??fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}delete({count:e}={}){let{url:t,headers:n}=this.cloneRequestState();return e&&n.append(`Prefer`,`count=${e}`),new Or({method:`DELETE`,url:t,headers:n,schema:this.schema,fetch:this.fetch??fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};function Ar(e){"@babel/helpers - typeof";return Ar=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Ar(e)}function jr(e,t){if(Ar(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(Ar(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Mr(e){var t=jr(e,`string`);return Ar(t)==`symbol`?t:t+``}function Nr(e,t,n){return(t=Mr(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Pr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Fr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Pr(Object(n),!0).forEach(function(t){Nr(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Pr(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Ir=class e{constructor(e,{headers:t={},schema:n,fetch:r,timeout:i,urlLengthLimit:a=8e3,retry:o}={}){this.url=e,this.headers=new Headers(t),this.schemaName=n,this.urlLengthLimit=a;let s=r??globalThis.fetch;i!==void 0&&i>0?this.fetch=(e,t)=>{let n=new AbortController,r=setTimeout(()=>n.abort(),i),a=t?.signal;if(a){if(a.aborted)return clearTimeout(r),s(e,t);let i=()=>{clearTimeout(r),n.abort()};return a.addEventListener(`abort`,i,{once:!0}),s(e,Fr(Fr({},t),{},{signal:n.signal})).finally(()=>{clearTimeout(r),a.removeEventListener(`abort`,i)})}return s(e,Fr(Fr({},t),{},{signal:n.signal})).finally(()=>clearTimeout(r))}:this.fetch=s,this.retry=o}from(e){if(!e||typeof e!=`string`||e.trim()===``)throw Error(`Invalid relation name: relation must be a non-empty string.`);return new kr(new URL(`${this.url}/${e}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}schema(t){return new e(this.url,{headers:this.headers,schema:t,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}rpc(e,t={},{head:n=!1,get:r=!1,count:i}={}){let a,o=new URL(`${this.url}/rpc/${e}`),s,c=e=>typeof e==`object`&&!!e&&(!Array.isArray(e)||e.some(c)),l=n&&Object.values(t).some(c);l?(a=`POST`,s=t):n||r?(a=n?`HEAD`:`GET`,Object.entries(t).filter(([e,t])=>t!==void 0).map(([e,t])=>[e,Array.isArray(t)?`{${t.join(`,`)}}`:`${t}
11`]).forEach(([e,t])=>{o.searchParams.append(e,t)})):(a=`POST`,s=t);let u=new Headers(this.headers);return l?u.set(`Prefer`,i?`count=${i},return=minimal`:`return=minimal`):i&&u.set(`Prefer`,`count=${i}`),new Or({method:a,url:o,headers:u,schema:this.schemaName,body:s,fetch:this.fetch??fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}},Lr=class{constructor(){}static detectEnvironment(){if(typeof WebSocket<`u`)return{type:`native`,wsConstructor:WebSocket};let e=globalThis;if(typeof globalThis<`u`&&e.WebSocket!==void 0)return{type:`native`,wsConstructor:e.WebSocket};let t=typeof global<`u`?global:void 0;if(t&&t.WebSocket!==void 0)return{type:`native`,wsConstructor:t.WebSocket};if(typeof globalThis<`u`&&e.WebSocketPair!==void 0&&globalThis.WebSocket===void 0)return{type:`cloudflare`,error:`Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.`,workaround:`Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime.`};if(typeof globalThis<`u`&&e.EdgeRuntime||typeof navigator<`u`&&navigator.userAgent?.includes(`Vercel-Edge`))return{type:`unsupported`,error:`Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.`,workaround:`Use serverless functions or a different deployment target for WebSocket functionality.`};let n=globalThis.process;if(n){let e=n.versions;if(e&&e.node){let t=e.node,n=parseInt(t.replace(/^v/,``).split(`.`)[0]);return n>=22?globalThis.WebSocket===void 0?{type:`unsupported`,error:`Node.js ${n} detected but native WebSocket not found.`,workaround:`Provide a WebSocket implementation via the transport option.`}:{type:`native`,wsConstructor:globalThis.WebSocket}:{type:`unsupported`,error:`Node.js ${n} detected without native WebSocket support.`,workaround:`For Node.js < 22, install "ws" package and provide it via the transport option: 12import ws from "ws" 13new RealtimeClient(url, { transport: ws })`}}}return{type:`unsupported`,error:`Unknown JavaScript runtime without WebSocket support.`,workaround:`Ensure you're running in a supported environment (browser, Node.js, Deno) or provide a custom WebSocket implementation.`}}static getWebSocketConstructor(){let e=this.detectEnvironment();if(e.wsConstructor)return e.wsConstructor;let t=e.error||`WebSocket not supported in this environment.`;throw e.workaround&&(t+=`\n\nSuggested solution: ${e.workaround}`),Error(t)}static isWebSocketSupported(){try{let e=this.detectEnvironment();return e.type===`native`||e.type===`ws`}catch{return!1}}},Rr=`realtime-js/2.108.2`,zr=`1.0.0`,Br=`2.0.0`,Vr=Br,Hr=1e4,Ur={closed:`closed`,errored:`errored`,joined:`joined`,joining:`joining`,leaving:`leaving`},Wr={close:`phx_close`,error:`phx_error`,join:`phx_join`,reply:`phx_reply`,leave:`phx_leave`,access_token:`access_token`},Gr={connecting:`connecting`,open:`open`,closing:`closing`,closed:`closed`},Kr=class{constructor(e){this.HEADER_LENGTH=1,this.USER_BROADCAST_PUSH_META_LENGTH=6,this.KINDS={userBroadcastPush:3,userBroadcast:4},this.BINARY_ENCODING=0,this.JSON_ENCODING=1,this.BROADCAST_EVENT=`broadcast`,this.allowedMetadataKeys=[],this.allowedMetadataKeys=e??[]}encode(e,t){if(e.event===this.BROADCAST_EVENT&&!(e.payload instanceof ArrayBuffer)&&typeof e.payload.event==`string`)return t(this._binaryEncodeUserBroadcastPush(e));let n=[e.join_ref,e.ref,e.topic,e.event,e.payload];return t(JSON.stringify(n))}_binaryEncodeUserBroadcastPush(e){return this._isArrayBuffer(e.payload?.payload)?this._encodeBinaryUserBroadcastPush(e):this._encodeJsonUserBroadcastPush(e)}_encodeBinaryUserBroadcastPush(e){let t=e.payload?.payload??new ArrayBuffer(0);return this._encodeUserBroadcastPush(e,this.BINARY_ENCODING,t)}_encodeJsonUserBroadcastPush(e){let t=e.payload?.payload??{},n=new TextEncoder().encode(JSON.stringify(t)).buffer;return this._encodeUserBroadcastPush(e,this.JSON_ENCODING,n)}_encodeUserBroadcastPush(e,t,n){let r=e.topic,i=e.ref??``,a=e.join_ref??``,o=e.payload.event,s=this.allowedMetadataKeys?this._pick(e.payload,this.allowedMetadataKeys):{},c=Object.keys(s).length===0?``:JSON.stringify(s);if(a.length>255)throw Error(`joinRef length ${a.length} exceeds maximum of 255`);if(i.length>255)throw Error(`ref length ${i.length} exceeds maximum of 255`);if(r.length>255)throw Error(`topic length ${r.length} exceeds maximum of 255`);if(o.length>255)throw Error(`userEvent length ${o.length} exceeds maximum of 255`);if(c.length>255)throw Error(`metadata length ${c.length} exceeds maximum of 255`);let l=this.USER_BROADCAST_PUSH_META_LENGTH+a.length+i.length+r.length+o.length+c.length,u=new ArrayBuffer(this.HEADER_LENGTH+l),d=new DataView(u),f=0;d.setUint8(f++,this.KINDS.userBroadcastPush),d.setUint8(f++,a.length),d.setUint8(f++,i.length),d.setUint8(f++,r.length),d.setUint8(f++,o.length),d.setUint8(f++,c.length),d.setUint8(f++,t),Array.from(a,e=>d.setUint8(f++,e.charCodeAt(0))),Array.from(i,e=>d.setUint8(f++,e.charCodeAt(0))),Array.from(r,e=>d.setUint8(f++,e.charCodeAt(0))),Array.from(o,e=>d.setUint8(f++,e.charCodeAt(0))),Array.from(c,e=>d.setUint8(f++,e.charCodeAt(0)));var p=new Uint8Array(u.byteLength+n.byteLength);return p.set(new Uint8Array(u),0),p.set(new Uint8Array(n),u.byteLength),p.buffer}decode(e,t){if(this._isArrayBuffer(e))return t(this._binaryDecode(e));if(typeof e==`string`){let[n,r,i,a,o]=JSON.parse(e);return t({join_ref:n,ref:r,topic:i,event:a,payload:o})}return t({})}_binaryDecode(e){let t=new DataView(e),n=t.getUint8(0),r=new TextDecoder;switch(n){case this.KINDS.userBroadcast:return this._decodeUserBroadcast(e,t,r)}}_decodeUserBroadcast(e,t,n){let r=t.getUint8(1),i=t.getUint8(2),a=t.getUint8(3),o=t.getUint8(4),s=this.HEADER_LENGTH+4,c=n.decode(e.slice(s,s+r));s+=r;let l=n.decode(e.slice(s,s+i));s+=i;let u=n.decode(e.slice(s,s+a));s+=a;let d=e.slice(s,e.byteLength),f=o===this.JSON_ENCODING?JSON.parse(n.decode(d)):d,p={type:this.BROADCAST_EVENT,event:l,payload:f};return a>0&&(p.meta=JSON.parse(u)),{join_ref:null,ref:null,topic:c,event:this.BROADCAST_EVENT,payload:p}}_isArrayBuffer(e){return e instanceof ArrayBuffer||e?.constructor?.name===`ArrayBuffer`}_pick(e,t){return!e||typeof e!=`object`?{}:Object.fromEntries(Object.entries(e).filter(([e])=>t.includes(e)))}},qr;(function(e){e.abstime=`abstime`,e.bool=`bool`,e.date=`date`,e.daterange=`daterange`,e.float4=`float4`,e.float8=`float8`,e.int2=`int2`,e.int4=`int4`,e.int4range=`int4range`,e.int8=`int8`,e.int8range=`int8range`,e.json=`json`,e.jsonb=`jsonb`,e.money=`money`,e.numeric=`numeric`,e.oid=`oid`,e.reltime=`reltime`,e.text=`text`,e.time=`time`,e.timestamp=`timestamp`,e.timestamptz=`timestamptz`,e.timetz=`timetz`,e.tsrange=`tsrange`,e.tstzrange=`tstzrange`})(qr||={});var Jr=(e,t,n={})=>{let r=n.skipTypes??[];return t?Object.keys(t).reduce((n,i)=>(n[i]=Yr(i,e,t,r),n),{}):{}},Yr=(e,t,n,r)=>{let i=t.find(t=>t.name===e)?.type,a=n[e];return i&&!r.includes(i)?Xr(i,a):Zr(a)},Xr=(e,t)=>
vendor: 10,596 bytes, line 13
13{if(e.charAt(0)===`_`)return ti(t,e.slice(1,e.length));switch(e){case qr.bool:return Qr(t);case qr.float4:case qr.float8:case qr.int2:case qr.int4:case qr.int8:case qr.numeric:case qr.oid:return $r(t);case qr.json:case qr.jsonb:return ei(t);case qr.timestamp:return ni(t);case qr.abstime:case qr.date:case qr.daterange:case qr.int4range:case qr.int8range:case qr.money:case qr.reltime:case qr.text:case qr.time:case qr.timestamptz:case qr.timetz:case qr.tsrange:case qr.tstzrange:return Zr(t);default:return Zr(t)}},Zr=e=>e,Qr=e=>{switch(e){case`t`:return!0;case`f`:return!1;default:return e}},$r=e=>{if(typeof e==`string`){let t=parseFloat(e);if(!Number.isNaN(t))return t}return e},ei=e=>{if(typeof e==`string`)try{return JSON.parse(e)}catch{return e}return e},ti=(e,t)=>{if(typeof e!=`string`)return e;let n=e.length-1,r=e[n];if(e[0]===`{`&&r===`}`){let r,i=e.slice(1,n);try{r=JSON.parse(`[`+i+`]`)}catch{r=i?i.split(`,`):[]}return r.map(e=>Xr(t,e))}return e},ni=e=>typeof e==`string`?e.replace(` `,`T`):e,ri=e=>{let t=new URL(e);return t.protocol=t.protocol.replace(/^ws/i,`http`),t.pathname=t.pathname.replace(/\/+$/,``).replace(/\/socket\/websocket$/i,``).replace(/\/socket$/i,``).replace(/\/websocket$/i,``),t.pathname===``||t.pathname===`/`?t.pathname=`/api/broadcast`:t.pathname+=`/api/broadcast`,t.href},ii=e=>typeof e==`function`?e:function(){return e},ai=typeof self<`u`?self:null,oi=typeof window<`u`?window:null,si=ai||oi||globalThis,ci=`2.0.0`,li=1e4,ui=1e3,di={connecting:0,open:1,closing:2,closed:3},fi={closed:`closed`,errored:`errored`,joined:`joined`,joining:`joining`,leaving:`leaving`},pi={close:`phx_close`,error:`phx_error`,join:`phx_join`,reply:`phx_reply`,leave:`phx_leave`},mi={longpoll:`longpoll`,websocket:`websocket`},hi={complete:4},gi=`base64url.bearer.phx.`,_i=class{constructor(e,t,n,r){this.channel=e,this.event=t,this.payload=n||function(){return{}},this.receivedResp=null,this.timeout=r,this.timeoutTimer=null,this.recHooks=[],this.sent=!1,this.ref=void 0}resend(e){this.timeout=e,this.reset(),this.send()}send(){this.hasReceived(`timeout`)||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload(),ref:this.ref,join_ref:this.channel.joinRef()}))}receive(e,t){return this.hasReceived(e)&&t(this.receivedResp.response),this.recHooks.push({status:e,callback:t}),this}reset(){this.cancelRefEvent(),this.ref=null,this.refEvent=null,this.receivedResp=null,this.sent=!1}destroy(){this.cancelRefEvent(),this.cancelTimeout()}matchReceive({status:e,response:t,_ref:n}){this.recHooks.filter(t=>t.status===e).forEach(e=>e.callback(t))}cancelRefEvent(){this.refEvent&&this.channel.off(this.refEvent)}cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=null}startTimeout(){this.timeoutTimer&&this.cancelTimeout(),this.ref=this.channel.socket.makeRef(),this.refEvent=this.channel.replyEventName(this.ref),this.channel.on(this.refEvent,e=>{this.cancelRefEvent(),this.cancelTimeout(),this.receivedResp=e,this.matchReceive(e)}),this.timeoutTimer=setTimeout(()=>{this.trigger(`timeout`,{})},this.timeout)}hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}trigger(e,t){this.channel.trigger(this.refEvent,{status:e,response:t})}},vi=class{constructor(e,t){this.callback=e,this.timerCalc=t,this.timer=void 0,this.tries=0}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries+=1,this.callback()},this.timerCalc(this.tries+1))}},yi=class{constructor(e,t,n){this.state=fi.closed,this.topic=e,this.params=ii(t||{}),this.socket=n,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new _i(this,pi.join,this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new vi(()=>{this.socket.isConnected()&&this.rejoin()},this.socket.rejoinAfterMs),this.stateChangeRefs.push(this.socket.onError(()=>this.rejoinTimer.reset())),this.stateChangeRefs.push(this.socket.onOpen(()=>{this.rejoinTimer.reset(),this.isErrored()&&this.rejoin()})),this.joinPush.receive(`ok`,()=>{this.state=fi.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(e=>e.send()),this.pushBuffer=[]}),this.joinPush.receive(`error`,e=>{this.state=fi.errored,this.socket.hasLogger()&&this.socket.log(`channel`,`error ${this.topic}`,e),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.onClose(()=>{this.rejoinTimer.reset(),this.socket.hasLogger()&&this.socket.log(`channel`,`close ${this.topic}`),this.state=fi.closed,this.socket.remove(this)}),this.onError(e=>{this.socket.hasLogger()&&this.socket.log(`channel`,`error ${this.topic}`,e),this.isJoining()&&this.joinPush.reset(),this.state=fi.errored,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.joinPush.receive(`timeout`,()=>{this.socket.hasLogger()&&this.socket.log(`channel`,`timeout ${this.topic}`,this.joinPush.timeout),new _i(this,pi.leave,ii({}),this.timeout).send(),this.state=fi.errored,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.on(pi.reply,(e,t)=>{this.trigger(this.replyEventName(t),e)})}join(e=this.timeout){if(this.joinedOnce)throw Error(`tried to join multiple times. 'join' can only be called a single time per channel instance`);return this.timeout=e,this.joinedOnce=!0,this.rejoin(),this.joinPush}teardown(){this.pushBuffer.forEach(e=>e.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=fi.closed,this.bindings=[]}onClose(e){this.on(pi.close,e)}onError(e){return this.on(pi.error,t=>e(t))}on(e,t){let n=this.bindingRef++;return this.bindings.push({event:e,ref:n,callback:t}),n}off(e,t){this.bindings=this.bindings.filter(n=>!(n.event===e&&(t===void 0||t===n.ref)))}canPush(){return this.socket.isConnected()&&this.isJoined()}push(e,t,n=this.timeout){if(t||={},!this.joinedOnce)throw Error(`tried to push '${e}' to '${this.topic}' before joining. Use channel.join() before pushing events`);let r=new _i(this,e,function(){return t},n);return this.canPush()?r.send():(r.startTimeout(),this.pushBuffer.push(r)),r}leave(e=this.timeout){this.rejoinTimer.reset(),this.joinPush.cancelTimeout(),this.state=fi.leaving;let t=()=>{this.socket.hasLogger()&&this.socket.log(`channel`,`leave ${this.topic}`),this.trigger(pi.close,`leave`)},n=new _i(this,pi.leave,ii({}),e);return n.receive(`ok`,()=>t()).receive(`timeout`,()=>t()),n.send(),this.canPush()||n.trigger(`ok`,{}),n}onMessage(e,t,n){return t}filterBindings(e,t,n){return!0}isMember(e,t,n,r){return this.topic===e?r&&r!==this.joinRef()?(this.socket.hasLogger()&&this.socket.log(`channel`,`dropping outdated message`,{topic:e,event:t,payload:n,joinRef:r}),!1):!0:!1}joinRef(){return this.joinPush.ref}rejoin(e=this.timeout){this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=fi.joining,this.joinPush.resend(e))}trigger(e,t,n,r){let i=this.onMessage(e,t,n,r);if(t&&!i)throw Error(`channel onMessage callbacks must return the payload, modified or unmodified`);let a=this.bindings.filter(r=>r.event===e&&this.filterBindings(r,t,n));for(let e=0;e<a.length;e++)a[e].callback(i,n,r||this.joinRef())}replyEventName(e){return`chan_reply_${e}`}isClosed(){return this.state===fi.closed}isErrored(){return this.state===fi.errored}isJoined(){return this.state===fi.joined}isJoining(){return this.state===fi.joining}isLeaving(){return this.state===fi.leaving}},bi=class{static request(e,t,n,r,i,a,o){if(si.XDomainRequest){let n=new si.XDomainRequest;return this.xdomainRequest(n,e,t,r,i,a,o)}else if(si.XMLHttpRequest){let s=new si.XMLHttpRequest;return this.xhrRequest(s,e,t,n,r,i,a,o)}else if(si.fetch&&si.AbortController)return this.fetchRequest(e,t,n,r,i,a,o);else throw Error(`No suitable XMLHttpRequest implementation found`)}static fetchRequest(e,t,n,r,i,a,o){let s={method:e,headers:n,body:r},c=null;return i&&(c=new AbortController,setTimeout(()=>c.abort(),i),s.signal=c.signal),si.fetch(t,s).then(e=>e.text()).then(e=>this.parseJSON(e)).then(e=>o&&o(e)).catch(e=>{e.name===`AbortError`&&a?a():o&&o(null)}),c}static xdomainRequest(e,t,n,r,i,a,o){return e.timeout=i,e.open(t,n),e.onload=()=>{let t=this.parseJSON(e.responseText);o&&o(t)},a&&(e.ontimeout=a),e.onprogress=()=>{},e.send(r),e}static xhrRequest(e,t,n,r,i,a,o,s){e.open(t,n,!0),e.timeout=a;for(let[t,n]of Object.entries(r))e.setRequestHeader(t,n);return e.onerror=()=>s&&s(null),e.onreadystatechange=()=>{e.readyState===hi.complete&&s&&s(this.parseJSON(e.responseText))},o&&(e.ontimeout=o),e.send(i),e}static parseJSON(e){if(!e||e===``)return null;try{return JSON.parse(e)}catch{return console&&console.log(`failed to parse JSON response`,e),null}}static serialize(e,t){let n=[];for(var r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;let i=t?`${t}[${r}]`:r,a=e[r];typeof a==`object`?n.push(this.serialize(a,i)):n.push(encodeURIComponent(i)+`=`+encodeURIComponent(a))}return n.join(`&`)}static appendParams(e,t){return Object.keys(t).length===0?e:`${e}${e.match(/\?/)?`&`:`?`}${this.serialize(t)}`}},xi=e=>{let t=``,n=new Uint8Array(e),r=n.byteLength;for(let e=0;e<r;e++)t+=String.fromCharCode(n[e]);return btoa(t)},Si=class{constructor(e,t){t&&t.length===2&&t[1].startsWith(gi)&&(this.authToken=atob(t[1].slice(gi.length))),this.endPoint=null,this.token=null,this.skipHeartbeat=!0,this.reqs=new Set,this.awaitingBatchAck=!1,this.currentBatch=null,this.currentBatchTimer=null,this.batchBuffer=[],this.onopen=function(){},this.onerror=function(){},this.onmessage=function(){},this.onclose=function(){},this.pollEndpoint=this.normalizeEndpoint(e),this.readyState=di.connecting,setTimeout(()=>this.poll(),0)}normalizeEndpoint(e){return e.replace(`ws://`,`http://`).replace(`wss://`,`https://`).replace(RegExp(`(.*)/`+mi.websocket),`$1/`+mi.longpoll)}endpointURL(){return bi.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(e,t,n){this.close(e,t,n),this.readyState=di.connecting}ontimeout(){this.onerror(`timeout`),this.closeAndRetry(1005,`timeout`,!1)}isActive(){return this.readyState===di.open||this.readyState===di.connecting}poll(){let e={Accept:`application/json`};this.authToken&&(e[`X-Phoenix-AuthToken`]=this.authToken),this.ajax(`GET`,e,null,()=>this.ontimeout(),e=>{if(e){var{status:t,token:n,messages:r}=e;if(t===410&&this.token!==null){this.onerror(410),this.closeAndRetry(3410,`session_gone`,!1);return}this.token=n}else t=0;switch(t){case 200:r.forEach(e=>{setTimeout(()=>this.onmessage({data:e}),0)}),this.poll();break;case 204:this.poll();break;case 410:this.readyState=di.open,this.onopen({}),this.poll();break;
13case 403:this.onerror(403),this.close(1008,`forbidden`,!1);break;case 0:case 500:this.onerror(500),this.closeAndRetry(1011,`internal server error`,500);break;default:throw Error(`unhandled poll status ${t}`)}})}send(e){typeof e!=`string`&&(e=xi(e)),this.currentBatch?this.currentBatch.push(e):this.awaitingBatchAck?this.batchBuffer.push(e):(this.currentBatch=[e],this.currentBatchTimer=setTimeout(()=>{this.batchSend(this.currentBatch),this.currentBatch=null},0))}batchSend(e){this.awaitingBatchAck=!0,this.ajax(`POST`,{"Content-Type":`application/x-ndjson`},e.join(` 14`),()=>this.onerror(`timeout`),e=>{this.awaitingBatchAck=!1,!e||e.status!==200?(this.onerror(e&&e.status),this.closeAndRetry(1011,`internal server error`,!1)):this.batchBuffer.length>0&&(this.batchSend(this.batchBuffer),this.batchBuffer=[])})}close(e,t,n){for(let e of this.reqs)e.abort();this.readyState=di.closed;let r=Object.assign({code:1e3,reason:void 0,wasClean:!0},{code:e,reason:t,wasClean:n});this.batchBuffer=[],clearTimeout(this.currentBatchTimer),this.currentBatchTimer=null,typeof CloseEvent<`u`?this.onclose(new CloseEvent(`close`,r)):this.onclose(r)}ajax(e,t,n,r,i){let a;a=bi.request(e,this.endpointURL(),t,n,this.timeout,()=>{this.reqs.delete(a),r()},e=>{this.reqs.delete(a),this.isActive()&&i(e)}),this.reqs.add(a)}},Ci=class e{constructor(t,n={}){let r=n.events||{state:`presence_state`,diff:`presence_diff`};this.state={},this.pendingDiffs=[],this.channel=t,this.joinRef=null,this.caller={onJoin:function(){},onLeave:function(){},onSync:function(){}},this.channel.on(r.state,t=>{let{onJoin:n,onLeave:r,onSync:i}=this.caller;this.joinRef=this.channel.joinRef(),this.state=e.syncState(this.state,t,n,r),this.pendingDiffs.forEach(t=>{this.state=e.syncDiff(this.state,t,n,r)}),this.pendingDiffs=[],i()}),this.channel.on(r.diff,t=>{let{onJoin:n,onLeave:r,onSync:i}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(t):(this.state=e.syncDiff(this.state,t,n,r),i())})}onJoin(e){this.caller.onJoin=e}onLeave(e){this.caller.onLeave=e}onSync(e){this.caller.onSync=e}list(t){return e.list(this.state,t)}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel.joinRef()}static syncState(e,t,n,r){let i=this.clone(e),a={},o={};return this.map(i,(e,n)=>{t[e]||(o[e]=n)}),this.map(t,(e,t)=>{let n=i[e];if(n){let r=t.metas.map(e=>e.phx_ref),i=n.metas.map(e=>e.phx_ref),s=t.metas.filter(e=>i.indexOf(e.phx_ref)<0),c=n.metas.filter(e=>r.indexOf(e.phx_ref)<0);s.length>0&&(a[e]=t,a[e].metas=s),c.length>0&&(o[e]=this.clone(n),o[e].metas=c)}else a[e]=t}),this.syncDiff(i,{joins:a,leaves:o},n,r)}static syncDiff(e,t,n,r){let{joins:i,leaves:a}=this.clone(t);return n||=function(){},r||=function(){},this.map(i,(t,r)=>{let i=e[t];if(e[t]=this.clone(r),i){let n=e[t].metas.map(e=>e.phx_ref),r=i.metas.filter(e=>n.indexOf(e.phx_ref)<0);e[t].metas.unshift(...r)}n(t,i,r)}),this.map(a,(t,n)=>{let i=e[t];if(!i)return;let a=n.metas.map(e=>e.phx_ref);i.metas=i.metas.filter(e=>a.indexOf(e.phx_ref)<0),r(t,i,n),i.metas.length===0&&delete e[t]}),e}static list(e,t){return t||=function(e,t){return t},this.map(e,(e,n)=>t(e,n))}static map(e,t){return Object.getOwnPropertyNames(e).map(n=>t(n,e[n]))}static clone(e){return JSON.parse(JSON.stringify(e))}},wi={HEADER_LENGTH:1,META_LENGTH:4,KINDS:{push:0,reply:1,broadcast:2},encode(e,t){if(e.payload.constructor===ArrayBuffer)return t(this.binaryEncode(e));{let n=[e.join_ref,e.ref,e.topic,e.event,e.payload];return t(JSON.stringify(n))}},decode(e,t){if(e.constructor===ArrayBuffer)return t(this.binaryDecode(e));{let[n,r,i,a,o]=JSON.parse(e);return t({join_ref:n,ref:r,topic:i,event:a,payload:o})}},binaryEncode(e){let{join_ref:t,ref:n,event:r,topic:i,payload:a}=e,o=this.META_LENGTH+t.length+n.length+i.length+r.length,s=new ArrayBuffer(this.HEADER_LENGTH+o),c=new DataView(s),l=0;c.setUint8(l++,this.KINDS.push),c.setUint8(l++,t.length),c.setUint8(l++,n.length),c.setUint8(l++,i.length),c.setUint8(l++,r.length),Array.from(t,e=>c.setUint8(l++,e.charCodeAt(0))),Array.from(n,e=>c.setUint8(l++,e.charCodeAt(0))),Array.from(i,e=>c.setUint8(l++,e.charCodeAt(0))),Array.from(r,e=>c.setUint8(l++,e.charCodeAt(0)));var u=new Uint8Array(s.byteLength+a.byteLength);return u.set(new Uint8Array(s),0),u.set(new Uint8Array(a),s.byteLength),u.buffer},binaryDecode(e){let t=new DataView(e),n=t.getUint8(0),r=new TextDecoder;switch(n){case this.KINDS.push:return this.decodePush(e,t,r);case this.KINDS.reply:return this.decodeReply(e,t,r);case this.KINDS.broadcast:return this.decodeBroadcast(e,t,r)}}
vendor: 12,506 bytes, line 14
14,decodePush(e,t,n){let r=t.getUint8(1),i=t.getUint8(2),a=t.getUint8(3),o=this.HEADER_LENGTH+this.META_LENGTH-1,s=n.decode(e.slice(o,o+r));o+=r;let c=n.decode(e.slice(o,o+i));o+=i;let l=n.decode(e.slice(o,o+a));return o+=a,{join_ref:s,ref:null,topic:c,event:l,payload:e.slice(o,e.byteLength)}},decodeReply(e,t,n){let r=t.getUint8(1),i=t.getUint8(2),a=t.getUint8(3),o=t.getUint8(4),s=this.HEADER_LENGTH+this.META_LENGTH,c=n.decode(e.slice(s,s+r));s+=r;let l=n.decode(e.slice(s,s+i));s+=i;let u=n.decode(e.slice(s,s+a));s+=a;let d=n.decode(e.slice(s,s+o));s+=o;let f={status:d,response:e.slice(s,e.byteLength)};return{join_ref:c,ref:l,topic:u,event:pi.reply,payload:f}},decodeBroadcast(e,t,n){let r=t.getUint8(1),i=t.getUint8(2),a=this.HEADER_LENGTH+2,o=n.decode(e.slice(a,a+r));a+=r;let s=n.decode(e.slice(a,a+i));return a+=i,{join_ref:null,ref:null,topic:o,event:s,payload:e.slice(a,e.byteLength)}}},Ti=class{constructor(e,t={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.fallbackRef=null,this.timeout=t.timeout||li,this.transport=t.transport||si.WebSocket||Si,this.conn=void 0,this.primaryPassedHealthCheck=!1,this.longPollFallbackMs=t.longPollFallbackMs,this.fallbackTimer=null;let n=null;try{n=si&&si.sessionStorage}catch{}this.sessionStore=t.sessionStorage||n,this.establishedConnections=0,this.defaultEncoder=wi.encode.bind(wi),this.defaultDecoder=wi.decode.bind(wi),this.closeWasClean=!0,this.disconnecting=!1,this.binaryType=t.binaryType||`arraybuffer`,this.connectClock=1,this.pageHidden=!1,this.encode=void 0,this.decode=void 0,this.transport===Si?(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder):(this.encode=t.encode||this.defaultEncoder,this.decode=t.decode||this.defaultDecoder);let r=null;oi&&oi.addEventListener&&(oi.addEventListener(`pagehide`,e=>{this.conn&&(this.disconnect(),r=this.connectClock)}),oi.addEventListener(`pageshow`,e=>{r===this.connectClock&&(r=null,this.connect())}),oi.addEventListener(`visibilitychange`,()=>{document.visibilityState===`hidden`?this.pageHidden=!0:(this.pageHidden=!1,!this.isConnected()&&!this.closeWasClean&&this.teardown(()=>this.connect()))})),this.heartbeatIntervalMs=t.heartbeatIntervalMs||3e4,this.autoSendHeartbeat=t.autoSendHeartbeat??!0,this.heartbeatCallback=t.heartbeatCallback??(()=>{}),this.rejoinAfterMs=e=>t.rejoinAfterMs?t.rejoinAfterMs(e):[1e3,2e3,5e3][e-1]||1e4,this.reconnectAfterMs=e=>t.reconnectAfterMs?t.reconnectAfterMs(e):[10,50,100,150,200,250,500,1e3,2e3][e-1]||5e3,this.logger=t.logger||null,!this.logger&&t.debug&&(this.logger=(e,t,n)=>{console.log(`${e}: ${t}`,n)}),this.longpollerTimeout=t.longpollerTimeout||2e4,this.params=ii(t.params||{}),this.endPoint=`${e}/${mi.websocket}`,this.vsn=t.vsn||ci,this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.heartbeatSentAt=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new vi(()=>{if(this.pageHidden){this.log(`Not reconnecting as page is hidden!`),this.teardown();return}this.teardown(async()=>{t.beforeReconnect&&await t.beforeReconnect(),this.connect()})},this.reconnectAfterMs),this.authToken=t.authToken}getLongPollTransport(){return Si}replaceTransport(e){this.connectClock++,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.conn&&=(this.conn.close(),null),this.transport=e}protocol(){return location.protocol.match(/^https/)?`wss`:`ws`}endPointURL(){let e=bi.appendParams(bi.appendParams(this.endPoint,this.params()),{vsn:this.vsn});return e.charAt(0)===`/`?e.charAt(1)===`/`?`${this.protocol()}:${e}`:`${this.protocol()}://${location.host}${e}`:e}disconnect(e,t,n){this.connectClock++,this.disconnecting=!0,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.teardown(()=>{this.disconnecting=!1,e&&e()},t,n)}connect(e){e&&(console&&console.log(`passing params to connect is deprecated. Instead pass :params to the Socket constructor`),this.params=ii(e)),!(this.conn&&!this.disconnecting)&&(this.longPollFallbackMs&&this.transport!==Si?this.connectWithFallback(Si,this.longPollFallbackMs):this.transportConnect())}log(e,t,n){this.logger&&this.logger(e,t,n)}hasLogger(){return this.logger!==null}onOpen(e){let t=this.makeRef();return this.stateChangeCallbacks.open.push([t,e]),t}onClose(e){let t=this.makeRef();return this.stateChangeCallbacks.close.push([t,e]),t}onError(e){let t=this.makeRef();return this.stateChangeCallbacks.error.push([t,e]),t}onMessage(e){let t=this.makeRef();return this.stateChangeCallbacks.message.push([t,e]),t}onHeartbeat(e){this.heartbeatCallback=e}ping(e){if(!this.isConnected())return!1;let t=this.makeRef(),n=Date.now();this.push({topic:`phoenix`,event:`heartbeat`,payload:{},ref:t});let r=this.onMessage(i=>{i.ref===t&&(this.off([r]),e(Date.now()-n))});return!0}transportName(e){switch(e){case Si:return`LongPoll`;default:return e.name}}transportConnect(){this.connectClock++,this.closeWasClean=!1;let e;this.authToken&&(e=[`phoenix`,`${gi}${btoa(this.authToken).replace(/=/g,``)}`]),this.conn=new this.transport(this.endPointURL(),e),this.conn.binaryType=this.binaryType,this.conn.timeout=this.longpollerTimeout,this.conn.onopen=()=>this.onConnOpen(),this.conn.onerror=e=>this.onConnError(e),this.conn.onmessage=e=>this.onConnMessage(e),this.conn.onclose=e=>this.onConnClose(e)}getSession(e){return this.sessionStore&&this.sessionStore.getItem(e)}storeSession(e,t){this.sessionStore&&this.sessionStore.setItem(e,t)}connectWithFallback(e,t=2500){clearTimeout(this.fallbackTimer);let n=!1,r=!0,i,a=this.transportName(e),o=t=>{this.log(`transport`,`falling back to ${a}...`,t),this.off([void 0,i]),r=!1,this.replaceTransport(e),this.transportConnect()};if(this.getSession(`phx:fallback:${a}`))return o(`memorized`);this.fallbackTimer=setTimeout(o,t),i=this.onError(e=>{this.log(`transport`,`error`,e),r&&!n&&(clearTimeout(this.fallbackTimer),o(e))}),this.fallbackRef&&this.off([this.fallbackRef]),this.fallbackRef=this.onOpen(()=>{if(n=!0,!r){let t=this.transportName(e);return this.primaryPassedHealthCheck||this.storeSession(`phx:fallback:${t}`,`true`),this.log(`transport`,`established ${t} fallback`)}clearTimeout(this.fallbackTimer),this.fallbackTimer=setTimeout(o,t),this.ping(e=>{this.log(`transport`,`connected to primary after`,e),this.primaryPassedHealthCheck=!0,clearTimeout(this.fallbackTimer)})}),this.transportConnect()}clearHeartbeats(){clearTimeout(this.heartbeatTimer),clearTimeout(this.heartbeatTimeoutTimer)}onConnOpen(){this.hasLogger()&&this.log(`transport`,`connected to ${this.endPointURL()}`),this.closeWasClean=!1,this.disconnecting=!1,this.establishedConnections++,this.flushSendBuffer(),this.reconnectTimer.reset(),this.autoSendHeartbeat&&this.resetHeartbeat(),this.triggerStateCallbacks(`open`)}heartbeatTimeout(){if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.hasLogger()&&this.log(`transport`,`heartbeat timeout. Attempting to re-establish connection`);try{this.heartbeatCallback(`timeout`)}catch(e){this.log(`error`,`error in heartbeat callback`,e)}this.triggerChanError(Error(`heartbeat timeout`)),this.closeWasClean=!1,this.teardown(()=>this.reconnectTimer.scheduleTimeout(),ui,`heartbeat timeout`)}}resetHeartbeat(){this.conn&&this.conn.skipHeartbeat||(this.pendingHeartbeatRef=null,this.clearHeartbeats(),this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}teardown(e,t,n){if(!this.conn)return e&&e();let r=this.conn;this.waitForBufferDone(r,()=>{t?r.close(t,n||``):r.close(),this.waitForSocketClosed(r,()=>{this.conn===r&&(this.conn.onopen=function(){},this.conn.onerror=function(){},this.conn.onmessage=function(){},this.conn.onclose=function(){},this.conn=null),e&&e()})})}waitForBufferDone(e,t,n=1){if(n===5||!e.bufferedAmount){t();return}setTimeout(()=>{this.waitForBufferDone(e,t,n+1)},150*n)}waitForSocketClosed(e,t,n=1){if(n===5||e.readyState===di.closed){t();return}setTimeout(()=>{this.waitForSocketClosed(e,t,n+1)},150*n)}onConnClose(e){this.conn&&(this.conn.onclose=()=>{}),this.hasLogger()&&this.log(`transport`,`close`,e),this.triggerChanError(e),this.clearHeartbeats(),this.closeWasClean||this.reconnectTimer.scheduleTimeout(),this.triggerStateCallbacks(`close`,e)}onConnError(e){this.hasLogger()&&this.log(`transport`,`error`,e);let t=this.transport,n=this.establishedConnections;this.triggerStateCallbacks(`error`,e,t,n),(t===this.transport||n>0)&&this.triggerChanError(e)}triggerChanError(e){this.channels.forEach(t=>{t.isErrored()||t.isLeaving()||t.isClosed()||t.trigger(pi.error,e)})}connectionState(){switch(this.conn&&this.conn.readyState){case di.connecting:return`connecting`;case di.open:return`open`;case di.closing:return`closing`;default:return`closed`}}isConnected(){return this.connectionState()===`open`}remove(e){this.off(e.stateChangeRefs),this.channels=this.channels.filter(t=>t!==e)}off(e){for(let t in this.stateChangeCallbacks)this.stateChangeCallbacks[t]=this.stateChangeCallbacks[t].filter(([t])=>e.indexOf(t)===-1)}channel(e,t={}){let n=new yi(e,t,this);return this.channels.push(n),n}push(e){if(this.hasLogger()){let{topic:t,event:n,payload:r,ref:i,join_ref:a}=e;this.log(`push`,`${t} ${n} (${a}, ${i})`,r)}this.isConnected()?this.encode(e,e=>this.conn.send(e)):this.sendBuffer.push(()=>this.encode(e,e=>this.conn.send(e)))}makeRef(){let e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}sendHeartbeat(){if(!this.isConnected()){try{this.heartbeatCallback(`disconnected`)}catch(e){this.log(`error`,`error in heartbeat callback`,e)}return}if(this.pendingHeartbeatRef){this.heartbeatTimeout();return}this.pendingHeartbeatRef=this.makeRef(),this.heartbeatSentAt=Date.now(),this.push({topic:`phoenix`,event:`heartbeat`,payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback(`sent`)}catch(e){this.log(`error`,`error in heartbeat callback`,e)}this.heartbeatTimeoutTimer=setTimeout(()=>this.heartbeatTimeout(),this.heartbeatIntervalMs)}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(e=>e()),this.sendBuffer=[])}onConnMessage(e){this.decode(e.data,e=>{let{topic:t,event:n,payload:r,ref:i,join_ref:a}=e;if(i&&i===this.pendingHeartbeatRef){let e=this.heartbeatSentAt?Date.now()-this.heartbeatSentAt:void 0;this.clearHeartbeats();try{this.heartbeatCallback(r.status===`ok`?`ok`:`error`,e)}catch(e){this.log(`error`,`error in heartbeat callback`,e)}this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.autoSendHeartbeat&&(this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}this.hasLogger()&&this.log(`receive`,`${r.status||``} ${t} ${n} ${i&&`(`+i+`)`||``}`.trim(),r);for(let e=0;e<this.channels.length;e++){let o=this.channels[e];o.isMember(t,n,r,a)&&o.trigger(n,r,i,a)}this.triggerStateCallbacks(`message`,e)})}triggerStateCallbacks(e,...t){try{this.stateChangeCallbacks[e].forEach(([n,r])=>{try{r(...t)}catch(t){this.log(`error`,`error in ${e} callback`,t)}})}catch(t){this.log(`error`,`error triggering ${e} callbacks`,t)}}leaveOpenTopic(e){let t=this.channels.find(t=>t.topic===e&&(t.isJoined()||t.isJoining()));t&&(this.hasLogger()&&this.log(`transport`,`leaving duplicate topic "${e}"`),t.leave())}},Ei=class e{constructor(t,n){let r=ki(n);this.presence=new Ci(t.getChannel(),r),this.presence.onJoin((n,r,i)=>{let a=e.onJoinPayload(n,r,i);t.getChannel().trigger(`presence`,a)}),this.presence.onLeave((n,r,i)=>{let a=e.onLeavePayload(n,r,i);t.getChannel().trigger(`presence`,a)}),this.presence.onSync(()=>{t.getChannel().trigger(`presence`,{event:`sync`})})}get state(){return e.transformState(this.presence.state)}static transformState(e){return e=Oi(e),Object.getOwnPropertyNames(e).reduce((t,n)=>{let r=e[n];return t[n]=Di(r),t},{})}static onJoinPayload(e,t,n){return{event:`join`,key:e,currentPresences:Ai(t),newPresences:Di(n)}}static onLeavePayload(e,t,n){return{event:`leave`,key:e,currentPresences:Ai(t),leftPresences:Di(n)}}};function Di(e){return e.metas.map(e=>(e.presence_ref=e.phx_ref,delete e.phx_ref,delete e.phx_ref_prev,e))}function Oi(e){return JSON.parse(JSON.stringify(e))}function ki(e){return e?.events&&{events:e.events}}function Ai(e){return e?.metas?Di(e):[]}var ji;(function(e){e.SYNC=`sync`,e.JOIN=`join`,e.LEAVE=`leave`})(ji||={});var Mi=class{get state(){return this.presenceAdapter.state}constructor(e,t){this.channel=e,this.presenceAdapter=new Ei(this.channel.channelAdapter,t)}};function Ni(e){if(e instanceof Error)return e;if(typeof e==`string`)return Error(e);
14if(e&&typeof e==`object`){let t=e;if(typeof t.code==`number`){let n=typeof t.reason==`string`&&t.reason?` (${t.reason})`:``;return Error(`socket closed: ${t.code}${n}`,{cause:e})}return Error(`channel error: transport failure`,{cause:e})}return Error(`channel error: connection lost`)}var Pi=class{constructor(e,t,n){let r=Fi(n);this.channel=e.getSocket().channel(t,r),this.socket=e}get state(){return this.channel.state}set state(e){this.channel.state=e}get joinedOnce(){return this.channel.joinedOnce}get joinPush(){return this.channel.joinPush}get rejoinTimer(){return this.channel.rejoinTimer}on(e,t){return this.channel.on(e,t)}off(e,t){this.channel.off(e,t)}subscribe(e){return this.channel.join(e)}unsubscribe(e){return this.channel.leave(e)}teardown(){this.channel.teardown()}onClose(e){this.channel.onClose(e)}onError(e){return this.channel.onError(e)}push(e,t,n){let r;try{r=this.channel.push(e,t,n)}catch{throw Error(`tried to push '${e}' to '${this.channel.topic}' before joining. Use channel.subscribe() before pushing events`)}if(this.channel.pushBuffer.length>100){let e=this.channel.pushBuffer.shift();e.cancelTimeout(),this.socket.log(`channel`,`discarded push due to buffer overflow: ${e.event}`,e.payload())}return r}updateJoinPayload(e){let t=this.channel.joinPush.payload();this.channel.joinPush.payload=()=>Object.assign(Object.assign({},t),e)}canPush(){return this.socket.isConnected()&&this.state===Ur.joined}isJoined(){return this.state===Ur.joined}isJoining(){return this.state===Ur.joining}isClosed(){return this.state===Ur.closed}isLeaving(){return this.state===Ur.leaving}updateFilterBindings(e){this.channel.filterBindings=e}updatePayloadTransform(e){this.channel.onMessage=e}getChannel(){return this.channel}};function Fi(e){return{config:Object.assign({broadcast:{ack:!1,self:!1},presence:{key:``,enabled:!1},private:!1},e.config)}}var Ii;(function(e){e.ALL=`*`,e.INSERT=`INSERT`,e.UPDATE=`UPDATE`,e.DELETE=`DELETE`})(Ii||={});var Li;(function(e){e.BROADCAST=`broadcast`,e.PRESENCE=`presence`,e.POSTGRES_CHANGES=`postgres_changes`,e.SYSTEM=`system`})(Li||={});var Ri;(function(e){e.SUBSCRIBED=`SUBSCRIBED`,e.TIMED_OUT=`TIMED_OUT`,e.CLOSED=`CLOSED`,e.CHANNEL_ERROR=`CHANNEL_ERROR`})(Ri||={});var zi=class e{get state(){return this.channelAdapter.state}set state(e){this.channelAdapter.state=e}get joinedOnce(){return this.channelAdapter.joinedOnce}get timeout(){return this.socket.timeout}get joinPush(){return this.channelAdapter.joinPush}get rejoinTimer(){return this.channelAdapter.rejoinTimer}constructor(e,t={config:{}},n){if(this.topic=e,this.params=t,this.socket=n,this.bindings={},this.subTopic=e.replace(/^realtime:/i,``),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:``,enabled:!1},private:!1},t.config),this.channelAdapter=new Pi(this.socket.socketAdapter,e,this.params),this.presence=new Mi(this),this._onClose(()=>{this.socket._remove(this)}),this._updateFilterTransform(),this.broadcastEndpointURL=ri(this.socket.socketAdapter.endPointURL()),this.private=this.params.config.private||!1,!this.private&&this.params.config?.broadcast?.replay)throw Error(`tried to use replay on public channel '${this.topic}'. It must be a private channel.`)}subscribe(e,t=this.timeout){if(this.socket.isConnected()||this.socket.connect(),this.channelAdapter.isClosed()){let{config:{broadcast:n,presence:r,private:i}}=this.params,a=this.bindings.postgres_changes?.map(e=>e.filter)??[],o=!!this.bindings[Li.PRESENCE]&&this.bindings[Li.PRESENCE].length>0||this.params.config.presence?.enabled===!0,s={},c={broadcast:n,presence:Object.assign(Object.assign({},r),{enabled:o}),postgres_changes:a,private:i};this.socket.accessTokenValue&&(s.access_token=this.socket.accessTokenValue),this._onError(t=>{e?.(Ri.CHANNEL_ERROR,Ni(t))}),this._onClose(()=>e?.(Ri.CLOSED)),this.updateJoinPayload(Object.assign({config:c},s)),this._updateFilterMessage(),this.channelAdapter.subscribe(t).receive(`ok`,async({postgres_changes:t})=>{if(this.socket._isManualToken()||this.socket.setAuth(),t===void 0){e?.(Ri.SUBSCRIBED);return}this._updatePostgresBindings(t,e)}).receive(`error`,t=>{this.state=Ur.errored;let n=Object.values(t).join(`, `)||`error`;e?.(Ri.CHANNEL_ERROR,Error(n,{cause:t}))}).receive(`timeout`,()=>{e?.(Ri.TIMED_OUT)})}return this}_updatePostgresBindings(t,n){let r=this.bindings.postgres_changes,i=r?.length??0,a=[];for(let o=0;o<i;o++){let i=r[o],{filter:{event:s,schema:c,table:l,filter:u}}=i,d=t&&t[o];if(d&&d.event===s&&e.isFilterValueEqual(d.schema,c)&&e.isFilterValueEqual(d.table,l)&&e.isFilterValueEqual(d.filter,u))a.push(Object.assign(Object.assign({},i),{id:d.id}));else{this.unsubscribe(),this.state=Ur.errored,n?.(Ri.CHANNEL_ERROR,Error(`mismatch between server and client bindings for postgres changes`));return}}this.bindings.postgres_changes=a,this.state!=Ur.errored&&n&&n(Ri.SUBSCRIBED)}presenceState(){return this.presence.state}async track(e,t={}){return await this.send({type:`presence`,event:`track`,payload:e},t.timeout||this.timeout)}async untrack(e={}){return await this.send({type:`presence`,event:`untrack`},e)}on(e,t,n){let r=this.channelAdapter.isJoined()||this.channelAdapter.isJoining(),i=e===Li.PRESENCE||e===Li.POSTGRES_CHANGES;if(r&&i)throw this.socket.log(`channel`,`cannot add \`${e}\` callbacks for ${this.topic} after \`subscribe()\`.`),Error(`cannot add \`${e}\` callbacks for ${this.topic} after \`subscribe()\`.`);return this._on(e,t,n)}async httpSend(e,t,n={}){if(t==null)return Promise.reject(Error(`Payload is required for httpSend()`));let r=t instanceof ArrayBuffer||ArrayBuffer.isView(t),i={apikey:this.socket.apiKey?this.socket.apiKey:``,"Content-Type":r?`application/octet-stream`:`application/json`};this.socket.accessTokenValue&&(i.Authorization=`Bearer ${this.socket.accessTokenValue}`);let a=new URL(this.broadcastEndpointURL);a.pathname+=`/${encodeURIComponent(this.subTopic)}/events/${encodeURIComponent(e)}`,this.private&&a.searchParams.set(`private`,`true`);let o={method:`POST`,headers:i,body:r?t:JSON.stringify(t)},s=await this._fetchWithTimeout(a.toString(),o,n.timeout??this.timeout);if(s.status===202)return{success:!0};if(s.status===404)return Promise.reject(Error(`httpSend() requires Realtime server v2.97.0 or newer; the endpoint returned 404. Update your Supabase CLI to a recent version, or upgrade the Realtime server in your self-hosted setup. See https://github.com/supabase/supabase-js/blob/master/packages/core/realt
14ime-js/migrations/httpsend-server-version.md`));let c=s.statusText;try{let e=await s.json();c=e.error||e.message||c}catch{}return Promise.reject(Error(c))}async send(e,t={}){if(!this.channelAdapter.canPush()&&e.type===`broadcast`){console.warn(`Realtime send() is automatically falling back to REST API. This behavior will be deprecated in the future. Please use httpSend() explicitly for REST delivery.`);let{event:n,payload:r}=e,i={apikey:this.socket.apiKey?this.socket.apiKey:``,"Content-Type":`application/json`};this.socket.accessTokenValue&&(i.Authorization=`Bearer ${this.socket.accessTokenValue}`);let a={method:`POST`,headers:i,body:JSON.stringify({messages:[{topic:this.subTopic,event:n,payload:r,private:this.private}]})};try{let e=await this._fetchWithTimeout(this.broadcastEndpointURL,a,t.timeout??this.timeout);return await e.body?.cancel(),e.ok?`ok`:`error`}catch(e){return e instanceof Error&&e.name===`AbortError`?`timed out`:`error`}}else return new Promise(n=>{let r=this.channelAdapter.push(e.type,e,t.timeout||this.timeout);e.type===`broadcast`&&!this.params?.config?.broadcast?.ack&&n(`ok`),r.receive(`ok`,()=>n(`ok`)),r.receive(`error`,()=>n(`error`)),r.receive(`timeout`,()=>n(`timed out`))})}updateJoinPayload(e){this.channelAdapter.updateJoinPayload(e)}async unsubscribe(e=this.timeout){return new Promise(t=>{this.channelAdapter.unsubscribe(e).receive(`ok`,()=>t(`ok`)).receive(`timeout`,()=>t(`timed out`)).receive(`error`,()=>t(`error`))})}teardown(){this.channelAdapter.teardown()}async _fetchWithTimeout(e,t,n){let r=new AbortController,i=setTimeout(()=>r.abort(),n),a=await this.socket.fetch(e,Object.assign(Object.assign({},t),{signal:r.signal}));return clearTimeout(i),a}_on(e,t,n){let r=e.toLocaleLowerCase(),i={type:r,filter:t,callback:n,ref:this.channelAdapter.on(e,n)};return this.bindings[r]?this.bindings[r].push(i):this.bindings[r]=[i],this._updateFilterMessage(),this}_onClose(e){this.channelAdapter.onClose(e)}_onError(e){this.channelAdapter.onError(e)}_updateFilterMessage(){this.channelAdapter.updateFilterBindings((e,t,n)=>{let r=e.event.toLocaleLowerCase();if(this._notThisChannelEvent(r,n))return!1;let i=this.bindings[r]?.find(t=>t.ref===e.ref);if(!i)return!0;if([`broadcast`,`presence`,`postgres_changes`].includes(r))if(`id`in i){let e=i.id,n=i.filter?.event;return e&&t.ids?.includes(e)&&(n===`*`||n?.toLocaleLowerCase()===t.data?.type.toLocaleLowerCase())}else{let e=(i?.filter?.event)?.toLocaleLowerCase();return e===`*`||e===(t?.event)?.toLocaleLowerCase()}else return i.type.toLocaleLowerCase()===r})}_notThisChannelEvent(e,t){let{close:n,error:r,leave:i,join:a}=Wr;return t&&[n,r,i,a].includes(e)&&t!==this.joinPush.ref}_updateFilterTransform(){this.channelAdapter.updatePayloadTransform((e,t,n)=>{if(typeof t==`object`&&`ids`in t){let e=t.data,{schema:n,table:r,commit_timestamp:i,type:a,errors:o}=e;return Object.assign(Object.assign({},{schema:n,table:r,commit_timestamp:i,eventType:a,new:{},old:{},errors:o}),this._getPayloadRecords(e))}return t})}copyBindings(e){if(this.joinedOnce)throw Error(`cannot copy bindings into joined channel`);for(let t in e.bindings)for(let n of e.bindings[t])this._on(n.type,n.filter,n.callback)}static isFilterValueEqual(e,t){return(e??void 0)===(t??void 0)}_getPayloadRecords(e){let t={new:{},old:{}};return(e.type===`INSERT`||e.type===`UPDATE`)&&(t.new=Jr(e.columns,e.record)),(e.type===`UPDATE`||e.type===`DELETE`)&&(t.old=Jr(e.columns,e.old_record)),t}},Bi=class{constructor(e,t){this.socket=new Ti(e,t)}get timeout(){return this.socket.timeout}get endPoint(){return this.socket.endPoint}get transport(){return this.socket.transport}get heartbeatIntervalMs(){return this.socket.heartbeatIntervalMs}get heartbeatCallback(){return this.socket.heartbeatCallback}set heartbeatCallback(e){this.socket.heartbeatCallback=e}get heartbeatTimer(){return this.socket.heartbeatTimer}get pendingHeartbeatRef(){return this.socket.pendingHeartbeatRef}get reconnectTimer(){return this.socket.reconnectTimer}get vsn(){return this.socket.vsn}get encode(){return this.socket.encode}get decode(){return this.socket.decode}get reconnectAfterMs(){return this.socket.reconnectAfterMs}get sendBuffer(){return this.socket.sendBuffer}get stateChangeCallbacks(){return this.socket.stateChangeCallbacks}connect(){this.socket.connect()}disconnect(e,t,n,r=1e4){return new Promise(i=>{setTimeout(()=>i(`timeout`),r),this.socket.disconnect(()=>{e(),i(`ok`)},t,n)})}push(e){this.socket.push(e)}log(e,t,n){this.socket.log(e,t,n)}makeRef(){return this.socket.makeRef()}onOpen(e){this.socket.onOpen(e)}onClose(e){this.socket.onClose(e)}onError(e){this.socket.onError(e)}onMessage(e){this.socket.onMessage(e)}isConnected(){return this.socket.isConnected()}isConnecting(){return this.socket.connectionState()==Gr.connecting}isDisconnecting(){return this.socket.connectionState()==Gr.closing}connectionState(){return this.socket.connectionState()}endPointURL(){return this.socket.endPointURL()}sendHeartbeat(){this.socket.sendHeartbeat()}getSocket(){return this.socket}},N={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},Vi=[1e3,2e3,5e3,1e4],Hi=1e4;function Ui(){let e=new Map;return{get length(){return e.size},clear(){e.clear()},getItem(t){return e.has(t)?e.get(t):null},key(t){return Array.from(e.keys())[t]??null},removeItem(t){e.delete(t)},setItem(t,n){e.set(t,String(n))}}}function Wi(){try{if(typeof globalThis<`u`&&globalThis.sessionStorage)return globalThis.sessionStorage}catch{}return Ui()}var Gi=` 15 addEventListener("message", (e) => { 16 if (e.data.event === "start") { 17 setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval); 18 } 19 });`,Ki=class{get endPoint(){return this.socketAdapter.endPoint}get timeout(){return this.socketAdapter.timeout}get transport(){return this.socketAdapter.transport}get heartbeatCallback(){return this.socketAdapter.heartbeatCallback}get heartbeatIntervalMs(){return this.socketAdapter.heartbeatIntervalMs}get heartbeatTimer(){return this.worker?this._workerHeartbeatTimer:this.socketAdapter.heartbeatTimer}get pendingHeartbeatRef(){return this.worker?this._pendingWorkerHeartbeatRef:this.socketAdapter.pendingHeartbeatRef}get reconnectTimer(){return this.socketAdapter.reconnectTimer}get vsn(){return this.socketAdapter.vsn}get encode(){return this.socketAdapter.encode}get decode(){return this.socketAdapter.decode}get reconnectAfterMs(){return this.socketAdapter.reconnectAfterMs}get sendBuffer(){return this.socketAdapter.sendBuffer}get stateChangeCallbacks(){return this.socketAdapter.stateChangeCallbacks}constructor(e,t){if(this.channels=[],this.accessTokenValue=null,this.accessToken=null,this.apiKey=null,this.httpEndpoint=``,this.headers={},this.params={}
19,this.ref=0,this.serializer=new Kr,this._manuallySetToken=!1,this._authPromise=null,this._workerHeartbeatTimer=void 0,this._pendingWorkerHeartbeatRef=null,this._pendingDisconnectTimer=null,this._disconnectOnEmptyChannelsAfterMs=0,this._resolveFetch=e=>e?(...t)=>e(...t):(...e)=>fetch(...e),!t?.params?.apikey)throw Error(`API key is required to connect to Realtime`);this.apiKey=t.params.apikey;let n=this._initializeOptions(t);this.socketAdapter=new Bi(e,n),this.httpEndpoint=ri(e),this.fetch=this._resolveFetch(t?.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.isConnected())){this.accessToken&&!this._authPromise&&this._setAuthSafely(`connect`),this._setupConnectionHandlers();try{this.socketAdapter.connect()}catch(e){let t=e.message;throw t.includes(`Node.js`)?Error(`${t}\n\nTo use Realtime in Node.js, you need to provide a WebSocket implementation: 20 21Option 1: Use Node.js 22+ which has native WebSocket support 22Option 2: Install and provide the "ws" package: 23 24 npm install ws 25 26 import ws from "ws" 27 const client = new RealtimeClient(url, { 28 ...options, 29 transport: ws 30 })`):Error(`WebSocket not available: ${t}`)}this._handleNodeJsRaceCondition()}}endpointURL(){return this.socketAdapter.endPointURL()}async disconnect(e,t){return this._cancelPendingDisconnect(),this.isDisconnecting()?`ok`:await this.socketAdapter.disconnect(()=>{clearInterval(this._workerHeartbeatTimer),this._terminateWorker()},e,t)}getChannels(){return this.channels}async removeChannel(e){let t=await e.unsubscribe();return t===`ok`&&e.teardown(),t}async removeAllChannels(){let e=this.channels.map(async e=>{let t=await e.unsubscribe();return e.teardown(),t}),t=await Promise.all(e);return await this.disconnect(),t}log(e,t,n){this.socketAdapter.log(e,t,n)}connectionState(){return this.socketAdapter.connectionState()||Gr.closed}isConnected(){return this.socketAdapter.isConnected()}isConnecting(){return this.socketAdapter.isConnecting()}isDisconnecting(){return this.socketAdapter.isDisconnecting()}channel(e,t={config:{}}){let n=`realtime:${e}`,r=this.getChannels().find(e=>e.topic===n);if(r)return r;{let n=new zi(`realtime:${e}`,t,this);return this._cancelPendingDisconnect(),this.channels.push(n),n}}push(e){this.socketAdapter.push(e)}async setAuth(e=null){this._authPromise=this._performAuth(e);try{await this._authPromise}finally{this._authPromise=null}}_isManualToken(){return this._manuallySetToken}async sendHeartbeat(){this.socketAdapter.sendHeartbeat()}onHeartbeat(e){this.socketAdapter.heartbeatCallback=this._wrapHeartbeatCallback(e)}_makeRef(){return this.socketAdapter.makeRef()}_remove(e){this.channels=this.channels.filter(t=>t.topic!==e.topic),this.channels.length===0&&(this.log(`transport`,`no channels remaining, scheduling disconnect`),this._schedulePendingDisconnect())}_schedulePendingDisconnect(){if(this._cancelPendingDisconnect(),this._disconnectOnEmptyChannelsAfterMs===0){this.log(`transport`,`disconnecting immediately - no channels`),this.disconnect();return}
30this._pendingDisconnectTimer=setTimeout(()=>{this._pendingDisconnectTimer=null,this.channels.length===0&&(this.log(`transport`,`deferred disconnect fired - no channels, disconnecting`),this.disconnect())},this._disconnectOnEmptyChannelsAfterMs),this.log(`transport`,`deferred disconnect scheduled in ${this._disconnectOnEmptyChannelsAfterMs}ms`)}_cancelPendingDisconnect(){this._pendingDisconnectTimer!==null&&(this.log(`transport`,`pending disconnect cancelled - channel activity detected`),clearTimeout(this._pendingDisconnectTimer),this._pendingDisconnectTimer=null)}async _performAuth(e=null){let t,n=!1;if(e)t=e,n=!0;else if(this.accessToken)try{t=await this.accessToken()}catch(e){this.log(`error`,`Error fetching access token from callback`,e),t=this.accessTokenValue}else t=this.accessTokenValue;n?this._manuallySetToken=!0:this.accessToken&&(this._manuallySetToken=!1),this.accessTokenValue!=t&&(this.accessTokenValue=t,this.channels.forEach(e=>{let n={access_token:t,version:Rr};t&&e.updateJoinPayload(n),e.joinedOnce&&e.channelAdapter.isJoined()&&e.channelAdapter.push(Wr.access_token,{access_token:t})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(e=`general`){this._isManualToken()||this.setAuth().catch(t=>{this.log(`error`,`Error setting auth in ${e}`,t)})}_setupConnectionHandlers(){this.socketAdapter.onOpen(()=>{(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).catch(e=>{this.log(`error`,`error waiting for auth on connect`,e)}),this.worker&&!this.workerRef&&this._startWorkerHeartbeat()}),this.socketAdapter.onClose(()=>{this.worker&&this.workerRef&&this._terminateWorker()}),this.socketAdapter.onMessage(e=>{e.ref&&e.ref===this._pendingWorkerHeartbeatRef&&(this._pendingWorkerHeartbeatRef=null)})}_handleNodeJsRaceCondition(){this.socketAdapter.isConnected()&&this.socketAdapter.getSocket().onConnOpen()}_wrapHeartbeatCallback(e){return(t,n)=>{t==`sent`&&this._setAuthSafely(),e&&e(t,n)}}_startWorkerHeartbeat(){this.workerUrl?this.log(`worker`,`starting worker for from ${this.workerUrl}`):this.log(`worker`,`starting default worker`);let e=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(e),this.workerRef.onerror=e=>{this.log(`worker`,`worker error`,e.message),this._terminateWorker(),this.disconnect()},this.workerRef.onmessage=e=>{e.data.event===`keepAlive`&&this.sendHeartbeat()},this.workerRef.postMessage({event:`start`,interval:this.heartbeatIntervalMs})}_terminateWorker(){this.workerRef&&=(this.log(`worker`,`terminating worker`),this.workerRef.terminate(),void 0)}_workerObjectUrl(e){let t;if(e)t=e;else{let e=new Blob([Gi],{type:`application/javascript`});t=URL.createObjectURL(e)}return t}_initializeOptions(e){this.worker=e?.worker??!1,this.accessToken=e?.accessToken??null;let t={};t.timeout=e?.timeout??Hr,t.heartbeatIntervalMs=e?.heartbeatIntervalMs??N.HEARTBEAT_INTERVAL,this._disconnectOnEmptyChannelsAfterMs=e?.disconnectOnEmptyChannelsAfterMs??2*(e?.heartbeatIntervalMs??N.HEARTBEAT_INTERVAL),t.transport=e?.transport??Lr.getWebSocketConstructor(),t.params=e?.params,t.logger=e?.logger,t.heartbeatCallback=this._wrapHeartbeatCallback(e?.heartbeatCallback),t.sessionStorage=e?.sessionStorage??Wi(),t.reconnectAfterMs=e?.reconnectAfterMs??(e=>Vi[e-1]||Hi);let n,r,i=e?.vsn??Vr;switch(i){case zr:n=(e,t)=>t(JSON.stringify(e)),r=(e,t)=>t(JSON.parse(e));break;case Br:n=this.serializer.encode.bind(this.serializer),r=this.serializer.decode.bind(this.serializer);break;default:throw Error(`Unsupported serializer version: ${t.vsn}`)}if(t.vsn=i,t.encode=e?.encode??n,t.decode=e?.decode??r,t.beforeReconnect=this._reconnectAuth.bind(this),(e?.logLevel||e?.log_level)&&(this.logLevel=e.logLevel||e.log_level,t.params=Object.assign(Object.assign({},t.params),{log_level:this.logLevel})),this.worker){if(typeof window<`u`&&!window.Worker)throw Error(`Web Worker is not supported`);this.workerUrl=e?.workerUrl,t.autoSendHeartbeat=!this.worker}return t}async _reconnectAuth(){await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()}}
vendor: 4,836 bytes, line 30
30,qi=class extends Error{constructor(e,t){super(e),this.name=`IcebergError`,this.status=t.status,this.icebergType=t.icebergType,this.icebergCode=t.icebergCode,this.details=t.details,this.isCommitStateUnknown=t.icebergType===`CommitStateUnknownException`||[500,502,504].includes(t.status)&&t.icebergType?.includes(`CommitState`)===!0}isNotFound(){return this.status===404}isConflict(){return this.status===409}isAuthenticationTimeout(){return this.status===419}};function Ji(e,t,n){let r=new URL(t,e);if(n)for(let[e,t]of Object.entries(n))t!==void 0&&r.searchParams.set(e,t);return r.toString()}async function Yi(e){return!e||e.type===`none`?{}:e.type===`bearer`?{Authorization:`Bearer ${e.token}`}:e.type===`header`?{[e.name]:e.value}:e.type===`custom`?await e.getHeaders():{}}function Xi(e){let t=e.fetchImpl??globalThis.fetch;return{async request({method:n,path:r,query:i,body:a,headers:o}){let s=Ji(e.baseUrl,r,i),c=await Yi(e.auth),l=await t(s,{method:n,headers:{...a?{"Content-Type":`application/json`}:{},...c,...o},body:a?JSON.stringify(a):void 0}),u=await l.text(),d=(l.headers.get(`content-type`)||``).includes(`application/json`),f=d&&u?JSON.parse(u):u;if(!l.ok){let e=d?f:void 0,t=e?.error;throw new qi(t?.message??`Request failed with status ${l.status}`,{status:l.status,icebergType:t?.type,icebergCode:t?.code,details:e})}return{status:l.status,headers:l.headers,data:f}}}}function Zi(e){return e.join(`�`)}var Qi=class{constructor(e,t=``){this.client=e,this.prefix=t}async listNamespaces(e){let t=e?{parent:Zi(e.namespace)}:void 0;return(await this.client.request({method:`GET`,path:`${this.prefix}/namespaces`,query:t})).data.namespaces.map(e=>({namespace:e}))}async createNamespace(e,t){let n={namespace:e.namespace,properties:t?.properties};return(await this.client.request({method:`POST`,path:`${this.prefix}/namespaces`,body:n})).data}async dropNamespace(e){await this.client.request({method:`DELETE`,path:`${this.prefix}/namespaces/${Zi(e.namespace)}`})}async loadNamespaceMetadata(e){return{properties:(await this.client.request({method:`GET`,path:`${this.prefix}/namespaces/${Zi(e.namespace)}`})).data.properties}}async namespaceExists(e){try{return await this.client.request({method:`HEAD`,path:`${this.prefix}/namespaces/${Zi(e.namespace)}`}),!0}catch(e){if(e instanceof qi&&e.status===404)return!1;throw e}}async createNamespaceIfNotExists(e,t){try{return await this.createNamespace(e,t)}catch(e){if(e instanceof qi&&e.status===409)return;throw e}}};function $i(e){return e.join(`�`)}var ea=class{constructor(e,t=``,n){this.client=e,this.prefix=t,this.accessDelegation=n}async listTables(e){return(await this.client.request({method:`GET`,path:`${this.prefix}/namespaces/${$i(e.namespace)}/tables`})).data.identifiers}async createTable(e,t){let n={};return this.accessDelegation&&(n[`X-Iceberg-Access-Delegation`]=this.accessDelegation),(await this.client.request({method:`POST`,path:`${this.prefix}/namespaces/${$i(e.namespace)}/tables`,body:t,headers:n})).data.metadata}async updateTable(e,t){let n=await this.client.request({method:`POST`,path:`${this.prefix}/namespaces/${$i(e.namespace)}/tables/${e.name}`,body:t});return{"metadata-location":n.data[`metadata-location`],metadata:n.data.metadata}}async dropTable(e,t){await this.client.request({method:`DELETE`,path:`${this.prefix}/namespaces/${$i(e.namespace)}/tables/${e.name}`,query:{purgeRequested:String(t?.purge??!1)}})}async loadTable(e){let t={};return this.accessDelegation&&(t[`X-Iceberg-Access-Delegation`]=this.accessDelegation),(await this.client.request({method:`GET`,path:`${this.prefix}/namespaces/${$i(e.namespace)}/tables/${e.name}`,headers:t})).data.metadata}async tableExists(e){let t={};this.accessDelegation&&(t[`X-Iceberg-Access-Delegation`]=this.accessDelegation);try{return await this.client.request({method:`HEAD`,path:`${this.prefix}/namespaces/${$i(e.namespace)}/tables/${e.name}`,headers:t}),!0}catch(e){if(e instanceof qi&&e.status===404)return!1;throw e}}async createTableIfNotExists(e,t){try{return await this.createTable(e,t)}catch(n){if(n instanceof qi&&n.status===409)return await this.loadTable({namespace:e.namespace,name:t.name});throw n}}},ta=class{constructor(e){let t=`v1`;e.catalogName&&(t+=`/${e.catalogName}`);let n=e.baseUrl.endsWith(`/`)?e.baseUrl:`${e.baseUrl}/`;this.client=Xi({baseUrl:n,auth:e.auth,fetchImpl:e.fetch}),this.accessDelegation=e.accessDelegation?.join(`,`),this.namespaceOps=new Qi(this.client,t),this.tableOps=new ea(this.client,t,this.accessDelegation)}async listNamespaces(e){return this.namespaceOps.listNamespaces(e)}async createNamespace(e,t){return this.namespaceOps.createNamespace(e,t)}async dropNamespace(e){await this.namespaceOps.dropNamespace(e)}async loadNamespaceMetadata(e){return this.namespaceOps.loadNamespaceMetadata(e)}async listTables(e){return this.tableOps.listTables(e)}
30async createTable(e,t){return this.tableOps.createTable(e,t)}async updateTable(e,t){return this.tableOps.updateTable(e,t)}async dropTable(e,t){await this.tableOps.dropTable(e,t)}async loadTable(e){return this.tableOps.loadTable(e)}async namespaceExists(e){return this.namespaceOps.namespaceExists(e)}async tableExists(e){return this.tableOps.tableExists(e)}async createNamespaceIfNotExists(e,t){return this.namespaceOps.createNamespaceIfNotExists(e,t)}async createTableIfNotExists(e,t){return this.tableOps.createTableIfNotExists(e,t)}};function na(e){"@babel/helpers - typeof";return na=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},na(e)}function ra(e,t){if(na(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(na(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function ia(e){var t=ra(e,`string`);return na(t)==`symbol`?t:t+``}function aa(e,t,n){return(t=ia(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function oa(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function P(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?oa(Object(n),!0).forEach(function(t){aa(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oa(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var sa=class extends Error{constructor(e,t=`storage`,n,r){super(e),this.__isStorageError=!0,this.namespace=t,this.name=t===`vectors`?`StorageVectorsError`:`StorageError`,this.status=n,this.statusCode=r}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}};function ca(e){return typeof e==`object`&&!!e&&`__isStorageError`in e}var la=class extends sa{constructor(e,t,n,r=`storage`){super(e,r,t,n),this.name=r===`vectors`?`StorageVectorsApiError`:`StorageApiError`,this.status=t,this.statusCode=n}toJSON(){return P({},super.toJSON())}},ua=class extends sa{constructor(e,t,n=`storage`){super(e,n),this.name=n===`vectors`?`StorageVectorsUnknownError`:`StorageUnknownError`,this.originalError=t}};function da(e,t,n){let r=P({},e),i=t.toLowerCase();for(let e of Object.keys(r))e.toLowerCase()===i&&delete r[e];return r[i]=n,r}function fa(e){let t={};for(let[n,r]of Object.entries(e))t[n.toLowerCase()]=r;return t}var pa=e=>e?(...t)=>e(...t):(...e)=>fetch(...e),ma=e=>{if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},ha=e=>{if(Array.isArray(e))return e.map(e=>ha(e));if(typeof e==`function`||e!==Object(e))return e;let t={};return Object.entries(e).forEach(([e,n])=>{let r=e.replace(/([-_][a-z])/gi,e=>e.toUpperCase().replace(/[-_]/g,``));t[r]=ha(n)}),t},ga=e=>!e||typeof e!=`string`||e.length===0||e.length>100||e.trim()!==e||e.includes(`/`)||e.includes(`\\`)?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(e),_a=e=>{if(typeof e==`object`&&e){let t=e;if(typeof t.msg==`string`)return t.msg;if(typeof t.message==`string`)return t.message;if(typeof t.error_description==`string`)return t.error_description;if(typeof t.error==`string`)return t.error;if(typeof t.error==`object`&&t.error!==null){let e=t.error;if(typeof e.message==`string`)return e.message}}return JSON.stringify(e)},va=async(e,t,n,r)=>{if(typeof e==`object`&&e&&`json`in e&&typeof e.json==`function`){let n=e,i=parseInt(String(n.status),10);Number.isFinite(i)||(i=500),n.json().then(e=>{let n=e?.statusCode||e?.code||i+``;t(new la(_a(e),i,n,r))}).catch(()=>{let e=i+``;t(new la(n.statusText||`HTTP ${i} error`,i,e,r))})}else t(new ua(_a(e),e,r))},ya=(e,t,n,r)=>{let i={method:e,headers:t?.headers||{}};if(e===`GET`||e===`HEAD`||!r)return P(P({},i),n);if(ma(r)){let e=t?.headers||{},n;for(let[t,r]of Object.entries(e))t.toLowerCase()===`content-type`&&(n=r);i.headers=da(e,`Content-Type`,n??`application/json`),i.body=JSON.stringify(r)}else i.body=r;return t?.duplex&&(i.duplex=t.duplex),P(P({},i),n)};async function ba(e,t,n,r,i,a,o){return new Promise((s,c)=>{e(n,ya(t,r,i,a)).then(e=>{if(!e.ok)throw e;if(r?.noResolveJson)return e;if(o===`vectors`){let t=e.headers.get(`content-type`);if(e.headers.get(`content-length`)===`0`||e.status===204||!t||!t.includes(`application/json`))return{}}return e.json()}).then(e=>s(e)).catch(e=>va(e,c,r,o))})}function xa(e=`storage`){return{get:async(t,n,r,i)=>ba(t,`GET`,n,r,i,void 0,e),post:async(t,n,r,i,a)=>ba(t,`POST`,n,i,a,r,e),put:async(t,n,r,i,a)=>ba(t,`PUT`,n,i,a,r,e),head:async(t,n,r,i)=>ba(t,`HEAD`,n,P(P({},r),{},{noResolveJson:!0}),i,void 0,e),remove:async(t,n,r,i,a)=>ba(t,`DELETE`,n,i,a,r,e)}}var{get:Sa,post:Ca,put:wa,head:Ta,remove:Ea}=xa(`storage`),Da=xa(`vectors`),Oa=class{constructor(e,t={},n,r=`storage`){this.shouldThrowOnError=!1,this.url=e,this.headers=fa(t),this.fetch=pa(n),this.namespace=r}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,t){return this.headers=da(this.headers,e,t),this}async handleOperation(e){var t=this;try{return{data:await e(),error:null}}catch(e){if(t.shouldThrowOnError)throw e;if(ca(e))return{data:null,error:e};throw e}}},ka=Symbol.toStringTag,Aa=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t,this[ka]=`StreamDownloadBuilder`,this.promise=null}
30then(e,t){return this.getPromise().then(e,t)}catch(e){return this.getPromise().catch(e)}finally(e){return this.getPromise().finally(e)}getPromise(){return this.promise||=this.execute(),this.promise}async execute(){var e=this;try{return{data:(await e.downloadFn()).body,error:null}}catch(t){if(e.shouldThrowOnError)throw t;if(ca(t))return{data:null,error:t};throw t}}},ja=Symbol.toStringTag,Ma=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t,this[ja]=`BlobDownloadBuilder`,this.promise=null}asStream(){return new Aa(this.downloadFn,this.shouldThrowOnError)}then(e,t){return this.getPromise().then(e,t)}catch(e){return this.getPromise().catch(e)}finally(e){return this.getPromise().finally(e)}getPromise(){return this.promise||=this.execute(),this.promise}async execute(){var e=this;try{return{data:await(await e.downloadFn()).blob(),error:null}}catch(t){if(e.shouldThrowOnError)throw t;if(ca(t))return{data:null,error:t};throw t}}},Na={limit:100,offset:0,sortBy:{column:`name`,order:`asc`}},Pa={cacheControl:`3600`,contentType:`text/plain;charset=UTF-8`,upsert:!1},Fa=class extends Oa{constructor(e,t={},n,r){super(e,t,r,`storage`),this.bucketId=n}async uploadOrUpdate(e,t,n,r){var i=this;return i.handleOperation(async()=>{let a,o=P(P({},Pa),r),s=P(P({},i.headers),e===`POST`&&{"x-upsert":String(o.upsert)}),c=o.metadata;if(typeof Blob<`u`&&n instanceof Blob?(a=new FormData,a.append(`cacheControl`,o.cacheControl),c&&a.append(`metadata`,i.encodeMetadata(c)),a.append(``,n)):typeof FormData<`u`&&n instanceof FormData?(a=n,a.has(`cacheControl`)||a.append(`cacheControl`,o.cacheControl),c&&!a.has(`metadata`)&&a.append(`metadata`,i.encodeMetadata(c))):(a=n,s[`cache-control`]=`max-age=${o.cacheControl}`,s[`content-type`]=o.contentType,c&&(s[`x-metadata`]=i.toBase64(i.encodeMetadata(c))),(typeof ReadableStream<`u`&&a instanceof ReadableStream||a&&typeof a==`object`&&`pipe`in a&&typeof a.pipe==`function`)&&!o.duplex&&(o.duplex=`half`)),r?.headers)for(let[e,t]of Object.entries(r.headers))s=da(s,e,t);let l=i._removeEmptyFolders(t),u=i._getFinalPath(l),d=await(e==`PUT`?wa:Ca)(i.fetch,`${i.url}/object/${u}`,a,P({headers:s},o?.duplex?{duplex:o.duplex}:{}));return{path:l,id:d.Id,fullPath:d.Key}})}async upload(e,t,n){return this.uploadOrUpdate(`POST`,e,t,n)}async uploadToSignedUrl(e,t,n,r){var i=this;let a=i._removeEmptyFolders(e),o=i._getFinalPath(a),s=new URL(i.url+`/object/upload/sign/${o}`);return s.searchParams.set(`token`,t),i.handleOperation(async()=>{let e,t=P(P({},Pa),r),o=P(P({},i.headers),{"x-upsert":String(t.upsert)}),c=t.metadata;if(typeof Blob<`u`&&n instanceof Blob?(e=new FormData,e.append(`cacheControl`,t.cacheControl),c&&e.append(`metadata`,i.encodeMetadata(c)),e.append(``,n)):typeof FormData<`u`&&n instanceof FormData?(e=n,e.has(`cacheControl`)||e.append(`cacheControl`,t.cacheControl),c&&!e.has(`metadata`)&&e.append(`metadata`,i.encodeMetadata(c))):(e=n,o[`cache-control`]=`max-age=${t.cacheControl}`,o[`content-type`]=t.contentType,c&&(o[`x-metadata`]=i.toBase64(i.encodeMetadata(c))),(typeof ReadableStream<`u`&&e instanceof ReadableStream||e&&typeof e==`object`&&`pipe`in e&&typeof e.pipe==`function`)&&!t.duplex&&(t.duplex=`half`)),r?.headers)for(let[e,t]of Object.entries(r.headers))o=da(o,e,t);return{path:a,fullPath:(await wa(i.fetch,s.toString(),e,P({headers:o},t?.duplex?{duplex:t.duplex}:{}))).Key}})}async createSignedUploadUrl(e,t){var n=this;return n.handleOperation(async()=>{let r=n._getFinalPath(e),i=P({},n.headers);t?.upsert&&(i[`x-upsert`]=`true`);let a=await Ca(n.fetch,`${n.url}/object/upload/sign/${r}`,{},{headers:i}),o=new URL(n.url+a.url),s=o.searchParams.get(`token`);if(!s)throw new sa(`No token returned by API`);return{signedUrl:o.toString(),path:e,token:s}})}async update(e,t,n){return this.uploadOrUpdate(`PUT`,e,t,n)}async move(e,t,n){var r=this;return r.handleOperation(async()=>await Ca(r.fetch,`${r.url}/object/move`,{bucketId:r.bucketId,sourceKey:e,destinationKey:t,de
30stinationBucket:n?.destinationBucket},{headers:r.headers}))}async copy(e,t,n){var r=this;return r.handleOperation(async()=>({path:(await Ca(r.fetch,`${r.url}/object/copy`,{bucketId:r.bucketId,sourceKey:e,destinationKey:t,destinationBucket:n?.destinationBucket},{headers:r.headers})).Key}))}async createSignedUrl(e,t,n){var r=this;return r.handleOperation(async()=>{let i=r._getFinalPath(e),a=typeof n?.transform==`object`&&n.transform!==null&&Object.keys(n.transform).length>0,o=await Ca(r.fetch,`${r.url}/object/sign/${i}`,P({expiresIn:t},a?{transform:n.transform}:{}),{headers:r.headers}),s=new URLSearchParams;n?.download&&s.set(`download`,n.download===!0?``:n.download),n?.cacheNonce!=null&&s.set(`cacheNonce`,String(n.cacheNonce));let c=s.toString();return{signedUrl:encodeURI(`${r.url}${o.signedURL}${c?`&${c}`:``}`)}})}async createSignedUrls(e,t,n){var r=this;return r.handleOperation(async()=>{let i=await Ca(r.fetch,`${r.url}/object/sign/${r.bucketId}`,{expiresIn:t,paths:e},{headers:r.headers}),a=new URLSearchParams;n?.download&&a.set(`download`,n.download===!0?``:n.download),n?.cacheNonce!=null&&a.set(`cacheNonce`,String(n.cacheNonce));let o=a.toString();return i.map(e=>P(P({},e),{},{signedUrl:e.signedURL?encodeURI(`${r.url}${e.signedURL}${o?`&${o}`:``}`):null}))})}download(e,t,n){let r=typeof t?.transform==`object`&&t.transform!==null&&Object.keys(t.transform).length>0?`render/image/authenticated`:`object`,i=new URLSearchParams;t?.transform&&this.applyTransformOptsToQuery(i,t.transform),t?.cacheNonce!=null&&i.set(`cacheNonce`,String(t.cacheNonce));let a=i.toString(),o=this._getFinalPath(e);return new Ma(()=>Sa(this.fetch,`${this.url}/${r}/${o}${a?`?${a}`:``}`,{headers:this.headers,noResolveJson:!0},n),this.shouldThrowOnError)}async info(e){var t=this;let n=t._getFinalPath(e);return t.handleOperation(async()=>ha(await Sa(t.fetch,`${t.url}/object/info/${n}`,{headers:t.headers})))}async exists(e){var t=this;let n=t._getFinalPath(e);try{return await Ta(t.fetch,`${t.url}/object/${n}`,{headers:t.headers}),{data:!0,error:null}}catch(e){if(t.shouldThrowOnError)throw e;if(ca(e)){let t=e instanceof la?e.status:e instanceof ua?e.originalError?.status:void 0;if(t!==void 0&&[400,404].includes(t))return{data:!1,error:e}}throw e}}getPublicUrl(e,t){let n=this._getFinalPath(e),r=new URLSearchParams;t?.download&&r.set(`download`,t.download===!0?``:t.download),t?.transform&&this.applyTransformOptsToQuery(r,t.transform),t?.cacheNonce!=null&&r.set(`cacheNonce`,String(t.cacheNonce));let i=r.toString(),a=typeof t?.transform==`object`&&t.transform!==null&&Object.keys(t.transform).length>0?`render/image`:`object`;return{data:{publicUrl:encodeURI(`${this.url}/${a}/public/${n}`)+(i?`?${i}`:``)}}}async remove(e){var t=this;return t.handleOperation(async()=>await Ea(t.fetch,`${t.url}/object/${t.bucketId}`,{prefixes:e},{headers:t.headers}))}async list(e,t,n){var r=this;return r.handleOperation(async()=>{let i=P(P(P({},Na),t),{},{prefix:e||``});return await Ca(r.fetch,`${r.url}/object/list/${r.bucketId}`,i,{headers:r.headers},n)})}async listV2(e,t){var n=this;return n.handleOperation(async()=>{let r=P({},e);return await Ca(n.fetch,`${n.url}/object/list-v2/${n.bucketId}`,r,{headers:n.headers},t)})}encodeMetadata(e){return JSON.stringify(e)}toBase64(e){return typeof Buffer<`u`?Buffer.from(e).toString(`base64`):btoa(e)}_getFinalPath(e){return`${this.bucketId}/${e.replace(/^\/+/,``)}`}_removeEmptyFolders(e){return e.replace(/^\/|\/$/g,``).replace(/\/+/g,`/`)}applyTransformOptsToQuery(e,t){return t.width&&e.set(`width`,t.width.toString()),t.height&&e.set(`height`,t.height.toString()),t.resize&&e.set(`resize`,t.resize),t.format&&e.set(`format`,t.format),t.quality&&e.set(`quality`,t.quality.toString()),e}},Ia={"X-Client-Info":`storage-js/2.108.2`},La=class extends Oa{constructor(e,t={},n,r){let i=new URL(e);r?.useNewHostname&&/supabase\.(co|in|red)$/.test(i.hostname)&&!i.hostname.includes(`storage.supabase.`)&&(i.hostname=i.hostname.replace(`supabase.`,`storage.supabase.`));let a=i.href.replace(/\/$/,``),o=P(P({},Ia),t);super(a,o,n,`storage`)}async listBuckets(e){var t=this;return t.handleOperation(async()=>{let n=t.listBucketOptionsToQueryString(e);return await Sa(t.fetch,`${t.url}/bucket${n}`,{headers:t.headers})})}async getBucket(e){var t=this;return t.handleOperation(async()=>await Sa(t.fetch,`${t.url}/bucket/${e}`,{headers:t.headers}))}async createBucket(e,t={public:!1}){var n=this;return n.handleOperation(async()=>await Ca(n.fetch,`${n.url}/bucket`,{id:e,name:e,type:t.type,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:n.headers}))}async updateBucket(e,t){var n=this;return n.handleOperation(async()=>await wa(n.fetch,`${n.url}/bucket/${e}`,{id:e,name:e,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:n.headers}))}async emptyBucket(e){var t=this;return t.handleOperation(async()=>await Ca(t.fetch,`${t.url}/bucket/${e}/empty`,{},{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await Ea(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}listBucketOptionsToQueryString(e){let t={};return e&&(`limit`in e&&(t.limit=String(e.limit)),`offset`in e&&(t.offset=String(e.offset)),e.search&&(t.search=e.search),e.sortColumn&&(t.sortColumn=e.sortColumn),e.sortOrder&&(t.sortOrder=e.sortOrder)),Object.keys(t).length>
300?`?`+new URLSearchParams(t).toString():``}},Ra=class extends Oa{constructor(e,t={},n){let r=e.replace(/\/$/,``),i=P(P({},Ia),t);super(r,i,n,`storage`)}async createBucket(e){var t=this;return t.handleOperation(async()=>await Ca(t.fetch,`${t.url}/bucket`,{name:e},{headers:t.headers}))}async listBuckets(e){var t=this;return t.handleOperation(async()=>{let n=new URLSearchParams;e?.limit!==void 0&&n.set(`limit`,e.limit.toString()),e?.offset!==void 0&&n.set(`offset`,e.offset.toString()),e?.sortColumn&&n.set(`sortColumn`,e.sortColumn),e?.sortOrder&&n.set(`sortOrder`,e.sortOrder),e?.search&&n.set(`search`,e.search);let r=n.toString(),i=r?`${t.url}/bucket?${r}`:`${t.url}/bucket`;return await Sa(t.fetch,i,{headers:t.headers})})}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await Ea(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}from(e){var t=this;if(!ga(e))throw new sa(`Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines and should avoid the use of any other characters.`);let n=new ta({baseUrl:this.url,catalogName:e,auth:{type:`custom`,getHeaders:async()=>t.headers},fetch:this.fetch}),r=this.shouldThrowOnError;return new Proxy(n,{get(e,t){let n=e[t];return typeof n==`function`?async(...t)=>{try{return{data:await n.apply(e,t),error:null}}catch(e){if(r)throw e;return{data:null,error:e}}}:n}})}},za=class extends Oa{constructor(e,t={},n){let r=e.replace(/\/$/,``),i=P(P({},Ia),{},{"Content-Type":`application/json`},t);super(r,i,n,`vectors`)}async createIndex(e){var t=this;return t.handleOperation(async()=>await Da.post(t.fetch,`${t.url}/CreateIndex`,e,{headers:t.headers})||{})}async getIndex(e,t){var n=this;return n.handleOperation(async()=>await Da.post(n.fetch,`${n.url}/GetIndex`,{vectorBucketName:e,indexName:t},{headers:n.headers}))}async listIndexes(e){var t=this;return t.handleOperation(async()=>await Da.post(t.fetch,`${t.url}/ListIndexes`,e,{headers:t.headers}))}async deleteIndex(e,t){var n=this;return n.handleOperation(async()=>await Da.post(n.fetch,`${n.url}/DeleteIndex`,{vectorBucketName:e,indexName:t},{headers:n.headers})||{})}},Ba=class extends Oa{constructor(e,t={},n){let r=e.replace(/\/$/,``),i=P(P({},Ia),{},{"Content-Type":`application/json`},t);super(r,i,n,`vectors`)}async putVectors(e){var t=this;if(e.vectors.length<1||e.vectors.length>500)throw Error(`Vector batch size must be between 1 and 500 items`);return t.handleOperation(async()=>await Da.post(t.fetch,`${t.url}/PutVectors`,e,{headers:t.headers})||{})}async getVectors(e){var t=this;return t.handleOperation(async()=>await Da.post(t.fetch,`${t.url}/GetVectors`,e,{headers:t.headers}))}async listVectors(e){var t=this;if(e.segmentCount!==void 0){if(e.segmentCount<1||e.segmentCount>16)throw Error(`segmentCount must be between 1 and 16`);if(e.segmentIndex!==void 0&&(e.segmentIndex<0||e.segmentIndex>=e.segmentCount))throw Error(`segmentIndex must be between 0 and ${e.segmentCount-1}`)}return t.handleOperation(async()=>await Da.post(t.fetch,`${t.url}/ListVectors`,e,{headers:t.headers}))}async queryVectors(e){var t=this;return t.handleOperation(async()=>await Da.post(t.fetch,`${t.url}/QueryVectors`,e,{headers:t.headers}))}async deleteVectors(e){var t=this;if(e.keys.length<1||e.keys.length>500)throw Error(`Keys batch size must be between 1 and 500 items`);return t.handleOperation(async()=>await Da.post(t.fetch,`${t.url}/DeleteVectors`,e,{headers:t.headers})||{})}},Va=class extends Oa{constructor(e,t={},n){let r=e.replace(/\/$/,``),i=P(P({},Ia),{},{"Content-Type":`application/json`},t);super(r,i,n,`vectors`)}async createBucket(e){var t=this;return t.handleOperation(async()=>await Da.post(t.fetch,`${t.url}/CreateVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}async getBucket(e){var t=this;return t.handleOperation(async()=>await Da.post(t.fetch,`${t.url}/GetVectorBucket`,{vectorBucketName:e},{headers:t.headers}))}async listBuckets(e={}){var t=this;return t.handleOperation(async()=>await Da.post(t.fetch,`${t.url}/ListVectorBuckets`,e,{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await Da.post(t.fetch,`${t.url}/DeleteVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}},Ha=class extends Va{constructor(e,t={}){super(e,t.headers||{},t.fetch)}from(e){return new Ua(this.url,this.headers,e,this.fetch)}async createBucket(e){var t=()=>super.createBucket,n=this;return t().call(n,e)}async getBucket(e){var t=()=>super.getBucket,n=this;return t().call(n,e)}async listBuckets(e={}){var t=()=>super.listBuckets,n=this;return t().call(n,e)}async deleteBucket(e){var t=()=>super.deleteBucket,n=this;return t().call(n,e)}},Ua=class extends za{constructor(e,t,n,r){super(e,t,r),this.vectorBucketName=n}async createIndex(e){var t=()=>super.createIndex,n=this;
30return t().call(n,P(P({},e),{},{vectorBucketName:n.vectorBucketName}))}async listIndexes(e={}){var t=()=>super.listIndexes,n=this;return t().call(n,P(P({},e),{},{vectorBucketName:n.vectorBucketName}))}async getIndex(e){var t=()=>super.getIndex,n=this;return t().call(n,n.vectorBucketName,e)}async deleteIndex(e){var t=()=>super.deleteIndex,n=this;return t().call(n,n.vectorBucketName,e)}index(e){return new Wa(this.url,this.headers,this.vectorBucketName,e,this.fetch)}},Wa=class extends Ba{constructor(e,t,n,r,i){super(e,t,i),this.vectorBucketName=n,this.indexName=r}async putVectors(e){var t=()=>super.putVectors,n=this;return t().call(n,P(P({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async getVectors(e){var t=()=>super.getVectors,n=this;return t().call(n,P(P({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async listVectors(e={}){var t=()=>super.listVectors,n=this;return t().call(n,P(P({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async queryVectors(e){var t=()=>super.queryVectors,n=this;return t().call(n,P(P({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async deleteVectors(e){var t=()=>super.deleteVectors,n=this;return t().call(n,P(P({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}},Ga=class extends La{constructor(e,t={},n,r){super(e,t,n,r)}from(e){return new Fa(this.url,this.headers,e,this.fetch)}get vectors(){return new Ha(this.url+`/vector`,{headers:this.headers,fetch:this.fetch})}get analytics(){return new Ra(this.url+`/iceberg`,this.headers,this.fetch)}},Ka=`2.108.2`,qa=30*1e3,Ja=3*qa,Ya=2*qa,Xa=`http://localhost:9999`,Za=`supabase.auth.token`,Qa={"X-Client-Info":`gotrue-js/${Ka}`},$a=`X-Supabase-Api-Version`,eo={"2024-01-01":{timestamp:Date.parse(`2024-01-01T00:00:00.0Z`),name:`2024-01-01`}},to=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,no=class extends Error{constructor(e,t,n){super(e),this.__isAuthError=!0,this.name=`AuthError`,this.status=t,this.code=n}toJSON(){return{name:this.name,message:this.message,status:this.status,code:this.code}}};function F(e){return typeof e==`object`&&!!e&&`__isAuthError`in e}var ro=class extends no{constructor(e,t,n){super(e,t,n),this.name=`AuthApiError`,this.status=t,this.code=n}};function io(e){return F(e)&&e.name===`AuthApiError`}var ao=class extends no{constructor(e,t){super(e),this.name=`AuthUnknownError`,this.originalError=t}},oo=class extends no{constructor(e,t,n,r){super(e,n,r),this.name=t,this.status=n}},I=class extends oo{constructor(){super(`Auth session missing!`,`AuthSessionMissingError`,400,void 0)}};function so(e){return F(e)&&e.name===`AuthSessionMissingError`}var co=class extends oo{constructor(){super(`Auth session or user missing`,`AuthInvalidToken
30ResponseError`,500,void 0)}},lo=class extends oo{constructor(e){super(e,`AuthInvalidCredentialsError`,400,void 0)}},uo=class extends oo{constructor(e,t=null){super(e,`AuthImplicitGrantRedirectError`,500,void 0),this.details=null,this.details=t}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}};function fo(e){return F(e)&&e.name===`AuthImplicitGrantRedirectError`}var po=class extends oo{constructor(e,t=null){super(e,`AuthPKCEGrantCodeExchangeError`,500,void 0),this.details=null,this.details=t}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}},mo=class extends oo{constructor(){super(`PKCE code verifier not found in storage. This can happen if the auth flow was initiated in a different browser or device, or if the storage was cleared. For SSR frameworks (Next.js, SvelteKit, etc.), use @supabase/ssr on both the server and client to store the code verifier in cookies.`,`AuthPKCECodeVerifierMissingError`,400,`pkce_code_verifier_not_found`)}},ho=class extends oo{constructor(e,t){super(e,`AuthRetryableFetchError`,t,void 0)}};function go(e){return F(e)&&e.name===`AuthRetryableFetchError`}var L=class extends oo{constructor(e=`Refresh result discarded: session state changed mid-flight (e.g., concurrent signOut)`){super(e,`AuthRefreshDiscardedError`,409,void 0)}};function _o(e){return F(e)&&e.name===`AuthRefreshDiscardedError`}var vo=class extends oo{constructor(e,t,n){super(e,`AuthWeakPasswordError`,t,`weak_password`),this.reasons=n}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{reasons:this.reasons})}},yo=class extends oo{constructor(e){super(e,`AuthInvalidJwtError`,400,`invalid_jwt`)}},bo=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_`.split(``),xo=` 31\r=`.split(``),So=(()=>{let e=Array(128);for(let t=0;t<e.length;t+=1)e[t]=-1;for(let t=0;t<xo.length;t+=1)e[xo[t].charCodeAt(0)]=-2;for(let t=0;t<bo.length;t+=1)e[bo[t].charCodeAt(0)]=t;return e})();function Co(e,t,n){if(e!==null)for(t.queue=t.queue<<8|e,t.queuedBits+=8;t.queuedBits>=6;)n(bo[t.queue>>t.queuedBits-6&63]),t.queuedBits-=6;else if(t.queuedBits>0)for(t.queue<<=6-t.queuedBits,t.queuedBits=6;t.queuedBits>=6;)n(bo[t.queue>>t.queuedBits-6&63]),t.queuedBits-=6}function wo(e,t,n){let r=So[e];if(r>-1)for(t.queue=t.queue<<6|r,t.queuedBits+=6;t.queuedBits>=8;)n(t.queue>>t.queuedBits-8&255),t.queuedBits-=8;else if(r===-2)return;else throw Error(`Invalid Base64-URL character "${String.fromCharCode(e)}"`)}function To(e){let t=[],n=e=>{t.push(String.fromCodePoint(e))},r={utf8seq:0,codepoint:0},i={queue:0,queuedBits:0},a=e=>{Oo(e,r,n)};for(let t=0;t<e.length;t+=1)wo(e.charCodeAt(t),i,a);return t.join(``)}function Eo(e,t){if(e<=127){t(e);return}else if(e<=2047){t(192|e>>6),t(128|e&63);return}else if(e<=65535){t(224|e>>12),t(128|e>>6&63),t(128|e&63);return}else if(e<=1114111){t(240|e>>18),t(128|e>>12&63),t(128|e>>6&63),t(128|e&63);return}throw Error(`Unrecognized Unicode codepoint: ${e.toString(16)}`)}function Do(e,t){for(let n=0;n<e.length;n+=1){let r=e.charCodeAt(n);if(r>55295&&r<=56319){let t=(r-55296)*1024&65535;r=(e.charCodeAt(n+1)-56320&65535|t)+65536,n+=1}Eo(r,t)}}function Oo(e,t,n){if(t.utf8seq===0){if(e<=127){n(e);return}for(let n=1;n<6;n+=1)if(!(e>>7-n&1)){t.utf8seq=n;break}if(t.utf8seq===2)t.codepoint=e&31;else if(t.utf8seq===3)t.codepoint=e&15;else if(t.utf8seq===4)t.codepoint=e&7;else throw Error(`Invalid UTF-8 sequence`);--t.utf8seq}else if(t.utf8seq>0){if(e<=127)throw Error(`Invalid UTF-8 sequence`);t.codepoint=t.codepoint<<6|e&63,--t.utf8seq,t.utf8seq===0&&n(t.codepoint)}}function ko(e){let t=[],n={queue:0,queuedBits:0},r=e=>{t.push(e)};for(let t=0;t<e.length;t+=1)wo(e.charCodeAt(t),n,r);return new Uint8Array(t)}function Ao(e){let t=[];return Do(e,e=>t.push(e)),new Uint8Array(t)}function jo(e){let t=[],n={queue:0,queuedBits:0},r=e=>{t.push(e)};return e.forEach(e=>Co(e,n,r)),Co(null,n,r),t.join(``)}function Mo(e){return Math.round(Date.now()/1e3)+e}function No(){return Symbol(`auth-callback`)}var Po=()=>typeof window<`u`&&typeof document<`u`,Fo={tested:!1,writable:!1},Io=()=>
31{if(!Po())return!1;try{if(typeof globalThis.localStorage!=`object`)return!1}catch{return!1}if(Fo.tested)return Fo.writable;let e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),Fo.tested=!0,Fo.writable=!0}catch{Fo.tested=!0,Fo.writable=!1}return Fo.writable};function Lo(e){let t={},n=new URL(e);if(n.hash&&n.hash[0]===`#`)try{new URLSearchParams(n.hash.substring(1)).forEach((e,n)=>{t[n]=e})}catch{}return n.searchParams.forEach((e,n)=>{t[n]=e}),t}var Ro=e=>e?(...t)=>e(...t):(...e)=>fetch(...e),zo=e=>typeof e==`object`&&!!e&&`status`in e&&`ok`in e&&`json`in e&&typeof e.json==`function`,Bo=async(e,t,n)=>{await e.setItem(t,JSON.stringify(n))},Vo=async(e,t)=>{let n=await e.getItem(t);if(!n)return null;try{return JSON.parse(n)}catch{return null}},Ho=async(e,t)=>{await e.removeItem(t)},Uo=class e{constructor(){this.promise=new e.promiseConstructor((e,t)=>{this.resolve=e,this.reject=t})}};Uo.promiseConstructor=Promise;function Wo(e){let t=e.split(`.`);if(t.length!==3)throw new yo(`Invalid JWT structure`);for(let e=0;e<t.length;e++)if(!to.test(t[e]))throw new yo(`JWT not in base64url format`);return{header:JSON.parse(To(t[0])),payload:JSON.parse(To(t[1])),signature:ko(t[2]),raw:{header:t[0],payload:t[1]}}}async function Go(e){return await new Promise(t=>{setTimeout(()=>t(null),e)})}function Ko(e,t){return new Promise((n,r)=>{(async()=>{for(let i=0;i<1/0;i++)try{let r=await e(i);if(!t(i,null,r)){n(r);return}}catch(e){if(!t(i,e)){r(e);return}}})()})}function qo(e){return(`0`+e.toString(16)).substr(-2)}function Jo(){let e=new Uint32Array(56);if(typeof crypto>`u`){let e=``;for(let t=0;t<56;t++)e+=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~`.charAt(Math.floor(Math.random()*66));return e}return crypto.getRandomValues(e),Array.from(e,qo).join(``)}async function Yo(e){let t=new TextEncoder().encode(e),n=await crypto.subtle.digest(`SHA-256`,t),r=new Uint8Array(n);return Array.from(r).map(e=>String.fromCharCode(e)).join(``)}async function Xo(e){if(!(typeof crypto<`u`&&crypto.subtle!==void 0&&typeof TextEncoder<`u`))return console.warn(`WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256.`),e;let t=await Yo(e);return btoa(t).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/,``)}async function Zo(e,t,n=!1){let r=Jo(),i=r;n&&(i+=`/recovery`),await Bo(e,`${t}-code-verifier`,i);let a=await Xo(r);return[a,r===a?`plain`:`s256`]}var Qo=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function $o(e){let t=e.headers.get($a);if(!t||!t.match(Qo))return null;try{return new Date(`${t}T00:00:00.0Z`)}catch{return null}}function es(e){if(!e)throw Error(`Missing exp claim`);if(e<=Math.floor(Date.now()/1e3))throw Error(`JWT has expired`)}function ts(e){switch(e){case`RS256`:return{name:`RSASSA-PKCS1-v1_5`,hash:{name:`SHA-256`}};case`ES256`:return{name:`ECDSA`,namedCurve:`P-256`,hash:{name:`SHA-256`}};default:throw Error(`Invalid alg claim`)}}var ns=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function rs(e){if(!ns.test(e))throw Error(`@supabase/auth-js: Expected parameter to be UUID but is not`)}function is(e){if(!e.passkey)throw Error("@supabase/auth-js: the passkey API is experimental and disabled by default. Enable it by passing `auth: { experimental: { passkey: true } }` to createClient (or to the GoTrueClient constructor).")}function as(){return new Proxy({},{get:(e,t)=>{if(t===`__isUserNotAvailableProxy`)return!0;if(typeof t==`symbol`){let e=t.toString();if(e===`Symbol(Symbol.toPrimitive)`||e===`Symbol(Symbol.toStringTag)`||e===`Symbol(util.inspect.custom)`)return}throw Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Accessing the "${t}" property of the session object is not supported. Please use getUser() instead.`)},set:(e,t)=>{throw Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${t}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(e,t)=>{throw Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${t}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function ss(e,t){return new Proxy(e,{get:(e,n,r)=>{if(n===`__isInsecureUserWarningProxy`)return!0;
31if(typeof n==`symbol`){let t=n.toString();if(t===`Symbol(Symbol.toPrimitive)`||t===`Symbol(Symbol.toStringTag)`||t===`Symbol(util.inspect.custom)`||t===`Symbol(nodejs.util.inspect.custom)`)return Reflect.get(e,n,r)}return!t.value&&typeof n==`string`&&(console.warn(`Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server.`),t.value=!0),Reflect.get(e,n,r)}})}function cs(e){return JSON.parse(JSON.stringify(e))}var ls=e=>{if(typeof e==`object`&&e){let t=e;if(typeof t.msg==`string`)return t.msg;if(typeof t.message==`string`)return t.message;if(typeof t.error_description==`string`)return t.error_description;if(typeof t.error==`string`)return t.error}return JSON.stringify(e)},us=[500,501,502,503,504,520,521,522,523,524,525,526,527,528,529,530];async function ds(e){if(!zo(e))throw new ho(ls(e),0);if(us.includes(e.status))throw new ho(ls(e),e.status);let t;try{t=await e.json()}catch(e){throw new ao(ls(e),e)}let n,r=$o(e);if(r&&r.getTime()>=eo[`2024-01-01`].timestamp&&typeof t==`object`&&t&&typeof t.code==`string`?n=t.code:typeof t==`object`&&t&&typeof t.error_code==`string`&&(n=t.error_code),!n){if(typeof t==`object`&&t&&typeof t.weak_password==`object`&&t.weak_password&&Array.isArray(t.weak_password.reasons)&&t.weak_password.reasons.length&&t.weak_password.reasons.reduce((e,t)=>e&&typeof t==`string`,!0))throw new vo(ls(t),e.status,t.weak_password.reasons)}else if(n===`weak_password`)throw new vo(ls(t),e.status,t.weak_password?.reasons||[]);else if(n===`session_not_found`)throw new I;throw new ro(ls(t),e.status||500,n)}var fs=(e,t,n,r)=>{let i={method:e,headers:t?.headers||{}};return e===`GET`?i:(i.headers=Object.assign({"Content-Type":`application/json;charset=UTF-8`},t?.headers),i.body=JSON.stringify(r),Object.assign(Object.assign({},i),n))};async function R(e,t,n,r){let i=Object.assign({},r?.headers);i[`X-Supabase-Api-Version`]||(i[$a]=eo[`2024-01-01`].name),r?.jwt&&(i.Authorization=`Bearer ${r.jwt}`);let a=r?.query??{};r?.redirectTo&&(a.redirect_to=r.redirectTo);let o=await ps(e,t,n+(Object.keys(a).length?`?`+new URLSearchParams(a).toString():``),{headers:i,noResolveJson:r?.noResolveJson},{},r?.body);return r?.xform?r?.xform(o):{data:Object.assign({},o),error:null}}async function ps(e,t,n,r,i,a){let o=fs(t,r,i,a),s;try{s=await e(n,Object.assign({},o))}catch(e){throw console.error(e),new ho(ls(e),0)}if(s.ok||await ds(s),r?.noResolveJson)return s;try{return await s.json()}catch(e){await ds(e)}}function ms(e){let t=null;bs(e)&&(t=Object.assign({},e),e.expires_at||(t.expires_at=Mo(e.expires_in)));let n=e.user??(typeof e?.id==`string`?e:null);return{data:{session:t,user:n},error:null}}function hs(e){let t=ms(e);return!t.error&&e.weak_password&&typeof e.weak_password==`object`&&Array.isArray(e.weak_password.reasons)&&e.weak_password.reasons.length&&e.weak_password.message&&typeof e.weak_password.message==`string`&&e.weak_password.reasons.reduce((e,t)=>e&&typeof t==`string`,!0)&&(t.data.weak_password=e.weak_password),t}function gs(e){return{data:{user:e.user??e},error:null}}function _s(e){return{data:e,error:null}}function vs(e){let{action_link:t,email_otp:n,hashed_token:r,redirect_to:i,verification_type:a}=e,o=lr(e,[`action_link`,`email_otp`,`hashed_token`,`redirect_to`,`verification_type`]);return{data:{properties:{action_link:t,email_otp:n,hashed_token:r,redirect_to:i,verification_type:a},user:Object.assign({},o)},error:null}}function ys(e){return e}function bs(e){return!!e.access_token&&!!e.refresh_token&&!!e.expires_in}var xs=[`global`,`local`,`others`],Ss=class{constructor({url:e=``,headers:t={},fetch:n,experimental:r}){this.url=e,this.headers=t,this.fetch=Ro(n),this.experimental=r??{},this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)},this.oauth={listClients:this._listOAuthClients.bind(this),createClient:this._createOAuthClient.bind(this),getClient:this._getOAuthClient.bind(this),updateClient:this._updateOAuthClient.bind(this),deleteClient:this._deleteOAuthClient.bind(this),regenerateClientSecret:this._regenerateOAuthClientSecret.bind(this)},this.customProviders={listProviders:this._listCustomProviders.bind(this),createProvider:this._createCustomProvider.bind(this),getProvider:this._getCustomProvider.bind(this),updateProvider:this._updateCustomProvider.bind(this),deleteProvider:this._deleteCustomProvider.bind(this)},this.passkey={listPasskeys:this._adminListPasskeys.bind(this),deletePasskey:this._adminDeletePasskey.bind(this)}}async signOut(e,t=xs[0]){if(xs.indexOf(t)<0)throw Error(`@supabase/auth-js: Parameter scope must be one of ${xs.join(`, `)}`);try{return await R(this.fetch,`POST`,`${this.url}/logout?scope=${t}`,{headers:this.headers,jwt:e,noResolveJson:!0}),{data:null,error:null}}catch(e){if(F(e))return{data:null,error:e};throw e}}async inviteUserByEmail(e,t={}){try{return await R(this.fetch,`POST`,`${this.url}/invite`,{body:{email:e,data:t.data},headers:this.headers,redirectTo:t.redirectTo,xform:gs})}catch(e){if(F(e))return{data:{user:null},error:e};throw e}}async generateLink(e){try{let{options:t}=e,n=lr(e,[`options`]),r=Object.assign(Object.assign({},n),t);
31return`newEmail`in n&&(r.new_email=n?.newEmail,delete r.newEmail),await R(this.fetch,`POST`,`${this.url}/admin/generate_link`,{body:r,headers:this.headers,xform:vs,redirectTo:t?.redirectTo})}catch(e){if(F(e))return{data:{properties:null,user:null},error:e};throw e}}async createUser(e){try{return await R(this.fetch,`POST`,`${this.url}/admin/users`,{body:e,headers:this.headers,xform:gs})}catch(e){if(F(e))return{data:{user:null},error:e};throw e}}async listUsers(e){try{let t={nextPage:null,lastPage:0,total:0},n=await R(this.fetch,`GET`,`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(e?.page)?.toString()??``,per_page:(e?.perPage)?.toString()??``},xform:ys});if(n.error)throw n.error;let r=await n.json(),i=n.headers.get(`x-total-count`)??0,a=n.headers.get(`link`)?.split(`,`)??[];return a.length>0&&(a.forEach(e=>{let n=parseInt(e.split(`;`)[0].split(`=`)[1].substring(0,1)),r=JSON.parse(e.split(`;`)[1].split(`=`)[1]);t[`${r}Page`]=n}),t.total=parseInt(i)),{data:Object.assign(Object.assign({},r),t),error:null}}catch(e){if(F(e))return{data:{users:[]},error:e};throw e}}async getUserById(e){rs(e);try{return await R(this.fetch,`GET`,`${this.url}/admin/users/${e}`,{headers:this.headers,xform:gs})}catch(e){if(F(e))return{data:{user:null},error:e};throw e}}async updateUserById(e,t){rs(e);try{return await R(this.fetch,`PUT`,`${this.url}/admin/users/${e}`,{body:t,headers:this.headers,xform:gs})}catch(e){if(F(e))return{data:{user:null},error:e};throw e}}async deleteUser(e,t=!1){rs(e);try{return await R(this.fetch,`DELETE`,`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:t},xform:gs})}catch(e){if(F(e))return{data:{user:null},error:e};throw e}}async _listFactors(e){rs(e.userId);try{let{data:t,error:n}=await R(this.fetch,`GET`,`${this.url}/admin/users/${e.userId}/factors`,{headers:this.headers,xform:e=>({data:{factors:e},error:null})});return{data:t,error:n}}catch(e){if(F(e))return{data:null,error:e};throw e}}async _deleteFactor(e){rs(e.userId),rs(e.id);try{return{data:await R(this.fetch,`DELETE`,`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers}),error:null}}catch(e){if(F(e))return{data:null,error:e};throw e}}async _listOAuthClients(e){try{let t={nextPage:null,lastPage:0,total:0},n=await R(this.fetch,`GET`,`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(e?.page)?.toString()??``,per_page:(e?.perPage)?.toString()??``},xform:ys});if(n.error)throw n.error;let r=await n.json(),i=n.headers.get(`x-total-count`)??0,a=n.headers.get(`link`)?.split(`,`)??[];return a.length>0&&(a.forEach(e=>{let n=parseInt(e.split(`;`)[0].split(`=`)[1].substring(0,1)),r=JSON.parse(e.split(`;`)[1].split(`=`)[1]);t[`${r}Page`]=n}),t.total=parseInt(i)),{data:Object.assign(Object.assign({},r),t),error:null}}catch(e){if(F(e))return{data:{clients:[]},error:e};throw e}}async _createOAuthClient(e){try{return await R(this.fetch,`POST`,`${this.url}/admin/oauth/clients`,{body:e,headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(F(e))return{data:null,error:e};throw e}}async _getOAuthClient(e){try{return await R(this.fetch,`GET`,`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(F(e))return{data:null,error:e};throw e}}async _updateOAuthClient(e,t){try{return await R(this.fetch,`PUT`,`${this.url}/admin/oauth/clients/${e}`,{body:t,headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(F(e))return{data:null,error:e};throw e}}async _deleteOAuthClient(e){try{return await R(this.fetch,`DELETE`,`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(e){if(F(e))return{data:null,error:e};throw e}}async _regenerateOAuthClientSecret(e){try{return await R(this.fetch,`POST`,`${this.url}/admin/oauth/clients/${e}/regenerate_secret`,{headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(F(e))return{data:null,error:e};throw e}}async _listCustomProviders(e){try{let t={};return e?.type&&(t.type=e.type),await R(this.fetch,`GET`,`${this.url}/admin/custom-providers`,{headers:this.headers,query:t,xform:e=>({data:{providers:e?.providers??[]},error:null})})}catch(e){if(F(e))return{data:{providers:[]},error:e};throw e}}async _createCustomProvider(e){try{return await R(this.fetch,`POST`,`${this.url}/admin/custom-providers`,{body:e,headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(F(e))return{data:null,error:e};throw e}}async _getCustomProvider(e){try{return await R(this.fetch,`GET`,`${this.url}/admin/custom-providers/${e}`,{headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(F(e))return{data:null,error:e};throw e}}async _updateCustomProvider(e,t){try{return await R(this.fetch,`PUT`,`${this.url}/admin/custom-providers/${e}`,{body:t,headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(F(e))return{data:null,error:e};throw e}}async _deleteCustomProvider(e){try{return await R(this.fetch,`DELETE`,`${this.url}/admin/custom-providers/${e}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(e){if(F(e))return{data:null,error:e};throw e}}async _adminListPasskeys(e){is(this.experimental),rs(e.userId);try{return await R(this.fetch,`GET`,`${this.url}/admin/users/${e.userId}/passkeys`,{headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(F(e))return{data:null,error:e};throw e}}async _adminDeletePasskey(e){is(this.experimental),rs(e.userId),rs(e.passkeyId);try{return await R(this.fetch,`DELETE`,`${this.url}/admin/users/${e.userId}/passkeys/${e.passkeyId}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(e){if(F(e))return{data:null,error:e};throw e}}};function Cs(e={}){return{getItem:t=>
31e[t]||null,setItem:(t,n)=>{e[t]=n},removeItem:t=>{delete e[t]}}}globalThis&&Io()&&globalThis.localStorage&&globalThis.localStorage.getItem(`supabase.gotrue-js.locks.debug`);var ws=class extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}};function Ts(){if(typeof globalThis!=`object`)try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch{typeof self<`u`&&(self.globalThis=self)}}function Es(e){if(!/^0x[a-fA-F0-9]{40}$/.test(e))throw Error(`@supabase/auth-js: Address "${e}" is invalid.`);return e.toLowerCase()}function Ds(e){return parseInt(e,16)}function Os(e){let t=new TextEncoder().encode(e);return`0x`+Array.from(t,e=>e.toString(16).padStart(2,`0`)).join(``)}function ks(e){let{chainId:t,domain:n,expirationTime:r,issuedAt:i=new Date,nonce:a,notBefore:o,requestId:s,resources:c,scheme:l,uri:u,version:d}=e;if(!Number.isInteger(t))throw Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${t}`);if(!n)throw Error(`@supabase/auth-js: Invalid SIWE message field "domain". Domain must be provided.`);if(a&&a.length<8)throw Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${a}`);if(!u)throw Error(`@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.`);if(d!==`1`)throw Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${d}`);if(e.statement?.includes(` 32`))throw Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${e.statement}`);let f=Es(e.address),p=`${l?`${l}://${n}`:n} wants you to sign in with your Ethereum account:\n${f}\n\n${e.statement?`${e.statement}\n`:``}`,m=`URI: ${u}\nVersion: ${d}\nChain ID: ${t}${a?`\nNonce: ${a}`:``}\nIssued At: ${i.toISOString()}`;if(r&&(m+=`\nExpiration Time: ${r.toISOString()}`),o&&(m+=`\nNot Before: ${o.toISOString()}`),s&&(m+=`\nRequest ID: ${s}`),c){let e=` 33Resources:`;for(let t of c){if(!t||typeof t!=`string`)throw Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${t}`);e+=`\n- ${t}`}m+=e}return`${p}\n${m}`}var As=class extends Error{constructor({message:e,code:t,cause:n,name:r}){super(e,{cause:n}),this.__isWebAuthnError=!0,this.name=r??(n instanceof Error?n.name:void 0)??`Unknown Error`,this.code=t}toJSON(){return{name:this.name,message:this.message,code:this.code}}},js=class extends As{constructor(e,t){super({code:`ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY`,cause:t,message:e}),this.name=`WebAuthnUnknownError`,this.originalError=t}};function Ms({error:e,options:t}){let{publicKey:n}=t;if(!n)throw Error(`options was missing required publicKey property`);if(e.name===`AbortError`){if(t.signal instanceof AbortSignal)return new As({message:`Registration ceremony was sent an abort signal`,code:`ERROR_CEREMONY_ABORTED`,cause:e})}else if(e.name===`ConstraintError`){if(n.authenticatorSelection?.requireResidentKey===!0)return new As({message:`Discoverable credentials were required but no available authenticator supported it`,code:`ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT`,cause:e});if(t.mediation===`conditional`&&n.authenticatorSelection?.userVerification===`required`)return new As({message:`User verification was required during automatic registration but it could not be performed`,code:`ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE`,cause:e});if(n.authenticatorSelection?.userVerification===`required`)return new As({message:`User verification was required but no available authenticator supported it`,code:`ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT`,cause:e})}else if(e.name===`InvalidStateError`)return new As({message:`The authenticator was previously registered`,code:`ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED`,cause:e});else if(e.name===`NotAllowedError`)return new As({message:e.message,code:`ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY`,cause:e});else if(e.name===`NotSupportedError`)return n.pubKeyCredParams.filter(e=>e.type===`public-key`).length===0?new As({message:`No entry in pubKeyCredParams was of type "public-key"`,code:`ERROR_MALFORMED_PUBKEYCREDPARAMS`,cause:e}):new As({message:`No available authenticator supported any of the specified pubKeyCredParams algorithms`,code:`ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG`,cause:e});else if(e.name===`SecurityError`){let t=window.location.hostname;if(!zs(t))return new As({message:`${window.location.hostname}
33 is an invalid domain`,code:`ERROR_INVALID_DOMAIN`,cause:e});if(n.rp.id!==t)return new As({message:`The RP ID "${n.rp.id}" is invalid for this domain`,code:`ERROR_INVALID_RP_ID`,cause:e})}else if(e.name===`TypeError`){if(n.user.id.byteLength<1||n.user.id.byteLength>64)return new As({message:`User ID was not between 1 and 64 characters`,code:`ERROR_INVALID_USER_ID_LENGTH`,cause:e})}else if(e.name===`UnknownError`)return new As({message:`The authenticator was unable to process the specified options, or could not create a new credential`,code:`ERROR_AUTHENTICATOR_GENERAL_ERROR`,cause:e});return new As({message:`a Non-Webauthn related error has occurred`,code:`ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY`,cause:e})}function Ns({error:e,options:t}){let{publicKey:n}=t;if(!n)throw Error(`options was missing required publicKey property`);if(e.name===`AbortError`){if(t.signal instanceof AbortSignal)return new As({message:`Authentication ceremony was sent an abort signal`,code:`ERROR_CEREMONY_ABORTED`,cause:e})}else if(e.name===`NotAllowedError`)return new As({message:e.message,code:`ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY`,cause:e});else if(e.name===`SecurityError`){let t=window.location.hostname;if(!zs(t))return new As({message:`${window.location.hostname} is an invalid domain`,code:`ERROR_INVALID_DOMAIN`,cause:e});if(n.rpId!==t)return new As({message:`The RP ID "${n.rpId}" is invalid for this domain`,code:`ERROR_INVALID_RP_ID`,cause:e})}else if(e.name===`UnknownError`)return new As({message:`The authenticator was unable to process the specified options, or could not create a new assertion signature`,code:`ERROR_AUTHENTICATOR_GENERAL_ERROR`,cause:e});return new As({message:`a Non-Webauthn related error has occurred`,code:`ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY`,cause:e})}var Ps=new class{createNewAbortSignal(){if(this.controller){let e=Error(`Cancelling existing WebAuthn API call for new one`);e.name=`AbortError`,this.controller.abort(e)}let e=new AbortController;return this.controller=e,e.signal}cancelCeremony(){if(this.controller){let e=Error(`Manually cancelling existing WebAuthn API call`);e.name=`AbortError`,this.controller.abort(e),this.controller=void 0}}};function Fs(e){if(!e)throw Error(`Credential creation options are required`);if(typeof PublicKeyCredential<`u`&&`parseCreationOptionsFromJSON`in PublicKeyCredential&&typeof PublicKeyCredential.parseCreationOptionsFromJSON==`function`)return PublicKeyCredential.parseCreationOptionsFromJSON(e);let{challenge:t,user:n,excludeCredentials:r}=e,i=lr(e,[`challenge`,`user`,`excludeCredentials`]),a=ko(t).buffer,o=Object.assign(Object.assign({},n),{id:ko(n.id).buffer}),s=Object.assign(Object.assign({},i),{challenge:a,user:o});if(r&&r.length>0){s.excludeCredentials=Array(r.length);for(let e=0;e<r.length;e++){let t=r[e];s.excludeCredentials[e]=Object.assign(Object.assign({},t),{id:ko(t.id).buffer,type:t.type||`public-key`,transports:t.transports})}}return s}function Is(e){if(!e)throw Error(`Credential request options are required`);if(typeof PublicKeyCredential<`u`&&`parseRequestOptionsFromJSON`in PublicKeyCredential&&typeof PublicKeyCredential.parseRequestOptionsFromJSON==`function`)return PublicKeyCredential.parseRequestOptionsFromJSON(e);let{challenge:t,allowCredentials:n}=e,r=lr(e,[`challenge`,`allowCredentials`]),i=ko(t).buffer,a=Object.assign(Object.assign({},r),{challenge:i});if(n&&n.length>0){a.allowCredentials=Array(n.length);for(let e=0;e<n.length;e++){let t=n[e];a.allowCredentials[e]=Object.assign(Object.assign({},t),{id:ko(t.id).buffer,type:t.type||`public-key`,transports:t.transports})}}return a}function Ls(e){if(`toJSON`in e&&typeof e.toJSON==`function`)return e.toJSON();let t=e;return{id:e.id,rawId:e.id,response:{attestationObject:jo(new Uint8Array(e.response.attestationObject)),clientDataJSON:jo(new Uint8Array(e.response.clientDataJSON))},type:`public-key`,clientExtensionResults:e.getClientExtensionResults(),authenticatorAttachment:t.authenticatorAttachment??void 0}}function Rs(e){if(`toJSON`in e&&typeof e.toJSON==`function`)return e.toJSON();let t=e,n=e.getClientExtensionResults(),r=e.response;return{id:e.id,rawId:e.id,response:{authenticatorData:jo(new Uint8Array(r.authenticatorData)),clientDataJSON:jo(new Uint8Array(r.clientDataJSON)),signature:jo(new Uint8Array(r.signature)),userHandle:r.userHandle?jo(new Uint8Array(r.userHandle)):void 0},type:`public-key`,clientExtensionResults:n,authenticatorAttachment:t.authenticatorAttachment??void 0}}function zs(e){return e===`localhost`||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e)}function Bs(){return!!(Po()&&`PublicKeyCredential`in window&&window.PublicKeyCredential&&`credentials`in navigator&&typeof(navigator==null?void 0:navigator.credentials)?.create==`function`&&typeof(navigator==null?void 0:navigator.credentials)?.get==`function`)}async function Vs(e){try{let t=await navigator.credentials.create(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new js(`Browser returned unexpected credential type`,t)}:{data:null,error:new js(`Empty credential response`,t)}}
33catch(t){return{data:null,error:Ms({error:t,options:e})}}}async function Hs(e){try{let t=await navigator.credentials.get(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new js(`Browser returned unexpected credential type`,t)}:{data:null,error:new js(`Empty credential response`,t)}}catch(t){return{data:null,error:Ns({error:t,options:e})}}}var Us={hints:[`security-key`],authenticatorSelection:{authenticatorAttachment:`cross-platform`,requireResidentKey:!1,userVerification:`preferred`,residentKey:`discouraged`},attestation:`direct`},Ws={userVerification:`preferred`,hints:[`security-key`],attestation:`direct`};function Gs(...e){let t=e=>typeof e==`object`&&!!e&&!Array.isArray(e),n=e=>e instanceof ArrayBuffer||ArrayBuffer.isView(e),r={};for(let i of e)if(i)for(let e in i){let a=i[e];if(a!==void 0)if(Array.isArray(a))r[e]=a;else if(n(a))r[e]=a;else if(t(a)){let n=r[e];t(n)?r[e]=Gs(n,a):r[e]=Gs(a)}else r[e]=a}return r}function Ks(e,t){return Gs(Us,e,t||{})}function qs(e,t){return Gs(Ws,e,t||{})}var Js=class{constructor(e){this.client=e,this.enroll=this._enroll.bind(this),this.challenge=this._challenge.bind(this),this.verify=this._verify.bind(this),this.authenticate=this._authenticate.bind(this),this.register=this._register.bind(this)}async _enroll(e){return this.client.mfa.enroll(Object.assign(Object.assign({},e),{factorType:`webauthn`}))}async _challenge({factorId:e,webauthn:t,friendlyName:n,signal:r},i){try{let{data:a,error:o}=await this.client.mfa.challenge({factorId:e,webauthn:t});if(!a)return{data:null,error:o};let s=r??Ps.createNewAbortSignal();if(a.webauthn.type===`create`){let{user:e}=a.webauthn.credential_options.publicKey;if(!e.name){let t=n;if(t)e.name=`${e.id}:${t}`;else{let t=(await this.client.getUser()).data.user,n=t?.user_metadata?.name||t?.email||t?.id||`User`;e.name=`${e.id}:${n}`}}e.displayName||=e.name}switch(a.webauthn.type){case`create`:{let{data:t,error:n}=await Vs({publicKey:Ks(a.webauthn.credential_options.publicKey,i?.create),signal:s});return t?{data:{factorId:e,challengeId:a.id,webauthn:{type:a.webauthn.type,credential_response:t}},error:null}:{data:null,error:n}}case`request`:{let t=qs(a.webauthn.credential_options.publicKey,i?.request),{data:n,error:r}=await Hs(Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:t,signal:s}));return n?{data:{factorId:e,challengeId:a.id,webauthn:{type:a.webauthn.type,credential_response:n}},error:null}:{data:null,error:r}}}}catch(e){return F(e)?{data:null,error:e}:{data:null,error:new ao(`Unexpected error in challenge`,e)}}}async _verify({challengeId:e,factorId:t,webauthn:n}){return this.client.mfa.verify({factorId:t,challengeId:e,webauthn:n})}async _authenticate({factorId:e,webauthn:{rpId:t=typeof window<`u`?window.location.hostname:void 0,rpOrigins:n=typeof window<`u`?[window.location.origin]:void 0,signal:r}={}},i){if(!t)return{data:null,error:new no(`rpId is required for WebAuthn authentication`)};try{if(!Bs())return{data:null,error:new ao(`Browser does not support WebAuthn`,null)};let{data:a,error:o}=await this.challenge({factorId:e,webauthn:{rpId:t,rpOrigins:n},signal:r},{request:i});if(!a)return{data:null,error:o};let{webauthn:s}=a;return this._verify({factorId:e,challengeId:a.challengeId,webauthn:{type:s.type,rpId:t,rpOrigins:n,credential_response:s.credential_response}})}catch(e){return F(e)?{data:null,error:e}:{data:null,error:new ao(`Unexpected error in authenticate`,e)}}}async _register({friendlyName:e,webauthn:{rpId:t=typeof window<`u`?window.location.hostname:void 0,rpOrigins:n=typeof window<`u`?[window.location.origin]:void 0,signal:r}={}},i){if(!t)return{data:null,error:new no(`rpId is required for WebAuthn registration`)};try{if(!Bs())return{data:null,error:new ao(`Browser does not support WebAuthn`,null)};let{data:a,error:o}=await this._enroll({friendlyName:e});if(!a)return await this.client.mfa.listFactors().then(t=>t.data?.all.find(t=>t.factor_type===`webauthn`&&t.friendly_name===e&&t.status!==`unverified`)).then(e=>e?this.client.mfa.unenroll({factorId:e?.id}):void 0),{data:null,error:o};let{data:s,error:c}=await this._challenge({factorId:a.id,friendlyName:a.friendly_name,webauthn:{rpId:t,rpOrigins:n},signal:r},{create:i});return s?this._verify({factorId:a.id,challengeId:s.challengeId,webauthn:{rpId:t,rpOrigins:n,type:s.webauthn.type,credential_response:s.webauthn.credential_response}}):{data:null,error:c}}catch(e){return F(e)?{data:null,error:e}:{data:null,error:new ao(`Unexpected error in register`,e)}}}};Ts();var Ys={url:Xa,storageKey:Za,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:Qa,flowType:`implicit`,debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:5e3,skipAutoInitialize:!1,experimental:{}},Xs={},Zs=class e{get jwks(){return Xs[this.storageKey]?.jwks??{keys:[]}}set jwks(e){Xs[this.storageKey]=Object.assign(Object.assign({}
33,Xs[this.storageKey]),{jwks:e})}get jwks_cached_at(){return Xs[this.storageKey]?.cachedAt??-(2**53-1)}set jwks_cached_at(e){Xs[this.storageKey]=Object.assign(Object.assign({},Xs[this.storageKey]),{cachedAt:e})}constructor(t){var n;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.autoRefreshTickTimeout=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.lastRefreshFailure=null,this._sessionRemovalEpoch=0,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lock=null,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log;let r=Object.assign(Object.assign({},Ys),t);if(this.storageKey=r.storageKey,this.instanceID=e.nextInstanceID[this.storageKey]??0,e.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!r.debug,typeof r.debug==`function`&&(this.logger=r.debug),this.instanceID>0&&Po()){let e=`${this._logPrefix()} Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.`;console.warn(e),this.logDebugMessages&&console.trace(e)}if(this.persistSession=r.persistSession,this.autoRefreshToken=r.autoRefreshToken,this.experimental=r.experimental??{},this.admin=new Ss({url:r.url,headers:r.headers,fetch:r.fetch,experimental:this.experimental}),this.url=r.url,this.headers=r.headers,this.fetch=Ro(r.fetch),this.detectSessionInUrl=r.detectSessionInUrl,this.flowType=r.flowType,this.hasCustomAuthorizationHeader=r.hasCustomAuthorizationHeader,this.throwOnError=r.throwOnError,this.lockAcquireTimeout=r.lockAcquireTimeout,r.lock!=null&&(this.lock=r.lock),this.jwks||(this.jwks={keys:[]},this.jwks_cached_at=-(2**53-1)),this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this),webauthn:new Js(this)},this.oauth={getAuthorizationDetails:this._getAuthorizationDetails.bind(this),approveAuthorization:this._approveAuthorization.bind(this),denyAuthorization:this._denyAuthorization.bind(this),listGrants:this._listOAuthGrants.bind(this),revokeGrant:this._revokeOAuthGrant.bind(this)},this.passkey={startRegistration:this._startPasskeyRegistration.bind(this),verifyRegistration:this._verifyPasskeyRegistration.bind(this),startAuthentication:this._startPasskeyAuthentication.bind(this),verifyAuthentication:this._verifyPasskeyAuthentication.bind(this),list:this._listPasskeys.bind(this),update:this._updatePasskey.bind(this),delete:this._deletePasskey.bind(this)},this.persistSession?(r.storage?this.storage=r.storage:Io()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=Cs(this.memoryStorage)),r.userStorage&&(this.userStorage=r.userStorage)):(this.memoryStorage={},this.storage=Cs(this.memoryStorage)),Po()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(e){console.error(`Failed to create a new BroadcastChannel, multi-tab state changes will not be available`,e)}(n=this.broadcastChannel)==null||n.addEventListener(`message`,async e=>{this._debug(`received broadcast notification from other tab or client`,e),(e.data.event===`TOKEN_REFRESHED`||e.data.event===`SIGNED_IN`)&&(this.lastRefreshFailure=null);try{await this._notifyAllSubscribers(e.data.event,e.data.session,!1)}catch(e){this._debug(`#broadcastChannel`,`error`,e)}})}r.skipAutoInitialize||this.initialize().catch(e=>{this._debug(`#initialize()`,`error`,e)})}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(e){if(this.throwOnError&&e&&e.error)throw e.error;return e}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${Ka}) ${new Date().toISOString()}`}_debug(...e){return this.logDebugMessages&&this.logger(this._logPrefix(),...e),this}async initialize(){return this.initializePromise||=(async()=>this.lock==null?await this._initialize():await this._acquireLock(this.lockAcquireTimeout,async()=>await this._initialize()))(),await this.initializePromise}async _initialize(){try{let e={},t=`none`;if(Po()&&(e=Lo(window.location.href),this._isImplicitGrantCallback(e)?t=`implicit`:await this._isPKCECallback(e)&&(t=`pkce`)),Po()&&this.detectSessionInUrl&&t!==`none`){let{data:n,error:r}=await this._getSessionFromURL(e,t);if(r){if(this._debug(`#_initialize()`,`error detecting session from URL`,r),fo(r)){let e=r.details?.code;if(e===`identity_already_exists`||e===`identity_not_found`||e===`single_identity_not_deletable`)return{error:r}}return{error:r}}let{session:i,redirectType:a}=n;return this._debug(`#_initialize()`,`detected session in URL`,i,`redirect type`,a),await this._saveSession(i),setTimeout(async()=>{a===`recovery`?await this._notifyAllSubscribers(`PASSWORD_RECOVERY`,i):await this._notifyAllSubscribers(`SIGNED_IN`,i)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(e){return F(e)?this._returnResult({error:e}):this._returnResult({error:new ao(`Unexpected error during initialization`,e)})}finally{await this._handleVisibilityChange(),this._debug(`#_initialize()`,`end`)}}async signInAnonymously(e){try{let{data:t,error:n}=await R(this.fetch,`POST`,`${this.url}/signup`,{headers:this.headers,body:{data:e?.options?.data??{},gotrue_meta_security:{captcha_token:e?.options?.captchaToken}},xform:ms});if(n||!t)return this._returnResult({data:{user:null,session:null},error:n});let r=t.session,i=t.user;return t.session&&(await this._saveSession(t.session),await this._notifyAllSubscribers(`SIGNED_IN`,r)),this._returnResult({data:{user:i,session:r},error:null})}catch(e){if(F(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signUp(e){try{let t;if(`email`in e){let{email:n,password:r,options:i}=e,a=null,o=null;this.flowType===`pkce`&&([a,o]=await Zo(this.storage,this.storageKey)),t=await R(this.fetch,`POST`,`${this.url}/signup`,{headers:this.headers,redirectTo:i?.emailRedirectTo,body:{email:n,password:r,data:i?.data??{},gotrue_meta_security:{captcha_token:i?.captchaToken},code_challenge:a,code_challenge_method:o},xform:ms})}else if(`phone`in e){let{phone:n,password:r,options:i}=e;t=await R(this.fetch,`POST`,`${this.url}/signup`,{headers:this.headers,body:{phone:n,password:r,data:i?.data??{},channel:i?.channel??`sms`,gotrue_meta_security:{captcha_token:i?.captchaToken}},xform:ms})}else throw new lo(`You must provide either an email or phone number and a password`);let{data:n,error:r}=t;if(r||!n)return await Ho(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:r});let i=n.session,a=n.user;return n.session&&(await this._saveSession(n.session),await this._notifyAllSubscribers(`SIGNED_IN`,i)),this._returnResult({data:{user:a,session:i},error:null})}catch(e){if(await Ho(this.storage,`${this.storageKey}-code-verifier`),F(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signInWithPassword(e){try{let t;if(`email`in e){let{email:n,password:r,options:i}=e;t=await R(this.fetch,`POST`,`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:n,password:r,gotrue_meta_security:{captcha_token:i?.captchaToken}},xform:hs})}else if(`phone`in e){let{phone:n,password:r,options:i}=e;t=await R(this.fetch,`POST`,`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:n,password:r,gotrue_meta_security:{captcha_token:i?.captchaToken}},xform:hs})}else throw new lo(`You must provide either an email or phone number and a password`);let{data:n,error:r}=t;if(r)return this._returnResult({data:{user:null,session:null},error:r});if(!n||!n.session||!n.user){let e=new co;return this._returnResult({data:{user:null,session:null},error:e})}return n.session&&(await this._saveSession(n.session),await this._notifyAllSubscribers(`SIGNED_IN`,n.session)),this._returnResult({data:Object.assign({user:n.user,session:n.session},n.weak_password?{weakPassword:n.weak_password}:null),error:r})}catch(e){if(F(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signInWithOAuth(e){return await this._handleProviderSignIn(e.provider,{redirectTo:e.options?.redirectTo,scopes:e.options?.scopes,queryParams:e.options?.queryParams,skipBrowserRedirect:e.options?.skipBrowserRedirect})}async exchangeCodeForSession(e){return await this.initializePromise,this.lock==null?this._exchangeCodeForSession(e):this._acquireLock(this.lockAcquireTimeout,async()=>this._exchangeCodeForSession(e))}async signInWithWeb3(e){let{chain:t}=e;switch(t){case`ethereum`:return await this.signInWithEthereum(e);case`solana`:return await this.signInWithSolana(e);default:throw Error(`@supabase/auth-js: Unsupported chain "${t}"`)}}async signInWithEthereum(e){let t,n;if(`message`in e)t=e.message,n=e.signature;else{let{chain:r,wallet:i,statement:a,options:o}=e,s;
33if(!Po()){if(typeof i!=`object`||!o?.url)throw Error(`@supabase/auth-js: Both wallet and url must be specified in non-browser environments.`);s=i}else if(typeof i==`object`)s=i;else{let e=window;if(`ethereum`in e&&typeof e.ethereum==`object`&&`request`in e.ethereum&&typeof e.ethereum.request==`function`)s=e.ethereum;else throw Error(`@supabase/auth-js: No compatible Ethereum wallet interface on the window object (window.ethereum) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'ethereum', wallet: resolvedUserWallet }) instead.`)}let c=new URL(o?.url??window.location.href),l=await s.request({method:`eth_requestAccounts`}).then(e=>e).catch(()=>{throw Error(`@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid`)});if(!l||l.length===0)throw Error(`@supabase/auth-js: No accounts available. Please ensure the wallet is connected.`);let u=Es(l[0]),d=o?.signInWithEthereum?.chainId;d||=Ds(await s.request({method:`eth_chainId`})),t=ks({domain:c.host,address:u,statement:a,uri:c.href,version:`1`,chainId:d,nonce:o?.signInWithEthereum?.nonce,issuedAt:o?.signInWithEthereum?.issuedAt??new Date,expirationTime:o?.signInWithEthereum?.expirationTime,notBefore:o?.signInWithEthereum?.notBefore,requestId:o?.signInWithEthereum?.requestId,resources:o?.signInWithEthereum?.resources}),n=await s.request({method:`personal_sign`,params:[Os(t),u]})}try{let{data:r,error:i}=await R(this.fetch,`POST`,`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:`ethereum`,message:t,signature:n},e.options?.captchaToken?{gotrue_meta_security:{captcha_token:e.options?.captchaToken}}:null),xform:ms});if(i)throw i;if(!r||!r.session||!r.user){let e=new co;return this._returnResult({data:{user:null,session:null},error:e})}return r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers(`SIGNED_IN`,r.session)),this._returnResult({data:Object.assign({},r),error:i})}catch(e){if(F(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signInWithSolana(e){let t,n;if(`message`in e)t=e.message,n=e.signature;else{let{chain:r,wallet:i,statement:a,options:o}=e,s;if(!Po()){if(typeof i!=`object`||!o?.url)throw Error(`@supabase/auth-js: Both wallet and url must be specified in non-browser environments.`);s=i}else if(typeof i==`object`)s=i;else{let e=window;if(`solana`in e&&typeof e.solana==`object`&&(`signIn`in e.solana&&typeof e.solana.signIn==`function`||`signMessage`in e.solana&&typeof e.solana.signMessage==`function`))s=e.solana;else throw Error(`@supabase/auth-js: No compatible Solana wallet interface on the window object (window.solana) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'solana', wallet: resolvedUserWallet }) instead.`)}let c=new URL(o?.url??window.location.href);if(`signIn`in s&&s.signIn){let e=await s.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},o?.signInWithSolana),{version:`1`,domain:c.host,uri:c.href}),a?{statement:a}:null)),r;if(Array.isArray(e)&&e[0]&&typeof e[0]==`object`)r=e[0];else if(e&&typeof e==`object`&&`signedMessage`in e&&`signature`in e)r=e;else throw Error(`@supabase/auth-js: Wallet method signIn() returned unrecognized value`);if(`signedMessage`in r&&`signature`in r&&(typeof r.signedMessage==`string`||r.signedMessage instanceof Uint8Array)&&r.signature instanceof Uint8Array)t=typeof r.signedMessage==`string`?r.signedMessage:new TextDecoder().decode(r.signedMessage),n=r.signature;else throw Error(`@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields`)}else{if(!(`signMessage`in s)||typeof s.signMessage!=`function`||!(`publicKey`in s)||typeof s!=`object`||!s.publicKey||!(`toBase58`in s.publicKey)||typeof s.publicKey.toBase58!=`function`)throw Error(`@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API`);t=[`${c.host} wants you to sign in with your Solana account:`,s.publicKey.toBase58(),...a?[``,a,``]:[``],`Version: 1`,`URI: ${c.href}`,`Issued At: ${o?.signInWithSolana?.issuedAt??new Date().toISOString()}`,...o?.signInWithSolana?.notBefore?[`Not Before: ${o.signInWithSolana.notBefore}`]:[],...o?.signInWithSolana?.expirationTime?[`Expiration Time: ${o.signInWithSolana.expirationTime}`]:[],...o?.signInWithSolana?.chainId?[`Chain ID: ${o.signInWithSolana.chainId}`]:[],...o?.signInWithSolana?.nonce?[`Nonce: ${o.signInWithSolana.nonce}`]:[],...o?.signInWithSolana?.requestId?[`Request ID: ${o.signInWithSolana.requestId}`]:[],...o?.signInWithSolana?.resources?.length?[`Resources`,...o.signInWithSolana.resources.map(e=>`- ${e}`)]:[]].join(` 34`);let e=await s.signMessage(new TextEncoder().encode(t),`utf8`);if(!e||!(e instanceof Uint8Array))throw Error(`@supabase/auth-js: Wallet signMessage() API returned an recognized value`);n=e}}try{let{data:r,error:i}=await R(this.fetch,`POST`,`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:`solana`,message:t,signature:jo(n)},e.options?.captchaToken?{gotrue_meta_security:{captcha_token:e.options?.captchaToken}}:null),xform:ms});if(i)throw i;if(!r||!r.session||!r.user){let e=new co;return this._returnResult({data:{user:null,session:null},error:e})}return r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers(`SIGNED_IN`,r.session)),this._returnResult({data:Object.assign({},r),error:i})}catch(e){if(F(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async _exchangeCodeForSession(e){let[t,n]=(await Vo(this.storage,`${this.storageKey}-code-verifier`)??``).split(`/`);try{if(!t&&this.flowType===`pkce`)throw new mo;let{data:r,error:i}=await R(this.fetch,`POST`,`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:t},xform:ms});if(await Ho(this.storage,`${this.storageKey}-code-verifier`),i)throw i;if(!r||!r.session||!r.user){let e=new co;return this._returnResult({data:{user:null,session:null,redirectType:null},error:e})}return r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers(n===`recovery`?`PASSWORD_RECOVERY`:`SIGNED_IN`,r.session)),this._returnResult({data:Object.assign(Object.assign({},r),{redirectType:n??null}),error:i})}catch(e){if(await Ho(this.storage,`${this.storageKey}-code-verifier`),F(e))return this._returnResult({data:{user:null,session:null,redirectType:null},error:e});throw e}}async signInWithIdToken(e){try{let{options:t,provider:n,token:r,access_token:i,nonce:a}=e,{data:o,error:s}=await R(this.fetch,`POST`,`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:n,id_token:r,access_token:i,nonce:a,gotrue_meta_security:{captcha_token:t?.captchaToken}},xform:ms});if(s)return this._returnResult({data:{user:null,session:null},error:s});if(!o||!o.session||!o.user){let e=new co;return this._returnResult({data:{user:null,session:null},error:e})}return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers(`SIGNED_IN`,o.session)),this._returnResult({data:o,error:s})}catch(e){if(F(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signInWithOtp(e){try{if(`email`in e){let{email:t,options:n}=e,r=null,i=null;this.flowType===`pkce`&&([r,i]=await Zo(this.storage,this.storageKey));let{error:a}=await R(this.fetch,`POST`,`${this.url}/otp`,{headers:this.headers,body:{email:t,data:n?.data??{},create_user:n?.shouldCreateUser??!0,gotrue_meta_security:{captcha_token:n?.captchaToken},code_challenge:r,code_challenge_method:i},redirectTo:n?.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:a})}if(`phone`in e){let{phone:t,options:n}=e,{data:r,error:i}=await R(this.fetch,`POST`,`${this.url}/otp`,{headers:this.headers,body:{phone:t,data:n?.data??{},create_user:n?.shouldCreateUser??!0,gotrue_meta_security:{captcha_token:n?.captchaToken},channel:n?.channel??`sms`}});return this._returnResult({data:{user:null,session:null,messageId:r?.message_id},error:i})}throw new lo(`You must provide either an email or phone number.`)}catch(e){if(await Ho(this.storage,`${this.storageKey}-code-verifier`),F(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async verifyOtp(e){try{let t,n;`options`in e&&(t=e.options?.redirectTo,n=e.options?.captchaToken);let{data:r,error:i}=await R(this.fetch,`POST`,`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:n}}),redirectTo:t,xform:ms});if(i)throw i;if(!r)throw Error(`An error occurred on token verification.`);let a=r.session,o=r.user;return a?.access_token&&(await this._saveSession(a),await this._notifyAllSubscribers(e.type==`recovery`?`PASSWORD_RECOVERY`:`SIGNED_IN`,a)),this._returnResult({data:{user:o,session:a},error:null})}catch(e){if(F(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signInWithSSO(e){try{let t=null,n=null;this.flowType===`pkce`&&([t,n]=await Zo(this.storage,this.storageKey));let r=await R(this.fetch,`POST`,`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},`providerId`in e?{provider_id:e.providerId}:null),`domain`in e?{domain:e.domain}:null),{redirect_to:e.options?.redirectTo??void 0}),e?.options?.captchaToken?{gotrue_meta_security:{captcha_token:e.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:t,code_challenge_method:n}),headers:this.headers,xform:_s});return r.data?.url&&Po()&&!e.options?.skipBrowserRedirect&&window.location.assign(r.data.url),this._returnResult(r)}catch(e){if(await Ho(this.storage,`${this.storageKey}-code-verifier`),F(e))return this._returnResult({data:null,error:e});throw e}}async reauthenticate(){return await this.initializePromise,this.lock==null?await this._reauthenticate():await this._acquireLock(this.lockAcquireTimeout,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async e=>{let{data:{session:t},error:n}=e;if(n)throw n;if(!t)throw new I;let{error:r}=await R(this.fetch,`GET`,`${this.url}/reauthenticate`,{headers:this.headers,jwt:t.access_token});return this._returnResult({data:{user:null,session:null},error:r})})}catch(e){if(F(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async resend(e){try{let t=`${this.url}/resend`;if(`email`in e){let{email:n,type:r,options:i}=e,a=null,o=null;this.flowType===`pkce`&&([a,o]=await Zo(this.storage,this.storageKey));let{error:s}=await R(this.fetch,`POST`,t,{headers:this.headers,body:{email:n,type:r,gotrue_meta_security:{captcha_token:i?.captchaToken},code_challenge:a,code_challenge_method:o},redirectTo:i?.emailRedirectTo});return s&&await Ho(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:s})}else if(`phone`in e){let{phone:n,type:r,options:i}=e,{data:a,error:o}=await R(this.fetch,`POST`,t,{headers:this.headers,body:{phone:n,type:r,gotrue_meta_security:{captcha_token:i?.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:a?.message_id},error:o})}throw new lo(`You must provide either an email or phone number and a type`)}catch(e){if(await Ho(this.storage,`${this.storageKey}-code-verifier`),F(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async getSession(){return await this.initializePromise,this.lock==null?await this._useSession(async e=>e):await this._acquireLock(this.lockAcquireTimeout,async()=>this._useSession(async e=>e))}async _acquireLock(e,t){this._debug(`#_acquireLock`,`begin`,e);try{if(this.lockAcquired){let e=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),n=(async()=>(await e,await t()))();return this.pendingInLock.push((async()=>{try{await n}catch{}})()),n}return await this.lock(`lock:${this.storageKey}`,e,async()=>{this._debug(`#_acquireLock`,`lock acquired for storage key`,this.storageKey);try{this.lockAcquired=!0;let e=t();for(this.pendingInLock.push((async()=>{try{await e}catch{}})()),await e;this.pendingInLock.length;){let e=[...this.pendingInLock];await Promise.all(e),this.pendingInLock.splice(0,e.length)}return await e}finally{this._debug(`#_acquireLock`,`lock released for storage key`,this.storageKey),this.lockAcquired=!1}})}finally{this._debug(`#_acquireLock`,`end`)}}async _useSession(e){this._debug(`#_useSession`,`begin`);try{return await e(await this.__loadSession())}finally{this._debug(`#_useSession`,`end`)}}async __loadSession(){this._debug(`#__loadSession()`,`begin`),this.lock!=null&&!this.lockAcquired&&this._debug(`#__loadSession()`,`used outside of an acquired lock!`,Error().stack);try{let e=null,t=await Vo(this.storage,this.storageKey);if(this._debug(`#getSession()`,`session from storage`,t),t!==null&&(this._isValidSession(t)?e=t:(this._debug(`#getSession()`,`session from storage is not val
34id`),await this._removeSession())),!e)return{data:{session:null},error:null};let n=e.expires_at?e.expires_at*1e3-Date.now()<Ja:!1;if(this._debug(`#__loadSession()`,`session has${n?``:` not`} expired`,`expires_at`,e.expires_at),!n){if(this.userStorage){let t=await Vo(this.userStorage,this.storageKey+`-user`);t?.user?e.user=t.user:e.user=as()}if(this.storage.isServer&&e.user&&!e.user.__isUserNotAvailableProxy){let t={value:this.suppressGetSessionWarning};e.user=ss(e.user,t),t.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:e},error:null}}let{data:r,error:i}=await this._callRefreshToken(e.refresh_token);if(i){if(e.expires_at&&e.expires_at*1e3>Date.now()){let t=await Vo(this.storage,this.storageKey);if(t&&t.refresh_token===e.refresh_token)return this._returnResult({data:{session:e},error:null})}return this._returnResult({data:{session:null},error:i})}return this._returnResult({data:{session:r},error:null})}finally{this._debug(`#__loadSession()`,`end`)}}async getUser(e){if(e)return await this._getUser(e);await this.initializePromise;let t;return t=this.lock==null?await this._getUser():await this._acquireLock(this.lockAcquireTimeout,async()=>await this._getUser()),t.data.user&&(this.suppressGetSessionWarning=!0),t}async _getUser(e){try{return e?await R(this.fetch,`GET`,`${this.url}/user`,{headers:this.headers,jwt:e,xform:gs}):await this._useSession(async e=>{let{data:t,error:n}=e;if(n)throw n;return!t.session?.access_token&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new I}:await R(this.fetch,`GET`,`${this.url}/user`,{headers:this.headers,jwt:t.session?.access_token??void 0,xform:gs})})}catch(e){if(F(e))return so(e)&&(await this._removeSession(),await Ho(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:e});throw e}}async updateUser(e,t={}){return await this.initializePromise,this.lock==null?await this._updateUser(e,t):await this._acquireLock(this.lockAcquireTimeout,async()=>await this._updateUser(e,t))}async _updateUser(e,t={}){try{return await this._useSession(async n=>{let{data:r,error:i}=n;if(i)throw i;if(!r.session)throw new I;let a=r.session,o=null,s=null;this.flowType===`pkce`&&e.email!=null&&([o,s]=await Zo(this.storage,this.storageKey));let{data:c,error:l}=await R(this.fetch,`PUT`,`${this.url}/user`,{headers:this.headers,redirectTo:t?.emailRedirectTo,body:Object.assign(Object.assign({},e),{code_challenge:o,code_challenge_method:s}),jwt:a.access_token,xform:gs});if(l)throw l;return a.user=c.user,await this._saveSession(a),await this._notifyAllSubscribers(`USER_UPDATED`,a),this._returnResult({data:{user:a.user},error:null})})}catch(e){if(await Ho(this.storage,`${this.storageKey}-code-verifier`),F(e))return this._returnResult({data:{user:null},error:e});throw e}}async setSession(e){return await this.initializePromise,this.lock==null?await this._setSession(e):await this._acquireLock(this.lockAcquireTimeout,async()=>await this._setSession(e))}async _setSession(e){try{if(!e.access_token||!e.refresh_token)throw new I;let t=Date.now()/1e3,n=t,r=!0,i=null,{payload:a}=Wo(e.access_token);if(a.exp&&(n=a.exp,r=n<=t),r){let{data:t,error:n}=await this._callRefreshToken(e.refresh_token);if(n)return this._returnResult({data:{user:null,session:null},error:n});if(!t)return{data:{user:null,session:null},error:null};i=t}else{let{data:r,error:a}=await this._getUser(e.access_token);if(a)return this._returnResult({data:{user:null,session:null},error:a});i={access_token:e.access_token,refresh_token:e.refresh_token,user:r.user,token_type:`bearer`,expires_in:n-t,expires_at:n},await this._saveSession(i),await this._notifyAllSubscribers(`SIGNED_IN`,i)}return this._returnResult({data:{user:i.user,session:i},error:null})}catch(e){if(F(e))return this._returnResult({data:{session:null,user:null},error:e});throw e}}async refreshSession(e){return await this.initializePromise,this.lock==null?await this._refreshSession(e):await this._acquireLock(this.lockAcquireTimeout,async()=>await this._refreshSession(e))}async _refreshSession(e){try{return await this._useSession(async t=>{if(!e){let{data:n,error:r}=t;if(r)throw r;e=n.session??void 0}if(!e?.refresh_token)throw new I;let{data:n,error:r}=await this._callRefreshToken(e.refresh_token);return r?this._returnResult({data:{user:null,session:null},error:r}):n?this._returnResult({data:{user:n.user,session:n},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(e){if(F(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async _getSessionFromURL(e,t){try{if(!Po())throw new uo(`No browser detected.`);if(e.error||e.error_description||e.error_code)throw new uo(e.error_description||`Error in URL with unspecified error_description`,{error:e.error||`unspecified_error`,code:e.error_code||`unspecified_code`});switch(t){case`implicit`:if(this.flowType===`pkce`)throw new po(`Not a valid PKCE flow url.`);break;case`pkce`:if(this.flowType===`implicit`)throw new uo(`Not a valid implicit grant flow url.`);break;default:}if(t===`pkce`){if(this._debug(`#_initialize()`,`begin`,`is PKCE flow`,!0),!e.code)throw new po(`No code detected.`);let{data:t,error:n}=await this._exchangeCodeForSession(e.code);
34if(n)throw n;let r=new URL(window.location.href);return r.searchParams.delete(`code`),window.history.replaceState(window.history.state,``,r.toString()),{data:{session:t.session,redirectType:t.redirectType??null},error:null}}let{provider_token:n,provider_refresh_token:r,access_token:i,refresh_token:a,expires_in:o,expires_at:s,token_type:c}=e;if(!i||!o||!a||!c)throw new uo(`No session defined in URL`);let l=Math.round(Date.now()/1e3),u=parseInt(o),d=l+u;s&&(d=parseInt(s));let f=d-l;f*1e3<=3e4&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${f}s, should have been closer to ${u}s`);let p=d-u;l-p>=120?console.warn(`@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale`,p,d,l):l-p<0&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew`,p,d,l);let{data:m,error:h}=await this._getUser(i);if(h)throw h;let g={provider_token:n,provider_refresh_token:r,access_token:i,expires_in:u,expires_at:d,refresh_token:a,token_type:c,user:m.user};return window.location.hash=``,this._debug(`#_getSessionFromURL()`,`clearing window.location.hash`),this._returnResult({data:{session:g,redirectType:e.type},error:null})}catch(e){if(F(e))return this._returnResult({data:{session:null,redirectType:null},error:e});throw e}}_isImplicitGrantCallback(e){return typeof this.detectSessionInUrl==`function`?this.detectSessionInUrl(new URL(window.location.href),e):!!(e.access_token||e.error||e.error_description||e.error_code)}async _isPKCECallback(e){let t=await Vo(this.storage,`${this.storageKey}-code-verifier`);return!!(e.code&&t)}async signOut(e={scope:`global`}){return await this.initializePromise,this.lock==null?await this._signOut(e):await this._acquireLock(this.lockAcquireTimeout,async()=>await this._signOut(e))}async _signOut({scope:e}={scope:`global`}){return await this._useSession(async t=>{let{data:n,error:r}=t;if(r&&!so(r))return this._returnResult({error:r});let i=n.session?.access_token;if(i){let{error:t}=await this.admin.signOut(i,e);if(t&&!(io(t)&&(t.status===404||t.status===401||t.status===403)||so(t)))return this._returnResult({error:t})}return e!==`others`&&(await this._removeSession(),await Ho(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(e){let t=No(),n={id:t,callback:e,unsubscribe:()=>{this._debug(`#unsubscribe()`,`state change callback with id removed`,t),this.stateChangeEmitters.delete(t)}};return this._debug(`#onAuthStateChange()`,`registered callback with id`,t),this.stateChangeEmitters.set(t,n),(async()=>{await this.initializePromise,this.lock==null?await this._emitInitialSession(t):await this._acquireLock(this.lockAcquireTimeout,async()=>{this._emitInitialSession(t)})})(),{data:{subscription:n}}}async _emitInitialSession(e){return await this._useSession(async t=>{try{let{data:{session:n},error:r}=t;if(r)throw r;await this.stateChangeEmitters.get(e)?.callback(`INITIAL_SESSION`,n),this._debug(`INITIAL_SESSION`,`callback id`,e,`session`,n)}catch(t){await this.stateChangeEmitters.get(e)?.callback(`INITIAL_SESSION`,null),this._debug(`INITIAL_SESSION`,`callback id`,e,`error`,t),so(t)?console.warn(t):console.error(t)}})}async resetPasswordForEmail(e,t={}){let n=null,r=null;this.flowType===`pkce`&&([n,r]=await Zo(this.storage,this.storageKey,!0));try{return await R(this.fetch,`POST`,`${this.url}/recover`,{body:{email:e,code_challenge:n,code_challenge_method:r,gotrue_meta_security:{captcha_token:t.captchaToken}},headers:this.headers,redirectTo:t.redirectTo})}catch(e){if(await Ho(this.storage,`${this.storageKey}-code-verifier`),F(e))return this._returnResult({data:null,error:e});throw e}}async getUserIdentities(){try{let{data:e,error:t}=await this.getUser();if(t)throw t;return this._returnResult({data:{identities:e.user.identities??[]},error:null})}catch(e){if(F(e))return this._returnResult({data:null,error:e});throw e}}async linkIdentity(e){return`token`in e?this.linkIdentityIdToken(e):this.linkIdentityOAuth(e)}async linkIdentityOAuth(e){try{let{data:t,error:n}=await this._useSession(async t=>{let{data:n,error:r}=t;if(r)throw r;let i=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,e.provider,{redirectTo:e.options?.redirectTo,scopes:e.options?.scopes,queryParams:e.options?.queryParams,skipBrowserRedirect:!0});return await R(this.fetch,`GET`,i,{headers:this.headers,jwt:n.session?.access_token??void 0})});if(n)throw n;return Po()&&!e.options?.skipBrowserRedirect&&window.location.assign(t?.url),this._returnResult({data:{provider:e.provider,url:t?.url},error:null})}catch(t){if(F(t))return this._returnResult({data:{provider:e.provider,url:null},error:t});throw t}}async linkIdentityIdToken(e){return await this._useSession(async t=>{try{let{error:n,data:{session:r}}=t;if(n)throw n;let{options:i,provider:a,token:o,access_token:s,nonce:c}=e,{data:l,error:u}=await R(this.fetch,`POST`,`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:r?.access_token??void 0,body:{provider:a,id_token:o,access_token:s,nonce:c,link_identity:!0,gotrue_meta_security:{captcha_token:i?.captchaToken}},xform:ms});return u?this._returnResult({data:{user:null,session:null},error:u}):!l||!l.session||!l.user?this._returnResult({data:{user:null,session:null},error:new co}):(l.session&&(await this._saveSession(l.session),await this._notifyAllSubscribers(`USER_UPDATED`,l.session)),this._returnResult({data:l,error:u}))}catch(e){if(await Ho(this.storage,`${this.storageKey}-code-verifier`),F(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}})}async unlinkIdentity(e){try{return await this._useSession(async t=>{let{data:n,error:r}=t;if(r)throw r;return await R(this.fetch,`DELETE`,`${this.url}/user/identities/${e.identity_id}`,{headers:this.headers,jwt:n.session?.access_token??void 0})})}catch(e){if(F(e))return this._returnResult({data:null,error:e});throw e}}async _refreshAccessToken(e){let t=`#_refreshAccessToken()`;this._debug(t,`begin`);try{let n=Date.now();return await Ko(async n=>(n>0&&await Go(200*2**(n-1)),this._debug(t,`refreshing attempt`,n),await R(this.fetch,`POST`,`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:ms})),(e,t)=>{let r=200*2**e;return t&&go(t)&&Date.now()+r-n<3e4})}catch(e){if(this._debug(t,`error`,e),F(e))return this._returnResult({data:{session:null,user:null},error:e});throw e}finally{this._debug(t,`end`)}}_isValidSession(e){return typeof e==`object`&&!!e&&`access_token`in e&&`refresh_token`in e&&`expires_at`in e}async _handleProviderSignIn(e,t){let n=await this._getUrlForProvider(`${this.url}/authorize`,e,{redirectTo:t.redirectTo,scopes:t.scopes,queryParams:t.queryParams});return this._debug(`#_handleProviderSignIn()`,`provider`,e,`options`,t,`url`,n),Po()&&!t.skipBrowserRedirect&&window.location.assign(n),{data:{provider:e,url:n},error:null}}async _recoverAndRefresh(){let e=`#_recoverAndRefresh()`;this._debug(e,`begin`);try{let t=await Vo(this.storage,this.storageKey);if(t&&this.userStorage){let e=await Vo(this.userStorage,this.storageKey+`-user`);!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!e&&(e={user:t.user},await Bo(this.userStorage,this.storageKey+`-user`,e)),t.user=e?.user??as()}else if(t&&!t.user&&!t.user){let e=await Vo(this.storage,this.storageKey+`-user`);e&&e?.user?(t.user=e.user,await Ho(this.storage,this.storageKey+`-user`),await Bo(this.storage,this.storageKey,t)):t.user=as()}if(this._debug(e,`session from storage`,t),!this._isValidSession(t)){this._debug(e,`session is not val
34id`),t!==null&&await this._removeSession();return}let n=(t.expires_at??1/0)*1e3-Date.now()<Ja;if(this._debug(e,`session has${n?``:` not`} expired with margin of ${Ja}s`),n){if(this.autoRefreshToken&&t.refresh_token){let{error:n}=await this._callRefreshToken(t.refresh_token);n&&(_o(n)?this._debug(e,`refresh discarded by commit guard`,n):this._debug(e,`refresh failed`,n))}}else if(t.user&&t.user.__isUserNotAvailableProxy===!0)try{let{data:n,error:r}=await this._getUser(t.access_token);!r&&n?.user?(t.user=n.user,await this._saveSession(t),await this._notifyAllSubscribers(`SIGNED_IN`,t)):this._debug(e,`could not get user data, skipping SIGNED_IN notification`)}catch(t){console.error(`Error getting user data:`,t),this._debug(e,`error getting user data, skipping SIGNED_IN notification`,t)}else await this._notifyAllSubscribers(`SIGNED_IN`,t)}catch(t){this._debug(e,`error`,t),console.error(t);return}finally{this._debug(e,`end`)}}async _callRefreshToken(e){var t,n;if(!e)throw new I;if(this.refreshingDeferred)return this.refreshingDeferred.promise;if(this.lastRefreshFailure&&this.lastRefreshFailure.refreshToken===e&&Date.now()<this.lastRefreshFailure.expiresAt)return this._debug(`#_callRefreshToken()`,`returning cached failure (cooldown active)`),this.lastRefreshFailure.result;let r=`#_callRefreshToken()`;this._debug(r,`begin`);try{this.refreshingDeferred=new Uo;let t=await Vo(this.storage,this.storageKey),{data:n,error:i}=await this._refreshAccessToken(e);if(i)throw i;if(!n.session)throw new I;let a=await Vo(this.storage,this.storageKey);if(t!==null&&(a===null||a.refresh_token!==t.refresh_token)){this._debug(r,`commit guard: storage changed since refresh started, discarding rotated tokens`,{startedWith:`present`,nowHolds:a?`replaced`:`cleared`});let e={data:null,error:new L};return this.refreshingDeferred.resolve(e),e}let o=this._sessionRemovalEpoch;if(await this._saveSession(n.session),this._sessionRemovalEpoch!==o){this._debug(r,`commit guard (post-save): _removeSession ran during _saveSession, undoing write`),await Ho(this.storage,this.storageKey),this.userStorage&&await Ho(this.userStorage,this.storageKey+`-user`);let e={data:null,error:new L};return this.refreshingDeferred.resolve(e),e}await this._notifyAllSubscribers(`TOKEN_REFRESHED`,n.session);let s={data:n.session,error:null};return this.lastRefreshFailure=null,this.refreshingDeferred.resolve(s),s}catch(i){if(this._debug(r,`error`,i),F(i)){let n={data:null,error:i};if(!go(i)){let e=await Vo(this.storage,this.storageKey);e?.expires_at&&e.expires_at*1e3>Date.now()?this._debug(r,`proactive refresh failed, access token still valid â preserving session`):await this._removeSession()}return this.lastRefreshFailure={refreshToken:e,result:n,expiresAt:Date.now()+Ya},(t=this.refreshingDeferred)==null||t.resolve(n),n}throw(n=this.refreshingDeferred)==null||n.reject(i),i}finally{this.refreshingDeferred=null,this._debug(r,`end`)}}async _notifyAllSubscribers(e,t,n=!0){let r=`#_notifyAllSubscribers(${e})`;this._debug(r,`begin`,t,`broadcast = ${n}`);try{this.broadcastChannel&&n&&this.broadcastChannel.postMessage({event:e,session:t});let r=[],i=Array.from(this.stateChangeEmitters.values()).map(async n=>{try{await n.callback(e,t)}catch(e){r.push(e)}});if(await Promise.all(i),r.length>0){for(let e=0;e<r.length;e+=1)console.error(r[e]);throw r[0]}}finally{this._debug(r,`end`)}}async _saveSession(e){this._debug(`#_saveSession()`,e),this.suppressGetSessionWarning=!0,await Ho(this.storage,`${this.storageKey}-code-verifier`);let t=Object.assign({},e),n=t.user&&t.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!n&&t.user&&await Bo(this.userStorage,this.storageKey+`-user`,{user:t.user});let e=Object.assign({},t);delete e.user;let r=cs(e);await Bo(this.storage,this.storageKey,r)}else{let e=cs(t);await Bo(this.storage,this.storageKey,e)}}async _removeSession(){this._sessionRemovalEpoch+=1,this._debug(`#_removeSession()`),this.lastRefreshFailure=null,this.suppressGetSessionWarning=!1,await Ho(this.storage,this.storageKey),await Ho(this.storage,this.storageKey+`-code-verifier`),await Ho(this.storage,this.storageKey+`-user`),this.userStorage&&await Ho(this.userStorage,this.storageKey+`-user`),await this._notifyAllSubscribers(`SIGNED_OUT`,null)}_removeVisibilityChangedCallback(){this._debug(`#_removeVisibilityChangedCallback()`);let e=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{e&&Po()&&window!=null&&window.removeEventListener&&window.removeEventListener(`visibilitychange`,e)}
34catch(e){console.error(`removing visibilitychange callback failed`,e)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug(`#_startAutoRefresh()`);let e=setInterval(()=>this._autoRefreshTokenTick(),qa);this.autoRefreshTicker=e,e&&typeof e==`object`&&typeof e.unref==`function`?e.unref():typeof Deno<`u`&&typeof Deno.unrefTimer==`function`&&Deno.unrefTimer(e);let t=setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0);this.autoRefreshTickTimeout=t,t&&typeof t==`object`&&typeof t.unref==`function`?t.unref():typeof Deno<`u`&&typeof Deno.unrefTimer==`function`&&Deno.unrefTimer(t)}async _stopAutoRefresh(){this._debug(`#_stopAutoRefresh()`);let e=this.autoRefreshTicker;this.autoRefreshTicker=null,e&&clearInterval(e);let t=this.autoRefreshTickTimeout;this.autoRefreshTickTimeout=null,t&&clearTimeout(t)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async dispose(){var e;this._removeVisibilityChangedCallback(),await this._stopAutoRefresh(),(e=this.broadcastChannel)==null||e.close(),this.broadcastChannel=null,this.stateChangeEmitters.clear()}async _autoRefreshTokenTick(){if(this._debug(`#_autoRefreshTokenTick()`,`begin`),this.lock!=null){try{await this._acquireLock(0,async()=>{try{let e=Date.now();try{return await this._useSession(async t=>{let{data:{session:n}}=t;if(!n||!n.refresh_token||!n.expires_at){this._debug(`#_autoRefreshTokenTick()`,`no session`);return}let r=Math.floor((n.expires_at*1e3-e)/qa);this._debug(`#_autoRefreshTokenTick()`,`access token expires in ${r} ticks, a tick lasts ${qa}ms, refresh threshold is 3 ticks`),r<=3&&await this._callRefreshToken(n.refresh_token)})}catch(e){console.error(`Auto refresh tick failed with error. This is likely a transient error.`,e)}}finally{this._debug(`#_autoRefreshTokenTick()`,`end`)}})}catch(e){if(e instanceof ws)this._debug(`auto refresh token tick lock not available`);else throw e}return}if(this.refreshingDeferred!==null){this._debug(`#_autoRefreshTokenTick()`,`refresh already in flight, skipping`);return}try{let e=Date.now();try{await this._useSession(async t=>{let{data:{session:n}}=t;if(!n||!n.refresh_token||!n.expires_at){this._debug(`#_autoRefreshTokenTick()`,`no session`);return}let r=Math.floor((n.expires_at*1e3-e)/qa);this._debug(`#_autoRefreshTokenTick()`,`access token expires in ${r} ticks, a tick lasts ${qa}ms, refresh threshold is 3 ticks`),r<=3&&await this._callRefreshToken(n.refresh_token)})}catch(e){console.error(`Auto refresh tick failed with error. This is likely a transient error.`,e)}}finally{this._debug(`#_autoRefreshTokenTick()`,`end`)}}async _handleVisibilityChange(){if(this._debug(`#_handleVisibilityChange()`),!Po()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>{try{await this._onVisibilityChanged(!1)}catch(e){this._debug(`#visibilityChangedCallback`,`error`,e)}},window==null||window.addEventListener(`visibilitychange`,this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(e){console.error(`_handleVisibilityChange`,e)}}async _onVisibilityChanged(e){let t=`#_onVisibilityChanged(${e})`;if(this._debug(t,`visibilityState`,document.visibilityState),document.visibilityState===`visible`){if(this.autoRefreshToken&&this._startAutoRefresh(),!e)if(await this.initializePromise,this.lock!=null)await this._acquireLock(this.lockAcquireTimeout,async()=>{if(document.visibilityState!==`visible`){this._debug(t,`acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting`);return}await this._recoverAndRefresh()});else{if(document.visibilityState!==`visible`){this._debug(t,`visibilityState is no longer visible, skipping recovery`);return}await this._recoverAndRefresh()}}else document.visibilityState===`hidden`&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(e,t,n){let r=[`provider=${encodeURIComponent(t)}`];if(n?.redirectTo&&r.push(`redirect_to=${encodeURIComponent(n.redirectTo)}`),n?.scopes&&r.push(`scopes=${encodeURIComponent(n.scopes)}`),this.flowType===`pkce`){let[e,t]=await Zo(this.storage,this.storageKey),n=new URLSearchParams({code_challenge:`${encodeURIComponent(e)}`,code_challenge_method:`${encodeURIComponent(t)}`});
34r.push(n.toString())}if(n?.queryParams){let e=new URLSearchParams(n.queryParams);r.push(e.toString())}return n?.skipBrowserRedirect&&r.push(`skip_http_redirect=${n.skipBrowserRedirect}`),`${e}?${r.join(`&`)}`}async _unenroll(e){try{return await this._useSession(async t=>{let{data:n,error:r}=t;return r?this._returnResult({data:null,error:r}):await R(this.fetch,`DELETE`,`${this.url}/factors/${e.factorId}`,{headers:this.headers,jwt:n?.session?.access_token})})}catch(e){if(F(e))return this._returnResult({data:null,error:e});throw e}}async _enroll(e){try{return await this._useSession(async t=>{let{data:n,error:r}=t;if(r)return this._returnResult({data:null,error:r});let i=Object.assign({friendly_name:e.friendlyName,factor_type:e.factorType},e.factorType===`phone`?{phone:e.phone}:e.factorType===`totp`?{issuer:e.issuer}:{}),{data:a,error:o}=await R(this.fetch,`POST`,`${this.url}/factors`,{body:i,headers:this.headers,jwt:n?.session?.access_token});return o?this._returnResult({data:null,error:o}):(e.factorType===`totp`&&a.type===`totp`&&a?.totp?.qr_code&&(a.totp.qr_code=`data:image/svg+xml;utf-8,${a.totp.qr_code}`),this._returnResult({data:a,error:null}))})}catch(e){if(F(e))return this._returnResult({data:null,error:e});throw e}}async _verify(e){let t=async()=>{try{return await this._useSession(async t=>{let{data:n,error:r}=t;if(r)return this._returnResult({data:null,error:r});let i=Object.assign({challenge_id:e.challengeId},`webauthn`in e?{webauthn:Object.assign(Object.assign({},e.webauthn),{credential_response:e.webauthn.type===`create`?Ls(e.webauthn.credential_response):Rs(e.webauthn.credential_response)})}:{code:e.code}),{data:a,error:o}=await R(this.fetch,`POST`,`${this.url}/factors/${e.factorId}/verify`,{body:i,headers:this.headers,jwt:n?.session?.access_token});return o?this._returnResult({data:null,error:o}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+a.expires_in},a)),await this._notifyAllSubscribers(`MFA_CHALLENGE_VERIFIED`,a),this._returnResult({data:a,error:o}))})}catch(e){if(F(e))return this._returnResult({data:null,error:e});throw e}};return this.lock==null?t():this._acquireLock(this.lockAcquireTimeout,t)}async _challenge(e){let t=async()=>{try{return await this._useSession(async t=>{let{data:n,error:r}=t;if(r)return this._returnResult({data:null,error:r});let i=await R(this.fetch,`POST`,`${this.url}/factors/${e.factorId}/challenge`,{body:e,headers:this.headers,jwt:n?.session?.access_token});if(i.error)return i;let{data:a}=i;if(a.type!==`webauthn`)return{data:a,error:null};switch(a.webauthn.type){case`create`:return{data:Object.assign(Object.assign({},a),{webauthn:Object.assign(Object.assign({},a.webauthn),{credential_options:Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:Fs(a.webauthn.credential_options.publicKey)})})}),error:null};case`request`:return{data:Object.assign(Object.assign({},a),{webauthn:Object.assign(Object.assign({},a.webauthn),{credential_options:Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:Is(a.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(e){if(F(e))return this._returnResult({data:null,error:e});throw e}};return this.lock==null?t():this._acquireLock(this.lockAcquireTimeout,t)}async _challengeAndVerify(e){let{data:t,error:n}=await this._challenge({factorId:e.factorId});return n?this._returnResult({data:null,error:n}):await this._verify({factorId:e.factorId,challengeId:t.id,code:e.code})}async _listFactors(){let{data:{user:e},error:t}=await this.getUser();if(t)return{data:null,error:t};let n={all:[],phone:[],totp:[],webauthn:[]};for(let t of e?.factors??[])n.all.push(t),t.status===`verified`&&n[t.factor_type].push(t);return{data:n,error:null}}async _getAuthenticatorAssuranceLevel(e){if(e)try{let{payload:t}=Wo(e),n=null;t.aal&&(n=t.aal);let r=n,{data:{user:i},error:a}=await this.getUser(e);if(a)return this._returnResult({data:null,error:a});((i?.factors)?.filter(e=>e.status===`verified`)??[]).length>0&&(r=`aal2`);let o=t.amr||[];return{data:{currentLevel:n,nextLevel:r,currentAuthenticationMethods:o},error:null}}catch(e){if(F(e))return this._returnResult({data:null,error:e});throw e}let{data:{session:t},error:n}
34=await this.getSession();if(n)return this._returnResult({data:null,error:n});if(!t)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};let{payload:r}=Wo(t.access_token),i=null;r.aal&&(i=r.aal);let a=i;(t.user.factors?.filter(e=>e.status===`verified`)??[]).length>0&&(a=`aal2`);let o=r.amr||[];return{data:{currentLevel:i,nextLevel:a,currentAuthenticationMethods:o},error:null}}async _getAuthorizationDetails(e){try{return await this._useSession(async t=>{let{data:{session:n},error:r}=t;return r?this._returnResult({data:null,error:r}):n?await R(this.fetch,`GET`,`${this.url}/oauth/authorizations/${e}`,{headers:this.headers,jwt:n.access_token,xform:e=>({data:e,error:null})}):this._returnResult({data:null,error:new I})})}catch(e){if(F(e))return this._returnResult({data:null,error:e});throw e}}async _approveAuthorization(e,t){try{return await this._useSession(async n=>{let{data:{session:r},error:i}=n;if(i)return this._returnResult({data:null,error:i});if(!r)return this._returnResult({data:null,error:new I});let a=await R(this.fetch,`POST`,`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:r.access_token,body:{action:`approve`},xform:e=>({data:e,error:null})});return a.data&&a.data.redirect_url&&Po()&&!t?.skipBrowserRedirect&&window.location.assign(a.data.redirect_url),a})}catch(e){if(F(e))return this._returnResult({data:null,error:e});throw e}}async _denyAuthorization(e,t){try{return await this._useSession(async n=>{let{data:{session:r},error:i}=n;if(i)return this._returnResult({data:null,error:i});if(!r)return this._returnResult({data:null,error:new I});let a=await R(this.fetch,`POST`,`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:r.access_token,body:{action:`deny`},xform:e=>({data:e,error:null})});return a.data&&a.data.redirect_url&&Po()&&!t?.skipBrowserRedirect&&window.location.assign(a.data.redirect_url),a})}catch(e){if(F(e))return this._returnResult({data:null,error:e});throw e}}async _listOAuthGrants(){try{return await this._useSession(async e=>{let{data:{session:t},error:n}=e;return n?this._returnResult({data:null,error:n}):t?await R(this.fetch,`GET`,`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:t.access_token,xform:e=>({data:e,error:null})}):this._returnResult({data:null,error:new I})})}catch(e){if(F(e))return this._returnResult({data:null,error:e});throw e}}async _revokeOAuthGrant(e){try{return await this._useSession(async t=>{let{data:{session:n},error:r}=t;return r?this._returnResult({data:null,error:r}):n?(await R(this.fetch,`DELETE`,`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:n.access_token,query:{client_id:e.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new I})})}catch(e){if(F(e))return this._returnResult({data:null,error:e});throw e}}async fetchJwk(e,t={keys:[]}){let n=t.keys.find(t=>t.kid===e);if(n)return n;let r=Date.now();if(n=this.jwks.keys.find(t=>t.kid===e),n&&this.jwks_cached_at+6e5>r)return n;let{data:i,error:a}=await R(this.fetch,`GET`,`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(a)throw a;return!i.keys||i.keys.length===0||(this.jwks=i,this.jwks_cached_at=r,n=i.keys.find(t=>t.kid===e),!n)?null:n}async getClaims(e,t={}){try{let n=e;if(!n){let{data:e,error:t}
34=await this.getSession();if(t||!e.session)return this._returnResult({data:null,error:t});n=e.session.access_token}let{header:r,payload:i,signature:a,raw:{header:o,payload:s}}=Wo(n);if(!t?.allowExpired)try{es(i.exp)}catch(e){throw new yo(e instanceof Error?e.message:`JWT validation failed`)}let c=!r.alg||r.alg.startsWith(`HS`)||!r.kid||!(`crypto`in globalThis&&`subtle`in globalThis.crypto)?null:await this.fetchJwk(r.kid,t?.keys?{keys:t.keys}:t?.jwks);if(!c){let{error:e}=await this.getUser(n);if(e)throw e;return{data:{claims:i,header:r,signature:a},error:null}}let l=ts(r.alg),u=await crypto.subtle.importKey(`jwk`,c,l,!0,[`verify`]);if(!await crypto.subtle.verify(l,u,a,Ao(`${o}.${s}`)))throw new yo(`Invalid JWT signature`);return{data:{claims:i,header:r,signature:a},error:null}}catch(e){if(F(e))return this._returnResult({data:null,error:e});throw e}}async signInWithPasskey(e){is(this.experimental);try{if(!Bs())return this._returnResult({data:null,error:new ao(`Browser does not support WebAuthn`,null)});let{data:t,error:n}=await this._startPasskeyAuthentication({options:{captchaToken:e?.options?.captchaToken}});if(n||!t)return this._returnResult({data:null,error:n});let{data:r,error:i}=await Hs({publicKey:Is(t.options),signal:e?.options?.signal??Ps.createNewAbortSignal()});if(i||!r)return this._returnResult({data:null,error:i??new ao(`WebAuthn ceremony failed`,null)});let a=Rs(r);return this._verifyPasskeyAuthentication({challengeId:t.challenge_id,credential:a})}catch(e){if(F(e))return this._returnResult({data:null,error:e});throw e}}async registerPasskey(e){is(this.experimental);try{if(!Bs())return this._returnResult({data:null,error:new ao(`Browser does not support WebAuthn`,null)});let{data:t,error:n}=await this._startPasskeyRegistration();if(n||!t)return this._returnResult({data:null,error:n});let{data:r,error:i}=await Vs({publicKey:Fs(t.options),signal:e?.options?.signal??Ps.createNewAbortSignal()});if(i||!r)return this._returnResult({data:null,error:i??new ao(`WebAuthn ceremony failed`,null)});let a=Ls(r);return this._verifyPasskeyRegistration({challengeId:t.challenge_id,credential:a})}catch(e){if(F(e))return this._returnResult({data:null,error:e});throw e}}async _startPasskeyRegistration(){is(this.experimental);try{return await this._useSession(async e=>{let{data:{session:t},error:n}=e;if(n)return this._returnResult({data:null,error:n});if(!t)return this._returnResult({data:null,error:new I});let{data:r,error:i}=await R(this.fetch,`POST`,`${this.url}/passkeys/registration/options`,{headers:this.headers,jwt:t.access_token,body:{}});return i?this._returnResult({data:null,error:i}):this._returnResult({data:r,error:null})})}catch(e){if(F(e))return this._returnResult({data:null,error:e});throw e}}async _verifyPasskeyRegistration(e){is(this.experimental);try{return await this._useSession(async t=>{let{data:{session:n},error:r}=t;if(r)return this._returnResult({data:null,error:r});if(!n)return this._returnResult({data:null,error:new I});let{data:i,error:a}=await R(this.fetch,`POST`,`${this.url}/passkeys/registration/verify`,{headers:this.headers,jwt:n.access_token,body:{challenge_id:e.challengeId,credential:e.credential}});return a?this._returnResult({data:null,error:a}):this._returnResult({data:i,error:null})})}catch(e){if(F(e))return this._returnResult({data:null,error:e});throw e}}async _startPasskeyAuthentication(e){is(this.experimental);try{let{data:t,error:n}=await R(this.fetch,`POST`,`${this.url}/passkeys/authentication/options`,{headers:this.headers,body:{gotrue_meta_security:{captcha_token:e?.options?.captchaToken}}});return n?this._returnResult({data:null,error:n}):this._returnResult({data:t,error:null})}catch(e){if(F(e))return this._returnResult({data:null,error:e});throw e}}async _verifyPasskeyAuthentication(e){is(this.experimental);try{let{data:t,error:n}=await R(this.fetch,`POST`,`${this.url}/passkeys/authentication/verify`,{headers:this.headers,body:{challenge_id:e.challengeId,credential:e.credential},xform:ms});return n?this._returnResult({data:null,error:n}):(t.session&&(await this._saveSession(t.session),await this._notifyAllSubscribers(`SIGNED_IN`,t.session)),this._returnResult({data:t,error:null}))}catch(e){if(F(e))return this._returnResult({data:null,error:e});throw e}}async _listPasskeys(){is(this.experimental);try{return await this._useSession(async e=>{let{data:{session:t},error:n}=e;if(n)return this._returnResult({data:null,error:n});if(!t)return this._returnResult({data:null,error:new I});let{data:r,error:i}=await R(this.fetch,`GET`,`${this.url}/passkeys`,{headers:this.headers,jwt:t.access_token,xform:e=>({data:e,error:null})});return i?this._returnResult({data:null,error:i}):this._returnResult({data:r,error:null})})}catch(e){if(F(e))return this._returnResult({data:null,error:e});throw e}}async _updatePasskey(e){is(this.experimental);try{return await this._useSession(async t=>{let{data:{session:n},error:r}=t;if(r)return this._returnResult({data:null,error:r});if(!n)return this._returnResult({data:null,error:new I});let{data:i,error:a}=await R(this.fetch,`PATCH`,`${this.url}/passkeys/${e.passkeyId}`,{headers:this.headers,jwt:n.access_token,body:{friendly_name:e.friendlyName}});return a?this._returnResult({data:null,error:a}):this._returnResult({data:i,error:null})})}catch(e){if(F(e))return this._returnResult({data:null,error:e});throw e}}async _deletePasskey(e){is(this.experimental);try{return await this._useSession(async t=>{let{data:{session:n},error:r}=t;if(r)return this._returnResult({data:null,error:r});if(!n)return this._returnResult({data:null,error:new I});let{error:i}=await R(this.fetch,`DELETE`,`${this.url}/passkeys/${e.passkeyId}`,{headers:this.headers,jwt:n.access_token,noResolveJson:!0});return i?this._returnResult({data:null,error:i}):this._returnResult({data:null,error:null})})}catch(e){if(F(e))return this._returnResult({data:null,error:e});throw e}}};Zs.nextInstanceID={};var Qs=Zs,$s=`2.108.2`,ec=``,tc;typeof Deno<`u`?(ec=`deno`,tc=Deno.version?.deno):typeof document<`u`?ec=`web`:typeof navigator<`u`&&navigator.product===`ReactNative`?ec=`react-native`:(ec=`node`,tc=typeof process<`u`?process.version?.replace(/^v/,``):void 0);var nc=[`runtime=${ec}`];tc&&nc.push(`runtime-version=${tc}`);var rc={headers:{"X-Client-Info":`supabase-js/${$s}; ${nc.join(`; `)}`}},ic={schema:`public`},ac={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:`implicit`},oc={},sc={enabled:!1,respectSamplingDecision:!0};function cc(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})}var lc=null,uc=`@opentelemetry/api`;function dc(){return lc===null&&(lc=S(()=>import(uc),[]).catch(()=>null)),lc}function fc(){return cc(this,void 0,void 0,function*(){try{let e=yield dc();if(!e||!e.propagation||!e.context)return null;let t={};e.propagation.inject(e.context.active(),t);let n=t.traceparent;return n?{traceparent:n,tracestate:t.tracestate,baggage:t.baggage}:null}catch{return null}})}function pc(e){if(!e||typeof e!=`string`)return null;let t=e.split(`-`);if(t.length!==4)return null;let[n,r,i,a]=t;if(n.length!==2||r.length!==32||i.length!==16||a.length!==2)return null;let o=/^[0-9a-f]+$/i;return!o.test(n)||!o.test(r)||!o.test(i)||!o.test(a)||r===`00000000000000000000000000000000`||i===`0000000000000000`?null:{version:n,traceId:r,parentId:i,traceFlags:a,isSampled:(parseInt(a,16)&1)==1}}function mc(e,t){if(!e||!t||t.length===0)return!1;let n;if(e instanceof URL)n=e;else try{n=new URL(e)}catch{return!1}for(let e of t)try{if(typeof e==`string`){if(hc(n.hostname,e))return!0}
34else if(e instanceof RegExp){if(e.test(n.hostname))return!0}else if(typeof e==`function`&&e(n))return!0}catch{continue}return!1}function hc(e,t){if(t===e)return!0;if(t.startsWith(`*.`)){let n=t.slice(2);if(e.endsWith(n)&&(e===n||e.endsWith(`.`+n)))return!0}return!1}function gc(e){let t=[];try{let n=new URL(e);t.push(n.hostname)}catch{}return t.push(`*.supabase.co`,`*.supabase.in`),t.push(`localhost`,`127.0.0.1`,`[::1]`),t}function _c(e){"@babel/helpers - typeof";return _c=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},_c(e)}function vc(e,t){if(_c(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(_c(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function yc(e){var t=vc(e,`string`);return _c(t)==`symbol`?t:t+``}function bc(e,t,n){return(t=yc(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Sc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?xc(Object(n),!0).forEach(function(t){bc(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xc(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Cc=e=>e?(...t)=>e(...t):(...e)=>fetch(...e),wc=()=>Headers,Tc=(e,t,n,r,i)=>{let a=Cc(r),o=wc(),s=i?.enabled===!0,c=i?.respectSamplingDecision!==!1,l=s?gc(t):null;return async(t,r)=>{let i=await n()??e,s=new o(r?.headers);if(s.has(`apikey`)||s.set(`apikey`,e),s.has(`Authorization`)||s.set(`Authorization`,`Bearer ${i}`),l){let e=await Ec(t,l,c);e&&(e.traceparent&&!s.has(`traceparent`)&&s.set(`traceparent`,e.traceparent),e.tracestate&&!s.has(`tracestate`)&&s.set(`tracestate`,e.tracestate),e.baggage&&!s.has(`baggage`)&&s.set(`baggage`,e.baggage))}return a(t,Sc(Sc({},r),{},{headers:s}))}};async function Ec(e,t,n){if(!mc(typeof e==`string`||e instanceof URL?e:e.url,t))return null;let r=await fc();if(!r||!r.traceparent)return null;if(n){let e=pc(r.traceparent);if(e&&!e.isSampled)return null}return r}function Dc(e){return typeof e==`boolean`?{enabled:e}:e}function Oc(e){return e.endsWith(`/`)?e:e+`/`}function kc(e,t){let{db:n,auth:r,realtime:i,global:a}=e,{db:o,auth:s,realtime:c,global:l}=t,u=Dc(e.tracePropagation),d=Dc(t.tracePropagation),f={db:Sc(Sc({},o),n),auth:Sc(Sc({},s),r),realtime:Sc(Sc({},c),i),storage:{},global:Sc(Sc(Sc({},l),a),{},{headers:Sc(Sc({},l?.headers??{}),a?.headers??{})}),tracePropagation:{enabled:u?.enabled??d?.enabled??!1,respectSamplingDecision:u?.respectSamplingDecision??d?.respectSamplingDecision??!0},accessToken:async()=>``};return e.accessToken?f.accessToken=e.accessToken:delete f.accessToken,f}function Ac(e){let t=e?.trim();if(!t)throw Error(`supabaseUrl is required.`);if(!t.match(/^https?:\/\//i))throw Error(`Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.`);try{return new URL(Oc(t))}catch{throw Error(`Invalid supabaseUrl: Provided URL is malformed.`)}}var jc=class extends Qs{constructor(e){super(e)}},Mc=class{constructor(e,t,n){this.supabaseUrl=e,this.supabaseKey=t;let r=Ac(e);if(!t)throw Error(`supabaseKey is required.`);this.realtimeUrl=new URL(`realtime/v1`,r),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace(`http`,`ws`),this.authUrl=new URL(`auth/v1`,r),this.storageUrl=new URL(`storage/v1`,r),this.functionsUrl=new URL(`functions/v1`,r);let i=`sb-${r.hostname.split(`.`)[0]}-auth-token`,a={db:ic,realtime:oc,auth:Sc(Sc({},ac),{},{storageKey:i}),global:rc,tracePropagation:sc},o=kc(n??{},a);this.settings=o,this.storageKey=o.auth.storageKey??``,this.headers=o.global.headers??{},o.accessToken?(this.accessToken=o.accessToken,this.auth=new Proxy({},{get:(e,t)=>{throw Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(t)} is not possible`)}})):this.auth=this._initSupabaseAuthClient(o.auth??{},this.headers,o.global.fetch),this.fetch=Tc(t,e,this._getAccessToken.bind(this),o.global.fetch,o.tracePropagation),this.realtime=this._initRealtimeClient(Sc({headers:this.headers,accessToken:this._getAccessToken.bind(this),fetch:this.fetch},o.realtime)),this.accessToken&&Promise.resolve(this.accessToken()).then(e=>this.realtime.setAuth(e)).catch(e=>console.warn(`Failed to set initial Realtime auth token:`,e)),this.rest=new Ir(new
34URL(`rest/v1`,r).href,{headers:this.headers,schema:o.db.schema,fetch:this.fetch,timeout:o.db.timeout,urlLengthLimit:o.db.urlLengthLimit}),this.storage=new Ga(this.storageUrl.href,this.headers,this.fetch,n?.storage),o.accessToken||this._listenForAuthEvents()}get functions(){return new _r(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}rpc(e,t={},n={head:!1,get:!1,count:void 0}){return this.rest.rpc(e,t,n)}channel(e,t={config:{}}){return this.realtime.channel(e,t)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var e=this;if(e.accessToken)return await e.accessToken();let{data:t}=await e.auth.getSession();return t.session?.access_token??e.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:t,detectSessionInUrl:n,storage:r,userStorage:i,storageKey:a,flowType:o,lock:s,debug:c,throwOnError:l,experimental:u,lockAcquireTimeout:d,skipAutoInitialize:f},p,m){let h={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new jc({url:this.authUrl.href,headers:Sc(Sc({},h),p),storageKey:a,autoRefreshToken:e,persistSession:t,detectSessionInUrl:n,storage:r,userStorage:i,flowType:o,lock:s,debug:c,throwOnError:l,experimental:u,fetch:m,lockAcquireTimeout:d,skipAutoInitialize:f,hasCustomAuthorizationHeader:Object.keys(this.headers).some(e=>e.toLowerCase()===`authorization`)})}_initRealtimeClient(e){return new Ki(this.realtimeUrl.href,Sc(Sc({},e),{},{params:Sc(Sc({},{apikey:this.supabaseKey}),e?.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((e,t)=>{this._handleTokenChanged(e,`CLIENT`,t?.access_token)})}_handleTokenChanged(e,t,n){(e===`TOKEN_REFRESHED`||e===`SIGNED_IN`)&&this.changedAccessToken!==n?(this.changedAccessToken=n,this.realtime.setAuth(n)):e===`SIGNED_OUT`&&(this.realtime.setAuth(),t==`STORAGE`&&this.auth.signOut(),this.changedAccessToken=void 0)}},Nc=(e,t,n)=>new Mc(e,t,n);function Pc(){if(typeof window<`u`)return!1;let e=globalThis.process;if(!e)return!1;let t=e.version;if(t==null)return!1;let n=t.match(/^v(\d+)\./);return n?parseInt(n[1],10)<=18:!1}Pc()&&console.warn(`â ï¸ Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217`);var z=Nc(`https://fzyvowthczazgirfursb.supabase.co`,`sb_publishable_NEgdxzTkVXkWnExIQuUVFQ_IOO4wGls`),Fc=[{label:`Home`,to:`/`},{label:`Businesses`,to:`/businesses`},{label:`Events`,to:`/events`},{label:`Resources`,to:`/resources`},{label:`Pricing`,to:`/pricing`},{label:`Blog`,to:`/blog`}];function Ic(){let e=O(),t=yt(),[n,r]=(0,_.useState)(!1),[i,a]=(0,_.useState)(null),o=cr()<768;(0,_.useEffect)(()=>{z.auth.getSession().then(({data:e})=>a(e.session?.user??null));let{data:e}=z.auth.onAuthStateChange((e,t)=>{a(t?.user??null)});return()=>e.subscription.unsubscribe()},[]);async function s(){await z.auth.signOut(),r(!1),t(`/`)}function c(t){return e.pathname===t||t!==`/`&&e.pathname.startsWith(t)}let l=i?.user_metadata?.full_name?.split(` `)[0]||i?.email?.split(`@`)[0]||`My Account`;return(0,j.jsxs)(`nav`,{style:{background:`#C0392B`,position:`relative`,zIndex:100},children:[(0,j.jsx)(M,{children:(0,j.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,height:60,gap:8},children:[(0,j.jsxs)(A,{to:`/`,style:{display:`flex`,alignItems:`center`,gap:8,color:`#fff`,fontWeight:900,fontSize:o?15:17,letterSpacing:`-0.3px`,textDecoration:`none`,whiteSpace:`nowrap`,flexShrink:0},children:[(0,j.jsx)(`span`,{style:{fontSize:20},children:`ð´`}),`Palm Beach Comm`]}),!o&&(0,j.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,gap:2},children:Fc.map(({label:e,to:t})=>{let n=c(t);return(0,j.jsx)(A,{to:t,style:{padding:`6px 16px`,borderRadius:999,fontSize:14,fontWeight:500,color:`#fff`,textDecoration:`none`,background:n?`rgba(255,255,255,0.22)`:`transparent`},onMouseEnter:e=>{n||(e.currentTarget.style.background=`rgba(255,255,255,0.12)`)},onMouseLeave:e=>{n||(e.currentTarget.style.background=n?`rgba(255,255,255,0.22)`:`transparent`)},children:e},t)})}),!o&&(0,j.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,gap:16},children:i?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(A,{to:`/account`,style:{color:`rgba(255,255,255,0.9)`,fontSize:14,fontWeight:600,textDecoration:`none`,background:`rgba(255,255,255,0.12)`,padding:`6px 14px`,borderRadius:999},children:[`Hi, `,l]}
34),(0,j.jsx)(`button`,{onClick:s,style:{background:`rgba(255,255,255,0.15)`,border:`none`,color:`#fff`,fontSize:13,fontWeight:600,padding:`6px 16px`,borderRadius:999,cursor:`pointer`},children:`Sign Out`})]}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(A,{to:`/sign-in`,style:{color:`rgba(255,255,255,0.85)`,fontSize:14,fontWeight:500,textDecoration:`none`},children:`Sign In`}),(0,j.jsx)(A,{to:`/sign-up`,style:{background:`#F0C419`,color:`#111`,fontSize:14,fontWeight:700,padding:`6px 20px`,borderRadius:999,textDecoration:`none`},children:`Join Free`})]})}),o&&(0,j.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10,flexShrink:0},children:[!i&&(0,j.jsx)(A,{to:`/sign-up`,style:{background:`#F0C419`,color:`#111`,fontSize:12,fontWeight:700,padding:`5px 12px`,borderRadius:999,textDecoration:`none`,whiteSpace:`nowrap`},children:`Join Free`}),(0,j.jsxs)(`button`,{onClick:()=>r(e=>!e),style:{background:`rgba(255,255,255,0.18)`,border:`none`,borderRadius:8,padding:`7px 9px`,cursor:`pointer`,display:`flex`,flexDirection:`column`,gap:4,flexShrink:0},children:[(0,j.jsx)(`span`,{style:{display:`block`,width:18,height:2,background:`#fff`,borderRadius:2}}),(0,j.jsx)(`span`,{style:{display:`block`,width:18,height:2,background:`#fff`,borderRadius:2}}),(0,j.jsx)(`span`,{style:{display:`block`,width:18,height:2,background:`#fff`,borderRadius:2}})]})]})]})}),o&&n&&(0,j.jsx)(`div`,{style:{background:`#A93226`,borderTop:`1px solid rgba(255,255,255,0.15)`,paddingBottom:12},children:(0,j.jsx)(M,{children:(0,j.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:2,paddingTop:8},children:[Fc.map(({label:e,to:t})=>(0,j.jsx)(A,{to:t,onClick:()=>r(!1),style:{padding:`10px 14px`,borderRadius:10,fontSize:15,fontWeight:c(t)?700:500,color:`#fff`,textDecoration:`none`,background:c(t)?`rgba(255,255,255,0.18)`:`transparent`},children:e},t)),(0,j.jsx)(`div`,{style:{borderTop:`1px solid rgba(255,255,255,0.12)`,marginTop:4,paddingTop:10},children:i?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(A,{to:`/account`,onClick:()=>r(!1),style:{display:`block`,padding:`10px 14px`,borderRadius:10,fontSize:14,fontWeight:700,color:`#fff`,textDecoration:`none`},children:`ð¤ My Account`}),(0,j.jsx)(`button`,{onClick:s,style:{width:`100%`,textAlign:`left`,padding:`10px 14px`,background:`none`,border:`none`,fontSize:14,color:`rgba(255,255,255,0.75)`,cursor:`pointer`,borderRadius:10},children:`Sign Out`})]}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(A,{to:`/sign-in`,onClick:()=>r(!1),style:{display:`block`,padding:`10px 14px`,borderRadius:10,fontSize:14,color:`rgba(255,255,255,0.85)`,textDecoration:`none`},children:`Sign In`}),(0,j.jsx)(A,{to:`/sign-up`,onClick:()=>r(!1),style:{display:`block`,padding:`10px 14px`,borderRadius:10,fontSize:14,color:`#F0C419`,fontWeight:700,textDecoration:`none`},children:`Join Free â`})]})})]})})})]})}var Lc=()=>(0,j.jsx)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`currentColor`,style:{flexShrink:0},children:(0,j.jsx)(`path`,{d:`M18 2h-3a5 5 0 0 0-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 0 1 1-1h3z`})}),Rc=()=>(0,j.jsxs)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`currentColor`,style:{flexShrink:0},children:[(0,j.jsx)(`path`,{d:`M22.54 6.42a2.78 2.78 0 0 0-1.95-1.96C18.88 4 12 4 12 4s-6.88 0-8.59.46a2.78 2.78 0 0 0-1.95 1.96A29 29 0 0 0 1 12a29 29 0 0 0 .46 5.58A2.78 2.78 0 0 0 3.41 19.6C5.12 20 12 20 12 20s6.88 0 8.59-.46a2.78 2.78 0 0 0 1.95-1.95A29 29 0 0 0 23 12a29 29 0 0 0-.46-5.58z`}),(0,j.jsx)(`polygon`,{points:`9.75 15.02 15.5 12 9.75 8.98 9.75 15.02`,fill:`white`})]}),zc=()=>(0,j.jsxs)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,style:{flexShrink:0},children:[(0,j.jsx)(`path`,{d:`M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2`}),(0,j.jsx)(`circle`,{cx:`9`,cy:`7`,r:`4`}),(0,j.jsx)(`path`,{d:`M23 21v-2a4 4 0 0 0-3-3.87`}),(0,j.jsx)(`path`,{d:`M16 3.13a4 4 0 0 1 0 7.75`})]});function Bc({to:e,href:t,icon:n,children:r}){let i=(0,j.jsxs)(`span`,{style:{display:`flex`,alignItems:`center`,gap:7},children:[n,r]}),a={fontSize:13,color:`#9CA3AF`,textDecoration:`none`},o={onMouseEnter:e=>e.currentTarget.style.color=`#fff`,onMouseLeave:e=>e.currentTarget.style.color=`#9CA3AF`};return t?(0,j.jsx)(`a`,{href:t,target:`_blank`,rel:`noreferrer`,style:a,...o,children:i}):(0,j.jsx)(A,{to:e,style:a,...o,children:i})}function Vc(){let e=cr()<768;return(0,j.jsx)(`footer`,{style:{background:`#111`,color:`#9CA3AF`,marginTop:`auto`}
34,children:(0,j.jsxs)(M,{children:[(0,j.jsxs)(`div`,{style:e?{display:`grid`,gridTemplateColumns:`repeat(2, 1fr)`,gap:28,padding:`40px 0 28px`}:{display:`grid`,gridTemplateColumns:`repeat(5, 1fr)`,gap:32,padding:`48px 0 32px`},children:[(0,j.jsxs)(`div`,{style:{gridColumn:e?`1 / -1`:`auto`},children:[(0,j.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,color:`#fff`,fontWeight:800,fontSize:16,marginBottom:10},children:[(0,j.jsx)(`span`,{children:`ð´`}),` Palm Beach Comm`]}),(0,j.jsx)(`p`,{style:{fontSize:13,lineHeight:1.6},children:`Your Palm Beach County community â businesses, events, and more.`})]}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`h4`,{style:{color:`#fff`,fontWeight:600,fontSize:11,textTransform:`uppercase`,letterSpacing:`0.08em`,marginBottom:14},children:`Explore`}),(0,j.jsx)(`ul`,{style:{listStyle:`none`,display:`flex`,flexDirection:`column`,gap:9,padding:0,margin:0},children:[[`Businesses`,`/businesses`],[`Events`,`/events`],[`Resources`,`/resources`],[`Forums`,`/forums`],[`Blog`,`/blog`],[`Podcasts`,`/podcasts`],[`Pricing`,`/pricing`],[`Job Board`,`/jobs`],[`Classifieds`,`/classifieds`]].map(([e,t])=>(0,j.jsx)(`li`,{children:(0,j.jsx)(Bc,{to:t,children:e})},t))})]}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`h4`,{style:{color:`#fff`,fontWeight:600,fontSize:11,textTransform:`uppercase`,letterSpacing:`0.08em`,marginBottom:14},children:`For Businesses`}),(0,j.jsxs)(`ul`,{style:{listStyle:`none`,display:`flex`,flexDirection:`column`,gap:9,padding:0,margin:0},children:[(0,j.jsx)(`li`,{children:(0,j.jsx)(Bc,{to:`/pricing`,children:`Listing Plans`})}),(0,j.jsx)(`li`,{children:(0,j.jsx)(Bc,{to:`/advertise`,children:`Advertise`})}),(0,j.jsx)(`li`,{children:(0,j.jsx)(Bc,{to:`/pricing`,children:`Get Listed`})}),(0,j.jsx)(`li`,{children:(0,j.jsx)(Bc,{to:`/beta`,children:`Join the Beta`})})]})]}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`h4`,{style:{color:`#fff`,fontWeight:600,fontSize:11,textTransform:`uppercase`,letterSpacing:`0.08em`,marginBottom:14},children:`Community`}),(0,j.jsxs)(`ul`,{style:{listStyle:`none`,display:`flex`,flexDirection:`column`,gap:9,padding:0,margin:0},children:[(0,j.jsx)(`li`,{children:(0,j.jsx)(Bc,{href:`https://www.facebook.com/palmbeachcomm`,icon:(0,j.jsx)(Lc,{}),children:`Facebook Page`})}),(0,j.jsx)(`li`,{children:(0,j.jsx)(Bc,{href:`https://www.facebook.com/groups/pbclassifieds`,icon:(0,j.jsx)(zc,{}),children:`PBC Classifieds`})}),(0,j.jsx)(`li`,{children:(0,j.jsx)(Bc,{href:`https://www.youtube.com/@PalmBeachCommunity`,icon:(0,j.jsx)(Rc,{}),children:`YouTube`})})]})]}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`h4`,{style:{color:`#fff`,fontWeight:600,fontSize:11,textTransform:`uppercase`,letterSpacing:`0.08em`,marginBottom:14},children:`Company`}),(0,j.jsxs)(`ul`,{style:{listStyle:`none`,display:`flex`,flexDirection:`column`,gap:9,padding:0,margin:0},children:[(0,j.jsx)(`li`,{children:(0,j.jsx)(Bc,{to:`/contact`,children:`Contact Us`})}),(0,j.jsx)(`li`,{children:(0,j.jsx)(Bc,{to:`/terms`,children:`Terms of Service`})}),(0,j.jsx)(`li`,{children:(0,j.jsx)(Bc,{to:`/privacy`,children:`Privacy Policy`})})]})]})]}),(0,j.jsxs)(`div`,{style:{borderTop:`1px solid #222`,padding:`18px 0`,fontSize:12,color:`#6B7280`,display:`flex`,flexDirection:e?`column`:`row`,alignItems:`center`,justifyContent:`space-between`,gap:8,textAlign:e?`center`:`left`},children:[(0,j.jsxs)(`span`,{children:[`© `,new Date().getFullYear(),` Palm Beach Comm â The Bynes Company Office Solutions. All rights reserved.`]}),(0,j.jsx)(`a`,{href:`https://bynesco-digital-maker.vercel.app/`,target:`_blank`,rel:`noopener noreferrer`,style:{color:`#F0C419`,fontWeight:600,textDecoration:`none`},children:`Powered by BynesPro AI`})]})]})})}var Hc={free:{name:`Free`,price:0,descriptionMaxChars:150,photos:1,socialLinks:!1,productsSection:!1,eventsPerMonth:0,featuredRotation:!1,priorityPlacement:!1,badge:null},basic:{name:`Basic`,price:20,descriptionMaxChars:null,photos:5,socialLinks:!0,productsSection:!1,eventsPerMonth:1,featuredRotation:!1,priorityPlacement:!1,badge:null},pro:{name:`Pro`,price:40,descriptionMaxChars:null,photos:15,socialLinks:!0,productsSection:!0,eventsPerMonth:5,featuredRotation:`rotation`,priorityPlacement:!0,badge:`Verified`},elite:{name:`Elite`,price:70,descriptionMaxChars:null,photos:null,socialLinks:!0,productsSection:!0,eventsPerMonth:null,featuredRotation:`guaranteed`,priorityPlacement:!0,badge:`custom`}},Uc=[`Restaurants`,`Real Estate`,`Services`,`Health`,`Shopping`,`Finance`,`Education`,`Technology / SaaS`,`Beauty & Wellness`,`Entertainment`,`Automotive`,`Home & Garden`,`Legal`,`Nonprofits`,`Other`],Wc=[`Community`,`Business`,`Arts`,`Celebration`,`Sports`,`Food & Drink`,`Other`],Gc={free:`#9CA3AF`,basic:`#3B82F6`,pro:`#C0392B`,elite:`#F59E0B`};function Kc({business:e}){let{id:t,slug:n,name:r,category:i,city:a,description:o,avg_rating:s,review_count:c,tier:l,badge:u,logo_initial:d,logo_bg_color:f,logo_url:p}=e,m=Gc[l]||Gc.free;return(0,j.jsxs)(A,{to:`/businesses/${n||t}`,style:{display:`block`,background:`#fff`,borderRadius:16,border:`1px solid #F0F0F0`,overflow:`hidden`,textDecoration:`none`,color:`inherit`,transition:`box-shadow 0.2s, border-color 0.2s`},onMouseEnter:e=>{e.currentTarget.style.boxShadow=`0 6px 24px rgba(0,0,0,0.09)`,e.currentTarget.style.borderColor=`#E0E0E0`},onMouseLeave:e=>{e.currentTarget.style.boxShadow=``,e.currentTarget.style.borderColor=`#F0F0F0`}
34,children:[(0,j.jsx)(`div`,{style:{height:3,background:m}}),(0,j.jsxs)(`div`,{style:{padding:20},children:[(0,j.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12,marginBottom:12},children:[p?(0,j.jsx)(`img`,{src:p,alt:r,style:{width:40,height:40,borderRadius:10,objectFit:`cover`,flexShrink:0}}):(0,j.jsx)(`div`,{style:{width:40,height:40,borderRadius:10,background:f||`#C0392B`,color:`#fff`,fontWeight:700,fontSize:16,display:`flex`,alignItems:`center`,justifyContent:`center`,flexShrink:0},children:d||r?.[0]||`?`}),(0,j.jsxs)(`div`,{style:{flex:1,minWidth:0},children:[(0,j.jsx)(`div`,{style:{fontWeight:700,color:`#111`,fontSize:14,lineHeight:1.3,whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`},children:r}),(0,j.jsx)(`div`,{style:{fontSize:12,color:`#9CA3AF`,marginTop:2,whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`},children:a})]}),i&&(0,j.jsx)(`span`,{style:{background:`#C0392B`,color:`#fff`,fontSize:11,fontWeight:700,padding:`3px 10px`,borderRadius:999,flexShrink:0,whiteSpace:`nowrap`},children:i})]}),o&&(0,j.jsx)(`p`,{style:{fontSize:12,color:`#6B7280`,lineHeight:1.6,marginBottom:16,display:`-webkit-box`,WebkitLineClamp:2,WebkitBoxOrient:`vertical`,overflow:`hidden`},children:o}),(0,j.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`},children:[s==null?(0,j.jsx)(`span`,{}):(0,j.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6,fontSize:12},children:[(0,j.jsx)(`span`,{style:{color:`#FBBF24`,fontSize:14},children:`â
â
â
â
â
`}),(0,j.jsx)(`span`,{style:{fontWeight:600,color:`#374151`},children:s}),c!=null&&(0,j.jsxs)(`span`,{style:{color:`#9CA3AF`},children:[`(`,c,`)`]})]}),u&&l===`pro`&&(0,j.jsx)(`span`,{style:{fontSize:11,fontWeight:800,padding:`3px 10px`,borderRadius:999,background:`#EFF6FF`,color:`#1D4ED8`,border:`1px solid #BFDBFE`},children:u}),u&&l===`elite`&&(0,j.jsxs)(`span`,{style:{fontSize:11,fontWeight:800,padding:`3px 10px`,borderRadius:999,background:`#FEF9C3`,color:`#92400E`,border:`1px solid #FDE68A`},children:[`â `,u]})]})]})]})}var qc=`America/New_York`;function Jc(e){let t=new Intl.DateTimeFormat(`en-US`,{timeZone:qc,hourCycle:`h23`,year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`,weekday:`short`}),n={};for(let r of t.formatToParts(e))n[r.type]=r.value;return n}function Yc(e){if(!e)return null;let[t,n]=e.split(`T`),[r,i,a]=t.split(`-`).map(Number),[o,s]=(n||`00:00`).split(`:`).map(Number),c=new Date(Date.UTC(r,i-1,a,o,s)),l=Jc(c),u=Date.UTC(+l.year,l.month-1,+l.day,+l.hour,+l.minute,+l.second)-c.getTime();return new Date(c.getTime()-u).toISOString()}function Xc(e){if(!e)return``;let t=Jc(new Date(e));return`${t.year}-${t.month}-${t.day}T${t.hour}:${t.minute}`}function Zc(e,t){return e?new Date(e).toLocaleString(`en-US`,{timeZone:qc,...t}):``}function Qc(e){let t=Jc(new Date(e));return{year:+t.year,month:+t.month,day:+t.day,hour:+t.hour,minute:+t.minute,weekday:t.weekday}}var $c=[`JAN`,`FEB`,`MAR`,`APR`,`MAY`,`JUN`,`JUL`,`AUG`,`SEP`,`OCT`,`NOV`,`DEC`],el={Community:{background:`#F3F4F6`,color:`#374151`},Business:{background:`#EFF6FF`,color:`#1D4ED8`},Arts:{background:`#F5F3FF`,color:`#6D28D9`},Celebration:{background:`#FFF7ED`,color:`#C2410C`},Sports:{background:`#F0FDF4`,color:`#15803D`},"Food & Drink":{background:`#FFFBEB`,color:`#B45309`},Other:{background:`#F3F4F6`,color:`#6B7280`}};function tl({event:e}){let{id:t,title:n,event_date:r,location:i,category:a,cover_image_url:o,featured:s,featured_on_listing:c}=e,l=Qc(r),u=el[a]||{background:`#F3F4F6`,color:`#374151`},d=Zc(r,{hour:`numeric`,minute:`2-digit`,hour12:!0});return(0,j.jsx)(A,{to:`/events/${t}`,style:{textDecoration:`none`,color:`inherit`,display:`block`},children:(0,j.jsxs)(`div`,{style:{background:`#fff`,borderRadius:16,border:c?`2px solid #D97706`:`1px solid #EBEBEB`,padding:16,display:`flex`,gap:14,alignItems:`flex-start`,cursor:`pointer`,transition:`box-shadow 0.15s`,position:`relative`},onMouseEnter:e=>e.currentTarget.style.boxShadow=`0 4px 16px rgba(0,0,0,0.08)`,onMouseLeave:e=>e.currentTarget.style.boxShadow=`none`,children:[c&&(0,j.jsx)(`div`,{style:{position:`absolute`,top:8,right:8,background:`#D97706`,color:`#fff`,padding:`2px 6px`,borderRadius:999,fontSize:12,fontWeight:700},children:`â`}),o&&(0,j.jsx)(`img`,{src:o,alt:n,style:{width:56,height:56,objectFit:`cover`,borderRadius:10,flexShrink:0}}),(0,j.jsxs)(`div`,{style:{background:`#FEF2F2`,borderRadius:12,padding:`10px 14px`,display:`flex`,flexDirection:`column`,alignItems:`center`,flexShrink:0,minWidth:52},children:[(0,j.jsx)(`span`,{style:{fontSize:10,fontWeight:700,color:`#9CA3AF`,letterSpacing:`0.05em`},children:l.weekday.toUpperCase()}),(0,j.jsx)(`span`,{style:{fontSize:26,fontWeight:900,color:`#C0392B`,lineHeight:1.1},children:l.day}),(0,j.jsx)(`span`,{style:{fontSize:10,fontWeight:700,color:`#9CA3AF`,letterSpacing:`0.05em`},children:$c[l.month-1]})]}),(0,j.jsxs)(`div`,{style:{flex:1,minWidth:0},children:[(0,j.jsx)(`p`,{style:{fontSize:14,fontWeight:700,color:`#111`,lineHeight:1.35,marginBottom:4},children:n}),i&&(0,j.jsxs)(`p`,{style:{fontSize:12,color:`#9CA3AF`,marginBottom:6,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:[`ð `,i]}),(0,j.jsxs)(`p`,{style:{fontSize:12,color:`#9CA3AF`,marginBottom:8},children:[`ð `,d]}),a&&(0,j.jsx)(`span`,{style:{fontSize:11,fontWeight:600,padding:`2px 10px`,borderRadius:999,...u},children:a})]})]})})}var nl=[{id:`1`,slug:`havana-nights`,name:`Havana Nights`,category:`Restaurant`,city:`West Palm Beach`,description:`Authentic Cuban cuisine and live music in a vibrant atmosphere.`,avg_rating:4.8,review_count:127,tier:`pro`,logo_initial:`H`,logo_bg_color:`#C0392B`},{id:`2`,slug:`pb-realty-group`,name:`PB Realty Group`,category:`Real Estate`,city:`Palm Beach Gardens`,description:`Luxury real estate specialists serving all of Palm Beach County since 2001.`,avg_rating:4.9,review_count:84,tier:`elite`,logo_initial:`P`,logo_bg_color:`#3B82F6`},{id:`3`,slug:`sunbright-solar`,name:`SunBright Solar`,category:`Services`,city:`Boca Raton`,description:`Solar panel installation and renewable energy solutions for Florida homes.`,avg_rating:4.7,review_count:56,tier:`basic`,logo_initial:`S`,logo_bg_color:`#F59E0B`}],rl=[{id:`1`,title:`Palm Beach Community Night`,event_date:`2026-07-05T19:00:00`,location:`Downtown West Palm Beach`,category:`Community`},{id:`2`,title:`Fourth of July Fireworks`,event_date:`2026-07-04T21:00:00`,location:`Flagler Drive, WPB`,category:`Celebration`},{id:`3`,title:`Small Business Mixer`,event_date:`2026-07-12T18:00:00`,location:`PB Gardens Marriott`,category:`Business`}
34,{id:`4`,title:`Clematis St Farmers Market`,event_date:`2026-07-19T08:00:00`,location:`Clematis St, WPB`,category:`Community`}],il=[{id:`1`,slug:`welcome`,title:`Welcome to the New Palm Beach Comm`,excerpt:`Introducing our revamped community platform for Palm Beach County businesses and residents.`,published_at:`2026-06-25`},{id:`2`,slug:`top-restaurants`,title:`Top 5 Restaurants in West Palm Beach This Summer`,excerpt:`From seafood to Cuban cuisine, here are the spots you need to visit this season.`,published_at:`2026-06-20`},{id:`3`,slug:`small-business-spotlight`,title:`Small Business Spotlight: June 2026`,excerpt:`Meet the entrepreneurs making Palm Beach County a better place to live and work.`,published_at:`2026-06-10`}],al=`#C0392B`,ol=[`https://images.unsplash.com/photo-1644985701274-3345c8be2641?w=700&q=80`,`https://images.unsplash.com/photo-1664829018245-04b94e17b8aa?w=700&q=80`,`https://images.unsplash.com/photo-1757609909192-0246239198c0?w=700&q=80`,`https://images.unsplash.com/photo-1459749411175-04bf5292ceea?w=700&q=80`,`https://images.unsplash.com/photo-1556742049-0cfed4f6a45d?w=700&q=80`,`https://images.unsplash.com/photo-1765648496288-e1760f547711?w=700&q=80`],sl=[{url:`https://images.unsplash.com/photo-1507525428034-b723cf961d3e?w=800&q=80`,label:`Palm Beach Coast`},{url:`https://images.unsplash.com/photo-1664829018245-04b94e17b8aa?w=800&q=80`,label:`West Palm Beach`},{url:`https://images.unsplash.com/photo-1555396273-367ea4eb4db5?w=800&q=80`,label:`Local Dining`},{url:`https://images.unsplash.com/photo-1523580494863-6f3031224c94?w=800&q=80`,label:`Community Events`}],cl=[{url:`https://images.unsplash.com/photo-1507525428034-b723cf961d3e?w=1400&q=85`,label:`Palm Beach Waterfront`,wide:!0},{url:`https://images.unsplash.com/photo-1540575467063-178a50c2df87?w=800&q=80`,label:`Business & Networking`},{url:`https://images.unsplash.com/photo-1414235077428-338989a2e8c0?w=800&q=80`,label:`Florida Dining`},{url:`https://images.unsplash.com/photo-1459749411175-04bf5292ceea?w=800&q=80`,label:`Arts & Culture`}],ll=[{category:`Live Music`,icon:`ðµ`,color:`#7C3AED`,bg:`#F5F3FF`,link:`/events?category=Arts`,items:[{title:`Clematis by Night`,detail:`Every other Friday · Clematis St, WPB`,link:`/events?q=clematis+by+night`},{title:`Kravis Center Performances`,detail:`World-class shows year-round`,link:`/events?q=kravis`},{title:`Respectable Street`,detail:`Live music & DJ nights, WPB`,link:`/businesses?q=respectable+street`}]},{category:`Family Fun`,icon:`ð¡`,color:`#D97706`,bg:`#FFFBEB`,link:`/events?category=Community`,items:[{title:`Cox Science Center & Aquarium`,detail:`Interactive exhibits & laser shows`,link:`/businesses?q=cox+science`}
34,{title:`South Florida Science Center`,detail:`STEM exhibits for all ages`,link:`/businesses?q=science+center`},{title:`Rapids Water Park`,detail:`Rides & slides in Riviera Beach`,link:`/businesses?q=rapids+water+park`}]},{category:`Arts & Culture`,icon:`ð¨`,color:`#0891B2`,bg:`#ECFEFF`,link:`/businesses?category=Entertainment`,items:[{title:`Norton Museum of Art`,detail:`World-class collection, free Sundays`,link:`/businesses?q=norton+museum`},{title:`Armory Art Center`,detail:`Classes, galleries & workshops`,link:`/businesses?q=armory+art`},{title:`Cultural Council PBC`,detail:`Local artist showcases & events`,link:`/businesses?q=cultural+council`}]},{category:`Outdoors`,icon:`ð`,color:`#059669`,bg:`#ECFDF5`,link:`/events?category=Community`,items:[{title:`Peanut Island Park`,detail:`Snorkeling, camping & beach access`,link:`/businesses?q=peanut+island`},{title:`Phil Foster Park`,detail:`Blue Heron Bridge snorkeling, free`,link:`/businesses?q=phil+foster`},{title:`Grassy Waters Preserve`,detail:`Hiking & wildlife viewing, WPB`,link:`/businesses?q=grassy+waters`}]}],ul=[{url:`https://images.unsplash.com/photo-1507525428034-b723cf961d3e?w=800&q=80`,label:`Palm Beach Beaches`},{url:`https://images.unsplash.com/photo-1459749411175-04bf5292ceea?w=800&q=80`,label:`Arts & Music`},{url:`https://images.unsplash.com/photo-1414235077428-338989a2e8c0?w=800&q=80`,label:`Local Dining`},{url:`https://images.unsplash.com/photo-1540575467063-178a50c2df87?w=800&q=80`,label:`Community Events`}],dl=[{url:`https://images.unsplash.com/photo-1511578314322-379afb476865?w=800&q=80`,label:`Business Networking`,span:!0},{url:`https://images.unsplash.com/photo-1757609909192-0246239198c0?w=800&q=80`,label:`Farmers Market`},{url:`https://images.unsplash.com/photo-1540575467063-178a50c2df87?w=800&q=80`,label:`Community Mixer`},{url:`https://images.unsplash.com/photo-1414235077428-338989a2e8c0?w=800&q=80`,label:`Food & Drink`},{url:`https://images.unsplash.com/photo-1459749411175-04bf5292ceea?w=800&q=80`,label:`Arts & Music`}];function fl(){let e=yt(),[t,n]=(0,_.useState)(``),[r,i]=(0,_.useState)(nl),[a,o]=(0,_.useState)([]),[s,c]=(0,_.useState)(rl),[l,u]=(0,_.useState)(il),d=cr()<768,f=!`https://fzyvowthczazgirfursb.supabase.co`.includes(`placeholder`);(0,_.useEffect)(()=>{f&&(p(),m(),h(),g())},[]);async function p(){let{data:e}=await z.from(`businesses`).select(`*`).eq(`active`,!0).eq(`featured_spotlight_active`,!0).limit(20);if(e?.length){let t=e.filter(e=>e.tier===`elite`),n=e.filter(e=>e.tier!==`elite`).sort(()=>Math.random()-.5);i([...t,...n].slice(0,6))}}async function m(){let{data:e}=await z.from(`businesses`).select(`*`).eq(`active`,!0).order(`created_at`,{ascending:!1}).limit(6);e?.length&&o(e)}async function h(){let{data:e}=await z.from(`events`).select(`*`).gte(`event_date`,new Date().toISOString()).order(`event_date`,{ascending:!0}).limit(4);e?.length&&c(e)}async function g(){let{data:e}=await z.from(`posts`).select(`id, slug, title, excerpt, published_at`).eq(`published`,!0).order(`published_at`,{ascending:!1}).limit(4);e?.length&&u(e)}function v(n){n.preventDefault(),t.trim()&&e(`/businesses?q=${encodeURIComponent(t.trim())}`)}let y=r[0],b=s[0],x=l[0],S=r.slice(1,4),C=s.slice(1),w=l.slice(1,3);return(0,j.jsxs)(`div`,{children:[(0,j.jsxs)(`section`,{style:{background:al,position:`relative`,overflow:`hidden`},children:[(0,j.jsx)(`div`,{style:{position:`absolute`,inset:0,display:`grid`,gridTemplateColumns:`repeat(3, 1fr)`,gridTemplateRows:`repeat(2, 1fr)`,gap:0},children:ol.map((e,t)=>(0,j.jsx)(`img`,{src:e,alt:``,style:{width:`100%`,height:`100%`,objectFit:`cover`,display:`block`}},t))}),(0,j.jsx)(`div`,{style:{position:`absolute`,inset:0,background:`linear-gradient(135deg, rgba(192,57,43,0.72) 0%, rgba(150,40,27,0.68) 100%)`}}),(0,j.jsx)(`div`,{style:{position:`relative`,zIndex:1},children:(0,j.jsx)(M,{children:(0,j.jsxs)(`div`,{style:{padding:d?`44px 0 52px`:`72px 0 80px`,display:`flex`,alignItems:`center`,gap:48},children:[(0,j.jsxs)(`div`,{style:{flex:1,minWidth:0},children:[(0,j.jsx)(`div`,{style:{display:`inline-flex`,alignItems:`center`,gap:6,background:`rgba(255,255,255,0.15)`,borderRadius:999,padding:`5px 14px`,marginBottom:20},children:(0,j.jsx)(`span`,{style:{fontSize:12,fontWeight:700,color:`#F0C419`,letterSpacing:`0.06em`,textTransform:`uppercase`},children:`ð´ Palm Beach County`})}),(0,j.jsxs)(`h1`,{style:{fontSize:d?36:54,fontWeight:900,color:`#fff`,lineHeight:1.08,letterSpacing:`-1.5px`,marginBottom:18,textShadow:`0 2px 16px rgba(0,0,0,0.35)`},children:[`Your Community.`,(0,j.jsx)(`br`,{}),`Your Businesses.`,(0,j.jsx)(`br`,{}),(0,j.jsx)(`span`,{style:{color:`#F0C419`},children:`All in One Place.`})]}),(0,j.jsx)(`p`,{style:{color:`rgba(255,255,255,0.9)`,fontSize:d?14:16,lineHeight:1.7,marginBottom:12,maxWidth:480,textShadow:`0 1px 10px rgba(0,0,0,0.3)`},children:`Palm Beach Comm is the local directory connecting residents with the best businesses, events, and community resources across Palm Beach County â from West Palm Beach to Boca Raton.`}),(0,j.jsx)(`p`,{style:{color:`rgba(255,255,255,0.75)`,fontSize:13,lineHeight:1.6,marginBottom:28,maxWidth:440,textShadow:`0 1px 8px rgba(0,0,0,0.3)`},children:`Free to browse. Free to list. Built for the community by people who call Palm Beach County home.`}),(0,j.jsxs)(`form`,{onSubmit:v,style:{display:`flex`,marginBottom:20,borderRadius:999,overflow:`hidden`,boxShadow:`0 6px 28px rgba(0,0,0,0.25)`,maxWidth:480},children:[(0,j.jsx)(`input`,{type:`text`,value:t,onChange:e=>n(e.target.value),placeholder:`Search restaurants, salons, contractors...`,style:{flex:1,padding:`14px 20px`,fontSize:14,background:`#fff`,color:`#111`,border:`none`,outline:`none`,minWidth:0}}),(0,j.jsx)(`button`,{type:`submit`,style:{padding:`14px 22px`,background:`#96281B`,color:`#fff`,border:`none`,fontWeight:700,fontSize:14,cursor:`pointer`,whiteSpace:`nowrap`},children:`Search`})]}),(0,j.jsxs)(`div`,{style:{display:`flex`,gap:10,marginBottom:24,flexWrap:`wrap`},children:[(0,j.jsx)(A,{to:`/businesses`,style:{padding:`10px 22px`,borderRadius:999,fontSize:13,fontWeight:700,color:`#111`,background:`#F0C419`,textDecoration:`none`}
34,children:`Browse Businesses â`}),(0,j.jsx)(A,{to:`/sign-up`,style:{padding:`10px 22px`,borderRadius:999,fontSize:13,fontWeight:700,color:`#fff`,border:`2px solid rgba(255,255,255,0.5)`,textDecoration:`none`},children:`List Your Business Free`})]}),(0,j.jsx)(`div`,{style:{display:`flex`,flexWrap:`wrap`,gap:6},children:Uc.slice(0,-1).map(e=>(0,j.jsx)(A,{to:`/businesses?category=${encodeURIComponent(e)}`,style:{padding:`4px 12px`,borderRadius:999,fontSize:11,fontWeight:500,color:`rgba(255,255,255,0.75)`,border:`1px solid rgba(255,255,255,0.25)`,textDecoration:`none`},children:e},e))})]}),!d&&(0,j.jsx)(`div`,{style:{width:300,flexShrink:0,display:`flex`,flexDirection:`column`,gap:10},children:[{icon:`ð`,title:`Founding Business Beta`,desc:`Be one of the first 50 businesses â extended trial, badge & guaranteed spotlight.`,to:`/beta`,cta:`Apply Now â`},{icon:`ð¼`,title:`List Your Business Free`,desc:`Join our growing directory. Plans start free, upgrade anytime.`,to:`/pricing`,cta:`Get Started â`},{icon:`ð·ï¸`,title:`PBC Classifieds`,desc:`Buy, sell & trade locally with Palm Beach County residents.`,to:`/classifieds`,cta:`Browse Listings â`},{icon:`ð`,title:`Job Board`,desc:`Find local jobs or post an opening for your business.`,to:`/jobs`,cta:`View Jobs â`},{icon:`ð¢`,title:`Advertise With Us`,desc:`Reach thousands of PBC residents. Banners, spotlights & more.`,to:`/advertise`,cta:`See Ad Options â`}].map(e=>(0,j.jsxs)(A,{to:e.to,style:{textDecoration:`none`,background:`rgba(255,255,255,0.08)`,borderRadius:14,padding:`14px 16px`,display:`flex`,gap:12,alignItems:`flex-start`,border:`1px solid rgba(255,255,255,0.15)`,transition:`background 0.15s`},onMouseEnter:e=>e.currentTarget.style.background=`rgba(255,255,255,0.16)`,onMouseLeave:e=>e.currentTarget.style.background=`rgba(255,255,255,0.08)`,children:[(0,j.jsx)(`span`,{style:{fontSize:20,flexShrink:0,marginTop:1},children:e.icon}),(0,j.jsxs)(`div`,{style:{flex:1,minWidth:0},children:[(0,j.jsx)(`div`,{style:{fontSize:13,fontWeight:800,color:`#fff`,marginBottom:3},children:e.title}),(0,j.jsx)(`div`,{style:{fontSize:11,color:`rgba(255,255,255,0.6)`,lineHeight:1.5,marginBottom:6},children:e.desc}),(0,j.jsx)(`div`,{style:{fontSize:11,fontWeight:700,color:`#F0C419`},children:e.cta})]})]},e.title))})]})})})]}),(0,j.jsx)(`div`,{style:{background:`#fff`,borderBottom:`1px solid #EBEBEB`},children:(0,j.jsx)(M,{children:(0,j.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(4, 1fr)`},children:[{num:`Growing`,label:`Local Businesses`,icon:`ðª`},{num:`15`,label:`Business Categories`,icon:`ð·ï¸`},{num:`100%`,label:`Locally Owned`,icon:`ð¤`},{num:`PBC`,label:`County-Wide Coverage`,icon:`ð`}].map((e,t,n)=>(0,j.jsxs)(`div`,{style:{padding:d?`20px 0`:`28px 0`,textAlign:`center`,borderRight:t<n.length-1?`1px solid #EBEBEB`:`none`},children:[(0,j.jsx)(`div`,{style:{fontSize:d?16:20,marginBottom:2},children:e.icon}),(0,j.jsx)(`div`,{style:{fontSize:d?18:24,fontWeight:900,color:`#111`,lineHeight:1},children:e.num}),(0,j.jsx)(`div`,{style:{fontSize:d?10:12,color:`#9CA3AF`,marginTop:3,fontWeight:500},children:e.label})]},e.label))})})}),(0,j.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:d?`repeat(2, 1fr)`:`repeat(4, 1fr)`,height:d?180:280,overflow:`hidden`},children:sl.map(e=>(0,j.jsxs)(`div`,{style:{position:`relative`,overflow:`hidden`},children:[(0,j.jsx)(`img`,{src:e.url,alt:e.label,style:{width:`100%`,height:`100%`,objectFit:`cover`,display:`block`,transition:`transform 0.4s ease`},onMouseEnter:e=>e.currentTarget.style.transform=`scale(1.04)`,onMouseLeave:e=>e.currentTarget.style.transform=`scale(1)`}),(0,j.jsx)(`div`,{style:{position:`absolute`,inset:0,background:`linear-gradient(to top, rgba(0,0,0,0.6) 0%, transparent 55%)`}}),(0,j.jsx)(`span`,{style:{position:`absolute`,bottom:14,left:16,fontSize:d?11:13,fontWeight:700,color:`#fff`,letterSpacing:`0.03em`,textShadow:`0 1px 4px rgba(0,0,0,0.4)`},children:e.label})]},e.label))}),(0,j.jsx)(`div`,{style:{maxWidth:1280,margin:`0 auto`,padding:d?`0 16px`:`0 32px`},children:(0,j.jsx)(`div`,{style:{padding:`0 0 80px`},children:(0,j.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:d?56:80,marginTop:d?40:64},children:[(0,j.jsxs)(`section`,{children:[(0,j.jsx)(pl,{eyebrow:`Featured`,title:`Local Businesses`,linkTo:`/businesses`}),y&&(0,j.jsx)(A,{to:`/businesses/${y.slug||y.id}`,style:{textDecoration:`none`,display:`block`,marginBottom:16},children:(0,j.jsxs)(`div`,{style:{background:`#fff`,borderRadius:20,border:`1px solid #EBEBEB`,padding:d?`20px 16px`:`28px 32px`,display:`flex`,flexDirection:d?`column`:`row`,alignItems:d?`flex-start`:`center`,gap:16},onMouseEnter:e=>e.currentTarget.style.boxShadow=`0 6px 24px rgba(0,0,0,0.07)`,onMouseLeave:e=>e.currentTarget.style.boxShadow=`none`,children:[(0,j.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:16,flex:1,minWidth:0},children:[(0,j.jsx)(`div`,{style:{width:52,height:52,borderRadius:12,background:y.logo_bg_color||al,color:`#fff`,fontSize:20,fontWeight:900,display:`flex`,alignItems:`center`,justifyContent:`center`,flexShrink:0},children:y.logo_initial||y.name?.[0]}),(0,j.jsxs)(`div`,{style:{flex:1,minWidth:0},children:[(0,j.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,flexWrap:`wrap`,marginBottom:4},children:[(0,j.jsx)(`span`,{style:{fontSize:16,fontWeight:900,color:`#111`},children:y.name}),(0,j.jsx)(`span`,{style:{fontSize:11,fontWeight:700,padding:`2px 8px`,borderRadius:999,background:`#C0392B18`,color:al,textTransform:`capitalize`},children:y.tier})]}),(0,j.jsxs)(`p`,{style:{fontSize:12,color:`#6B7280`},children:[y.category,` · `,y.city]}),y.description&&!d&&(0,j.jsx)(`p`,{style:{fontSize:12,color:`#9CA3AF`,lineHeight:1.55,marginTop:4},children:y.description})]})]}),(0,j.jsx)(`span`,{style:{fontSize:13,fontWeight:700,color:al,flexShrink:0,alignSelf:d?`flex-end`:`center`},children:`View â`})]})}),S.length>0&&(0,j.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:d?`1fr`:`repeat(3, 1fr)`,gap:16},children:S.map(e=>(0,j.jsx)(Kc,{business:e},e.id))})]}),a.length>0&&(0,j.jsxs)(`section`,{children:[(0,j.jsx)(pl,{eyebrow:`Explore`,title:`Businesses`,linkTo:`/businesses`}),(0,j.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:d?`1fr`:`repeat(3, 1fr)`,gap:16},children:a.map(e=>(0,j.jsx)(Kc,{business:e},e.id))})]}),(0,j.jsxs)(`section`,{children:[(0,j.jsx)(pl,{eyebrow:`Happening Soon`,title:`Upcoming Events`,linkTo:`/events`}),d?(0,j.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(2, 1fr)`,height:160,gap:6,marginBottom:16,borderRadius:12,overflow:`hidden`},children:dl.slice(0,4).map(e=>(0,j.jsxs)(`div`,{style:{position:`relative`,overflow:`hidden`},children:[(0,j.jsx)(`img`,{src:e.url,alt:e.label,style:{width:`100%`,height:`100%`,objectFit:`cover`,display:`block`}}),(0,j.jsx)(`div`,{style:{position:`absolute`,inset:0,background:`linear-gradient(to top, rgba(0,0,0,0.5) 0%, transparent 60%)`}}),(0,j.jsx)(`span`,{style:{position:`absolute`,bottom:8,left:8,fontSize:10,fontWeight:700,color:`#fff`},children:e.label})]},e.label))}):(0,j.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`2fr 1fr 1fr`,gridTemplateRows:`140px 140px`,gap:8,marginBottom:20,borderRadius:16,overflow:`hidden`},children:[(0,j.jsxs)(`div`,{style:{gridRow:`1 / 3`,position:`relative`,overflow:`hidden`},children:[(0,j.jsx)(`img`,{src:dl[0].url,alt:dl[0].label,style:{width:`100%`,height:`100%`,objectFit:`cover`,display:`block`}}),(0,j.jsx)(`div`,{style:{position:`absolute`,inset:0,background:`linear-gradient(to top, rgba(0,0,0,0.55) 0%, transparent 50%)`}}),(0,j.jsx)(`span`,{style:{position:`absolute`,bottom:14,left:14,fontSize:12,fontWeight:700,color:`#fff`},children:dl[0].label})]}),dl.slice(1).map(e=>(0,j.jsxs)(`div`,{style:{position:`relative`,overflow:`hidden`},children:[(0,j.jsx)(`img`,{src:e.url,alt:e.label,style:{width:`100%`,height:`100%`,objectFit:`cover`,display:`block`}}),(0,j.jsx)(`div`,{style:{position:`absolute`,inset:0,background:`linear-gradient(to top, rgba(0,0,0,0.5) 0%, transparent 60%)`}}),(0,j.jsx)(`span`,{style:{position:`absolute`,bottom:10,left:10,fontSize:11,fontWeight:700,color:`#fff`},children:e.label})]},e.label))]}),b&&(0,j.jsxs)(`div`,{style:{background:`#FEF2F2`,borderRadius:16,border:`1px solid #FECACA`,padding:d?`16px`:`24px 28px`,display:`flex`,alignItems:`center`,gap:16,marginBottom:16},children:[(0,j.jsxs)(`div`,{style:{background:`#fff`,borderRadius:12,padding:d?`10px 14px`:`16px 20px`,textAlign:`center`,flexShrink:0,boxShadow:`0 2px 8px rgba(192,57,43,0.12)`},children:[(0,j.jsx)(`div`,{style:{fontSize:10,fontWeight:700,color:`#9CA3AF`,letterSpacing:`0.06em`},children:Qc(b.event_date).weekday.toUpperCase()}),(0,j.jsx)(`div`,{style:{fontSize:d?28:36,fontWeight:900,color:al,lineHeight:1},children:Qc(b.event_date).day}),(0,j.jsx)(`div`,{style:{fontSize:10,fontWeight:700,color:`#9CA3AF`,letterSpacing:`0.06em`},children:[`JAN`,`FEB`,`MAR`,`APR`,`MAY`,`JUN`,`JUL`,`AUG`,`SEP`,`OCT`,`NOV`,`DEC`][Qc(b.event_date).month-1]})]}),(0,j.jsxs)(`div`,{style:{flex:1,minWidth:0},children:[(0,j.jsx)(`p`,{style:{fontSize:10,fontWeight:700,color:al,textTransform:`uppercase`,letterSpacing:`0.08em`,marginBottom:4},children:`Next Up`}),(0,j.jsx)(`h3`,{style:{fontSize:d?15:18,fontWeight:900,color:`#111`,marginBottom:4},children:b.title}),b.location&&(0,j.jsxs)(`p`,{style:{fontSize:12,color:`#6B7280`},children:[`ð `,b.location]})]}),(0,j.jsx)(A,{to:`/events`,style:{fontSize:12,fontWeight:700,color:al,textDecoration:`none`,flexShrink:0},children:`See all â`})]}),C.length>0&&(0,j.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:d?`1fr`:`repeat(3, 1fr)`,gap:14},children:C.map(e=>(0,j.jsx)(tl,{event:e},e.id))})]}),(0,j.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:d?`repeat(2, 1fr)`:`repeat(4, 1fr)`,height:d?160:220,borderRadius:16,overflow:`hidden`},children:ul.map(e=>(0,j.jsxs)(`div`,{style:{position:`relative`,overflow:`hidden`},children:[(0,j.jsx)(`img`,{src:e.url,alt:e.label,style:{width:`100%`,height:`100%`,objectFit:`cover`,display:`block`,transition:`transform 0.4s ease`},onMouseEnter:e=>e.currentTarget.style.transform=`scale(1.05)`,onMouseLeave:e=>e.currentTarget.style.transform=`scale(1)`}),(0,j.jsx)(`div`,{style:{position:`absolute`,inset:0,background:`linear-gradient(to top, rgba(0,0,0,0.55) 0%, transparent 60%)`}}),(0,j.jsx)(`span`,{style:{position:`absolute`,bottom:10,left:12,fontSize:11,fontWeight:700,color:`#fff`,letterSpacing:`0.03em`},children:e.label})]},e.label))}),(0,j.jsxs)(`section`,{children:[(0,j.jsx)(pl,{eyebrow:`Palm Beach County`,title:`Things To Do`,linkTo:`/events`}),(0,j.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:d?`1fr`:`repeat(2, 1fr)`,gap:16},children:ll.map(e=>(0,j.jsxs)(`div`,{style:{background:e.bg,borderRadius:16,padding:`24px 24px 20px`,border:`1px solid ${e.color}22`},children:[(0,j.jsxs)(A,{to:e.link,style:{display:`flex`,alignItems:`center`,gap:10,marginBottom:16,textDecoration:`none`},children:[(0,j.jsx)(`div`,{style:{width:36,height:36,borderRadius:10,background:e.color+`18`,display:`flex`,alignItems:`center`,justifyContent:`center`,fontSize:18},children:e.icon}),(0,j.jsx)(`span`,{style:{fontSize:15,fontWeight:800,color:e.color},children:e.category}),(0,j.jsx)(`span`,{style:{fontSize:11,fontWeight:700,color:e.color,marginLeft:`auto`,opacity:.7},children:`See all â`})]}),(0,j.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:12},children:e.items.map(t=>(0,j.jsxs)(A,{to:t.link,style:{display:`flex`,gap:10,alignItems:`flex-start`,textDecoration:`none`},onMouseEnter:e=>e.currentTarget.style.opacity=`0.75`,onMouseLeave:e=>e.currentTarget.style.opacity=`1`,children:[(0,j.jsx)(`div`,{style:{width:6,height:6,borderRadius:`50%`,background:e.color,flexShrink:0,marginTop:6}}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`div`,{style:{fontSize:13,fontWeight:700,color:`#111`,lineHeight:1.3},children:t.title}),(0,j.jsx)(`div`,{style:{fontSize:12,color:`#6B7280`,marginTop:2},children:t.detail})]})]},t.title))})]},e.category))}),(0,j.jsx)(`p`,{style:{fontSize:12,color:`#9CA3AF`,marginTop:12,textAlign:`right`},children:`Content updated regularly â submit an event or listing to be featured`})]})]})})}),(0,j.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:d?`1fr 1fr`:`2.2fr 1fr 1fr 1fr`,height:d?180:320,overflow:`hidden`,margin:`0`},children:cl.map((e,t)=>(0,j.jsxs)(`div`,{style:{position:`relative`,overflow:`hidden`},children:[(0,j.jsx)(`img`,{src:e.url,alt:e.label,style:{width:`100%`,height:`100%`,objectFit:`cover`,display:`block`,transition:`transform 0.4s ease`},onMouseEnter:e=>e.currentTarget.style.transform=`scale(1.04)`,onMouseLeave:e=>e.currentTarget.style.transform=`scale(1)`}),(0,j.jsx)(`div`,{style:{position:`absolute`,inset:0,background:`linear-gradient(to top, rgba(0,0,0,0.65) 0%, rgba(0,0,0,0.1) 60%, transparent 100%)`}}),t===0&&(0,j.jsxs)(`div`,{style:{position:`absolute`,bottom:20,left
34:24},children:[(0,j.jsx)(`p`,{style:{fontSize:d?10:11,fontWeight:700,color:`#F0C419`,letterSpacing:`0.1em`,textTransform:`uppercase`,marginBottom:6},children:`ð´ Palm Beach County, FL`}),(0,j.jsxs)(`p`,{style:{fontSize:d?16:22,fontWeight:900,color:`#fff`,lineHeight:1.2},children:[`Beautiful.`,(0,j.jsx)(`br`,{}),`Vibrant.`,(0,j.jsx)(`br`,{}),`Community.`]})]}),t>0&&(0,j.jsx)(`span`,{style:{position:`absolute`,bottom:14,left:14,fontSize:d?10:12,fontWeight:700,color:`#fff`,letterSpacing:`0.03em`,textShadow:`0 1px 4px rgba(0,0,0,0.5)`},children:e.label})]},e.label))}),l.length>0&&(0,j.jsx)(`div`,{style:{maxWidth:1280,margin:`0 auto`,padding:d?`0 16px`:`0 32px`},children:(0,j.jsxs)(`div`,{style:{padding:d?`48px 0 64px`:`72px 0 80px`},children:[(0,j.jsx)(pl,{eyebrow:`From the Blog`,title:`Latest News`,linkTo:`/blog`}),x&&(0,j.jsx)(A,{to:`/blog/${x.slug}`,style:{textDecoration:`none`,display:`block`,marginBottom:14},children:(0,j.jsxs)(`div`,{style:{background:`#111`,borderRadius:18,padding:d?`24px 20px`:`36px 44px`},onMouseEnter:e=>e.currentTarget.style.background=`#1a1a1a`,onMouseLeave:e=>e.currentTarget.style.background=`#111`,children:[(0,j.jsx)(`p`,{style:{fontSize:10,fontWeight:700,color:`#F0C419`,textTransform:`uppercase`,letterSpacing:`0.08em`,marginBottom:8},children:x.published_at?new Date(x.published_at).toLocaleDateString(`en-US`,{month:`long`,day:`numeric`,year:`numeric`}):`Latest`}),(0,j.jsx)(`h3`,{style:{fontSize:d?18:26,fontWeight:900,color:`#fff`,lineHeight:1.25,marginBottom:10},children:x.title}),x.excerpt&&(0,j.jsx)(`p`,{style:{fontSize:14,color:`rgba(255,255,255,0.65)`,lineHeight:1.65,maxWidth:640},children:x.excerpt}),(0,j.jsx)(`p`,{style:{fontSize:13,fontWeight:700,color:`#F0C419`,marginTop:16},children:`Read more â`})]})}),w.length>0&&(0,j.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:d?`1fr`:`repeat(3, 1fr)`,gap:16},children:w.map(e=>(0,j.jsxs)(A,{to:`/blog/${e.slug}`,style:{display:`block`,background:`#fff`,borderRadius:14,border:`1px solid #EBEBEB`,padding:24,textDecoration:`none`},onMouseEnter:e=>e.currentTarget.style.boxShadow=`0 4px 20px rgba(0,0,0,0.08)`,onMouseLeave:e=>e.currentTarget.style.boxShadow=`none`,children:[(0,j.jsx)(`div`,{style:{fontSize:11,color:`#9CA3AF`,fontWeight:600,textTransform:`uppercase`,letterSpacing:`0.06em`,marginBottom:8},children:e.published_at?new Date(e.published_at).toLocaleDateString(`en-US`,{month:`short`,day:`numeric`,year:`numeric`}):``}),(0,j.jsx)(`h3`,{style:{fontWeight:800,color:`#111`,fontSize:15,lineHeight:1.4,marginBottom:8},children:e.title}),e.excerpt&&(0,j.jsx)(`p`,{style:{fontSize:13,color:`#6B7280`,lineHeight:1.6},children:e.excerpt}),(0,j.jsx)(`p`,{style:{fontSize:12,fontWeight:700,color:`#C0392B`,marginTop:12},children:`Read â`})]},e.id))})]})}),(0,j.jsxs)(`section`,{style:{background:`#111`,position:`relative`,overflow:`hidden`},children:[(0,j.jsx)(M,{children:(0,j.jsxs)(`div`,{style:{padding:d?`48px 0`:`72px 0`,display:`grid`,gridTemplateColumns:d?`1fr`:`1fr 1px 1fr`,gap:d?40:0},children:[(0,j.jsxs)(`div`,{style:{padding:d?`0`:`0 48px 0 0`},children:[(0,j.jsx)(`p`,{style:{fontSize:11,fontWeight:700,letterSpacing:`0.1em`,textTransform:`uppercase`,color:`#F0C419`,marginBottom:12},children:`For Residents`}),(0,j.jsxs)(`h2`,{style:{fontSize:d?24:32,fontWeight:900,color:`#fff`,lineHeight:1.2,letterSpacing:`-0.5px`,marginBottom:14},children:[`Find Everything`,(0,j.jsx)(`br`,{}),`Palm Beach Has to Offer`]}),(0,j.jsx)(`p`,{style:{fontSize:14,color:`rgba(255,255,255,0.6)`,lineHeight:1.65,marginBottom:28},children:`Browse local businesses, discover upcoming events, and connect with community resources â all in one place. Free for everyone.`}),(0,j.jsxs)(`div`,{style:{display:`flex`,gap:10,flexWrap:`wrap`},children:[(0,j.jsx)(A,{to:`/businesses`,style:{display:`inline-block`,background:`#F0C419`,color:`#111`,fontWeight:800,fontSize:13,padding:`11px 24px`,borderRadius:999,textDecoration:`none`},children:`Browse Businesses â`}),(0,j.jsx)(A,{to:`/events`,style:{display:`inline-block`,background:`transparent`,color:`#fff`,fontWeight:700,fontSize:13,padding:`11px 24px`,borderRadius:999,textDecoration:`none`,border:`1px solid rgba(255,255,255,0.25)`},children:`See Events`})]})]}
34),!d&&(0,j.jsx)(`div`,{style:{background:`rgba(255,255,255,0.1)`,width:1}}),(0,j.jsxs)(`div`,{style:{padding:d?`0`:`0 0 0 48px`},children:[(0,j.jsx)(`p`,{style:{fontSize:11,fontWeight:700,letterSpacing:`0.1em`,textTransform:`uppercase`,color:al,marginBottom:12},children:`For Businesses`}),(0,j.jsxs)(`h2`,{style:{fontSize:d?24:32,fontWeight:900,color:`#fff`,lineHeight:1.2,letterSpacing:`-0.5px`,marginBottom:14},children:[`Grow Your Business`,(0,j.jsx)(`br`,{}),`With Your Community`]}),(0,j.jsx)(`p`,{style:{fontSize:14,color:`rgba(255,255,255,0.6)`,lineHeight:1.65,marginBottom:28},children:`Get discovered by thousands of Palm Beach County residents. Create a free listing today â or upgrade for guaranteed homepage placement, photos, and more.`}),(0,j.jsxs)(`div`,{style:{display:`flex`,gap:10,flexWrap:`wrap`},children:[(0,j.jsx)(A,{to:`/sign-up`,style:{display:`inline-block`,background:al,color:`#fff`,fontWeight:800,fontSize:13,padding:`11px 24px`,borderRadius:999,textDecoration:`none`},children:`List Your Business Free â`}),(0,j.jsx)(A,{to:`/pricing`,style:{display:`inline-block`,background:`transparent`,color:`#fff`,fontWeight:700,fontSize:13,padding:`11px 24px`,borderRadius:999,textDecoration:`none`,border:`1px solid rgba(255,255,255,0.25)`},children:`View Plans`})]})]})]})}),(0,j.jsx)(`div`,{style:{position:`absolute`,right:-40,bottom:-40,opacity:.04,pointerEvents:`none`,fontSize:320,lineHeight:1},children:`ð´`})]}),(0,j.jsx)(`section`,{style:{background:al,padding:d?`40px 0`:`56px 0`},children:(0,j.jsx)(M,{children:(0,j.jsxs)(`div`,{style:{textAlign:`center`,maxWidth:640,margin:`0 auto`},children:[(0,j.jsx)(`div`,{style:{display:`inline-flex`,alignItems:`center`,gap:6,background:`rgba(255,255,255,0.15)`,borderRadius:999,padding:`5px 14px`,marginBottom:16},children:(0,j.jsx)(`span`,{style:{fontSize:12,fontWeight:700,color:`#F0C419`,letterSpacing:`0.06em`,textTransform:`uppercase`},children:`ð Founding Business Beta`})}),(0,j.jsx)(`h2`,{style:{fontSize:d?24:32,fontWeight:900,color:`#fff`,lineHeight:1.2,marginBottom:12},children:`Be One of the First 50 Businesses`}),(0,j.jsx)(`p`,{style:{fontSize:14,color:`rgba(255,255,255,0.8)`,lineHeight:1.7,marginBottom:24},children:`Apply for the beta and get a 60-day Elite trial, a permanent Founding Business badge, guaranteed homepage placement, and priority access to new features â before the program opens to everyone.`}),(0,j.jsx)(A,{to:`/beta`,style:{display:`inline-block`,background:`#F0C419`,color:`#111`,fontWeight:800,fontSize:14,padding:`13px 32px`,borderRadius:999,textDecoration:`none`},children:`Apply for the Beta â`})]})})})]})}function pl({eyebrow:e,title:t,linkTo:n}){return(0,j.jsxs)(`div`,{style:{display:`flex`,alignItems:`flex-end`,justifyContent:`space-between`,marginBottom:20},children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`p`,{style:{fontSize:11,fontWeight:700,letterSpacing:`0.1em`,textTransform:`uppercase`,color:al,marginBottom:4},children:e}),(0,j.jsx)(`h2`,{style:{fontSize:26,fontWeight:900,color:`#111`,letterSpacing:`-0.4px`},children:t})]}),(0,j.jsx)(A,{to:n,style:{fontSize:13,fontWeight:600,color:al,textDecoration:`none`},children:`View All â`})]})}function B({zone:e}){let[t,n]=(0,_.useState)(null);if((0,_.useEffect)(()=>{async function t(){let t=new Date().toISOString().split(`T`)[0],{data:r}=await z.from(`ads`).select(`*`).eq(`zone`,e).eq(`active`,!0).lte(`start_date`,t).gte(`end_date`,t).limit(1).maybeSingle();n(r)}t()},[e]),!t)return null;async function r(){await z.rpc(`increment_ad_clicks`,{ad_id:t.id}),window.open(t.link_url,`_blank`,`noopener,noreferrer`)}return(0,j.jsxs)(`div`,{onClick:r,style:{overflow:`hidden`,borderRadius:8,cursor:`pointer`},children:[t.image_url&&(0,j.jsx)(`img`,{src:t.image_url,alt:t.advertiser_name,style:{width:`100%`,objectFit:`cover`,display:`block`}}),t.advertiser_name&&(0,j.jsxs)(`p`,{style:{fontSize:11,textAlign:`center`,color:`#9CA3AF`,marginTop:4},children:[`Sponsored · `,t.advertiser_name]})]})}var ml=[{id:`1`,slug:`havana-nights`,name:`Havana Nights`,category:`Restaurants`,city:`West Palm Beach`,description:`Authentic Cuban cuisine and live music in a vibrant atmosphere.`,avg_rating:4.8,review_count:127,tier:`pro`,logo_initial:`H`,logo_bg_color:`#C0392B`},{id:`2`,slug:`pb-realty-group`,name:`PB Realty Group`,category:`Real Estate`,city:`Palm Beach Gardens`,description:`Luxury real estate specialists serving all of Palm Beach County since 2001.`,avg_rating:4.9,review_count:84,tier:`elite`,logo_initial:`P`,logo_bg_color:`#3B82F6`},{id:`3`,slug:`sunbright-solar`,name:`SunBright Solar`,category:`Services`,city:`Boca Raton`,description:`Solar panel installation and renewable energy solutions for Florida homes.`,avg_rating:4.7,review_count:56,tier:`basic`,logo_initial:`S`,logo_bg_color:`#F59E0B`},{id:`4`,slug:`palm-health-center`,name:`Palm Health Center`,category:`Health`,city:`West Palm Beach`,description:`Holistic health and wellness services for the whole family.`,avg_rating:4.6,review_count:39,tier:`free`,logo_initial:`P`,logo_bg_color:`#10B981`},{id:`5`,slug:`coastal-finance`,name:`Coastal Finance Group`,category:`Finance`,city:`Boca Raton`,description:`Local financial planning and wealth management for Palm Beach County residents.`,avg_rating:4.5,review_count:22,tier:`basic`,logo_initial:`C`,logo_bg_color:`#6366F1`},{id:`6`,slug:`pb-boutique`,name:`Palm Beach Boutique`,category:`Shopping`,city:`Palm Beach`,description:`Curated fashion and lifestyle goods from local and independent designers.`,avg_rating:4.8,review_count:61,tier:`pro`,logo_initial:`P`,logo_bg_color:`#EC4899`}];function hl(){let[e,t]=Jn(),[n,r]=(0,_.useState)(null),[i,a]=(0,_.useState)([]),[o,s]=(0,_.useState)(!1),[c,l]=(0,_.useState)(e.get(`q`)||``),u=cr()<768,d=e.get(`q`)||``,f=e.get(`category`)||``;(0,_.useEffect)(()=>{m()},[d,f]),(0,_.useEffect)(()=>{p()},[]);async function p(){if(`https://fzyvowthczazgirfursb.supabase.co`.includes(`placeholder`))return;let{data:e}=await z.from(`businesses`).select(`*`).eq(`active`,!0).eq(`featured_spotlight_active`,!0).limit(6);e?.length&&a(e)}async function m(){if(!`https://fzyvowthczazgirfursb.supabase.co`.includes(`placeholder`)){s(!0);try{let e=z.from(`businesses`).select(`*`).eq(`active`,!0);d&&(e=e.or(`name.ilike.%${d}%,category.ilike.%${d}%,description.ilike.%${d}%`)),f&&(e=e.eq(`category`,f));let{data:t}=await e.limit(50),n={elite:0,pro:1,basic:2,free:3};r((t||[]).slice().sort((e,t)=>
34{let r=(n[e.tier]??3)-(n[t.tier]??3);return r===0?(t.avg_rating??0)-(e.avg_rating??0):r}))}catch{}s(!1)}}let h=n??ml.filter(e=>!(d&&!e.name.toLowerCase().includes(d.toLowerCase())||f&&e.category!==f)),g=h.slice(0,Math.ceil(h.length/2)),v=h.slice(Math.ceil(h.length/2)),y=i.length>0&&!d&&!f;function b(n){let r=new URLSearchParams(e);n?r.set(`category`,n):r.delete(`category`),r.delete(`q`),l(``),t(r)}function x(n){n.preventDefault();let r=new URLSearchParams(e);c.trim()?r.set(`q`,c.trim()):r.delete(`q`),t(r)}function S(){let n=new URLSearchParams(e);n.delete(`q`),l(``),t(n)}return(0,j.jsxs)(`div`,{style:{background:`#FAFAFA`,minHeight:`100vh`},children:[(0,j.jsxs)(`div`,{style:{position:`relative`,overflow:`hidden`,background:`#C0392B`},children:[(0,j.jsx)(`div`,{style:{position:`absolute`,inset:0,display:`grid`,gridTemplateColumns:u?`repeat(3, 1fr)`:`repeat(6, 1fr)`,gridTemplateRows:`1fr`,gap:0,pointerEvents:`none`},children:[`https://images.unsplash.com/photo-1531058240690-006c446962d8?w=500&q=80`,`https://images.unsplash.com/photo-1555396273-367ea4eb4db5?w=500&q=80`,`https://images.unsplash.com/photo-1511578314322-379afb476865?w=500&q=80`,`https://images.unsplash.com/photo-1491438590914-bc09fcaaf77a?w=500&q=80`,`https://images.unsplash.com/photo-1414235077428-338989a2e8c0?w=500&q=80`,`https://images.unsplash.com/photo-1758921006011-ce8365eb57a6?w=500&q=80`].map((e,t)=>(0,j.jsx)(`img`,{src:e,alt:``,style:{width:`100%`,height:`100%`,objectFit:`cover`,display:`block`}},t))}),(0,j.jsx)(`div`,{style:{position:`absolute`,inset:0,background:`linear-gradient(135deg, rgba(192,57,43,0.82) 0%, rgba(150,40,27,0.78) 100%)`,pointerEvents:`none`}}),(0,j.jsx)(M,{style:{position:`relative`,zIndex:1},children:(0,j.jsxs)(`div`,{style:{padding:`40px 0 32px`},children:[(0,j.jsx)(`h1`,{style:{fontSize:u?28:36,fontWeight:900,color:`#fff`,letterSpacing:`-0.5px`,marginBottom:8},children:`Palm Beach Businesses`}),(0,j.jsxs)(`p`,{style:{color:`rgba(255,255,255,0.75)`,fontSize:15},children:[`Discover `,ml.length,`+ local businesses across Palm Beach County`]}),(0,j.jsxs)(`form`,{onSubmit:x,style:{display:`flex`,maxWidth:480,marginTop:20,borderRadius:999,overflow:`hidden`,boxShadow:`0 2px 12px rgba(0,0,0,0.15)`},children:[(0,j.jsx)(`input`,{type:`text`,value:c,onChange:e=>l(e.target.value),placeholder:`Search businesses by name...`,style:{flex:1,padding:`11px 18px`,fontSize:14,background:`#fff`,border:`none`,outline:`none`,color:`#111`}}),(0,j.jsx)(`button`,{type:`submit`,style:{padding:`11px 22px`,background:`#96281B`,color:`#fff`,border:`none`,fontWeight:700,fontSize:14,cursor:`pointer`},children:`Search`})]})]})})]}),(0,j.jsx)(`div`,{style:{background:`#fff`,borderBottom:`1px solid #EBEBEB`},children:(0,j.jsx)(M,{children:(0,j.jsx)(`div`,{style:{padding:`14px 0`},children:(0,j.jsx)(B,{zone:`businesses-top`})})})}),(0,j.jsx)(M,{children:(0,j.jsxs)(`div`,{style:{padding:`28px 0 64px`},children:[y&&(0,j.jsxs)(`div`,{style:{marginBottom:36},children:[(0,j.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10,marginBottom:16},children:[(0,j.jsx)(`span`,{style:{background:`#F0C419`,color:`#111`,fontSize:11,fontWeight:800,padding:`3px 12px`,borderRadius:999,textTransform:`uppercase`,letterSpacing:`0.05em`},children:`â Featured`}),(0,j.jsx)(`span`,{style:{fontSize:15,fontWeight:700,color:`#111`},children:`Spotlight Businesses`})]}),(0,j.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:u?`1fr`:`repeat(3, 1fr)`,gap:16},children:i.slice(0,3).map(e=>(0,j.jsx)(Kc,{business:e},e.id))}),(0,j.jsx)(`div`,{style:{height:1,background:`#EBEBEB`,margin:`32px 0 0`}})]}),(0,j.jsxs)(`div`,{style:{display:`flex`,flexWrap:`wrap`,gap:8,marginBottom:28},children:[(0,j.jsx)(gl,{label:`All`,active:!f,onClick:()=>b(``)}),Uc.slice(0,-1).map(e=>(0,j.jsx)(gl,{label:e,active:f===e,onClick:()=>b(e)},e))]}),(d||f)&&(0,j.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12,marginBottom:20,fontSize:13,color:`#6B7280`},children:[(0,j.jsxs)(`span`,{children:[h.length,` result`,h.length===1?``:`s`,d&&(0,j.jsxs)(j.Fragment,{children:[` for `,(0,j.jsxs)(`strong`,{style:{color:`#111`},children:[`"`,d,`"`]})]}),f&&(0,j.jsxs)(j.Fragment,{children:[` in `,(0,j.jsx)(`strong`,{style:{color:`#111`},children:f})]})]}),(0,j.jsx)(`button`,{onClick:()=>{b(``),S()},style:{fontSize:12,color:`#C0392B`,background:`none`,border:`none`,cursor:`pointer`,fontWeight:600,padding:0},children:`Clear filters`})]}),o?(0,j.jsx)(`div`,{style:{textAlign:`center`,padding:`80px 0`,color:`#9CA3AF`},children:`Loading...`}):h.length===0?(0,j.jsxs)(`div`,{style:{textAlign:`center`,padding:`80px 0`},children:[(0,j.jsx)(`p`,{style:{fontSize:16,color:`#6B7280`,marginBottom:8},children:`No businesses found.`}),(0,j.jsx)(`button`,{onClick:()=>{b(``),S()},style:{fontSize:13,color:`#C0392B`,background:`none`,border:`none`,cursor:`pointer`,fontWeight:600},children:`Clear filters`})]}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:u?`1fr`:`repeat(3, 1fr)`,gap:16,marginBottom:32},children:g.map(e=>(0,j.jsx)(Kc,{business:e},e.id))}),h.length>6&&(0,j.jsx)(`div`,{style:{marginBottom:32},children:(0,j.jsx)(B,{zone:`businesses-middle`})}),y&&i.length>3&&h.length>6&&(0,j.jsxs)(`div`,{style:{background:`#fff`,borderRadius:16,border:`2px solid #F0C419`,padding:`20px 24px`,marginBottom:32},children:[(0,j.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginBottom:16},children:(0,j.jsx)(`span`,{style:{background:`#F0C419`,color:`#111`,fontSize:11,fontWeight:800,padding:`3px 12px`,borderRadius:999,textTransform:`uppercase`},children:`â Spotlight`})}),(0,j.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:u?`1fr`:`repeat(3, 1fr)`,gap:16},children:i.slice(3,6).map(e=>(0,j.jsx)(Kc,{business:e},e.id))})]}),v.length>0&&(0,j.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:u?`1fr`:`repeat(3, 1fr)`,gap:16},children:v.map(e=>(0,j.jsx)(Kc,{business:e},e.id))})]}),(0,j.jsx)(`div`,{style:{marginTop:40},children:(0,j.jsx)(B,{zone:`businesses-bottom`})}),(0,j.jsxs)(`div`,{style:{marginTop:32,background:`#fff`,borderRadius:20,border:`1px solid #F0F0F0`,padding:u?`28px 20px`:`40px 48px`,display:`flex`,flexDirection:u?`column`:`row`,alignItems:u?`flex-start`:`center`,justifyContent:`space-between`,gap:20},children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`h3`,{style:{fontWeight:800,fontSize:20,color:`#111`,marginBottom:6},children:`Is your business listed?`}),(0,j.jsx)(`p`,{style:{fontSize:14,color:`#6B7280`,lineHeight:1.6},children:`Get discovered by thousands of Palm Beach County residents. Free listings available â paid tiers for more visibility.`})]}),(0,j.jsx)(A,{to:`/pricing`,style:{background:`#C0392B`,color:`#fff`,fontWeight:700,fontSize:14,padding:`12px 28px`,borderRadius:999,textDecoration:`none`,flexShrink:0,whiteSpace:`nowrap`},children:`View Listing Plans â`})]}),(0,j.jsxs)(`div`,{style:{marginTop:16,background:`#111`,borderRadius:20,padding:u?`28px 20px`:`40px 48px`,display:`flex`,flexDirection:u?`column`:`row`,alignItems:u?`flex-start`:`center`,justifyContent:`space-between`,gap:20},children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`h3`,{style:{fontWeight:800,fontSize:20,color:`#fff`,marginBottom:6},children:`Want to reach these residents directly?`}),(0,j.jsx)(`p`,{style:{fontSize:14,color:`rgba(255,255,255,0.7)`,lineHeight:1.6},children:`Put your brand in front of people actively browsing Palm Beach County businesses with a banner, sidebar, or featured spotlight placement.`})]}),(0,j.jsx)(A,{to:`/advertise`,style:{background:`#F0C419`,color:`#111`,fontWeight:700,fontSize:14,padding:`12px 28px`,borderRadius:999,textDecoration:`none`,flexShrink:0,whiteSpace:`nowrap`},children:`See Ad Options â`})]})]})})]})}function gl({label:e,active:t,onClick:n}){return(0,j.jsx)(`button`,{onClick:n,style:{padding:`7px 18px`,borderRadius:999,fontSize:13,fontWeight:500,cursor:`pointer`,border:t?`none`:`1px solid #E5E7EB`,background:t?`#C0392B`:`#fff`,color:t?`#fff`:`#374151`},children:e})}function _l({business:e}){let[t,n]=(0,_.useState)(null),[r,i]=(0,_.useState)([]),[a,o]=(0,_.useState)(null),[s,c]=(0,_.useState)(0),[l,u]=(0,_.useState)(0),[d,f]=(0,_.useState)(``),[p,m]=(0,_.useState)(!1),[h,g]=(0,_.useState)([]);(0,_.useEffect)(()=>{z.auth.getSession().then(({data:e})=>n(e.session?.user??null))},[]),(0,_.useEffect)(()=>{v()},[e.id]);async function v(){let{data:n}=await z.from(`reviews`).select(`*`).eq(`business_id`,e.id).order(`created_at`,{ascending:!1});i(n||[]),t&&o((n||[]).find(e=>e.reviewer_user_id===t.id)||null)}async function y(n){if(n.preventDefault(),!s)return;m(!0);let{error:r}=await z.from(`reviews`).insert({business_id:e.id,reviewer_user_id:t.id,reviewer_name:t.user_metadata?.full_name||t.email?.split(`@`)[0]||`Resident`,rating:s,text:d.trim()||null});r?alert(`Could not submit review: `+r.message):(c(0),f(``),v()),m(!1)}
34async function b(n){h.includes(n.id)||(await z.from(`contact_submissions`).insert({name:t?.email||`Anonymous`,email:t?.email||``,topic:`Review Report`,message:`Reported review on "${e.name}" (business_id: ${e.id}, review_id: ${n.id}) by "${n.reviewer_name}": "${n.text||`(no text, rating only)`}"`,read:!1}),g(e=>[...e,n.id]))}return(0,j.jsxs)(`div`,{style:{background:`#fff`,borderRadius:20,border:`1px solid #EBEBEB`,padding:28},children:[(0,j.jsxs)(`h2`,{style:{fontSize:16,fontWeight:800,color:`#111`,marginBottom:16},children:[`Reviews `,r.length>0&&`(${r.length})`]}),t?a?(0,j.jsx)(`div`,{style:{background:`#F9FAFB`,borderRadius:12,padding:16,marginBottom:20,fontSize:13,color:`#6B7280`},children:`You already reviewed this business â thanks for your feedback!`}):(0,j.jsxs)(`form`,{onSubmit:y,style:{background:`#F9FAFB`,borderRadius:12,padding:18,marginBottom:20},children:[(0,j.jsx)(`p`,{style:{fontSize:12,fontWeight:700,color:`#374151`,marginBottom:8,textTransform:`uppercase`,letterSpacing:`0.04em`},children:`Write a Review`}),(0,j.jsx)(`div`,{style:{display:`flex`,gap:4,marginBottom:12},children:[1,2,3,4,5].map(e=>(0,j.jsx)(`button`,{type:`button`,onClick:()=>c(e),onMouseEnter:()=>u(e),onMouseLeave:()=>u(0),style:{background:`none`,border:`none`,cursor:`pointer`,fontSize:24,padding:0,color:(l||s)>=e?`#F59E0B`:`#E5E7EB`},children:`â
`},e))}),(0,j.jsx)(`textarea`,{value:d,onChange:e=>f(e.target.value),placeholder:`Share your experience (optional)...`,rows:3,style:{width:`100%`,boxSizing:`border-box`,padding:`10px 12px`,borderRadius:8,border:`1px solid #E5E7EB`,fontSize:13,color:`#111`,outline:`none`,resize:`vertical`,marginBottom:12,fontFamily:`inherit`}}),(0,j.jsx)(`button`,{type:`submit`,disabled:!s||p,style:{background:`#C0392B`,color:`#fff`,fontWeight:700,fontSize:13,padding:`9px 22px`,borderRadius:999,border:`none`,cursor:!s||p?`not-allowed`:`pointer`,opacity:!s||p?.6:1},children:p?`Submitting...`:`Submit Review`})]}):(0,j.jsxs)(`div`,{style:{background:`#F9FAFB`,borderRadius:12,padding:16,marginBottom:20,fontSize:13,color:`#6B7280`},children:[(0,j.jsx)(`a`,{href:`/sign-in`,style:{color:`#C0392B`,fontWeight:700,textDecoration:`none`},children:`Sign in`}),` to leave a review.`]}),r.length===0?(0,j.jsx)(`p`,{style:{fontSize:13,color:`#9CA3AF`},children:`No reviews yet â be the first!`}):(0,j.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:16},children:r.map(e=>(0,j.jsxs)(`div`,{style:{paddingBottom:16,borderBottom:`1px solid #F5F5F5`},children:[(0,j.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`flex-start`,marginBottom:4},children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`span`,{style:{fontSize:13,fontWeight:700,color:`#111`},children:e.reviewer_name}),(0,j.jsxs)(`span`,{style:{color:`#F59E0B`,fontSize:12,marginLeft:8},children:[`â
`.repeat(e.rating),`â`.repeat(5-e.rating)]})]}),(0,j.jsx)(`span`,{style:{fontSize:11,color:`#9CA3AF`},children:new Date(e.created_at).toLocaleDateString(`en-US`,{month:`short`,day:`numeric`,year:`numeric`})})]}),e.text&&(0,j.jsx)(`p`,{style:{fontSize:13,color:`#6B7280`,lineHeight:1.6,marginBottom:4},children:e.text}),(0,j.jsx)(`button`,{onClick:()=>b(e),disabled:h.includes(e.id),style:{background:`none`,border:`none`,fontSize:11,color:h.includes(e.id)?`#9CA3AF`:`#C0392B`,cursor:h.includes(e.id)?`default`:`pointer`,padding:0,textDecoration:h.includes(e.id)?`none`:`underline`},children:h.includes(e.id)?`Reported`:`Report`})]},e.id))})]})}function vl({business:e,onClose:t}){let[n,r]=(0,_.useState)({name:``,email:``,message:``}),[i,a]=(0,_.useState)(!1),[o,s]=(0,_.useState)(!1);function c(e,t){r(n=>({...n,[e]:t}))}async function l(t){t.preventDefault(),s(!0),await z.from(`business_inquiries`).insert({business_id:e.id,business_name:e.name,sender_name:n.name,sender_email:n.email,message:n.message}),a(!0),s(!1)}return(0,j.jsx)(`div`,{style:{position:`fixed`,inset:0,background:`rgba(0,0,0,0.5)`,display:`flex`,alignItems:`center`,justifyContent:`center`,zIndex:100,padding:24},onClick:e=>e.target===e.currentTarget&&t(),children:(0,j.jsx)(`div`,{style:{background:`#fff`,borderRadius:20,width:`100%`,maxWidth:460,padding:32,boxShadow:`0 20px 60px rgba(0,0,0,0.2)`},children:i?(0,j.jsxs)(`div`,{style:{textAlign:`center`,padding:`20px 0`},children:[(0,j.jsx)(`div`,{style:{fontSize:48,marginBottom:12},children:`â
`}),(0,j.jsx)(`h2`,{style:{fontSize:20,fontWeight:900,color:`#111`,marginBottom:8},children:`Inquiry Sent!`}),(0,j.jsxs)(`p`,{style:{fontSize:14,color:`#6B7280`,lineHeight:1.7,marginBottom:20},children:[`Your message has been sent to `,(0,j.jsx)(`strong`,{children:e.name}),`. They'll be in touch soon.`]}),(0,j.jsx)(`button`,{onClick:t,style:{background:`#C0392B`,color:`#fff`,fontWeight:700,fontSize:14,padding:`10px 28px`,borderRadius:999,border:`none`,cursor:`pointer`},children:`Close`})]}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:20},children:[(0,j.jsxs)(`h2`,{style:{fontSize:18,fontWeight:900,color:`#111`},children:[`Contact `,e.name]}),(0,j.jsx)(`button`,{onClick:t,style:{background:`none`,border:`none`,fontSize:22,color:`#9CA3AF`,cursor:`pointer`},children:`Ã`})]}),(0,j.jsxs)(`form`,{onSubmit:l,style:{display:`flex`,flexDirection:`column`,gap:14},children:[(0,j.jsx)(bl,{label:`Your Name`,value:n.name,onChange:e=>c(`name`,e),required:!0}),(0,j.jsx)(bl,{label:`Your Email`,type:`email`,value:n.email,onChange:e=>c(`email`,e),required:!0}),(0,j.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:4},children:[(0,j.jsx)(`label`,{style:yl,children:`Message`}),(0,j.jsx)(`textarea`,{value:n.message,onChange:e=>c(`message`,e.target.value),required:!0,rows:4,placeholder:`Hi ${e.name}, I'm interested in your services...`,style:{padding:`10px 12px`,borderRadius:10,border:`1px solid #E5E7EB`,fontSize:14,color:`#111`,outline:`none`,resize:`vertical`,fontFamily:`inherit`},onFocus:e=>e.target.style.borderColor=`#C0392B`,onBlur:e=>e.target.style.borderColor=`#E5E7EB`})]}),(0,j.jsx)(`button`,{type:`submit`,disabled:o,style:{padding:13,background:`#C0392B`,color:`#fff`,fontWeight:700,fontSize:15,borderRadius:999,border:`none`,cursor:`pointer`,o
34pacity:o?.7:1},children:o?`Sending...`:`Send Inquiry â`}),(0,j.jsx)(`p`,{style:{fontSize:11,color:`#9CA3AF`,textAlign:`center`},children:`Your message will be forwarded to the business owner.`})]})]})})})}var yl={fontSize:12,fontWeight:700,color:`#374151`,textTransform:`uppercase`,letterSpacing:`0.04em`};function bl({label:e,type:t=`text`,value:n,onChange:r,required:i}){return(0,j.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:4},children:[(0,j.jsx)(`label`,{style:yl,children:e}),(0,j.jsx)(`input`,{type:t,value:n,onChange:e=>r(e.target.value),required:i,style:{padding:`10px 12px`,borderRadius:10,border:`1px solid #E5E7EB`,fontSize:14,color:`#111`,outline:`none`},onFocus:e=>e.target.style.borderColor=`#C0392B`,onBlur:e=>e.target.style.borderColor=`#E5E7EB`})]})}var xl={free:`#6B7280`,basic:`#3B82F6`,pro:`#C0392B`,elite:`#F59E0B`},Sl=[{id:`1`,slug:`havana-nights`,name:`Havana Nights`,category:`Restaurant`,city:`West Palm Beach`,description:`Authentic Cuban cuisine and live music in a vibrant atmosphere. Serving West Palm Beach since 2012 with traditional recipes, fresh ingredients, and weekend entertainment.`,avg_rating:4.8,review_count:127,tier:`pro`,badge:`Top Rated`,logo_initial:`H`,logo_bg_color:`#C0392B`,phone:`(561) 555-0101`,email:`[email protected]`,address:`123 Clematis St, West Palm Beach, FL 33401`},{id:`2`,slug:`pb-realty-group`,name:`PB Realty Group`,category:`Real Estate`,city:`Palm Beach Gardens`,description:`Luxury real estate specialists serving all of Palm Beach County since 2001. Residential, commercial, and investment properties.`,avg_rating:4.9,review_count:84,tier:`elite`,badge:`Verified`,logo_initial:`P`,logo_bg_color:`#3B82F6`,phone:`(561) 555-0202`,email:`[email protected]`,address:`456 PGA Blvd, Palm Beach Gardens, FL 33410`},{id:`3`,slug:`sunbright-solar`,name:`SunBright Solar`,category:`Services`,city:`Boca Raton`,description:`Solar panel installation and renewable energy solutions for Florida homes and businesses. Licensed, insured, and Florida-certified.`,avg_rating:4.7,review_count:56,tier:`basic`,logo_initial:`S`,logo_bg_color:`#F59E0B`,phone:`(561) 555-0303`,email:`[email protected]`,address:`789 Glades Rd, Boca Raton, FL 33431`}];function Cl(){let{slug:e}=Ct(),[t,n]=(0,_.useState)(null),[r,i]=(0,_.useState)(!0),[a,o]=(0,_.useState)(!1);(0,_.useEffect)(()=>{async function t(){let{data:t}=await z.from(`businesses`).select(`*`).eq(`slug`,e).maybeSingle();t||=(await z.from(`businesses`).select(`*`).eq(`id`,e).maybeSingle()).data,t||=Sl.find(t=>t.slug===e||t.id===e)||null,t&&(n(t),await z.rpc(`increment_business_views`,{business_id:t.id})),i(!1)}t()},[e]);async function s(e){t&&await z.rpc(`increment_business_clicks`,{business_id:t.id,click_type:e})}if(r)return(0,j.jsx)(`div`,{style:{textAlign:`center`,padding:`80px 0`,color:`#9CA3AF`,fontSize:15},children:`Loading...`});if(!t)return(0,j.jsxs)(`div`,{style:{textAlign:`center`,padding:`80px 0`},children:[(0,j.jsx)(`p`,{style:{color:`#9CA3AF`,marginBottom:16},children:`Business not found.`}),(0,j.jsx)(A,{to:`/businesses`,style:{color:`#C0392B`,fontWeight:700,textDecoration:`none`,fontSize:14},children:`â Back to Directory`})]});let{name:c,category:l,city:u,address:d,phone:f,email:p,website_url:m,description:h,avg_rating:g,review_count:v,tier:y,badge:b,logo_initial:x,logo_bg_color:S,logo_url:C,facebook_url:w,instagram_url:ee,youtube_url:te,photos:ne,products_promotions:re}=t,T=[w&&{label:`Facebook`,url:w},ee&&{label:`Instagram`,url:ee},te&&{label:`YouTube`,url:te}].filter(Boolean),ie=xl[y]||`#6B7280`,ae=[`basic`,`pro`,`elite`].includes(y),oe=[`basic`,`pro`,`elite`].includes(y),se=[`basic`,`pro`,`elite`].includes(y),ce=[`pro`,`elite`].includes(y),le=m?m.startsWith(`http`)?m:`https://${m}`:null;return(0,j.jsxs)(`div`,{style:{background:`#F9F9F9`,minHeight:`100vh`,padding:`40px 0`},children:[a&&(0,j.jsx)(vl,{business:t,onClose:()=>o(!1)}),(0,j.jsxs)(M,{children:[(0,j.jsx)(A,{to:`/businesses`,style:{color:`#C0392B`,fontWeight:700,textDecoration:`none`,fontSize:13,display:`inline-block`,marginBottom:20},children:`â Back to Directory`}),(0,j.jsxs)(`div`,{style:{display:`flex`,gap:28,alignItems:`flex-start`,flexWrap:`wrap`},children:[(0,j.jsxs)(`div`,{style:{flex:1,minWidth:280,display:`flex`,flexDirection:`column`,gap:20},children:[(0,j.jsxs)(`div`,{style:{background:`#fff`,borderRadius:20,border:`1px solid #EBEBEB`,padding:28},children:[(0,j.jsx)(`div`,{style:{height:4,borderRadius:4,background:ie,width:48,marginBottom:20}}),(0,j.jsxs)(`div`,{style:{display:`flex`,gap:16,alignItems:`flex-start`},children:[C?(0,j.jsx)(`img`,{src:C,alt:c,style:{width:64,height:64,borderRadius:14,objectFit:`cover`,flexShrink:0}}):(0,j.jsx)(`div`,{style:{width:64,height:64,borderRadius:14,background:S||`#C0392B`,color:`#fff`,fontSize:26,fontWeight:900,display:`flex`,alignItems:`center`,justifyContent:`center`,flexShrink:0},children:x||c?.[0]}),(0,j.jsxs)(`div`,{style:{flex:1,minWidth:0},children:[(0,j.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,flexWrap:`wrap`,marginBottom:4},children:[(0,j.jsx)(`h1`,{style:{fontSize:24,fontWeight:900,color:`#111`},children:c}),b&&y===`pro`&&(0,j.jsx)(`span`,{style:{fontSize:11,fontWeight:800,padding:`3px 12px`,borderRadius:999,background:`#EFF6FF`,color:`#1D4ED8`,border:`1px solid #BFDBFE`},children:b}),b&&y===`elite`&&(0,j.jsxs)(`span`,{style:{fontSize:11,fontWeight:800,padding:`3px 12px`,borderRadius:999,background:`#FEF9C3`,color:`#92400E`,border:`1px solid #FDE68A`},children:[`â `,b]}),(y===`pro`||y===`elite`)&&(0,j.jsx)(`span`,{style:{fontSize:11,fontWeight:700,padding:`3px 10px`,borderRadius:999,background:ie+`20`,color:ie,textTransform:`capitalize`},children:y})]}),(0,j.jsxs)(`div`,{style:{display:`flex`,gap:8,fontSize:13,color:`#6B7280`,flexWrap:`wrap`},children:[l&&(0,j.jsx)(`span`,{style:{fontWeight:600},children:l}),u&&(0,j.jsxs)(`span`,{children:[`· `,u]})]}),g!=null&&(0,j.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6,marginTop:8},children:[(0,j.jsx)(`span`,{style:{color:`#F59E0B`,fontSize:14},children:`â
â
â
â
â
`}),(0,j.jsx)(`span`,{style:{fontSize:14,fontWeight:700,color:`#111`},children:g}),v!=null&&(0,j.jsxs)(`span`,{style:{fontSize:13,color:`#9CA3AF`},children:[`(`,v,` reviews)`]})]})]})]}),h&&(0,j.jsx)(`p`,{style:{fontSize:14,color:`#6B7280`,lineHeight:1.7,marginTop:20},children:h}),(0,j.jsxs)(`div`,{style:{display:`flex`,gap:10,marginTop:20,flexWrap:`wrap`},children:[ae&&le&&(0,j.jsx)(`a`,{href:le,target:`_blank`,rel:`noopener noreferrer`,onClick:()=>s(`website`),style:{background:`#C0392B`,color:`#fff`,fontWeight:700,fontSize:13,padding:`10px 20px`,borderRadius:999,textDecoration:`none`},children:`Visit Website â`}),(0,j.jsx)(`button`,{onClick:()=>o(!0),style:{background:`#111`,color:`#fff`,fontWeight:700,fontSize:13,padding:`10px 20px`,borderRadius:999,border:`none`,cursor:`pointer`},children:`âï¸ Send Inquiry`}),f&&(0,j.jsxs)(`a`,{href:`tel:${f}`,onClick:()=>s(`phone`),style:{border:`1px solid #E5E7EB`,color:`#374151`,fontWeight:600,fontSize:13,padding:`10px 20px`,borderRadius:999,textDecoration:`none`,background:`#fff`},children:[`ð `,f]})]}),d&&(0,j.jsxs)(`p`,{style:{fontSize:13,color:`#9CA3AF`,marginTop:14},children:[`ð `,d]}),oe&&T.length>0&&(0,j.jsx)(`div`,{style:{display:`flex`,gap:8,marginTop:16,flexWrap:`wrap`},children:T.map(({label:e,url:t})=>(0,j.jsx)(`a`,{href:t,target:`_blank`,rel:`noopener noreferrer`,onClick:()=>s(`social_${e.toLowerCase()}`),style:{fontSize:12,fontWeight:600,padding:`5px 14px`,borderRadius:999,background:`#F3F4F6`,color:`#374151`,textDecoration:`none`},children:e},e))})]}),se&&ne?.length>0&&(0,j.jsxs)(`div`,{style:{background:`#fff`,borderRadius:20,border:`1px solid #EBEBEB`,padding:28},children:[(0,j.jsx)(`h2`,{style:{fontSize:16,fontWeight:800,color:`#111`,marginBottom:16},children:`Photos`}),(0,j.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(auto-fill, minmax(140px, 1fr))`,gap:10},children:ne.map((e,t)=>(0,j.jsx)(`img`,{src:e,alt:`${c} ${t+1}`,style:{width:`100%`,aspectRatio:`1`,objectFit:`cover`,borderRadius:10}},t))})]}),ce&&re?.length>0&&(0,j.jsxs)(`div`,{style:{background:`#fff`,borderRadius:20,border:`1px solid #EBEBEB`,padding:28},children:[(0,j.jsx)(`h2`,{style:{fontSize:16,fontWeight:800,color:`#111`,marginBottom:16},children:`Products & Promotions`}),(0,j.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:16},children:re.map((e,t)=>(0,j.jsxs)(`div`,{style:{display:`flex`,gap:14,alignItems:`flex-start`,paddingBottom:16,borderBottom:t<re.length-1?`1px solid #F5F5F5`:`none`},children:[e.image&&(0,j.jsx)(`img`,{src:e.image,alt:e.name,style:{width:64,height:64,objectFit:`cover`,borderRadius:10,flexShrink:0}}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`div`,{style:{fontSize:14,fontWeight:700,color:`#111`},children:e.name}),e.description&&(0,j.jsx)(`p`,{style:{fontSize:13,color:`#6B7280`,marginTop:2},children:e.description}),e.price&&(0,j.jsx)(`div`,{style:{fontSize:14,fontWeight:800,color:`#C0392B`,marginTop:4},children:e.price})]})]},t))})]}),(0,j.jsx)(_l,{business:t})]}),(0,j.jsx)(`div`,{style:{width:260,flexShrink:0},children:(0,j.jsx)(B,{zone:`business-profile-sidebar`})})]})]})]})}function wl(){let[e,t]=(0,_.useState)([]);(0,_.useEffect)(()=>{async function e(){let{data:e}=await z.from(`events`).select(`*`).eq(`featured`,!0).order(`event_date`,{ascending:!0}).limit(3);t(e||[])}e()},[]);let n={Community:`https://images.unsplash.com/photo-1552664730-d307ca884978?w=600&q=80`,Business:`https://images.unsplash.com/photo-1552664730-d307ca884978?w=600&q=80`,Arts:`https://images.unsplash.com/photo-1460661419201-fd4cecdf8a8b?w=600&q=80`,Celebration:`https://images.unsplash.com/photo-1492684223066-81342ee5ff30?w=600&q=80`,Sports:`https://images.unsplash.com/photo-1519389950473-47ba0277781c?w=600&q=80`,"Food & Drink":`https://images.unsplash.com/photo-1555939594-58d7cb561140?w=600&q=80`};return(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(auto-fit, minmax(320px, 1fr))`,gap:24,marginBottom:40},children:e.length>0?e.map(e=>(0,j.jsxs)(`div`,{style:{background:`#fff`,borderRadius:16,border:`1px solid #EBEBEB`,overflow:`hidden`,transition:`all 0.3s ease`,cursor:`pointer`,height:`100%`,dis
34play:`flex`,flexDirection:`column`},onMouseEnter:e=>e.currentTarget.style.boxShadow=`0 12px 32px rgba(0,0,0,0.1)`,onMouseLeave:e=>e.currentTarget.style.boxShadow=`none`,children:[(0,j.jsx)(`img`,{src:n[e.category]||`https://images.unsplash.com/photo-1540575467063-178a50c2df87?w=600&q=80`,alt:e.title,style:{width:`100%`,height:200,objectFit:`cover`}}),(0,j.jsxs)(`div`,{style:{padding:20,flex:1,display:`flex`,flexDirection:`column`},children:[(0,j.jsx)(`div`,{style:{display:`inline-block`,background:`#FEF3C7`,color:`#92400E`,padding:`4px 12px`,borderRadius:999,fontSize:11,fontWeight:700,marginBottom:12,width:`fit-content`},children:e.category||`Event`}),(0,j.jsx)(`h3`,{style:{fontSize:16,fontWeight:800,color:`#111`,marginBottom:8,lineHeight:1.3},children:e.title}),(0,j.jsxs)(`div`,{style:{fontSize:13,color:`#6B7280`,marginBottom:8},children:[`ð `,Zc(e.event_date,{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`})]}),e.location&&(0,j.jsxs)(`div`,{style:{fontSize:13,color:`#6B7280`,marginBottom:12},children:[`ð `,e.location]}),(0,j.jsx)(`div`,{style:{color:`#F59E0B`,fontWeight:700,fontSize:13,marginTop:`auto`},children:`View Event â`})]})]},e.id)):(0,j.jsx)(`div`,{style:{gridColumn:`1 / -1`,textAlign:`center`,padding:40,color:`#9CA3AF`},children:(0,j.jsx)(`p`,{style:{fontSize:14},children:`No featured events yet.`})})}),e.length>0&&(0,j.jsxs)(`div`,{style:{background:`linear-gradient(135deg, #F59E0B 0%, #D97706 100%)`,borderRadius:16,padding:40,marginBottom:40,display:`grid`,gridTemplateColumns:`1fr 1fr`,gap:40,alignItems:`center`,overflow:`hidden`,position:`relative`},children:[(0,j.jsx)(`div`,{style:{position:`absolute`,right:0,top:0,width:`50%`,height:`100%`,backgroundImage:`url(https://images.unsplash.com/photo-1492684223066-81342ee5ff30?w=800&q=80)`,backgroundSize:`cover`,backgroundPosition:`center`,opacity:.15,pointerEvents:`none`}}),(0,j.jsxs)(`div`,{style:{position:`relative`,zIndex:1,color:`#fff`},children:[(0,j.jsx)(`h2`,{style:{fontSize:28,fontWeight:900,marginBottom:12},children:`Things to Do in Palm Beach`}),(0,j.jsx)(`p`,{style:{fontSize:15,lineHeight:1.7,marginBottom:20,opacity:.9},children:`Discover upcoming events, celebrations, and community activities happening across Palm Beach County.`}),(0,j.jsx)(`a`,{href:`/events`,style:{display:`inline-block`,background:`#fff`,color:`#D97706`,fontWeight:700,fontSize:14,padding:`12px 28px`,borderRadius:999,textDecoration:`none`,transition:`transform 0.2s`},onMouseEnter:e=>e.target.style.transform=`scale(1.05)`,onMouseLeave:e=>e.target.style.transform=`scale(1)`,children:`See All Events â`})]})]})]})}var Tl=[{id:`1`,title:`Palm Beach Community Night`,event_date:`2026-07-05T19:00:00`,location:`Downtown West Palm Beach`,category:`Community`},{id:`2`,title:`Fourth of July Fireworks`,event_date:`2026-07-04T21:00:00`,location:`Flagler Drive, WPB`,category:`Celebration`},{id:`3`,title:`Small Business Mixer`,event_date:`2026-07-12T18:00:00`,location:`PB Gardens Marriott`,category:`Business`},{id:`4`,title:`Clematis St Farmers Market`,event_date:`2026-07-19T08:00:00`,location:`Clematis St, WPB`,category:`Community`},{id:`5`,title:`Art in the Park`,event_date:`2026-08-02T10:00:00`,location:`Dreher Park, WPB`,category:`Arts`},{id:`6`,title:`Taste of Palm Beach`,event_date:`2026-08-09T17:00:00`,location:`CityPlace, WPB`,category:`Food & Drink`}];function El(){let[e,t]=(0,_.useState)(Tl),[n,r]=(0,_.useState)(``);(0,_.useEffect)(()=>{async function e(){if(`https://fzyvowthczazgirfursb.supabase.co`.includes(`placeholder`))return;let e=z.from(`events`).select(`*`).order(`event_date`,{ascending:!0}).limit(60);n&&(e=e.eq(`category`,n));let{data:r}=await e;t(r||[])}e()},[n]);let i=cr()<768,a=e.sort((e,t)=>e.featured_on_listing===t.featured_on_listing?0:e.featured_on_listing?-1:1),o=a.reduce((e,t)=>{let n=Zc(t.event_date,{month:`long`,year:`numeric`});return e[n]||(e[n]=[]),e[n].push(t),e},{}),s=Object.entries(o);return(0,j.jsxs)(`div`,{children:[(0,j.jsxs)(`div`,{style:{position:`relative`,overflow:`hidden`,background:`#C0392B`,padding:i?`36px 0 28px`:`56px 0 48px`},children:[(0,j.jsx)(`div`,{style:{position:`absolute`,inset:0,display:`grid`,gridTemplateColumns:i?`repeat(3, 1fr)`:`repeat(6, 1fr)`,gridTemplateRows:`1fr`,gap:0,pointerEvents:`none`},children:[`https://images.unsplash.com/photo-1760881973494-6df29de5e36f?w=500&q=80`,`https://images.unsplash.com/photo-1638132704904-58d5ebe85aa5?w=500&q=80`,`https://images.unsplash.com/photo-1540575467063-178a50c2df87?w=500&q=80`,`https://images.unsplash.com/photo-1523580494863-6f3031224c94?w=500&q=80`,`https://images.unsplash.com/photo-1511578314322-379afb476865?w=500&q=80`,`https://images.unsplash.com/photo-1491438590914-bc09fcaaf77a?w=500&q=80`].map((e,t)=>(0,j.jsx)(`img`,{src:e,alt:``,style:{width:`100%`,height:`100%`,objectFit:`cover`,display:`block`}},t))}),(0,j.jsx)(`div`,{style:{position:`absolute`,inset:0,background:`linear-gradient(135deg, rgba(192,57,43,0.82) 0%, rgba(150,40,27,0.78) 100%)`,pointerEvents:`none`}}),(0,j.jsx)(M,{style:{position:`relative`,zIndex:1},children:(0,j.jsxs)(`div`,{style:{maxWidth:600},children:[(0,j.jsx)(`div`,{style:{display:`inline-block`,background:`rgba(255,255,255,0.15)`,borderRadius:999,padding:`4px 16px`,fontSize:11,fontWeight:700,color:`#fff`,letterSpacing:`0.06em`,textTransform:`uppercase`,marginBottom:16},children:`Happening Soon`}),(0,j.jsx)(`h1`,{style:{fontSize:i?28:38,fontWeight:900,color:`#fff`,lineHeight:1.15,marginBottom:12},children:`Upcoming Events`}),(0,j.jsx)(`p`,{style:{fontSize:14,color:`rgba(255,255,255,0.85)`,lineHeight:1.7},children:`Things to do across Palm Beach County â concerts, markets, mixers, and more.`})]})})]}),(0,j.jsx)(`div`,{style:{background:`#fff`,borderBottom:`1px solid #EBEBEB`},children:(0,j.jsx)(M,{children:(0,j.jsx)(`div`,{style:{padding:`14px 0`},children:(0,j.jsx)(B,{zone:`events-top`})})})}),(0,j.jsx)(M,{children:(0,j.jsxs)(`div`,{style:{padding:`40px 0`},children:[(0,j.jsx)(`h2`,{style:{fontSize:22,fontWeight:900,color:`#111`,marginBottom:28},children:`Featured Events`}),(0,j.jsx)(wl,{})]})}),(0,j.jsx)(`div`,{style:{borderBottom:`1px solid #EBEBEB`,background:`#fff`},children:(0,j.jsx)(M,{children:(0,j.jsx)(`div`,{style:{display:`flex`,gap:8,flexWrap:`wrap`,padding:`14px 0`},children:[``,...Wc].map(e=>{let t=n===e;return(0,j.jsx)(`button`,{onClick:()=>r(e),style:{padding:`6px 16px`,borderRadius:999,fontSize:13,fontWeight:600,cursor:`pointer`,border:`none`,background:t?`#C0392B`:`#F3F4F6`,color:t?`#fff`:`#374151`},children:e||`All Events`},e||`all`)})})})}),(0,j.jsx)(`div`,{style:{background:`#F9F9F9`,minHeight:480,padding:`40px 0`},children:(0,j.jsx)(M,{children:a.length===0?(0,j.jsx)(`div`,{style:{textAlign:`center`,padding:`80px 0`,color:`#9CA3AF`,fontSize:15},children:`No upcoming events in this category.`}):s.map(([e,t],n)=>(0,j.jsxs)(`div`,{children:[(0,j.jsxs)(`div`,{style:{marginBottom:40},children:[(0,j.jsx)(`h2`,{style:{fontSize:13,fontWeight:700,color:`#9CA3AF`,textTransform:`uppercase`,letterSpacing:`0.08em`,marginBottom:16},children:e}),(0,j.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(auto-fill, minmax(280px, 1fr))`,gap:14},children:t.map(e=>(0,j.jsx)(tl,{event:e},e.id))})]}),n===0&&s.length>1&&(0,j.jsx)(`div`,{style:{marginBottom:32},children:(0,j.jsx)(B,{zone:`events-middle`})})]},e))})}),(0,j.jsx)(`div`,{style:{background:`#fff`,borderTop:`1px solid #EBEBEB`},children:(0,j.jsx)(M,{children:(0,j.jsx)(`div`,{style:{padding:`16px 0`},children:(0,j.jsx)(B,{zone:`events-bottom`})})})}),(0,j.jsx)(`div`,{style:{background:`#111`,padding:`48px 0`},children:(0,j.jsx)(M,{children:(0,j.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,flexWrap:`wrap`,gap:20},children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`h2`,{style:{fontSize:22,fontWeight:900,color:`#fff`,marginBottom:6},children:`Have an event to share?`}),(0,j.jsx)(`p`,{style:{fontSize:14,color:`rgba(255,255,255,0.6)`},children:`Listed businesses can post events directly through their dashboard.`})]}),(0,j.jsx)(`a`,{href:`/pricing`,style:{background:`#C0392B`,color:`#fff`,fontWeight:700,fontSize:14,padding:`12px 28px`,borderRadius:999,textDecoration:`none`},children:`Get Listed â`})]})})})]})}var Dl=[{url:`https://images.unsplash.com/photo-1765648496288-e1760f547711?w=800&q=80`,label:`Local Stories`},{url:`https://images.unsplash.com/photo-1511578314322-379afb476865?w=800&q=80`,label:`Business Spotlights`},{url:`https://images.unsplash.com/photo-1540575467063-178a50c2df87?w=800&q=80`,label:`Community News`},{url:`https://images.unsplash.com/photo-1459749411175-04bf5292ceea?w=800&q=80`,label:`Arts & Culture`}],Ol=[{id:`1`,slug:`welcome-to-palm-beach-comm`,title:`Welcome to Palm Beach Comm â Your Community, Online`,excerpt:`We built Palm Beach Comm to connect residents, celebrate local businesses, and make it easier to find everything Palm Beach County has to offer. Here is what you can do on the platform.`,published_at:`2026-06-25`,cover_image_url:`https://images.unsplash.com/photo-1507525428034-b723cf961d3e?w=800&q=80`,content:`Palm Beach County is one of the most vibrant communities in Florida â and it deserves a platform that reflects that. Palm Beach Comm is a free directory and community hub built specifically for residents and businesses across the county. 35 36Whether you are looking for a trusted local contractor, a weekend event, a restaurant recommendation, or a community resource, Palm Beach Comm puts it all in one place. 37 38## What You Can Do 39 40**Find Local Businesses** â Browse hundreds of businesses by category, city, or keyword. Every listing includes contact info, photos, reviews, and more depending on their plan. 41 42**Discover Events** â From farmers markets to business networking mixers, our events calendar keeps you in the loop on what is happening near you. 43 44**Access Community Resources** â Need housing assistance, food support, or health screenings? Our Community Resources section connects Palm Beach County residents with free and low-cost services. 45 46**Read the Blog** â Local stories, business spotlights, and community news written for Palm Beach County residents. 47 48## For Business Owners 49 50Getting listed is free. Paid plans unlock photos, events, featured placement, analytics, and more. Visit our Pricing page to see all options. 51 52We are glad you are here. Welcome to Palm Beach Comm.`},{id:`2`,slug:`top-restaurants-west-palm-beach-2026`,title:`Top 5 Restaurants in West Palm Beach This Summer`,excerpt:`From fresh seafood on the waterfront to authentic Cuban cuisine, these are the must-visit restaurants in West Palm Beach right now.`,published_at:`2026-06-20`,cover_image_url:`https://images.unsplash.com/photo-1414235077428-338989a2e8c0?w=800&q=80`,content:`Summer in West Palm Beach means warm nights, rooftop dining, and some of the best food in South Florida. Whether you are a longtime resident or visiting for the first time, these five restaurants deserve a spot on your list. 53 54## 1. Havana Nights 55Authentic Cuban cuisine with live music on weekends. The ropa vieja and mojitos are unmatched. Located in downtown West Palm Beach, this spot brings the energy of Little Havana to Palm Beach County. 56 57## 2. Rhythm Cafe 58A quirky, intimate dining room on South Dixie Highway serving globally inspired dishes. The rotating menu keeps regulars coming back every week. 59 60## 3. Rocco's Tacos & Tequila Bar 61A Palm Beach staple with an extensive tequila selection and crowd-pleasing Mexican food. Great for groups, happy hour, and late-night dining. 62 63## 4. Hullabaloo
64A gastropub downtown known for locally sourced ingredients, craft cocktails, and a lively atmosphere. Their brunch menu on weekends draws a crowd. 65 66## 5. Avocado Grill 67Farm-to-table dining in Clematis Street's most charming space. The avocado hummus and grilled fish tacos are standouts. Perfect for a date night or a casual dinner with friends. 68 69*Know a restaurant we missed? Submit your business to get listed on Palm Beach Comm.*`},{id:`3`,slug:`small-business-spotlight-june-2026`,title:`Small Business Spotlight: June 2026`,excerpt:`This month we highlight three Palm Beach County entrepreneurs who are making a difference in their communities through hard work, creativity, and commitment.`,published_at:`2026-06-15`,cover_image_url:`https://images.unsplash.com/photo-1511578314322-379afb476865?w=800&q=80`,content:`Every month, Palm Beach Comm spotlights local small businesses that are making an impact across Palm Beach County. This June, we are featuring three businesses worth knowing. 70 71## The Bynes Company Office Solutions 72Founded by Francina Bynes, The Bynes Company provides professional office solutions and business support services to small businesses and entrepreneurs throughout Palm Beach County. What started as a one-person operation has grown into a trusted resource for local business owners who need reliable, affordable support. 73 74"Palm Beach County is full of talented entrepreneurs who just need the right tools and support," says Francina. "That is exactly what we provide." 75 76## SunBright Solar â Boca Raton 77With Florida sunshine in abundance, SunBright Solar has been helping homeowners and businesses reduce their energy bills through residential and commercial solar installations. Their team prides itself on transparent pricing and clean, professional installs. 78 79## Palm Health Center â West Palm Beach 80Holistic health services for the whole family, including chiropractic care, massage therapy, and nutrition consulting. Palm Health Center accepts most insurance plans and offers sliding-scale pricing for uninsured patients. 81 82*Is your business doing great things in the community? Get listed on Palm Beach Comm and let us spotlight you next month.*`},{id:`4`,slug:`community-resources-palm-beach-county`,title:`Community Resources Available Right Now in Palm Beach County`,excerpt:`From emergency rental assistance to free health screenings, Palm Beach County has more support available than most residents realize. Here is where to start.`,published_at:`2026-06-10`,cover_image_url:`https://images.unsplash.com/photo-1540575467063-178a50c2df87?w=800&q=80`,content:`Palm Beach County has a robust network of nonprofit organizations, government programs, and community groups offering free and low-cost services to residents in need. The challenge is knowing where to look. 83 84Palm Beach Comm has built a dedicated Community Resources section to make this easier. Here is a snapshot of what is available right now. 85 86## Housing Assistance 87The Palm Beach County Housing Authority offers emergency rental assistance for residents facing eviction or unable to pay rent due to financial hardship. Applications are accepted monthly. Call (561) 655-8230 or visit pbcgov.org for details. 88 89## Food & Nutrition 90Feeding South Florida operates a community food pantry with free groceries and prepared meals available on Tuesdays and Thursdays. No income verification is required. Located at 2501 SW 32nd Terrace, West Palm Beach. 91 92## Free Health Screenings 93JFK North Medical Center hosts monthly free health screenings for blood pressure, diabetes, and cholesterol â no appointment needed. Call (561) 840-6205 for the next scheduled date. 94 95## Youth Mentorship 96The Urban League of Palm Beach County connects at-risk youth ages 10â18 with mentors, job training, and academic support. Call (561) 833-1461 to enroll or volunteer. 97 98## Mental Health Crisis Line 99The Crisis Line of Palm Beach County provides 24/7 confidential support for anyone experiencing emotional distress or a mental health emergency. Call (561) 383-1988 anytime. 100 101*Browse the full Community Resources directory at palmbeachcomm.us/resources.*`},{id:`5`,slug:`how-to-get-your-business-listed`,title:`How to Get Your Business Listed on Palm Beach Comm`,excerpt:`Getting your business in front of Palm Beach County residents is easier than you think. Here is everything you need to know about listing your business â free or paid.`,published_at:`2026-06-05`,cover_image_url:`https://images.unsplash.com/photo-1765648496288-e1760f547711?w=800&q=80`,content:`If you own or manage a business in Palm Beach County, getting listed on Palm Beach Comm is one of the easiest ways to increase your local visibility. Here is how it works. 102 103## Step 1: Create a Free Account 104Visit palmbeachcomm.us and click "Join Free" in the top navigation. Create your account with your name, email, and a password. Email confirmation is required. 105 106## Step 2: Choose Your Plan 107We offer four listing tiers: 108 109**Free** â Basic directory listing with your name, category, address, and customer reviews. No photos, no events. 110 111**Basic ($20/mo)** â Adds up to 5 photos, website and social links, 1 event per month, and profile view anal
111ytics. 112 113**Pro ($40/mo)** â Adds up to 15 photos, 5 events per month, products and promotions section, homepage rotation pool, priority search placement, and a Verified or Top Rated badge. 114 115**Elite ($70/mo)** â Unlimited photos, unlimited events, guaranteed homepage top slot, full analytics, and a custom gold badge. 116 117## Step 3: Set Up Your Profile 118Once listed, you can upload your logo, add photos, write a description, link your website and social accounts, and post events â all from your admin dashboard. 119 120## Featured Spotlight Add-On 121Any tier â including Free â can purchase a Featured Spotlight for guaranteed homepage placement. Packages start at $25 per week. 122 123## Try Elite Free for 7 Days 124New accounts can request a 7-day Elite trial at no cost. No credit card required. Email us at [email protected] to activate. 125 126*Ready to get started? Visit palmbeachcomm.us/pricing to see all plans.*`}];function kl(){let[e,t]=(0,_.useState)(Ol),n=cr()<768;(0,_.useEffect)(()=>{async function e(){let{data:e}=await z.from(`posts`).select(`id, slug, title, excerpt, published_at, cover_image_url`).eq(`published`,!0).order(`published_at`,{ascending:!1}).limit(24);e?.length&&t(e)}e()},[]);let[r,...i]=e;function a(e){return e?new Date(e).toLocaleDateString(`en-US`,{month:`long`,day:`numeric`,year:`numeric`}):``}return(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`div`,{style:{background:`#C0392B`,padding:n?`36px 0 28px`:`56px 0 48px`},children:(0,j.jsxs)(M,{children:[(0,j.jsx)(`h1`,{style:{fontSize:n?30:40,fontWeight:900,color:`#fff`,marginBottom:8},children:`PBC Community Blog`}),(0,j.jsx)(`p`,{style:{fontSize:16,color:`rgba(255,255,255,0.8)`},children:`Local stories, business spotlights, and community news from across Palm Beach County.`})]})}),(0,j.jsx)(`div`,{style:{background:`#111`,overflow:`hidden`},children:(0,j.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:n?`repeat(2, 1fr)`:`repeat(4, 1fr)`,height:n?180:220},children:Dl.map((e,t)=>(0,j.jsxs)(`div`,{style:{position:`relative`,overflow:`hidden`},children:[(0,j.jsx)(`img`,{src:e.url,alt:e.label,style:{width:`100%`,height:`100%`,objectFit:`cover`,display:`block`,opacity:.85}}),(0,j.jsx)(`div`,{style:{position:`absolute`,bottom:0,left:0,right:0,background:`linear-gradient(transparent, rgba(0,0,0,0.6))`,padding:`16px 12px 10px`},children:(0,j.jsx)(`span`,{style:{color:`#fff`,fontSize:12,fontWeight:600},children:e.label})})]},t))})}),(0,j.jsx)(`div`,{style:{background:`#F9F9F9`,minHeight:480,padding:`48px 0`},children:(0,j.jsxs)(M,{children:[r&&(0,j.jsx)(A,{to:`/blog/${r.slug}`,style:{textDecoration:`none`,display:`block`,marginBottom:32},children:(0,j.jsxs)(`div`,{style:{background:`#fff`,borderRadius:20,border:`1px solid #EBEBEB`,overflow:`hidden`},onMouseEnter:e=>e.currentTarget.style.boxShadow=`0 8px 32px rgba(0,0,0,0.08)`,onMouseLeave:e=>e.currentTarget.style.boxShadow=`none`,children:[r.cover_image_url&&(0,j.jsx)(`img`,{src:r.cover_image_url,alt:r.title,style:{width:`100%`,maxHeight:320,objectFit:`cover`,display:`block`}}),(0,j.jsxs)(`div`,{style:{padding:`36px 40px`},children:[(0,j.jsx)(`span`,{style:{fontSize:11,fontWeight:700,color:`#C0392B`,textTransform:`uppercase`,letterSpacing:`0.08em`,display:`block`,marginBottom:10},children:`Featured`}),(0,j.jsx)(`h2`,{style:{fontSize:26,fontWeight:900,color:`#111`,lineHeight:1.25,marginBottom:10},children:r.title}),r.excerpt&&(0,j.jsx)(`p`,{style:{fontSize:15,color:`#6B7280`,lineHeight:1.6,marginBottom:16},children:r.excerpt}),(0,j.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:16},children:[(0,j.jsx)(`span`,{style:{fontSize:13,color:`#9CA3AF`},children:a(r.published_at)}),(0,j.jsx)(`span`,{style:{fontSize:13,fontWeight:700,color:`#C0392B`},children:`Read more â`})]})]})]})}),i.length>0&&(0,j.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(auto-fill, minmax(280px, 1fr))`,gap:20},children:i.map(e=>(0,j.jsx)(A,{to:`/blog/${e.slug}`,style:{textDecoration:`none`},children:(0,j.jsxs)(`div`,{style:{background:`#fff`,borderRadius:16,border:`1px solid #EBEBEB`,height:`100%`,boxSizing:`border-box`,overflow:`hidden`,display:`flex`,flexDirection:`column`},onMouseEnter:e=>e.currentTarget.style.boxShadow=`0 4px 16px rgba(0,0,0,0.07)`,onMouseLeave:e=>e.currentTarget.style.boxShadow=`none`,children:[e.cover_image_url&&(0,j.jsx)(`img`,{src:e.cover_image_url,alt:e.title,style:{width:`100%`,height:140,objectFit:`cover`,display:`block`}}),(0,j.jsxs)(`div`,{style:{padding:24,display:`flex`,flexDirection:`column`,gap:10,flex:1},children:[(0,j.jsx)(`p`,{style:{fontSize:11,color:`#9CA3AF`,fontWeight:600,textTransform:`uppercase`,letterSpacing:`0.06em`},children:a(e.published_at)}),(0,j.jsx)(`h3`,{style:{fontSize:16,fontWeight:800,color:`#111`,lineHeight:1.35},children:e.title}),e.excerpt&&(0,j.jsx)(`p`,{style:{fontSize:13,color:`#6B7280`,lineHeight:1.55,flex:1},children:e.excerpt}),(0,j.jsx)(`span`,{style:{fontSize:13,fontWeight:700,color:`#C0392B`,marginTop:4},children:`Read more â`})]})]})},e.id))}),e.length===0&&(0,j.jsx)(`div`,{style:{textAlign:`center`,padding:`80px 0`,color:`#9CA3AF`,fontSize:15},children:`No posts yet.`})]})})]})}var Al=[{id:`1`,slug:`welcome-to-palm-beach-comm`,title:`Welcome to Palm Beach Comm â Your Community, Online`,excerpt:`We built Palm Beach Comm to connect residents, celebrate local businesses, and make it easier to find everything Palm Beach County has to offer. Here is what you can do on the platform.`,published_at:`2026-06-25`,cover_image_url:`https://images.unsplash.com/photo-1507525428034-b723cf961d3e?w=1200&q=80`,content:`Palm Beach County is one of the most vibrant communities in Florida â and it deserves a platform that reflects that. Palm Beach Comm is a free directory and community hub built specifically for residents and businesses across the county. 127 128Whether you are looking for a trusted local contractor, a weekend event, a restaurant recommendation, or a community resource, Palm Beach Comm puts it all in one place. 129 130## What You Can Do 131 132**Find Local Businesses** â Browse hundreds of businesses by category, city, or keyword. 133 134**Discover Events** â From farmers markets to business networking mixers, our events calendar keeps you in the loop on what is happening near you. 135 136**Access Community Resources** â Need housing assistance, food support, or health screenings? Our Community Resources section connects Palm Beach County residents with free and low-cost services. 137 138**Read the Blog** â Local stories, business spotlights, and community news written for Palm Beach County residents. 139 140## For Business Owners 141 142Getting listed is free. Paid plans unlock photos, events, featured placement, analytics, and more. Visit our Pricing page to see all options. 143 144We are glad you are here. Welcome to Palm Beach Comm.`},{id:`2`,slug:`top-restaurants-west-palm-beach-2026`,title:`Top 5 Restaurants in West Palm Beach This Summer`,excerpt:`From fresh seafood on the waterfront to authentic Cuban cuisine, these are the must-visit restaurants in West Palm Beach right now.`,published_at:`2026-06-20`,cover_image_url:`https://images.unsplash.com/photo-1414235077428-338989a2e8c0?w=1200&q=80`,content:`Summer in West Palm Beach means warm nights, rooftop dining, and some of the best food in South Florida. Whether you are a longtime resident or visiting for the first time, these five restaurants deserve a spot on your list. 145 146## 1. Havana Nights 147Authentic Cuban cuisine with live music on weekends. The ropa vieja and mojitos are unmatched. Located in downtown West Palm Beach. 148 149## 2. Rhythm Cafe 150A quirky, intimate dining room on South Dixie Highway serving globally inspired dishes. The rotating menu keeps regulars coming back every week. 151 152## 3. Rocco's Tacos & Tequila Bar 153A Palm Beach staple with an extensive tequila selection and crowd-pleasing Mexican food. Great for groups, happy hour, and late-night dining. 154 155## 4. Hullabaloo
156A gastropub downtown known for locally sourced ingredients, craft cocktails, and a lively atmosphere. Their brunch menu on weekends draws a crowd. 157 158## 5. Avocado Grill 159Farm-to-table dining in Clematis Street's most charming space. The avocado hummus and grilled fish tacos are standouts. Perfect for a date night. 160 161Know a restaurant we missed? Submit your business to get listed on Palm Beach Comm.`},{id:`3`,slug:`small-business-spotlight-june-2026`,title:`Small Business Spotlight: June 2026`,excerpt:`This month we highlight three Palm Beach County entrepreneurs who are making a difference in their communities through hard work, creativity, and commitment.`,published_at:`2026-06-15`,cover_image_url:`https://images.unsplash.com/photo-1511578314322-379afb476865?w=1200&q=80`,content:`Every month, Palm Beach Comm spotlights local small businesses that are making an impact across Palm Beach County. This June, we are featuring three businesses worth knowing. 162 163## The Bynes Company Office Solutions 164Founded by Francina Bynes, The Bynes Company provides professional office solutions and business support services to small businesses and entrepreneurs throughout Palm Beach County. 165 166"Palm Beach County is full of talented entrepreneurs who just need the right tools and support," says Francina. "That is exactly what we provide." 167 168## SunBright Solar â Boca Raton 169With Florida sunshine in abundance, SunBright Solar has been helping homeowners and businesses reduce their energy bills through residential and commercial solar installations. 170 171## Palm Health Center â West Palm Beach 172Holistic health services for the whole family, including chiropractic care, massage therapy, and nutrition consulting. 173 174Is your business doing great things in the community? Get listed on Palm Beach Comm and let us spotlight you next month.`},{id:`4`,slug:`community-resources-palm-beach-county`,title:`Community Resources Available Right Now in Palm Beach County`,excerpt:`From emergency rental assistance to free health screenings, Palm Beach County has more support available than most residents realize. Here is where to start.`,published_at:`2026-06-10`,cover_image_url:`https://images.unsplash.com/photo-1540575467063-178a50c2df87?w=1200&q=80`,content:`Palm Beach County has a robust network of nonprofit organizations, government programs, and community groups offering free and low-cost services to residents in need. 175 176## Housing Assistance 177The Palm Beach County Housing Authority offers emergency rental assistance for residents facing eviction or financial hardship. Call (561) 655-8230. 178 179## Food & Nutrition 180Feeding South Florida operates a community food pantry with free groceries available Tuesdays and Thursdays. No income verification required. 2501 SW 32nd Terrace, West Palm Beach. 181 182## Free Health Screenings 183JFK North Medical Center hosts monthly free health screenings â blood pressure, diabetes, cholesterol. No appointment needed. Call (561) 840-6205. 184 185## Youth Mentorship 186The Urban League of Palm Beach County connects at-risk youth ages 10â18 with mentors and job training. Call (561) 833-1461. 187 188## Mental Health Crisis Line 189The Crisis Line of Palm Beach County provides 24/7 confidential support. Call (561) 383-1988 anytime. 190 191Browse the full directory at palmbeachcomm.us/resources.`},{id:`5`,slug:`how-to-get-your-business-listed`,title:`How to Get Your Business Listed on Palm Beach Comm`,excerpt:`Getting your business in front of Palm Beach County residents is easier than you think. Here is everything you need to know about listing your business â free or paid.`,published_at:`2026-06-05`,cover_image_url:`https://images.unsplash.com/photo-1765648496288-e1760f547711?w=1200&q=80`,content:`If you own or manage a business in Palm Beach County, getting listed on Palm Beach Comm is one of the easiest ways to increase your local visibility. 192 193## Step 1: Create a Free Account 194Visit palmbeachcomm.us and click "Join Free." Create your account with your name, email, and a password. 195 196## Step 2: Choose Your Plan 197 198**Free** â Basic listing, address, category, customer reviews. 199
200**Basic ($20/mo)** â 5 photos, website and social links, 1 event/month, profile analytics. 201 202**Pro ($40/mo)** â 15 photos, 5 events/month, products section, homepage rotation, priority search, badge. 203 204**Elite ($70/mo)** â Unlimited photos and events, guaranteed homepage slot, full analytics, custom gold badge. 205 206## Featured Spotlight Add-On 207Any tier can purchase guaranteed homepage placement starting at $25/week. 208 209## 7-Day Elite Free Trial 210New accounts can request a 7-day Elite trial at no cost. Email [email protected] to activate. 211 212Ready? Visit palmbeachcomm.us/pricing.`}],jl=` 213 .blog-body { font-size: 15px; line-height: 1.8; color: #374151; } 214 .blog-body h2 { font-size: 22px; font-weight: 800; color: #111; margin: 32px 0 12px; line-height: 1.25; } 215 .blog-body h3 { font-size: 17px; font-weight: 700; color: #111; margin: 24px 0 8px; } 216 .blog-body p { margin: 0 0 16px; } 217 .blog-body ul, .blog-body ol { padding-left: 24px; margin: 0 0 16px; } 218 .blog-body li { margin-bottom: 6px; } 219 .blog-body blockquote { border-left: 4px solid #C0392B; margin: 20px 0; padding: 10px 20px; color: #6B7280; font-style: italic; background: #FEF2F2; border-radius: 0 8px 8px 0; } 220 .blog-body img { max-width: 100%; border-radius: 10px; margin: 20px 0; display: block; } 221 .blog-body a { color: #C0392B; text-decoration: underline; } 222 .blog-body strong { font-weight: 700; color: #111; } 223`;function Ml(e){return e?e.split(` 224`).map((e,t)=>e.startsWith(`## `)?(0,j.jsx)(`h2`,{style:{fontSize:20,fontWeight:800,color:`#111`,marginTop:28,marginBottom:10},children:e.slice(3)},t):e.startsWith(`**`)&&e.endsWith(`**`)?(0,j.jsx)(`p`,{style:{fontSize:15,fontWeight:700,color:`#111`,lineHeight:1.8},children:e.slice(2,-2)},t):e===``?(0,j.jsx)(`div`,{style:{height:12}},t):(0,j.jsx)(`p`,{style:{fontSize:15,color:`#374151`,lineHeight:1.8,marginBottom:4},children:e.split(/(\*\*[^*]+\*\*)/g).map((e,t)=>e.startsWith(`**`)&&e.endsWith(`**`)?(0,j.jsx)(`strong`,{children:e.slice(2,-2)},t):e)},t)):null}function Nl(){let{slug:e}=Ct(),[t,n]=(0,_.useState)(null),[r,i]=(0,_.useState)(!0);if((0,_.useEffect)(()=>{async function t(){let{data:t}=await z.from(`posts`).select(`*`).eq(`slug`,e).maybeSingle();t||=(await z.from(`posts`).select(`*`).eq(`id`,e).maybeSingle()).data,t||=Al.find(t=>t.slug===e||t.id===e)||null,n(t),i(!1)}t()},[e]),r)return(0,j.jsx)(`div`,{style:{textAlign:`center`,padding:`80px 0`,color:`#9CA3AF`,fontSize:15},children:`Loading...`});if(!t)return(0,j.jsxs)(`div`,{style:{textAlign:`center`,padding:`80px 0`},children:[(0,j.jsx)(`p`,{style:{color:`#9CA3AF`,marginBottom:16},children:`Post not found.`}),(0,j.jsx)(A,{to:`/blog`,style:{color:`#C0392B`,fontWeight:700,textDecoration:`none`,fontSize:14},children:`â Back to Blog`})]});let a=t.content||t.body||``;return(0,j.jsxs)(`div`,{style:{background:`#F9F9F9`,minHeight:`100vh`,padding:`48px 0`},children:[(0,j.jsx)(`style`,{children:jl}),(0,j.jsx)(M,{children:(0,j.jsxs)(`div`,{style:{maxWidth:720,margin:`0 auto`},children:[(0,j.jsx)(A,{to:`/blog`,style:{color:`#C0392B`,fontWeight:700,textDecoration:`none`,fontSize:13,display:`inline-block`,marginBottom:24},children:`â Back to Blog`}),(0,j.jsxs)(`div`,{style:{background:`#fff`,borderRadius:20,border:`1px solid #EBEBEB`,padding:`40px 48px`},children:[(0,j.jsx)(`p`,{style:{fontSize:12,color:`#9CA3AF`,fontWeight:600,textTransform:`uppercase`,letterSpacing:`0.06em`,marginBottom:12},children:t.published_at?new Date(t.published_at).toLocaleDateString(`en-US`,{month:`long`,day:`numeric`,year:`numeric`}):``}),t.cover_image_url&&(0,j.jsx)(`img`,{src:t.cover_image_url,alt:t.title,style:{width:`100%`,borderRadius:12,objectFit:`cover`,maxHeight:360,display:`block`,marginBottom:28}}),(0,j.jsx)(`h1`,{style:{fontSize:30,fontWeight:900,color:`#111`,lineHeight:1.2,marginBottom:20},children:t.title}),t.excerpt&&(0,j.jsx)(`p`,{style:{fontSize:16,color:`#6B7280`,lineHeight:1.65,marginBottom:28,paddingBottom:28,borderBottom:`1px solid #EBEBEB`},children:t.excerpt}),a.trimStart().startsWith(`<`)?(0,j.jsx)(`div`,{className:`blog-body`,dangerouslySetInnerHTML:{__html:a}}):(0,j.jsx)(`div`,{children:Ml(a)})]}),(0,j.jsx)(`div`,{style:{marginTop:32,textAlign:`center`},children:(0,j.jsx)(A,{to:`/blog`,style:{color:`#C0392B`,fontWeight:700,textDecoration:`none`,fontSize:14},children:`â More from the Blog`})})]})})]})}var Pl=[{id:`1`,title:`Palm Beach Community Night`,event_date:`2026-07-05T19:00:00`,location:`Downtown West Palm Beach`,category:`Community`,description:`Join neighbors from across Palm Beach County for an evening of community connection, local vendors, and live entertainment in the heart of downtown West Palm Beach.`},{id:`2`,title:`Fourth of July Fireworks`,event_date:`2026-07-04T21:00:00`,location:`Flagler Drive, WPB`,category:`Celebration`,description:`Celebrate Independence Day with a spectacular fireworks display over the Intracoastal Waterway along Flagler Drive. Bring lawn chairs and arr
224ive early for the best views.`},{id:`3`,title:`Small Business Mixer`,event_date:`2026-07-12T18:00:00`,location:`PB Gardens Marriott`,category:`Business`,description:`Network with fellow Palm Beach County entrepreneurs and business owners at this monthly mixer. Light refreshments provided. Free to attend for all Palm Beach Comm members.`},{id:`4`,title:`Clematis St Farmers Market`,event_date:`2026-07-19T08:00:00`,location:`Clematis St, WPB`,category:`Community`,description:`Fresh produce, local artisans, and food vendors every Sunday morning on Clematis Street. Over 40 vendors selling fruits, vegetables, baked goods, crafts, and more.`},{id:`5`,title:`Art in the Park`,event_date:`2026-08-02T10:00:00`,location:`Dreher Park, WPB`,category:`Arts`,description:`A celebration of local artists and creatives at Dreher Park. Browse paintings, sculptures, photography, and handmade goods from over 50 Palm Beach County artists.`},{id:`6`,title:`Taste of Palm Beach`,event_date:`2026-08-09T17:00:00`,location:`CityPlace, WPB`,category:`Food & Drink`,description:`Sample dishes from 30+ local restaurants at this annual food festival at CityPlace. Live music, cocktails, and the best flavors Palm Beach County has to offer.`}],Fl={Community:{background:`#F3F4F6`,color:`#374151`},Business:{background:`#EFF6FF`,color:`#1D4ED8`},Arts:{background:`#F5F3FF`,color:`#6D28D9`},Celebration:{background:`#FFF7ED`,color:`#C2410C`},Sports:{background:`#F0FDF4`,color:`#15803D`},"Food & Drink":{background:`#FFFBEB`,color:`#B45309`}};function Il(){let{id:e}=Ct(),[t,n]=(0,_.useState)(null),[r,i]=(0,_.useState)(!0);if((0,_.useEffect)(()=>{async function t(){let{data:t}=await z.from(`events`).select(`*`).eq(`id`,e).maybeSingle();t||=Pl.find(t=>t.id===e)||null,n(t),i(!1)}t()},[e]),r)return(0,j.jsx)(`div`,{style:{textAlign:`center`,padding:`80px 0`,color:`#9CA3AF`},children:`Loading...`});if(!t)return(0,j.jsxs)(`div`,{style:{textAlign:`center`,padding:`80px 0`},children:[(0,j.jsx)(`p`,{style:{color:`#9CA3AF`,marginBottom:16},children:`Event not found.`}),(0,j.jsx)(A,{to:`/events`,style:{color:`#C0392B`,fontWeight:700,textDecoration:`none`},children:`â Back to Events`})]});let a=Fl[t.category]||{background:`#F3F4F6`,color:`#374151`},o=Zc(t.event_date,{weekday:`long`,month:`long`,day:`numeric`,year:`numeric`}),s=Zc(t.event_date,{hour:`numeric`,minute:`2-digit`,hour12:!0});return(0,j.jsx)(`div`,{style:{background:`#F9F9F9`,minHeight:`100vh`,padding:`48px 0`},children:(0,j.jsx)(M,{children:(0,j.jsxs)(`div`,{style:{maxWidth:680,margin:`0 auto`},children:[(0,j.jsx)(A,{to:`/events`,style:{color:`#C0392B`,fontWeight:700,textDecoration:`none`,fontSize:13,display:`inline-block`,marginBottom:24},children:`â Back to Events`}),t.cover_image_url&&(0,j.jsx)(`img`,{src:t.cover_image_url,alt:t.title,style:{width:`100%`,borderRadius:16,objectFit:`cover`,maxHeight:300,display:`block`,marginBottom:24}}),(0,j.jsxs)(`div`,{style:{background:`#fff`,borderRadius:20,border:`1px solid #EBEBEB`,padding:`36px 40px`},children:[t.category&&(0,j.jsx)(`span`,{style:{fontSize:11,fontWeight:700,padding:`3px 12px`,borderRadius:999,marginBottom:16,display:`inline-block`,...a},children:t.category}),(0,j.jsx)(`h1`,{style:{fontSize:28,fontWeight:900,color:`#111`,lineHeight:1.2,marginBottom:20},children:t.title}),(0,j.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:10,marginBottom:24,paddingBottom:24,borderBottom:`1px solid #F3F4F6`},children:[(0,j.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10,fontSize:14,color:`#374151`},children:[(0,j.jsx)(`span`,{style:{fontSize:18},children:`ð
`}),(0,j.jsx)(`span`,{style:{fontWeight:600},children:o})]}),(0,j.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10,fontSize:14,color:`#374151`},children:[(0,j.jsx)(`span`,{style:{fontSize:18},children:`ð`}),(0,j.jsx)(`span`,{children:s})]}),t.location&&(0,j.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10,fontSize:14,color:`#374151`},children:[(0,j.jsx)(`span`,{style:{fontSize:18},children:`ð`}),(0,j.jsx)(`span`,{children:t.location})]})]}),t.description&&(0,j.jsx)(`p`,{style:{fontSize:15,color:`#374151`,lineHeight:1.8,whiteSpace:`pre-line`},children:t.description}),(0,j.jsxs)(`div`,{style:{marginTop:28,paddingTop:24,borderTop:`1px solid #F3F4F6`,dis
224play:`flex`,gap:10,flexWrap:`wrap`},children:[(0,j.jsx)(`a`,{href:`https://calendar.google.com/calendar/render?action=TEMPLATE&text=${encodeURIComponent(t.title)}&location=${encodeURIComponent(t.location||``)}&dates=${new Date(t.event_date).toISOString().replace(/[-:]/g,``).split(`.`)[0]}Z/${new Date(t.event_date).toISOString().replace(/[-:]/g,``).split(`.`)[0]}Z`,target:`_blank`,rel:`noopener noreferrer`,style:{display:`inline-block`,background:`#C0392B`,color:`#fff`,fontWeight:700,fontSize:13,padding:`11px 24px`,borderRadius:999,textDecoration:`none`},children:`+ Add to Google Calendar`}),t.website_url&&(0,j.jsx)(`a`,{href:t.website_url,target:`_blank`,rel:`noopener noreferrer`,style:{display:`inline-block`,background:`#fff`,color:`#C0392B`,fontWeight:700,fontSize:13,padding:`11px 24px`,borderRadius:999,textDecoration:`none`,border:`1px solid #E5E7EB`},children:`Visit Website â`})]})]})]})})})}var Ll=[{name:`Free`,price:0,color:`#6B7280`,features:[{label:`Listed in directory`,yes:!0},{label:`Name, category, address`,yes:!0},{label:`Description (150 char)`,yes:!0},{label:`Photos`,value:`None`},{label:`Website & social links`,yes:!1},{label:`Customer reviews & ratings`,yes:!0},{label:`Event posting`,yes:!1},{label:`Products & promotions`,yes:!1},{label:`Homepage featured rotation`,yes:!1},{label:`Priority in search results`,yes:!1},{label:`Analytics`,yes:!1},{label:`Badge`,yes:!1}],cta:`Get Listed Free`,highlight:!1},{name:`Basic`,price:20,color:`#3B82F6`,features:[{label:`Listed in directory`,yes:!0},{label:`Name, category, address`,yes:!0},{label:`Full description`,yes:!0},{label:`Photos`,value:`Up to 5`},{label:`Website & social links`,yes:!0},{label:`Customer reviews & ratings`,yes:!0},{label:`Event posting`,value:`1 / month`},{label:`Products & promotions`,yes:!1},{label:`Homepage featured rotation`,yes:!1},{label:`Priority in search results`,yes:!1},{label:`Analytics`,value:`Profile views`},{label:`Badge`,yes:!1}],cta:`Get Started`,highlight:!1},{name:`Pro`,price:40,color:`#C0392B`,badge:`Most Popular`,features:[{label:`Listed in directory`,yes:!0},{label:`Name, category, address`,yes:!0},{label:`Full description`,yes:!0},{label:`Photos`,value:`Up to 15`},{label:`Website & social links`,yes:!0},{label:`Customer reviews & ratings`,yes:!0},{label:`Event posting`,value:`5 / month`},{label:`Products & promotions`,yes:!0},{label:`Homepage featured rotation`,value:`Random rotation pool`},{label:`Priority in search results`,yes:!0},{label:`Analytics`,value:`Views + clicks`},{label:`Badge`,value:`"Verified" or "Top Rated"`}],cta:`Get Pro`,highlight:!0},{name:`Elite`,price:70,color:`#F59E0B`,features:[{label:`Listed in directory`,yes:!0},{label:`Name, category, address`,yes:!0},{label:`Full description`,yes:!0},{label:`Photos`,value:`Unlimited`},{label:`Website & social links`,yes:!0},{label:`Customer reviews & ratings`,yes:!0},{label:`Event posting`,value:`Unlimited`},{label:`Products & promotions`,yes:!0},{label:`Homepage featured rotation`,value:`Guaranteed top slot`},{label:`Priority in search results`,yes:!0},{label:`Analytics`,value:`Views + clicks + full breakdown`},{label:`Badge`,value:`Custom (any text + gold)`}],cta:`Get Elite`,highlight:!1}];function Rl(){let e=cr()<768;return(0,j.jsxs)(`div`,{style:{background:`#FAFAFA`,minHeight:`100vh`},children:[(0,j.jsx)(`div`,{style:{background:`#C0392B`},children:(0,j.jsx)(M,{children:(0,j.jsxs)(`div`,{style:{padding:`52px 0 48px`,textAlign:`center`},children:[(0,j.jsx)(`h1`,{style:{fontSize:e?30:42,fontWeight:900,color:`#fff`,letterSpacing:`-0.8px`,marginBottom:12},children:`Listing Plans`}),(0,j.jsx)(`p`,{style:{color:`rgba(255,255,255,0.8)`,fontSize:16,maxWidth:480,margin:`0 auto`},children:`Get your Palm Beach County business in front of the community. Start free, upgrade when you're ready.`})]})})}),(0,j.jsx)(M,{children:(0,j.jsxs)(`div`,{style:{padding:`48px 0 80px`},children:[(0,j.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:e?`1fr`:`repeat(4, 1fr)`,gap:e?14:20,marginBottom:48},children:Ll.map(e=>(0,j.jsx)(zl,{tier:e},e.name))}),(0,j.jsx)(`div`,{style:{overflowX:`auto`,WebkitOverflowScrolling:`touch`,marginBottom:48,borderRadius:20},children:(0,j.jsxs)(`div`,{style:{background:`#fff`,borderRadius:20,border:`1px solid #F0F0F0`,overflow:`hidden`,minWidth:640,width:`100%`},children:[(0,j.jsx)(`div`,{style:{padding:`24px 32px`,borderBottom:`1px solid #F0F0F0`}
224,children:(0,j.jsx)(`h2`,{style:{fontWeight:800,fontSize:18,color:`#111`},children:`Full Feature Comparison`})}),(0,j.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`2fr 1fr 1fr 1fr 1fr`,background:`#FAFAFA`,borderBottom:`1px solid #F0F0F0`},children:[(0,j.jsx)(`div`,{style:{padding:`12px 32px`,fontSize:12,fontWeight:700,color:`#9CA3AF`,textTransform:`uppercase`,letterSpacing:`0.06em`},children:`Feature`}),Ll.map(e=>(0,j.jsx)(`div`,{style:{padding:`12px 16px`,fontSize:13,fontWeight:700,color:e.highlight?`#C0392B`:`#374151`,textAlign:`center`},children:e.name},e.name))]}),Ll[0].features.map((e,t)=>(0,j.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`2fr 1fr 1fr 1fr 1fr`,borderBottom:t<Ll[0].features.length-1?`1px solid #F8F8F8`:`none`},children:[(0,j.jsx)(`div`,{style:{padding:`13px 32px`,fontSize:13,color:`#374151`,fontWeight:500},children:e.label}),Ll.map(e=>{let n=e.features[t];return(0,j.jsx)(`div`,{style:{padding:`13px 16px`,textAlign:`center`,fontSize:13},children:n.yes===!0?(0,j.jsx)(`span`,{style:{color:`#16A34A`,fontWeight:700,fontSize:16},children:`â`}):n.yes===!1?(0,j.jsx)(`span`,{style:{color:`#D1D5DB`,fontSize:16},children:`â`}):(0,j.jsx)(`span`,{style:{color:`#374151`,fontSize:12,fontWeight:500},children:n.value})},e.name)})]},e.label))]})}),(0,j.jsx)(`div`,{style:{background:`#fff`,borderRadius:20,border:`2px solid #F0C419`,padding:`32px 40px`,marginBottom:24},children:(0,j.jsxs)(`div`,{style:{display:`flex`,alignItems:`flex-start`,justifyContent:`space-between`,gap:24,flexWrap:`wrap`},children:[(0,j.jsxs)(`div`,{children:[(0,j.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10,marginBottom:8},children:[(0,j.jsx)(`span`,{style:{background:`#F0C419`,color:`#111`,fontSize:11,fontWeight:800,padding:`3px 10px`,borderRadius:999,textTransform:`uppercase`,letterSpacing:`0.05em`},children:`Add-On`}),(0,j.jsx)(`h3`,{style:{fontWeight:800,fontSize:18,color:`#111`},children:`Featured Spotlight`})]}),(0,j.jsxs)(`p`,{style:{fontSize:14,color:`#6B7280`,lineHeight:1.6,maxWidth:540},children:[`Guaranteed homepage featured placement for one week â available to `,(0,j.jsx)(`em`,{children:`any`}),` tier including Free. One-time or recurring purchase. Separate from Elite's included placement.`]}),(0,j.jsx)(`p`,{style:{fontSize:12,color:`#9CA3AF`,marginTop:8},children:`â
Final price confirmed with owner before launch.`})]}),(0,j.jsxs)(`div`,{style:{textAlign:`right`,flexShrink:0},children:[(0,j.jsx)(`div`,{style:{fontSize:13,color:`#9CA3AF`,marginBottom:2},children:`Starting at`}),(0,j.jsx)(`div`,{style:{fontSize:36,fontWeight:900,color:`#111`,lineHeight:1},children:`$25`}),(0,j.jsx)(`div`,{style:{fontSize:12,color:`#9CA3AF`},children:`/ week`}),(0,j.jsx)(A,{to:`/featured-spotlight`,style:{display:`inline-block`,marginTop:12,background:`#F0C419`,color:`#111`,fontWeight:700,fontSize:13,padding:`9px 22px`,borderRadius:999,textDecoration:`none`},children:`Learn More â`})]})]})}),(0,j.jsxs)(`div`,{style:{background:`#111`,borderRadius:20,padding:`32px 40px`,display:`flex`,alignItems:`center`,justifyContent:`space-between`,gap:24,flexWrap:`wrap`},children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`h3`,{style:{fontWeight:800,fontSize:18,color:`#fff`,marginBottom:6},children:`Want to advertise instead?`}),(0,j.jsx)(`p`,{style:{fontSize:14,color:`#9CA3AF`,lineHeight:1.6},children:`Ad placements available for listed businesses and non-listed advertisers at separate rates. Banner, in-feed, and sidebar zones available.`})]}),(0,j.jsx)(A,{to:`/advertise`,style:{background:`#C0392B`,color:`#fff`,fontWeight:700,fontSize:14,padding:`12px 28px`,borderRadius:999,textDecoration:`none`,flexShrink:0,whiteSpace:`nowrap`},children:`Advertise With Us â`})]})]})})]})}function zl({tier:e}){let{name:t,price:n,color:r,badge:i,cta:a,highlight:o,features:s}=e;return(0,j.jsxs)(`div`,{style:{background:o?`#C0392B`:`#fff`,borderRadius:20,border:o?`none`:`1px solid #F0F0F0`,padding:28,display:`flex`,flexDirection:`column`,boxShadow:o?`0 8px 32px rgba(192,57,43,0.22)`:`0 1px 4px rgba(0,0,0,0.04)`,position:`relative`}
224,children:[!o&&(0,j.jsx)(`div`,{style:{position:`absolute`,top:0,left:0,right:0,height:3,background:r,borderRadius:`20px 20px 0 0`}}),i&&(0,j.jsx)(`span`,{style:{display:`inline-block`,background:`#F0C419`,color:`#111`,fontSize:10,fontWeight:800,padding:`3px 10px`,borderRadius:999,textTransform:`uppercase`,letterSpacing:`0.05em`,marginBottom:12,alignSelf:`flex-start`},children:i}),(0,j.jsx)(`div`,{style:{fontSize:16,fontWeight:800,color:o?`#fff`:`#111`,marginBottom:4},children:t}),(0,j.jsxs)(`div`,{style:{marginBottom:20},children:[(0,j.jsx)(`span`,{style:{fontSize:38,fontWeight:900,color:o?`#fff`:`#111`,lineHeight:1},children:n===0?`Free`:`$${n}`}),n>0&&(0,j.jsx)(`span`,{style:{fontSize:13,color:o?`rgba(255,255,255,0.6)`:`#9CA3AF`,marginLeft:4},children:`/mo`})]}),(0,j.jsx)(`ul`,{style:{listStyle:`none`,flex:1,marginBottom:24,display:`flex`,flexDirection:`column`,gap:8},children:s.filter(e=>e.yes!==!1).slice(0,6).map(e=>(0,j.jsxs)(`li`,{style:{display:`flex`,alignItems:`flex-start`,gap:8,fontSize:12,color:o?`rgba(255,255,255,0.85)`:`#374151`},children:[(0,j.jsx)(`span`,{style:{color:o?`#F0C419`:`#16A34A`,fontWeight:700,fontSize:14,lineHeight:1.2,flexShrink:0},children:`â`}),(0,j.jsx)(`span`,{children:e.value&&e.value!==`Full`&&e.value!==`â`?`${e.label} (${e.value})`:e.label})]},e.label))}),(0,j.jsx)(A,{to:`/sign-up`,style:{display:`block`,textAlign:`center`,padding:`11px 0`,borderRadius:999,fontWeight:700,fontSize:14,textDecoration:`none`,background:o?`#F0C419`:`#C0392B`,color:o?`#111`:`#fff`},children:a})]})}function Bl(){return(0,j.jsx)(`div`,{style:{minHeight:`60vh`,display:`flex`,alignItems:`center`,justifyContent:`center`,padding:`80px 24px`},children:(0,j.jsxs)(`div`,{style:{maxWidth:520,textAlign:`center`},children:[(0,j.jsx)(`span`,{style:{fontSize:56,display:`block`,marginBottom:20},children:`ð´`}),(0,j.jsx)(`h1`,{style:{fontSize:32,fontWeight:900,color:`#111`,marginBottom:12},children:`Forums Coming Soon`}),(0,j.jsx)(`p`,{style:{fontSize:15,color:`#6B7280`,lineHeight:1.7,marginBottom:32},children:`The Palm Beach Comm community forums are in development. Check back soon â we're building a space for local conversations, business networking, and neighborhood news.`}),(0,j.jsx)(A,{to:`/`,style:{display:`inline-block`,background:`#C0392B`,color:`#fff`,fontWeight:700,fontSize:14,padding:`12px 28px`,borderRadius:999,textDecoration:`none`},children:`Back to Home`})]})})}function Vl(){let e=yt(),[t,n]=(0,_.useState)({email:``,password:``}),[r,i]=(0,_.useState)(!1),[a,o]=(0,_.useState)(``);function s(e,t){n(n=>({...n,[e]:t}))}async function c(n){n.preventDefault(),o(``),i(!0);let{error:r}=await z.auth.signInWithPassword({email:t.email,password:t.password});if(i(!1),r){o(r.message);return}e(`/`)}return(0,j.jsx)(`div`,{style:{background:`#F9F9F9`,minHeight:`100vh`,display:`flex`,alignItems:`center`,padding:`48px 0`},children:(0,j.jsx)(M,{children:(0,j.jsxs)(`div`,{style:{maxWidth:420,margin:`0 auto`},children:[(0,j.jsxs)(`div`,{style:{textAlign:`center`,marginBottom:32},children:[(0,j.jsx)(`span`,{style:{fontSize:40},children:`ð´`}),(0,j.jsx)(`h1`,{style:{fontSize:26,fontWeight:900,color:`#111`,marginTop:12,marginBottom:6},children:`Welcome back`}),(0,j.jsx)(`p`,{style:{fontSize:14,color:`#6B7280`},children:`Sign in to your Palm Beach Comm account`})]}),(0,j.jsxs)(`div`,{style:{background:`#fff`,borderRadius:20,border:`1px solid #EBEBEB`,padding:`36px 32px`,boxShadow:`0 2px 16px rgba(0,0,0,0.06)`},children:[(0,j.jsxs)(`form`,{onSubmit:c,style:{display:`flex`,flexDirection:`column`,gap:16},children:[(0,j.jsx)(Hl,{label:`Email Address`,type:`email`,value:t.email,onChange:e=>s(`email`,e),placeholder:`[email protected]`}),(0,j.jsx)(Hl,{label:`Password`,type:`password`,value:t.password,onChange:e=>s(`password`,e),placeholder:`â¢â¢â¢â¢â¢â¢â¢â¢`}),a&&(0,j.jsx)(`div`,{style:{background:`#FEF2F2`,border:`1px solid #FECACA`,borderRadius:8,padding:`10px 14px`,fontSize:13,color:`#DC2626`},children:a}),(0,j.jsx)(`button`,{type:`submit`,disabled:r||!t.email||!t.password,style:{padding:`13px`,background:`#C0392B`,color:`#fff`,fontWeight:700,fontSize:15,borderRadius:999,border:`none`,cursor:r?`not-allowed`:`pointer`,o
224pacity:r?.7:1,marginTop:4},children:r?`Signing in...`:`Sign In`})]}),(0,j.jsxs)(`div`,{style:{textAlign:`center`,marginTop:20,fontSize:13,color:`#6B7280`},children:[`Don't have an account?`,` `,(0,j.jsx)(A,{to:`/sign-up`,style:{color:`#C0392B`,fontWeight:700,textDecoration:`none`},children:`Create one free â`})]})]}),(0,j.jsx)(`div`,{style:{textAlign:`center`,marginTop:20},children:(0,j.jsx)(A,{to:`/`,style:{fontSize:13,color:`#9CA3AF`,textDecoration:`none`},children:`â Back to Home`})})]})})})}function Hl({label:e,type:t,value:n,onChange:r,placeholder:i}){return(0,j.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:6},children:[(0,j.jsx)(`label`,{style:{fontSize:12,fontWeight:700,color:`#374151`,textTransform:`uppercase`,letterSpacing:`0.04em`},children:e}),(0,j.jsx)(`input`,{type:t,value:n,onChange:e=>r(e.target.value),placeholder:i,required:!0,style:{padding:`11px 14px`,borderRadius:10,border:`1px solid #E5E7EB`,fontSize:14,color:`#111`,outline:`none`,width:`100%`,boxSizing:`border-box`},onFocus:e=>e.target.style.borderColor=`#C0392B`,onBlur:e=>e.target.style.borderColor=`#E5E7EB`})]})}function Ul(){yt();let[e,t]=(0,_.useState)({full_name:``,email:``,password:``,confirm:``}),[n,r]=(0,_.useState)(!1),[i,a]=(0,_.useState)(``),[o,s]=(0,_.useState)(!1);function c(e,n){t(t=>({...t,[e]:n}))}async function l(t){if(t.preventDefault(),a(``),e.password!==e.confirm){a(`Passwords do not match.`);return}if(e.password.length<6){a(`Password must be at least 6 characters.`);return}r(!0);let{error:n}=await z.auth.signUp({email:e.email,password:e.password,options:{data:{full_name:e.full_name}}});if(r(!1),n){a(n.message);return}s(!0)}return o?(0,j.jsx)(`div`,{style:{background:`#F9F9F9`,minHeight:`100vh`,display:`flex`,alignItems:`center`,padding:`48px 0`},children:(0,j.jsx)(M,{children:(0,j.jsxs)(`div`,{style:{maxWidth:420,margin:`0 auto`,textAlign:`center`},children:[(0,j.jsx)(`span`,{style:{fontSize:56,display:`block`,marginBottom:16},children:`ð`}),(0,j.jsx)(`h1`,{style:{fontSize:24,fontWeight:900,color:`#111`,marginBottom:10},children:`You're in!`}),(0,j.jsx)(`p`,{style:{fontSize:14,color:`#6B7280`,lineHeight:1.7,marginBottom:28},children:`Check your email to confirm your account, then come back and sign in.`}),(0,j.jsx)(A,{to:`/sign-in`,style:{display:`inline-block`,background:`#C0392B`,color:`#fff`,fontWeight:700,fontSize:14,padding:`12px 28px`,borderRadius:999,textDecoration:`none`},children:`Go to Sign In â`})]})})}):(0,j.jsx)(`div`,{style:{background:`#F9F9F9`,minHeight:`100vh`,display:`flex`,alignItems:`center`,padding:`48px 0`},children:(0,j.jsx)(M,{children:(0,j.jsxs)(`div`,{style:{maxWidth:420,margin:`0 auto`},children:[(0,j.jsxs)(`div`,{style:{textAlign:`center`,marginBottom:32},children:[(0,j.jsx)(`span`,{style:{fontSize:40},children:`ð´`}),(0,j.jsx)(`h1`,{style:{fontSize:26,fontWeight:900,color:`#111`,marginTop:12,marginBottom:6},children:`Create your account`}),(0,j.jsx)(`p`,{style:{fontSize:14,color:`#6B7280`},children:`Free to join. Be part of the Palm Beach community.`})]}),(0,j.jsxs)(`div`,{style:{background:`#fff`,borderRadius:20,border:`1px solid #EBEBEB`,padding:`36px 32px`,boxShadow:`0 2px 16px rgba(0,0,0,0.06)`},children:[(0,j.jsxs)(`form`,{onSubmit:l,style:{display:`flex`,flexDirection:`column`,gap:16},children:[(0,j.jsx)(Wl,{label:`Full Name`,type:`text`,value:e.full_name,onChange:e=>c(`full_name`,e),placeholder:`Jane Smith`}),(0,j.jsx)(Wl,{label:`Email Address`,type:`email`,value:e.email,onChange:e=>c(`email`,e),placeholder:`[email protected]`}),(0,j.jsx)(Wl,{label:`Password`,type:`password`,value:e.password,onChange:e=>c(`password`,e),placeholder:`Min. 6 characters`}),(0,j.jsx)(Wl,{label:`Confirm Password`,type:`password`,value:e.confirm,onChange:e=>c(`confirm`,e),placeholder:`â¢â¢â¢â¢â¢â¢â¢â¢`}),i&&(0,j.jsx)(`div`,{style:{background:`#FEF2F2`,border:`1px solid #FECACA`,borderRadius:8,padding:`10px 14px`,fontSize:13,color:`#DC2626`},children:i}),(0,j.jsx)(`button`,{type:`submit`,disabled:n||!e.email||!e.password||!e.full_name,style:{padding:`13px`,background:`#C0392B`,color:`#fff`,fontWeight:700,fontSize:15,borderRadius:999,border:`none`,cursor:n?`not-allowed`:`pointer`,o
224pacity:n?.7:1,marginTop:4},children:n?`Creating account...`:`Create Free Account`}),(0,j.jsx)(`p`,{style:{fontSize:11,color:`#9CA3AF`,textAlign:`center`,lineHeight:1.5},children:`By signing up you agree to our Terms of Service and Privacy Policy.`})]}),(0,j.jsxs)(`div`,{style:{textAlign:`center`,marginTop:16,fontSize:13,color:`#6B7280`},children:[`Already have an account?`,` `,(0,j.jsx)(A,{to:`/sign-in`,style:{color:`#C0392B`,fontWeight:700,textDecoration:`none`},children:`Sign in â`})]})]}),(0,j.jsx)(`div`,{style:{textAlign:`center`,marginTop:20},children:(0,j.jsx)(A,{to:`/`,style:{fontSize:13,color:`#9CA3AF`,textDecoration:`none`},children:`â Back to Home`})})]})})})}function Wl({label:e,type:t,value:n,onChange:r,placeholder:i}){return(0,j.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:6},children:[(0,j.jsx)(`label`,{style:{fontSize:12,fontWeight:700,color:`#374151`,textTransform:`uppercase`,letterSpacing:`0.04em`},children:e}),(0,j.jsx)(`input`,{type:t,value:n,onChange:e=>r(e.target.value),placeholder:i,required:!0,style:{padding:`11px 14px`,borderRadius:10,border:`1px solid #E5E7EB`,fontSize:14,color:`#111`,outline:`none`,width:`100%`,boxSizing:`border-box`},onFocus:e=>e.target.style.borderColor=`#C0392B`,onBlur:e=>e.target.style.borderColor=`#E5E7EB`})]})}var V=[{key:`free`,label:`Free`,price:`$0/mo`,color:`#6B7280`,features:[`Basic directory listing`,`Name, category, address`,`Customer reviews`]},{key:`basic`,label:`Basic`,price:`$20/mo`,color:`#3B82F6`,features:[`Everything in Free`,`5 photos`,`1 event/month`,`Website & social links`,`Profile views analytics`]},{key:`pro`,label:`Pro`,price:`$40/mo`,color:`#C0392B`,features:[`Everything in Basic`,`15 photos`,`5 events/month`,`Products & promotions`,`Rotation pool + priority search`,`Views + clicks analytics`,`Verified / Top Rated badge`]},{key:`elite`,label:`Elite`,price:`$70/mo`,color:`#F59E0B`,features:[`Everything in Pro`,`Unlimited photos & events`,`Guaranteed homepage top slot`,`Full analytics breakdown`,`Custom gold badge`]}];function Gl(){let e=yt(),t=cr()<768,[n,r]=(0,_.useState)(null),[i,a]=(0,_.useState)(!0),[o,s]=(0,_.useState)(!1),[c,l]=(0,_.useState)(``),[u,d]=(0,_.useState)(!1),[f,p]=(0,_.useState)(``);(0,_.useEffect)(()=>{z.auth.getSession().then(({data:t})=>{if(!t.session){e(`/sign-in`);return}r(t.session.user),l(t.session.user.user_metadata?.full_name||``),a(!1)})},[e]);async function m(e){e.preventDefault(),d(!0);let{error:t}=await z.auth.updateUser({data:{full_name:c}});d(!1),t||(p(`Saved!`),s(!1),setTimeout(()=>p(``),3e3))}async function h(){await z.auth.signOut(),e(`/`)}if(i)return(0,j.jsx)(`div`,{style:{textAlign:`center`,padding:`80px 0`,color:`#9CA3AF`},children:`Loading...`});let g=n.user_metadata?.full_name||n.email?.split(`@`)[0]||`Member`,v=new Date(n.created_at).toLocaleDateString(`en-US`,{month:`long`,year:`numeric`});return(0,j.jsx)(`div`,{style:{background:`#F9F9F9`,minHeight:`100vh`,padding:`40px 0`},children:(0,j.jsx)(M,{children:(0,j.jsxs)(`div`,{style:{maxWidth:720,margin:`0 auto`},children:[(0,j.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:20,marginBottom:32,flexWrap:`wrap`},children:[(0,j.jsx)(`div`,{style:{width:64,height:64,borderRadius:`50%`,background:`#C0392B`,color:`#fff`,fontSize:26,fontWeight:900,display:`flex`,alignItems:`center`,justifyContent:`center`,flexShrink:0},children:g[0]?.toUpperCase()}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`h1`,{style:{fontSize:22,fontWeight:900,color:`#111`,marginBottom:2},children:g}),(0,j.jsxs)(`p`,{style:{fontSize:13,color:`#9CA3AF`},children:[`Member since `,v]})]})]}),(0,j.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:20},children:[(0,j.jsxs)(H,{title:`Contact Information`,children:[(0,j.jsx)(U,{label:`Email`,value:n.email}),(0,j.jsx)(U,{label:`Email Confirmed`,value:n.email_confirmed_at?`â
Confirmed`:`â³ Check your inbox to confirm`}),(0,j.jsxs)(`div`,{style:{marginTop:16,borderTop:`1px solid #F3F4F6`,paddingTop:16},children:[o?(0,j.jsxs)(`form`,{onSubmit:m,style:{display:`flex`,gap:10,alignItems:`center`,flexWrap:`wrap`},children:[(0,j.jsx)(`input`,{value:c,onChange:e=>l(e.target.value),placeholder:`Full name`,style:{flex:1,minWidth:180,padding:`9px 14px`,borderRadius:10,border:`1px solid #E5E7EB`,fontSize:14,color:`#111`,outline:`none`},onFocus:e=>e.target.style.borderColor=`#C0392B`,onBlur:e=>e.target.style.borderColor=`#E5E7EB`}),(0,j.jsx)(`button`,{type:`submit`,disabled:u,style:{padding:`9px 20px`,background:`#C0392B`,color:`#fff`,fontWeight:700,fontSize:13,borderRadius:999,border:`none`,cursor:`pointer`},children:u?`Saving...`:`Save`}),(0,j.jsx)(`button`,{type:`button`,onClick:()=>s(!1),style:{padding:`9px 16px`,background:`#F3F4F6`,color:`#374151`,fontWeight:600,fontSize:13,borderRadius:999,border:`none`,cursor:`pointer`},children:`Cancel`})]}):(0,j.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,flexWrap:`wrap`,gap:8},children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`span`,{style:{fontSize:12,fontWeight:700,color:`#9CA3AF`,textTransform:`uppercase`,letterSpacing:`0.04em`},children:`Display Name`}),(0,j.jsx)(`p`,{style:{fontSize:15,color:`#111`,fontWeight:600,marginTop:2},children:g})]}),(0,j.jsx)(`button`,{onClick:()=>s(!0),style:{padding:`7px 16px`,background:`#F3F4F6`,color:`#374151`,fontWeight:600,fontSize:13,borderRadius:999,border:`none`,cursor:`pointer`},children:`Edit Name`})]}),f&&(0,j.jsx)(`p`,{style:{fontSize:13,color:`#16A34A`,marginTop:8},children:f})]})]}),(0,j.jsxs)(H,{title:`Your Plan`,children:[(0,j.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,flexWrap:`wrap`,gap:12},children:[(0,j.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12},children:[(0,j.jsx)(`div`,{style:{padding:`6px 16px`,borderRadius:999,background:`#F3F4F6`,fontWeight:800,fontSize:14,color:`#374151`},children:`Free Plan`}),(0,j.jsx)(`span`,{style:{fontSize:13,color:`#9CA3AF`},children:`$0/month`})]}),(0,j.jsx)(A,{to:`/pricing`,style:{padding:`9px 20px`,background:`#C0392B`,color:`#fff`,fontWeight:700,fontSize:13,borderRadius:999,textDecoration:`none`},children:`Upgrade Plan â`})]}),(0,j.jsx)(`p`,{style:{fontSize:13,color:`#6B7280`,marginTop:12,lineHeight:1.6},children:`Upgrade to Basic, Pro, or Elite to unlock photos, events, analytics, featured placement, and more.`})]}),(0,j.jsxs)(H,{title:`Available Plans`,children:[(0,j.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:t?`1fr 1fr`:`repeat(4, 1fr)`,gap:12},children:V.map(e=>(0,j.jsxs)(`div`,{style:{border:`2px solid ${e.color}22`,borderRadius:14,padding:`16px 14px`,background:`#fff`},children:[(0,j.jsx)(`div`,{style:{fontWeight:800,fontSize:14,color:e.color,marginBottom:4},children:e.label}),(0,j.jsx)(`div`,{style:{fontSize:13,fontWeight:700,color:`#111`,marginBottom:10},children:e.price}),e.features.map((e,t)=>(0,j.jsxs)(`div`,{style:{fontSize:11,color:`#6B7280`,lineHeight:1.6},children:[`â `,e]},t)),e.key!==`free`&&(0,j.jsx)(A,{to:`/pricing`,style:{display:`block`,marginTop:12,textAlign:`center`,padding:`7px 0`,background:e.color,color:`#fff`,fontWeight:700,fontSize:12,borderRadius:999,textDecoration:`none`},children:`Select`})]},e.key))}),(0,j.jsxs)(`p`,{style:{fontSize:12,color:`#9CA3AF`,marginTop:12},children:[`To change or cancel your plan, contact us at `,(0,j.jsx)(`a`,{href:`mailto:[email protected]`,style:{color:`#C0392B`},children:`[email protected]`})]})]}),(0,j.jsxs)(H,{title:`Account Security`,children:[(0,j.jsx)(U,{label:`Account ID`,value:n.id,mono:!0}),(0,j.jsxs)(`div`,{style:{marginTop:16,borderTop:`1px solid #F3F4F6`,paddingTop:16},children:[(0,j.jsx)(`p`,{style:{fontSize:13,color:`#6B7280`,marginBottom:12},children:`Need to change your password? We'll send a reset link to your email.`}),(0,j.jsx)(`button`,{onClick:async()=>{await z.auth.resetPasswordForEmail(n.email),alert(`Password reset email sent. Check your inbox.`)},style:{padding:`9px 20px`,background:`#F3F4F6`,color:`#374151`,fontWeight:700,fontSize:13,borderRadius:999,border:`none`,cursor:`pointer`},children:`Send Password Reset Email`})]})]}),(0,j.jsx)(`div`,{style:{textAlign:`center`,paddingBottom:20},children:(0,j.jsx)(`button`,{onClick:h,style:{padding:`10px 28px`,background:`none`,border:`1px solid #E5E7EB`,color:`#6B7280`,fontWeight:600,fontSize:13,borderRadius:999,cursor:`pointer`},children:`Sign Out`})})]})]})})})}function H({title:e,children:t}){return(0,j.jsxs)(`div`,{style:{background:`#fff`,borderRadius:20,border:`1px solid #EBEBEB`,padding:28},children:[(0,j.jsx)(`h2`,{style:{fontSize:14,fontWeight:800,color:`#111`,textTransform:`uppercase`,letterSpacing:`0.06em`,marginBottom:20,paddingBottom:12,borderBottom:`1px solid #F3F4F6`},children:e}),t]})}function U({label:e,value:t,mono:n}){return(0,j.jsxs)(`div`,{style:{marginBottom:12},children:[(0,j.jsx)(`span`,{style:{fontSize:12,fontWeight:700,color:`#9CA3AF`,textTransform:`uppercase`,letterSpacing:`0.04em`,display:`block`,marginBottom:2},children:e}),(0,j.jsx)(`span`,{style:{fontSize:n?11:14,color:`#374151`,fontFamily:n?`monospace`:`inherit`,wordBreak:`break-all`},children:t})]})}var Kl=[{page:`Homepage`,icon:`ð `,zones:[{name:`Homepage Banner â Top`,size:`728Ã90 or 320Ã50 (mobile)`,weekly:75,monthly:250,note:`First thing visitors see`},{name:`Homepage Mid-Page`,size:`300Ã250`,weekly:50,monthly:175,note:`Below featured businesses`}]},{page:`Business Directory`,icon:`ð¢`,zones:[{name:`Directory â Top Banner`,size:`728Ã90 or 320Ã50 (mobile)`,weekly:60,monthly:200,note:`Above all search results`},{name:`Directory â Mid Feed`,size:`300Ã250`,weekly:40,monthly:140,note:`Between listing rows`},{name:`Directory â Bottom`,size:`728Ã90`,weekly:30,monthly:100,note:`Footer of results page`}]},{page:`Events Page`,icon:`ð
`,zones:[{name:`Events â Top Banner`,size:`728Ã90 or 320Ã50 (mobile)`,weekly:60,monthly:200,note:`Above event listings`},{name:`Events â Mid Feed`,size:`300Ã250`,weekly:40,monthly:140,note:`Between event groups`},{name:`Events â Bottom`,size:`728Ã90`,weekly:30,monthly:100,note:`Footer of events page`}]},{page:`Business Profile Sidebar`,icon:`ð`,zones:[{name:`Profile Sidebar Ad`,size:`300Ã250`,weekly:50,monthly:175,note:`Shows on every business profile page`}]}],ql=[{label:`Accepted Formats`,value:`JPG, PNG, GIF (static only), WebP`},{label:`Max File Size`,value:`500 KB`},{label:`Standard Sizes`,value:`728Ã90 (leaderboard), 300Ã250 (medium rectangle), 320Ã50 (mobile banner)`},{label:`Link Destination`,value:`Any URL â your website, social page, event registration, etc.`},{label:`Approval`,value:`All ads reviewed within 1 business day before going live`},{label:`Turnaround`,value:`Ads go live within 24â48 hours of approval`}],Jl=[{n:`1`,title:`Contact Us`,body:`Email [email protected] with the zone(s) you want, your desired dates, and your ad creative (image + destination URL).`},{n:`2`,title:`We Review & Confirm`,body:`Our team reviews your ad for content guidelines and confirms availability. You'll hear back within 1 business day.`},{n:`3`,title:`Go Live`,body:`Once approved and payment is received, your ad goes live on the scheduled date. You'll receive a confirmation email.`}];function Yl(){let e=cr()<768;return(0,j.jsxs)(`div`,{style:{background:`#F9F9F9`,minHeight:`100vh`},children:[(0,j.jsxs)(`div`,{style:{position:`relative`,padding:e?`52px 0 44px`:`72px 0 60px`,overflow:`hidden`,background:`#C0392B`},children:[(0,j.jsx)(`div`,{style:{position:`absolute`,inset:0,display:`grid`,gridTemplateColumns:e?`repeat(3, 1fr)`:`repeat(6, 1fr)`,gridTemplateRows:`1fr`,gap:0,pointerEvents:`none`},children:[`https://images.unsplash.com/photo-1551288049-bebda4e38f71?w=500&q=80`,`https://images.unsplash.com/photo-1758921006011-ce8365eb57a6?w=500&q=80`,`https://images.unsplash.com/photo-1540575467063-178a50c2df87?w=500&q=80`,`https://images.unsplash.com/photo-1523580494863-6f3031224c94?w=500&q=80`,`https://images.unsplash.com/photo-1507525428034-b723cf961d3e?w=500&q=80`,`https://images.unsplash.com/photo-1414235077428-338989a2e8c0?w=500&q=80`].map((e,t)=>(0,j.jsx)(`img`,{src:e,alt:``,style:{width:`100%`,height:`100%`,objectFit:`cover`,display:`block`}},t))}),(0,j.jsx)(`div`,{style:{position:`absolute`,inset:0,background:`linear-gradient(135deg, rgba(192,57,43,0.82) 0%, rgba(150,40,27,0.78) 100%)`,pointerEvents:`none`}}),(0,j.jsx)(M,{style:{position:`relative`,zIndex:1},children:(0,j.jsxs)(`div`,{style:{maxWidth:640,margin:`0 auto`,textAlign:`center`,position:`relative`,zIndex:1},children:[(0,j.jsx)(`div`,{style:{display:`inline-block`,background:`rgba(255,255,255,0.15)`,borderRadius:999,padding:`5px 18px`,fontSize:12,fontWeight:700,color:`#fff`,letterSpacing:`0.06em`,textTransform:`uppercase`,marginBottom:20}
224,children:`Advertise With Us`}),(0,j.jsxs)(`h1`,{style:{fontSize:e?30:42,fontWeight:900,color:`#fff`,lineHeight:1.15,marginBottom:16},children:[`Reach Thousands of`,(0,j.jsx)(`br`,{}),`Palm Beach County Residents`]}),(0,j.jsx)(`p`,{style:{fontSize:e?14:16,color:`rgba(255,255,255,0.85)`,lineHeight:1.7,marginBottom:32},children:`Palm Beach Comm is the go-to local directory for businesses, events, and community resources in Palm Beach County. Put your brand in front of people actively searching for what you offer.`}),(0,j.jsx)(`a`,{href:`mailto:[email protected]?subject=Advertising%20Inquiry`,style:{display:`inline-block`,background:`#F0C419`,color:`#111`,fontWeight:800,fontSize:15,padding:`14px 36px`,borderRadius:999,textDecoration:`none`},children:`Get Started â Email Us â`})]})})]}),(0,j.jsx)(`div`,{style:{background:`#fff`,borderBottom:`1px solid #EBEBEB`},children:(0,j.jsx)(M,{children:(0,j.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:e?`repeat(2,1fr)`:`repeat(4,1fr)`,padding:`28px 0`,textAlign:`center`},children:[[`Growing`,`Listed Businesses`],[`15`,`Business Categories`],[`100%`,`Locally Owned`],[`PBC`,`County-Wide Coverage`]].map(([e,t])=>(0,j.jsxs)(`div`,{style:{padding:`12px 0`,borderRight:`1px solid #F3F4F6`},children:[(0,j.jsx)(`div`,{style:{fontSize:26,fontWeight:900,color:`#C0392B`},children:e}),(0,j.jsx)(`div`,{style:{fontSize:12,color:`#9CA3AF`,marginTop:2},children:t})]},t))})})}),(0,j.jsx)(M,{children:(0,j.jsxs)(`div`,{style:{padding:`52px 0`,display:`flex`,flexDirection:`column`,gap:48},children:[(0,j.jsxs)(`section`,{children:[(0,j.jsx)(Xl,{title:`Ad Zones & Pricing`,subtitle:`Choose the pages and placements that match your audience.`}),(0,j.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:28},children:Kl.map(e=>(0,j.jsxs)(`div`,{style:{background:`#fff`,borderRadius:20,border:`1px solid #EBEBEB`,overflow:`hidden`},children:[(0,j.jsxs)(`div`,{style:{padding:`16px 24px`,background:`#FAFAFA`,borderBottom:`1px solid #EBEBEB`,display:`flex`,alignItems:`center`,gap:10},children:[(0,j.jsx)(`span`,{style:{fontSize:20},children:e.icon}),(0,j.jsx)(`span`,{style:{fontSize:15,fontWeight:800,color:`#111`},children:e.page})]}),(0,j.jsx)(`div`,{style:{overflowX:`auto`,WebkitOverflowScrolling:`touch`},children:(0,j.jsxs)(`table`,{style:{width:`100%`,borderCollapse:`collapse`,minWidth:520},children:[(0,j.jsx)(`thead`,{children:(0,j.jsx)(`tr`,{style:{background:`#F9F9F9`},children:[`Placement`,`Ad Size`,`Weekly`,`Monthly`,`Notes`].map(e=>(0,j.jsx)(`th`,{style:{padding:`10px 16px`,textAlign:`left`,fontSize:11,fontWeight:700,color:`#9CA3AF`,textTransform:`uppercase`,letterSpacing:`0.04em`,borderBottom:`1px solid #EBEBEB`},children:e},e))})}),(0,j.jsx)(`tbody`,{children:e.zones.map((t,n)=>(0,j.jsxs)(`tr`,{style:{borderBottom:n<e.zones.length-1?`1px solid #F5F5F5`:`none`},children:[(0,j.jsx)(`td`,{style:{padding:`14px 16px`,fontSize:13,fontWeight:700,color:`#111`},children:t.name}),(0,j.jsx)(`td`,{style:{padding:`14px 16px`,fontSize:12,color:`#6B7280`,fontFamily:`monospace`},children:t.size}),(0,j.jsxs)(`td`,{style:{padding:`14px 16px`,fontSize:13,fontWeight:800,color:`#C0392B`},children:[`$`,t.weekly]}),(0,j.jsxs)(`td`,{style:{padding:`14px 16px`,fontSize:13,fontWeight:800,color:`#C0392B`},children:[`$`,t.monthly]}),(0,j.jsx)(`td`,{style:{padding:`14px 16px`,fontSize:12,color:`#9CA3AF`},children:t.note})]},n))})]})})]},e.page))})]}),(0,j.jsxs)(`section`,{children:[(0,j.jsx)(Xl,{title:`How It Works`,subtitle:`Simple 3-step process to get your ad live.`}),(0,j.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:e?`1fr`:`repeat(3,1fr)`,gap:20},children:Jl.map(e=>(0,j.jsxs)(`div`,{style:{background:`#fff`,borderRadius:20,border:`1px solid #EBEBEB`,padding:28},children:[(0,j.jsx)(`div`,{style:{width:40,height:40,borderRadius:`50%`,background:`#C0392B`,color:`#fff`,fontWeight:900,fontSize:18,display:`flex`,alignItems:`center`,justifyContent:`center`,marginBottom:16},children:e.n}),(0,j.jsx)(`h3`,{style:{fontSize:15,fontWeight:800,color:`#111`,marginBottom:8},children:e.title}),(0,j.jsx)(`p`,{style:{fontSize:13,color:`#6B7280`,lineHeight:1.7},children:e.body})]},e.n))})]}),(0,j.jsxs)(`section`,{children:[(0,j.jsx)(Xl,{title:`Ad Specifications`,subtitle:`Make sure your creative meets these requirements.`}),(0,j.jsx)(`div`,{style:{background:`#fff`,borderRadius:20,border:`1px solid #EBEBEB`,padding:28},children:(0,j.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:0},children:ql.map((e,t)=>(0,j.jsxs)(`div`,{style:{display:`flex`,gap:20,padding:`14px 0`,borderBottom:t<ql.length-1?`1px solid #F5F5F5`:`none`,flexWrap:`wrap`},children:[(0,j.jsx)(`div`,{style:{width:180,flexShrink:0,fontSize:13,fontWeight:700,color:`#374151`},children:e.label}),(0,j.jsx)(`div`,{style:{fontSize:13,color:`#6B7280`,flex:1},children:e.value})]},e.label))})})]}),(0,j.jsx)(`section`,{children:(0,j.jsxs)(`div`,{style:{background:`#111`,borderRadius:24,padding:e?`40px 24px`:`52px 48px`,textAlign:`center`},children:[(0,j.jsx)(`h2`,{style:{fontSize:e?24:32,fontWeight:900,color:`#fff`,marginBottom:12}
224,children:`Ready to Advertise?`}),(0,j.jsx)(`p`,{style:{fontSize:14,color:`rgba(255,255,255,0.65)`,lineHeight:1.7,marginBottom:28,maxWidth:480,margin:`0 auto 28px`},children:`Email us with the zone you want, your ad image, and your target URL. We'll get back to you within 1 business day.`}),(0,j.jsx)(`a`,{href:`mailto:[email protected]?subject=Advertising%20Inquiry`,style:{display:`inline-block`,background:`#F0C419`,color:`#111`,fontWeight:800,fontSize:15,padding:`14px 36px`,borderRadius:999,textDecoration:`none`},children:`[email protected] â`}),(0,j.jsx)(`p`,{style:{fontSize:12,color:`rgba(255,255,255,0.35)`,marginTop:20},children:`All ads subject to content review. We reserve the right to decline ads that don't meet our community guidelines.`})]})}),(0,j.jsxs)(`div`,{style:{background:`#FFFBEB`,border:`1px solid #FDE68A`,borderRadius:12,padding:`16px 20px`,textAlign:`center`,fontSize:13,color:`#92400E`,lineHeight:1.6},children:[`ð° `,(0,j.jsx)(`strong`,{children:`Refer a business, earn 15%`}),` commission on their first year. `,(0,j.jsx)(A,{to:`/contact`,style:{color:`#92400E`,fontWeight:700,textDecoration:`underline`},children:`Contact us to learn more â`})]})]})})]})}function Xl({title:e,subtitle:t}){return(0,j.jsxs)(`div`,{style:{marginBottom:24},children:[(0,j.jsx)(`h2`,{style:{fontSize:22,fontWeight:900,color:`#111`,marginBottom:6},children:e}),(0,j.jsx)(`p`,{style:{fontSize:14,color:`#9CA3AF`},children:t})]})}function Zl(){let[e,t]=(0,_.useState)([]);(0,_.useEffect)(()=>{async function e(){let{data:e}=await z.from(`resources`).select(`*`).eq(`featured`,!0).limit(3);t(e||[])}e()},[]);let n=[`https://images.unsplash.com/photo-1427504494785-cdccb16203e7?w=600&q=80`,`https://images.unsplash.com/photo-1552664730-d307ca884978?w=600&q=80`,`https://images.unsplash.com/photo-1491841573634-28be979cc31e?w=600&q=80`];return e.length===0?(0,j.jsx)(`div`,{style:{textAlign:`center`,padding:40,color:`#9CA3AF`},children:(0,j.jsx)(`p`,{style:{fontSize:14},children:`No featured resources yet.`})}):(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(auto-fit, minmax(320px, 1fr))`,gap:24,marginBottom:40},children:e.map((e,t)=>(0,j.jsx)(A,{to:`/resources/${e.id}`,style:{textDecoration:`none`},children:(0,j.jsxs)(`div`,{style:{background:`#fff`,borderRadius:16,border:`1px solid #EBEBEB`,overflow:`hidden`,transition:`all 0.3s ease`,cursor:`pointer`,height:`100%`,display:`flex`,flexDirection:`column`},onMouseEnter:e=>e.currentTarget.style.boxShadow=`0 12px 32px rgba(0,0,0,0.1)`,onMouseLeave:e=>e.currentTarget.style.boxShadow=`none`,children:[(0,j.jsx)(`img`,{src:n[t%n.length],alt:e.title,style:{width:`100%`,height:200,objectFit:`cover`}}),(0,j.jsxs)(`div`,{style:{padding:20,flex:1,display:`flex`,flexDirection:`column`},children:[(0,j.jsx)(`div`,{style:{display:`inline-block`,background:`#EEF2FF`,color:`#4F46E5`,padding:`4px 12px`,borderRadius:999,fontSize:11,fontWeight:700,marginBottom:12,width:`fit-content`},children:e.category||`Resource`}),(0,j.jsx)(`h3`,{style:{fontSize:16,fontWeight:800,color:`#111`,marginBottom:8,lineHeight:1.3},children:e.title}),(0,j.jsxs)(`p`,{style:{fontSize:13,color:`#6B7280`,lineHeight:1.6,flex:1},children:[e.description?.substring(0,100),`...`]}),(0,j.jsx)(`div`,{style:{color:`#4F46E5`,fontWeight:700,fontSize:13,marginTop:12},children:`View Details â`})]})]})},e.id))}),e.length>0&&(0,j.jsxs)(`div`,{style:{background:`linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%)`,borderRadius:16,padding:40,marginBottom:40,display:`grid`,gridTemplateColumns:`1fr 1fr`,gap:40,alignItems:`center`,overflow:`hidden`,position:`relative`},children:[(0,j.jsx)(`div`,{style:{position:`absolute`,right:0,top:0,width:`50%`,height:`100%`,backgroundImage:`url(https://images.unsplash.com/photo-1552664730-d307ca884978?w=800&q=80)`,backgroundSize:`cover`,backgroundPosition:`center`,opacity:.15,pointerEvents:`none`}}),(0,j.jsxs)(`div`,{style:{position:`relative`,zIndex:1,color:`#fff`},children:[(0,j.jsx)(`h2`,{style:{fontSize:28,fontWeight:900,marginBottom:12},children:`Resources for Your Community`}),(0,j.jsx)(`p`,{style:{fontSize:15,lineHeight:1.7,marginBottom:20,opacity:.9},children:`Find local support, guides, and information to help you thrive in Palm Beach County.`}),(0,j.jsx)(`a`,{href:`/resources`,style:{display:`inline-block`,background:`#fff`,color:`#4F46E5`,fontWeight:700,fontSize:14,padding:`12px 28px`,borderRadius:999,textDecoration:`none`,transition:`transform 0.2s`},onMouseEnter:e=>e.target.style.transform=`scale(1.05)`,onMouseLeave:e=>e.target.style.transform=`scale(1)`,children:`Explore All Resources â`})]})]})]})}var Ql=[`All`,`Housing`,`Food & Nutrition`,`Health & Wellness`,`Youth & Families`,`Education`,`Senior Services`,`Mental Health`,`Giveaways & Free Items`],$l={Housing:`ð `,"Food & Nutrition":`ð¥`,"Health & Wellness":`â¤ï¸`,"Youth & Families":`ð¨âð©âð§`,Education:`ð`,"Senior Services":`ð¤`,"Mental Health":`ð§ `,"Giveaways & Free Items":`ð`},eu={Housing:`#3B82F6`,"Food & Nutrition":`#16A34A`,"Health & Wellness":`#C0392B`,"Youth & Families":`#7C3AED`,Education:`#D97706`,"Senior Services":`#0891B2`,"Mental Health":`#DB2777`,"Giveaways & Free Items":`#F59E0B`},tu=[{id:`1`,title:`Emergency Rental Assistance`,organization:`Palm Beach County Housing Authority`,category:`Housing`,description:`Financial assistance for residents facing eviction or unable to pay rent due to hardship. Applications accepted monthly.`,phone:`(561) 655-8230`,website_url:`https://www.pbcgov.org`,address:`3432 W Belvedere Rd`,city:`West Palm Beach`},{id:`2`,title:`Community Food Pantry`,organization:`Feeding South Florida`,category:`Food & Nutrition`,description:`Free groceries and prepared meals for Palm Beach County residents in need. No income verification required. Open Tue & Thu.`,phone:`(561) 243-3500`,website_url:`https://feedingsouthflorida.org`,address:`2501 SW 32nd Terrace`,city:`West Palm Beach`},{id:`3`,title:`Youth Mentorship Program`,organization:`Urban League of Palm Beach County`,category:`Youth & Families`,description:`Connecting at-risk y
224outh ages 10â18 with mentors, job training, and academic support services throughout the county.`,phone:`(561) 833-1461`,website_url:`https://ulpbc.org`,city:`West Palm Beach`},{id:`4`,title:`Free Health Screenings`,organization:`JFK North Medical Center`,category:`Health & Wellness`,description:`Monthly free health screenings including blood pressure, diabetes, and cholesterol checks. No appointment needed.`,phone:`(561) 840-6205`,city:`West Palm Beach`},{id:`5`,title:`Adult Literacy & GED Classes`,organization:`Palm Beach County Library System`,category:`Education`,description:`Free adult education classes including GED prep, basic literacy, English as a second language, and computer skills.`,phone:`(561) 233-2600`,website_url:`https://www.pbclibrary.org`,city:`Multiple Locations`},{id:`6`,title:`Senior Meal Delivery`,organization:`Area Agency on Aging - PBC`,category:`Senior Services`,description:`Hot meal delivery for homebound seniors 60 and older. Nutritious meals delivered to your door MondayâFriday at no cost.`,phone:`(561) 684-5885`,website_url:`https://www.aaa-pbc.org`,city:`Palm Beach County`},{id:`7`,title:`Back-to-School Backpack Drive`,organization:`The Bynes Company Office Solutions`,category:`Giveaways & Free Items`,description:`Free backpacks and school supplies for Kâ12 students. First come, first served. Sponsored by local businesses.`,city:`West Palm Beach`},{id:`8`,title:`Crisis & Suicide Hotline`,organization:`Crisis Line of Palm Beach County`,category:`Mental Health`,description:`24/7 confidential crisis support for individuals experiencing emotional distress, suicidal thoughts, or mental health emergencies.`,phone:`(561) 383-1988`,website_url:`https://www.crisislineofpbc.org`,city:`Serving All of PBC`}];function nu(){let e=cr()<768,[t,n]=(0,_.useState)(tu),[r,i]=(0,_.useState)(`All`),[a,o]=(0,_.useState)(``);(0,_.useEffect)(()=>{`https://fzyvowthczazgirfursb.supabase.co`.includes(`placeholder`)||z.from(`resources`).select(`*`).eq(`active`,!0).order(`category`).then(({data:e})=>{e?.length&&n(e)})},[]);let s=t.filter(e=>{let t=r===`All`||e.category===r,n=!a||e.title.toLowerCase().includes(a.toLowerCase())||e.organization.toLowerCase().includes(a.toLowerCase())||e.description?.toLowerCase().includes(a.toLowerCase());return t&&n}).sort((e,t)=>e.featured_on_listing===t.featured_on_listing?0:e.featured_on_listing?-1:1);return(0,j.jsxs)(`div`,{style:{background:`#F9F9F9`,minHeight:`100vh`},children:[(0,j.jsxs)(`div`,{style:{position:`relative`,overflow:`hidden`,background:`#C0392B`,padding:e?`44px 0 36px`:`60px 0 48px`},children:[(0,j.jsx)(`div`,{style:{position:`absolute`,inset:0,display:`grid`,gridTemplateColumns:e?`repeat(3, 1fr)`:`repeat(6, 1fr)`,gridTemplateRows:`1fr`,gap:0,pointerEvents:`none`},children:[`https://images.unsplash.com/photo-1599059813005-11265ba4b4ce?w=500&q=80`,`https://images.unsplash.com/photo-1555396273-367ea4eb4db5?w=500&q=80`,`https://images.unsplash.com/photo-1507525428034-b723cf961d3e?w=500&q=80`,`https://images.unsplash.com/photo-1491438590914-bc09fcaaf77a?w=500&q=80`,`https://images.unsplash.com/photo-1540575467063-178a50c2df87?w=500&q=80`,`https://images.unsplash.com/photo-1511578314322-379afb476865?w=500&q=80`].map((e,t)=>(0,j.jsx)(`img`,{src:e,alt:``,style:{width:`100%`,height:`100%`,objectFit:`cover`,display:`block`}},t))}),(0,j.jsx)(`div`,{style:{position:`absolute`,inset:0,background:`linear-gradient(135deg, rgba(192,57,43,0.82) 0%, rgba(150,40,27,0.78) 100%)`,pointerEvents:`none`}}),(0,j.jsx)(M,{style:{position:`relative`,zIndex:1},children:(0,j.jsxs)(`div`,{style:{maxWidth:600},children:[(0,j.jsx)(`div`,{style:{display:`inline-block`,background:`rgba(255,255,255,0.15)`,borderRadius:999,padding:`4px 16px`,fontSize:11,fontWeight:700,color:`#fff`,letterSpacing:`0.06em`,textTransform:`uppercase`,marginBottom:16},children:`Community Resources`}),(0,j.jsx)(`h1`,{style:{fontSize:e?28:38,fontWeight:900,color:`#fff`,lineHeight:1.15,marginBottom:12},children:`Help Is Here for Palm Beach County Residents`}),(0,j.jsx)(`p`,{style:{fontSize:14,color:`rgba(255,255,255,0.85)`,lineHeight:1.7,marginBottom:24},children:`Find local organizations offering housing assistance, food, healthcare, education, and more â all free or low-cost.`}),(0,j.jsx)(`input`,{type:`text`,value:a,onChange:e=>o(e.target.value),placeholder:`Search resources or organizations...`,style:{width:`100%`,maxWidth:460,padding:`12px 18px`,borderRadius:999,border:`none`,fontSize:14,color:`#111`,outline:`none`,boxSizing:`border-box`,boxShadow:`0 4px 20px rgba(0,0,0,0.2)`}})]})})]}),(0,j.jsx)(B,{zone:`resources-top`}),(0,j.jsx)(M,{children:(0,j.jsxs)(`div`,{style:{padding:`36px 0 52px`},children:[(0,j.jsxs)(`div`,{style:{marginBottom:52},children:[(0,j.jsx)(`h2`,{style:{fontSize:22,fontWeight:900,color:`#111`,marginBottom:28},children:`Featured Resources`}),(0,j.jsx)(Zl,{})]}),(0,j.jsx)(`div`,{style:{display:`flex`,gap:8,flexWrap:`wrap`,marginBottom:32},children:Ql.map(e=>{let t=e===r,n=eu[e]||`#C0392B`;return(0,j.jsxs)(`button`,{onClick:()=>i(e),style:{padding:`7px 16px`,borderRadius:999,fontSize:13,fontWeight:600,border:t?`2px solid ${n}`:`2px solid #E5E7EB`,background:t?n:`#fff`,color:t?`#fff`:`#374151`,cursor:`pointer`,transition:`all 0.15s`},children:[$l[e]&&`${$l[e]} `,e]},e)})}),(0,j.jsxs)(`p`,{style:{fontSize:13,color:`#9CA3AF`,marginBottom:20},children:[s.length,` resource`,s.length===1?``:`s`,` `,r===`All`?`available`:`in ${r}`]}),s.length===0?(0,j.jsxs)(`div`,{style:{textAlign:`center`,padding:`60px 0`,color:`#9CA3AF`},children:[(0,j.jsx)(`div`,{style:{fontSize:40,marginBottom:12},children:`ð`}),(0,j.jsx)(`p`,{children:`No resources found. Try a different search or category.`})]}):(0,j.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:e?`1fr`:`repeat(2, 1fr)`,gap:20},children:s.map(e=>(0,j.jsx)(ru,{resource:e},e.id))}),(0,j.jsx)(B,{zone:`resources-bottom`}),(0,j.jsxs)(`div`,{style:{marginTop:52,background:`#fff`,borderRadius:20,border:`1px solid #EBEBEB`,padding:e?`28px 20px`:`36px 40px`,display:`flex`,alignItems:`center`,justifyContent:`space-between`,gap:20,flexWrap:`wrap`},children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`h3`,{style:{fontSize:17,fontWeight:800,color:`#111`,marginBottom:6},children:`Know a resource we're missing?`}),(0,j.jsx)(`p`,{style:{fontSize:13,color:`#6B7280`,lineHeight:1.6},children:`Help us keep this list up to date. Submit an organization and we'll review it within 1â2 business days.`})]}),(0,j.jsx)(`a`,{href:`mailto:[email protected]?subject=Community%20Resource%20Submission`,style:{display:`inline-block`,background:`#C0392B`,color:`#fff`,fontWeight:700,fontSize:13,padding:`11px 24px`,borderRadius:999,textDecoration:`none`,whiteSpace:`nowrap`},children:`Submit a Resource â`})]})]})})]})}function ru({resource:e}){let{id:t,title:n,organization:r,category:i,description:a,image_url:o,featured:s,featured_on_listing:c}=e,l=eu[i]||`#C0392B`,u=$l[i]||`ð`;return(0,j.jsx)(A,{to:`/resources/${t}`,style:{textDecoration:`none`,color:`inherit`},children:(0,j.jsxs)(`div`,{style:{background:`#fff`,borderRadius:16,border:c?`2px s
224olid ${l}`:`1px solid #F0F0F0`,overflow:`hidden`,cursor:`pointer`,transition:`border-color 0.2s, box-shadow 0.2s`,position:`relative`},onMouseEnter:e=>{e.currentTarget.style.borderColor=l+`30`,e.currentTarget.style.boxShadow=`0 4px 20px ${l}18`},onMouseLeave:e=>{e.currentTarget.style.borderColor=c?l:`#F0F0F0`,e.currentTarget.style.boxShadow=`none`},children:[c&&(0,j.jsx)(`div`,{style:{position:`absolute`,top:8,right:8,background:l,color:`#fff`,padding:`4px 8px`,borderRadius:999,fontSize:14,fontWeight:700,zIndex:2},children:`â`}),(0,j.jsx)(`div`,{style:{height:4,background:l}}),(0,j.jsxs)(`div`,{style:{padding:24},children:[(0,j.jsxs)(`div`,{style:{display:`flex`,alignItems:`flex-start`,gap:12},children:[o?(0,j.jsx)(`img`,{src:o,alt:n,style:{width:40,height:40,borderRadius:10,objectFit:`cover`,flexShrink:0}}):(0,j.jsx)(`div`,{style:{width:40,height:40,borderRadius:10,background:l+`15`,fontSize:20,display:`flex`,alignItems:`center`,justifyContent:`center`,flexShrink:0},children:u}),(0,j.jsxs)(`div`,{style:{flex:1,minWidth:0},children:[(0,j.jsx)(`h3`,{style:{fontSize:15,fontWeight:800,color:`#111`,marginBottom:2,lineHeight:1.3},children:n}),(0,j.jsx)(`p`,{style:{fontSize:12,color:`#6B7280`,fontWeight:600},children:r})]}),(0,j.jsx)(`span`,{style:{fontSize:10,fontWeight:700,padding:`3px 10px`,borderRadius:999,background:l+`15`,color:l,flexShrink:0},children:i})]}),a&&(0,j.jsx)(`p`,{style:{fontSize:13,color:`#6B7280`,lineHeight:1.6,marginTop:14,display:`-webkit-box`,WebkitLineClamp:2,WebkitBoxOrient:`vertical`,overflow:`hidden`},children:a}),(0,j.jsx)(`p`,{style:{fontSize:12,fontWeight:700,color:l,marginTop:12},children:`View Details â`})]})]})})}var iu=[{id:`1`,title:`Emergency Rental Assistance`,organization:`Palm Beach County Housing Authority`,category:`Housing`,description:`Financial assistance for residents facing eviction or unable to pay rent due to hardship. Applications accepted monthly.`,phone:`(561) 655-8230`,website_url:`https://www.pbcgov.org`,address:`3432 W Belvedere Rd`,city:`West Palm Beach`},{id:`2`,title:`Community Food Pantry`,organization:`Feeding South Florida`,category:`Food & Nutrition`,description:`Free groceries and prepared meals for Palm Beach County residents in need. No income verification required. Open Tue & Thu.`,phone:`(561) 243-3500`,website_url:`https://feedingsouthflorida.org`,address:`2501 SW 32nd Terrace`,city:`West Palm Beach`},{id:`3`,title:`Youth Mentorship Program`,organization:`Urban League of Palm Beach County`,category:`Youth & Families`,description:`Connecting at-risk y
224outh ages 10â18 with mentors, job training, and academic support services throughout the county.`,phone:`(561) 833-1461`,website_url:`https://ulpbc.org`,city:`West Palm Beach`},{id:`4`,title:`Free Health Screenings`,organization:`JFK North Medical Center`,category:`Health & Wellness`,description:`Monthly free health screenings including blood pressure, diabetes, and cholesterol checks. No appointment needed.`,phone:`(561) 840-6205`,city:`West Palm Beach`},{id:`5`,title:`Adult Literacy & GED Classes`,organization:`Palm Beach County Library System`,category:`Education`,description:`Free adult education classes including GED prep, basic literacy, English as a second language, and computer skills.`,phone:`(561) 233-2600`,website_url:`https://www.pbclibrary.org`,city:`Multiple Locations`},{id:`6`,title:`Senior Meal Delivery`,organization:`Area Agency on Aging - PBC`,category:`Senior Services`,description:`Hot meal delivery for homebound seniors 60 and older. Nutritious meals delivered to your door MondayâFriday at no cost.`,phone:`(561) 684-5885`,website_url:`https://www.aaa-pbc.org`,city:`Palm Beach County`},{id:`7`,title:`Back-to-School Backpack Drive`,organization:`The Bynes Company Office Solutions`,category:`Giveaways & Free Items`,description:`Free backpacks and school supplies for Kâ12 students. First come, first served. Sponsored by local businesses.`,city:`West Palm Beach`},{id:`8`,title:`Crisis & Suicide Hotline`,organization:`Crisis Line of Palm Beach County`,category:`Mental Health`,description:`24/7 confidential crisis support for individuals experiencing emotional distress, suicidal thoughts, or mental health emergencies.`,phone:`(561) 383-1988`,website_url:`https://www.crisislineofpbc.org`,city:`Serving All of PBC`}],au={Housing:`ð `,"Food & Nutrition":`ð¥`,"Health & Wellness":`â¤ï¸`,"Youth & Families":`ð¨âð©âð§`,Education:`ð`,"Senior Services":`ð¤`,"Mental Health":`ð§ `,"Giveaways & Free Items":`ð`},ou={Housing:`#3B82F6`,"Food & Nutrition":`#16A34A`,"Health & Wellness":`#C0392B`,"Youth & Families":`#7C3AED`,Education:`#D97706`,"Senior Services":`#0891B2`,"Mental Health":`#DB2777`,"Giveaways & Free Items":`#F59E0B`};function su(){let{id:e}=Ct(),[t,n]=(0,_.useState)(null),[r,i]=(0,_.useState)(!0);if((0,_.useEffect)(()=>{async function t(){let{data:t}=await z.from(`resources`).select(`*`).eq(`id`,e).maybeSingle();t||=iu.find(t=>t.id===e)||null,n(t),i(!1)}t()},[e]),r)return(0,j.jsx)(`div`,{style:{textAlign:`center`,padding:`80px 0`,color:`#9CA3AF`},children:`Loading...`});if(!t)return(0,j.jsxs)(`div`,{style:{textAlign:`center`,padding:`80px 0`},children:[(0,j.jsx)(`p`,{style:{color:`#9CA3AF`,marginBottom:16},children:`Resource not found.`}),(0,j.jsx)(A,{to:`/resources`,style:{color:`#C0392B`,fontWeight:700,textDecoration:`none`},children:`â Back to Resources`})]});let{title:a,organization:o,category:s,description:c,phone:l,website_url:u,address:d,city:f,image_url:p}=t,m=ou[s]||`#C0392B`,h=au[s]||`ð`,g=u?u.startsWith(`http`)?u:`https://${u}`:null;return(0,j.jsx)(`div`,{style:{background:`#F9F9F9`,minHeight:`100vh`,padding:`48px 0`},children:(0,j.jsx)(M,{children:(0,j.jsxs)(`div`,{style:{maxWidth:680,margin:`0 auto`},children:[(0,j.jsx)(A,{to:`/resources`,style:{color:`#C0392B`,fontWeight:700,textDecoration:`none`,fontSize:13,display:`inline-block`,marginBottom:24},children:`â Back to Resources`}),p&&(0,j.jsx)(`img`,{src:p,alt:a,style:{width:`100%`,borderRadius:16,objectFit:`cover`,maxHeight:280,display:`block`,marginBottom:24}}),(0,j.jsxs)(`div`,{style:{background:`#fff`,borderRadius:20,border:`1px solid #EBEBEB`,padding:`36px 40px`},children:[(0,j.jsx)(`div`,{style:{height:4,borderRadius:4,background:m,width:48,marginBottom:20}}),(0,j.jsxs)(`div`,{style:{display:`flex`,alignItems:`flex-start`,gap:16,marginBottom:20},children:[(0,j.jsx)(`div`,{style:{width:52,height:52,borderRadius:12,background:m+`15`,fontSize:24,display:`flex`,alignItems:`center`,justifyContent:`center`,flexShrink:0},children:h}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`h1`,{style:{fontSize:24,fontWeight:900,color:`#111`,lineHeight:1.25,marginBottom:6},children:a}),(0,j.jsx)(`p`,{style:{fontSize:14,color:`#6B7280`,fontWeight:600},children:o})]})]}),(0,j.jsx)(`span`,{style:{fontSize:11,fontWeight:700,padding:`3px 12px`,borderRadius:999,background:m+`15`,color:m,display:`inline-block`,marginBottom:20},children:s}),c&&(0,j.jsx)(`p`,{style:{fontSize:15,color:`#374151`,lineHeight:1.8,marginBottom:24,paddingBottom:24,borderBottom:`1px solid #F3F4F6`},children:c}),(0,j.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:10,marginBottom:24},children:[f&&(0,j.jsxs)(`div`,{style:{fontSize:14,color:`#374151`},children:[`ð `,d?`${d}, `:``,f]}),l&&(0,j.jsxs)(`div`,{style:{fontSize:14,color:`#374151`},children:[`ð `,l]})]}),(0,j.jsxs)(`div`,{style:{display:`flex`,gap:10,flexWrap:`wrap`},children:[l&&(0,j.jsx)(`a`,{href:`tel:${l}`,style:{fontWeight:700,fontSize:13,padding:`10px 20px`,borderRadius:999,background:m,color:`#fff`,textDecoration:`none`},children:`Call Now`}),g&&(0,j.jsx)(`a`,{href:g,target:`_blank`,rel:`noopener noreferrer`,style:{fontWeight:600,fontSize:13,padding:`10px 20px`,borderRadius:999,background:`#F3F4F6`,color:`#374151`,textDecoration:`none`},children:`Visit Website â`})]})]})]})})})}var cu=[`General Inquiry`,`Business Listing`,`Advertising`,`Featured Spotlight`,`Community Resources`,`Technical Issue`,`Other`];function lu(){let e=cr()<768,[t,n]=(0,_.useState)({name:``,email:``,topic:`General Inquiry`,message:``}),[r,i]=(0,_.useState)(!1),[a,o]=(0,_.useState)(!1);function s(e,t){n(n=>({...n,[e]:t}))}async function c(e){e.preventDefault(),o(!0),await z.from(`contact_submissions`).insert({name:t.name,email:t.email,topic:t.to
224pic,message:t.message,read:!1}),i(!0),o(!1)}return(0,j.jsxs)(`div`,{style:{background:`#F9F9F9`,minHeight:`100vh`},children:[(0,j.jsx)(`div`,{style:{background:`#C0392B`,padding:e?`44px 0 36px`:`60px 0 48px`},children:(0,j.jsx)(M,{children:(0,j.jsxs)(`div`,{style:{maxWidth:560},children:[(0,j.jsx)(`h1`,{style:{fontSize:e?28:38,fontWeight:900,color:`#fff`,marginBottom:10},children:`Contact Us`}),(0,j.jsx)(`p`,{style:{fontSize:14,color:`rgba(255,255,255,0.85)`,lineHeight:1.7},children:`Questions about listings, advertising, or the site? We're here to help. Reach us directly or use the form below.`})]})})}),(0,j.jsx)(M,{children:(0,j.jsxs)(`div`,{style:{padding:`44px 0 60px`,display:`grid`,gridTemplateColumns:e?`1fr`:`1fr 380px`,gap:32,alignItems:`flex-start`},children:[(0,j.jsx)(`div`,{style:{background:`#fff`,borderRadius:20,border:`1px solid #EBEBEB`,padding:e?`28px 20px`:`36px 36px`},children:r?(0,j.jsxs)(`div`,{style:{textAlign:`center`,padding:`40px 0`},children:[(0,j.jsx)(`div`,{style:{fontSize:52,marginBottom:16},children:`â
`}),(0,j.jsx)(`h2`,{style:{fontSize:20,fontWeight:900,color:`#111`,marginBottom:8},children:`Message Received!`}),(0,j.jsxs)(`p`,{style:{fontSize:14,color:`#6B7280`,lineHeight:1.7},children:[`Thank you, `,t.name,`. We'll get back to you within 1 business day at`,` `,(0,j.jsx)(`strong`,{style:{color:`#111`},children:t.email}),`.`,(0,j.jsx)(`br`,{}),(0,j.jsx)(`br`,{}),`For urgent matters email us directly at`,` `,(0,j.jsx)(`a`,{href:`mailto:[email protected]`,style:{color:`#C0392B`,fontWeight:700},children:`[email protected]`}),`.`]})]}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`h2`,{style:{fontSize:18,fontWeight:800,color:`#111`,marginBottom:24,paddingBottom:16,borderBottom:`1px solid #F3F4F6`},children:`Send Us a Message`}),(0,j.jsxs)(`form`,{onSubmit:c,style:{display:`flex`,flexDirection:`column`,gap:18},children:[(0,j.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:e?`1fr`:`1fr 1fr`,gap:16},children:[(0,j.jsx)(du,{label:`Your Name`,value:t.name,onChange:e=>s(`name`,e),placeholder:`Jane Smith`,required:!0}),(0,j.jsx)(du,{label:`Email Address`,type:`email`,value:t.email,onChange:e=>s(`email`,e),placeholder:`[email protected]`,required:!0})]}),(0,j.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:6},children:[(0,j.jsx)(`label`,{style:fu,children:`Topic`}),(0,j.jsx)(`select`,{value:t.topic,onChange:e=>s(`topic`,e.target.value),style:pu,children:cu.map(e=>(0,j.jsx)(`option`,{children:e},e))})]}),(0,j.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:6},children:[(0,j.jsx)(`label`,{style:fu,children:`Message`}),(0,j.jsx)(`textarea`,{value:t.message,onChange:e=>s(`message`,e.target.value),placeholder:`Tell us how we can help...`,rows:5,required:!0,style:{...pu,resize:`vertical`,lineHeight:1.6},onFocus:e=>e.target.style.borderColor=`#C0392B`,onBlur:e=>e.target.style.borderColor=`#E5E7EB`})]}),(0,j.jsx)(`button`,{type:`submit`,disabled:a,style:{padding:`13px`,background:`#C0392B`,color:`#fff`,fontWeight:700,fontSize:15,borderRadius:999,border:`none`,cursor:a?`not-allowed`:`pointer`,opacity:a?.7:1},children:a?`Sending...`:`Send Message â`}),(0,j.jsx)(`p`,{style:{fontSize:11,color:`#9CA3AF`,textAlign:`center`,lineHeight:1.5},children:`You can also reach us directly at [email protected].`})]})]})}),(0,j.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:16},children:[(0,j.jsx)(uu,{icon:`âï¸`,title:`General & Listings`,detail:`[email protected]`,href:`mailto:[email protected]`}),(0,j.jsx)(uu,{icon:`ð£`,title:`Advertising`,detail:`[email protected]`,href:`mailto:[email protected]`}),(0,j.jsx)(uu,{icon:`â`,title:`Featured Spotlight`,detail:`[email protected]`,href:`mailto:[email protected]?subject=Featured%20Spotlight%20Inquiry`,linkLabel:`Book a Spotlight`}),(0,j.jsx)(uu,{icon:`ð¤`,title:`Community Resources`,detail:`Submit a resource or update an existing listing`,href:`mailto:[email protected]?subject=Community%20Resource%20Submission`,linkLabel:`Submit Resource`}),(0,j.jsxs)(`div`,{style:{background:`#111`,borderRadius:16,padding:24,color:`#fff`},children:[(0,j.jsx)(`div`,{style:{fontSize:18,marginBottom:8},children:`â±ï¸`}),(0,j.jsx)(`div`,{style:{fontSize:14,fontWeight:800,marginBottom:6},children:`Response Time`}),(0,j.jsxs)(`p`,{style:{fontSize:13,color:`rgba(255,255,255,0.65)`,lineHeight:1.6},children:[`We typically respond within `,(0,j.jsx)(`strong`,{style:{color:`#F0C419`},children:`1 business day`}),`. For urgent matters, include "URGENT" in your subject line.`]})]})]})]})})]})}
224function uu({icon:e,title:t,detail:n,href:r,linkLabel:i}){return(0,j.jsx)(`div`,{style:{background:`#fff`,borderRadius:16,border:`1px solid #EBEBEB`,padding:`20px 22px`},children:(0,j.jsxs)(`div`,{style:{display:`flex`,gap:12,alignItems:`flex-start`},children:[(0,j.jsx)(`span`,{style:{fontSize:22},children:e}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`div`,{style:{fontSize:13,fontWeight:800,color:`#111`,marginBottom:4},children:t}),(0,j.jsx)(`div`,{style:{fontSize:12,color:`#6B7280`,marginBottom:8,lineHeight:1.5},children:n}),(0,j.jsxs)(`a`,{href:r,style:{fontSize:12,fontWeight:700,color:`#C0392B`,textDecoration:`none`},children:[i||n,` â`]})]})]})})}function du({label:e,type:t=`text`,value:n,onChange:r,placeholder:i,required:a}){return(0,j.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:6},children:[(0,j.jsx)(`label`,{style:fu,children:e}),(0,j.jsx)(`input`,{type:t,value:n,onChange:e=>r(e.target.value),placeholder:i,required:a,style:pu,onFocus:e=>e.target.style.borderColor=`#C0392B`,onBlur:e=>e.target.style.borderColor=`#E5E7EB`})]})}var fu={fontSize:12,fontWeight:700,color:`#374151`,textTransform:`uppercase`,letterSpacing:`0.04em`},pu={padding:`11px 14px`,borderRadius:10,border:`1px solid #E5E7EB`,fontSize:14,color:`#111`,outline:`none`,width:`100%`,boxSizing:`border-box`},mu=`https://www.facebook.com/groups/pbclassifieds`;function hu(){let e=cr()<768;return(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`div`,{style:{background:`#C0392B`,padding:e?`36px 0 28px`:`56px 0 48px`},children:(0,j.jsxs)(M,{children:[(0,j.jsx)(`h1`,{style:{fontSize:e?30:40,fontWeight:900,color:`#fff`,marginBottom:8},children:`PBC Classifieds`}),(0,j.jsx)(`p`,{style:{fontSize:16,color:`rgba(255,255,255,0.8)`},children:`Buy, sell, and trade with your Palm Beach County neighbors.`})]})}),(0,j.jsx)(`div`,{style:{background:`#F9F9F9`,minHeight:420,padding:e?`36px 0`:`56px 0`},children:(0,j.jsx)(M,{children:(0,j.jsxs)(`div`,{style:{maxWidth:640,margin:`0 auto`,textAlign:`center`,background:`#fff`,borderRadius:20,border:`1px solid #EBEBEB`,padding:e?`36px 24px`:`52px 48px`},children:[(0,j.jsx)(`span`,{style:{fontSize:48,display:`block`,marginBottom:16},children:`ð·ï¸`}),(0,j.jsx)(`h2`,{style:{fontSize:22,fontWeight:900,color:`#111`,marginBottom:14},children:`A Community Facebook Group`}),(0,j.jsx)(`p`,{style:{fontSize:15,color:`#6B7280`,lineHeight:1.75,marginBottom:28},children:`PBC Classifieds is a free, active Facebook group where Palm Beach County residents buy, sell, and trade everything from furniture and vehicles to home goods and services. Post a listing, browse what's available nearby, or just see what your neighbors are up to.`}),(0,j.jsx)(`a`,{href:mu,target:`_blank`,rel:`noopener noreferrer`,style:{display:`inline-block`,background:`#C0392B`,color:`#fff`,fontWeight:700,fontSize:15,padding:`14px 32px`,borderRadius:999,textDecoration:`none`},children:`Join the Group on Facebook â`}),(0,j.jsx)(`p`,{style:{fontSize:12,color:`#9CA3AF`,marginTop:24,lineHeight:1.6},children:`A dedicated Classifieds section is coming soon right here on Palm Beach Comm. Until then, the Facebook group is the best place to buy and sell locally.`})]})})})]})}var gu={business_name:``,contact_name:``,email:``,phone:``,category:``,city:``,online_presence:``,why_join:``,feedback_willing:!0};function _u(){let e=cr()<768,[t,n]=(0,_.useState)(gu),[r,i]=(0,_.useState)(!1),[a,o]=(0,_.useState)(!1);function s(e,t){n(n=>({...n,[e]:t}))}async function c(e){e.preventDefault(),o(!0),await z.from(`beta_applications`).insert(t),i(!0),o(!1)}return(0,j.jsxs)(`div`,{style:{background:`#F9F9F9`,minHeight:`100vh`},children:[(0,j.jsx)(`div`,{style:{background:`#C0392B`,padding:e?`44px 0 36px`:`60px 0 48px`},children:(0,j.jsx)(M,{children:(0,j.jsxs)(`div`,{style:{maxWidth:600},children:[(0,j.jsx)(`div`,{style:{display:`inline-block`,background:`rgba(255,255,255,0.15)`,borderRadius:999,padding:`4px 16px`,fontSize:11,fontWeight:700,color:`#fff`,letterSpacing:`0.06em`,textTransform:`uppercase`,marginBottom:16},children:`Founding Business Beta`}),(0,j.jsx)(`h1`,{style:{fontSize:e?28:38,fontWeight:900,color:`#fff`,lineHeight:1.15,marginBottom:12},children:`Be One of the First 50 Businesses`}),(0,j.jsx)(`p`,{style:{fontSize:14,color:`rgba(255,255,255,0.85)`,lineHeight:1.7},children:`We're opening a limited beta for Palm Beach County businesses to help shape the new Palm Beach Comm before it's open to everyone. Apply below â spots are limited so we can actually listen to what you tell us.`})]})})}),(0,j.jsx)(M,{children:(0,j.jsxs)(`div`,{style:{padding:e?`32px 0 48px`:`44px 0 60px`,display:`grid`,gridTemplateColumns:e?`1fr`:`1fr 360px`,gap:32,alignItems:`flex-start`},children:[(0,j.jsx)(`div`,{style:{background:`#fff`,borderRadius:20,border:`1px solid #EBEBEB`,padding:e?`28px 20px`:`36px 36px`},children:r?(0,j.jsxs)(`div`,{style:{textAlign:`center`,padding:`40px 0`},children:[(0,j.jsx)(`div`,{style:{fontSize:52,marginBottom:16},children:`â
`}),(0,j.jsx)(`h2`,{style:{fontSize:20,fontWeight:900,color:`#111`,marginBottom:8},children:`Application Received!`}),(0,j.jsxs)(`p`,{style:{fontSize:14,color:`#6B7280`,lineHeight:1.7}
224,children:[`Thank you, `,t.contact_name,`. We review applications personally and will follow up at`,` `,(0,j.jsx)(`strong`,{style:{color:`#111`},children:t.email}),` within a few days.`]})]}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`h2`,{style:{fontSize:18,fontWeight:800,color:`#111`,marginBottom:24,paddingBottom:16,borderBottom:`1px solid #F3F4F6`},children:`Apply for the Beta`}),(0,j.jsxs)(`form`,{onSubmit:c,style:{display:`flex`,flexDirection:`column`,gap:18},children:[(0,j.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:e?`1fr`:`1fr 1fr`,gap:16},children:[(0,j.jsx)(yu,{label:`Business Name`,value:t.business_name,onChange:e=>s(`business_name`,e),placeholder:`Havana Nights`,required:!0}),(0,j.jsx)(yu,{label:`Your Name`,value:t.contact_name,onChange:e=>s(`contact_name`,e),placeholder:`Jane Smith`,required:!0})]}),(0,j.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:e?`1fr`:`1fr 1fr`,gap:16},children:[(0,j.jsx)(yu,{label:`Email Address`,type:`email`,value:t.email,onChange:e=>s(`email`,e),placeholder:`[email protected]`,required:!0}),(0,j.jsx)(yu,{label:`Phone`,value:t.phone,onChange:e=>s(`phone`,e),placeholder:`(561) 555-0101`})]}),(0,j.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:e?`1fr`:`1fr 1fr`,gap:16},children:[(0,j.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:6},children:[(0,j.jsx)(`label`,{style:bu,children:`Category`}),(0,j.jsxs)(`select`,{value:t.category,onChange:e=>s(`category`,e.target.value),required:!0,style:xu,children:[(0,j.jsx)(`option`,{value:``,disabled:!0,children:`Select a category`}),Uc.map(e=>(0,j.jsx)(`option`,{children:e},e))]})]}),(0,j.jsx)(yu,{label:`City`,value:t.city,onChange:e=>s(`city`,e),placeholder:`West Palm Beach`,required:!0})]}),(0,j.jsx)(yu,{label:`Current Website or Social Link (optional)`,value:t.online_presence,onChange:e=>s(`online_presence`,e),placeholder:`https://`}),(0,j.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:6},children:[(0,j.jsx)(`label`,{style:bu,children:`Why do you want to join the beta?`}),(0,j.jsx)(`textarea`,{value:t.why_join,onChange:e=>s(`why_join`,e.target.value),placeholder:`Tell us a bit about your business and what you're hoping to get out of it...`,rows:4,required:!0,style:{...xu,resize:`vertical`,lineHeight:1.6},onFocus:e=>e.target.style.borderColor=`#C0392B`,onBlur:e=>e.target.style.borderColor=`#E5E7EB`})]}),(0,j.jsxs)(`label`,{style:{display:`flex`,alignItems:`flex-start`,gap:8,fontSize:13,color:`#374151`,cursor:`pointer`,lineHeight:1.5},children:[(0,j.jsx)(`input`,{type:`checkbox`,checked:t.feedback_willing,onChange:e=>s(`feedback_willing`,e.target.checked),style:{width:16,height:16,marginTop:2,flexShrink:0}}),`I'm willing to share feedback during the beta (a quick survey or short call)`]}),(0,j.jsx)(`button`,{type:`submit`,disabled:a,style:{padding:`13px`,background:`#C0392B`,color:`#fff`,fontWeight:700,fontSize:15,borderRadius:999,border:`none`,cursor:a?`not-allowed`:`pointer`,opacity:a?.7:1},children:a?`Submitting...`:`Submit Application â`})]})]})}),(0,j.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:16},children:[(0,j.jsx)(vu,{icon:`â`,title:`Extended Elite Trial`,detail:`60 days of full Elite-tier features â unlimited photos, guaranteed homepage placement, custom badge â instead of the standard 7-day trial.`}),(0,j.jsx)(vu,{icon:`ð
`,title:`Founding Business Badge`,detail:`A permanent badge on your listing marking you as one of the businesses that helped shape the platform from day one.`}),(0,j.jsx)(vu,{icon:`ð`,title:`Guaranteed Spotlight`,detail:`Featured placement on the homepage for the full length of your beta trial, no extra cost.`}),(0,j.jsx)(vu,{icon:`ð`,title:`Priority Access`,detail:`First access to new features as they launch â Job Board, Forums, and more â before the general public.`}),(0,j.jsxs)(`div`,{style:{background:`#111`,borderRadius:16,padding:24,color:`#fff`},children:[(0,j.jsx)(`div`,{style:{fontSize:18,marginBottom:8},children:`ð¤`}),(0,j.jsx)(`div`,{style:{fontSize:14,fontWeight:800,marginBottom:6},children:`A Real Feedback Relationship`}),(0,j.jsxs)(`p`,{style:{fontSize:13,color:`rgba(255,255,255,0.65)`,lineHeight:1.6},children:[`We're keeping this beta small on purpose â `,(0,j.jsx)(`strong`,{style:{color:`#F0C419`},children:`limited spots`}),` â so we can actually read what you tell us and act on it.`]})]})]})]})})]})}
224function vu({icon:e,title:t,detail:n}){return(0,j.jsx)(`div`,{style:{background:`#fff`,borderRadius:16,border:`1px solid #EBEBEB`,padding:`20px 22px`},children:(0,j.jsxs)(`div`,{style:{display:`flex`,gap:12,alignItems:`flex-start`},children:[(0,j.jsx)(`span`,{style:{fontSize:22},children:e}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`div`,{style:{fontSize:13,fontWeight:800,color:`#111`,marginBottom:4},children:t}),(0,j.jsx)(`div`,{style:{fontSize:12,color:`#6B7280`,lineHeight:1.55},children:n})]})]})})}function yu({label:e,type:t=`text`,value:n,onChange:r,placeholder:i,required:a}){return(0,j.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:6},children:[(0,j.jsx)(`label`,{style:bu,children:e}),(0,j.jsx)(`input`,{type:t,value:n,onChange:e=>r(e.target.value),placeholder:i,required:a,style:xu,onFocus:e=>e.target.style.borderColor=`#C0392B`,onBlur:e=>e.target.style.borderColor=`#E5E7EB`})]})}var bu={fontSize:12,fontWeight:700,color:`#374151`,textTransform:`uppercase`,letterSpacing:`0.04em`},xu={padding:`11px 14px`,borderRadius:10,border:`1px solid #E5E7EB`,fontSize:14,color:`#111`,outline:`none`,width:`100%`,boxSizing:`border-box`};function Su(){return(0,_.useEffect)(()=>{if(document.getElementById(`tawk-to-script`))return;window.Tawk_API=window.Tawk_API||{},window.Tawk_LoadStart=new Date;let e=document.createElement(`script`);e.id=`tawk-to-script`,e.async=!0,e.src=`https://embed.tawk.to/6a515929037b921d3d91a769/1jt6s8j66`,e.charset=`UTF-8`,e.setAttribute(`crossorigin`,`*`),document.body.appendChild(e)},[]),null}var Cu=`G-579EKBJPKB`;function wu(){let e=O();return(0,_.useEffect)(()=>{if(document.getElementById(`ga-script`))return;window.dataLayer=window.dataLayer||[],window.gtag=function(){window.dataLayer.push(arguments)},window.gtag(`js`,new Date),window.gtag(`config`,Cu,{send_page_view:!1});let e=document.createElement(`script`);e.id=`ga-script`,e.async=!0,e.src=`https://www.googletagmanager.com/gtag/js?id=${Cu}`,document.head.appendChild(e)},[]),(0,_.useEffect)(()=>{typeof window.gtag==`function`&&window.gtag(`event`,`page_view`,{page_path:e.pathname+e.search,page_location:window.location.href,page_title:document.title})},[e]),null}function Tu({title:e,lastUpdated:t,children:n}){let r=cr()<768;return(0,j.jsxs)(`div`,{style:{background:`#F9F9F9`,minHeight:`100vh`},children:[(0,j.jsx)(`div`,{style:{background:`#C0392B`,padding:r?`44px 0 36px`:`60px 0 48px`},children:(0,j.jsxs)(M,{children:[(0,j.jsx)(`h1`,{style:{fontSize:r?28:38,fontWeight:900,color:`#fff`,marginBottom:8},children:e}),(0,j.jsxs)(`p`,{style:{fontSize:13,color:`rgba(255,255,255,0.8)`},children:[`Last updated: `,t]})]})}),(0,j.jsx)(M,{children:(0,j.jsxs)(`div`,{style:{maxWidth:760,margin:`0 auto`,padding:r?`32px 0 60px`:`48px 0 72px`},children:[(0,j.jsxs)(`div`,{style:{background:`#FFFBEB`,border:`1px solid #FDE68A`,borderRadius:10,padding:`14px 18px`,marginBottom:32,fontSize:13,color:`#92400E`,lineHeight:1.6},children:[(0,j.jsx)(`strong`,{children:`Draft document.`}),` This page is a general starting template and has not been reviewed by an attorney. It should be reviewed by qualified legal counsel before being relied upon.`]}),(0,j.jsx)(`div`,{style:{background:`#fff`,borderRadius:16,border:`1px solid #EBEBEB`,padding:r?`28px 22px`:`40px 48px`,display:`flex`,flexDirection:`column`,gap:24},children:n})]})})]})}function Eu({title:e,children:t}){return(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`h2`,{style:{fontSize:18,fontWeight:800,color:`#111`,marginBottom:10},children:e}),(0,j.jsx)(`div`,{style:{fontSize:14,color:`#374151`,lineHeight:1.75,display:`flex`,flexDirection:`column`,gap:10},children:t})]})}function Du(){return(0,j.jsxs)(Tu,{title:`Terms of Service`,lastUpdated:`July 8, 2026`,children:[(0,j.jsx)(Eu,{title:`1. Acceptance of Terms`,children:(0,j.jsx)(`p`,{children:`By accessing or using Palm Beach Comm ("the Site," "we," "us"), operated by The Bynes Company Office Solutions, you agree to be bound by these Terms of Service. If you do not agree, please do not use the Site.`})}),(0,j.jsx)(Eu,{title:`2. Description of Service`,children:(0,j.jsx)(`p`,{children:`Palm Beach Comm is a community directory and information platform for Palm Beach County, Florida, offering a business directory, event listings, community resources, a blog, and related features. Some features are free; others require a paid subscription.`})}),(0,j.jsx)(Eu,{title:`3. Accounts`,children:(0,j.jsx)(`p`,{children:`Some features require an account. You are responsible for maintaining the confidentiality of your login credentials and for all activity under your account. You must provide accurate information when creating an account or business listing.`})}),(0,j.jsx)(Eu,{title:`4. Business Listings & Content`,children:(0,j.jsx)(`p`,{children:`Business owners are responsible for the accuracy of the information they submit (name, address, description, photos, links, etc.). We reserve the right to edit, decline, or remove any listing that is inaccurate, misleading, or violates these Terms, at our discretion.`})}),(0,j.jsx)(Eu,{title:`5. Paid Plans & Payments`,children:(0,j.jsx)(`p`,{children:`Paid listing tiers, Featured Spotlight placements, advertising, and (when available) Job Board postings are billed as described on the applicable pricing page at the time of purchase. Subscriptions renew automatically until canceled. Fees are generally non-refundable except where required by law or expressly stated otherwise at checkout.`})}),(0,j.jsx)(Eu,{title:`6. Acceptable Use`,children:(0,j.jsx)(`p`,{children:`You agree not to use the Site to: post unlawful, fraudulent, discriminatory, or misleading content; violate any applicable employment or fair-housing law (including in job postings, when available); scrape or harvest data; impersonate another person or business; or interfere with the Site's operation or security.`})}),(0,j.jsx)(Eu,{title:`7. User-Submitted Content`,children:(0,j.jsx)(`p`,{children:`Where the Site allows submitted content (such as reviews, comments, or listing details), you grant Palm Beach Comm a non-exclusive, royalty-free license to display that content on the Site. You retain ownership of what you submit and are solely responsible for its accuracy and legality.`})}),(0,j.jsx)(Eu,{title:`8. Third-Party Links & Content`,children:(0,j.jsx)(`p`,{children:`The Site links to third-party websites and services (including business websites and s
224ocial media groups such as our Facebook Group and PBC Classifieds) that we do not control and are not responsible for. Use of those services is subject to their own terms.`})}),(0,j.jsx)(Eu,{title:`9. Intellectual Property`,children:(0,j.jsx)(`p`,{children:`The Site's design, branding, and original content are owned by The Bynes Company Office Solutions. Business names, logos, and photos remain the property of their respective owners.`})}),(0,j.jsx)(Eu,{title:`10. Disclaimer of Warranties`,children:(0,j.jsx)(`p`,{children:`The Site and its content are provided "as is" without warranties of any kind. We do not guarantee the accuracy, completeness, or reliability of any business listing, event, or community resource information.`})}),(0,j.jsx)(Eu,{title:`11. Limitation of Liability`,children:(0,j.jsx)(`p`,{children:`To the fullest extent permitted by law, Palm Beach Comm and The Bynes Company Office Solutions shall not be liable for any indirect, incidental, or consequential damages arising from your use of the Site.`})}),(0,j.jsx)(Eu,{title:`12. Governing Law`,children:(0,j.jsx)(`p`,{children:`These Terms are governed by the laws of the State of Florida, without regard to conflict-of-law principles.`})}),(0,j.jsx)(Eu,{title:`13. Changes to These Terms`,children:(0,j.jsx)(`p`,{children:`We may update these Terms from time to time. Continued use of the Site after changes are posted constitutes acceptance of the revised Terms.`})}),(0,j.jsx)(Eu,{title:`14. Contact Us`,children:(0,j.jsxs)(`p`,{children:[`Questions about these Terms can be sent through our `,(0,j.jsx)(`a`,{href:`/contact`,style:{color:`#C0392B`,fontWeight:700,textDecoration:`none`},children:`Contact page`}),`.`]})})]})}function Ou(){return(0,j.jsxs)(Tu,{title:`Privacy Policy`,lastUpdated:`July 8, 2026`,children:[(0,j.jsx)(Eu,{title:`1. Introduction`,children:(0,j.jsx)(`p`,{children:`This Privacy Policy explains how Palm Beach Comm, operated by The Bynes Company Office Solutions, collects, uses, and protects information when you use our Site.`})}),(0,j.jsxs)(Eu,{title:`2. Information We Collect`,children:[(0,j.jsx)(`p`,{children:`We collect information you provide directly, including: account details (name, email, password) when you sign up; business listing information (business name, address, description, photos, contact and social links); and messages you send through our Contact form or "notify me" signups.`}),(0,j.jsx)(`p`,{children:`We do not currently use third-party analytics or advertising tracking tools. If that changes, this policy will be updated.`})]}),(0,j.jsx)(Eu,{title:`3. How We Use Information`,children:(0,j.jsx)(`p`,{children:`We use collected information to operate and improve the Site, display business listings and events, respond to inquiries, process payments for paid plans, and send updates you've requested (such as "notify me" signups for upcoming features).`})}),(0,j.jsx)(Eu,{title:`4. Third-Party Services`,children:(0,j.jsx)(`p`,{children:`We rely on third-party providers to operate the Site, including Supabase (database, authentication, and file storage), Vercel (hosting), and â for paid plans â a payment processor such as Stripe. These providers process data on our behalf under their own privacy and security practices.`})}),(0,j.jsx)(Eu,{title:`5. Cookies`,children:(0,j.jsx)(`p`,{children:`The Site may use essential cookies or local storage required for core functionality, such as keeping you signed in. We do not currently use cookies for advertising or cross-site tracking.`})}),(0,j.jsx)(Eu,{title:`6. Data Retention`,children:(0,j.jsx)(`p`,{children:`We retain account and listing information for as long as your account or listing is active, and contact form submissions for as long as reasonably needed to respond to and document the inquiry.`})}),(0,j.jsx)(Eu,{title:`7. Your Rights & Choices`,children:(0,j.jsxs)(`p`,{children:[`You may request access to, correction of, or deletion of your personal information by contacting us through our `,(0,j.jsx)(`a`,{href:`/contact`,style:{color:`#C0392B`,fontWeight:700,textDecoration:`none`},children:`Contact page`}),`. Business owners can update or remove their own listing information by request.`]})}),(0,j.jsx)(Eu,{title:`8. Children's Privacy`,children:(0,j.jsx)(`p`,{children:`The Site is not directed at children under 13, and we do not knowingly collect personal information from children under 13.`})}),(0,j.jsx)(Eu,{title:`9. Data Security`,children:(0,j.jsx)(`p`,{children:`We use reasonable administrative and technical safeguards to protect information, but no method of transmission or storage is 100% secure, and we cannot guarantee absolute security.`})}),(0,j.jsx)(Eu,{title:`10. Changes to This Policy`,children:(0,j.jsx)(`p`,{children:`We may update this Privacy Policy from time to time. The "Last updated" date at the top of this page reflects the most recent revision.`})}),(0,j.jsx)(Eu,{title:`11. Contact Us`,children:(0,j.jsxs)(`p`,{children:[`Questions about this Privacy Policy can be sent through our `,(0,j.jsx)(`a`,{href:`/contact`,style:{color:`#C0392B`,fontWeight:700,textDecoration:`none`},children:`Contact page`}),`.`]})})]})}var ku=[{n:`1`,title:`Choose Your Duration`,body:`Select 1 week, 2 weeks, or a full month of guaranteed placement on the Palm Beach Comm homepage.`},{n:`2`,title:`Submit Your Business`,body:`Already listed? We activate your spotlight. Not listed yet? Start with a free listing and add the spotlight as an add-on.`},{n:`3`,title:`You're Featured`,body:`Your business card appears at the top of the Featured Local Businesses section â seen by every visitor to the homepage.`}],Au=[{label:`1 Week`,price:25,note:`Best for events or limited-time promos`,highlight:!1},{label:`2 Weeks`,price:45,note:`Most popular â double the visibility`,highlight:!0},{label:`1 Month`,price:80,note:`Maximum exposure at the best rate`,highlight:!1}],ju=[{q:`Who can buy a Featured Spotlight?`,a:`Any listed business â Free, Basic, Pro, or Elite. It's an add-on available to all tiers.`},{q:`How is this different from Elite's homepage slot?`,a:`Elite plan includes a guaranteed homepage rotation slot as part of their monthly subscription. The Featured Spotlight is a one-time or recurring purchase available to any tier, including Free.`},{q:`Where does my business appear?`,a:`In the "Featured Local Businesses" section on the Palm Beach Comm homepage â the most-visited page on the site.`},{q:`Can I run a Spotlight while on the Free plan?`,a:`Yes. Your business must be listed in our directory, but you don't need a paid subscription to purchase a spotlight.`},{q:`How do I buy one?`,a:`Email us or click "Get Featured" below. We'll confirm availability and send a payment link within 1 business day.`}];function Mu(){let e=cr()<768;return(0,j.jsxs)(`div`,{style:{background:`#F9F9F9`,minHeight:`100vh`},children:[(0,j.jsxs)(`div`,{style:{background:`#111`,padding:e?`52px 0 44px`:`72px 0 60px`,position:`relative`,overflow:`hidden`},children:[(0,j.jsx)(`div`,{style:{position:`absolute`,top:0,left:0,right:0,height:4,background:`#F0C419`}}),(0,j.jsx)(M,{children:(0,j.jsxs)(`div`,{style:{maxWidth:640,margin:`0 auto`,textAlign:`center`},children:[(0,j.jsx)(`div`,{style:{display:`inline-flex`,alignItems:`center`,gap:8,background:`#F0C419`,borderRadius:999,padding:`5px 18px`,fontSize:12,fontWeight:800,color:`#111`,letterSpacing:`0.06em`,textTransform:`uppercase`,marginBottom:20},children:`â Add-On Feature`}),(0,j.jsx)(`h1`,{style:{fontSize:e?32:46,fontWeight:900,color:`#fff`,lineHeight:1.1,marginBottom:16},children:`Featured Spotlight`}),(0,j.jsx)(`p`,{style:{fontSize:e?14:16,color:`rgba(255,255,255,0.7)`,lineHeight:1.7,marginBottom:32},children:`Guaranteed placement at the top of the Palm Beach Comm homepage. Your business â front and center â seen by every visitor to the site.`}),(0,j.jsxs)(`div`,{style:{display:`flex`,gap:12,justifyContent:`center`,flexWrap:`wrap`},children:[(0,j.jsx)(`a`,{href:`mailto:[email protected]?subject=Featured%20Spotlight%20Inquiry`,style:{display:`inline-block`,background:`#F0C419`,color:`#111`,fontWeight:800,fontSize:15,padding:`13px 32px`,borderRadius:999,textDecoration:`none`},children:`Get Featured â Starting at $25 â`}),(0,j.jsx)(A,{to:`/pricing`,style:{display:`inline-block`,background:`rgba(255,255,255,0.1)`,color:`#fff`,fontWeight:600,fontSize:14,padding:`13px 24px`,borderRadius:999,textDecoration:`none`},children:`View All Plans`})]})]})})]}),(0,j.jsx)(M,{children:(0,j.jsxs)(`div`,{style:{padding:`52px 0`,display:`flex`,flexDirection:`column`,gap:52},children:[(0,j.jsxs)(`section`,{children:[(0,j.jsxs)(`div`,{style:{textAlign:`center`,marginBottom:32},children:[(0,j.jsx)(`h2`,{style:{fontSize:26,fontWeight:900,color:`#111`,marginBottom:8},children:`What Visitors See`}),(0,j.jsx)(`p`,{style:{fontSize:14,color:`#9CA3AF`},children:`Your business appears in the highlighted Featured Local Businesses section on the homepage.`})]}),(0,j.jsxs)(`div`,{style:{background:`#fff`,borderRadius:20,border:`1px solid #EBEBEB`,padding:e?20:36,boxShadow:`0 4px 24px rgba(0,0,0,0.06)`},children:[(0,j.jsxs)(`div`,{style:{borderBottom:`1px solid #F3F4F6`,paddingBottom:20,marginBottom:24},children:[(0,j.jsx)(`div`,{style:{fontSize:11,fontWeight:800,color:`#C0392B`,textTransform:`uppercase`,letterSpacing:`0.08em`,marginBottom:6},children:`Featured`}),(0,j.jsx)(`div`,{style:{fontSize:20,fontWeight:900,color:`#111`},children:`Local Businesses`})]}),(0,j.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:e?`1fr`:`repeat(3, 1fr)`,gap:16},children:[(0,j.jsxs)(`div`,{style:{borderRadius:14,border:`2px solid #F0C419`,background:`#FFFBEB`,overflow:`hidden`,position:`relative`},children:[(0,j.jsx)(`div`,{style:{height:3,background:`#F0C419`}}),(0,j.jsx)(`div`,{style:{position:`absolute`,top:10,right:10,background:`#F0C419`,color:`#111`,fontSize:9,fontWeight:800,padding:`2px 8px`,borderRadius:999,textTransform:`uppercase`},children:`â Featured`}),(0,j.jsxs)(`div`,{style:{padding:18},children:[(0,j.jsx)(`div`,{style:{width:40,height:40,borderRadius:10,background:`#C0392B`,color:`#fff`,fontWeight:900,fontSize:16,display:`flex`,alignItems:`center`,justifyContent:`center`,marginBottom:10},children:`Y`}),(0,j.jsx)(`div`,{style:{fontWeight:800,fontSize:14,color:`#111`,marginBottom:2}
224,children:`Your Business Name`}),(0,j.jsx)(`div`,{style:{fontSize:11,color:`#9CA3AF`,marginBottom:8},children:`Your Category · Palm Beach`}),(0,j.jsx)(`div`,{style:{fontSize:11,color:`#6B7280`,lineHeight:1.5},children:`Your business description appears here, visible to everyone who visits the homepage...`})]})]}),[`Other Business`,`Another Listing`].map((e,t)=>(0,j.jsxs)(`div`,{style:{borderRadius:14,border:`1px solid #F0F0F0`,background:`#fff`,overflow:`hidden`,opacity:.5},children:[(0,j.jsx)(`div`,{style:{height:3,background:`#9CA3AF`}}),(0,j.jsxs)(`div`,{style:{padding:18},children:[(0,j.jsx)(`div`,{style:{width:40,height:40,borderRadius:10,background:`#E5E7EB`,marginBottom:10}}),(0,j.jsx)(`div`,{style:{fontWeight:700,fontSize:14,color:`#9CA3AF`,marginBottom:2},children:e}),(0,j.jsx)(`div`,{style:{fontSize:11,color:`#D1D5DB`,marginBottom:8},children:`Category · City`}),(0,j.jsx)(`div`,{style:{fontSize:11,color:`#E5E7EB`,lineHeight:1.5},children:`Regular listing shown below featured businesses.`})]})]},t))]}),(0,j.jsx)(`p`,{style:{fontSize:11,color:`#9CA3AF`,textAlign:`center`,marginTop:16},children:`Your card appears with a â Featured badge â gold border, highlighted background â standing out above all regular listings.`})]})]}),(0,j.jsxs)(`section`,{children:[(0,j.jsxs)(`div`,{style:{textAlign:`center`,marginBottom:32},children:[(0,j.jsx)(`h2`,{style:{fontSize:26,fontWeight:900,color:`#111`,marginBottom:8},children:`Spotlight Packages`}),(0,j.jsx)(`p`,{style:{fontSize:14,color:`#9CA3AF`},children:`Available to any listed business on any plan â no subscription required.`})]}),(0,j.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:e?`1fr`:`repeat(3, 1fr)`,gap:20},children:Au.map(e=>(0,j.jsxs)(`div`,{style:{background:e.highlight?`#111`:`#fff`,borderRadius:20,border:e.highlight?`2px solid #F0C419`:`1px solid #EBEBEB`,padding:`32px 28px`,textAlign:`center`,position:`relative`},children:[e.highlight&&(0,j.jsx)(`div`,{style:{position:`absolute`,top:-12,left:`50%`,transform:`translateX(-50%)`,background:`#F0C419`,color:`#111`,fontSize:11,fontWeight:800,padding:`3px 14px`,borderRadius:999,whiteSpace:`nowrap`},children:`Most Popular`}),(0,j.jsx)(`div`,{style:{fontSize:15,fontWeight:800,color:e.highlight?`#F0C419`:`#374151`,marginBottom:8},children:e.label}),(0,j.jsxs)(`div`,{style:{fontSize:42,fontWeight:900,color:e.highlight?`#fff`:`#111`,lineHeight:1,marginBottom:4},children:[`$`,e.price]}),(0,j.jsx)(`div`,{style:{fontSize:12,color:e.highlight?`rgba(255,255,255,0.5)`:`#9CA3AF`,marginBottom:20},children:`one-time`}),(0,j.jsx)(`p`,{style:{fontSize:13,color:e.highlight?`rgba(255,255,255,0.7)`:`#6B7280`,lineHeight:1.6,marginBottom:24},children:e.note}),(0,j.jsx)(`a`,{href:`mailto:[email protected]?subject=Featured%20Spotlight%20Inquiry`,style:{display:`block`,padding:`11px 0`,borderRadius:999,fontWeight:700,fontSize:13,textDecoration:`none`,background:e.highlight?`#F0C419`:`#C0392B`,color:e.highlight?`#111`:`#fff`},children:`Get Featured â`})]},e.label))}),(0,j.jsx)(`p`,{style:{fontSize:12,color:`#9CA3AF`,textAlign:`center`,marginTop:16},children:`Final pricing confirmed with owner before launch. Volume discounts available for recurring monthly purchases.`})]}),(0,j.jsxs)(`section`,{children:[(0,j.jsx)(`div`,{style:{textAlign:`center`,marginBottom:32},children:(0,j.jsx)(`h2`,{style:{fontSize:26,fontWeight:900,color:`#111`,marginBottom:8},children:`How It Works`})}),(0,j.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:e?`1fr`:`repeat(3, 1fr)`,gap:20},children:ku.map(e=>(0,j.jsxs)(`div`,{style:{background:`#fff`,borderRadius:20,border:`1px solid #EBEBEB`,padding:28},children:[(0,j.jsx)(`div`,{style:{width:40,height:40,borderRadius:`50%`,background:`#F0C419`,color:`#111`,fontWeight:900,fontSize:18,display:`flex`,alignItems:`center`,justifyContent:`center`,marginBottom:16},children:e.n}),(0,j.jsx)(`h3`,{style:{fontSize:15,fontWeight:800,color:`#111`,marginBottom:8},children:e.title}),(0,j.jsx)(`p`,{style:{fontSize:13,color:`#6B7280`,lineHeight:1.7},children:e.body})]},e.n))})]}),(0,j.jsxs)(`section`,{children:[(0,j.jsx)(`div`,{style:{textAlign:`center`,marginBottom:32},children:(0,j.jsx)(`h2`,{style:{fontSize:26,fontWeight:900,color:`#111`,marginBottom:8},children:`Frequently Asked Questions`})}),(0,j.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:12,maxWidth:700,margin:`0 auto`}
224,children:ju.map((e,t)=>(0,j.jsxs)(`div`,{style:{background:`#fff`,borderRadius:14,border:`1px solid #EBEBEB`,padding:`20px 24px`},children:[(0,j.jsxs)(`div`,{style:{fontSize:14,fontWeight:800,color:`#111`,marginBottom:8},children:[`Q: `,e.q]}),(0,j.jsx)(`div`,{style:{fontSize:13,color:`#6B7280`,lineHeight:1.7},children:e.a})]},t))})]}),(0,j.jsx)(`section`,{children:(0,j.jsxs)(`div`,{style:{background:`#C0392B`,borderRadius:24,padding:e?`40px 24px`:`52px 48px`,textAlign:`center`},children:[(0,j.jsx)(`h2`,{style:{fontSize:e?24:32,fontWeight:900,color:`#fff`,marginBottom:12},children:`Ready to Get Featured?`}),(0,j.jsx)(`p`,{style:{fontSize:14,color:`rgba(255,255,255,0.75)`,lineHeight:1.7,marginBottom:28,maxWidth:440,margin:`0 auto 28px`},children:`Email us to reserve your spotlight dates. We confirm within 1 business day.`}),(0,j.jsxs)(`div`,{style:{display:`flex`,gap:12,justifyContent:`center`,flexWrap:`wrap`},children:[(0,j.jsx)(`a`,{href:`mailto:[email protected]?subject=Featured%20Spotlight%20Inquiry`,style:{display:`inline-block`,background:`#F0C419`,color:`#111`,fontWeight:800,fontSize:14,padding:`13px 32px`,borderRadius:999,textDecoration:`none`},children:`Email Us to Book â`}),(0,j.jsx)(A,{to:`/advertise`,style:{display:`inline-block`,background:`rgba(255,255,255,0.15)`,color:`#fff`,fontWeight:600,fontSize:14,padding:`13px 24px`,borderRadius:999,textDecoration:`none`},children:`View Ad Packages Instead`})]})]})})]})})]})}var Nu=[`Housing`,`Food & Nutrition`,`Health & Wellness`,`Youth & Families`,`Education`,`Senior Services`,`Mental Health`,`Giveaways & Free Items`],Pu={title:``,organization:``,category:`Housing`,description:``,phone:``,website_url:``,address:``,city:``,active:!0,image_url:``,featured:!1,featured_on_listing:!1};function Fu(){let[e,t]=(0,_.useState)([]),[n,r]=(0,_.useState)(Pu),[i,a]=(0,_.useState)(null),[o,s]=(0,_.useState)(!1),[c,l]=(0,_.useState)(!1),[u,d]=(0,_.useState)(``),f=(0,_.useRef)();(0,_.useEffect)(()=>{p()},[]);async function p(){let{data:e}=await z.from(`resources`).select(`*`).order(`category`);e&&t(e)}function m(e,t){r(n=>({...n,[e]:t}))}function h(e){a(e.id),r(e),d(``)}function g(){a(`new`),r(Pu),d(``)}function v(){a(null),r(Pu)}async function y(e){let t=e.target.files?.[0];if(!t)return;l(!0);let n=t.name.split(`.`).pop(),r=`resources/${Date.now()}.${n}`,{error:i}=await z.storage.from(`business-logos`).upload(r,t,{upsert:!0});if(!i){let{data:{publicUrl:e}}=z.storage.from(`business-logos`).getPublicUrl(r);m(`image_url`,e)}l(!1)}async function b(e){e.preventDefault(),s(!0);let t={...n};delete t.id;let r;if(i===`new`?{error:r}=await z.from(`resources`).insert(t):{error:r}=await z.from(`resources`).update(t).eq(`id`,i),s(!1),r){d(`Error: `+r.message);return}d(`Saved!`),v(),p(),setTimeout(()=>d(``),3e3)}async function x(e){confirm(`Delete this resource?`)&&(await z.from(`resources`).delete().eq(`id`,e),p())}async function S(e){await z.from(`resources`).update({active:!e.active}).eq(`id`,e.id),p()}return(0,j.jsxs)(`div`,{style:{padding:32,maxWidth:960},children:[(0,j.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:24},children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`h1`,{style:{fontSize:22,fontWeight:900,color:`#111`,marginBottom:2},children:`Community Resources`}),(0,j.jsxs)(`p`,{style:{fontSize:13,color:`#9CA3AF`},children:[e.length,` resource`,e.length===1?``:`s`,` total`]})]}),(0,j.jsx)(`button`,{onClick:g,style:{background:`#C0392B`,color:`#fff`,fontWeight:700,fontSize:13,padding:`10px 20px`,borderRadius:8,border:`none`,cursor:`pointer`},children:`+ Add Resource`})]}),u&&(0,j.jsx)(`div`,{style:{background:`#F0FDF4`,border:`1px solid #BBF7D0`,borderRadius:8,padding:`10px 16px`,fontSize:13,color:`#15803D`,marginBottom:16},children:u}),i&&(0,j.jsxs)(`div`,{style:{background:`#fff`,border:`1px solid #EBEBEB`,borderRadius:16,padding:28,marginBottom:28},children:[(0,j.jsx)(`h3`,{style:{fontSize:15,fontWeight:800,color:`#111`,marginBottom:20},children:i===`new`?`Add New Resource`:`Edit Resource`}),(0,j.jsxs)(`form`,{onSubmit:b,children:[(0,j.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`1fr 1fr`,gap:14},children:[(0,j.jsx)(Ru,{label:`Resource Title`,value:n.title,onChange:e=>m(`title`,e),required:!0}),(0,j.jsx)(Ru,{label:`Organization Name`,value:n.organization,onChange:e=>m(`organization`,e),required:!0}),(0,j.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:6},children:[(0,j.jsx)(`label`,{style:Iu,children:`Category`}),(0,j.jsx)(`select`,{value:n.category,onChange:e=>m(`category`,e.target.value),style:Lu,children:Nu.map(e=>(0,j.jsx)(`option`,{children:e},e))})]}),(0,j.jsx)(Ru,{label:`Phone`,value:n.phone,onChange:e=>
224m(`phone`,e)}),(0,j.jsx)(Ru,{label:`Website URL`,value:n.website_url,onChange:e=>m(`website_url`,e)}),(0,j.jsx)(Ru,{label:`City`,value:n.city,onChange:e=>m(`city`,e)}),(0,j.jsx)(`div`,{style:{gridColumn:`1 / -1`},children:(0,j.jsx)(Ru,{label:`Address`,value:n.address,onChange:e=>m(`address`,e)})}),(0,j.jsxs)(`div`,{style:{gridColumn:`1 / -1`,display:`flex`,flexDirection:`column`,gap:6},children:[(0,j.jsx)(`label`,{style:Iu,children:`Description`}),(0,j.jsx)(`textarea`,{value:n.description,onChange:e=>m(`description`,e.target.value),rows:3,style:{...Lu,resize:`vertical`}})]}),(0,j.jsxs)(`div`,{style:{gridColumn:`1 / -1`,display:`flex`,flexDirection:`column`,gap:8},children:[(0,j.jsx)(`label`,{style:Iu,children:`Resource Image (optional)`}),n.image_url&&(0,j.jsxs)(`div`,{style:{position:`relative`,display:`inline-block`},children:[(0,j.jsx)(`img`,{src:n.image_url,alt:`Resource`,style:{width:`100%`,maxHeight:140,objectFit:`cover`,borderRadius:10,display:`block`}}),(0,j.jsx)(`button`,{type:`button`,onClick:()=>m(`image_url`,``),style:{position:`absolute`,top:8,right:8,background:`#fff`,border:`none`,borderRadius:`50%`,width:26,height:26,cursor:`pointer`,fontWeight:700,fontSize:14,color:`#C0392B`,boxShadow:`0 1px 4px rgba(0,0,0,0.2)`},children:`Ã`})]}),(0,j.jsx)(`input`,{ref:f,type:`file`,accept:`image/*`,onChange:y,style:{display:`none`}}),(0,j.jsx)(`button`,{type:`button`,onClick:()=>f.current?.click(),disabled:c,style:{padding:`9px 16px`,borderRadius:8,border:`1px dashed #D1D5DB`,background:`#FAFAFA`,fontSize:13,color:`#6B7280`,cursor:`pointer`,textAlign:`left`},children:c?`â³ Uploading...`:n.image_url?`ð Replace Image`:`ð· Upload Image`})]}),(0,j.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,j.jsx)(`input`,{type:`checkbox`,checked:n.active,onChange:e=>m(`active`,e.target.checked),id:`res-active`}),(0,j.jsx)(`label`,{htmlFor:`res-active`,style:{fontSize:13,color:`#374151`,fontWeight:600},children:`Active (visible to public)`})]}),(0,j.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,j.jsx)(`input`,{type:`checkbox`,checked:n.featured,onChange:e=>m(`featured`,e.target.checked),id:`res-featured`}),(0,j.jsx)(`label`,{htmlFor:`res-featured`,style:{fontSize:13,color:`#374151`,fontWeight:600},children:`Featured (shows on homepage)`})]}),(0,j.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,j.jsx)(`input`,{type:`checkbox`,checked:n.featured_on_listing,onChange:e=>m(`featured_on_listing`,e.target.checked),id:`res-featured-listing`}),(0,j.jsx)(`label`,{htmlFor:`res-featured-listing`,style:{fontSize:13,color:`#374151`,fontWeight:600},children:`Featured on Resources page (sorted to top with checkmark)`})]})]}),(0,j.jsxs)(`div`,{style:{display:`flex`,gap:10,marginTop:20},children:[(0,j.jsx)(`button`,{type:`submit`,disabled:o,style:{background:`#C0392B`,color:`#fff`,fontWeight:700,fontSize:13,padding:`9px 24px`,borderRadius:999,border:`none`,cursor:`pointer`},children:o?`Saving...`:`Save Resource`}),(0,j.jsx)(`button`,{type:`button`,onClick:v,style:{background:`#F3F4F6`,color:`#374151`,fontWeight:600,fontSize:13,padding:`9px 20px`,borderRadius:999,border:`none`,cursor:`pointer`},children:`Cancel`})]})]})]}),(0,j.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:10},children:[e.length===0&&(0,j.jsx)(`div`,{style:{textAlign:`center`,padding:`48px 0`,color:`#9CA3AF`,fontSize:14},children:`No resources yet. Click "+ Add Resource" to get started.`}),e.map(e=>(0,j.jsxs)(`div`,{style:{background:`#fff`,border:`1px solid #EBEBEB`,borderRadius:12,padding:`16px 20px`,display:`flex`,alignItems:`center`,gap:16,flexWrap:`wrap`},children:[e.image_url?(0,j.jsx)(`img`,{src:e.image_url,alt:``,style:{width:52,height:40,objectFit:`cover`,borderRadius:8,flexShrink:0}}):(0,j.jsx)(`div`,{style:{width:52,height:40,borderRadius:8,background:`#F3F4F6`,display:`flex`,alignItems:`center`,justifyContent:`center`,fontSize:18,flexShrink:0},children:`ð¤`}),(0,j.jsxs)(`div`,{style:{flex:1,minWidth:200},children:[(0,j.jsx)(`div`,{style:{fontSize:14,fontWeight:700,color:`#111`},children:e.title}),(0,j.jsxs)(`div`,{style:{fontSize:12,color:`#6B7280`,marginTop:2},children:[e.organization,` · `,e.category]}),e.city&&(0,j.jsxs)(`div`,{style:{fontSize:12,color:`#9CA3AF`,marginTop:1},children:[`ð `,e.city]})]}),(0,j.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,j.jsx)(`span`,{style:{fontSize:11,fontWeight:700,padding:`3px 10px`,borderRadius:999,background:e.active?`#F0FDF4`:`#F3F4F6`,color:e.active?`#16A34A`:`#9CA3AF`},children:e.active?`Active`:`Hidden`}),(0,j.jsx)(`button`,{onClick:()=>S(e),style:{fontSize:12,padding:`5px 12px`,borderRadius:999,border:`1px solid #E5E7EB`,background:`#fff`,cursor:`pointer`,color:`#374151`},children:e.active?`Hide`:`Show`}),(0,j.jsx)(`a`,{href:`/resources`,target:`_blank`,rel:`noopener noreferrer`,style:{fontSize:12,padding:`5px 12px`,borderRadius:999,border:`1px solid #D1FAE5`,background:`#F0FDF4`,cursor:`pointer`,color:`#16A34A`,textDecoration:`none`},children:`View â`}),(0,j.jsx)(`button`,{onClick:()=>h(e),style:{fontSize:12,padding:`5px 12px`,borderRadius:999,border:`1px solid #E5E7EB`,background:`#fff`,cursor:`pointer`,color:`#374151`},children:`Edit`}),(0,j.jsx)(`button`,{onClick:()=>x(e.id),style:{fontSize:12,padding:`5px 12px`,borderRadius:999,border:`1px solid #FECACA`,background:`#FEF2F2`,cursor:`pointer`,color:`#DC2626`},children:`Delete`})]})]},e.id))]})]})}var Iu={fontSize:11,fontWeight:700,color:`#374151`,textTransform:`uppercase`,letterSpacing:`0.04em`},Lu={padding:`9px 12px`,borderRadius:8,border:`1px solid #E5E7EB`,fontSize:13,color:`#111`,outline:`none`,width:`100%`,boxSizing:`border-box`};function Ru({label:e,value:t,onChange:n,required:r}){return(0,j.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:6},children:[(0,j.jsx)(`label`,{style:Iu,children:e}),(0,j.jsx)(`input`,{value:t,onChange:e=>n(e.target.value),required:r,style:Lu,onFocus:e=>e.target.style.borderColor=`#C0392B`,onBlur:e=>e.target.style.borderColor=`#E5E7EB`})]})}function zu(){let e=yt(),[t,n]=(0,_.useState)(``),[r,i]=(0,_.useState)(``),[a,o]=(0,_.useState)(``),[s,c]=(0,_.useState)(!1);async function l(n){n.preventDefault(),o(``),c(!0);let{error:i}=await z.auth.signInWithPassword({email:t,password:r});i?o(i.message):e(`/admin`),c(!1)}return(0,j.jsx)(`div`,{style:{minHeight:`100vh`,background:`#F5F5F5`,display:`flex`,alignItems:`center`,justifyContent:`center`,padding:24},children:(0,j.jsxs)(`div`,{style:{background:`#fff`,borderRadius:16,border:`1px solid #EBEBEB`,padding:`40px 36px`,width:`100%`,maxWidth:380,boxSh
224adow:`0 4px 24px rgba(0,0,0,0.06)`},children:[(0,j.jsxs)(`div`,{style:{textAlign:`center`,marginBottom:28},children:[(0,j.jsx)(`div`,{style:{fontSize:36,marginBottom:10},children:`ð´`}),(0,j.jsx)(`h1`,{style:{fontSize:20,fontWeight:900,color:`#111`,marginBottom:4},children:`Palm Beach Comm`}),(0,j.jsx)(`p`,{style:{fontSize:13,color:`#9CA3AF`},children:`Admin Panel`})]}),(0,j.jsxs)(`form`,{onSubmit:l,style:{display:`flex`,flexDirection:`column`,gap:14},children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`label`,{style:{display:`block`,fontSize:11,fontWeight:600,color:`#6B7280`,textTransform:`uppercase`,letterSpacing:`0.04em`,marginBottom:6},children:`Email`}),(0,j.jsx)(`input`,{type:`email`,value:t,onChange:e=>n(e.target.value),required:!0,placeholder:`[email protected]`,style:{width:`100%`,padding:`10px 14px`,borderRadius:8,border:`1px solid #E5E7EB`,fontSize:14,outline:`none`,boxSizing:`border-box`,color:`#111`},onFocus:e=>e.target.style.borderColor=`#C0392B`,onBlur:e=>e.target.style.borderColor=`#E5E7EB`})]}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`label`,{style:{display:`block`,fontSize:11,fontWeight:600,color:`#6B7280`,textTransform:`uppercase`,letterSpacing:`0.04em`,marginBottom:6},children:`Password`}),(0,j.jsx)(`input`,{type:`password`,value:r,onChange:e=>i(e.target.value),required:!0,placeholder:`â¢â¢â¢â¢â¢â¢â¢â¢`,style:{width:`100%`,padding:`10px 14px`,borderRadius:8,border:`1px solid #E5E7EB`,fontSize:14,outline:`none`,boxSizing:`border-box`,color:`#111`},onFocus:e=>e.target.style.borderColor=`#C0392B`,onBlur:e=>e.target.style.borderColor=`#E5E7EB`})]}),a&&(0,j.jsx)(`div`,{style:{background:`#FEF2F2`,border:`1px solid #FECACA`,borderRadius:8,padding:`10px 14px`,fontSize:13,color:`#DC2626`},children:a}),(0,j.jsx)(`button`,{type:`submit`,disabled:s,style:{background:`#C0392B`,color:`#fff`,fontWeight:700,fontSize:14,padding:`11px`,borderRadius:8,border:`none`,cursor:s?`not-allowed`:`pointer`,opacity:s?.7:1,marginTop:4},children:s?`Signing in...`:`Sign In`})]})]})})}var Bu=[{label:`ð¢ Businesses`,to:`/admin/businesses`},{label:`ð¤ Resources`,to:`/admin/resources`},{label:`ð
Events`,to:`/admin/events`},{label:`âï¸ Blog Posts`,to:`/admin/posts`},{label:`ð£ Ads`,to:`/admin/ads`},{label:`âï¸ Messages`,to:`/admin/contacts`},{label:`ð¬ Inquiries`,to:`/admin/inquiries`},{label:`ð Beta Applications`,to:`/admin/beta`},{label:`â Reviews`,to:`/admin/reviews`}];function Vu(){let e=yt(),t=O(),[n,r]=(0,_.useState)(null),[i,a]=(0,_.useState)(!0),[o,s]=(0,_.useState)(!1),c=cr()<900;(0,_.useEffect)(()=>{z.auth.getSession().then(({data:{session:t}})=>{if(!t){e(`/admin/login`);return}if(t.user?.user_metadata?.is_admin!==!0){e(`/`);return}r(t.user),a(!1)})},[]);async function l(){await z.auth.signOut(),e(`/admin/login`)}if(i)return null;let u=(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`div`,{style:{padding:`20px 20px 16px`,borderBottom:`1px solid #EBEBEB`},children:[(0,j.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`},children:[(0,j.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,j.jsx)(`span`,{style:{fontSize:20},children:`ð´`}),(0,j.jsx)(`span`,{style:{fontWeight:800,fontSize:15,color:`#111`},children:`PBC Admin`})]}),c&&(0,j.jsx)(`button`,{onClick:()=>s(!1),style:{background:`none`,border:`none`,fontSize:22,color:`#9CA3AF`,cursor:`pointer`,lineHeight:1},children:`Ã`})]}),(0,j.jsx)(`div`,{style:{fontSize:11,color:`#9CA3AF`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,marginTop:4},children:n?.email})]}),(0,j.jsx)(`nav`,{style:{padding:`12px 12px`,flex:1},children:Bu.map(({label:e,to:n})=>{let r=t.pathname===n||t.pathname.startsWith(n+`/`);return(0,j.jsx)(A,{to:n,onClick:()=>c&&s(!1),style:{display:`block`,padding:`9px 12px`,borderRadius:8,fontSize:13,fontWeight:r?700:500,color:r?`#fff`:`#4B5563`,background:r?`#C0392B`:`transparent`,textDecoration:`none`,marginBottom:2},onMouseEnter:e=>{r||(e.currentTarget.style.background=`#F5F5F5`)},onMouseLeave:e=>{r||(e.currentTarget.style.background=`transparent`)},children:e},n)})}),(0,j.jsxs)(`div`,{style:{padding:`12px 12px`,borderTop:`1px solid #EBEBEB`},children:[(0,j.jsx)(A,{to:`/`,style:{display:`block`,padding:`8px 12px`,fontSize:12,color:`#9CA3AF`,textDecoration:`none`,borderRadius:8,marginBottom:2},onMouseEnter:e=>e.currentTarget.style.color=`#374151`,onMouseLeave:e=>e.currentTarget.style.color=`#9CA3AF`,children:`â View Site`}),(0,j.jsx)(`button`,{onClick:l,style:{width:`100%`,textAlign:`left`,padding:`8px 12px`,fontSize:12,color:`#9CA3AF`,background:`none`,border:`none`,cursor:`pointer`,borderRadius:8},onMouseEnter:e=>e.currentTarget.style.color=`#C0392B`,onMouseLeave:e=>e.currentTarget.style.color=`#9CA3AF`,children:`Sign Out`})]})]});return(0,j.jsxs)(`div`,{style:{display:`flex`,minHeight:`100vh`,background:`#F5F5F5`},children:[!c&&(0,j.jsx)(`div`,{style:{width:220,background:`#fff`,borderRight:`1px solid #EBEBEB`,display:`flex`,flexDirection:`column`,flexShrink:0,position:`sticky`,top:0,height:`100vh`},children:u}),c&&o&&(0,j.jsxs)(`div`,{style:{position:`fixed`,inset:0,zIndex:100,display:`flex`},onClick:e=>e.target===e.currentTarget&&s(!1),children:[(0,j.jsx)(`div`,{style:{width:240,background:`#fff`,height:`100%`,dis
224play:`flex`,flexDirection:`column`,boxShadow:`4px 0 24px rgba(0,0,0,0.12)`},children:u}),(0,j.jsx)(`div`,{style:{flex:1,background:`rgba(0,0,0,0.4)`}})]}),(0,j.jsxs)(`div`,{style:{flex:1,overflow:`auto`,minWidth:0},children:[c&&(0,j.jsxs)(`div`,{style:{background:`#fff`,borderBottom:`1px solid #EBEBEB`,padding:`12px 16px`,display:`flex`,alignItems:`center`,gap:12,position:`sticky`,top:0,zIndex:10},children:[(0,j.jsxs)(`button`,{onClick:()=>s(!0),style:{background:`none`,border:`none`,cursor:`pointer`,padding:4,display:`flex`,flexDirection:`column`,gap:4},children:[(0,j.jsx)(`span`,{style:{display:`block`,width:20,height:2,background:`#374151`,borderRadius:2}}),(0,j.jsx)(`span`,{style:{display:`block`,width:20,height:2,background:`#374151`,borderRadius:2}}),(0,j.jsx)(`span`,{style:{display:`block`,width:20,height:2,background:`#374151`,borderRadius:2}})]}),(0,j.jsx)(`span`,{style:{fontWeight:800,fontSize:15,color:`#111`},children:`ð´ PBC Admin`})]}),(0,j.jsx)(qt,{})]})]})}var Hu=Object.keys(Hc),Uu={name:``,slug:``,category:``,city:``,address:``,phone:``,email:``,website_url:``,description:``,tier:`free`,badge:``,active:!0,logo_initial:``,logo_bg_color:`#C0392B`,avg_rating:``,review_count:``,logo_url:``,photos:[],facebook_url:``,instagram_url:``,youtube_url:``,beta_trial_ends_at:``};function Wu(e){if(!e)return null;let t=new Date(e).setHours(0,0,0,0)-new Date().setHours(0,0,0,0);return Math.round(t/864e5)}var Gu={free:1,basic:5,pro:15,elite:null};function Ku(e){if(e.trim().startsWith(`+`))return e;let t=e.replace(/\D/g,``);return t.length===11&&t.startsWith(`1`)&&(t=t.slice(1)),t=t.slice(0,10),t.length===0?``:t.length<4?`(${t}`:t.length<7?`(${t.slice(0,3)}) ${t.slice(3)}`:`(${t.slice(0,3)}) ${t.slice(3,6)}-${t.slice(6)}`}var qu={free:`#6B7280`,basic:`#3B82F6`,pro:`#C0392B`,elite:`#F59E0B`};function Ju(){let[e,t]=(0,_.useState)([]),[n,r]=(0,_.useState)(null),[i,a]=(0,_.useState)(Uu),[o,s]=(0,_.useState)(!1),[c,l]=(0,_.useState)(!1),[u,d]=(0,_.useState)(!1),f=(0,_.useRef)(null),p=(0,_.useRef)(null);(0,_.useEffect)(()=>{m()},[]);async function m(){let{data:e}=await z.from(`businesses`).select(`*`).order(`created_at`,{ascending:!1});t(e||[])}function h(){r(`new`),a(Uu)}function g(e){r(e.id),a({...Uu,...e})}function v(){r(null),a(Uu)}function y(e,t){a(n=>({...n,[e]:t}))}async function b(e){let t=e.target.files?.[0];if(!t)return;l(!0);let n=t.name.split(`.`).pop(),r=`${Date.now()}.${n}`,{data:i,error:a}=await z.storage.from(`business-logos`).upload(r,t,{upsert:!0});if(a){alert(`Upload failed: `+a.message),l(!1);return}let{data:o}=z.storage.from(`business-logos`).getPublicUrl(i.path);y(`logo_url`,o.publicUrl),l(!1)}async function x(e){let t=Array.from(e.target.files||[]);if(!t.length)return;let n=Gu[i.tier],r=Array.isArray(i.photos)?i.photos:[],a=n===null?t.length:Math.max(0,n-r.length),o=t.slice(0,a);if(o.length===0){alert(`Your ${i.tier} plan allows ${n} photo${n===1?``:`s`}. Remove some to add more.`);return}d(!0);let s=[];for(let e of o){let t=e.name.split(`.`).pop(),n=`photos/${Date.now()}-${Math.random().toString(36).slice(2)}.${t}`,{data:r,error:i}=await z.storage.from(`business-logos`).upload(n,e,{upsert:!0});if(!i){let{data:e}=z.storage.from(`business-logos`).getPublicUrl(r.path);s.push(e.publicUrl)}}y(`photos`,[...r,...s]),d(!1),e.target.value=``}function S(e){y(`photos`,(i.photos||[]).filter((t,n)=>n!==e))}async function C(){s(!0);let e={...i,slug:i.slug||i.name.toLowerCase().replace(/\s+/g,`-`).replace(/[^a-z0-9-]/g,``),avg_rating:i.avg_rating?parseFloat(i.avg_rating):null,review_count:i.review_count?parseInt(i.review_count):0,beta_trial_ends_at:i.beta_trial_ends_at||null},t;if(n===`new`?{error:t}=await z.from(`businesses`).insert(e):{error:t}=await z.from(`businesses`).update(e).eq(`id`,n),s(!1),t){alert(`Save failed: `+t.message);return}v(),m()}async function w(e){await z.from(`businesses`).update({active:!e.active}).eq(`id`,e.id),m()}async function ee(e){confirm(`Delete this listing? This cannot be undone.`)&&(await z.from(`businesses`).delete().eq(`id`,e),m())}function te(){let t=`Name,Email\n${e.filter(e=>e.email).map(e=>`"${e.name}","${e.email}"`).join(` 225`)}`,n=new Blob([t],{type:`text/csv`}),r=URL.createObjectURL(n),i=document.createElement(`a`);i.href=r,i.download=`business-emails-${new Date().toISOString().slice(0,10)}.csv`,i.click(),URL.revokeObjectURL(r)}return(0,j.jsxs)(`div`,{style:{padding:32,maxWidth:1e3},children:[(0,j.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,marginBottom:24},children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`h1`,{style:{fontSize:22,fontWeight:900,color:`#111`,marginBottom:2},children:`Business Listings`}),(0,j.jsxs)(`p`,{style:{fontSize:13,color:`#9CA3AF`},children:[e.length,` listing`,e.length===1?``:`s`,` total`]})]}),(0,j.jsxs)(`div`,{style:{display:`flex`,gap:10},children:[e.some(e=>e.email)&&(0,j.jsx)(`button`,{onClick:te,style:{background:`#F59E0B`,color:`#111`,fontWeight:700,fontSize:13,padding:`10px 20px`,borderRadius:8,border:`none`,cursor:`pointer`},children:`ð§ Export Emails`}),(0,j.jsx)(`button`,{onClick:h,style:{background:`#C0392B`,color:`#fff`,fontWeight:700,fontSize:13,padding:`10px 20px`,borderRadius:8,border:`none`,cursor:`pointer`},children:`+ Add Listing`})]})]}),(0,j.jsx)(`div`,{style:{background:`#fff`,borderRadius:12,border:`1px solid #EBEBEB`,overflow:`auto`}
225,children:(0,j.jsxs)(`table`,{style:{width:`100%`,borderCollapse:`collapse`,fontSize:13,minWidth:1200},children:[(0,j.jsx)(`thead`,{children:(0,j.jsx)(`tr`,{style:{background:`#FAFAFA`,borderBottom:`1px solid #EBEBEB`},children:[`Name`,`Category`,`City`,`Email`,`Tier`,`Badge`,`Status`,`Actions`].map(e=>(0,j.jsx)(`th`,{style:{textAlign:`left`,padding:`10px 16px`,fontWeight:600,color:`#6B7280`,whiteSpace:`nowrap`},children:e},e))})}),(0,j.jsx)(`tbody`,{children:e.length===0?(0,j.jsx)(`tr`,{children:(0,j.jsx)(`td`,{colSpan:7,style:{padding:`48px 16px`,textAlign:`center`,color:`#9CA3AF`},children:`No listings yet. Click "+ Add Listing" to get started.`})}):e.map((t,n)=>(0,j.jsxs)(`tr`,{style:{borderBottom:n<e.length-1?`1px solid #F5F5F5`:`none`},children:[(0,j.jsx)(`td`,{style:{padding:`12px 16px`,fontWeight:600,color:`#111`},children:(0,j.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[t.logo_url?(0,j.jsx)(`img`,{src:t.logo_url,alt:``,style:{width:28,height:28,borderRadius:6,objectFit:`cover`,flexShrink:0}}):(0,j.jsx)(`div`,{style:{width:28,height:28,borderRadius:6,background:t.logo_bg_color||`#C0392B`,color:`#fff`,fontSize:12,fontWeight:700,display:`flex`,alignItems:`center`,justifyContent:`center`,flexShrink:0},children:t.logo_initial||t.name?.[0]}),t.name]})}),(0,j.jsx)(`td`,{style:{padding:`12px 16px`,color:`#6B7280`},children:t.category||`â`}),(0,j.jsx)(`td`,{style:{padding:`12px 16px`,color:`#6B7280`},children:t.city||`â`}),(0,j.jsx)(`td`,{style:{padding:`12px 16px`,color:`#6B7280`,fontSize:12,maxWidth:200,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:t.email?(0,j.jsx)(`a`,{href:`mailto:${t.email}`,style:{color:`#3B82F6`,textDecoration:`none`,fontWeight:500,display:`block`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},title:t.email,children:t.email}):(0,j.jsx)(`span`,{style:{color:`#D1D5DB`},children:`â`})}),(0,j.jsxs)(`td`,{style:{padding:`12px 16px`},children:[(0,j.jsx)(`span`,{style:{fontSize:11,fontWeight:700,padding:`3px 8px`,borderRadius:999,background:qu[t.tier]+`18`,color:qu[t.tier],textTransform:`capitalize`},children:t.tier}),t.beta_trial_ends_at&&(()=>{let e=Wu(t.beta_trial_ends_at),n=e<0;return(0,j.jsx)(`div`,{style:{fontSize:10,fontWeight:700,marginTop:4,color:n?`#DC2626`:e<=7?`#D97706`:`#9CA3AF`},children:n?`Trial ended ${-e}d ago`:`Trial: ${e}d left`})})()]}),(0,j.jsx)(`td`,{style:{padding:`12px 16px`,color:`#9CA3AF`,fontSize:12},children:t.badge||`â`}),(0,j.jsx)(`td`,{style:{padding:`12px 16px`},children:(0,j.jsx)(`button`,{onClick:()=>w(t),style:{fontSize:11,fontWeight:700,padding:`3px 10px`,borderRadius:999,border:`none`,cursor:`pointer`,background:t.active?`#F0FDF4`:`#F5F5F5`,color:t.active?`#15803D`:`#9CA3AF`},children:t.active?`Active`:`Hidden`})}),(0,j.jsx)(`td`,{style:{padding:`12px 16px`},children:(0,j.jsxs)(`div`,{style:{display:`flex`,gap:12},children:[(0,j.jsx)(`a`,{href:`/businesses/${t.slug||t.id}`,target:`_blank`,rel:`noopener noreferrer`,style:{fontSize:12,fontWeight:600,color:`#16A34A`,textDecoration:`none`},children:`View â`}),t.email&&(0,j.jsx)(`a`,{href:`mailto:${t.email}`,style:{fontSize:12,fontWeight:600,color:`#F59E0B`,textDecoration:`none`},children:`Email`}),(0,j.jsx)(`button`,{onClick:()=>g(t),style:{fontSize:12,fontWeight:600,color:`#3B82F6`,background:`none`,border:`none`,cursor:`pointer`,padding:0},children:`Edit`}),(0,j.jsx)(`button`,{onClick:()=>ee(t.id),style:{fontSize:12,fontWeight:600,color:`#EF4444`,background:`none`,border:`none`,cursor:`pointer`,padding:0},children:`Delete`})]})})]},t.id))})]})}),n&&(0,j.jsx)(`div`,{style:{position:`fixed`,inset:0,background:`rgba(0,0,0,0.45)`,display:`flex`,alignItems:`center`,justifyContent:`center`,zIndex:50,padding:24},onClick:e=>e.target===e.currentTarget&&v(),children:(0,j.jsxs)(`div`,{style:{background:`#fff`,borderRadius:16,width:`100%`,maxWidth:560,maxHeight:`90vh`,overflowY:`auto`,boxShadow:`0 20px 60px rgba(0,0,0,0.15)`},children:[(0,j.jsxs)(`div`,{style:{padding:`20px 24px 0`,display:`flex`,alignItems:`center`,justifyContent:`space-between`},children:[(0,j.jsx)(`h2`,{style:{fontSize:17,fontWeight:900,color:`#111`},children:n===`new`?`Add Listing`:`Edit Listing`}),(0,j.jsx)(`button`,{onClick:v,style:{background:`none`,border:`none`,fontSize:20,color:`#9CA3AF`,cursor:`pointer`,lineHeight:1},children:`Ã`})]}),(0,j.jsxs)(`div`,{style:{padding:`20px 24px`,display:`flex`,flexDirection:`column`,gap:14},children:[(0,j.jsxs)(Xu,{children:[(0,j.jsx)(Zu,{label:`Business N
225ame *`,value:i.name,onChange:e=>y(`name`,e),flex:2}),(0,j.jsx)(Zu,{label:`Logo Initial`,value:i.logo_initial,onChange:e=>y(`logo_initial`,e),placeholder:`e.g. H`})]}),(0,j.jsxs)(Xu,{children:[(0,j.jsx)(W,{label:`Category`,value:i.category,options:Uc,onChange:e=>y(`category`,e)}),(0,j.jsx)(W,{label:`Tier`,value:i.tier,options:Hu,onChange:e=>y(`tier`,e)})]}),(0,j.jsxs)(Xu,{children:[(0,j.jsx)(Zu,{label:`City`,value:i.city,onChange:e=>y(`city`,e)}),(0,j.jsx)(Zu,{label:`Phone`,value:i.phone,onChange:e=>y(`phone`,Ku(e)),placeholder:`(561) 555-0101 or +44 20 7946 0958`})]}),(0,j.jsx)(Xu,{children:(0,j.jsx)(Zu,{label:`Email`,type:`email`,value:i.email,onChange:e=>y(`email`,e),placeholder:`[email protected]`})}),(0,j.jsx)(Zu,{label:`Address`,value:i.address,onChange:e=>y(`address`,e)}),(0,j.jsx)(Zu,{label:`Website URL`,value:i.website_url,onChange:e=>y(`website_url`,e),placeholder:`https://`}),(0,j.jsx)(Qu,{label:`Description`,value:i.description,onChange:e=>y(`description`,e)}),(0,j.jsx)(Yu,{label:`Logo / Photo`}),(0,j.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:14},children:[i.logo_url?(0,j.jsx)(`img`,{src:i.logo_url,alt:`logo`,style:{width:56,height:56,borderRadius:10,objectFit:`cover`,border:`1px solid #EBEBEB`,flexShrink:0}}):(0,j.jsx)(`div`,{style:{width:56,height:56,borderRadius:10,background:i.logo_bg_color||`#C0392B`,color:`#fff`,fontSize:20,fontWeight:700,display:`flex`,alignItems:`center`,justifyContent:`center`,flexShrink:0},children:i.logo_initial||i.name?.[0]||`?`}),(0,j.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:6,flex:1},children:[(0,j.jsx)(`input`,{ref:f,type:`file`,accept:`image/*`,onChange:b,style:{display:`none`}}),(0,j.jsx)(`button`,{onClick:()=>f.current?.click(),disabled:c,style:{padding:`8px 16px`,background:`#F5F5F5`,border:`1px solid #E5E7EB`,borderRadius:8,fontSize:13,fontWeight:600,color:`#374151`,cursor:`pointer`},children:c?`Uploading...`:i.logo_url?`Replace Image`:`Upload Logo`}),i.logo_url&&(0,j.jsx)(`button`,{onClick:()=>y(`logo_url`,``),style:{padding:`4px 0`,background:`none`,border:`none`,fontSize:12,color:`#EF4444`,cursor:`pointer`,textAlign:`left`},children:`Remove image`})]}),(0,j.jsx)(Zu,{label:`BG Color`,value:i.logo_bg_color,onChange:e=>y(`logo_bg_color`,e),placeholder:`#C0392B`})]}),(0,j.jsx)(Yu,{label:`Photo Gallery`}),(0,j.jsx)($u,{tier:i.tier,photos:Array.isArray(i.photos)?i.photos:[],uploading:u,photoRef:p,onAdd:()=>p.current?.click(),onRemove:S,onUpload:x}),(0,j.jsx)(Yu,{label:`Social Media Links`}),(0,j.jsx)(Zu,{label:`Facebook URL`,value:i.facebook_url,onChange:e=>y(`facebook_url`,e),placeholder:`https://facebook.com/...`}),(0,j.jsx)(Zu,{label:`Instagram URL`,value:i.instagram_url,onChange:e=>y(`instagram_url`,e),placeholder:`https://instagram.com/...`}),(0,j.jsx)(Zu,{label:`YouTube URL`,value:i.youtube_url,onChange:e=>y(`youtube_url`,e),placeholder:`https://youtube.com/...`}),(0,j.jsx)(Yu,{label:`Ratings & Settings`}),(0,j.jsxs)(Xu,{children:[(0,j.jsx)(Zu,{label:`Avg Rating`,value:i.avg_rating,onChange:e=>y(`avg_rating`,e),placeholder:`e.g. 4.8`}),(0,j.jsx)(Zu,{label:`Review Count`,value:i.review_count,onChange:e=>y(`review_count`,e),placeholder:`e.g. 42`}),(0,j.jsx)(Zu,{label:`Badge`,value:i.badge,onChange:e=>y(`badge`,e),placeholder:`Verified`})]}),(0,j.jsx)(Zu,{label:`Slug (auto if blank)`,value:i.slug,onChange:e=>y(`slug`,e)}),(0,j.jsxs)(`div`,{style:{display:`flex`,gap:20,paddingTop:4},children:[(0,j.jsxs)(`label`,{style:{display:`flex`,alignItems:`center`,gap:6,fontSize:13,color:`#374151`,cursor:`pointer`},children:[(0,j.jsx)(`input`,{type:`checkbox`,checked:i.active,onChange:e=>y(`active`,e.target.checked)}),`Active (visible on site)`]}),(0,j.jsxs)(`label`,{style:{display:`flex`,alignItems:`center`,gap:6,fontSize:13,color:`#374151`,cursor:`pointer`},children:[(0,j.jsx)(`input`,{type:`checkbox`,checked:!!i.featured_spotlight_active,onChange:e=>y(`featured_spotlight_active`,e.target.checked)}),`Featured Spotlight (paid)`]})]}),(0,j.jsxs)(`div`,{style:{display:`flex`,alignItems:`flex-end`,gap:10,paddingTop:4},children:[(0,j.jsx)(`div`,{style:{flex:1},children:(0,j.jsx)(Zu,{label:`Beta Trial Ends`,type:`date`,value:i.beta_trial_ends_at,onChange:e=>y(`beta_trial_ends_at`,e)})}),(0,j.jsx)(`button`,{type:`button`,onClick:()=>{let e=new Date;e.setDate(e.getDate()+60),y(`beta_trial_ends_at`,e.toISOString().slice(0,10))},style:{padding:`9px 12px`,borderRadius:8,border:`1px solid #E5E7EB`,background:`#FAFAFA`,color:`#374151`,fontWeight:600,fontSize:12,cursor:`pointer`,whiteSpace:`nowrap`,marginBottom:1},children:`+60 days from today`})]})]}),(0,j.jsxs)(`div`,{style:{padding:`0 24px 24px`,display:`flex`,gap:10},children:[(0,j.jsx)(`button`,{onClick:C,disabled:o||!i.name,style:{flex:1,padding:`11px`,background:`#C0392B`,color:`#fff`,fontWeight:700,fontSize:14,borderRadius:8,border:`none`,cursor:o||!i.name?`not-allowed`:`pointer`,o
225pacity:o||!i.name?.6:1},children:o?`Saving...`:`Save Listing`}),(0,j.jsx)(`button`,{onClick:v,style:{padding:`11px 20px`,background:`#F5F5F5`,color:`#374151`,fontWeight:600,fontSize:14,borderRadius:8,border:`none`,cursor:`pointer`},children:`Cancel`})]})]})})]})}function Yu({label:e}){return(0,j.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10,marginTop:4},children:[(0,j.jsx)(`div`,{style:{fontSize:11,fontWeight:700,color:`#9CA3AF`,textTransform:`uppercase`,letterSpacing:`0.06em`,whiteSpace:`nowrap`},children:e}),(0,j.jsx)(`div`,{style:{flex:1,height:1,background:`#F0F0F0`}})]})}function Xu({children:e}){return(0,j.jsx)(`div`,{style:{display:`flex`,gap:12},children:e})}function Zu({label:e,value:t,onChange:n,placeholder:r=``,flex:i=1,type:a=`text`}){return(0,j.jsxs)(`div`,{style:{flex:i,display:`flex`,flexDirection:`column`,gap:4},children:[(0,j.jsx)(`label`,{style:{fontSize:11,fontWeight:600,color:`#6B7280`,textTransform:`uppercase`,letterSpacing:`0.04em`},children:e}),(0,j.jsx)(`input`,{type:a,value:t||``,onChange:e=>n(e.target.value),placeholder:r,style:{padding:`9px 12px`,borderRadius:8,border:`1px solid #E5E7EB`,fontSize:13,color:`#111`,outline:`none`,width:`100%`,boxSizing:`border-box`},onFocus:e=>e.target.style.borderColor=`#C0392B`,onBlur:e=>e.target.style.borderColor=`#E5E7EB`})]})}function Qu({label:e,value:t,onChange:n}){return(0,j.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:4},children:[(0,j.jsx)(`label`,{style:{fontSize:11,fontWeight:600,color:`#6B7280`,textTransform:`uppercase`,letterSpacing:`0.04em`},children:e}),(0,j.jsx)(`textarea`,{value:t||``,onChange:e=>n(e.target.value),rows:3,style:{padding:`9px 12px`,borderRadius:8,border:`1px solid #E5E7EB`,fontSize:13,color:`#111`,outline:`none`,resize:`vertical`,fontFamily:`inherit`,boxSizing:`border-box`,width:`100%`},onFocus:e=>e.target.style.borderColor=`#C0392B`,onBlur:e=>e.target.style.borderColor=`#E5E7EB`})]})}function W({label:e,value:t,options:n,onChange:r,flex:i=1}){return(0,j.jsxs)(`div`,{style:{flex:i,display:`flex`,flexDirection:`column`,gap:4},children:[(0,j.jsx)(`label`,{style:{fontSize:11,fontWeight:600,color:`#6B7280`,textTransform:`uppercase`,letterSpacing:`0.04em`},children:e}),(0,j.jsxs)(`select`,{value:t||``,onChange:e=>r(e.target.value),style:{padding:`9px 12px`,borderRadius:8,border:`1px solid #E5E7EB`,fontSize:13,color:`#111`,outline:`none`,background:`#fff`,width:`100%`,boxSizing:`border-box`},onFocus:e=>e.target.style.borderColor=`#C0392B`,onBlur:e=>e.target.style.borderColor=`#E5E7EB`,children:[(0,j.jsx)(`option`,{value:``,children:`â Select â`}),n.map(e=>(0,j.jsx)(`option`,{value:e,children:e},e))]})]})}function $u({tier:e,photos:t,uploading:n,photoRef:r,onAdd:i,onRemove:a,onUpload:o}){let s=Gu[e]??1,c=Gu[e]===null,l=!c&&t.length>=s,u=qu[e]||`#6B7280`;return(0,j.jsxs)(`div`,{children:[(0,j.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,marginBottom:10},children:[(0,j.jsxs)(`span`,{style:{fontSize:12,color:`#9CA3AF`},children:[t.length,` / `,c?`â`:s,` photos \xA0·\xA0`,(0,j.jsxs)(`span`,{style:{color:u,fontWeight:700,textTransform:`capitalize`},children:[e,` plan`]})]}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`input`,{ref:r,type:`file`,accept:`image/*`,multiple:!0,onChange:o,style:{display:`none`}}),(0,j.jsx)(`button`,{onClick:i,disabled:n||l,style:{padding:`7px 14px`,background:l?`#F5F5F5`:`#F0C419`,border:`none`,borderRadius:8,fontSize:12,fontWeight:700,color:l?`#9CA3AF`:`#111`,cursor:l?`not-allowed`:`pointer`},children:n?`Uploading...`:l?`Limit reached (${s})`:`+ Add Photos`})]})]}),t.length>0?(0,j.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(4, 1fr)`,gap:8},children:t.map((e,t)=>(0,j.jsxs)(`div`,{style:{position:`relative`,aspectRatio:`1`,borderRadius:8,overflow:`hidden`,border:`1px solid #EBEBEB`},children:[(0,j.jsx)(`img`,{src:e,alt:``,style:{width:`100%`,height:`100%`,objectFit:`cover`}}),(0,j.jsx)(`button`,{onClick:()=>a(t),style:{position:`absolute`,top:4,right:4,background:`rgba(0,0,0,0.6)`,color:`#fff`,border:`none`,borderRadius:999,width:20,height:20,fontSize:14,cursor:`pointer`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:`Ã`})]},t))}):(0,j.jsx)(`div`,{style:{border:`2px dashed #E5E7EB`,borderRadius:10,padding:`24px`,textAlign:`center`,color:`#9CA3AF`,fontSize:13},children:`No photos yet. Click "+ Add Photos" to upload.`})]})}var ed={title:``,event_date:``,location:``,category:``,description:``,business_id:``,cover_image_url:``,website_url:``,featured:!1,featured_on_listing:!1};function td(){let[e,t]=(0,_.useState)([]),[n,r]=(0,_.useState)(null),[i,a]=(0,_.useState)(ed),[o,s]=(0,_.useState)(!1),[c,l]=(0,_.useState)(!1),u=(0,_.useRef)();(0,_.useEffect)(()=>{d()},[]);async function d(){let{data:e}=await z.from(`events`).select(`*`).order(`event_date`,{ascending:!0});t(e||[])}function f(){r(`new`),a(ed)}function p(e){r(e.id),a({...ed,...e,event_date:Xc(e.event_date)})}function m(){r(null),a(ed)}function h(e,t){a(n=>({...n,[e]:t}))}async function g(e){let t=e.target.files?.[0];if(!t)return;l(!0);let n=t.name.split(`.`).pop(),r=`events/${Date.now()}.${n}`,{error:i}=await z.storage.from(`business-logos`).upload(r,t,{upsert:!0});if(!i){let{data:{publicUrl:e}}=z.storage.from(`business-logos`).getPublicUrl(r);h(`cover_image_url`,e)}l(!1)}async function v(){s(!0);let e={...i,business_id:i.business_id||null,event_date:Yc(i.event_date)},{error:t}=n===`new`?await z.from(`events`).insert(e):await z.from(`events`).update(e).eq(`id`,n);if(s(!1),t){alert(`Save failed: `+t.message);return}m(),d()}async function y(e){confirm(`Delete this event?`)&&(await z.from(`events`).delete().eq(`id`,e),d())}return(0,j.jsxs)(`div`,{style:{padding:32,maxWidth:900},children:[(0,j.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,marginBottom:24},children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`h1`,{style:{fontSize:22,fontWeight:900,color:`#111`,marginBottom:2},children:`Events`}),(0,j.jsxs)(`p`,{style:{fontSize:13,color:`#9CA3AF`},children:[e.length,` event`,e.length===1?``:`s`,` total`]})]}),(0,j.jsx)(`button`,{onClick:f,style:{background:`#C0392B`,color:`#fff`,fontWeight:700,fontSize:13,padding:`10px 20px`,borderRadius:8,border:`none`,cursor:`pointer`},children:`+ Add Event`})]}),(0,j.jsx)(`div`,{style:{background:`#fff`,borderRadius:12,border:`1px solid #EBEBEB`,overflow:`hidden`},children:(0,j.jsxs)(`table`,{style:{width:`100%`,borderCollapse:`collapse`,fontSize:13},children:[(0,j.jsx)(`thead`,{children:(0,j.jsx)(`tr`,{style:{background:`#FAFAFA`,borderBottom:`1px solid #EBEBEB`},children:[`Cover`,`Title`,`Date`,`Location`,`Category`,`Actions`].map(e=>(0,j.jsx)(`th`,{style:{textAlign:`left`,padding:`10px 16px`,fontWeight:600,color:`#6B7280`,whiteSpace:`nowrap`},children:e},e))})}),(0,j.jsx)(`tbody`,{children:e.length===0?(0,j.jsx)(`tr`,{children:(0,j.jsx)(`td`,{colSpan:5,style:{padding:`48px 16px`,textAlign:`center`,color:`#9CA3AF`},children:`No events yet. Click "+ Add Event" to get started.`})}):e.map((t,n)=>(0,j.jsxs)(`tr`,{style:{borderBottom:n<e.length-1?`1px solid #F5F5F5`:`none`},children:[(0,j.jsx)(`td`,{style:{padding:`10px 16px`},children:t.cover_image_url?(0,j.jsx)(`img`,{src:t.cover_image_url,alt:``,style:{width:48,height:36,objectFit:`cover`,borderRadius:6}}):(0,j.jsx)(`div`,{style:{width:48,height:36,borderRadius:6,background:`#F3F4F6`,dis
225play:`flex`,alignItems:`center`,justifyContent:`center`,fontSize:16},children:`ð
`})}),(0,j.jsx)(`td`,{style:{padding:`12px 16px`,fontWeight:600,color:`#111`},children:t.title}),(0,j.jsx)(`td`,{style:{padding:`12px 16px`,color:`#6B7280`,whiteSpace:`nowrap`},children:Zc(t.event_date,{month:`short`,day:`numeric`,year:`numeric`})}),(0,j.jsx)(`td`,{style:{padding:`12px 16px`,color:`#6B7280`},children:t.location||`â`}),(0,j.jsx)(`td`,{style:{padding:`12px 16px`},children:t.category&&(0,j.jsx)(`span`,{style:{fontSize:11,fontWeight:700,padding:`3px 10px`,borderRadius:999,background:`#F0F4FF`,color:`#3B5BDB`},children:t.category})}),(0,j.jsx)(`td`,{style:{padding:`12px 16px`},children:(0,j.jsxs)(`div`,{style:{display:`flex`,gap:12},children:[(0,j.jsx)(`a`,{href:`/events/${t.id}`,target:`_blank`,rel:`noopener noreferrer`,style:{fontSize:12,fontWeight:600,color:`#16A34A`,textDecoration:`none`},children:`View â`}),(0,j.jsx)(`button`,{onClick:()=>p(t),style:{fontSize:12,fontWeight:600,color:`#3B82F6`,background:`none`,border:`none`,cursor:`pointer`,padding:0},children:`Edit`}),(0,j.jsx)(`button`,{onClick:()=>y(t.id),style:{fontSize:12,fontWeight:600,color:`#EF4444`,background:`none`,border:`none`,cursor:`pointer`,padding:0},children:`Delete`})]})})]},t.id))})]})}),n&&(0,j.jsx)(`div`,{style:{position:`fixed`,inset:0,background:`rgba(0,0,0,0.45)`,display:`flex`,alignItems:`center`,justifyContent:`center`,zIndex:50,padding:24},onClick:e=>e.target===e.currentTarget&&m(),children:(0,j.jsxs)(`div`,{style:{background:`#fff`,borderRadius:16,width:`100%`,maxWidth:480,maxHeight:`90vh`,overflowY:`auto`,boxShadow:`0 20px 60px rgba(0,0,0,0.15)`},children:[(0,j.jsxs)(`div`,{style:{padding:`20px 24px 0`,display:`flex`,alignItems:`center`,justifyContent:`space-between`},children:[(0,j.jsx)(`h2`,{style:{fontSize:17,fontWeight:900,color:`#111`},children:n===`new`?`Add Event`:`Edit Event`}),(0,j.jsx)(`button`,{onClick:m,style:{background:`none`,border:`none`,fontSize:20,color:`#9CA3AF`,cursor:`pointer`},children:`Ã`})]}),(0,j.jsxs)(`div`,{style:{padding:`20px 24px`,display:`flex`,flexDirection:`column`,gap:14},children:[(0,j.jsx)(id,{label:`Event Title *`,value:i.title,onChange:e=>h(`title`,e)}),(0,j.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:4},children:[(0,j.jsx)(`label`,{style:nd,children:`Date & Time * (Eastern Time)`}),(0,j.jsx)(`input`,{type:`datetime-local`,value:i.event_date||``,onChange:e=>h(`event_date`,e.target.value),style:rd,onFocus:e=>e.target.style.borderColor=`#C0392B`,onBlur:e=>e.target.style.borderColor=`#E5E7EB`})]}),(0,j.jsx)(id,{label:`Location`,value:i.location,onChange:e=>h(`location`,e),placeholder:`e.g. Clematis St, WPB`}),(0,j.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:4},children:[(0,j.jsx)(`label`,{style:nd,children:`Category`}),(0,j.jsxs)(`select`,{value:i.category||``,onChange:e=>h(`category`,e.target.value),style:{...rd,background:`#fff`},onFocus:e=>e.target.style.borderColor=`#C0392B`,onBlur:e=>e.target.style.borderColor=`#E5E7EB`,children:[(0,j.jsx)(`option`,{value:``,children:`â Select â`}),Wc.map(e=>(0,j.jsx)(`option`,{value:e,children:e},e))]})]}),(0,j.jsx)(ad,{label:`Description (optional)`,value:i.description,onChange:e=>h(`description`,e)}),(0,j.jsx)(id,{label:`Website URL (optional)`,value:i.website_url,onChange:e=>h(`website_url`,e),placeholder:`https://`}),(0,j.jsx)(id,{label:`Linked Business ID (optional)`,value:i.business_id,onChange:e=>h(`business_id`,e),placeholder:`UUID from businesses table`}),(0,j.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:8},children:[(0,j.jsx)(`label`,{style:nd,children:`Event Cover Image`}),i.cover_image_url&&(0,j.jsxs)(`div`,{style:{position:`relative`},children:[(0,j.jsx)(`img`,{src:i.cover_image_url,alt:`Cover`,style:{width:`100%`,maxHeight:160,objectFit:`cover`,borderRadius:10,display:`block`}}),(0,j.jsx)(`button`,{onClick:()=>h(`cover_image_url`,``),style:{position:`absolute`,top:8,right:8,background:`#fff`,border:`none`,borderRadius:`50%`,width:26,height:26,cursor:`pointer`,fontWeight:700,fontSize:14,color:`#C0392B`,boxShadow:`0 1px 4px rgba(0,0,0,0.2)`},children:`Ã`})]}
225),(0,j.jsx)(`input`,{ref:u,type:`file`,accept:`image/*`,onChange:g,style:{display:`none`}}),(0,j.jsx)(`button`,{type:`button`,onClick:()=>u.current?.click(),disabled:c,style:{padding:`9px 16px`,borderRadius:8,border:`1px dashed #D1D5DB`,background:`#FAFAFA`,fontSize:13,color:`#6B7280`,cursor:`pointer`,textAlign:`left`},children:c?`â³ Uploading...`:i.cover_image_url?`ð Replace Image`:`ð· Upload Event Image`})]}),(0,j.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,j.jsx)(`input`,{type:`checkbox`,checked:i.featured,onChange:e=>h(`featured`,e.target.checked),id:`evt-featured`}),(0,j.jsx)(`label`,{htmlFor:`evt-featured`,style:{fontSize:13,color:`#374151`,fontWeight:600},children:`Featured (shows on homepage)`})]}),(0,j.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,j.jsx)(`input`,{type:`checkbox`,checked:i.featured_on_listing,onChange:e=>h(`featured_on_listing`,e.target.checked),id:`evt-featured-listing`}),(0,j.jsx)(`label`,{htmlFor:`evt-featured-listing`,style:{fontSize:13,color:`#374151`,fontWeight:600},children:`Featured on Events page (sorted to top with checkmark)`})]})]}),(0,j.jsxs)(`div`,{style:{padding:`0 24px 24px`,display:`flex`,gap:10},children:[(0,j.jsx)(`button`,{onClick:v,disabled:o||!i.title||!i.event_date,style:{flex:1,padding:11,background:`#C0392B`,color:`#fff`,fontWeight:700,fontSize:14,borderRadius:8,border:`none`,cursor:`pointer`,opacity:o||!i.title||!i.event_date?.6:1},children:o?`Saving...`:`Save Event`}),(0,j.jsx)(`button`,{onClick:m,style:{padding:`11px 20px`,background:`#F5F5F5`,color:`#374151`,fontWeight:600,fontSize:14,borderRadius:8,border:`none`,cursor:`pointer`},children:`Cancel`})]})]})})]})}var nd={fontSize:11,fontWeight:600,color:`#6B7280`,textTransform:`uppercase`,letterSpacing:`0.04em`},rd={padding:`9px 12px`,borderRadius:8,border:`1px solid #E5E7EB`,fontSize:13,color:`#111`,outline:`none`,width:`100%`,boxSizing:`border-box`};function id({label:e,value:t,onChange:n,placeholder:r=``}){return(0,j.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:4},children:[(0,j.jsx)(`label`,{style:nd,children:e}),(0,j.jsx)(`input`,{type:`text`,value:t||``,onChange:e=>n(e.target.value),placeholder:r,style:rd,onFocus:e=>e.target.style.borderColor=`#C0392B`,onBlur:e=>e.target.style.borderColor=`#E5E7EB`})]})}function ad({label:e,value:t,onChange:n}){return(0,j.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:4},children:[(0,j.jsx)(`label`,{style:nd,children:e}),(0,j.jsx)(`textarea`,{value:t||``,onChange:e=>n(e.target.value),rows:4,style:{...rd,resize:`vertical`,fontFamily:`inherit`},onFocus:e=>e.target.style.borderColor=`#C0392B`,onBlur:e=>e.target.style.borderColor=`#E5E7EB`})]})}var od=o((e=>{var t=u();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),sd=o(((e,t)=>{t.exports=od()}));function cd(e){this.content=e}cd.prototype={constructor:cd,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),a=r.content.slice();return i==-1?a.push(n||e,t):(a[i+1]=t,n&&(a[i]=n)),new cd(a)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new cd(n)},addToStart:function(e,t){return new cd([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new cd(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),a=r.find(e);return i.splice(a==-1?i.length:a,0,t,n),new cd(i)}
vendor: 77,913 bytes, lines 225-229
225,forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return e=cd.from(e),e.size?new cd(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=cd.from(e),e.size?new cd(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=cd.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}},cd.from=function(e){if(e instanceof cd)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new cd(t)};function ld(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),a=t.child(r);if(i==a){n+=i.nodeSize;continue}if(!i.sameMarkup(a))return n;if(i.isText&&i.text!=a.text){let e=i.text,t=a.text,r=0;for(;e[r]==t[r];r++)n++;return r&&r<e.length&&r<t.length&&fd(e.charCodeAt(r-1))&&dd(e.charCodeAt(r))&&n--,n}if(i.content.size||a.content.size){let e=ld(i.content,a.content,n+1);if(e!=null)return e}n+=i.nodeSize}}function ud(e,t,n,r){for(let i=e.childCount,a=t.childCount;;){if(i==0||a==0)return i==a?null:{a:n,b:r};let o=e.child(--i),s=t.child(--a),c=o.nodeSize;if(o==s){n-=c,r-=c;continue}if(!o.sameMarkup(s))return{a:n,b:r};if(o.isText&&o.text!=s.text){let e=o.text,t=s.text,i=e.length,a=t.length;for(;i>0&&a>0&&e[i-1]==t[a-1];)i--,a--,n--,r--;return i&&a&&i<e.length&&fd(e.charCodeAt(i-1))&&dd(e.charCodeAt(i))&&(n++,r++),{a:n,b:r}}if(o.content.size||s.content.size){let e=ud(o.content,s.content,n-1,r-1);if(e)return e}n-=c,r-=c}}function dd(e){return e>=56320&&e<57344}function fd(e){return e>=55296&&e<56320}var G=class e{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,i){for(let a=0,o=0;o<t;a++){let s=this.content[a],c=o+s.nodeSize;if(c>e&&n(s,r+o,i||null,a)!==!1&&s.content.size){let i=o+1;s.nodesBetween(Math.max(0,e-i),Math.min(s.content.size,t-i),n,r+i)}o=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i=``,a=!0;return this.nodesBetween(e,t,(o,s)=>{let c=o.isText?o.text.slice(Math.max(e,s)-s,t-s):o.isLeaf?r?typeof r==`function`?r(o):r:o.type.spec.leafText?o.type.spec.leafText(o):``:``;o.isBlock&&(o.isLeaf&&c||o.isTextblock)&&n&&(a?a=!1:i+=n),i+=c},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),a=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),a=1);a<t.content.length;a++)i.push(t.content[a]);return new e(i,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],i=0;if(n>t)for(let e=0,a=0;a<n;e++){let o=this.content[e],s=a+o.nodeSize;s>t&&((a<t||s>n)&&(o=o.isText?o.cut(Math.max(0,t-a),Math.min(o.text.length,n-a)):o.cut(Math.max(0,t-a-1),Math.min(o.content.size,n-a-1))),r.push(o),i+=o.nodeSize),a=s}return new e(r,i)}cutByIndex(t,n){return t==n?e.empty:t==0&&n==this.content.length?this:new e(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),a=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new e(i,a)}addToStart(t){return new e([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new e(this.content.concat(t),this.size+t.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw RangeError(`Index `+e+` out of range for `+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return ld(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return ud(this,e,t,n)}findIndex(e){if(e==0)return md(0,e);if(e==this.size)return md(this.content.length,e);if(e>this.size||e<0)throw RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let r=this.child(t),i=n+r.nodeSize;if(i>=e)return i==e?md(t+1,i):md(t,n);n=i}}toString(){return`<`+this.toStringInner()+`>`}toStringInner(){return this.content.join(`, `)}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(t,n){if(!n)return e.empty;if(!Array.isArray(n))throw RangeError(`Invalid input for Fragment.fromJSON`);return e.fromArray(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return e.empty;let n,r=0;for(let e=0;e<t.length;e++){let i=t[e];r+=i.nodeSize,e&&i.isText&&t[e-1].sameMarkup(i)?(n||=t.slice(0,e),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new e(n||t,r)}static from(t){if(!t)return e.empty;if(t instanceof e)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new e([t],t.nodeSize);throw RangeError(`Can not convert `+t+` to a Fragment`+(t.nodesBetween?` (looks like multiple versions of prosemirror-model were loaded)`:``))}};G.empty=new G([],0);var pd={index:0,offset:0};function md(e,t){return pd.index=e,pd.offset=t,pd}function hd(e,t){if(e===t)return!0;if(!(e&&typeof e==`object`)||!(t&&typeof t==`object`))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!hd(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!hd(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}var gd=class e{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))t||=e.slice(0,r);else if(i.type.excludes(this.type))return e;else!n&&i.type.rank>this.type.rank&&(t||=e.slice(0,r),t.push(this),n=!0),t&&t.push(i)}return t||=e.slice(),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&hd(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Mark.fromJSON`);let n=e.marks[t.type];if(!n)throw RangeError(`There is no mark type ${t.type} in this schema`);let r=n.create(t.attrs);return n.checkAttrs(r.attrs),r}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return e.none;if(t instanceof e)return[t];let n=t.slice();return n.sort((e,t)=>e.type.rank-t.type.rank),n}};gd.none=[];var _d=class extends Error{},K=class e{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=yd(this.content,t+this.openStart,n,this.openStart+1,this.openEnd+1);return r&&new e(r,this.openStart,this.openEnd)}removeBetween(t,n){return new e(vd(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+`(`+this.openStart+`,`+this.openEnd+`)`}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(t,n){if(!n)return e.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!=`number`||typeof i!=`number`)throw RangeError(`Invalid input for Slice.fromJSON`);return new e(G.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let e=t.firstChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.firstChild)r++;for(let e=t.lastChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.lastChild)i++;return new e(t,r,i)}};K.empty=new K(G.empty,0,0);function vd(e,t,n){let{index:r,offset:i}=e.findIndex(t),a=e.maybeChild(r),{index:o,offset:s}=e.findIndex(n);if(i==t||a.isText){if(s!=n&&!e.child(o).isText)throw RangeError(`Removing non-flat range`);return e.cut(0,t).append(e.cut(n))}if(r!=o)throw RangeError(`Removing non-flat range`);return e.replaceChild(r,a.copy(vd(a.content,t-i-1,n-i-1)))}function yd(e,t,n,r,i,a){let{index:o,offset:s}=e.findIndex(t),c=e.maybeChild(o);if(s==t||c.isText)return a&&r<=0&&i<=0&&!a.canReplace(o,o,n)?null:e.cut(0,t).append(n).append(e.cut(t));let l=yd(c.content,t-s-1,n,o==0?r-1:0,o==e.childCount-1?i-1:0,c);return l&&e.replaceChild(o,c.copy(l))}function bd(e,t,n){if(n.openStart>e.depth)throw new _d(`Inserted content deeper than insertion position`);if(e.depth-n.openStart!=t.depth-n.openEnd)throw new _d(`Inconsistent open depths`);return xd(e,t,n,0)}function xd(e,t,n,r){let i=e.index(r),a=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let o=xd(e,t,n,r+1);return a.copy(a.content.replaceChild(i,o))}else if(!n.content.size)return q(a,Dd(e,t,r));else if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let r=e.parent,i=r.content;return q(r,i.cut(0,e.parentOffset).append(n.content).append(i.cut(t.parentOffset)))}else{let{start:i,end:o}=Od(n,e);return q(a,Ed(e,i,o,t,r))}}function Sd(e,t){if(!t.type.compatibleContent(e.type))throw new _d(`Cannot join `+t.type.name+` onto `+e.type.name)}function Cd(e,t,n){let r=e.node(n);return Sd(r,t.node(n)),r}function wd(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function Td(e,t,n,r){let i=(t||e).node(n),a=0,o=t?t.index(n):i.childCount;e&&(a=e.index(n),e.depth>n?a++:e.textOffset&&(wd(e.nodeAfter,r),a++));for(let e=a;e<o;e++)wd(i.child(e),r);t&&t.depth==n&&t.textOffset&&wd(t.nodeBefore,r)}function q(e,t){if(!e.type.validContent(t))throw new _d(`Invalid content for node `+e.type.name);return e.copy(t)}function Ed(e,t,n,r,i){let a=e.depth>i&&Cd(e,t,i+1),o=r.depth>i&&Cd(n,r,i+1),s=[];return Td(null,e,i,s),a&&o&&t.index(i)==n.index(i)?(Sd(a,o),wd(q(a,Ed(e,t,n,r,i+1)),s)):(a&&wd(q(a,Dd(e,t,i+1)),s),Td(t,n,i,s),o&&wd(q(o,Dd(n,r,i+1)),s)),Td(r,null,i,s),new G(s)}function Dd(e,t,n){let r=[];return Td(null,e,n,r),e.depth>n&&wd(q(Cd(e,t,n+1),Dd(e,t,n+1)),r),Td(t,null,n,r),new G(r)}function Od(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)r=t.node(e).copy(G.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}var kd=class e{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position before the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position after the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[t*3],r=t==0?0:this.path[t*3-1]+1;for(let t=0;t<e;t++)r+=n.child(t).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return gd.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let i=n.marks;for(var a=0;a<i.length;a++)i[a].type.spec.inclusive===!1&&(!r||!i[a].isInSet(r.marks))&&(i=i[a--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var i=0;i<n.length;i++)n[i].type.spec.inclusive===!1&&(!r||!n[i].isInSet(r.marks))&&(n=n[i--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new Nd(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e=``;for(let t=1;t<=this.depth;t++)e+=(e?`/`:``)+this.node(t).type.name+`_`+this.index(t-1);return e+`:`+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw RangeError(`Position `+n+` out of range`);let r=[],i=0,a=n;for(let e=t;;){let{index:t,offset:n}=e.content.findIndex(a),o=a-n;if(r.push(e,t,i+n),!o||(e=e.child(t),e.isText))break;a=o-1,i+=n+1}return new e(n,r,a)}static resolveCached(t,n){let r=Md.get(t);if(r)for(let e=0;e<r.elts.length;e++){let t=r.elts[e];if(t.pos==n)return t}else Md.set(t,r=new Ad);let i=r.elts[r.i]=e.resolve(t,n);return r.i=(r.i+1)%jd,i}},Ad=class{constructor(){this.elts=[],this.i=0}},jd=12,Md=new WeakMap,Nd=class{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}},Pd=Object.create(null),Fd=class e{constructor(e,t,n,r=gd.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||G.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,r=0){this.content.nodesBetween(e,t,n,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,``)}textBetween(e,t,n,r){return this.content.textBetween(e,t,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&hd(this.attrs,t||e.defaultAttrs||Pd)&&gd.sameSet(this.marks,n||gd.none)}copy(t=null){return t==this.content?this:new e(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.content,t)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return K.empty;let r=this.resolve(e),i=this.resolve(t),a=n?0:r.sharedDepth(t),o=r.start(a);return new K(r.node(a).content.cut(r.pos-o,i.pos-o),r.depth-a,i.depth-a)}replace(e,t,n){return bd(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return kd.resolveCached(this,e)}resolveNoCache(e){return kd.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,e=>(n.isInSet(e.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+=`(`+this.content.toStringInner()+`)`),Ld(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw Error(`Called contentMatchAt on a node with invalid content`);return t}canReplace(e,t,n=G.empty,r=0,i=n.childCount){let a=this.contentMatchAt(e).matchFragment(n,r,i),o=a&&a.matchFragment(this.content,t);if(!o||!o.validEnd)return!1;for(let e=r;e<i;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(e).matchType(n),a=i&&i.matchFragment(this.content,t);return a?a.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=gd.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!gd.sameSet(e,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>e.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(e=>e.toJSON())),e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Node.fromJSON`);let n;if(t.marks){if(!Array.isArray(t.marks))throw RangeError(`Invalid mark data for Node.fromJSON`);n=t.marks.map(e.markFromJSON)}if(t.type==`text`){if(typeof t.text!=`string`)throw RangeError(`Invalid text node in JSON`);return e.text(t.text,n)}let r=G.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,r,n);return i.type.checkAttrs(i.attrs),i}};Fd.prototype.text=void 0;var Id=class e extends Fd{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw RangeError(`Empty text nodes are not allowed`);this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Ld(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new e(this.type,this.attrs,t,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function Ld(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+`(`+t+`)`;return t}var Rd=class e{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new zd(t,n);if(r.next==null)return e.empty;let i=Bd(r);r.next&&r.err(`Unexpected trailing text`);let a=Xd(qd(i));return Zd(a,r),a}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let r=this;for(let i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];function i(a,o){let s=a.matchFragment(e,n);if(s&&(!t||s.validEnd))return G.from(o.map(e=>e.createAndFill()));for(let e=0;e<a.next.length;e++){let{type:t,next:n}=a.next[e];if(!(t.isText||t.hasRequiredAttrs())&&r.indexOf(n)==-1){r.push(n);let e=i(n,o.concat(t));if(e)return e}}return null}return i(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<i.next.length;e++){let{type:a,next:o}=i.next[e];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in t)&&(!r.type||o.validEnd)&&(n.push({match:a.contentMatch,type:a,via:r}),t[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(n){e.push(n);for(let r=0;r<n.next.length;r++)e.indexOf(n.next[r].next)==-1&&t(n.next[r].next)}return t(this),e.map((t,n)=>{let r=n+(t.validEnd?`*`:` `)+` `;for(let n=0;n<t.next.length;n++)r+=(n?`, `:``)+t.next[n].type.name+`->`+e.indexOf(t.next[n].next);return r}).join(` 226`)}};Rd.empty=new Rd(!0);var zd=class{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==``&&this.tokens.pop(),this.tokens[0]==``&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw SyntaxError(e+` (in content expression '`+this.string+`')`)}};function Bd(e){let t=[];do t.push(Vd(e));while(e.eat(`|`));return t.length==1?t[0]:{type:`choice`,exprs:t}}function Vd(e){let t=[];do t.push(Hd(e));while(e.next&&e.next!=`)`&&e.next!=`|`);return t.length==1?t[0]:{type:`seq`,exprs:t}}function Hd(e){let t=Kd(e);for(;;)if(e.eat(`+`))t={type:`plus`,expr:t};else if(e.eat(`*`))t={type:`star`,expr:t};else if(e.eat(`?`))t={type:`opt`,expr:t};else if(e.eat(`{`))t=Wd(e,t);else break;return t}function Ud(e){/\D/.test(e.next)&&e.err(`Expected number, got '`+e.next+`'`);let t=Number(e.next);return e.pos++,t}function Wd(e,t){let n=Ud(e),r=n;return e.eat(`,`)&&(r=e.next==`}`?-1:Ud(e)),e.eat(`}`)||e.err(`Unclosed braced range`),{type:`range`,min:n,max:r,expr:t}}function Gd(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let e in n){let r=n[e];r.isInGroup(t)&&i.push(r)}return i.length==0&&e.err(`No node type or group '`+t+`' found`),i}function Kd(e){if(e.eat(`(`)){let t=Bd(e);return e.eat(`)`)||e.err(`Missing closing paren`),t}else if(/\W/.test(e.next))e.err(`Unexpected token '`+e.next+`'`);else{let t=Gd(e,e.next).map(t=>(e.inline==null?e.inline=t.isInline:e.inline!=t.isInline&&e.err(`Mixing inline and block content`),{type:`name`,value:t}));return e.pos++,t.length==1?t[0]:{type:`choice`,exprs:t}}}function qd(e){let t=[[]];return i(a(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let i={term:r,to:n};return t[e].push(i),i}function i(e,t){e.forEach(e=>e.to=t)}function a(e,t){if(e.type==`choice`)return e.exprs.reduce((e,n)=>e.concat(a(n,t)),[]);if(e.type==`seq`)for(let r=0;;r++){let o=a(e.exprs[r],t);if(r==e.exprs.length-1)return o;i(o,t=n())}else if(e.type==`star`){let o=n();return r(t,o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`plus`){let o=n();return i(a(e.expr,t),o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`opt`)return[r(t)].concat(a(e.expr,t));else if(e.type==`range`){let o=t;for(let t=0;t<e.min;t++){let t=n();i(a(e.expr,o),t),o=t}if(e.max==-1)i(a(e.expr,o),o);else for(let t=e.min;t<e.max;t++){let t=n();r(o,t),i(a(e.expr,o),t),o=t}return[r(o)]}else if(e.type==`name`)return[r(t,void 0,e.value)];else throw Error(`Unknown expr type`)}}function Jd(e,t){return t-e}function Yd(e,t){let n=[];return r(t),n.sort(Jd);function r(t){let i=e[t];if(i.length==1&&!i[0].term)return r(i[0].to);n.push(t);for(let e=0;e<i.length;e++){let{term:t,to:a}=i[e];!t&&n.indexOf(a)==-1&&r(a)}}}function Xd(e){let t=Object.create(null);return n(Yd(e,0));function n(r){let i=[];r.forEach(t=>{e[t].forEach(({term:t,to:n})=>{if(!t)return;let r;for(let e=0;e<i.length;e++)i[e][0]==t&&(r=i[e][1]);Yd(e,n).forEach(e=>{r||i.push([t,r=[]]),r.indexOf(e)==-1&&r.push(e)})})});let a=t[r.join(`,`)]=new Rd(r.indexOf(e.length-1)>-1);for(let e=0;e<i.length;e++){let r=i[e][1].sort(Jd);a.next.push({type:i[e][0],next:t[r.join(`,`)]||n(r)})}return a}}function Zd(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],i=!e.validEnd,a=[];for(let t=0;t<e.next.length;t++){let{type:n,next:o}=e.next[t];a.push(n.name),i&&!(n.isText||n.hasRequiredAttrs())&&(i=!1),r.indexOf(o)==-1&&r.push(o)}i&&t.err(`Only non-generatable nodes (`+a.join(`, `)+`) in a required position (see https://prosemirror.net/docs/guide/#generatable)`)}}function Qd(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function $d(e,t){let n=Object.create(null);for(let r in e){let i=t&&t[r];if(i===void 0){let t=e[r];if(t.hasDefault)i=t.default;else throw RangeError(`No value supplied for attribute `+r)}n[r]=i}return n}function ef(e,t,n,r){for(let i in t)if(!(i in e))throw RangeError(`Unsupported attribute ${i} for ${n} of type ${r}`);for(let n in e)e[n].validate&&e[n].validate(t[n])}function tf(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new af(e,r,t[r]);return n}var nf=class e{constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(` `):[],this.attrs=tf(e,n.attrs),this.defaultAttrs=Qd(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||e==`text`),this.isText=e==`text`}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Rd.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?`pre`:`normal`)}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:$d(this.attrs,e)}create(e=null,t,n){if(this.isText)throw Error(`NodeType.create can't construct text nodes`);return new Fd(this,this.computeAttrs(e),G.from(t),gd.setFrom(n))}createChecked(e=null,t,n){return t=G.from(t),this.checkContent(t),new Fd(this,this.computeAttrs(e),t,gd.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),t=G.from(t),t.size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let r=this.contentMatch.matchFragment(t),i=r&&r.fillBefore(G.empty,!0);return i?new Fd(this,e,t.append(i),gd.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let t=0;t<e.childCount;t++)if(!this.allowsMarks(e.child(t).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){ef(this.attrs,e,`node`,this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||=e.slice(0,n);return t?t.length?t:gd.none:e}static compile(t,n){let r=Object.create(null);t.forEach((t,i)=>r[t]=new e(t,n,i));let i=n.spec.topNode||`doc`;if(!r[i])throw RangeError(`Schema is missing its top node type ('`+i+`')`);if(!r.text)throw RangeError(`Every schema needs a 'text' type`);for(let e in r.text.attrs)throw RangeError(`The text node type should not have attributes`);return r}};function rf(e,t,n){let r=n.split(`|`);return n=>{let i=n===null?`null`:typeof n;if(r.indexOf(i)<0)throw RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${i}`)}}var af=class{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,`default`),this.default=n.default,this.validate=typeof n.validate==`string`?rf(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}},of=class e{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=tf(e,r.attrs),this.excluded=null;let i=Qd(this.attrs);this.instance=i?new gd(this,i):null}create(e=null){return!e&&this.instance?this.instance:new gd(this,$d(this.attrs,e))}static compile(t,n){let r=Object.create(null),i=0;return t.forEach((t,a)=>r[t]=new e(t,i++,n,a)),r}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){ef(this.attrs,e,`mark`,this.name)}excludes(e){return this.excluded.indexOf(e)>-1}},sf=class{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let n in e)t[n]=e[n];t.nodes=cd.from(e.nodes),t.marks=cd.from(e.marks||{}),this.nodes=nf.compile(this.spec.nodes,this),this.marks=of.compile(this.spec.marks,this);let n=Object.create(null);for(let e in this.nodes){if(e in this.marks)throw RangeError(e+` can not be both a node and a mark`);let t=this.nodes[e],r=t.spec.content||``,i=t.spec.marks;if(t.contentMatch=n[r]||(n[r]=Rd.parse(r,this.nodes)),t.inlineContent=t.contentMatch.inlineContent,t.spec.linebreakReplacement){if(this.linebreakReplacement)throw RangeError(`Multiple linebreak nodes defined`);if(!t.isInline||!t.isLeaf)throw RangeError(`Linebreak replacement nodes must be inline leaf nodes`);this.linebreakReplacement=t}t.markSet=i==`_`?null:i?cf(this,i.split(` `)):i==``||!t.inlineContent?[]:null}for(let e in this.marks){let t=this.marks[e],n=t.spec.excludes;t.excluded=n==null?[t]:n==``?[]:cf(this,n.split(` `))}this.nodeFromJSON=e=>Fd.fromJSON(this,e),this.markFromJSON=e=>gd.fromJSON(this,e),this.topNodeType=this.nodes[this.spec.topNode||`doc`],this.cached.wrappings=Object.create(null)}node(e,t=null,n,r){if(typeof e==`string`)e=this.nodeType(e);else if(!(e instanceof nf))throw RangeError(`Invalid node type: `+e);else if(e.schema!=this)throw RangeError(`Node type from different schema used (`+e.name+`)`);return e.createChecked(t,n,r)}text(e,t){let n=this.nodes.text;return new Id(n,n.defaultAttrs,e,gd.setFrom(t))}mark(e,t){return typeof e==`string`&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw RangeError(`Unknown node type: `+e);return t}};function cf(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],a=e.marks[i],o=a;if(a)n.push(a);else for(let t in e.marks){let r=e.marks[t];(i==`_`||r.spec.group&&r.spec.group.split(` `).indexOf(i)>-1)&&n.push(o=r)}if(!o)throw SyntaxError(`Unknown mark type: '`+t[r]+`'`)}return n}function lf(e){return e.tag!=null}function uf(e){return e.style!=null}var df=class e{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach(e=>{if(lf(e))this.tags.push(e);else if(uf(e)){let t=/[^=]*/.exec(e.style)[0];n.indexOf(t)<0&&n.push(t),this.styles.push(e)}}),this.normalizeLists=!this.tags.some(t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let n=e.nodes[t.node];return n.contentMatch.matchType(n)})}parse(e,t={}){let n=new bf(this,t,!1);return n.addAll(e,gd.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new bf(this,t,!0);return n.addAll(e,gd.none,t.from,t.to),K.maxOpen(n.finish())}matchTag(e,t,n){for(let r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){let n=this.tags[r];if(Sf(e,n.tag)&&(n.namespace===void 0||e.namespaceURI==n.namespace)&&(!n.context||t.matchesContext(n.context))){if(n.getAttrs){let t=n.getAttrs(e);if(t===!1)continue;n.attrs=t||void 0}return n}}}matchStyle(e,t,n,r){for(let i=r?this.styles.indexOf(r)+1:0;i<this.styles.length;i++){let r=this.styles[i],a=r.style;if(!(a.indexOf(e)!=0||r.context&&!n.matchesContext(r.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=t))){if(r.getAttrs){let e=r.getAttrs(t);if(e===!1)continue;r.attrs=e||void 0}return r}}}static schemaRules(e){let t=[];function n(e){let n=e.priority==null?50:e.priority,r=0;for(;r<t.length;r++){let e=t[r];if((e.priority==null?50:e.priority)<n)break}t.splice(r,0,e)}for(let t in e.marks){let r=e.marks[t].spec.parseDOM;r&&r.forEach(e=>{n(e=Cf(e)),e.mark||e.ignore||e.clearMark||(e.mark=t)})}for(let t in e.nodes){let r=e.nodes[t].spec.parseDOM;r&&r.forEach(e=>{n(e=Cf(e)),e.node||e.ignore||e.mark||(e.node=t)})}return t}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new e(t,e.schemaRules(t)))}},ff={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},pf={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},mf={ol:!0,ul:!0},hf=1,gf=2,_f=4;function vf(e,t,n){return t==null?e&&e.whitespace==`pre`?3:n&-5:(t?hf:0)|(t===`full`?gf:0)}var yf=class{constructor(e,t,n,r,i,a){this.type=e,this.attrs=t,this.marks=n,this.solid=r,this.options=a,this.content=[],this.activeMarks=gd.none,this.match=i||(a&_f?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(G.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let t=this.type.contentMatch,n;return(n=t.findWrapping(e.type))?(this.match=t,n):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&hf)){let e=this.content[this.content.length-1],t;if(e&&e.isText&&(t=/[ \t\r\n\u000c]+$/.exec(e.text))){let n=e;e.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-t[0].length))}}let t=G.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(G.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!ff.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}},bf=class{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let r=t.topNode,i,a=vf(null,t.preserveWhitespace,0)|(n?_f:0);i=r?new yf(r.type,r.attrs,gd.none,!0,t.topMatch||r.type.contentMatch,a):n?new yf(null,null,gd.none,!0,null,a):new yf(e.schema.topNodeType,null,gd.none,!0,null,a),this.nodes=[i],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let n=e.nodeValue,r=this.top,i=r.options&gf?`full`:this.localPreserveWS||(r.options&hf)>0,{schema:a}=this.parser;if(i===`full`||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(!i){if(n=n.replace(/[ \t\r\n\u000c]+/g,` `),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let t=r.content[r.content.length-1],i=e.previousSibling;(!t||i&&i.nodeName==`BR`||t.isText&&/[ \t\r\n\u000c]$/.test(t.text))&&(n=n.slice(1))}}else if(i===`full`)n=n.replace(/\r\n?/g,` 227`);else if(a.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(a.linebreakReplacement.create())){let e=n.split(/\r?\n|\r/);for(let n=0;n<e.length;n++)n&&this.insertNode(a.linebreakReplacement.create(),t,!0),e[n]&&this.insertNode(a.text(e[n]),t,!/\S/.test(e[n]));n=``}else n=n.replace(/\r?\n|\r/g,` `);n&&this.insertNode(a.text(n),t,!/\S/.test(n)),this.findInText(e)}else this.findInside(e)}addElement(e,t,n){let r=this.localPreserveWS,i=this.top;(e.tagName==`PRE`||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let a=e.nodeName.toLowerCase(),o;mf.hasOwnProperty(a)&&this.parser.normalizeLists&&xf(e);let s=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(o=this.parser.matchTag(e,this,n));out:if(s?s.ignore:pf.hasOwnProperty(a))this.findInside(e),this.ignoreFallback(e,t);else if(!s||s.skip||s.closeParent){s&&s.closeParent?this.open=Math.max(0,this.open-1):s&&s.skip.nodeType&&(e=s.skip);let n,r=this.needsBlock;if(ff.hasOwnProperty(a))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),n=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break out}let o=s&&s.skip?t:this.readStyles(e,t);o&&this.addAll(e,o),n&&this.sync(i),this.needsBlock=r}else{let n=this.readStyles(e,t);n&&this.addElementByRule(e,s,n,s.consuming===!1?o:void 0)}this.localPreserveWS=r}leafFallback(e,t){e.nodeName==`BR`&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(` 228`),t)}ignoreFallback(e,t){e.nodeName==`BR`&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text(`-`),t,!0)}readStyles(e,t){let n=e.style;if(n&&n.length)for(let e=0;e<this.parser.matchedStyles.length;e++){let r=this.parser.matchedStyles[e],i=n.getPropertyValue(r);if(i)for(let e;;){let n=this.parser.matchStyle(r,i,this,e);if(!n)break;if(n.ignore)return null;if(t=n.clearMark?t.filter(e=>!n.clearMark(e)):t.concat(this.parser.schema.marks[n.mark].create(n.attrs)),n.consuming===!1)e=n;else break}}return t}addElementByRule(e,t,n,r){let i,a;if(t.node)if(a=this.parser.schema.nodes[t.node],a.isLeaf)this.insertNode(a.create(t.attrs),n,e.nodeName==`BR`)||this.leafFallback(e,n);else{let e=this.enter(a,t.attrs||null,n,t.preserveWhitespace);e&&(i=!0,n=e)}else{let e=this.parser.schema.marks[t.mark];n=n.concat(e.create(t.attrs))}let o=this.top;if(a&&a.isLeaf)this.findInside(e);else if(r)this.addElement(e,n,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(e=>this.insertNode(e,n,!1));else{let r=e;typeof t.contentElement==`string`?r=e.querySelector(t.contentElement):typeof t.contentElement==`function`?r=t.contentElement(e):t.contentElement&&(r=t.contentElement),this.findAround(e,r,!0),this.addAll(r,n),this.findAround(e,r,!1)}i&&this.sync(o)&&this.open--}addAll(e,t,n,r){let i=n||0;for(let a=n?e.childNodes[n]:e.firstChild,o=r==null?null:e.childNodes[r];a!=o;a=a.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(a,t);this.findAtPoint(e,i)}findPlace(e,t,n){let r,i;for(let t=this.open,a=0;t>=0;t--){let o=this.nodes[t],s=o.findWrapping(e);if(s&&(!r||r.length>s.length+a)&&(r=s,i=o,!s.length))break;if(o.solid){if(n)break;a+=2}}if(!r)return null;this.sync(i);for(let e=0;e<r.length;e++)t=this.enterInner(r[e],null,t,!1);return t}insertNode(e,t,n){if(e.isInline&&this.needsBlock&&!this.top.type){let e=this.textblockFromContext();e&&(t=this.enterInner(e,null,t))}let r=this.findPlace(e,t,n);if(r){this.closeExtra();let t=this.top;t.match&&=t.match.matchType(e.type);let n=gd.none;for(let i of r.concat(e.marks))(t.type?t.type.allowsMarkType(i.type):wf(i.type,e.type))&&(n=i.addToSet(n));return t.content.push(e.mark(n)),!0}return!1}enter(e,t,n,r){let i=this.findPlace(e.create(t),n,!1);return i&&=this.enterInner(e,t,n,!0,r),i}enterInner(e,t,n,r=!1,i){this.closeExtra();let a=this.top;a.match=a.match&&a.match.matchType(e);let o=vf(e,i,a.options);a.options&_f&&a.content.length==0&&(o|=_f);let s=gd.none;return n=n.filter(t=>(a.type?a.type.allowsMarkType(t.type):wf(t.type,e))?(s=t.addToSet(s),!1):!0),this.nodes.push(new yf(e,t,s,r,null,o)),this.open++,n}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;else this.localPreserveWS&&(this.nodes[t].options|=hf);return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let t=n.length-1;t>=0;t--)e+=n[t].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,n){if(e!=t&&this.find)for(let r=0;r<this.find.length;r++)this.find[r].pos==null&&e.nodeType==1&&e.contains(this.find[r].node)&&t.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf(`|`)>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split(`/`),n=this.options.context,r=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),i=-(n?n.depth+1:0)+ +!r,a=(e,o)=>{for(;e>=0;e--){let s=t[e];if(s==``){if(e==t.length-1||e==0)continue;for(;o>=i;o--)if(a(e-1,o))return!0;return!1}else{let e=o>0||o==0&&r?this.nodes[o].type:n&&o>=i?n.node(o-i).type:null;if(!e||e.name!=s&&!e.isInGroup(s))return!1;o--}}return!0};return a(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];if(t.isTextblock&&t.defaultAttrs)return t}}};function xf(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=t.nodeType==1?t.nodeName.toLowerCase():null;e&&mf.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):e==`li`?n=t:e&&(n=null)}}function Sf(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function Cf(e){let t={};for(let n in e)t[n]=e[n];return t}function wf(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let a=[],o=e=>{a.push(e);for(let n=0;n<e.edgeCount;n++){let{type:r,next:i}=e.edge(n);if(r==t||a.indexOf(i)<0&&o(i))return!0}};if(o(i.contentMatch))return!0}}var Tf=class e{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||=Df(t).createDocumentFragment();let r=n,i=[];return e.forEach(e=>{if(i.length||e.marks.length){let n=0,a=0;for(;n<i.length&&a<e.marks.length;){let t=e.marks[a];if(!this.marks[t.type.name]){a++;continue}if(!t.eq(i[n][0])||t.type.spec.spanning===!1)break;n++,a++}for(;n<i.length;)r=i.pop()[1];for(;a<e.marks.length;){let n=e.marks[a++],o=this.serializeMark(n,e.isInline,t);o&&(i.push([n,r]),r.appendChild(o.dom),r=o.contentDOM||o.dom)}}r.appendChild(this.serializeNodeInner(e,t))}),n}serializeNodeInner(e,t){if(e.isText)return Df(t).createTextNode(e.text);let{dom:n,contentDOM:r}=jf(Df(t),this.nodes[e.type.name](e),null,e.attrs);if(r){if(e.isLeaf)throw RangeError(`Content hole not allowed in a leaf node spec`);this.serializeFragment(e.content,t,r)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let r=e.marks.length-1;r>=0;r--){let i=this.serializeMark(e.marks[r],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(e,t,n={}){let r=this.marks[e.type.name];return r&&jf(Df(n),r(e,t),null,e.attrs)}static renderSpec(e,t,n=null,r){return typeof t==`string`?{dom:e.createTextNode(t)}:jf(e,t,n,r)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new e(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(e){let t=Ef(e.nodes);return t.text||=e=>e.text,t}static marksFromSchema(e){return Ef(e.marks)}};function Ef(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function Df(e){return e.document||window.document}var Of=new WeakMap;function kf(e){let t=Of.get(e);return t===void 0&&Of.set(e,t=Af(e)),t}function Af(e){let t=null;function n(e){if(e&&typeof e==`object`)if(Array.isArray(e))if(typeof e[0]==`string`)t||=[],t.push(e);else for(let t=0;t<e.length;t++)n(e[t]);else for(let t in e)n(e[t])}return n(e),t}function jf(e,t,n,r){if(t.nodeType==1)return{dom:t};if(t.dom&&t.dom.nodeType==1)return t;let i=t[0],a;if(typeof i!=`string`)throw RangeError(`Invalid array passed to renderSpec`);if(r&&(a=kf(r))&&a.indexOf(t)>-1)throw RangeError(`Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.`);let o=i.indexOf(` `);o>0&&(n=i.slice(0,o),i=i.slice(o+1));let s,c=n?e.createElementNS(n,i):e.createElement(i),l=t[1],u=1;if(l&&typeof l==`object`&&l.nodeType==null&&!Array.isArray(l)){u=2;for(let e in l)if(l[e]!=null){let t=e.indexOf(` `);t>0?c.setAttributeNS(e.slice(0,t),e.slice(t+1),l[e]):e==`style`&&c.style?c.style.cssText=l[e]:c.setAttribute(e,l[e])}}for(let i=u;i<t.length;i++){let a=t[i];if(a===0){if(i<t.length-1||i>u)throw RangeError(`Content hole must be the only child of its parent node`);return{dom:c,contentDOM:c}}else if(typeof a==`string`)c.appendChild(e.createTextNode(a));else{let{dom:t,contentDOM:i}=jf(e,a,n,r);if(c.appendChild(t),i){if(s)throw RangeError(`Multiple content holes`);s=i}}}return{dom:c,contentDOM:s}}var Mf=65535,Nf=2**16;function Pf(e,t){return e+t*Nf}function Ff(e){return e&Mf}function If(e){return(e-(e&Mf))/Nf}var Lf=1,Rf=2,zf=4,Bf=8,Vf=class{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(this.delInfo&Bf)>0}get deletedBefore(){return(this.delInfo&5)>0}get deletedAfter(){return(this.delInfo&6)>0}get deletedAcross(){return(this.delInfo&zf)>0}},Hf=class e{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&e.empty)return e.empty}recover(e){let t=0,n=Ff(e);if(!this.inverted)for(let e=0;e<n;e++)t+=this.ranges[e*3+2]-this.ranges[e*3+1];return this.ranges[n*3]+t+If(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let r=0,i=this.inverted?2:1,a=this.inverted?1:2;for(let o=0;o<this.ranges.length;o+=3){let s=this.ranges[o]-(this.inverted?r:0);if(s>e)break;let c=this.ranges[o+i],l=this.ranges[o+a],u=s+c;if(e<=u){let i=c?e==s?-1:e==u?1:t:t,a=s+r+(i<0?0:l);if(n)return a;let d=e==(t<0?s:u)?null:Pf(o/3,e-s),f=e==s?Rf:e==u?Lf:zf;return(t<0?e!=s:e!=u)&&(f|=Bf),new Vf(a,f,d)}r+=l-c}return n?e+r:new Vf(e+r,0,null)}touches(e,t){let n=0,r=Ff(t),i=this.inverted?2:1,a=this.inverted?1:2;for(let t=0;t<this.ranges.length;t+=3){let o=this.ranges[t]-(this.inverted?n:0);if(o>e)break;let s=this.ranges[t+i];if(e<=o+s&&t==r*3)return!0;n+=this.ranges[t+a]-s}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r<this.ranges.length;r+=3){let a=this.ranges[r],o=a-(this.inverted?i:0),s=a+(this.inverted?0:i),c=this.ranges[r+t],l=this.ranges[r+n];e(o,o+c,s,s+l),i+=l-c}}invert(){return new e(this.ranges,!this.inverted)}toString(){return(this.inverted?`-`:``)+JSON.stringify(this.ranges)}static offset(t){return t==0?e.empty:new e(t<0?[0,-t,0]:[0,0,t])}};Hf.empty=new Hf([]);var Uf=class e{constructor(e,t,n=0,r=e?e.length:0){this.mirror=t,this.from=n,this.to=r,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(t=0,n=this.maps.length){return new e(this._maps,this.mirror,t,n)}appendMap(e,t){this.ownData||=(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),!0),this.to=this._maps.push(e),t!=null&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,n=this._maps.length;t<e._maps.length;t++){let r=e.getMirror(t);this.appendMap(e._maps[t],r!=null&&r<t?n+r:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||=[],this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,n=this._maps.length+e._maps.length;t>=0;t--){let r=e.getMirror(t);this.appendMap(e._maps[t].invert(),r!=null&&r>t?n-r-1:void 0)}}invert(){let t=new e;return t.appendMappingInverted(this),t}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this._maps[n].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,n){let r=0;for(let n=this.from;n<this.to;n++){let i=this._maps[n].mapResult(e,t);if(i.recover!=null){let t=this.getMirror(n);if(t!=null&&t>n&&t<this.to){n=t,e=this._maps[t].recover(i.recover);continue}}r|=i.delInfo,e=i.pos}return n?e:new Vf(e,r,null)}},Wf=Object.create(null),Gf=class{getMap(){return Hf.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw RangeError(`Invalid input for Step.fromJSON`);let n=Wf[t.stepType];if(!n)throw RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in Wf)throw RangeError(`Duplicate use of step JSON ID `+e);return Wf[e]=t,t.prototype.jsonID=e,t}},Kf=class e{constructor(e,t){this.doc=e,this.failed=t}static ok(t){return new e(t,null)}static fail(t){return new e(null,t)}static fromReplace(t,n,r,i){try{return e.ok(t.replace(n,r,i))}catch(t){if(t instanceof _d)return e.fail(t.message);throw t}}};function qf(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let a=e.child(i);a.content.size&&(a=a.copy(qf(a.content,t,a))),a.isInline&&(a=t(a,n,i)),r.push(a)}return G.fromArray(r)}var Jf=class e extends Gf{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),r=n.node(n.sharedDepth(this.to)),i=new K(qf(t.content,(e,t)=>!e.isAtom||!t.type.allowsMarkType(this.mark.type)?e:e.mark(this.mark.addToSet(e.marks)),r),t.openStart,t.openEnd);return Kf.fromReplace(e,this.from,this.to,i)}invert(){return new Yf(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:`addMark`,mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for AddMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}};Gf.jsonID(`addMark`,Jf);var Yf=class e extends Gf{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new K(qf(t.content,e=>e.mark(this.mark.removeFromSet(e.marks)),e),t.openStart,t.openEnd);return Kf.fromReplace(e,this.from,this.to,n)}invert(){return new Jf(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:`removeMark`,mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for RemoveMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}};Gf.jsonID(`removeMark`,Yf);var Xf=class e extends Gf{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Kf.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return Kf.fromReplace(e,this.pos,this.pos+1,new K(G.from(n),0,+!t.isLeaf))}invert(t){let n=t.nodeAt(this.pos);if(n){let t=this.mark.addToSet(n.marks);if(t.length==n.marks.length){for(let r=0;r<n.marks.length;r++)if(!n.marks[r].isInSet(t))return new e(this.pos,n.marks[r]);return new e(this.pos,this.mark)}}return new Zf(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:`addNodeMark`,pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for AddNodeMarkStep.fromJSON`);return new e(n.pos,t.markFromJSON(n.mark))}};Gf.jsonID(`addNodeMark`,Xf);var Zf=class e extends Gf{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Kf.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return Kf.fromReplace(e,this.pos,this.pos+1,new K(G.from(n),0,+!t.isLeaf))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new Xf(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:`removeNodeMark`,pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for RemoveNodeMarkStep.fromJSON`);return new e(n.pos,t.markFromJSON(n.mark))}};Gf.jsonID(`removeNodeMark`,Zf);var Qf=class e extends Gf{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&ep(e,this.from,this.to)?Kf.fail(`Structure replace would overwrite content`):Kf.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Hf([this.from,this.to-this.from,this.slice.size])}invert(t){return new e(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.to,-1),r=this.from==this.to&&e.MAP_BIAS<0?n:t.mapResult(this.from,1);return r.deletedAcross&&n.deletedAcross?null:new e(r.pos,Math.max(r.pos,n.pos),this.slice,this.structure)}merge(t){if(!(t instanceof e)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let n=this.slice.size+t.slice.size==0?K.empty:new K(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new e(this.from,this.to+(t.to-t.from),n,this.structure)}else if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let n=this.slice.size+t.slice.size==0?K.empty:new K(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new e(t.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:`replace`,from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for ReplaceStep.fromJSON`);return new e(n.from,n.to,K.fromJSON(t,n.slice),!!n.structure)}};Qf.MAP_BIAS=1,Gf.jsonID(`replace`,Qf);var $f=class e extends Gf{constructor(e,t,n,r,i,a,o=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=i,this.insert=a,this.structure=o}apply(e){if(this.structure&&(ep(e,this.from,this.gapFrom)||ep(e,this.gapTo,this.to)))return Kf.fail(`Structure gap-replace would overwrite content`);let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return Kf.fail(`Gap is not a flat range`);let n=this.slice.insertAt(this.insert,t.content);return n?Kf.fromReplace(e,this.from,this.to,n):Kf.fail(`Content does not fit in gap`)}getMap(){return new Hf([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let n=this.gapTo-this.gapFrom;return new e(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:t.map(this.gapFrom,-1),a=this.to==this.gapTo?r.pos:t.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||a>r.pos?null:new e(n.pos,r.pos,i,a,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:`replaceAround`,from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`||typeof n.gapFrom!=`number`||typeof n.gapTo!=`number`||typeof n.insert!=`number`)throw RangeError(`Invalid input for ReplaceAroundStep.fromJSON`);return new e(n.from,n.to,n.gapFrom,n.gapTo,K.fromJSON(t,n.slice),n.insert,!!n.structure)}};Gf.jsonID(`replaceAround`,$f);function ep(e,t,n){let r=e.resolve(t),i=n-t,a=r.depth;for(;i>0&&a>0&&r.indexAfter(a)==r.node(a).childCount;)a--,i--;if(i>0){let e=r.node(a).maybeChild(r.indexAfter(a));for(;i>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,i--}}return!1}function tp(e,t,n,r){let i=[],a=[],o,s;e.doc.nodesBetween(t,n,(e,c,l)=>{if(!e.isInline)return;let u=e.marks;if(!r.isInSet(u)&&l.type.allowsMarkType(r.type)){let l=Math.max(c,t),d=Math.min(c+e.nodeSize,n),f=r.addToSet(u);for(let e=0;e<u.length;e++)u[e].isInSet(f)||(o&&o.to==l&&o.mark.eq(u[e])?o.to=d:i.push(o=new Yf(l,d,u[e])));s&&s.to==l?s.to=d:a.push(s=new Jf(l,d,r))}}),i.forEach(t=>e.step(t)),a.forEach(t=>e.step(t))}function np(e,t,n,r){let i=[],a=0;e.doc.nodesBetween(t,n,(e,o)=>{if(!e.isInline)return;a++;let s=null;if(r instanceof of){let t=e.marks,n;for(;n=r.isInSet(t);)(s||=[]).push(n),t=n.removeFromSet(t)}else r?r.isInSet(e.marks)&&(s=[r]):s=e.marks;if(s&&s.length){let r=Math.min(o+e.nodeSize,n);for(let e=0;e<s.length;e++){let n=s[e],c;for(let e=0;e<i.length;e++){let t=i[e];t.step==a-1&&n.eq(i[e].style)&&(c=t)}c?(c.to=r,c.step=a):i.push({style:n,from:Math.max(o,t),to:r,step:a})}}}),i.forEach(t=>e.step(new Yf(t.from,t.to,t.style)))}function rp(e,t,n,r=n.contentMatch,i=!0){let a=e.doc.nodeAt(t),o=[],s=t+1;for(let t=0;t<a.childCount;t++){let c=a.child(t),l=s+c.nodeSize,u=r.matchType(c.type);if(!u)o.push(new Qf(s,l,K.empty));else{r=u;for(let t=0;t<c.marks.length;t++)n.allowsMarkType(c.marks[t].type)||e.step(new Yf(s,l,c.marks[t]));if(i&&c.isText&&n.whitespace!=`pre`){let e,t=/\r?\n|\r/g,r;for(;e=t.exec(c.text);)r||=new K(G.from(n.schema.text(` `,n.allowedMarks(c.marks))),0,0),o.push(new Qf(s+e.index,s+e.index+e[0].length,r))}}s=l}if(!r.validEnd){let t=r.fillBefore(G.empty,!0);e.replace(s,s,new K(t,0,0))}for(let t=o.length-1;t>=0;t--)e.step(o[t])}function ip(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function ap(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth,r=0,i=0;;--n){let a=e.$from.node(n),o=e.$from.index(n)+r,s=e.$to.indexAfter(n)-i;if(n<e.depth&&a.canReplace(o,s,t))return n;if(n==0||a.type.spec.isolating||!ip(a,o,s))break;o&&(r=1),s<a.childCount&&(i=1)}return null}function op(e,t,n){let{$from:r,$to:i,depth:a}=t,o=r.before(a+1),s=i.after(a+1),c=o,l=s,u=G.empty,d=0;for(let e=a,t=!1;e>n;e--)t||r.index(e)>0?(t=!0,u=G.from(r.node(e).copy(u)),d++):c--;let f=G.empty,p=0;for(let e=a,t=!1;e>n;e--)t||i.after(e+1)<i.end(e)?(t=!0,f=G.from(i.node(e).copy(f)),p++):l++;e.step(new $f(c,l,o,s,new K(u.append(f),d,p),u.size-d,!0))}function sp(e,t,n=null,r=e){let i=lp(e,t),a=i&&up(r,t);return a?i.map(cp).concat({type:t,attrs:n}).concat(a.map(cp)):null}function cp(e){return{type:e,attrs:null}}function lp(e,t){let{parent:n,startIndex:r,endIndex:i}=e,a=n.contentMatchAt(r).findWrapping(t);if(!a)return null;let o=a.length?a[0]:t;return n.canReplaceWith(r,i,o)?a:null}function up(e,t){let{parent:n,startIndex:r,endIndex:i}=e,a=n.child(r),o=t.contentMatch.findWrapping(a.type);if(!o)return null;let s=(o.length?o[o.length-1]:t).contentMatch;for(let e=r;s&&e<i;e++)s=s.matchType(n.child(e).type);return!s||!s.validEnd?null:o}function dp(e,t,n){let r=G.empty;for(let e=n.length-1;e>=0;e--){if(r.size){let t=n[e].type.contentMatch.matchFragment(r);if(!t||!t.validEnd)throw RangeError(`Wrapper type given to Transform.wrap does not form valid content of its parent wrapper`)}r=G.from(n[e].type.create(n[e].attrs,r))}let i=t.start,a=t.end;e.step(new $f(i,a,i,a,new K(r,0,0),n.length,!0))}function fp(e,t,n,r,i){if(!r.isTextblock)throw RangeError(`Type given to setBlockType should be a textblock`);let a=e.steps.length;e.doc.nodesBetween(t,n,(t,n)=>{let o=typeof i==`function`?i(t):i;if(t.isTextblock&&!t.hasMarkup(r,o)&&hp(e.doc,e.mapping.slice(a).map(n),r)){let i=null;if(r.schema.linebreakReplacement){let e=r.whitespace==`pre`,t=!!r.contentMatch.matchType(r.schema.linebreakReplacement);e&&!t?i=!1:!e&&t&&(i=!0)}i===!1&&mp(e,t,n,a),rp(e,e.mapping.slice(a).map(n,1),r,void 0,i===null);let s=e.mapping.slice(a),c=s.map(n,1),l=s.map(n+t.nodeSize,1);return e.step(new $f(c,l,c+1,l-1,new K(G.from(r.create(o,null,t.marks)),0,0),1,!0)),i===!0&&pp(e,t,n,a),!1}})}function pp(e,t,n,r){t.forEach((i,a)=>{if(i.isText){let o,s=/\r?\n|\r/g;for(;o=s.exec(i.text);){let i=e.mapping.slice(r).map(n+1+a+o.index);e.replaceWith(i,i+1,t.type.schema.linebreakReplacement.create())}}})}function mp(e,t,n,r){t.forEach((i,a)=>{if(i.type==i.type.schema.linebreakReplacement){let i=e.mapping.slice(r).map(n+1+a);e.replaceWith(i,i+1,t.type.schema.text(` 229`))}})}function hp(e,t,n){let r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function gp(e,t,n,r,i){let a=e.doc.nodeAt(t);if(!a)throw RangeError(`No node at given position`);n||=a.type;let o=n.create(r,null,i||a.marks);if(a.isLeaf)return e.replaceWith(t,t+a.nodeSize,o);if(!n.validContent(a.content))throw RangeError(`Invalid content for node type `+n.name);e.step(new $f(t,t+a.nodeSize,t+1,t+a.nodeSize-1,new K(G.from(o),0,0),1,!0))}function _p(e,t,n=1,r){let i=e.resolve(t),a=i.depth-n,o=r&&r[r.length-1]||i.parent;if(a<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!o.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let e=i.depth-1,t=n-2;e>a;e--,t--){let n=i.node(e),a=i.index(e);if(n.type.spec.isolating)return!1;let o=n.content.cutByIndex(a,n.childCount),s=r&&r[t+1];s&&(o=o.replaceChild(0,s.type.create(s.attrs)));let c=r&&r[t]||n;if(!n.canReplace(a+1,n.childCount)||!c.type.validContent(o))return!1}let s=i.indexAfter(a),c=r&&r[0];return i.node(a).canReplaceWith(s,s,c?c.type:i.node(a+1).type)}function vp(e,t,n=1,r){let i=e.doc.resolve(t),a=G.empty,o=G.empty;for(let e=i.depth,t=i.depth-n,s=n-1;e>t;e--,s--){a=G.from(i.node(e).copy(a));let t=r&&r[s];o=G.from(t?t.type.create(t.attrs,o):i.node(e).copy(o))}e.step(new Qf(t,t,new K(a.append(o),n,n),!0))}function yp(e,t){let n=e.resolve(t),r=n.index();return xp(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function bp(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:r}=e.type.schema;for(let i=0;i<t.childCount;i++){let a=t.child(i),o=a.type==r?e.type.schema.nodes.text:a.type;if(n=n.matchType(o),!n||!e.type.allowsMarks(a.marks))return!1}return n.validEnd}function xp(e,t){return!!(e&&t&&!e.isLeaf&&bp(e,t))}function Sp(e,t,n=-1){let r=e.resolve(t);for(let e=r.depth;;e--){let i,a,o=r.index(e);if(e==r.depth?(i=r.nodeBefore,a=r.nodeAfter):n>0?(i=r.node(e+1),o++,a=r.node(e).maybeChild(o)):(i=r.node(e).maybeChild(o-1),a=r.node(e+1)),i&&!i.isTextblock&&xp(i,a)&&r.node(e).canReplace(o,o+1))return t;if(e==0)break;t=n<0?r.before(e):r.after(e)}}function Cp(e,t,n){let r=null,{linebreakReplacement:i}=e.doc.type.schema,a=e.doc.resolve(t-n),o=a.node().type;if(i&&o.inlineContent){let e=o.whitespace==`pre`,t=!!o.contentMatch.matchType(i);e&&!t?r=!1:!e&&t&&(r=!0)}let s=e.steps.length;if(r===!1){let r=e.doc.resolve(t+n);mp(e,r.node(),r.before(),s)}o.inlineContent&&rp(e,t+n-1,o,a.node().contentMatchAt(a.index()),r==null);let c=e.mapping.slice(s),l=c.map(t-n);if(e.step(new Qf(l,c.map(t+n,-1),K.empty,!0)),r===!0){let t=e.doc.resolve(l);pp(e,t.node(),t.before(),e.steps.length)}return e}function wp(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(r.parentOffset==0)for(let e=r.depth-1;e>=0;e--){let t=r.index(e);if(r.node(e).canReplaceWith(t,t,n))return r.before(e+1);if(t>0)return null}if(r.parentOffset==r.parent.content.size)for(let e=r.depth-1;e>=0;e--){let t=r.indexAfter(e);if(r.node(e).canReplaceWith(t,t,n))return r.after(e+1);if(t<r.node(e).childCount)return null}return null}function Tp(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let i=n.content;for(let e=0;e<n.openStart;e++)i=i.firstChild.content;for(let e=1;e<=(n.openStart==0&&n.size?2:1);e++)for(let t=r.depth;t>=0;t--){let n=t==r.depth?0:r.pos<=(r.start(t+1)+r.end(t+1))/2?-1:1,a=r.index(t)+ +(n>0),o=r.node(t),s=!1;if(e==1)s=o.canReplace(a,a,i);else{let e=o.contentMatchAt(a).findWrapping(i.firstChild.type);s=e&&o.canReplaceWith(a,a,e[0])}if(s)return n==0?r.pos:n<0?r.before(t+1):r.after(t+1)}return null}function Ep(e,t,n=t,r=K.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),a=e.resolve(n);return Dp(i,a,r)?new Qf(t,n,r):new Op(i,a,r).fit()}function Dp(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}var Op=class{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=G.empty;for(let t=0;t<=e.depth;t++){let n=e.node(t);this.frontier.push({type:n.type,match:n.contentMatchAt(e.indexAfter(t))})}for(let t=e.depth;t>0;t--)this.placed=G.from(e.node(t).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,r=this.close(e<0?this.$to:n.doc.resolve(e));if(!r)return null;let i=this.placed,a=n.depth,o=r.depth;for(;a&&o&&i.childCount==1;)i=i.firstChild.content,a--,o--;let s=new K(i,a,o);return e>-1?new $f(n.pos,e,this.$to.pos,this.$to.end(),s,t):s.size||n.pos!=this.$to.pos?new Qf(n.pos,r.pos,s):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,n=0,r=this.unplaced.openEnd;n<e;n++){let i=t.firstChild;if(t.childCount>1&&(r=0),i.type.spec.isolating&&r<=n){e=n;break}t=i.content}for(let t=1;t<=2;t++)for(let n=t==1?e:this.unplaced.openStart;n>=0;n--){let e,r=null;n?(r=jp(this.unplaced.content,n-1).firstChild,e=r.content):e=this.unplaced.content;let i=e.firstChild;for(let e=this.depth;e>=0;e--){let{type:a,match:o}=this.frontier[e],s,c=null;if(t==1&&(i?o.matchType(i.type)||(c=o.fillBefore(G.from(i),!1)):r&&a.compatibleContent(r.type)))return{sliceDepth:n,frontierDepth:e,parent:r,inject:c};if(t==2&&i&&(s=o.findWrapping(i.type)))return{sliceDepth:n,frontierDepth:e,parent:r,wrap:s};if(r&&o.matchType(r.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=jp(e,t);return!r.childCount||r.firstChild.isLeaf?!1:(this.unplaced=new K(e,t+1,Math.max(n,r.size+t>=e.size-n?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=jp(e,t);if(r.childCount<=1&&t>0){let i=e.size-t<=t+r.size;this.unplaced=new K(kp(e,t-1,1),t-1,i?t-1:n)}else this.unplaced=new K(kp(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:r,wrap:i}){for(;this.depth>t;)this.closeFrontierNode();if(i)for(let e=0;e<i.length;e++)this.openFrontierNode(i[e]);let a=this.unplaced,o=n?n.content:a.content,s=a.openStart-e,c=0,l=[],{match:u,type:d}=this.frontier[t];if(r){for(let e=0;e<r.childCount;e++)l.push(r.child(e));u=u.matchFragment(r)}let f=o.size+e-(a.content.size-a.openEnd);for(;c<o.childCount;){let e=o.child(c),t=u.matchType(e.type);if(!t)break;c++,(c>1||s==0||e.content.size)&&(u=t,l.push(Mp(e.mark(d.allowedMarks(e.marks)),c==1?s:0,c==o.childCount?f:-1)))}let p=c==o.childCount;p||(f=-1),this.placed=Ap(this.placed,t,G.from(l)),this.frontier[t].match=u,p&&f<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let e=0,t=o;e<f;e++){let e=t.lastChild;this.frontier.push({type:e.type,match:e.contentMatchAt(e.childCount)}),t=e.content}this.unplaced=p?e==0?K.empty:new K(kp(a.content,e-1,1),e-1,f<0?a.openEnd:e-1):new K(kp(a.content,e,c),a.openStart,a.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!Np(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return-1;let{depth:n}=this.$to,r=this.$to.after(n);for(;n>1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(e){scan:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:r}=this.frontier[t],i=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),a=Np(e,t,r,n,i);if(a){for(let n=t-1;n>=0;n--){let{match:t,type:r}=this.frontier[n],i=Np(e,n,r,t,!0);if(!i||i.childCount)continue scan}return{depth:t,fit:a,move:i?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=Ap(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let t=e.node(n),r=t.type.contentMatch.fillBefore(t.content,!0,e.index(n));this.openFrontierNode(t.type,t.attrs,r)}return e}openFrontierNode(e,t=null,n){let r=this.frontier[this.depth];r.match=r.match.matchType(e),this.placed=Ap(this.placed,this.depth,G.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(G.empty,!0);e.childCount&&(this.placed=Ap(this.placed,this.frontier.length,e))}};function kp(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(kp(e.firstChild.content,t-1,n)))}function Ap(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(Ap(e.lastChild.content,t-1,n)))}function jp(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function Mp(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,Mp(r.firstChild,t-1,r.childCount==1?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(G.empty,!0)))),e.copy(r)}function Np(e,t,n,r,i){let a=e.node(t),o=i?e.indexAfter(t):e.index(t);if(o==a.childCount&&!n.compatibleContent(a.type))return null;let s=r.fillBefore(a.content,!0,o);return s&&!Pp(n,a.content,o)?s:null}function Pp(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}function Fp(e){return e.spec.defining||e.spec.definingForContent}function Ip(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let i=e.doc.resolve(t),a=e.doc.resolve(n);if(Dp(i,a,r))return e.step(new Qf(t,n,r));let o=Bp(i,a);o[o.length-1]==0&&o.pop();let s=-(i.depth+1);o.unshift(s);for(let e=i.depth,t=i.pos-1;e>0;e--,t--){let n=i.node(e).type.spec;if(n.defining||n.definingAsContext||n.isolating)break;o.indexOf(e)>-1?s=e:i.before(e)==t&&o.splice(1,0,-e)}let c=o.indexOf(s),l=[],u=r.openStart;for(let e=r.content,t=0;;t++){let n=e.firstChild;if(l.push(n),t==r.openStart)break;e=n.content}for(let e=u-1;e>=0;e--){let t=l[e],n=Fp(t.type);if(n&&!t.sameMarkup(i.node(Math.abs(s)-1)))u=e;else if(n||!t.type.isTextblock)break}for(let t=r.openStart;t>=0;t--){let s=(t+u+1)%(r.openStart+1),d=l[s];if(d)for(let t=0;t<o.length;t++){let l=o[(t+c)%o.length],u=!0;l<0&&(u=!1,l=-l);let f=i.node(l-1),p=i.index(l-1);if(f.canReplaceWith(p,p,d.type,d.marks))return e.replace(i.before(l),u?a.after(l):n,new K(Lp(r.content,0,r.openStart,s),s,r.openEnd))}}let d=e.steps.length;for(let s=o.length-1;s>=0&&(e.replace(t,n,r),!(e.steps.length>d));s--){let e=o[s];e<0||(t=i.before(e),n=a.after(e))}}function Lp(e,t,n,r,i){if(t<n){let i=e.firstChild;e=e.replaceChild(0,i.copy(Lp(i.content,t+1,n,r,i)))}if(t>r){let t=i.contentMatchAt(0),n=t.fillBefore(e).append(e);e=n.append(t.matchFragment(n).fillBefore(G.empty,!0))}return e}function Rp(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let i=wp(e.doc,t,r.type);i!=null&&(t=n=i)}e.replaceRange(t,n,new K(G.from(r),0,0))}function zp(e,t,n){let r=e.doc.resolve(t),i=e.doc.resolve(n);if(r.parent.isTextblock&&i.parent.isTextblock&&r.start()!=i.start()&&r.parentOffset==0&&i.parentOffset==0){let a=r.sharedDepth(n),o=!1;for(let e=r.depth;e>a;e--)r.node(e).type.spec.isolating&&(o=!0);for(let e=i.depth;e>a;e--)i.node(e).type.spec.isolating&&(o=!0);if(!o){for(let e=r.depth;e>0&&t==r.start(e);e--)t=r.before(e);for(let e=i.depth;e>0&&n==i.start(e);e--)n=i.before(e);r=e.doc.resolve(t),i=e.doc.resolve(n)}}let a=Bp(r,i);for(let t=0;t<a.length;t++){let n=a[t],o=t==a.length-1;if(o&&n==0||r.node(n).type.contentMatch.validEnd)return e.delete(r.start(n),i.end(n));if(n>0&&(o||r.node(n-1).canReplace(r.index(n-1),i.indexAfter(n-1))))return e.delete(r.before(n),i.after(n))}for(let a=1;a<=r.depth&&a<=i.depth;a++)if(t-r.start(a)==r.depth-a&&n>r.end(a)&&i.end(a)-n!=i.depth-a&&r.start(a-1)==i.start(a-1)&&r.node(a-1).canReplace(r.index(a-1),i.index(a-1)))return e.delete(r.before(a),n);e.delete(t,n)}function Bp(e,t){let n=[],r=Math.min(e.depth,t.depth);for(let i=r;i>=0;i--){let r=e.start(i);if(r<e.pos-(e.depth-i)||t.end(i)>t.pos+(t.depth-i)||e.node(i).type.spec.isolating||t.node(i).type.spec.isolating)break;(r==t.start(i)||i==e.depth&&i==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&i&&t.start(i-1)==r-1)&&n.push(i)}return n}var Vp=class e extends Gf{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}apply(e){let t=e.nodeAt(this.pos);if(!t)return Kf.fail(`No node at attribute step's position`);let n=Object.create(null);for(let e in t.attrs)n[e]=t.attrs[e];n[this.attr]=this.value;let r=t.type.create(n,null,t.marks);return Kf.fromReplace(e,this.pos,this.pos+1,new K(G.from(r),0,+!t.isLeaf))}getMap(){return Hf.empty}invert(t){return new e(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.attr,this.value)}toJSON(){return{stepType:`attr`,pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!=`number`||typeof n.attr!=`string`)throw RangeError(`Invalid input for AttrStep.fromJSON`);return new e(n.pos,n.attr,n.value)}};Gf.jsonID(`attr`,Vp);var Hp=class e extends Gf{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let n in e.attrs)t[n]=e.attrs[n];t[this.attr]=this.value;let n=e.type.create(t,e.content,e.marks);return Kf.ok(n)}getMap(){return Hf.empty}invert(t){return new e(this.attr,t.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:`docAttr`,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.attr!=`string`)throw RangeError(`Invalid input for DocAttrStep.fromJSON`);return new e(n.attr,n.value)}};Gf.jsonID(`docAttr`,Hp);var Up=class extends Error{};Up=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},Up.prototype=Object.create(Error.prototype),Up.prototype.constructor=Up,Up.prototype.name=`TransformError`;var Wp=class{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Uf}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new Up(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}changedRange(){let e=1e9,t=-1e9;for(let n=0;n<this.mapping.maps.length;n++){let r=this.mapping.maps[n];n&&(e=r.map(e,1),t=r.map(t,-1)),r.forEach((n,r,i,a)=>{e=Math.min(e,i),t=Math.max(t,a)})}return e==1e9?null:{from:e,to:t}}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,n=K.empty){let r=Ep(this.doc,e,t,n);return r&&this.step(r),this}replaceWith(e,t,n){return this.replace(e,t,new K(G.from(n),0,0))}delete(e,t){return this.replace(e,t,K.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return Ip(this,e,t,n),this}replaceRangeWith(e,t,n){return Rp(this,e,t,n),this}deleteRange(e,t){return zp(this,e,t),this}lift(e,t){return op(this,e,t),this}join(e,t=1){return Cp(this,e,t),this}wrap(e,t){return dp(this,e,t),this}setBlockType(e,t=e,n,r=null){return fp(this,e,t,n,r),this}setNodeMarkup(e,t,n=null,r){return gp(this,e,t,n,r),this}setNodeAttribute(e,t,n){return this.step(new Vp(e,t,n)),this}setDocAttribute(e,t){return this.step(new Hp(e,t)),this}addNodeMark(e,t){return this.step(new Xf(e,t)),this}removeNodeMark(e,t){let n=this.doc.nodeAt(e);if(!n)throw RangeError(`No node at position `+e);if(t instanceof gd)t.isInSet(n.marks)&&this.step(new Zf(e,t));else{let r=n.marks,i,a=[];for(;i=t.isInSet(r);)a.push(new Zf(e,i)),r=i.removeFromSet(r);for(let e=a.length-1;e>=0;e--)this.step(a[e])}return this}split(e,t=1,n){return vp(this,e,t,n),this}addMark(e,t,n){return tp(this,e,t,n),this}removeMark(e,t,n){return np(this,e,t,n),this}clearIncompatible(e,t,n){return rp(this,e,t,n),this}},Gp=Object.create(null),J=class{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new Kp(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=K.empty){let n=t.content.lastChild,r=null;for(let e=0;e<t.openEnd;e++)r=n,n=n.lastChild;let i=e.steps.length,a=this.ranges;for(let o=0;o<a.length;o++){let{$from:s,$to:c}=a[o],l=e.mapping.slice(i);e.replaceRange(l.map(s.pos),l.map(c.pos),o?K.empty:t),o==0&&em(e,i,(n?n.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:a,$to:o}=r[i],s=e.mapping.slice(n),c=s.map(a.pos),l=s.map(o.pos);i?e.deleteRange(c,l):(e.replaceRangeWith(c,l,t),em(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let r=e.parent.inlineContent?new Y(e):$p(e.node(0),e.parent,e.pos,e.index(),t,n);if(r)return r;for(let r=e.depth-1;r>=0;r--){let i=t<0?$p(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):$p(e.node(0),e.node(r),e.after(r+1),e.index(r)+1,t,n);if(i)return i}return null}
229static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new Zp(e.node(0))}static atStart(e){return $p(e,e,0,0,1)||new Zp(e)}static atEnd(e){return $p(e,e,e.content.size,e.childCount,-1)||new Zp(e)}static fromJSON(e,t){if(!t||!t.type)throw RangeError(`Invalid input for Selection.fromJSON`);let n=Gp[t.type];if(!n)throw RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in Gp)throw RangeError(`Duplicate use of selection JSON ID `+e);return Gp[e]=t,t.prototype.jsonID=e,t}getBookmark(){return Y.between(this.$anchor,this.$head).getBookmark()}};J.prototype.visible=!0;var Kp=class{constructor(e,t){this.$from=e,this.$to=t}},qp=!1;function Jp(e){!qp&&!e.parent.inlineContent&&(qp=!0,console.warn(`TextSelection endpoint not pointing into a node with inline content (`+e.parent.type.name+`)`))}var Y=class e extends J{constructor(e,t=e){Jp(e),Jp(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,n){let r=t.resolve(n.map(this.head));if(!r.parent.inlineContent)return J.near(r);let i=t.resolve(n.map(this.anchor));return new e(i.parent.inlineContent?i:r,r)}replace(e,t=K.empty){if(super.replace(e,t),t==K.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(t){return t instanceof e&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new Yp(this.anchor,this.head)}toJSON(){return{type:`text`,anchor:this.anchor,head:this.head}}static fromJSON(t,n){if(typeof n.anchor!=`number`||typeof n.head!=`number`)throw RangeError(`Invalid input for TextSelection.fromJSON`);return new e(t.resolve(n.anchor),t.resolve(n.head))}static create(e,t,n=t){let r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))}static between(t,n,r){let i=t.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let e=J.findFrom(n,r,!0)||J.findFrom(n,-r,!0);if(e)n=e.$head;else return J.near(n,r)}return t.parent.inlineContent||(i==0?t=n:(t=(J.findFrom(t,-r,!0)||J.findFrom(t,r,!0)).$anchor,t.pos<n.pos!=i<0&&(t=n))),new e(t,n)}};J.jsonID(`text`,Y);var Yp=class e{constructor(e,t){this.anchor=e,this.head=t}map(t){return new e(t.map(this.anchor),t.map(this.head))}resolve(e){return Y.between(e.resolve(this.anchor),e.resolve(this.head))}},X=class e extends J{constructor(e){let t=e.nodeAfter,n=e.node(0).resolve(e.pos+t.nodeSize);super(e,n),this.node=t}map(t,n){let{deleted:r,pos:i}=n.mapResult(this.anchor),a=t.resolve(i);return r?J.near(a):new e(a)}content(){return new K(G.from(this.node),0,0)}eq(t){return t instanceof e&&t.anchor==this.anchor}toJSON(){return{type:`node`,anchor:this.anchor}}getBookmark(){return new Xp(this.anchor)}static fromJSON(t,n){if(typeof n.anchor!=`number`)throw RangeError(`Invalid input for NodeSelection.fromJSON`);return new e(t.resolve(n.anchor))}static create(t,n){return new e(t.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}};X.prototype.visible=!1,J.jsonID(`node`,X);var Xp=class e{constructor(e){this.anchor=e}map(t){let{deleted:n,pos:r}=t.mapResult(this.anchor);return n?new Yp(r,r):new e(r)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&X.isSelectable(n)?new X(t):J.near(t)}},Zp=class e extends J{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=K.empty){if(t==K.empty){e.delete(0,e.doc.content.size);let t=J.atStart(e.doc);t.eq(e.selection)||e.setSelection(t)}else super.replace(e,t)}toJSON(){return{type:`all`}}static fromJSON(t){return new e(t)}map(t){return new e(t)}eq(t){return t instanceof e}getBookmark(){return Qp}};J.jsonID(`all`,Zp);var Qp={map(){return this},resolve(e){return new Zp(e)}};function $p(e,t,n,r,i,a=!1){if(t.inlineContent)return Y.create(e,n);for(let o=r-(i>0?0:1);i>0?o<t.childCount:o>=0;o+=i){let r=t.child(o);if(!r.isAtom){let t=$p(e,r,n+i,i<0?r.childCount:0,i,a);if(t)return t}else if(!a&&X.isSelectable(r))return X.create(e,n-(i<0?r.nodeSize:0));n+=r.nodeSize*i}return null}function em(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof Qf||i instanceof $f))return;let a=e.mapping.maps[r],o;a.forEach((e,t,n,r)=>{o??=r}),e.setSelection(J.near(e.doc.resolve(o),n))}var tm=1,nm=2,rm=4,im=class extends Wp{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw RangeError(`Selection passed to setSelection must point at the current document`);return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|tm)&-3,this.storedMarks=null,this}get selectionSet(){return(this.updated&tm)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=nm,this}ensureMarks(e){return gd.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&nm)>0}addStep(e,t){super.addStep(e,t),this.updated&=-3,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let n=this.selection;return t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||gd.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,n){let r=this.doc.type.schema;if(t==null)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();{if(n??=t,!e)return this.deleteRange(t,n);let i=this.storedMarks;if(!i){let e=this.doc.resolve(t);i=n==t?e.marks():e.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,r.text(e,i)),!this.selection.empty&&this.selection.to==t+e.length&&this.setSelection(J.near(this.selection.$to)),this}}setMeta(e,t){return this.meta[typeof e==`string`?e:e.key]=t,this}getMeta(e){return this.meta[typeof e==`string`?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=rm,this}get scrolledIntoView(){return(this.updated&rm)>0}};function am(e,t){return!t||!e?e:e.bind(t)}var om=class{constructor(e,t,n){this.name=e,this.init=am(t.init,
229n),this.apply=am(t.apply,n)}},sm=[new om(`doc`,{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new om(`selection`,{init(e,t){return e.selection||J.atStart(t.doc)},apply(e){return e.selection}}),new om(`storedMarks`,{init(e){return e.storedMarks||null},apply(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new om(`scrollToSelection`,{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})],cm=class{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=sm.slice(),t&&t.forEach(e=>{if(this.pluginsByKey[e.key])throw RangeError(`Adding different instances of a keyed plugin (`+e.key+`)`);this.plugins.push(e),this.pluginsByKey[e.key]=e,e.spec.state&&this.fields.push(new om(e.key,e.spec.state,e))})}},lm=class e{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let n=0;n<this.config.plugins.length;n++)if(n!=t){let t=this.config.plugins[n];if(t.spec.filterTransaction&&!t.spec.filterTransaction.call(t,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],n=this.applyInner(e),r=null;for(;;){let i=!1;for(let a=0;a<this.config.plugins.length;a++){let o=this.config.plugins[a];if(o.spec.appendTransaction){let s=r?r[a].n:0,c=r?r[a].state:this,l=s<t.length&&o.spec.appendTransaction.call(o,s?t.slice(s):t,c,n);if(l&&n.filterTransaction(l,a)){if(l.setMeta(`appendedTransaction`,e),!r){r=[];for(let e=0;e<this.config.plugins.length;e++)r.push(e<a?{state:n,n:t.length}:{state:this,n:0})}t.push(l),n=n.applyInner(l),i=!0}r&&(r[a]={state:n,n:t.length})}}if(!i)return{state:n,transactions:t}}}applyInner(t){if(!t.before.eq(this.doc))throw RangeError(`Applying a mismatched transaction`);let n=new e(this.config),r=this.config.fields;for(let e=0;e<r.length;e++){let i=r[e];n[i.name]=i.apply(t,this[i.name],this,n)}return n}get tr(){return new im(this)}static create(t){let n=new cm(t.doc?t.doc.type.schema:t.schema,t.plugins),r=new e(n);for(let e=0;e<n.fields.length;e++)r[n.fields[e].name]=n.fields[e].init(t,r);return r}reconfigure(t){let n=new cm(this.schema,t.plugins),r=n.fields,i=new e(n);for(let e=0;e<r.length;e++){let n=r[e].name;i[n]=this.hasOwnProperty(n)?this[n]:r[e].init(t,i)}return i}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map(e=>e.toJSON())),e&&typeof e==`object`)for(let n in e){if(n==`doc`||n==`selection`)throw RangeError("The JSON fields `doc` and `selection` are reserved");let r=e[n],i=r.spec.state;i&&i.toJSON&&(t[n]=i.toJSON.call(r,this[r.key]))}return t}static fromJSON(t,n,r){if(!n)throw RangeError(`Invalid input for EditorState.fromJSON`);if(!t.schema)throw RangeError(`Required config field 'schema' missing`);let i=new cm(t.schema,t.plugins),a=new e(i);return i.fields.forEach(e=>{if(e.name==`doc`)a.doc=Fd.fromJSON(t.schema,n.doc);else if(e.name==`selection`)a.selection=J.fromJSON(a.doc,n.selection);else if(e.name==`storedMarks`)n.storedMarks&&(a.storedMarks=n.storedMarks.map(t.schema.markFromJSON));else{if(r)for(let i in r){let o=r[i],s=o.spec.state;if(o.key==e.name&&s&&s.fromJSON&&Object.prototype.hasOwnProperty.call(n,i)){a[e.name]=s.fromJSON.call(o,t,n[i],a);return}}a[e.name]=e.init(t,a)}}),a}};function um(e,t,n){for(let r in e){let i=e[r];i instanceof Function?i=i.bind(t):r==`handleDOMEvents`&&(i=um(i,t,{})),n[r]=i}return n}var dm=class{constructor(e){this.spec=e,this.props={},e.props&&um(e.props,this,this.props),this.key=e.key?e.key.key:pm(`plugin`)}getState(e){return e[this.key]}},fm=Object.create(null);function pm(e){return e in fm?e+`$`+ ++fm[e]:(fm[e]=0,e+`$`)}var mm=class{constructor(e=`key`){this.key=pm(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}},hm=(e,t)=>e.selection.empty?!1:(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function gm(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock(`backward`,e):n.parentOffset>0)?null:n}
vendor: 9,007 bytes, lines 229-230
229var _m=(e,t,n)=>{let r=gm(e,n);if(!r)return!1;let i=Cm(r);if(!i){let n=r.blockRange(),i=n&&ap(n);return i==null?!1:(t&&t(e.tr.lift(n,i).scrollIntoView()),!0)}let a=i.nodeBefore;if(Vm(e,i,t,-1))return!0;if(r.parent.content.size==0&&(xm(a,`end`)||X.isSelectable(a)))for(let n=r.depth;;n--){let o=Ep(e.doc,r.before(n),r.after(n),K.empty);if(o&&o.slice.size<o.to-o.from){if(t){let n=e.tr.step(o);n.setSelection(xm(a,`end`)?J.findFrom(n.doc.resolve(n.mapping.map(i.pos,-1)),-1):X.create(n.doc,i.pos-a.nodeSize)),t(n.scrollIntoView())}return!0}if(n==1||r.node(n-1).childCount>1)break}return a.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos-a.nodeSize,i.pos).scrollIntoView()),!0):!1},vm=(e,t,n)=>{let r=gm(e,n);if(!r)return!1;let i=Cm(r);return i?bm(e,i,t):!1},ym=(e,t,n)=>{let r=wm(e,n);if(!r)return!1;let i=Dm(r);return i?bm(e,i,t):!1};function bm(e,t,n){let r=t.nodeBefore,i=t.pos-1;for(;!r.isTextblock;i--){if(r.type.spec.isolating)return!1;let e=r.lastChild;if(!e)return!1;r=e}let a=t.nodeAfter,o=t.pos+1;for(;!a.isTextblock;o++){if(a.type.spec.isolating)return!1;let e=a.firstChild;if(!e)return!1;a=e}let s=Ep(e.doc,i,o,K.empty);if(!s||s.from!=i||s instanceof Qf&&s.slice.size>=o-i)return!1;if(n){let t=e.tr.step(s);t.setSelection(Y.create(t.doc,i)),n(t.scrollIntoView())}return!0}function xm(e,t,n=!1){for(let r=e;r;r=t==`start`?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}var Sm=(e,t,n)=>{let{$head:r,empty:i}=e.selection,a=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock(`backward`,e):r.parentOffset>0)return!1;a=Cm(r)}let o=a&&a.nodeBefore;return!o||!X.isSelectable(o)?!1:(t&&t(e.tr.setSelection(X.create(e.doc,a.pos-o.nodeSize)).scrollIntoView()),!0)};function Cm(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function wm(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock(`forward`,e):n.parentOffset<n.parent.content.size)?null:n}var Tm=(e,t,n)=>{let r=wm(e,n);if(!r)return!1;let i=Dm(r);if(!i)return!1;let a=i.nodeAfter;if(Vm(e,i,t,1))return!0;if(r.parent.content.size==0&&(xm(a,`start`)||X.isSelectable(a))){let n=Ep(e.doc,r.before(),r.after(),K.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(xm(a,`start`)?J.findFrom(r.doc.resolve(r.mapping.map(i.pos)),1):X.create(r.doc,r.mapping.map(i.pos))),t(r.scrollIntoView())}return!0}}return a.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos,i.pos+a.nodeSize).scrollIntoView()),!0):!1},Em=(e,t,n)=>{let{$head:r,empty:i}=e.selection,a=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock(`forward`,e):r.parentOffset<r.parent.content.size)return!1;a=Dm(r)}let o=a&&a.nodeAfter;return!o||!X.isSelectable(o)?!1:(t&&t(e.tr.setSelection(X.create(e.doc,a.pos)).scrollIntoView()),!0)};function Dm(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}var Om=(e,t)=>{let n=e.selection,r=n instanceof X,i;if(r){if(n.node.isTextblock||!yp(e.doc,n.from))return!1;i=n.from}else if(i=Sp(e.doc,n.from,-1),i==null)return!1;if(t){let n=e.tr.join(i);r&&n.setSelection(X.create(n.doc,i-e.doc.resolve(i).nodeBefore.nodeSize)),t(n.scrollIntoView())}return!0},km=(e,t)=>{let n=e.selection,r;if(n instanceof X){if(n.node.isTextblock||!yp(e.doc,n.to))return!1;r=n.to}else if(r=Sp(e.doc,n.to,1),r==null)return!1;return t&&t(e.tr.join(r).scrollIntoView()),!0},Am=(e,t)=>{let{$from:n,$to:r}=e.selection,i=n.blockRange(r),a=i&&ap(i);return a==null?!1:(t&&t(e.tr.lift(i,a).scrollIntoView()),!0)},jm=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(t&&t(e.tr.insertText(` 230`).scrollIntoView()),!0)};function Mm(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}var Nm=(e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),a=n.indexAfter(-1),o=Mm(i.contentMatchAt(a));if(!o||!i.canReplaceWith(a,a,o))return!1;if(t){let r=n.after(),i=e.tr.replaceWith(r,r,o.createAndFill());i.setSelection(J.near(i.doc.resolve(r),1)),t(i.scrollIntoView())}return!0},Pm=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof Zp||r.parent.inlineContent||i.parent.inlineContent)return!1;let a=Mm(i.parent.contentMatchAt(i.indexAfter()));if(!a||!a.isTextblock)return!1;if(t){let n=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,o=e.tr.insert(n,a.createAndFill());o.setSelection(Y.create(o.doc,n+1)),t(o.scrollIntoView())}return!0},Fm=(e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let r=n.before();if(_p(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),i=r&&ap(r);return i==null?!1:(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)};function Im(e){return(t,n)=>{let{$from:r,$to:i}=t.selection;if(t.selection instanceof X&&t.selection.node.isBlock)return!r.parentOffset||!_p(t.doc,r.pos)?!1:(n&&n(t.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let a=[],o,s,c=!1,l=!1;for(let t=r.depth;;t--)if(r.node(t).isBlock){c=r.end(t)==r.pos+(r.depth-t),l=r.start(t)==r.pos-(r.depth-t),s=Mm(r.node(t-1).contentMatchAt(r.indexAfter(t-1)));let n=e&&e(i.parent,c,r);a.unshift(n||(c&&s?{type:s}:null)),o=t;break}else{if(t==1)return!1;a.unshift(null)}let u=t.tr;(t.selection instanceof Y||t.selection instanceof Zp)&&u.deleteSelection();let d=u.mapping.map(r.pos),f=_p(u.doc,d,a.length,a);if(f||=(a[0]=s?{type:s}:null,_p(u.doc,d,a.length,a)),!f)return!1;if(u.split(d,a.length,a),!c&&l&&r.node(o).type!=s){let e=u.mapping.map(r.before(o)),t=u.doc.resolve(e);s&&r.node(o-1).canReplaceWith(t.index(),t.index()+1,s)&&u.setNodeMarkup(u.mapping.map(r.before(o)),s)}return n&&n(u.scrollIntoView()),!0}}var Lm=Im(),Rm=(e,t)=>{let{$from:n,to:r}=e.selection,i,a=n.sharedDepth(r);return a==0?!1:(i=n.before(a),t&&t(e.tr.setSelection(X.create(e.doc,i))),!0)},zm=(e,t)=>(t&&t(e.tr.setSelection(new Zp(e.doc))),!0);function Bm(e,t,n){let r=t.nodeBefore,i=t.nodeAfter,a=t.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&t.parent.canReplace(a-1,a)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(a,a+1)||!(i.isTextblock||yp(e.doc,t.pos))?!1:(n&&n(e.tr.join(t.pos).scrollIntoView()),!0)}function Vm(e,t,n,r){let i=t.nodeBefore,a=t.nodeAfter,o,s,c=i.type.spec.isolating||a.type.spec.isolating;if(!c&&Bm(e,t,n))return!0;let l=!c&&t.parent.canReplace(t.index(),t.index()+1);if(l&&(o=(s=i.contentMatchAt(i.childCount)).findWrapping(a.type))&&s.matchType(o[0]||a.type).validEnd){if(n){let r=t.pos+a.nodeSize,s=G.empty;for(let e=o.length-1;e>=0;e--)s=G.from(o[e].create(null,s));s=G.from(i.copy(s));let c=e.tr.step(new $f(t.pos-1,r,t.pos,r,new K(s,1,0),o.length,!0)),l=c.doc.resolve(r+2*o.length);l.nodeAfter&&l.nodeAfter.type==i.type&&yp(c.doc,l.pos)&&c.join(l.pos),n(c.scrollIntoView())}return!0}let u=a.type.spec.isolating||r>0&&c?null:J.findFrom(t,1),d=u&&u.$from.blockRange(u.$to),f=d&&ap(d);if(f!=null&&f>=t.depth)return n&&n(e.tr.lift(d,f).scrollIntoView()),!0;if(l&&xm(a,`start`,!0)&&xm(i,`end`)){let r=i,o=[];for(;o.push(r),!r.isTextblock;)r=r.lastChild;let s=a,c=1;for(;!s.isTextblock;s=s.firstChild)c++;if(r.canReplace(r.childCount,r.childCount,s.content)){if(n){let r=G.empty;for(let e=o.length-1;e>=0;e--)r=G.from(o[e].copy(r));n(e.tr.step(new $f(t.pos-o.length,t.pos+a.nodeSize,t.pos+c,t.pos+a.nodeSize-c,new K(r,o.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function Hm(e){return function(t,n){let r=t.selection,i=e<0?r.$from:r.$to,a=i.depth;for(;i.node(a).isInline;){if(!a)return!1;a--}return i.node(a).isTextblock?(n&&n(t.tr.setSelection(Y.create(t.doc,e<0?i.start(a):i.end(a)))),!0):!1}}var Um=Hm(-1),Wm=Hm(1);function Gm(e,t=null){return function(n,r){let{$from:i,$to:a}=n.selection,o=i.blockRange(a),s=o&&sp(o,e,t);return s?(r&&r(n.tr.wrap(o,s).scrollIntoView()),!0):!1}}function Km(e,t=null){return function(n,r){let i=!1;for(let r=0;r<n.selection.ranges.length&&!i;r++){let{$from:{pos:a},$to:{pos:o}}=n.selection.ranges[r];n.doc.nodesBetween(a,o,(r,a)=>{if(i)return!1;if(!(!r.isTextblock||r.hasMarkup(e,t)))if(r.type==e)i=!0;else{let t=n.doc.resolve(a),r=t.index();i=t.parent.canReplaceWith(r,r+1,e)}})}if(!i)return!1;if(r){let i=n.tr;for(let r=0;r<n.selection.ranges.length;r++){let{$from:{pos:a},$to:{pos:o}}=n.selection.ranges[r];i.setBlockType(a,o,e,t)}r(i.scrollIntoView())}return!0}}function qm(...e){return function(t,n,r){for(let i=0;i<e.length;i++)if(e[i](t,n,r))return!0;return!1}}var Jm=qm(hm,_m,Sm),Ym=qm(hm,Tm,Em),Xm={Enter:qm(jm,Pm,Fm,Lm),"Mod-Enter":Nm,Backspace:Jm,"Mod-Backspace":Jm,"Shift-Backspace":Jm,Delete:Ym,"Mod-Delete":Ym,"Mod-a":zm},Zm={"Ctrl-h":Xm.Backspace,"Alt-Backspace":Xm[`Mod-Backspace`],"Ctrl-d":Xm.Delete,"Ctrl-Alt-Backspace":Xm[`Mod-Delete`],"Alt
230-Delete":Xm[`Mod-Delete`],"Alt-d":Xm[`Mod-Delete`],"Ctrl-a":Um,"Ctrl-e":Wm};for(let e in Xm)Zm[e]=Xm[e];typeof navigator<`u`?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<`u`&&os.platform&&os.platform();function Qm(e,t=null){return function(n,r){let{$from:i,$to:a}=n.selection,o=i.blockRange(a);if(!o)return!1;let s=r?n.tr:null;return $m(s,o,e,t)?(r&&r(s.scrollIntoView()),!0):!1}}function $m(e,t,n,r=null){let i=!1,a=t,o=t.$from.doc;if(t.depth>=2&&t.$from.node(t.depth-1).type.compatibleContent(n)&&t.startIndex==0){if(t.$from.index(t.depth-1)==0)return!1;let e=o.resolve(t.start-2);a=new Nd(e,e,t.depth),t.endIndex<t.parent.childCount&&(t=new Nd(t.$from,o.resolve(t.$to.end(t.depth)),t.depth)),i=!0}let s=sp(a,n,r,t);return s?(e&&eh(e,t,s,i,n),!0):!1}function eh(e,t,n,r,i){let a=G.empty;for(let e=n.length-1;e>=0;e--)a=G.from(n[e].type.create(n[e].attrs,a));e.step(new $f(t.start-(r?2:0),t.end,t.start,t.end,new K(a,0,0),n.length,!0));let o=0;for(let e=0;e<n.length;e++)n[e].type==i&&(o=e+1);let s=n.length-o,c=t.start+n.length-(r?2:0),l=t.parent;for(let n=t.startIndex,r=t.endIndex,i=!0;n<r;n++,i=!1)!i&&_p(e.doc,c,s)&&(e.split(c,s),c+=2*s),c+=l.child(n).nodeSize;return e}function th(e){return function(t,n){let{$from:r,$to:i}=t.selection,a=r.blockRange(i,t=>t.childCount>0&&t.firstChild.type==e);return a?n?r.node(a.depth-1).type==e?nh(t,n,e,a):rh(t,n,a):!0:!1}}function nh(e,t,n,r){let i=e.tr,a=r.end,o=r.$to.end(r.depth);a<o&&(i.step(new $f(a-1,o,a,o,new K(G.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new Nd(i.doc.resolve(r.$from.pos),i.doc.resolve(o),r.depth));let s=ap(r);if(s==null)return!1;i.lift(r,s);let c=i.doc.resolve(i.mapping.map(a,-1)-1);return yp(i.doc,c.pos)&&c.nodeBefore.type==c.nodeAfter.type&&i.join(c.pos),t(i.scrollIntoView()),!0}function rh(e,t,n){let r=e.tr,i=n.parent;for(let e=n.end,t=n.endIndex-1,a=n.startIndex;t>a;t--)e-=i.child(t).nodeSize,r.delete(e-1,e+1);let a=r.doc.resolve(n.start),o=a.nodeAfter;if(r.mapping.map(n.end)!=n.start+a.nodeAfter.nodeSize)return!1;let s=n.startIndex==0,c=n.endIndex==i.childCount,l=a.node(-1),u=a.index(-1);if(!l.canReplace(u+ +!s,u+1,o.content.append(c?G.empty:G.from(i))))return!1;let d=a.pos,f=d+o.nodeSize;return r.step(new $f(d-+!!s,f+ +!!c,d+1,f-1,new K((s?G.empty:G.from(i.copy(G.empty))).append(c?G.empty:G.from(i.copy(G.empty))),+!s,+!c),+!s)),t(r.scrollIntoView()),!0}function ih(e){return function(t,n){let{$from:r,$to:i}=t.selection,a=r.blockRange(i,t=>t.childCount>0&&t.firstChild.type==e);if(!a)return!1;let o=a.startIndex;if(o==0)return!1;let s=a.parent,c=s.child(o-1);if(c.type!=e)return!1;if(n){let r=c.lastChild&&c.lastChild.type==s.type,i=G.from(r?e.create():null),o=new K(G.from(e.create(null,G.from(s.type.create(null,i)))),r?3:1,0),l=a.start,u=a.end;n(t.tr.step(new $f(l-(r?3:1),u,l,u,o,1,!0)).scrollIntoView())}return!0}}var ah=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},oh=function(e){let t=e.assignedSlot||e.parentNode;return t&&t.nodeType==11?t.host:t},sh=null,ch=function(e,t,n){let r=sh||=document.createRange();return r.setEnd(e,n??e.nodeValue.length),r.setStart(e,t||0),r},lh=function(){sh=null},uh=function(e,t,n,r){return n&&(fh(e,t,n,r,-1)||fh(e,t,n,r,1))},dh=/^(img|br|input|textarea|hr)$/i;function fh(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:ph(e))){let n=e.parentNode;if(!n||n.nodeType!=1||_h(e)||dh.test(e.nodeName)||e.contentEditable==`false`)return!1;t=ah(e)+(i<0?0:1),e=n}else if(e.nodeType==1){let n=e.childNodes[t+(i<0?-1:0)];if(n.nodeType==1&&n.contentEditable==`false`)if(n.pmViewDesc?.ignoreForSelection)t+=i;else return!1;else e=n,t=i<0?ph(e):0}else return!1}}function ph(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function mh(e,t){for(;;){if(e.nodeType==3&&t)return e;if(e.nodeType==1&&t>0){if(e.contentEditable==`false`)return null;e=e.childNodes[t-1],t=ph(e)}else if(e.parentNode&&!_h(e))t=ah(e),e=e.parentNode;else return null}}function hh(e,t){for(;;){if(e.nodeType==3&&t<e.nodeValue.length)return e;if(e.nodeType==1&&t<e.childNodes.length){if(e.contentEditable==`false`)return null;e=e.childNodes[t],t=0}else if(e.parentNode&&!_h(e))t=ah(e)+1,e=e.parentNode;else return null}}function gh(e,t,n){for(let r=t==0,i=t==ph(e);r||i;){if(e==n)return!0;let t=ah(e);if(e=e.parentNode,!e)return!1;r&&=t==0,i&&=t==ph(e)}}function _h(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}var vh=function(e){return e.focusNode&&uh(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function yh(e,t){let n=document.createEvent(`Event`);return n.initEvent(`keydown`,!0,!0),n.keyCode=e,n.key=n.code=t,n}function bh(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}function xh(e,t,n){if(e.caretPositionFromPoint)try{let r=e.caretPositionFromPoint(t,n);
vendor: 26,362 bytes, lines 230-231
230if(r)return{node:r.offsetNode,offset:Math.min(ph(r.offsetNode),r.offset)}}catch{}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:Math.min(ph(r.startContainer),r.startOffset)}}}var Sh=typeof navigator<`u`?navigator:null,Ch=typeof document<`u`?document:null,wh=Sh&&Sh.userAgent||``,Th=/Edge\/(\d+)/.exec(wh),Eh=/MSIE \d/.exec(wh),Dh=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(wh),Oh=!!(Eh||Dh||Th),kh=Eh?document.documentMode:Dh?+Dh[1]:Th?+Th[1]:0,Ah=!Oh&&/gecko\/(\d+)/i.test(wh);Ah&&+(/Firefox\/(\d+)/.exec(wh)||[0,0])[1];var jh=!Oh&&/Chrome\/(\d+)/.exec(wh),Mh=!!jh,Nh=jh?+jh[1]:0,Ph=!Oh&&!!Sh&&/Apple Computer/.test(Sh.vendor),Fh=Ph&&(/Mobile\/\w+/.test(wh)||!!Sh&&Sh.maxTouchPoints>2),Ih=Fh||(Sh?/Mac/.test(Sh.platform):!1),Lh=Sh?/Win/.test(Sh.platform):!1,Rh=/Android \d/.test(wh),zh=!!Ch&&`webkitFontSmoothing`in Ch.documentElement.style,Bh=zh?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function Vh(e){let t=e.defaultView&&e.defaultView.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function Hh(e,t){return typeof e==`number`?e:e[t]}function Uh(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function Wh(e,t,n){let r=e.someProp(`scrollThreshold`)||0,i=e.someProp(`scrollMargin`)||5,a=e.dom.ownerDocument;for(let o=n||e.dom;o;){if(o.nodeType!=1){o=oh(o);continue}let e=o,n=e==a.body,s=n?Vh(a):Uh(e),c=0,l=0;if(t.top<s.top+Hh(r,`top`)?l=-(s.top-t.top+Hh(i,`top`)):t.bottom>s.bottom-Hh(r,`bottom`)&&(l=t.bottom-t.top>s.bottom-s.top?t.top+Hh(i,`top`)-s.top:t.bottom-s.bottom+Hh(i,`bottom`)),t.left<s.left+Hh(r,`left`)?c=-(s.left-t.left+Hh(i,`left`)):t.right>s.right-Hh(r,`right`)&&(c=t.right-s.right+Hh(i,`right`)),c||l)if(n)a.defaultView.scrollBy(c,l);else{let n=e.scrollLeft,r=e.scrollTop;l&&(e.scrollTop+=l),c&&(e.scrollLeft+=c);let i=e.scrollLeft-n,a=e.scrollTop-r;t={left:t.left-i,top:t.top-a,right:t.right-i,bottom:t.bottom-a}}let u=n?`fixed`:getComputedStyle(o).position;if(/^(fixed|sticky)$/.test(u))break;o=u==`absolute`?o.offsetParent:oh(o)}}function Gh(e){let t=e.dom.getBoundingClientRect(),n=Math.max(0,t.top),r,i;for(let a=(t.left+t.right)/2,o=n+1;o<Math.min(innerHeight,t.bottom);o+=5){let t=e.root.elementFromPoint(a,o);if(!t||t==e.dom||!e.dom.contains(t))continue;let s=t.getBoundingClientRect();if(s.top>=n-20){r=t,i=s.top;break}}return{refDOM:r,refTop:i,stack:Kh(e.dom)}}function Kh(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=oh(r));return t}function qh({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;Jh(n,r==0?0:r-t)}function Jh(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:i,left:a}=e[n];r.scrollTop!=i+t&&(r.scrollTop=i+t),r.scrollLeft!=a&&(r.scrollLeft=a)}}var Yh=null;function Xh(e){if(e.setActive)return e.setActive();if(Yh)return e.focus(Yh);let t=Kh(e);e.focus(Yh==null?{get preventScroll(){return Yh={preventScroll:!0},!0}}:void 0),Yh||(Yh=!1,Jh(t,0))}function Zh(e,t){let n,r=2e8,i,a=0,o=t.top,s=t.top,c,l;for(let u=e.firstChild,d=0;u;u=u.nextSibling,d++){let e;if(u.nodeType==1)e=u.getClientRects();else if(u.nodeType==3)e=ch(u).getClientRects();else continue;for(let f=0;f<e.length;f++){let p=e[f];if(p.top<=o&&p.bottom>=s){o=Math.max(p.bottom,o),s=Math.min(p.top,s);let e=p.left>t.left?p.left-t.left:p.right<t.left?t.left-p.right:0;if(e<r){n=u,r=e,i=e&&n.nodeType==3?{left:p.right<t.left?p.right:p.left,top:t.top}:t,u.nodeType==1&&e&&(a=d+ +(t.left>=(p.left+p.right)/2));continue}}else p.top>t.top&&!c&&p.left<=t.left&&p.right>=t.left&&(c=u,l={left:Math.max(p.left,Math.min(p.right,t.left)),top:p.top});!n&&(t.left>=p.right&&t.top>=p.top||t.left>=p.left&&t.top>=p.bottom)&&(a=d+1)}}return!n&&c&&(n=c,i=l,r=0),n&&n.nodeType==3?Qh(n,i):!n||r&&n.nodeType==1?{node:e,offset:a}:Zh(n,i)}function Qh(e,t){let n=e.nodeValue.length,r=document.createRange(),i;for(let a=0;a<n;a++){r.setEnd(e,a+1),r.setStart(e,a);let n=og(r,1);if(n.top!=n.bottom&&$h(t,n)){i={node:e,offset:a+ +(t.left>=(n.left+n.right)/2)};break}}return r.detach(),i||{node:e,offset:0}}function $h(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function eg(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}function tg(e,t,n){let{node:r,offset:i}=Zh(t,n),a=-1;if(r.nodeType==1&&!r.firstChild){let e=r.getBoundingClientRect();a=e.left!=e.right&&n.left>(e.left+e.right)/2?1:-1}return e.docView.posFromDOM(r,i,a)}function ng(e,t,n,r){let i=-1;for(let n=t,a=!1;n!=e.dom;){let t=e.docView.nearestDesc(n,!0),o;if(!t)return null;if(t.dom.nodeType==1&&(t.node.isBlock&&t.parent||!t.contentDOM)&&((o=t.dom.getBoundingClientRect()).width||o.height)&&(t.node.isBlock&&t.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(t.dom.nodeName)&&(!a&&o.left>r.left||o.top>r.top?i=t.posBefore:(!a&&o.right<r.left||o.bottom<r.top)&&(i=t.posAfter),a=!0),!t.contentDOM&&i<0&&!t.node.isText))return(t.node.isBlock?r.top<(o.top+o.bottom)/2:r.left<(o.left+o.right)/2)?t.posBefore:t.posAfter;n=t.dom.parentNode}return i>-1?i:e.docView.posFromDOM(t,n,-1)}function rg(e,t,n){let r=e.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(t.top-n.top)/(n.bottom-n.top))-2)),a=i;;){let n=e.childNodes[a];if(n.nodeType==1){let e=n.getClientRects();for(let r=0;r<e.length;r++){let i=e[r];if($h(t,i))return rg(n,t,i)}}if((a=(a+1)%r)==i)break}return e}function ig(e,t){let n=e.dom.ownerDocument,r,i=0,a=xh(n,t.left,t.top);a&&({node:r,offset:i}=a);let o=(e.root.elementFromPoint?e.root:n).elementFromPoint(t.left,t.top),s;if(!o||!e.dom.contains(o.nodeType==1?o:o.parentNode)){let n=e.dom.getBoundingClientRect();if(!$h(t,n)||(o=rg(e.dom,t,n),!o))return null}if(Ph)for(let e=o;r&&e;e=oh(e))e.draggable&&(r=void 0);if(o=eg(o,t),r){if(Ah&&r.nodeType==1&&(i=Math.min(i,r.childNodes.length),i<r.childNodes.length)){let e=r.childNodes[i],n;e.nodeName==`IMG`&&(n=e.getBoundingClientRect()).right<=t.left&&n.bottom>t.top&&i++}let n;zh&&i&&r.nodeType==1&&(n=r.childNodes[i-1]).nodeType==1&&n.contentEditable==`false`&&n.getBoundingClientRect().top>=t.top&&i--,r==e.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&t.top>r.lastChild.getBoundingClientRect().bottom?s=e.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!=`BR`)&&(s=ng(e,r,i,t))}s??=tg(e,o,t);let c=e.docView.nearestDesc(o,!0);return{pos:s,inside:c?c.posAtStart-c.border:-1}}function ag(e){return e.top<e.bottom||e.left<e.right}function og(e,t){let n=e.getClientRects();if(n.length){let e=n[t<0?0:n.length-1];if(ag(e))return e}return Array.prototype.find.call(n,ag)||e.getBoundingClientRect()}var sg=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function cg(e,t,n){let{node:r,offset:i,atom:a}=e.docView.domFromPos(t,n<0?-1:1),o=zh||Ah;if(r.nodeType==3)if(o&&(sg.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let e=og(ch(r,i,i),n);if(Ah&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let t=og(ch(r,i-1,i-1),-1);if(t.top==e.top){let n=og(ch(r,i,i+1),-1);if(n.top!=e.top)return lg(n,n.left<t.left)}}return e}else{let e=i,t=i,a=n<0?1:-1;return n<0&&!i?(t++,a=-1):n>=0&&i==r.nodeValue.length?(e--,a=1):n<0?e--:t++,lg(og(ch(r,e,t),a),a<0)}if(!e.state.doc.resolve(t-(a||0)).parent.inlineContent){if(a==null&&i&&(n<0||i==ph(r))){let e=r.childNodes[i-1];if(e.nodeType==1)return ug(e.getBoundingClientRect(),!1)}if(a==null&&i<ph(r)){let e=r.childNodes[i];if(e.nodeType==1)return ug(e.getBoundingClientRect(),!0)}return ug(r.getBoundingClientRect(),n>=0)}if(a==null&&i&&(n<0||i==ph(r))){let e=r.childNodes[i-1],t=e.nodeType==3?ch(e,ph(e)-+!o):e.nodeType==1&&(e.nodeName!=`BR`||!e.nextSibling)?e:null;if(t)return lg(og(t,1),!1)}if(a==null&&i<ph(r)){let e=r.childNodes[i];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?e.nodeType==3?ch(e,0,+!o):e.nodeType==1?e:null:null;if(t)return lg(og(t,-1),!0)}return lg(og(r.nodeType==3?ch(r):r,-n),n>=0)}function lg(e,t){if(e.width==0)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function ug(e,t){if(e.height==0)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function dg(e,t,n){let r=e.state,i=e.root.activeElement;r!=t&&e.updateState(t),i!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),i!=e.dom&&i&&i.focus()}}function fg(e,t,n){let r=t.selection,i=n==`up`?r.$from:r.$to;return dg(e,t,()=>{let{node:t}=e.docView.domFromPos(i.pos,n==`up`?-1:1);for(;;){let n=e.docView.nearestDesc(t,!0);if(!n)break;if(n.node.isBlock){t=n.contentDOM||n.dom;break}t=n.dom.parentNode}let r=cg(e,i.pos,1);for(let e=t.firstChild;e;e=e.nextSibling){let t;if(e.nodeType==1)t=e.getClientRects();else if(e.nodeType==3)t=ch(e,0,e.nodeValue.length).getClientRects();else continue;for(let e=0;e<t.length;e++){let i=t[e];if(i.bottom>i.top+1&&(n==`up`?r.top-i.top>(i.bottom-r.top)*2:i.bottom-r.bottom>(r.bottom-i.top)*2))return!1}}return!0})}var pg=/[\u0590-\u08ac]/;function mg(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,a=!i,o=i==r.parent.content.size,s=e.domSelection();return s?!pg.test(r.parent.textContent)||!s.modify?n==`left`||n==`backward`?a:o:dg(e,t,()=>{let{focusNode:t,focusOffset:i,anchorNode:a,anchorOffset:o}=e.domSelectionRange(),c=s.caretBidiLevel;s.modify(`move`,n,`character`);let l=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:u,focusOffset:d}=e.domSelectionRange(),f=u&&!l.contains(u.nodeType==1?u:u.parentNode)||t==u&&i==d;try{s.collapse(a,o),t&&(t!=a||i!=o)&&s.extend&&s.extend(t,i)}catch{}return c!=null&&(s.caretBidiLevel=c),f}):r.pos==r.start()||r.pos==r.end()}var hg=null,gg=null,_g=!1;function vg(e,t,n){return hg==t&&gg==n?_g:(hg=t,gg=n,_g=n==`up`||n==`down`?fg(e,t,n):mg(e,t,n))}var yg=0,bg=1,xg=2,Sg=3,Cg=class{constructor(e,t,n,r){this.parent=e,this.children=t,this.dom=n,this.contentDOM=r,this.dirty=yg,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,n){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let t=0,n=this.posAtStart;;t++){let r=this.children[t];if(r==e)return n;n+=r.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,t,n){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(n<0){let n,r;if(e==this.contentDOM)n=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.previousSibling}for(;n&&!((r=n.pmViewDesc)&&r.parent==this);)n=n.previousSibling;return n?this.posBeforeChild(r)+r.size:this.posAtStart}else{let n,r;if(e==this.contentDOM)n=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.nextSibling}for(;n&&!((r=n.pmViewDesc)&&r.parent==this);)n=n.nextSibling;return n?this.posBeforeChild(r):this.posAtEnd}let r;if(e==this.dom&&this.contentDOM)r=t>ah(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(t==0)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!1;break}if(t.previousSibling)break}if(r==null&&t==e.childNodes.length)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!0;break}if(t.nextSibling)break}}return r??n>0?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,r=e;r;r=r.parentNode){let i=this.getDesc(r),a;if(i&&(!t||i.node))if(n&&(a=i.nodeDOM)&&!(a.nodeType==1?a.contains(e.nodeType==1?e:e.parentNode):a==e))n=!1;else return i}}getDesc(e){let t=e.pmViewDesc;for(let e=t;e;e=e.parent)if(e==this)return t}posFromDOM(e,t,n){for(let r=e;r;r=r.parentNode){let i=this.getDesc(r);if(i)return i.localPosFromDOM(e,t,n)}return-1}descAt(e){for(let t=0,n=0;t<this.children.length;t++){let r=this.children[t],i=n+r.size;if(n==e&&i!=n){for(;!r.border&&r.children.length;)for(let e=0;e<r.children.length;e++){let t=r.children[e];if(t.size){r=t;break}}return r}if(e<i)return r.descAt(e-n-r.border);n=i}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let n=0,r=0;for(let t=0;n<this.children.length;n++){let i=this.children[n],a=t+i.size;if(a>e||i instanceof Ag){r=e-t;break}t=a}if(r)return this.children[n].domFromPos(r-this.children[n].border,t);for(let e;n&&!(e=this.children[n-1]).size&&e instanceof wg&&e.side>=0;n--);if(t<=0){let e,r=!0;for(;e=n?this.children[n-1]:null,!(!e||e.dom.parentNode==this.contentDOM);n--,r=!1);return e&&t&&r&&!e.border&&!e.domAtom?e.domFromPos(e.size,t):{node:this.contentDOM,offset:e?ah(e.dom)+1:0}}else{let e,r=!0;for(;e=n<this.children.length?this.children[n]:null,!(!e||e.dom.parentNode==this.contentDOM);n++,r=!1);return e&&r&&!e.border&&!e.domAtom?e.domFromPos(0,t):{node:this.contentDOM,offset:e?ah(e.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,n=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let r=-1,i=-1;for(let a=n,o=0;;o++){let n=this.children[o],s=a+n.size;if(r==-1&&e<=s){let i=a+n.border;if(e>=i&&t<=s-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(e,t,i);e=a;for(let t=o;t>0;t--){let n=this.children[t-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){r=ah(n.dom)+1;break}e-=n.size}r==-1&&(r=0)}if(r>-1&&(s>t||o==this.children.length-1)){t=s;for(let e=o+1;e<this.children.length;e++){let n=this.children[e];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(-1)){i=ah(n.dom);break}t+=n.size}i==-1&&(i=this.contentDOM.childNodes.length);break}a=s}return{node:this.contentDOM,from:e,to:t,fromOffset:r,toOffset:i}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return t.size==0||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:n}=this.domFromPos(e,0);if(t.nodeType!=1||n==t.childNodes.length)throw RangeError(`No node after pos `+e);return t.childNodes[n]}setSelection(e,t,n,r=!1){let i=Math.min(e,t),a=Math.max(e,t);for(let o=0,s=0;o<this.children.length;o++){let c=this.children[o],l=s+c.size;if(i>s&&a<l)return c.setSelection(e-s-c.border,t-s-c.border,n,r);s=l}let o=this.domFromPos(e,e?-1:1),s=t==e?o:this.domFromPos(t,t?-1:1),c=n.root.getSelection(),l=n.domSelectionRange(),u=!1;if((Ah||Ph)&&e==t){let{node:e,offset:t}=o;if(e.nodeType==3){if(u=!!(t&&e.nodeValue[t-1]==` 231`),u&&t==e.nodeValue.length)for(let t=e,n;t;t=t.parentNode){if(n=t.nextSibling){n.nodeName==`BR`&&(o=s={node:n.parentNode,offset:ah(n)+1});break}let e=t.pmViewDesc;if(e&&e.node&&e.node.isBlock)break}}else{let n=e.childNodes[t-1];u=n&&(n.nodeName==`BR`||n.contentEditable==`false`)}}if(Ah&&l.focusNode&&l.focusNode!=s.node&&l.focusNode.nodeType==1){let e=l.focusNode.childNodes[l.focusOffset];e&&e.contentEditable==`false`&&(r=!0)}if(!(r||u&&Ph)&&uh(o.node,o.offset,l.anchorNode,l.anchorOffset)&&uh(s.node,s.offset,l.focusNode,l.focusOffset))return;let d=!1;if((c.extend||e==t)&&!(u&&Ah)){c.collapse(o.node,o.offset);try{e!=t&&c.extend(s.node,s.offset),d=!0}catch{}}if(!d){if(e>t){let e=o;o=s,s=e}let n=document.createRange();n.setEnd(s.node,s.offset),n.setStart(o.node,o.offset),c.removeAllRanges(),c.addRange(n)}}ignoreMutation(e){return!this.contentDOM&&e.type!=`selection`}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let n=0,r=0;r<this.children.length;r++){let i=this.children[r],a=n+i.size;if(n==a?e<=a&&t>=n:e<a&&t>n){let r=n+i.border,o=a-i.border;if(e>=r&&t<=o){this.dirty=e==n||t==a?xg:bg,e==r&&t==o&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=Sg:i.markDirty(e-r,t-r);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?xg:Sg}n=a}this.dirty=xg}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=e==1?xg:bg;t.dirty<n&&(t.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}},wg=class extends Cg{constructor(e,t,n,r){let i,a=t.type.toDOM;if(typeof a==`function`&&(a=a(n,()=>{if(!i)return r;if(i.parent)return i.parent.posBeforeChild(i)})),!t.type.spec.raw){if(a.nodeType!=1){let e=document.createElement(`span`);e.appendChild(a),a=e}a.contentEditable=`false`,a.classList.add(`ProseMirror-widget`)}super(e,[],a,null),this.widget=t,this.widget=t,i=this}matchesWidget(e){return this.dirty==yg&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return t?t(e):!1}ignoreMutation(e){return e.type!=`selection`||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}},Tg=class extends Cg{constructor(e,t,n,r){super(e,[],t,null),this.textDOM=n,this.text=r}get size(){return this.text.length}localPosFromDOM(e,t){return e==this.textDOM?this.posAtStart+t:this.posAtStart+(t?this.size:0)}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type===`characterData`&&e.target.nodeValue==e.oldValue}},Eg=class e extends Cg{constructor(e,t,n,r,i){super(e,[],n,r),this.mark=t,this.spec=i}static create(t,n,r,i){let a=i.nodeViews[n.type.name],o=a&&a(n,i,r);return(!o||!o.dom)&&(o=Tf.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new e(t,n,o.dom,o.contentDOM||o.dom,o)}parseRule(){return this.dirty&Sg||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=Sg&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=yg){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty<this.dirty&&(e.dirty=this.dirty),this.dirty=yg}}slice(t,n,r){let i=e.create(this.parent,this.mark,!0,r),a=this.children,o=this.size;n<o&&(a=qg(a,n,o,r)),t>0&&(a=qg(a,0,t,r));for(let e=0;e<a.length;e++)a[e].parent=i;return i.children=a,i}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}},Dg=class e extends Cg{constructor(e,t,n,r,i,a,o){super(e,[],i,a),this.node=t,this.outerDeco=n,this.innerDeco=r,this.nodeDOM=o}static create(t,n,r,i,a,o){let s=a.nodeViews[n.type.name],c,l=s&&s(n,a,()=>{if(!c)return o;if(c.parent)return c.parent.posBeforeChild(c)},r,i),u=l&&l.dom,d=l&&l.contentDOM;if(n.isText){if(!u)u=document.createTextNode(n.text);else if(u.nodeType!=3)throw RangeError(`Text must be rendered as a DOM text node`)}else if(!u){let e=Tf.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs);({dom:u,contentDOM:d}=e)}!d&&!n.isText&&u.nodeName!=`BR`&&(u.hasAttribute(`contenteditable`)||(u.contentEditable=`false`),n.type.spec.draggable&&(u.draggable=!0));let f=u;return u=Rg(u,r,n),l?c=new jg(t,n,r,i,u,d||null,f,l):n.isText?new kg(t,n,r,i,u,f):new e(t,n,r,i,u,d||null,f)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace==`pre`&&(e.preserveWhitespace=`full`),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let t=this.children.length-1;t>=0;t--){let n=this.children[t];if(this.dom.contains(n.dom.parentNode)){e.contentElement=n.dom.parentNode;break}}e.contentElement||(e.getContent=()=>G.empty)}return e}matchesNode(e,t,n){return this.dirty==yg&&e.eq(this.node)&&zg(t,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return+!this.node.isLeaf}updateChildren(e,t){let n=this.node.inlineContent,r=t,i=e.composing?this.localCompositionInfo(e,t):null,a=i&&i.pos>-1?i:null,o=i&&i.pos<0,s=new Vg(this,a&&a.node,e);Wg(this.node,this.innerDeco,(t,i,a)=>{t.spec.marks?s.syncToMarks(t.spec.marks,n,e,i):t.type.side>=0&&!a&&s.syncToMarks(i==this.node.childCount?gd.none:this.node.child(i).marks,n,e,i),s.placeWidget(t,e,r)},(t,a,c,l)=>{s.syncToMarks(t.marks,n,e,l);let u;s.findNodeMatch(t,a,c,l)||o&&e.state.selection.from>r&&e.state.selection.to<r+t.nodeSize&&(u=s.findIndexWithChild(i.node))>-1&&s.updateNodeAt(t,a,c,u,e)||s.updateNextNode(t,a,c,e,l,r)||s.addNode(t,a,c,e,r),r+=t.nodeSize}),s.syncToMarks([],n,e,0),this.node.isTextblock&&s.addTextblockHacks(),s.destroyRest(),(s.changed||this.dirty==xg)&&(a&&this.protectLocalComposition(e,a),Mg(this.contentDOM,this.children,e),Fh&&Gg(this.dom))}localCompositionInfo(e,t){let{from:n,to:r}=e.state.selection;if(!(e.state.selection instanceof Y)||n<t||r>t+this.node.content.size)return null;let i=e.input.compositionNode;if(!i||!this.dom.contains(i.parentNode))return null;if(this.node.inlineContent){let e=i.nodeValue,a=Kg(this.node.content,e,n-t,r-t);return a<0?null:{node:i,pos:a,text:e}}else return{node:i,pos:-1,text:``}}protectLocalComposition(e,{node:t,pos:n,text:r}){if(this.getDesc(t))return;let i=t;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&=void 0}let a=new Tg(this,i,t,r);e.input.compositionNodes.push(a),this.children=qg(this.children,n,n+r.length,e,a)}update(e,t,n,r){return this.dirty==Sg||!e.sameMarkup(this.node)?!1:(this.updateInner(e,t,n,r),!0)}updateInner(e,t,n,r){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=yg}updateOuterDeco(e){if(zg(e,this.outerDeco))return;let t=this.nodeDOM.nodeType!=1,n=this.dom;this.dom=Ig(this.dom,this.nodeDOM,Fg(this.outerDeco,this.node,t),Fg(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.add(`ProseMirror-selectednode`),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove(`ProseMirror-selectednode`),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute(`draggable`))}get domAtom(){return this.node.isAtom}};function Og(e,t,n,r,i){Rg(r,t,e);let a=new Dg(void 0,e,t,n,r,r,r);return a.contentDOM&&a.updateChildren(i,0),a}var kg=class e extends Dg{constructor(e,t,n,r,i,a){super(e,t,n,r,i,null,a)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,n,r){return this.dirty==Sg||this.dirty!=yg&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(t),(this.dirty!=yg||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=e,this.dirty=yg,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,n){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,n)}ignoreMutation(e){return e.type!=`characterData`&&e.type!=`selection`}slice(t,n,r){let i=this.node.cut(t,n),a=document.createTextNode(i.text);return new e(this.parent,i,this.outerDeco,this.innerDeco,a,a)}markDirty(e,t){super.markDirty(e,t),this.dom!=this.nodeDOM&&(e==0||t==this.nodeDOM.nodeValue.length)&&(this.dirty=Sg)}get domAtom(){return!1}isText(e){return this.node.text==e}},Ag=class extends Cg{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==yg&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName==`IMG`}},jg=class extends Dg{constructor(e,t,n,r,i,a,o,s){super(e,t,n,r,i,a,o),this.spec=s}update(e,t,n,r){if(this.dirty==Sg)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let i=this.spec.update(e,t,n);return i&&this.updateInner(e,t,n,r),i}else if(!this.contentDOM&&!e.isLeaf)return!1;else return super.update(e,t,n,r)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,n,r){this.spec.setSelection?this.spec.setSelection(e,t,n.root):super.setSelection(e,t,n,r)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}};function Mg(e,t,n){let r=e.firstChild,i=!1;for(let a=0;a<t.length;a++){let o=t[a],s=o.dom;if(s.parentNode==e){for(;s!=r;)r=Bg(r),i=!0;r=r.nextSibling}else i=!0,e.insertBefore(s,r);if(o instanceof Eg){let t=r?r.previousSibling:e.lastChild;Mg(o.contentDOM,o.children,n),r=t?t.nextSibling:e.firstChild}}for(;r;)r=Bg(r),i=!0;i&&n.trackWrites==e&&(n.trackWrites=null)}var Ng=function(e){e&&(this.nodeName=e)};Ng.prototype=Object.create(null);var Pg=[new Ng];function Fg(e,t,n){if(e.length==0)return Pg;let r=n?Pg[0]:new Ng,i=[r];for(let a=0;a<e.length;a++){let o=e[a].type.attrs;if(o){o.nodeName&&i.push(r=new Ng(o.nodeName));for(let e in o){let a=o[e];a!=null&&(n&&i.length==1&&i.push(r=new Ng(t.isInline?`span`:`div`)),e==`class`?r.class=(r.class?r.class+` `:``)+a:e==`style`?r.style=(r.style?r.style+`;`:``)+a:e!=`nodeName`&&(r[e]=a))}}}return i}function Ig(e,t,n,r){if(n==Pg&&r==Pg)return t;let i=t;for(let t=0;t<r.length;t++){let a=r[t],o=n[t];if(t){let t;o&&o.nodeName==a.nodeName&&i!=e&&(t=i.parentNode)&&t.nodeName.toLowerCase()==a.nodeName?i=t:(t=document.createElement(a.nodeName),t.pmIsDeco=!0,t.appendChild(i),o=Pg[0],i=t)}Lg(i,o||Pg[0],a)}return i}function Lg(e,t,n){for(let r in t)r!=`class`&&r!=`style`&&r!=`nodeName`&&!(r in n)&&e.removeAttribute(r);for(let r in n)r!=`class`&&r!=`style`&&r!=`nodeName`&&n[r]!=t[r]&&e.setAttribute(r,n[r]);
vendor: 6,942 bytes, line 231
231if(t.class!=n.class){let r=t.class?t.class.split(` `).filter(Boolean):[],i=n.class?n.class.split(` `).filter(Boolean):[];for(let t=0;t<r.length;t++)i.indexOf(r[t])==-1&&e.classList.remove(r[t]);for(let t=0;t<i.length;t++)r.indexOf(i[t])==-1&&e.classList.add(i[t]);e.classList.length==0&&e.removeAttribute(`class`)}if(t.style!=n.style){if(t.style){let n=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,r;for(;r=n.exec(t.style);)e.style.removeProperty(r[1])}n.style&&(e.style.cssText+=n.style)}}function Rg(e,t,n){return Ig(e,e,Pg,Fg(t,n,e.nodeType!=1))}function zg(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function Bg(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}var Vg=class{constructor(e,t,n){this.lock=t,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=Hg(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let n=e;n<t;n++)this.top.children[n].destroy();this.top.children.splice(e,t-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,t,n,r){let i=0,a=this.stack.length>>1,o=Math.min(a,e.length);for(;i<o&&(i==a-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&e[i].type.spec.spanning!==!1;)i++;for(;i<a;)this.destroyRest(),this.top.dirty=yg,this.index=this.stack.pop(),this.top=this.stack.pop(),a--;for(;a<e.length;){this.stack.push(this.top,this.index+1);let i=-1,o=this.top.children.length;r<this.preMatch.index&&(o=Math.min(this.index+3,o));for(let t=this.index;t<o;t++){let n=this.top.children[t];if(n.matchesMark(e[a])&&!this.isLocked(n.dom)){i=t;break}}if(i<0&&this.index<this.top.children.length){let t=this.top.children[this.index];t instanceof Eg&&t.dirty!=Sg&&t.mark.type==e[a].type&&t.spec.update&&!this.isLocked(t.dom)&&t.spec.update(e[a])&&(t.mark=e[a],i=this.index,this.changed=!0)}if(i>-1)i>this.index&&(this.changed=!0,this.destroyBetween(this.index,i)),this.top=this.top.children[this.index];else{let r=Eg.create(this.top,e[a],t,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0}this.index=0,a++}}findNodeMatch(e,t,n,r){let i=-1,a;if(r>=this.preMatch.index&&(a=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&a.matchesNode(e,t,n))i=this.top.children.indexOf(a,this.index);else for(let r=this.index,a=Math.min(this.top.children.length,r+5);r<a;r++){let a=this.top.children[r];if(a.matchesNode(e,t,n)&&!this.preMatch.matched.has(a)){i=r;break}}return i<0?!1:(this.destroyBetween(this.index,i),this.index++,!0)}updateNodeAt(e,t,n,r,i){let a=this.top.children[r];return a.dirty==Sg&&a.dom==a.contentDOM&&(a.dirty=xg),a.update(e,t,n,i)?(this.destroyBetween(this.index,r),this.index++,!0):!1}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return-1;if(t==this.top.contentDOM){let t=e.pmViewDesc;if(t){for(let e=this.index;e<this.top.children.length;e++)if(this.top.children[e]==t)return e}return-1}e=t}}updateNextNode(e,t,n,r,i,a){for(let o=this.index;o<this.top.children.length;o++){let s=this.top.children[o];if(s instanceof Dg){let c=this.preMatch.matched.get(s);if(c!=null&&c!=i)return!1;let l=s.dom,u,d=this.isLocked(l)&&!(e.isText&&s.node&&s.node.isText&&s.nodeDOM.nodeValue==e.text&&s.dirty!=Sg&&zg(t,s.outerDeco));if(!d&&s.update(e,t,n,r))return this.destroyBetween(this.index,o),s.dom!=l&&(this.changed=!0),this.index++,!0;if(!d&&(u=this.recreateWrapper(s,e,t,n,r,a)))return this.destroyBetween(this.index,o),this.top.children[this.index]=u,u.contentDOM&&(u.dirty=xg,u.updateChildren(r,a+1),u.dirty=yg),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,t,n,r,i,a){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content)||!zg(n,e.outerDeco)||!r.eq(e.innerDeco))return null;let o=Dg.create(this.top,t,n,r,i,a);if(o.contentDOM){o.children=e.children,e.children=[];for(let e of o.children)e.parent=o}return e.destroy(),o}addNode(e,t,n,r,i){let a=Dg.create(this.top,e,t,n,r,i);a.contentDOM&&a.updateChildren(r,i+1),this.top.children.splice(this.index++,0,a),this.changed=!0}placeWidget(e,t,n){let r=this.index<this.top.children.length?this.top.children[this.index]:null;if(r&&r.matchesWidget(e)&&(e==r.widget||!r.widget.type.toDOM.parentNode))this.index++;else{let r=new wg(this.top,e,t,n);this.top.children.splice(this.index++,0,r),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof Eg;)t=e,e=t.children[t.children.length-1];(!e||!(e instanceof kg)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((Ph||Mh)&&e&&e.dom.contentEditable==`false`&&this.addHackNode(`IMG`,t),this.addHackNode(`BR`,this.top))}addHackNode(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{let n=document.createElement(e);e==`IMG`&&(n.className=`ProseMirror-separator`,n.alt=``),e==`BR`&&(n.className=`ProseMirror-trailingBreak`);let r=new Ag(this.top,[],n,null);t==this.top?t.children.splice(this.index++,0,r):t.children.push(r),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}};function Hg(e,t){let n=t,r=n.children.length,i=e.childCount,a=new Map,o=[];outer:for(;i>0;){let s;for(;;)if(r){let e=n.children[r-1];if(e instanceof Eg)n=e,r=e.children.length;else{s=e,r--;break}}else if(n==t)break outer;else r=n.parent.children.indexOf(n),n=n.parent;let c=s.node;if(c){if(c!=e.child(i-1))break;--i,a.set(s,i),o.push(s)}}return{index:i,matched:a,matches:o.reverse()}}function Ug(e,t){return e.type.side-t.type.side}function Wg(e,t,n,r){let i=t.locals(e),a=0;if(i.length==0){for(let n=0;n<e.childCount;n++){let o=e.child(n);r(o,i,t.forChild(a,o),n),a+=o.nodeSize}return}let o=0,s=[],c=null;for(let l=0;;){let u,d;for(;o<i.length&&i[o].to==a;){let e=i[o++];e.widget&&(u?(d||=[u]).push(e):u=e)}if(u)if(d){d.sort(Ug);for(let e=0;e<d.length;e++)n(d[e],l,!!c)}else n(u,l,!!c);let f,p;if(c)p=-1,f=c,c=null;else if(l<e.childCount)p=l,f=e.child(l++);else break;for(let e=0;e<s.length;e++)s[e].to<=a&&s.splice(e--,1);for(;o<i.length&&i[o].from<=a&&i[o].to>a;)s.push(i[o++]);let m=a+f.nodeSize;if(f.isText){let e=m;o<i.length&&i[o].from<e&&(e=i[o].from);for(let t=0;t<s.length;t++)s[t].to<e&&(e=s[t].to);e<m&&(c=f.cut(e-a),f=f.cut(0,e-a),m=e,p=-1)}else for(;o<i.length&&i[o].to<m;)o++;let h=f.isInline&&!f.isLeaf?s.filter(e=>!e.inline):s.slice();r(f,h,t.forChild(a,f),p),a=m}}function Gg(e){if(e.nodeName==`UL`||e.nodeName==`OL`){let t=e.style.cssText;e.style.cssText=t+`; list-style: square !important`,window.getComputedStyle(e).listStyle,e.style.cssText=t}}function Kg(e,t,n,r){for(let i=0,a=0;i<e.childCount&&a<=r;){let o=e.child(i++),s=a;if(a+=o.nodeSize,!o.isText)continue;let c=o.text;for(;i<e.childCount;){let t=e.child(i++);if(a+=t.nodeSize,!t.isText)break;c+=t.text}if(a>=n){if(a>=r&&c.slice(r-t.length-s,r-s)==t)return r-t.length;let e=s<r?c.lastIndexOf(t,r-s-1):-1;
vendor: 16,708 bytes, lines 231-234
231if(e>=0&&e+t.length+s>=n)return s+e;if(n==r&&c.length>=r+t.length-s&&c.slice(r-s,r-s+t.length)==t)return r}}return-1}function qg(e,t,n,r,i){let a=[];for(let o=0,s=0;o<e.length;o++){let c=e[o],l=s,u=s+=c.size;l>=n||u<=t?a.push(c):(l<t&&a.push(c.slice(0,t-l,r)),i&&=(a.push(i),void 0),u>n&&a.push(c.slice(n-l,c.size,r)))}return a}function Jg(e,t=null){let n=e.domSelectionRange(),r=e.state.doc;if(!n.focusNode)return null;let i=e.docView.nearestDesc(n.focusNode),a=i&&i.size==0,o=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(o<0)return null;let s=r.resolve(o),c,l;if(vh(n)){for(c=o;i&&!i.node;)i=i.parent;let e=i.node;if(i&&e.isAtom&&X.isSelectable(e)&&i.parent&&!(e.isInline&&gh(n.focusNode,n.focusOffset,i.dom))){let e=i.posBefore;l=new X(o==e?s:r.resolve(e))}}else{if(n instanceof e.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let t=o,i=o;for(let r=0;r<n.rangeCount;r++){let a=n.getRangeAt(r);t=Math.min(t,e.docView.posFromDOM(a.startContainer,a.startOffset,1)),i=Math.max(i,e.docView.posFromDOM(a.endContainer,a.endOffset,-1))}if(t<0)return null;[c,o]=i==e.state.selection.anchor?[i,t]:[t,i],s=r.resolve(o)}else c=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(c<0)return null}let u=r.resolve(c);if(!l){let n=t==`pointer`||e.state.selection.head<s.pos&&!a?1:-1;l=a_(e,u,s,n)}return l}function Yg(e){return e.editable?e.hasFocus():s_(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function Xg(e,t=!1){let n=e.state.selection;if(r_(e,n),!Yg(e))return;let r=e.input.mouseDown;if(!t&&Mh&&r){let t=e.domSelectionRange(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&uh(t.anchorNode,t.anchorOffset,n.anchorNode,n.anchorOffset)&&r.delaySelUpdate()){e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)n_(e);else{let{anchor:r,head:i}=n,a,o;Zg&&!(n instanceof Y)&&(n.$from.parent.inlineContent||(a=Qg(e,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(o=Qg(e,n.to))),e.docView.setSelection(r,i,e,t),Zg&&(a&&e_(a),o&&e_(o)),n.visible?e.dom.classList.remove(`ProseMirror-hideselection`):(e.dom.classList.add(`ProseMirror-hideselection`),`onselectionchange`in document&&t_(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}var Zg=Ph||Mh&&Nh<63;function Qg(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),i=r<n.childNodes.length?n.childNodes[r]:null,a=r?n.childNodes[r-1]:null;if(Ph&&i&&i.contentEditable==`false`)return $g(i);if((!i||i.contentEditable==`false`)&&(!a||a.contentEditable==`false`)){if(i)return $g(i);if(a)return $g(a)}}function $g(e){return e.contentEditable=`true`,Ph&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function e_(e){e.contentEditable=`false`,e.wasDraggable&&=(e.draggable=!0,null)}function t_(e){let t=e.dom.ownerDocument;t.removeEventListener(`selectionchange`,e.input.hideSelectionGuard);let n=e.domSelectionRange(),r=n.anchorNode,i=n.anchorOffset;t.addEventListener(`selectionchange`,e.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=i)&&(t.removeEventListener(`selectionchange`,e.input.hideSelectionGuard),setTimeout(()=>{(!Yg(e)||e.state.selection.visible)&&e.dom.classList.remove(`ProseMirror-hideselection`)},20))})}function n_(e){let t=e.domSelection();if(!t)return;let n=e.cursorWrapper.dom,r=n.nodeName==`IMG`;r?t.collapse(n.parentNode,ah(n)+1):t.collapse(n,0),!r&&!e.state.selection.visible&&Oh&&kh<=11&&(n.disabled=!0,n.disabled=!1)}function r_(e,t){if(t instanceof X){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(i_(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else i_(e)}function i_(e){e.lastSelectedViewDesc&&=(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),void 0)}function a_(e,t,n,r){return e.someProp(`createSelectionBetween`,r=>r(e,t,n))||Y.between(t,n,r)}function o_(e){return e.editable&&!e.hasFocus()?!1:s_(e)}function s_(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(t.anchorNode.nodeType==3?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(t.focusNode.nodeType==3?t.focusNode.parentNode:t.focusNode))}catch{return!1}}function c_(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return uh(t.node,t.offset,n.anchorNode,n.anchorOffset)}function l_(e,t){let{$anchor:n,$head:r}=e.selection,i=t>0?n.max(r):n.min(r),a=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return a&&J.findFrom(a,t)}function u_(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function d_(e,t,n){let r=e.state.selection;if(r instanceof Y){if(n.indexOf(`s`)>-1){let{$head:n}=r,i=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let a=e.state.doc.resolve(n.pos+i.nodeSize*(t<0?-1:1));return u_(e,new Y(r.$anchor,a))}else if(!r.empty)return!1;else if(e.endOfTextblock(t>0?`forward`:`backward`)){let n=l_(e.state,t);return n&&n instanceof X?u_(e,n):!1}else if(!(Ih&&n.indexOf(`m`)>-1)){let n=r.$head,i=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter,a;if(!i||i.isText)return!1;let o=t<0?n.pos-i.nodeSize:n.pos;return i.isAtom||(a=e.docView.descAt(o))&&!a.contentDOM?X.isSelectable(i)?u_(e,new X(t<0?e.state.doc.resolve(n.pos-i.nodeSize):n)):zh?u_(e,new Y(e.state.doc.resolve(t<0?o:o+i.nodeSize))):!1:!1}}else if(r instanceof X&&r.node.isInline)return u_(e,new Y(t>0?r.$to:r.$from));else{let n=l_(e.state,t);return n?u_(e,n):!1}}function f_(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function p_(e,t){let n=e.pmViewDesc;return n&&n.size==0&&(t<0||e.nextSibling||e.nodeName!=`BR`)}function m_(e,t){return t<0?h_(e):g_(e)}function h_(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,a,o=!1;for(Ah&&n.nodeType==1&&r<f_(n)&&p_(n.childNodes[r],-1)&&(o=!0);;)if(r>0){if(n.nodeType!=1)break;{let e=n.childNodes[r-1];if(p_(e,-1))i=n,a=--r;else if(e.nodeType==3)n=e,r=n.nodeValue.length;else break}}else if(__(n))break;else{let t=n.previousSibling;for(;t&&p_(t,-1);)i=n.parentNode,a=ah(t),t=t.previousSibling;if(t)n=t,r=f_(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}o?b_(e,n,r):i&&b_(e,i,a)}function g_(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i=f_(n),a,o;for(;;)if(r<i){if(n.nodeType!=1)break;let e=n.childNodes[r];if(p_(e,1))a=n,o=++r;else break}else if(__(n))break;else{let t=n.nextSibling;for(;t&&p_(t,1);)a=t.parentNode,o=ah(t)+1,t=t.nextSibling;if(t)n=t,r=0,i=f_(n);else{if(n=n.parentNode,n==e.dom)break;r=i=0}}a&&b_(e,a,o)}function __(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function v_(e,t){for(;e&&t==e.childNodes.length&&!_h(e);)t=ah(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable==`false`)break;e=n,t=0}}function y_(e,t){for(;e&&!t&&!_h(e);)t=ah(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable==`false`)break;e=n,t=e.childNodes.length}}function b_(e,t,n){if(t.nodeType!=3){let e,r;(r=v_(t,n))?(t=r,n=0):(e=y_(t,n))&&(t=e,n=e.nodeValue.length)}let r=e.domSelection();if(!r)return;if(vh(r)){let e=document.createRange();e.setEnd(t,n),e.setStart(t,n),r.removeAllRanges(),r.addRange(e)}else r.extend&&r.extend(t,n);e.domObserver.setCurSelection();let{state:i}=e;setTimeout(()=>{e.state==i&&Xg(e)},50)}function x_(e,t){let n=e.state.doc.resolve(t);if(!(Mh||Lh)&&n.parent.inlineContent){let r=e.coordsAtPos(t);if(t>n.start()){let n=e.coordsAtPos(t-1),i=(n.top+n.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(n.left-r.left)>1)return n.left<r.left?`ltr`:`rtl`}if(t<n.end()){let n=e.coordsAtPos(t+1),i=(n.top+n.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(n.left-r.left)>1)return n.left>r.left?`ltr`:`rtl`}}return getComputedStyle(e.dom).direction==`rtl`?`rtl`:`ltr`}function S_(e,t,n){let r=e.state.selection;if(r instanceof Y&&!r.empty||n.indexOf(`s`)>-1||Ih&&n.indexOf(`m`)>-1)return!1;let{$from:i,$to:a}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?`up`:`down`)){let n=l_(e.state,t);if(n&&n instanceof X)return u_(e,n)}if(!i.parent.inlineContent){let n=t<0?i:a,o=r instanceof Zp?J.near(n,t):J.findFrom(n,t);return o?u_(e,o):!1}return!1}function C_(e,t){if(!(e.state.selection instanceof Y))return!0;let{$head:n,$anchor:r,empty:i}=e.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?`forward`:`backward`))return!0;let a=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(a&&!a.isText){let r=e.state.tr;return t<0?r.delete(n.pos-a.nodeSize,n.pos):r.delete(n.pos,n.pos+a.nodeSize),e.dispatch(r),!0}return!1}function w_(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function T_(e){if(!Ph||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&t.nodeType==1&&n==0&&t.firstChild&&t.firstChild.contentEditable==`false`){let n=t.firstChild;w_(e,n,`true`),setTimeout(()=>w_(e,n,`false`),20)}return!1}function E_(e){let t=``;return e.ctrlKey&&(t+=`c`),e.metaKey&&(t+=`m`),e.altKey&&(t+=`a`),e.shiftKey&&(t+=`s`),t}function D_(e,t){let n=t.keyCode,r=E_(t);if(n==8||Ih&&n==72&&r==`c`)return C_(e,-1)||m_(e,-1);if(n==46&&!t.shiftKey||Ih&&n==68&&r==`c`)return C_(e,1)||m_(e,1);if(n==13||n==27)return!0;if(n==37||Ih&&n==66&&r==`c`){let t=n==37?x_(e,e.state.selection.from)==`ltr`?-1:1:-1;return d_(e,t,r)||m_(e,t)}else if(n==39||Ih&&n==70&&r==`c`){let t=n==39?x_(e,e.state.selection.from)==`ltr`?1:-1:1;return d_(e,t,r)||m_(e,t)}else if(n==38||Ih&&n==80&&r==`c`)return S_(e,-1,r)||m_(e,-1);else if(n==40||Ih&&n==78&&r==`c`)return T_(e)||S_(e,1,r)||m_(e,1);else if(r==(Ih?`m`:`c`)&&(n==66||n==73||n==89||n==90))return!0;return!1}function O_(e,t){e.someProp(`transformCopied`,n=>{t=n(t,e)});let n=[],{content:r,openStart:i,openEnd:a}=t;for(;i>1&&a>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,a--;let e=r.firstChild;n.push(e.type.name,e.attrs==e.type.defaultAttrs?null:e.attrs),r=e.content}let o=e.someProp(`clipboardSerializer`)||Tf.fromSchema(e.state.schema),s=R_(),c=s.createElement(`div`);c.appendChild(o.serializeFragment(r,{document:s}));let l=c.firstChild,u,d=0;for(;l&&l.nodeType==1&&(u=L_[l.nodeName.toLowerCase()]);){for(let e=u.length-1;e>=0;e--){let t=s.createElement(u[e]);for(;c.firstChild;)t.appendChild(c.firstChild);c.appendChild(t),d++}l=c.firstChild}return l&&l.nodeType==1&&l.setAttribute(`data-pm-slice`,`${i} ${a}${d?` -${d}`:``} ${JSON.stringify(n)}`),{dom:c,text:e.someProp(`clipboardTextSerializer`,n=>n(t,e))||t.content.textBetween(0,t.content.size,` 232 233`),slice:t}}function k_(e,t,n,r,i){let a=i.parent.type.spec.code,o,s;if(!n&&!t)return null;let c=!!t&&(r||a||!n);if(c){if(e.someProp(`transformPastedText`,n=>{t=n(t,a||r,e)}),a)return s=new K(G.from(e.state.schema.text(t.replace(/\r\n?/g,` 234`))),0,0),e.someProp(`transformPasted`,t=>{s=t(s,e,!0)}),s;let n=e.someProp(`clipboardTextParser`,n=>n(t,i,r,e));if(n)s=n;else{let n=i.marks(),{schema:r}=e.state,a=Tf.fromSchema(r);o=document.createElement(`div`),t.split(/(?:\r\n?|\n)+/).forEach(e=>{let t=o.appendChild(document.createElement(`p`));e&&t.appendChild(a.serializeNode(r.text(e,n)))})}}else e.someProp(`transformPastedHTML`,t=>{n=t(n,e)}),o=V_(n),zh&&H_(o);let l=o&&o.querySelector(`[data-pm-slice]`),u=l&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(l.getAttribute(`data-pm-slice`)||``);if(u&&u[3])for(let e=+u[3];e>0;e--){let e=o.firstChild;for(;e&&e.nodeType!=1;)e=e.nextSibling;if(!e)break;o=e}if(s||=(e.someProp(`clipboardParser`)||e.someProp(`domParser`)||df.fromSchema(e.state.schema)).parseSlice(o,{preserveWhitespace:!!(c||u),context:i,ruleFromNode(e){return e.nodeName==`BR`&&!e.nextSibling&&e.parentNode&&!A_.test(e.parentNode.nodeName)?{ignore:!0}:null}}),u)s=U_(I_(s,+u[1],+u[2]),u[4]);else if(s=K.maxOpen(j_(s.content,i),!0),s.openStart||s.openEnd){let e=0,t=0;for(let t=s.content.firstChild;e<s.openStart&&!t.type.spec.isolating;e++,t=t.firstChild);for(let e=s.content.lastChild;t<s.openEnd&&!e.type.spec.isolating;t++,e=e.lastChild);s=I_(s,e,t)}return e.someProp(`transformPasted`,t=>{s=t(s,e,c)}),s}var A_=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function j_(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let r=t.node(n).contentMatchAt(t.index(n)),i,a=[];if(e.forEach(e=>{if(!a)return;let t=r.findWrapping(e.type),n;if(!t)return a=null;if(n=a.length&&i.length&&N_(t,i,e,a[a.length-1],0))a[a.length-1]=n;else{a.length&&(a[a.length-1]=P_(a[a.length-1],i.length));let n=M_(e,t);a.push(n),r=r.matchType(n.type),i=t}}),a)return G.from(a)}return e}function M_(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,G.from(e));return e}function N_(e,t,n,r,i){if(i<e.length&&i<t.length&&e[i]==t[i]){let a=N_(e,t,n,r.lastChild,i+1);if(a)return r.copy(r.content.replaceChild(r.childCount-1,a));if(r.contentMatchAt(r.childCount).matchType(i==e.length-1?n.type:e[i+1]))return r.copy(r.content.append(G.from(M_(n,e,i+1))))}}function P_(e,t){if(t==0)return e;let n=e.content.replaceChild(e.childCount-1,P_(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(G.empty,!0);return e.copy(n.append(r))}function F_(e,t,n,r,i,a){let o=t<0?e.firstChild:e.lastChild,s=o.content;return e.childCount>1&&(a=0),i<r-1&&(s=F_(s,t,n,r,i+1,a)),i>=n&&(s=t<0?o.contentMatchAt(0).fillBefore(s,a<=i).append(s):s.append(o.contentMatchAt(o.childCount).fillBefore(G.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,o.copy(s))}function I_(e,t,n){return t<e.openStart&&(e=new K(F_(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new K(F_(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}var L_={thead:[`table`],tbody:[`table`],tfoot:[`table`],caption:[`table`],colgroup:[`table`],col:[`table`,`colgroup`],tr:[`table`,`tbody`],td:[`table`,`tbody`,`tr`],th:[`table`,`tbody`,`tr`]};function R_(){return document.implementation.createHTMLDocument(`title`)}var z_=null;function B_(e){let t=window.trustedTypes;return t?(z_||=t.defaultPolicy||t.createPolicy(`ProseMirrorClipboard`,{createHTML:e=>e}),z_.createHTML(e)):e}function V_(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=R_(),r=n.body,i=/<([a-z][^>\s]+)/i.exec(e),a;if((a=i&&L_[i[1].toLowerCase()])&&(e=a.map(e=>`<`+e+`>`).join(``)+e+a.map(e=>`</`+e+`>`).reverse().join(``)),r.innerHTML=B_(e),a)for(let e=0;e<a.length;e++)r=r.querySelector(a[e])||r;for(let e=0;e<n.styleSheets.length;e++){let t=n.styleSheets[e];for(let e=0;e<t.rules.length;e++){let n=t.rules[e];if(n instanceof CSSStyleRule){let e=r.querySelectorAll(n.selectorText);for(let t=0;t<e.length;t++)e[t].style.cssText+=n.style.cssText}}}return r}function H_(e){let t=e.querySelectorAll(Mh?`span:not([class]):not([style])`:`span.Apple-converted-space`);for(let n=0;n<t.length;n++){let r=t[n];r.childNodes.length==1&&r.textContent==`\xA0`&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(` `),r)}}function U_(e,t){if(!e.size)return e;let n=e.content.firstChild.type.schema,r;try{r=JSON.parse(t)}catch{return e}let{content:i,openStart:a,openEnd:o}=e;for(let e=r.length-2;e>=0;e-=2){let t=n.nodes[r[e]];if(!t||t.hasRequiredAttrs())break;i=G.from(t.create(r[e+1],i)),a++,o++}return new K(i,a,o)}var W_={},G_={},K_={touchstart:!0,touchmove:!0},q_=class{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:``,button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}};function J_(e){for(let t in W_){let n=W_[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{$_(e,t)&&!Q_(e,t)&&(e.editable||!(t.type in G_))&&n(e,t)},K_[t]?{passive:!0}:void 0)}Ph&&e.dom.addEventListener(`input`,()=>null),Z_(e)}function Y_(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function X_(e){e.input.mouseDown&&e.input.mouseDown.done(),e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}function Z_(e){e.someProp(`handleDOMEvents`,t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>Q_(e,t))})}function Q_(e,t){return e.someProp(`handleDOMEvents`,n=>{let r=n[t.type];return r?r(e,t)||t.defaultPrevented:!1})}function $_(e,t){if(!t.bubbles)return!0;
vendor: 7,976 bytes, line 234
234if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function ev(e,t){!Q_(e,t)&&W_[t.type]&&(e.editable||!(t.type in G_))&&W_[t.type](e,t)}G_.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=n.keyCode==16||n.shiftKey,!_v(e)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!(Rh&&Mh&&n.keyCode==13)))if(n.keyCode!=229&&e.domObserver.forceFlush(),Fh&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let t=Date.now();e.input.lastIOSEnter=t,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==t&&(e.someProp(`handleKeyDown`,t=>t(e,yh(13,`Enter`))),e.input.lastIOSEnter=0)},200)}else e.someProp(`handleKeyDown`,t=>t(e,n))||D_(e,n)?n.preventDefault():Y_(e,`key`)},G_.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)},G_.keypress=(e,t)=>{let n=t;if(_v(e)||!n.charCode||n.ctrlKey&&!n.altKey||Ih&&n.metaKey)return;if(e.someProp(`handleKeyPress`,t=>t(e,n))){n.preventDefault();return}let r=e.state.selection;if(!(r instanceof Y)||!r.$from.sameParent(r.$to)){let t=String.fromCharCode(n.charCode),i=()=>e.state.tr.insertText(t).scrollIntoView();!/[\r\n]/.test(t)&&!e.someProp(`handleTextInput`,n=>n(e,r.$from.pos,r.$to.pos,t,i))&&e.dispatch(i()),n.preventDefault()}};function tv(e){return{left:e.clientX,top:e.clientY}}function nv(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}function rv(e,t,n,r,i){if(r==-1)return!1;let a=e.state.doc.resolve(r);for(let r=a.depth+1;r>0;r--)if(e.someProp(t,t=>r>a.depth?t(e,n,a.nodeAfter,a.before(r),i,!0):t(e,n,a.node(r),a.before(r),i,!1)))return!0;return!1}function iv(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let r=e.state.tr.setSelection(t);n==`pointer`&&r.setMeta(`pointer`,!0),e.dispatch(r)}function av(e,t){if(t==-1)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return r&&r.isAtom&&X.isSelectable(r)?(iv(e,new X(n),`pointer`),!0):!1}function ov(e,t){if(t==-1)return!1;let n=e.state.selection,r,i;n instanceof X&&(r=n.node);let a=e.state.doc.resolve(t);for(let e=a.depth+1;e>0;e--){let t=e>a.depth?a.nodeAfter:a.node(e);if(X.isSelectable(t)){i=r&&n.$from.depth>0&&e>=n.$from.depth&&a.before(n.$from.depth+1)==n.$from.pos?a.before(n.$from.depth):a.before(e);break}}return i==null?!1:(iv(e,X.create(e.state.doc,i),`pointer`),!0)}function sv(e,t,n,r,i){return rv(e,`handleClickOn`,t,n,r)||e.someProp(`handleClick`,n=>n(e,t,r))||(i?ov(e,n):av(e,n))}function cv(e,t,n,r){return rv(e,`handleDoubleClickOn`,t,n,r)||e.someProp(`handleDoubleClick`,n=>n(e,t,r))}function lv(e,t,n,r){return rv(e,`handleTripleClickOn`,t,n,r)||e.someProp(`handleTripleClick`,n=>n(e,t,r))||uv(e,n,r)}function uv(e,t,n){if(n.button!=0)return!1;let r=dv(e,t,!0),i=e.state.doc;return r?(iv(e,r,`pointer`),r instanceof Y&&i.eq(e.state.doc)&&(e.input.mouseDown=new gv(e,r)),!0):!1}function dv(e,t,n){let r=e.state.doc;if(t==-1)return r.inlineContent?Y.create(r,0,r.content.size):null;let i=r.resolve(t);for(let e=i.depth+1;e>0;e--){let t=e>i.depth?i.nodeAfter:i.node(e),a=i.before(e);if(t.inlineContent)return Y.create(r,a+1,a+1+t.content.size);if(n&&X.isSelectable(t))return X.create(r,a)}return null}function fv(e){return Cv(e)}var pv=Ih?`metaKey`:`ctrlKey`;W_.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=fv(e),i=Date.now(),a=`singleClick`;i-e.input.lastClick.time<500&&nv(n,e.input.lastClick)&&!n[pv]&&e.input.lastClick.button==n.button&&(e.input.lastClick.type==`singleClick`?a=`doubleClick`:e.input.lastClick.type==`doubleClick`&&(a=`tripleClick`)),e.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:a,button:n.button},e.input.mouseDown&&e.input.mouseDown.done();let o=e.posAtCoords(tv(n));o&&(a==`singleClick`?e.input.mouseDown=new hv(e,o,n,!!r):(a==`doubleClick`?cv:lv)(e,o.pos,o.inside,n)?n.preventDefault():Y_(e,`pointer`))};var mv=class{constructor(e){this.view=e,this.mightDrag=null,e.root.addEventListener(`mouseup`,this.up=this.up.bind(this)),e.root.addEventListener(`mousemove`,this.move=this.move.bind(this))}up(e){this.done()}move(e){e.buttons==0&&this.done()}done(){this.view.root.removeEventListener(`mouseup`,this.up),this.view.root.removeEventListener(`mousemove`,this.move),this.view.input.mouseDown==this&&(this.view.input.mouseDown=null)}delaySelUpdate(){return!1}},hv=class extends mv{constructor(e,t,n,r){super(e),this.pos=t,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.startDoc=e.state.doc,this.selectNode=!!n[pv],this.allowDefault=n.shiftKey;let i,a;if(t.inside>-1)i=e.state.doc.nodeAt(t.inside),a=t.inside;else{let n=e.state.doc.resolve(t.pos);i=n.parent,a=n.depth?n.before():0}let o=r?null:n.target,s=o?e.docView.nearestDesc(o,!0):null;this.target=s&&s.nodeDOM.nodeType==1?s.nodeDOM:null;let{selection:c}=e.state;n.button==0&&(i.type.spec.draggable&&i.type.spec.selectable!==!1||c instanceof X&&c.from<=a&&c.to>a)&&(this.mightDrag={node:i,pos:a,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Ah&&!this.target.hasAttribute(`contentEditable`))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute(`contentEditable`,`false`)},20),this.view.domObserver.start()),Y_(e,`pointer`)}done(){super.done(),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute(`draggable`),this.mightDrag.setUneditable&&this.target.removeAttribute(`contentEditable`),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>{this.view.isDestroyed||Xg(this.view)})}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(tv(e))),this.updateAllowDefault(e),this.allowDefault||!t?Y_(this.view,`pointer`):sv(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Ph&&this.mightDrag&&!this.mightDrag.node.isAtom||Mh&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(iv(this.view,J.near(this.view.state.doc.resolve(t.pos)),`pointer`),e.preventDefault()):Y_(this.view,`pointer`)}move(e){this.updateAllowDefault(e),Y_(this.view,`pointer`),super.move(e)}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}delaySelUpdate(){return this.allowDefault?(this.delayedSelectionSync=!0,!0):!1}},gv=class extends mv{constructor(e,t){super(e),this.startSelection=t,this.startDoc=e.state.doc}move(e){if(e.buttons==0||this.view.isDestroyed||!this.view.state.doc.eq(this.startDoc)){this.done();return}e.preventDefault(),Y_(this.view,`pointer`);let t=this.view.posAtCoords(tv(e)),n=t&&dv(this.view,t.inside,!1);if(!n)return;let{doc:r}=this.view.state,i=this.startSelection,[a,o]=n.from<i.from?[i.to,n.from]:[i.from,n.to];iv(this.view,Y.create(r,a,o),`pointer`)}};W_.touchstart=e=>{e.input.lastTouch=Date.now(),fv(e),Y_(e,`pointer`)},W_.touchmove=e=>{e.input.lastTouch=Date.now(),Y_(e,`pointer`)},W_.contextmenu=e=>fv(e);function _v(e,t){return e.composing?!0:Ph&&Math.abs(Date.now()-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}var vv=Rh?5e3:-1;G_.compositionstart=G_.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof Y&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(e=>e.type.spec.inclusive===!1)||Mh&&Lh&&yv(e)))e.markCursor=e.state.storedMarks||n.marks(),Cv(e,!0),e.markCursor=null;else if(Cv(e,!t.selection.empty),Ah&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelectionRange();for(let n=t.focusNode,r=t.focusOffset;n&&n.nodeType==1&&r!=0;){let t=r<0?n.lastChild:n.childNodes[r-1];if(!t)break;
vendor: 29,417 bytes, line 234
234if(t.nodeType==3){let n=e.domSelection();n&&n.collapse(t,t.nodeValue.length);break}else n=t,r=-1}}e.input.composing=!0}bv(e,vv)};function yv(e){let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(!t||t.nodeType!=1||n>=t.childNodes.length)return!1;let r=t.childNodes[n];return r.nodeType==1&&r.contentEditable==`false`}G_.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Date.now(),e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.badSafariComposition?e.domObserver.forceFlush():e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,bv(e,20))};function bv(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>Cv(e),t))}function xv(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Date.now());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function Sv(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=mh(t.focusNode,t.focusOffset),r=hh(t.focusNode,t.focusOffset);if(n&&r&&n!=r){let t=r.pmViewDesc,i=e.domObserver.lastChangedTextNode;if(n==i||r==i)return i;if(!t||!t.isText(r.nodeValue))return r;if(e.input.compositionNode==r){let e=n.pmViewDesc;if(!(!e||!e.isText(n.nodeValue)))return r}}return n||r}function Cv(e,t=!1){if(!(Rh&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),xv(e),t||e.docView&&e.docView.dirty){let n=Jg(e),r=e.state.selection;return n&&!n.eq(r)?e.dispatch(e.state.tr.setSelection(n)):(e.markCursor||t)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?e.dispatch(e.state.tr.deleteSelection()):e.updateState(e.state),!0}return!1}}function wv(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement(`div`));n.appendChild(t),n.style.cssText=`position: fixed; left: -10000px; top: 10px`;let r=getSelection(),i=document.createRange();i.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}var Tv=Oh&&kh<15||Fh&&Bh<604;W_.copy=G_.cut=(e,t)=>{let n=t,r=e.state.selection,i=n.type==`cut`;if(r.empty)return;let a=Tv?null:n.clipboardData,{dom:o,text:s}=O_(e,r.content());a?(n.preventDefault(),a.clearData(),a.setData(`text/html`,o.innerHTML),a.setData(`text/plain`,s)):wv(e,o),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta(`uiEvent`,`cut`))};function Ev(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function Dv(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?`textarea`:`div`));n||(r.contentEditable=`true`),r.style.cssText=`position: fixed; left: -10000px; top: 10px`,r.focus();let i=e.input.shiftKey&&e.input.lastKeyCode!=45;setTimeout(()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Ov(e,r.value,null,i,t):Ov(e,r.textContent,r.innerHTML,i,t)},50)}function Ov(e,t,n,r,i){let a=k_(e,t,n,r,e.state.selection.$from);if(e.someProp(`handlePaste`,t=>t(e,i,a||K.empty)))return!0;if(!a)return!1;let o=Ev(a),s=o?e.state.tr.replaceSelectionWith(o,r):e.state.tr.replaceSelection(a);return e.dispatch(s.scrollIntoView().setMeta(`paste`,!0).setMeta(`uiEvent`,`paste`)),!0}function kv(e){let t=e.getData(`text/plain`)||e.getData(`Text`);if(t)return t;let n=e.getData(`text/uri-list`);return n?n.replace(/\r?\n/g,` `):``}G_.paste=(e,t)=>{let n=t;if(e.composing&&!Rh)return;let r=Tv?null:n.clipboardData,i=e.input.shiftKey&&e.input.lastKeyCode!=45;r&&Ov(e,kv(r),r.getData(`text/html`),i,n)?n.preventDefault():Dv(e,n)};var Av=class{constructor(e,t,n){this.slice=e,this.move=t,this.node=n}},jv=Ih?`altKey`:`ctrlKey`;function Mv(e,t){let n;return e.someProp(`dragCopies`,e=>{n||=e(t)}),n==null?!t[jv]:!n}W_.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=e.state.selection,a=i.empty?null:e.posAtCoords(tv(n)),o;if(!(a&&a.pos>=i.from&&a.pos<=(i instanceof X?i.to-1:i.to))){if(r&&r.mightDrag)o=X.create(e.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let t=e.docView.nearestDesc(n.target,!0);t&&t.node.type.spec.draggable&&t!=e.docView&&(o=X.create(e.state.doc,t.posBefore))}}let{dom:s,text:c,slice:l}=O_(e,(o||e.state.selection).content());(!n.dataTransfer.files.length||!Mh||Nh>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(Tv?`Text`:`text/html`,s.innerHTML),n.dataTransfer.effectAllowed=`copyMove`,Tv||n.dataTransfer.setData(`text/plain`,c),e.dragging=new Av(l,Mv(e,n),o)},W_.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)},G_.dragover=G_.dragenter=(e,t)=>t.preventDefault(),G_.drop=(e,t)=>{try{Nv(e,t,e.dragging)}finally{e.dragging=null}};function Nv(e,t,n){if(!t.dataTransfer)return;let r=e.posAtCoords(tv(t));if(!r)return;let i=e.state.doc.resolve(r.pos),a=n&&n.slice;a?e.someProp(`transformPasted`,t=>{a=t(a,e,!1)}):a=k_(e,kv(t.dataTransfer),Tv?null:t.dataTransfer.getData(`text/html`),!1,i);let o=!!(n&&Mv(e,t));if(e.someProp(`handleDrop`,n=>n(e,t,a||K.empty,o))){t.preventDefault();return}if(!a)return;t.preventDefault();let s=a?Tp(e.state.doc,i.pos,a):i.pos;s??=i.pos;let c=e.state.tr;if(o){let{node:e}=n;e?e.replace(c):c.deleteSelection()}let l=c.mapping.map(s),u=a.openStart==0&&a.openEnd==0&&a.content.childCount==1,d=c.doc;if(u?c.replaceRangeWith(l,l,a.content.firstChild):c.replaceRange(l,l,a),c.doc.eq(d))return;let f=c.doc.resolve(l);if(u&&X.isSelectable(a.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(a.content.firstChild))c.setSelection(new X(f));else{let t=c.mapping.map(s);c.mapping.maps[c.mapping.maps.length-1].forEach((e,n,r,i)=>t=i),c.setSelection(a_(e,f,c.doc.resolve(t)))}e.focus(),e.dispatch(c.setMeta(`uiEvent`,`drop`))}W_.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add(`ProseMirror-focused`),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&Xg(e)},20))},W_.blur=(e,t)=>{let n=t;e.focused&&=(e.domObserver.stop(),e.dom.classList.remove(`ProseMirror-focused`),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),!1)},W_.beforeinput=(e,t)=>{if(Mh&&Rh&&t.inputType==`deleteContentBackward`){e.domObserver.flushSoon();let{domChangeCount:t}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=t||(e.dom.blur(),e.focus(),e.someProp(`handleKeyDown`,t=>t(e,yh(8,`Backspace`)))))return;let{$cursor:n}=e.state.selection;n&&n.pos>0&&e.dispatch(e.state.tr.delete(n.pos-1,n.pos).scrollIntoView())},50)}};for(let e in G_)W_[e]=G_[e];function Pv(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}var Fv=class e{constructor(e,t){this.toDOM=e,this.spec=t||Bv,this.side=this.spec.side||0}map(e,t,n,r){let{pos:i,deleted:a}=e.mapResult(t.from+r,this.side<0?-1:1);return a?null:new Rv(i-n,i-n,this)}valid(){return!0}eq(t){return this==t||t instanceof e&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&Pv(this.spec,t.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}},Iv=class e{constructor(e,t){this.attrs=e,this.spec=t||Bv}map(e,t,n,r){let i=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,a=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return i>=a?null:new Rv(i,a,this)}valid(e,t){return t.from<t.to}eq(t){return this==t||t instanceof e&&Pv(this.attrs,t.attrs)&&Pv(this.spec,t.spec)}static is(t){return t.type instanceof e}destroy(){}},Lv=class e{constructor(e,t){this.attrs=e,this.spec=t||Bv}map(e,t,n,r){let i=e.mapResult(t.from+r,1);if(i.deleted)return null;let a=e.mapResult(t.to+r,-1);return a.deleted||a.pos<=i.pos?null:new Rv(i.pos-n,a.pos-n,this)}valid(e,t){let{index:n,offset:r}=e.content.findIndex(t.from),i;return r==t.from&&!(i=e.child(n)).isText&&r+i.nodeSize==t.to}eq(t){return this==t||t instanceof e&&Pv(this.attrs,t.attrs)&&Pv(this.spec,t.spec)}destroy(){}},Rv=class e{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(t,n){return new e(t,n,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,n){return this.type.map(e,this,t,n)}static widget(t,n,r){return new e(t,t,new Fv(n,r))}static inline(t,n,r,i){return new e(t,n,new Iv(r,i))}static node(t,n,r,i){return new e(t,n,new Lv(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof Iv}get widget(){return this.type instanceof Fv}},zv=[],Bv={},Vv=class e{constructor(e,t){this.local=e.length?e:zv,this.children=t.length?t:zv}static create(e,t){return t.length?Yv(t,e,0,Bv):Hv}find(e,t,n){let r=[];return this.findInner(e??0,t??1e9,r,0,n),r}findInner(e,t,n,r,i){for(let a=0;a<this.local.length;a++){let o=this.local[a];o.from<=t&&o.to>=e&&(!i||i(o.spec))&&n.push(o.copy(o.from+r,o.to+r))}for(let a=0;a<this.children.length;a+=3)if(this.children[a]<t&&this.children[a+1]>e){let o=this.children[a]+1;this.children[a+2].findInner(e-o,t-o,n,r+o,i)}}map(e,t,n){return this==Hv||e.maps.length==0?this:this.mapInner(e,t,0,0,n||Bv)}mapInner(t,n,r,i,a){let o;for(let e=0;e<this.local.length;e++){let s=this.local[e].map(t,r,i);s&&s.type.valid(n,s)?(o||=[]).push(s):a.onRemove&&a.onRemove(this.local[e].spec)}return this.children.length?Wv(this.children,o||[],t,n,r,i,a):o?new e(o.sort(Xv),zv):Hv}add(t,n){return n.length?this==Hv?e.create(t,n):this.addInner(t,n,0):this}addInner(t,n,r){let i,a=0;t.forEach((e,t)=>{let o=t+r,s;if(s=qv(n,e,o)){for(i||=this.children.slice();a<i.length&&i[a]<t;)a+=3;i[a]==t?i[a+2]=i[a+2].addInner(e,s,o+1):i.splice(a,0,t,t+e.nodeSize,Yv(s,e,o+1,Bv)),a+=3}});let o=Gv(a?Jv(n):n,-r);for(let e=0;e<o.length;e++)o[e].type.valid(t,o[e])||o.splice(e--,1);return new e(o.length?this.local.concat(o).sort(Xv):this.local,i||this.children)}remove(e){return e.length==0||this==Hv?this:this.removeInner(e,0)}removeInner(t,n){let r=this.children,i=this.local;for(let e=0;e<r.length;e+=3){let i,a=r[e]+n,o=r[e+1]+n;for(let e=0,n;e<t.length;e++)(n=t[e])&&n.from>a&&n.to<o&&(t[e]=null,(i||=[]).push(n));if(!i)continue;r==this.children&&(r=this.children.slice());let s=r[e+2].removeInner(i,a+1);s==Hv?(r.splice(e,3),e-=3):r[e+2]=s}if(i.length){for(let e=0,r;e<t.length;e++)if(r=t[e])for(let e=0;e<i.length;e++)i[e].eq(r,n)&&(i==this.local&&(i=this.local.slice()),i.splice(e--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new e(i,r):Hv}forChild(t,n){if(this==Hv)return this;if(n.isLeaf)return e.empty;let r,i;for(let e=0;e<this.children.length;e+=3)if(this.children[e]>=t){this.children[e]==t&&(r=this.children[e+2]);break}let a=t+1,o=a+n.content.size;for(let e=0;e<this.local.length;e++){let t=this.local[e];if(t.from<o&&t.to>a&&t.type instanceof Iv){let e=Math.max(a,t.from)-a,n=Math.min(o,t.to)-a;e<n&&(i||=[]).push(t.copy(e,n))}}if(i){let t=new e(i.sort(Xv),zv);return r?new Uv([t,r]):t}return r||Hv}eq(t){if(this==t)return!0;if(!(t instanceof e)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(let e=0;e<this.local.length;e++)if(!this.local[e].eq(t.local[e]))return!1;for(let e=0;e<this.children.length;e+=3)if(this.children[e]!=t.children[e]||this.children[e+1]!=t.children[e+1]||!this.children[e+2].eq(t.children[e+2]))return!1;return!0}locals(e){return Zv(this.localsInner(e))}localsInner(e){if(this==Hv)return zv;if(e.inlineContent||!this.local.some(Iv.is))return this.local;let t=[];for(let e=0;e<this.local.length;e++)this.local[e].type instanceof Iv||t.push(this.local[e]);return t}forEachSet(e){e(this)}};Vv.empty=new Vv([],[]),Vv.removeOverlap=Zv;var Hv=Vv.empty,Uv=class e{constructor(e){this.members=e}map(t,n){let r=this.members.map(e=>e.map(t,n,Bv));return e.from(r)}forChild(t,n){if(n.isLeaf)return Vv.empty;let r=[];for(let i=0;i<this.members.length;i++){let a=this.members[i].forChild(t,n);a!=Hv&&(a instanceof e?r=r.concat(a.members):r.push(a))}return e.from(r)}eq(t){if(!(t instanceof e)||t.members.length!=this.members.length)return!1;for(let e=0;e<this.members.length;e++)if(!this.members[e].eq(t.members[e]))return!1;return!0}locals(e){let t,n=!0;for(let r=0;r<this.members.length;r++){let i=this.members[r].localsInner(e);if(i.length)if(!t)t=i;else{n&&=(t=t.slice(),!1);for(let e=0;e<i.length;e++)t.push(i[e])}}return t?Zv(n?t:t.sort(Xv)):zv}static from(t){switch(t.length){case 0:return Hv;case 1:return t[0];default:return new e(t.every(e=>e instanceof Vv)?t:t.reduce((e,t)=>e.concat(t instanceof Vv?t:t.members),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}};function Wv(e,t,n,r,i,a,o){let s=e.slice();for(let e=0,t=a;e<n.maps.length;e++){let r=0;n.maps[e].forEach((e,n,i,a)=>{let o=a-i-(n-e);for(let i=0;i<s.length;i+=3){let a=s[i+1];if(a<0||e>a+t-r)continue;let c=s[i]+t-r;n>=c?s[i+1]=e<=c?-2:-1:e>=t&&o&&(s[i]+=o,s[i+1]+=o)}r+=o}),t=n.maps[e].map(t,-1)}let c=!1;for(let t=0;t<s.length;t+=3)if(s[t+1]<0){if(s[t+1]==-2){c=!0,s[t+1]=-1;continue}let l=n.map(e[t]+a),u=l-i;if(u<0||u>=r.content.size){c=!0;continue}let d=n.map(e[t+1]+a,-1)-i,{index:f,offset:p}=r.content.findIndex(u),m=r.maybeChild(f);if(m&&p==u&&p+m.nodeSize==d){let r=s[t+2].mapInner(n,m,l+1,e[t]+a+1,o);r==Hv?(s[t+1]=-2,c=!0):(s[t]=u,s[t+1]=d,s[t+2]=r)}else c=!0}if(c){let c=Yv(Kv(s,e,t,n,i,a,o),r,0,o);t=c.local;for(let e=0;e<s.length;e+=3)s[e+1]<0&&(s.splice(e,3),e-=3);for(let e=0,t=0;e<c.children.length;e+=3){let n=c.children[e];for(;t<s.length&&s[t]<n;)t+=3;s.splice(t,0,c.children[e],c.children[e+1],c.children[e+2])}}return new Vv(t.sort(Xv),s)}function Gv(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let i=e[r];n.push(new Rv(i.from+t,i.to+t,i.type))}return n}function Kv(e,t,n,r,i,a,o){function s(e,t){for(let a=0;a<e.local.length;a++){let s=e.local[a].map(r,i,t);s?n.push(s):o.onRemove&&o.onRemove(e.local[a].spec)}for(let n=0;n<e.children.length;n+=3)s(e.children[n+2],e.children[n]+t+1)}for(let n=0;n<e.length;n+=3)e[n+1]==-1&&s(e[n+2],t[n]+a+1);return n}function qv(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,i=null;for(let t=0,a;t<e.length;t++)(a=e[t])&&a.from>n&&a.to<r&&((i||=[]).push(a),e[t]=null);return i}function Jv(e){let t=[];for(let n=0;n<e.length;n++)e[n]!=null&&t.push(e[n]);return t}function Yv(e,t,n,r){let i=[],a=!1;t.forEach((t,o)=>{let s=qv(e,t,o+n);if(s){a=!0;let e=Yv(s,t,n+o+1,r);e!=Hv&&i.push(o,o+t.nodeSize,e)}});let o=Gv(a?Jv(e):e,-n).sort(Xv);for(let e=0;e<o.length;e++)o[e].type.valid(t,o[e])||(r.onRemove&&r.onRemove(o[e].spec),o.splice(e--,1));return o.length||i.length?new Vv(o,i):Hv}function Xv(e,t){return e.from-t.from||e.to-t.to}function Zv(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let i=n+1;i<t.length;i++){let a=t[i];if(a.from==r.from){a.to!=r.to&&(t==e&&(t=e.slice()),t[i]=a.copy(a.from,r.to),Qv(t,i+1,a.copy(r.to,a.to)));continue}else{a.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,a.from),Qv(t,i,r.copy(a.from,r.to)));break}}}return t}function Qv(e,t,n){for(;t<e.length&&Xv(n,e[t])>0;)t++;e.splice(t,0,n)}function $v(e){let t=[];return e.someProp(`decorations`,n=>{let r=n(e.state);r&&r!=Hv&&t.push(r)}),e.cursorWrapper&&t.push(Vv.create(e.state.doc,[e.cursorWrapper.deco])),Uv.from(t)}var ey={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},ty=Oh&&kh<=11,ny=class{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}},ry=class{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new ny,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(t=>{for(let e=0;e<t.length;e++)this.queue.push(t[e]);Oh&&kh<=11&&t.some(e=>e.type==`childList`&&e.removedNodes.length||e.type==`characterData`&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():Ph&&e.composing&&t.some(e=>e.type==`childList`&&e.target.nodeName==`TR`)?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),ty&&(this.onCharData=e=>{this.queue.push({target:e.target,type:`characterData`,oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,ey)),this.onCharData&&this.view.dom.addEventListener(`DOMCharacterDataModified`,this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;t<e.length;t++)this.queue.push(e[t]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener(`DOMCharacterDataModified`,this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener(`selectionchange`,this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener(`selectionchange`,this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(o_(this.view)){if(this.suppressingSelectionUpdates)return Xg(this.view);if(Oh&&kh<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&uh(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t=new Set,n;for(let n=e.focusNode;n;n=oh(n))t.add(n);for(let r=e.anchorNode;r;r=oh(r))if(t.has(r)){n=r;break}let r=n&&this.view.docView.nearestDesc(n);if(r&&r.ignoreMutation({type:`selection`,target:n.nodeType==3?n.parentNode:n}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.pendingRecords();t.length&&(this.queue=[]);let n=e.domSelectionRange(),r=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&o_(e)&&!this.ignoreSelectionChange(n),i=-1,a=-1,o=!1,s=[];if(e.editable)for(let e=0;e<t.length;e++){let n=this.registerMutation(t[e],s);n&&(i=i<0?n.from:Math.min(n.from,i),a=a<0?n.to:Math.max(n.to,a),n.typeOver&&(o=!0))}if(s.some(e=>e.nodeName==`BR`)&&(e.input.lastKeyCode==8||e.input.lastKeyCode==46||Mh&&(e.composing||e.input.compositionEndedAt>Date.now()-50)&&t.some(e=>e.type==`childList`&&e.removedNodes.length))){for(let e of s)if(e.nodeName==`BR`&&e.parentNode){let t=e.nextSibling;for(;t&&t.nodeType==1;){if(t.contentEditable==`false`){e.parentNode.removeChild(e);break}t=t.firstChild}}}else if(Ah&&s.length){let t=s.filter(e=>e.nodeName==`BR`);if(t.length==2){let[e,n]=t;e.parentNode&&e.parentNode.parentNode==n.parentNode?n.remove():e.remove()}else{let{focusNode:n}=this.currentSelection;for(let r of t){let t=r.parentNode;t&&t.nodeName==`LI`&&(!n||ly(e,n)!=t)&&r.remove()}}}let c=null;i<0&&r&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&vh(n)&&(c=Jg(e))&&c.eq(J.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Xg(e),this.currentSelection.set(n),e.scrollToSelection()):(i>-1||r)&&(i>-1&&(e.docView.markDirty(i,a),oy(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,uy(e,s)),this.handleDOMChange(i,a,o,s),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||Xg(e),this.currentSelection.set(n))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if(e.type==`attributes`&&(n==this.view.docView||e.attributeName==`contenteditable`||e.attributeName==`style`&&!e.oldValue&&!e.target.getAttribute(`style`))||!n||n.ignoreMutation(e))return null;if(e.type==`childList`){for(let n=0;n<e.addedNodes.length;n++){let r=e.addedNodes[n];t.push(r),r.nodeType==3&&(this.lastChangedTextNode=r)}if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};let r=e.previousSibling,i=e.nextSibling;if(Oh&&kh<=11&&e.addedNodes.length)for(let t=0;t<e.addedNodes.length;t++){let{previousSibling:n,nextSibling:a}=e.addedNodes[t];(!n||Array.prototype.indexOf.call(e.addedNodes,n)<0)&&(r=n),(!a||Array.prototype.indexOf.call(e.addedNodes,a)<0)&&(i=a)}let a=r&&r.parentNode==e.target?ah(r)+1:0,o=n.localPosFromDOM(e.target,a,-1),s=i&&i.parentNode==e.target?ah(i):e.target.childNodes.length;return{from:o,to:n.localPosFromDOM(e.target,s,1)}}else if(e.type==`attributes`)return{from:n.posAtStart-n.border,to:n.posAtEnd+n.border};else return this.lastChangedTextNode=e.target,{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}}},iy=new WeakMap,ay=!1;function oy(e){if(!iy.has(e)&&(iy.set(e,null),[`normal`,`nowrap`,`pre-line`].indexOf(getComputedStyle(e.dom).whiteSpace)!==-1)){if(e.requiresGeckoHackNode=Ah,ay)return;console.warn(`ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package.`),ay=!0}}function sy(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,a=t.endOffset,o=e.domAtPos(e.state.selection.anchor);return uh(o.node,o.offset,i,a)&&([n,r,i,a]=[i,a,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:a}}function cy(e,t){if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return sy(e,n)}let n;function r(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}return e.dom.addEventListener(`beforeinput`,r,!0),document.execCommand(`indent`),e.dom.removeEventListener(`beforeinput`,r,!0),n?sy(e,n):null}function ly(e,t){for(let n=t.parentNode;n&&n!=e.dom;n=n.parentNode){let t=e.docView.nearestDesc(n,!0);if(t&&t.node.isBlock)return n}return null}function uy(e,t){let{focusNode:n,focusOffset:r}=e.domSelectionRange();for(let i of t)if(i.parentNode?.nodeName==`TR`){let t=i.nextSibling;for(;t&&t.nodeName!=`TD`&&t.nodeName!=`TH`;)t=t.nextSibling;if(t){let a=t;for(;;){let e=a.firstChild;if(!e||e.nodeType!=1||e.contentEditable==`false`||/^(BR|IMG)$/.test(e.nodeName))break;a=e}a.insertBefore(i,a.firstChild),n==i&&e.domSelection().collapse(i,r)}else i.parentNode.removeChild(i)}}function dy(e,t,n){let{node:r,fromOffset:i,toOffset:a,from:o,to:s}=e.docView.parseRange(t,n),c=e.domSelectionRange(),l,u=c.anchorNode;if(u&&e.dom.contains(u.nodeType==1?u:u.parentNode)&&(l=[{node:u,offset:c.anchorOffset}],vh(c)||l.push({node:c.focusNode,offset:c.focusOffset})),Mh&&e.input.lastKeyCode===8)for(let e=a;e>i;e--){let t=r.childNodes[e-1],n=t.pmViewDesc;if(t.nodeName==`BR`&&!n){a=e;break}if(!n||n.size)break}let d=e.state.doc,f=e.someProp(`domParser`)||df.fromSchema(e.state.schema),p=d.resolve(o),m=null,h=f.parse(r,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:i,to:a,preserveWhitespace:p.parent.type.whitespace==`pre`?`full`:!0,findPositions:l,ruleFromNode:fy,context:p});if(l&&l[0].pos!=null){let e=l[0].pos,t=l[1]&&l[1].pos;t??=e,m={anchor:e+o,head:t+o}}return{doc:h,sel:m,from:o,to:s}}function fy(e){let t=e.pmViewDesc;if(t)return t.parseRule();if(e.nodeName==`BR`&&e.parentNode){if(Ph&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let e=document.createElement(`div`);return e.appendChild(document.createElement(`li`)),{skip:e}}else if(e.parentNode.lastChild==e||Ph&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if(e.nodeName==`IMG`&&e.getAttribute(`mark-placeholder`))return{ignore:!0};return null}var py=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function my(e,t,n,r,i){let a=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let t=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,n=Jg(e,t);if(n&&!e.state.selection.eq(n)){if(Mh&&Rh&&e.input.lastKeyCode===13&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp(`handleKeyDown`,t=>t(e,yh(13,`Enter`))))return;let r=e.state.tr.setSelection(n);t==`pointer`?r.setMeta(`pointer`,!0):t==`key`&&r.scrollIntoView(),a&&r.setMeta(`composition`,a),e.dispatch(r)}return}let o=e.state.doc.resolve(t),s=o.sharedDepth(n);t=o.before(s+1),n=e.state.doc.resolve(n).after(s+1);let c=e.state.selection,l=dy(e,t,n),u=e.state.doc,d=u.slice(l.from,l.to),f,p;e.input.lastKeyCode===8&&Date.now()-100<e.input.lastKeyCodeTime?(f=e.state.selection.to,p=`end`):(f=e.state.selection.from,p=`start`),e.input.lastKeyCode=null;let m=yy(d.content,l.doc.content,l.from,f,p);if(m&&e.input.domChangeCount++,(Fh&&e.input.lastIOSEnter>Date.now()-225||Rh)&&i.some(e=>e.nodeType==1&&!py.test(e.nodeName))&&(!m||m.endA>=m.endB)&&e.someProp(`handleKeyDown`,t=>t(e,yh(13,`Enter`)))){e.input.lastIOSEnter=0;return}if(!m)if(r&&c instanceof Y&&!c.empty&&c.$head.sameParent(c.$anchor)&&!e.composing&&!(l.sel&&l.sel.anchor!=l.sel.head))m={start:c.from,endA:c.to,endB:c.to};else{if(l.sel){let t=hy(e,e.state.doc,l.sel);if(t&&!t.eq(e.state.selection)){let n=e.state.tr.setSelection(t);a&&n.setMeta(`composition`,a),e.dispatch(n)}}return}e.state.selection.from<e.state.selection.to&&m.start==m.endB&&e.state.selection instanceof Y&&(m.start>e.state.selection.from&&m.start<=e.state.selection.from+2&&e.state.selection.from>=l.from?m.start=e.state.selection.from:m.endA<e.state.selection.to&&m.endA>=e.state.selection.to-2&&e.state.selection.to<=l.to&&(m.endB+=e.state.selection.to-m.endA,m.endA=e.state.selection.to)),Oh&&kh<=11&&m.endB==m.start+1&&m.endA==m.start&&m.start>l.from&&l.doc.textBetween(m.start-l.from-1,m.start-l.from+1)==` \xA0`&&(m.start--,m.endA--,m.endB--);let h=l.doc.resolveNoCache(m.start-l.from),g=l.doc.resolveNoCache(m.endB-l.from),_=u.resolve(m.start),v=h.sameParent(g)&&h.parent.inlineContent&&_.end()>=m.endA;if((Fh&&e.input.lastIOSEnter>Date.now()-225&&(!v||i.some(e=>e.nodeName==`DIV`||e.nodeName==`P`))||!v&&h.pos<l.doc.content.size&&(!h.sameParent(g)||!h.parent.inlineContent)&&h.pos<g.pos&&!/\S/.test(l.doc.textBetween(h.pos,g.pos,``,``)))&&e.someProp(`handleKeyDown`,t=>t(e,yh(13,`Enter`)))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>m.start&&_y(u,m.start,m.endA,h,g)&&e.someProp(`handleKeyDown`,t=>t(e,yh(8,`Backspace`)))){Rh&&Mh&&e.domObserver.suppressSelectionUpdates();return}Mh&&m.endB==m.start&&(e.input.lastChromeDelete=Date.now()),Rh&&!v&&h.start()!=g.start()&&g.parentOffset==0&&h.depth==g.depth&&l.sel&&l.sel.anchor==l.sel.head&&l.sel.head==m.endA&&(m.endB-=2,g=l.doc.resolveNoCache(m.endB-l.from),setTimeout(()=>{e.someProp(`handleKeyDown`,function(t){return t(e,yh(13,`Enter`))})},20));let y=m.start,b=m.endA,x=t=>{let n=t||e.state.tr.replace(y,b,l.doc.slice(m.start-l.from,m.endB-l.from));if(l.sel){let t=hy(e,n.doc,l.sel);t&&!(Mh&&e.composing&&t.empty&&(m.start!=m.endB||e.input.lastChromeDelete<Date.now()-100)&&(t.head==y||t.head==n.mapping.map(b)-1)||Oh&&t.empty&&t.head==y)&&n.setSelection(t)}return a&&n.setMeta(`composition`,a),n.scrollIntoView()},S;if(v)if(h.pos==g.pos){Oh&&kh<=11&&h.parentOffset==0&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>Xg(e),20));let t=x(e.state.tr.delete(y,b)),n=u.resolve(m.start).marksAcross(u.resolve(m.endA));n&&t.ensureMarks(n),e.dispatch(t)}else if(m.endA==m.endB&&(S=gy(h.parent.content.cut(h.parentOffset,g.parentOffset),_.parent.content.cut(_.parentOffset,m.endA-_.start())))){let t=x(e.state.tr);S.type==`add`?t.addMark(y,b,S.mark):t.removeMark(y,b,S.mark),e.dispatch(t)}else if(h.parent.child(h.index()).isText&&h.index()==g.index()-+!g.textOffset){let t=h.parent.textBetween(h.parentOffset,g.parentOffset),n=()=>x(e.state.tr.insertText(t,y,b));e.someProp(`handleTextInput`,r=>r(e,y,b,t,n))||e.dispatch(n())}else e.dispatch(x());else e.dispatch(x())}function hy(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:a_(e,t.resolve(n.anchor),t.resolve(n.head))}function gy(e,t){let n=e.firstChild.marks,r=t.firstChild.marks,i=n,a=r,o,s,c;for(let e=0;e<r.length;e++)i=r[e].removeFromSet(i);for(let e=0;e<n.length;e++)a=n[e].removeFromSet(a);if(i.length==1&&a.length==0)s=i[0],o=`add`,c=e=>e.mark(s.addToSet(e.marks));else if(i.length==0&&a.length==1)s=a[0],o=`remove`,c=e=>e.mark(s.removeFromSet(e.marks));else return null;let l=[];for(let e=0;e<t.childCount;e++)l.push(c(t.child(e)));if(G.from(l).eq(e))return{mark:s,type:o}}function _y(e,t,n,r,i){if(n-t<=i.pos-r.pos||vy(r,!0,!1)<i.pos)return!1;let a=e.resolve(t);if(!r.parent.isTextblock){let e=a.nodeAfter;return e!=null&&n==t+e.nodeSize}if(a.parentOffset<a.parent.content.size||!a.parent.isTextblock)return!1;let o=e.resolve(vy(a,!0,!0));return!o.parent.isTextblock||o.pos>n||vy(o,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(o.parent.content)}
vendor: 4,545 bytes, line 234
234function vy(e,t,n){let r=e.depth,i=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,i++,t=!1;if(n){let t=e.node(r).maybeChild(e.indexAfter(r));for(;t&&!t.isLeaf;)t=t.firstChild,i++}return i}function yy(e,t,n,r,i){let a=e.findDiffStart(t,n),o=n+e.size,s=n+t.size;if(a==null)return null;let{a:c,b:l}=e.findDiffEnd(t,o,s);if(i==`end`){let e=Math.max(0,a-Math.min(c,l));r-=c+e-a}if(c<a&&o<s){let e=r<=a&&r>=c?a-r:0;a-=e,l=a+(l-c),c=a}else if(l<a){let e=r<=a&&r>=l?a-r:0;a-=e,c=a+(c-l),l=a}return{start:a,endA:c,endB:l}}var by=class{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new q_,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(Dy),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement(`div`),e&&(e.appendChild?e.appendChild(this.dom):typeof e==`function`?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=Cy(this),Sy(this),this.nodeViews=Ty(this),this.docView=Og(this.state.doc,xy(this),$v(this),this.dom,this),this.domObserver=new ry(this,(e,t,n,r)=>my(this,e,t,n,r)),this.domObserver.start(),J_(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Z_(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(Dy),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let e in this._props)t[e]=this._props[e];t.state=this.state;for(let n in e)t[n]=e[n];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){let n=this.state,r=!1,i=!1;e.storedMarks&&this.composing&&(xv(this),i=!0),this.state=e;let a=n.plugins!=e.plugins||this._props.plugins!=t.plugins;if(a||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let e=Ty(this);Ey(e,this.nodeViews)&&(this.nodeViews=e,r=!0)}(a||t.handleDOMEvents!=this._props.handleDOMEvents)&&Z_(this),this.editable=Cy(this),Sy(this);let o=$v(this),s=xy(this),c=n.plugins!=e.plugins&&!n.doc.eq(e.doc)?`reset`:e.scrollToSelection>n.scrollToSelection?`to selection`:`preserve`,l=r||!this.docView.matchesNode(e.doc,s,o);(l||!e.selection.eq(n.selection))&&(i=!0);let u=c==`preserve`&&i&&this.dom.style.overflowAnchor==null&&Gh(this);if(i){this.domObserver.stop();let t=l&&(Oh||Mh)&&!this.composing&&!n.selection.empty&&!e.selection.empty&&wy(n.selection,e.selection);if(l){let n=Mh?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=Sv(this)),(r||!this.docView.update(e.doc,s,o,this))&&(this.docView.updateOuterDeco(s),this.docView.destroy(),this.docView=Og(e.doc,s,o,this.dom,this)),n&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(t=!0)}let i=this.input.mouseDown;t||!(i&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&c_(this)&&i.delaySelUpdate())?Xg(this,t):(r_(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(n),this.dragging?.node&&!n.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,n),c==`reset`?this.dom.scrollTop=0:c==`to selection`?this.scrollToSelection():u&&qh(u)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))&&!this.someProp(`handleScrollToSelection`,e=>e(this)))if(this.state.selection instanceof X){let t=this.docView.domAfterPos(this.state.selection.from);t.nodeType==1&&Wh(this,t.getBoundingClientRect(),e)}else Wh(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let e=0;e<this.directPlugins.length;e++){let t=this.directPlugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}for(let e=0;e<this.state.plugins.length;e++){let t=this.state.plugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}}else for(let t=0;t<this.pluginViews.length;t++){let n=this.pluginViews[t];n.update&&n.update(this,e)}}updateDraggedNode(e,t){let n=e.node,r=-1;
vendor: 40,037 bytes, lines 234-236
234if(n.from<this.state.doc.content.size&&this.state.doc.nodeAt(n.from)==n.node)r=n.from;else{let e=n.from+(this.state.doc.content.size-t.doc.content.size);(e>0&&e<this.state.doc.content.size&&this.state.doc.nodeAt(e))==n.node&&(r=e)}this.dragging=new Av(e.slice,e.move,r<0?void 0:X.create(this.state.doc,r))}someProp(e,t){let n=this._props&&this._props[e],r;if(n!=null&&(r=t?t(n):n))return r;for(let n=0;n<this.directPlugins.length;n++){let i=this.directPlugins[n].props[e];if(i!=null&&(r=t?t(i):i))return r}let i=this.state.plugins;if(i)for(let n=0;n<i.length;n++){let a=i[n].props[e];if(a!=null&&(r=t?t(a):a))return r}}hasFocus(){if(Oh){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable==`false`)return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&Xh(this.dom),Xg(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let e=this.dom.parentNode;e;e=e.parentNode)if(e.nodeType==9||e.nodeType==11&&e.host)return e.getSelection||(Object.getPrototypeOf(e).getSelection=()=>e.ownerDocument.getSelection()),this._root=e}return e||document}updateRoot(){this._root=null}posAtCoords(e){return ig(this,e)}coordsAtPos(e,t=1){return cg(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,n=-1){let r=this.docView.posFromDOM(e,t,n);if(r==null)throw RangeError(`DOM position not inside the editor`);return r}endOfTextblock(e,t){return vg(this,t||this.state,e)}pasteHTML(e,t){return Ov(this,``,e,!1,t||new ClipboardEvent(`paste`))}pasteText(e,t){return Ov(this,e,null,!0,t||new ClipboardEvent(`paste`))}serializeForClipboard(e){return O_(this,e)}destroy(){this.docView&&(X_(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],$v(this),this),this.dom.textContent=``):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,lh())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return ev(this,e)}domSelectionRange(){let e=this.domSelection();return e?Ph&&this.root.nodeType===11&&bh(this.dom.ownerDocument)==this.dom&&cy(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}};by.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))};function xy(e){let t=Object.create(null);return t.class=`ProseMirror`,t.contenteditable=String(e.editable),e.someProp(`attributes`,n=>{if(typeof n==`function`&&(n=n(e.state)),n)for(let e in n)e==`class`?t.class+=` `+n[e]:e==`style`?t.style=(t.style?t.style+`;`:``)+n[e]:!t[e]&&e!=`contenteditable`&&e!=`nodeName`&&(t[e]=String(n[e]))}),t.translate||=`no`,[Rv.node(0,e.state.doc.content.size,t)]}function Sy(e){if(e.markCursor){let t=document.createElement(`img`);t.className=`ProseMirror-separator`,t.setAttribute(`mark-placeholder`,`true`),t.setAttribute(`alt`,``),e.cursorWrapper={dom:t,deco:Rv.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function Cy(e){return!e.someProp(`editable`,t=>t(e.state)===!1)}function wy(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}function Ty(e){let t=Object.create(null);function n(e){for(let n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n])}return e.someProp(`nodeViews`,n),e.someProp(`markViews`,n),t}function Ey(e,t){let n=0,r=0;for(let r in e){if(e[r]!=t[r])return!0;n++}for(let e in t)r++;return n!=r}function Dy(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw RangeError(`Plugins passed directly to the view must not have a state component`)}for(var Oy={8:`Backspace`,9:`Tab`,10:`Enter`,12:`NumLock`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,44:`PrintScreen`,45:`Insert`,46:`Delete`,59:`;`,61:`=`,91:`Meta`,92:`Meta`,106:`*`,107:`+`,108:`,`,109:`-`,110:`.`,111:`/`,144:`NumLock`,145:`ScrollLock`,160:`Shift`,161:`Shift`,162:`Control`,163:`Control`,164:`Alt`,165:`Alt`,173:`-`,186:`;`,187:`=`,188:`,`,189:`-`,190:`.`,191:`/`,192:"`",219:`[`,220:`\\`,221:`]`,222:`'`},ky={48:`)`,49:`!`,50:`@`,51:`#`,52:`$`,53:`%`,54:`^`,55:`&`,56:`*`,57:`(`,59:`:`,61:`+`,173:`_`,186:`:`,187:`+`,188:`<`,189:`_`,190:`>`,191:`?`,192:`~`,219:`{`,220:`|`,221:`}`,222:`"`},Ay=typeof navigator<`u`&&/Mac/.test(navigator.platform),jy=typeof navigator<`u`&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),My=0;My<10;My++)Oy[48+My]=Oy[96+My]=String(My);for(var My=1;My<=24;My++)Oy[My+111]=`F`+My;for(var My=65;My<=90;My++)Oy[My]=String.fromCharCode(My+32),ky[My]=String.fromCharCode(My);for(var Ny in Oy)ky.hasOwnProperty(Ny)||(ky[Ny]=Oy[Ny]);function Py(e){var t=!(Ay&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||jy&&e.shiftKey&&e.key&&e.key.length==1||e.key==`Unidentified`)&&e.key||(e.shiftKey?ky:Oy)[e.keyCode]||e.key||`Unidentified`;return t==`Esc`&&(t=`Escape`),t==`Del`&&(t=`Delete`),t==`Left`&&(t=`ArrowLeft`),t==`Up`&&(t=`ArrowUp`),t==`Right`&&(t=`ArrowRight`),t==`Down`&&(t=`ArrowDown`),t}var Fy=typeof navigator<`u`&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),Iy=typeof navigator<`u`&&/Win/.test(navigator.platform);function Ly(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n==`Space`&&(n=` `);let r,i,a,o;for(let e=0;e<t.length-1;e++){let n=t[e];if(/^(cmd|meta|m)$/i.test(n))o=!0;else if(/^a(lt)?$/i.test(n))r=!0;else if(/^(c|ctrl|control)$/i.test(n))i=!0;else if(/^s(hift)?$/i.test(n))a=!0;else if(/^mod$/i.test(n))Fy?o=!0:i=!0;else throw Error(`Unrecognized modifier name: `+n)}return r&&(n=`Alt-`+n),i&&(n=`Ctrl-`+n),o&&(n=`Meta-`+n),a&&(n=`Shift-`+n),n}function Ry(e){let t=Object.create(null);for(let n in e)t[Ly(n)]=e[n];return t}function zy(e,t,n=!0){return t.altKey&&(e=`Alt-`+e),t.ctrlKey&&(e=`Ctrl-`+e),t.metaKey&&(e=`Meta-`+e),n&&t.shiftKey&&(e=`Shift-`+e),e}function By(e){return new dm({props:{handleKeyDown:Vy(e)}})}function Vy(e){let t=Ry(e);return function(e,n){let r=Py(n),i,a=t[zy(r,n)];if(a&&a(e.state,e.dispatch,e))return!0;if(r.length==1&&r!=` `){if(n.shiftKey){let i=t[zy(r,n,!1)];if(i&&i(e.state,e.dispatch,e))return!0}if((n.altKey||n.metaKey||n.ctrlKey)&&!(Iy&&n.ctrlKey&&n.altKey)&&(i=Oy[n.keyCode])&&i!=r){let r=t[zy(i,n)];if(r&&r(e.state,e.dispatch,e))return!0}}return!1}}var Hy=c(m(),1),Uy=sd(),Wy=Object.defineProperty,Gy=(e,t)=>{for(var n in t)Wy(e,n,{get:t[n],enumerable:!0})};function Ky(e){let{state:t,transaction:n}=e,{selection:r}=n,{doc:i}=n,{storedMarks:a}=n;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return a},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,a=n.storedMarks,n}}}var qy=class{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){let{rawCommands:e,editor:t,state:n}=this,{view:r}=t,{tr:i}=n,a=this.buildProps(i);return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,(...e)=>{let n=t(...e)(a);return!i.getMeta(`preventDispatch`)&&!this.hasCustomState&&r.dispatch(i),n}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){let{rawCommands:n,editor:r,state:i}=this,{view:a}=r,o=[],s=!!e,c=e||i.tr,l=()=>(!s&&t&&!c.getMeta(`preventDispatch`)&&!this.hasCustomState&&a.dispatch(c),o.every(e=>e===!0)),u={...Object.fromEntries(Object.entries(n).map(([e,n])=>[e,(...e)=>{let r=this.buildProps(c,t),i=n(...e)(r);return o.push(i),u}])),run:l};return u}createCan(e){let{rawCommands:t,state:n}=this,r=e||n.tr,i=this.buildProps(r,!1);return{...Object.fromEntries(Object.entries(t).map(([e,t])=>[e,(...e)=>t(...e)({...i,dispatch:void 0})])),chain:()=>this.createChain(r,!1)}}buildProps(e,t=!0){let{rawCommands:n,editor:r,state:i}=this,{view:a}=r,o={tr:e,editor:r,view:a,state:Ky({state:i,transaction:e}),dispatch:t?()=>void 0:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(n).map(([e,t])=>[e,(...e)=>t(...e)(o)]))}};return o}},Jy={};Gy(Jy,{blur:()=>Yy,clearContent:()=>Xy,clearNodes:()=>Zy,command:()=>Qy,createParagraphNear:()=>$y,cut:()=>eb,deleteCurrentNode:()=>tb,deleteNode:()=>rb,deleteRange:()=>ib,deleteSelection:()=>cb,enter:()=>lb,exitCode:()=>ub,extendMarkRange:()=>_b,first:()=>vb,focus:()=>Tb,forEach:()=>Eb,insertContent:()=>Db,insertContentAt:()=>Nb,joinBackward:()=>Ib,joinDown:()=>Fb,joinForward:()=>Lb,joinItemBackward:()=>Rb,joinItemForward:()=>zb,joinTextblockBackward:()=>Bb,joinTextblockForward:()=>Vb,joinUp:()=>Pb,keyboardShortcut:()=>Wb,lift:()=>Kb,liftEmptyBlock:()=>qb,liftListItem:()=>Jb,newlineInCode:()=>Yb,resetAttributes:()=>Qb,scrollIntoView:()=>$b,selectAll:()=>ex,selectNodeBackward:()=>tx,selectNodeForward:()=>nx,selectParentNode:()=>rx,selectTextblockEnd:()=>ix,selectTextblockStart:()=>ax,setContent:()=>sx,setMark:()=>iS,setMeta:()=>aS,setNode:()=>oS,setNodeSelection:()=>sS,setTextDirection:()=>cS,setTextSelection:()=>lS,sinkListItem:()=>uS,splitBlock:()=>fS,splitListItem:()=>pS,toggleList:()=>yS,toggleMark:()=>bS,toggleNode:()=>xS,toggleWrap:()=>SS,undoInputRule:()=>CS,unsetAllMarks:()=>wS,unsetMark:()=>TS,unsetTextDirection:()=>ES,updateAttributes:()=>DS,wrapIn:()=>OS,wrapInList:()=>kS});var Yy=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{var n;e.isDestroyed||(t.dom.blur(),(n=window==null?void 0:window.getSelection())==null||n.removeAllRanges())}),!0),Xy=(e=!0)=>({commands:t})=>t.setContent(``,{emitUpdate:e}),Zy=()=>({state:e,tr:t,dispatch:n})=>{let{selection:r}=t,{ranges:i}=r;return n&&i.forEach(({$from:n,$to:r})=>{e.doc.nodesBetween(n.pos,r.pos,(e,n)=>{if(e.type.isText)return;let{doc:r,mapping:i}=t,a=r.resolve(i.map(n)),o=r.resolve(i.map(n+e.nodeSize)),s=a.blockRange(o);if(!s)return;let c=ap(s);if(e.type.isTextblock){let{defaultType:e}=a.parent.contentMatchAt(a.index());t.setNodeMarkup(s.start,e)}(c||c===0)&&t.lift(s,c)})}),!0},Qy=e=>t=>e(t),$y=()=>({state:e,dispatch:t})=>Pm(e,t),eb=(e,t)=>({editor:n,tr:r})=>{let{state:i}=n,a=i.doc.slice(e.from,e.to);r.deleteRange(e.from,e.to);let o=r.mapping.map(t);return r.insert(o,a.content),r.setSelection(new Y(r.doc.resolve(Math.max(o-1,0)))),!0},tb=()=>({tr:e,dispatch:t})=>{let{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;let i=e.selection.$anchor;for(let n=i.depth;n>0;--n)if(i.node(n).type===r.type){if(t){let t=i.before(n),r=i.after(n);e.delete(t,r).scrollIntoView()}return!0}return!1};function nb(e,t){if(typeof e==`string`){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}var rb=e=>({tr:t,state:n,dispatch:r})=>{let i=nb(e,n.schema),a=t.selection.$anchor;for(let e=a.depth;e>0;--e)if(a.node(e).type===i){if(r){let n=a.before(e),r=a.after(e);t.delete(n,r).scrollIntoView()}return!0}return!1},ib=e=>({tr:t,dispatch:n})=>{let{from:r,to:i}=e;return n&&t.delete(r,i),!0},ab=e=>e.content?/^text(\*|\+)/.test(e.content):!1,ob=(e,t,n)=>{if(!e.parent.isInline||n===`left`&&e.pos>e.start()||n===`right`&&e.pos<e.end())return e.pos;let r=t.nodes[e.parent.type.name].spec;return ab(r)?n===`left`?e.start()-1:e.end()+1:e.pos},sb=(e,t,n)=>({from:ob(e,n,`left`),to:ob(t,n,`right`)}),cb=()=>({state:e,dispatch:t})=>{let{$from:n,$to:r}=e.selection;if(e.selection.empty)return!1;let{from:i,to:a}=sb(n,r,e.schema);return t&&(e.tr.deleteRange(i,a).scrollIntoView(),t(e.tr)),!0},lb=()=>({commands:e})=>e.keyboardShortcut(`Enter`),ub=()=>({state:e,dispatch:t})=>Nm(e,t);function db(e){return Object.prototype.toString.call(e)===`[object RegExp]`}function fb(e,t,n={strict:!0}){let r=Object.keys(t);return r.length?r.every(r=>n.strict?t[r]===e[r]:db(t[r])?t[r].test(e[r]):t[r]===e[r]):!0}function pb(e,t,n={}){return e.find(e=>e.type===t&&fb(Object.fromEntries(Object.keys(n).map(t=>[t,e.attrs[t]])),n))}function mb(e,t,n={}){return!!pb(e,t,n)}function hb(e,t,n){if(!e||!t)return;let r=e.parent.childAfter(e.parentOffset);if((!r.node||!r.node.marks.some(e=>e.type===t))&&(r=e.parent.childBefore(e.parentOffset)),!r.node||!r.node.marks.some(e=>e.type===t))return;if(!n){let e=r.node.marks.find(e=>e.type===t);e&&(n=e.attrs)}if(!pb([...r.node.marks],t,n))return;let i=r.index,a=e.start()+r.offset,o=i+1,s=a+r.node.nodeSize;for(;i>0&&mb([...e.parent.child(i-1).marks],t,n);)--i,a-=e.parent.child(i).nodeSize;for(;o<e.parent.childCount&&mb([...e.parent.child(o).marks],t,n);)s+=e.parent.child(o).nodeSize,o+=1;return{from:a,to:s}}function gb(e,t){if(typeof e==`string`){if(!t.marks[e])throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);return t.marks[e]}return e}var _b=(e,t)=>({tr:n,state:r,dispatch:i})=>{let a=gb(e,r.schema),{doc:o,selection:s}=n,{$from:c,from:l,to:u}=s;if(i){let e=hb(c,a,t);if(e&&e.from<=l&&e.to>=u){let t=Y.create(o,e.from,e.to);n.setSelection(t)}}return!0},vb=e=>t=>{let n=typeof e==`function`?e(t):e;for(let e=0;e<n.length;e+=1)if(n[e](t))return!0;return!1};function yb(e){return e instanceof Y}function bb(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function xb(e,t=null){if(!t)return null;let n=J.atStart(e),r=J.atEnd(e);if(t===`start`||t===!0)return n;if(t===`end`)return r;let i=n.from,a=r.to;return t===`all`?Y.create(e,bb(0,i,a),bb(e.content.size,i,a)):Y.create(e,bb(t,i,a),bb(t,i,a))}function Sb(){return navigator.platform===`Android`||/android/i.test(navigator.userAgent)}function Cb(){return[`iPad Simulator`,`iPhone Simulator`,`iPod Simulator`,`iPad`,`iPhone`,`iPod`].includes(navigator.platform)||navigator.userAgent.includes(`Mac`)&&`ontouchend`in document}function wb(){return typeof navigator<`u`?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}var Tb=(e=null,t={})=>({editor:n,view:r,tr:i,dispatch:a})=>{t={scrollIntoView:!0,...t};let o=()=>{(Cb()||Sb())&&r.dom.focus(),wb()&&!Cb()&&!Sb()&&r.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),t?.scrollIntoView&&n.commands.scrollIntoView())})};try{if(r.hasFocus()&&e===null||e===!1)return!0}catch{return!1}if(a&&e===null&&!yb(n.state.selection))return o(),!0;let s=xb(i.doc,e)||n.state.selection,c=n.state.selection.eq(s);return a&&(c||i.setSelection(s),c&&i.storedMarks&&i.setStoredMarks(i.storedMarks),o()),!0},Eb=(e,t)=>n=>e.every((e,r)=>t(e,{...n,index:r})),Db=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),Ob=e=>{let t=e.childNodes;for(let n=t.length-1;n>=0;--n){let r=t[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?e.removeChild(r):r.nodeType===1&&Ob(r)}return e};function kb(e){if(typeof window>`u`)throw Error(`[tiptap error]: there is no window object available, so this function cannot be used`);let t=`<body>${e}</body>`,n=new window.DOMParser().parseFromString(t,`text/html`).body;return Ob(n)}function Ab(e,t,n){if(e instanceof Fd||e instanceof G)return e;n={slice:!0,parseOptions:{},...n};let r=typeof e==`object`&&!!e,i=typeof e==`string`;if(r)try{if(Array.isArray(e)&&e.length>0)return G.fromArray(e.map(e=>t.nodeFromJSON(e)));let r=t.nodeFromJSON(e);return n.errorOnInvalidContent&&r.check(),r}catch(r){if(n.errorOnInvalidContent)throw Error(`[tiptap error]: Invalid JSON content`,{cause:r});return console.warn(`[tiptap warn]: Invalid content.`,`Passed value:`,e,`Error:`,r),Ab(``,t,n)}if(i){if(n.errorOnInvalidContent){let r=!1,i=``,a=new sf({topNode:t.spec.topNode,marks:t.spec.marks,nodes:t.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:`inline*`,group:`block`,parseDOM:[{tag:`*`,getAttrs:e=>(r=!0,i=typeof e==`string`?e:e.outerHTML,null)}]}})});if(n.slice?df.fromSchema(a).parseSlice(kb(e),n.parseOptions):df.fromSchema(a).parse(kb(e),n.parseOptions),n.errorOnInvalidContent&&r)throw Error(`[tiptap error]: Invalid HTML content`,{cause:Error(`Invalid element found: ${i}`)})}let r=df.fromSchema(t);return n.slice?r.parseSlice(kb(e),n.parseOptions).content:r.parse(kb(e),n.parseOptions)}return Ab(``,t,n)}function jb(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof Qf||i instanceof $f))return;let a=e.mapping.maps[r],o=0;a.forEach((e,t,n,r)=>{o===0&&(o=r)}),e.setSelection(J.near(e.doc.resolve(o),n))}var Mb=e=>!(`type`in e),Nb=(e,t,n)=>({tr:r,dispatch:i,editor:a})=>{if(i){n={parseOptions:a.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let i,o=e=>{a.emit(`contentError`,{editor:a,error:e,disableCollaboration:()=>{`collaboration`in a.storage&&typeof a.storage.collaboration==`object`&&a.storage.collaboration&&(a.storage.collaboration.isDisabled=!0)}})},s={preserveWhitespace:`full`,...n.parseOptions};if(!n.errorOnInvalidContent&&!a.options.enableContentCheck&&a.options.emitContentError)try{Ab(t,a.schema,{parseOptions:s,errorOnInvalidContent:!0})}catch(e){o(e)}try{i=Ab(t,a.schema,{parseOptions:s,errorOnInvalidContent:n.errorOnInvalidContent??a.options.enableContentCheck})}catch(e){return o(e),!1}let{from:c,to:l}=typeof e==`number`?{from:e,to:e}:{from:e.from,to:e.to},u=!0,d=!0;if((Mb(i)?i:[i]).forEach(e=>{e.check(),u=u?e.isText&&e.marks.length===0:!1,d=d?e.isBlock:!1}),c===l&&d){let{parent:e}=r.doc.resolve(c);e.isTextblock&&!e.type.spec.code&&!e.childCount&&(--c,l+=1)}let f;if(u){if(Array.isArray(t))f=t.map(e=>e.text||``).join(``);else if(t instanceof G){let e=``;t.forEach(t=>{t.text&&(e+=t.text)}),f=e}else f=typeof t==`object`&&t&&t.text?t.text:t;r.insertText(f,c,l)}else{f=i;let e=r.doc.resolve(c),t=e.node(),n=e.parentOffset===0,a=t.isText||t.isTextblock,o=t.content.size>0;n&&a&&o&&d&&(c=Math.max(0,c-1)),r.replaceWith(c,l,f)}n.updateSelection&&jb(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta(`applyInputRules`,{from:c,text:f}),n.applyPasteRules&&r.setMeta(`applyPasteRules`,{from:c,text:f})}return!0},Pb=()=>({state:e,dispatch:t})=>Om(e,t),Fb=()=>({state:e,dispatch:t})=>km(e,t),Ib=()=>({state:e,dispatch:t})=>_m(e,t),Lb=()=>({state:e,dispatch:t})=>Tm(e,t),Rb=()=>({state:e,dispatch:t,tr:n})=>{try{let r=Sp(e.doc,e.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},zb=()=>({state:e,dispatch:t,tr:n})=>{try{let r=Sp(e.doc,e.selection.$from.pos,1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},Bb=()=>({state:e,dispatch:t})=>vm(e,t),Vb=()=>({state:e,dispatch:t})=>ym(e,t);function Hb(){return typeof navigator<`u`?/Mac/.test(navigator.platform):!1}function Ub(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n===`Space`&&(n=` `);let r,i,a,o;for(let e=0;e<t.length-1;e+=1){let n=t[e];if(/^(cmd|meta|m)$/i.test(n))o=!0;else if(/^a(lt)?$/i.test(n))r=!0;else if(/^(c|ctrl|control)$/i.test(n))i=!0;else if(/^s(hift)?$/i.test(n))a=!0;else if(/^mod$/i.test(n))Cb()||Hb()?o=!0:i=!0;else throw Error(`Unrecognized modifier name: ${n}`)}return r&&(n=`Alt-${n}`),i&&(n=`Ctrl-${n}`),o&&(n=`Meta-${n}`),a&&(n=`Shift-${n}`),n}var Wb=e=>({editor:t,view:n,tr:r,dispatch:i})=>{let a=Ub(e).split(/-(?!$)/),o=a.find(e=>![`Alt`,`Ctrl`,`Meta`,`Shift`].includes(e)),s=new KeyboardEvent(`keydown`,{key:o===`Space`?` `:o,altKey:a.includes(`Alt`),ctrlKey:a.includes(`Ctrl`),metaKey:a.includes(`Meta`),shiftKey:a.includes(`Shift`),bubbles:!0,cancelable:!0});return t.captureTransaction(()=>{n.someProp(`handleKeyDown`,e=>e(n,s))})?.steps.forEach(e=>{let t=e.map(r.mapping);t&&i&&r.maybeStep(t)}),!0};function Gb(e,t,n={}){let{from:r,to:i,empty:a}=e.selection,o=t?nb(t,e.schema):null,s=[];e.doc.nodesBetween(r,i,(e,t)=>{if(e.isText)return;let n=Math.max(r,t),a=Math.min(i,t+e.nodeSize);s.push({node:e,from:n,to:a})});let c=i-r,l=s.filter(e=>o?o.name===e.node.type.name:!0).filter(e=>fb(e.node.attrs,n,{strict:!1}));return a?!!l.length:l.reduce((e,t)=>e+t.to-t.from,0)>=c}var Kb=(e,t={})=>({state:n,dispatch:r})=>Gb(n,nb(e,n.schema),t)?Am(n,r):!1,qb=()=>({state:e,dispatch:t})=>Fm(e,t),Jb=e=>({state:t,dispatch:n})=>th(nb(e,t.schema))(t,n),Yb=()=>({state:e,dispatch:t})=>jm(e,t);function Xb(e,t){return t.nodes[e]?`node`:t.marks[e]?`mark`:null}function Zb(e,t){let n=typeof t==`string`?[t]:t;return Object.keys(e).reduce((t,r)=>(n.includes(r)||(t[r]=e[r]),t),{})}var Qb=(e,t)=>({tr:n,state:r,dispatch:i})=>{let a=null,o=null,s=Xb(typeof e==`string`?e:e.name,r.schema);if(!s)return!1;s===`node`&&(a=nb(e,r.schema)),s===`mark`&&(o=gb(e,r.schema));let c=!1;return n.selection.ranges.forEach(e=>{r.doc.nodesBetween(e.$from.pos,e.$to.pos,(e,r)=>{a&&a===e.type&&(c=!0,i&&n.setNodeMarkup(r,void 0,Zb(e.attrs,t))),o&&e.marks.length&&e.marks.forEach(a=>{o===a.type&&(c=!0,i&&n.addMark(r,r+e.nodeSize,o.create(Zb(a.attrs,t))))})})}),c},$b=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),ex=()=>({tr:e,dispatch:t})=>{if(t){let t=new Zp(e.doc);e.setSelection(t)}return!0},tx=()=>({state:e,dispatch:t})=>Sm(e,t),nx=()=>({state:e,dispatch:t})=>Em(e,t),rx=()=>({state:e,dispatch:t})=>Rm(e,t),ix=()=>({state:e,dispatch:t})=>Wm(e,t),ax=()=>({state:e,dispatch:t})=>Um(e,t);function ox(e,t,n={},r={}){return Ab(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var sx=(e,{errorOnInvalidContent:t,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:i,tr:a,dispatch:o,commands:s})=>{let{doc:c}=a;if(r.preserveWhitespace!==`full`){let s=ox(e,i.schema,r,{errorOnInvalidContent:t??i.options.enableContentCheck});return o&&a.replaceWith(0,c.content.size,s).setMeta(`preventUpdate`,!n),!0}return o&&a.setMeta(`preventUpdate`,!n),s.insertContentAt({from:0,to:c.content.size},e,{parseOptions:r,errorOnInvalidContent:t??i.options.enableContentCheck})};function cx(e,t){let n=gb(t,e.schema),{from:r,to:i,empty:a}=e.selection,o=[];a?(e.storedMarks&&o.push(...e.storedMarks),o.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,i,e=>{o.push(...e.marks)});let s=o.find(e=>e.type.name===n.name);return s?{...s.attrs}:{}}function lx(e,t){let n=new Wp(e);return t.forEach(e=>{e.steps.forEach(e=>{n.step(e)})}),n}function ux(e){for(let t=0;t<e.edgeCount;t+=1){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function dx(e,t,n){let r=[];return e.nodesBetween(t.from,t.to,(e,t)=>{n(e)&&r.push({node:e,pos:t})}),r}function fx(e,t){for(let n=e.depth;n>0;--n){let r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}function px(e){return t=>fx(t.$from,e)}function Z(e,t,n){return e.config[t]===void 0&&e.parent?Z(e.parent,t,n):typeof e.config[t]==`function`?e.config[t].bind({...n,parent:e.parent?Z(e.parent,t,n):null}):e.config[t]}function mx(e){return e.map(e=>{let t=Z(e,`addExtensions`,{name:e.name,options:e.options,storage:e.storage});return t?[e,...mx(t())]:e}).flat(10)}function hx(e,t){let n=Tf.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement(`div`);return r.appendChild(n),r.innerHTML}function gx(e){return typeof e==`function`}function _x(e,t=void 0,...n){return gx(e)?t?e.bind(t)(...n):e(...n):e}function vx(e={}){return Object.keys(e).length===0&&e.constructor===Object}function yx(e){return{baseExtensions:e.filter(e=>e.type===`extension`),nodeExtensions:e.filter(e=>e.type===`node`),markExtensions:e.filter(e=>e.type===`mark`)}}function bx(e){let t=[],{nodeExtensions:n,markExtensions:r}=yx(e),i=[...n,...r],a={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},o=n.filter(e=>e.name!==`text`).map(e=>e.name),s=r.map(e=>e.name),c=[...o,...s];return e.forEach(e=>{let n=Z(e,`addGlobalAttributes`,{name:e.name,options:e.options,storage:e.storage,extensions:i});n&&n().forEach(e=>{let n;n=Array.isArray(e.types)?e.types:e.types===`*`?c:e.types===`nodes`?o:e.types===`marks`?s:[],n.forEach(n=>{Object.entries(e.attributes).forEach(([e,r])=>{t.push({type:n,name:e,attribute:{...a,...r}})})})})}),i.forEach(e=>{let n=Z(e,`addAttributes`,{name:e.name,options:e.options,storage:e.storage});if(!n)return;let r=n();Object.entries(r).forEach(([n,r])=>{let i={...a,...r};typeof i?.default==`function`&&(i.default=i.default()),i?.isRequired&&i?.default===void 0&&delete i.default,t.push({type:e.name,name:n,attribute:i})})}),t}function xx(e){let t=[],n=``,r=!1,i=!1,a=0,o=e.length;for(let s=0;s<o;s+=1){let o=e[s];if(o===`'`&&!i){r=!r,n+=o;continue}if(o===`"`&&!r){i=!i,n+=o;continue}if(!r&&!i){if(o===`(`){a+=1,n+=o;continue}if(o===`)`&&a>0){--a,n+=o;continue}if(o===`;`&&a===0){t.push(n),n=``;continue}}n+=o}return n&&t.push(n),t}function Sx(e){let t=[],n=xx(e||``),r=n.length;for(let e=0;e<r;e+=1){let r=n[e],i=r.indexOf(`:`);if(i===-1)continue;let a=r.slice(0,i).trim(),o=r.slice(i+1).trim();a&&o&&t.push([a,o])}return t}function Cx(...e){return e.filter(e=>!!e).reduce((e,t)=>{let n={...e};return Object.entries(t).forEach(([e,t])=>{if(!n[e]){n[e]=t;return}if(e===`class`){let r=t?String(t).split(` `):[],i=n[e]?n[e].split(` `):[],a=r.filter(e=>!i.includes(e));n[e]=[...i,...a].join(` `)}else if(e===`style`){let r=new Map([...Sx(n[e]),...Sx(t)]);n[e]=Array.from(r.entries()).map(([e,t])=>`${e}: ${t}`).join(`; `)}else n[e]=t}),n},{})}function wx(e,t){return t.filter(t=>t.type===e.type.name).filter(e=>e.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(e.attrs)||{}:{[t.name]:e.attrs[t.name]}).reduce((e,t)=>Cx(e,t),{})}function Tx(e){return typeof e==`string`?e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):e===`true`?!0:e===`false`?!1:e:e}function Ex(e,t){return`style`in e?e:{...e,getAttrs:n=>{let r=e.getAttrs?e.getAttrs(n):e.attrs;if(r===!1)return!1;let i=t.reduce((e,t)=>{let r=t.attribute.parseHTML?t.attribute.parseHTML(n):Tx(n.getAttribute(t.name));return r==null?e:{...e,[t.name]:r}},{});return{...r,...i}}}}function Dx(e){return Object.fromEntries(Object.entries(e).filter(([e,t])=>e===`attrs`&&vx(t)?!1:t!=null))}function Ox(e){let t={};return!e?.attribute?.isRequired&&`default`in(e?.attribute||{})&&(t.default=e.attribute.default),e?.attribute?.validate!==void 0&&(t.validate=e.attribute.validate),[e.name,t]}function kx(e,t){let n=bx(e),{nodeExtensions:r,markExtensions:i}=yx(e);return new sf({topNode:r.find(e=>Z(e,`topNode`))?.name,nodes:Object.fromEntries(r.map(r=>{let i=n.filter(e=>e.type===r.name),a={name:r.name,options:r.options,storage:r.storage,editor:t},o=Dx({...e.reduce((e,t)=>{let n=Z(t,`extendNodeSchema`,a);return{...e,...n?n(r):{}}},{}),content:_x(Z(r,`content`,a)),marks:_x(Z(r,`marks`,a)),group:_x(Z(r,`group`,a)),inline:_x(Z(r,`inline`,a)),atom:_x(Z(r,`atom`,a)),selectable:_x(Z(r,`selectable`,a)),draggable:_x(Z(r,`draggable`,a)),code:_x(Z(r,`code`,a)),whitespace:_x(Z(r,`whitespace`,a)),linebreakReplacement:_x(Z(r,`linebreakReplacement`,a)),defining:_x(Z(r,`defining`,a)),isolating:_x(Z(r,`isolating`,a)),attrs:Object.fromEntries(i.map(Ox))}),s=_x(Z(r,`parseHTML`,a));s&&(o.parseDOM=s.map(e=>Ex(e,i)));let c=Z(r,`renderHTML`,a);c&&(o.toDOM=e=>c({node:e,HTMLAttributes:wx(e,i)}));let l=Z(r,`renderText`,a);return l&&(o.toText=l),[r.name,o]})),marks:Object.fromEntries(i.map(r=>{let i=n.filter(e=>e.type===r.name),a={name:r.name,options:r.options,storage:r.storage,editor:t},o=Dx({...e.reduce((e,t)=>{let n=Z(t,`extendMarkSchema`,a);return{...e,...n?n(r):{}}},{}),inclusive:_x(Z(r,`inclusive`,a)),excludes:_x(Z(r,`excludes`,a)),group:_x(Z(r,`group`,a)),spanning:_x(Z(r,`spanning`,a)),code:_x(Z(r,`code`,a)),attrs:Object.fromEntries(i.map(Ox))}),s=_x(Z(r,`parseHTML`,a));s&&(o.parseDOM=s.map(e=>Ex(e,i)));let c=Z(r,`renderHTML`,a);return c&&(o.toDOM=e=>c({mark:e,HTMLAttributes:wx(e,i)})),[r.name,o]}))})}function Ax(e){let t=e.filter((t,n)=>e.indexOf(t)!==n);return Array.from(new Set(t))}function jx(e){return e.sort((e,t)=>{let n=Z(e,`priority`)||100,r=Z(t,`priority`)||100;return n>r?-1:+(n<r)})}function Mx(e){let t=jx(mx(e)),n=Ax(t.map(e=>e.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(e=>`'${e}'`).join(`, `)}]. This can lead to issues.`),t}function Nx(e,t,n){let{from:r,to:i}=t,{blockSeparator:a=` 235 236`,textSerializers:o={}}=n||{},s=``;return e.nodesBetween(r,i,(e,n,c,l)=>{e.isBlock&&n>r&&(s+=a);let u=o?.[e.type.name];if(u)return c&&(s+=u({node:e,pos:n,parent:c,index:l,range:t})),!1;e.isText&&(s+=(e?.text)?.slice(Math.max(r,n)-n,i-n))}),s}function Px(e,t){return Nx(e,{from:0,to:e.content.size},t)}function Fx(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}function Ix(e,t){let n=nb(t,e.schema),{from:r,to:i}=e.selection,a=[];e.doc.nodesBetween(r,i,e=>{a.push(e)});let o=a.reverse().find(e=>e.type.name===n.name);return o?{...o.attrs}:{}}function Lx(e,t){let n=Xb(typeof t==`string`?t:t.name,e.schema);return n===`node`?Ix(e,t):n===`mark`?cx(e,t):{}}function Rx(e,t=JSON.stringify){let n={};return e.filter(e=>{let r=t(e);return Object.prototype.hasOwnProperty.call(n,r)?!1:n[r]=!0})}function zx(e){let t=Rx(e);return t.length===1?t:t.filter((e,n)=>!t.filter((e,t)=>t!==n).some(t=>e.oldRange.from>=t.oldRange.from&&e.oldRange.to<=t.oldRange.to&&e.newRange.from>=t.newRange.from&&e.newRange.to<=t.newRange.to))}function Bx(e){let{mapping:t,steps:n}=e,r=[];return t.maps.forEach((e,i)=>{let a=[];if(e.ranges.length)e.forEach((e,t)=>{a.push({from:e,to:t})});else{let{from:e,to:t}=n[i];if(e===void 0||t===void 0)return;a.push({from:e,to:t})}a.forEach(({from:e,to:n})=>{let a=t.slice(i).map(e,-1),o=t.slice(i).map(n),s=t.invert().map(a,-1),c=t.invert().map(o);r.push({oldRange:{from:s,to:c},newRange:{from:a,to:o}})})}),zx(r)}function Vx(e,t,n){let r=[];return e===t?n.resolve(e).marks().forEach(t=>{let i=hb(n.resolve(e),t.type);i&&r.push({mark:t,...i})}):n.nodesBetween(e,t,(e,t)=>{!e||e?.nodeSize===void 0||r.push(...e.marks.map(n=>({from:t,to:t+e.nodeSize,mark:n})))}),r}var Hx=(e,t,n,r=20)=>{let i=e.doc.resolve(n),a=r,o=null;for(;a>0&&o===null;){let e=i.node(a);e?.type.name===t?o=e:--a}return[o,a]};function Ux(e,t){return t.nodes[e]||t.marks[e]||null}function Wx(e,t,n){return Object.fromEntries(Object.entries(n).filter(([n])=>{let r=e.find(e=>e.type===t&&e.name===n);return r?r.attribute.keepOnSplit:!1}))}var Gx=(e,t=500)=>{let n=``,r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,(e,t,i,a)=>{var o;let s=(o=e.type.spec).toText?.call(o,{node:e,pos:t,parent:i,index:a})||e.textContent||`%leaf%`;n+=e.isAtom&&!e.isText?s:s.slice(0,Math.max(0,r-t))}),n};function Kx(e,t,n={}){let{empty:r,ranges:i}=e.selection,a=t?gb(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(e=>a?a.name===e.type.name:!0).find(e=>fb(e.attrs,n,{strict:!1}));let o=0,s=[];if(i.forEach(({$from:t,$to:n})=>{let r=t.pos,i=n.pos;e.doc.nodesBetween(r,i,(e,t)=>{if(a&&e.inlineContent&&!e.type.allowsMarkType(a))return!1;if(!e.isText&&!e.marks.length)return;let n=Math.max(r,t),c=Math.min(i,t+e.nodeSize),l=c-n;o+=l,s.push(...e.marks.map(e=>({mark:e,from:n,to:c})))})}),o===0)return!1;let c=s.filter(e=>a?a.name===e.mark.type.name:!0).filter(e=>fb(e.mark.attrs,n,{strict:!1})).reduce((e,t)=>e+t.to-t.from,0),l=s.filter(e=>a?e.mark.type!==a&&e.mark.type.excludes(a):!0).reduce((e,t)=>e+t.to-t.from,0);return(c>0?c+l:c)>=o}function qx(e,t,n={}){if(!t)return Gb(e,null,n)||Kx(e,null,n);let r=Xb(t,e.schema);return r===`node`?Gb(e,t,n):r===`mark`?Kx(e,t,n):!1}var Jx=(e,t)=>{let{$from:n,$to:r,$anchor:i}=e.selection;if(t){let n=px(e=>e.type.name===t)(e.selection);if(!n)return!1;let r=e.doc.resolve(n.pos+1);return i.pos+1===r.end()}return!(r.parentOffset<r.parent.nodeSize-2||n.pos!==r.pos)},Yx=e=>{let{$from:t,$to:n}=e.selection;return!(t.parentOffset>0||t.pos!==n.pos)};function Xx(e,t){return Array.isArray(t)?t.some(t=>(typeof t==`string`?t:t.name)===e.name):t}function Zx(e,t){let{nodeExtensions:n}=yx(t),r=n.find(t=>t.name===e);if(!r)return!1;let i=_x(Z(r,`group`,{name:r.name,options:r.options,storage:r.storage}));return typeof i==`string`?i.split(` `).includes(`list`):!1}function Qx(e,{checkChildren:t=!0,ignoreWhitespace:n=!1}={}){if(n){if(e.type.name===`hardBreak`)return!0;if(e.isText)return!/\S/.test(e.text??``)}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(e.content.childCount===0)return!0;if(t){let r=!0;return e.content.forEach(e=>{r!==!1&&(Qx(e,{ignoreWhitespace:n,checkChildren:t})||(r=!1))}),r}return!1}function $x(e){return e instanceof X}var eS=class e{constructor(e){this.position=e}static fromJSON(t){return new e(t.position)}toJSON(){return{position:this.position}}};function tS(e,t){let n=t.mapping.mapResult(e.position);return{position:new eS(n.pos),mapResult:n}}function nS(e){return new eS(e)}function rS(e,t,n){let{selection:r}=t,i=null;if(yb(r)&&(i=r.$cursor),i){let t=e.storedMarks??i.marks();return i.parent.type.allowsMarkType(n)&&(!!n.isInSet(t)||!t.some(e=>e.type.excludes(n)))}let{ranges:a}=r;return a.some(({$from:t,$to:r})=>{let i=t.depth===0?e.doc.inlineContent&&e.doc.type.allowsMarkType(n):!1;return e.doc.nodesBetween(t.pos,r.pos,(e,t,r)=>{if(i)return!1;if(e.isInline){let t=!r||r.type.allowsMarkType(n),a=!!n.isInSet(e.marks)||!e.marks.some(e=>e.type.excludes(n));i=t&&a}return!i}),i})}var iS=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let{selection:a}=n,{empty:o,ranges:s}=a,c=gb(e,r.schema);if(i)if(o){let e=cx(r,c);n.addStoredMark(c.create({...e,...t}))}else s.forEach(e=>{let i=e.$from.pos,a=e.$to.pos;r.doc.nodesBetween(i,a,(e,r)=>{let o=Math.max(r,i),s=Math.min(r+e.nodeSize,a);e.marks.find(e=>e.type===c)?e.marks.forEach(e=>{c===e.type&&n.addMark(o,s,c.create({...e.attrs,...t}))}):n.addMark(o,s,c.create(t))})});return rS(r,n,c)},aS=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),oS=(e,t={})=>({state:n,dispatch:r,chain:i})=>{let a=nb(e,n.schema),o;return n.selection.$anchor.sameParent(n.selection.$head)&&(o=n.selection.$anchor.parent.attrs),a.isTextblock?i().command(({commands:e})=>Km(a,{...o,...t})(n)?!0:e.clearNodes()).command(({state:e})=>Km(a,{...o,...t})(e,r)).run():(console.warn(`[tiptap warn]: Currently "setNode()" only supports text block nodes.`),!1)},sS=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,r=bb(e,0,n.content.size),i=X.create(n,r);t.setSelection(i)}return!0},cS=(e,t)=>({tr:n,state:r,dispatch:i})=>{let{selection:a}=r,o,s;return typeof t==`number`?(o=t,s=t):t&&`from`in t&&`to`in t?(o=t.from,s=t.to):(o=a.from,s=a.to),i&&n.doc.nodesBetween(o,s,(t,r)=>{t.isText||n.setNodeMarkup(r,void 0,{...t.attrs,dir:e})}),!0},lS=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,{from:r,to:i}=typeof e==`number`?{from:e,to:e}:e,a=Y.atStart(n).from,o=Y.atEnd(n).to,s=bb(r,a,o),c=bb(i,a,o),l=Y.create(n,s,c);t.setSelection(l)}return!0},uS=e=>({state:t,dispatch:n})=>ih(nb(e,t.schema))(t,n);function dS(e,t){let n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){let r=n.filter(e=>t?.includes(e.type.name));e.tr.ensureMarks(r)}}var fS=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:i})=>{let{selection:a,doc:o}=t,{$from:s,$to:c}=a,l=i.extensionManager.attributes,u=Wx(l,s.node().type.name,s.node().attrs);if(a instanceof X&&a.node.isBlock)return!s.parentOffset||!_p(o,s.pos)?!1:(r&&(e&&dS(n,i.extensionManager.splittableMarks),t.split(s.pos).scrollIntoView()),!0);if(!s.parent.isBlock)return!1;let d=c.parentOffset===c.parent.content.size,f=s.depth===0?void 0:ux(s.node(-1).contentMatchAt(s.indexAfter(-1))),p=d&&f?[{type:f,attrs:u}]:void 0,m=_p(t.doc,t.mapping.map(s.pos),1,p);if(!p&&!m&&_p(t.doc,t.mapping.map(s.pos),1,f?[{type:f}]:void 0)&&(m=!0,p=f?[{type:f,attrs:u}]:void 0),r){if(m&&(a instanceof Y&&t.deleteSelection(),t.split(t.mapping.map(s.pos),1,p),f&&!d&&!s.parentOffset&&s.parent.type!==f)){let e=t.mapping.map(s.before()),n=t.doc.resolve(e);s.node(-1).canReplaceWith(n.index(),n.index()+1,f)&&t.setNodeMarkup(t.mapping.map(s.before()),f)}e&&dS(n,i.extensionManager.splittableMarks),t.scrollIntoView()}return m},pS=(e,t={})=>({tr:n,state:r,dispatch:i,editor:a})=>{let o=nb(e,r.schema),{$from:s,$to:c}=r.selection,l=r.selection.node;if(l&&l.isBlock||s.depth<2||!s.sameParent(c))return!1;let u=s.node(-1);if(u.type!==o)return!1;let d=a.extensionManager.attributes;if(s.parent.content.size===0&&s.node(-1).childCount===s.indexAfter(-1)){if(s.depth===2||s.node(-3).type!==o||s.index(-2)!==s.node(-2).childCount-1)return!1;if(i){let e=G.empty,r=s.index(-1)?1:s.index(-2)?2:3;for(let t=s.depth-r;t>=s.depth-3;--t)e=G.from(s.node(t).copy(e));let i=s.indexAfter(-1)<s.node(-2).childCount?1:s.indexAfter(-2)<s.node(-3).childCount?2:3,a={...Wx(d,s.node().type.name,s.node().attrs),...t},c=o.contentMatch.defaultType?.createAndFill(a)||void 0;e=e.append(G.from(o.createAndFill(null,c)||void 0));let l=s.before(s.depth-(r-1));n.replace(l,s.after(-i),new K(e,4-r,0));let u=-1;n.doc.nodesBetween(l,n.doc.content.size,(e,t)=>{if(u>-1)return!1;e.isTextblock&&e.content.size===0&&(u=t+1)}),u>-1&&n.setSelection(Y.near(n.doc.resolve(u))),n.scrollIntoView()}return!0}let f=c.pos===s.end()?u.contentMatchAt(0).defaultType:null,p={...Wx(d,u.type.name,u.attrs),...t},m={...Wx(d,s.node().type.name,s.node().attrs),...t};n.delete(s.pos,c.pos);let h=f?[{type:o,attrs:p},{type:f,attrs:m}]:[{type:o,attrs:p}];if(!_p(n.doc,s.pos,2))return!1;if(i){let{selection:e,storedMarks:t}=r,{splittableMarks:o}=a.extensionManager,c=t||e.$to.parentOffset&&e.$from.marks();if(n.split(s.pos,2,h).scrollIntoView(),!c||!i)return!0;let l=c.filter(e=>o.includes(e.type.name));n.ensureMarks(l)}return!0};function mS(e){return!e||e===`1`?null:e}function hS(e,t){return mS(e)===mS(t)}var gS=(e,t)=>{let n=px(e=>e.type===t)(e.selection);if(!n)return!0;let r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;let i=e.doc.nodeAt(r);return!(n.node.type===i?.type&&yp(e.doc,n.pos))||!hS(n.node.attrs.type,i?.attrs.type)||e.join(n.pos),!0},_S=(e,t)=>{let n=px(e=>e.type===t)(e.selection);if(!n)return!0;let r=e.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;let i=e.doc.nodeAt(r);return!(n.node.type===i?.type&&yp(e.doc,r))||!hS(n.node.attrs.type,i?.attrs.type)||e.join(r),!0};function vS(e){let t=e.doc,n=t.firstChild;if(!n)return null;let r=t.resolve(1),i=t.resolve(n.nodeSize-1);return Y.between(r,i)}var yS=(e,t,n,r={})=>({editor:i,tr:a,state:o,dispatch:s,chain:c,commands:l,can:u})=>{let{extensions:d,splittableMarks:f}=i.extensionManager,p=nb(e,o.schema),m=nb(t,o.schema),{selection:h,storedMarks:g}=o,{$from:_,$to:v}=h,y=_.blockRange(v),b=g||h.$to.parentOffset&&h.$from.marks();if(!y)return!1;let x=px(e=>Zx(e.type.name,d))(h),S=h.from===0&&h.to===o.doc.content.size,C=o.doc.content.content,w=C.length===1?C[0]:null,ee=S&&w&&Zx(w.type.name,d)?{node:w,pos:0,depth:0}:null,te=x??ee,ne=!!x&&y.depth>=1&&y.depth-x.depth<=1,re=!!ee;if((ne||re)&&te){if(te.node.type===p)return S&&re?c().command(({tr:e,dispatch:t})=>{let n=vS(e);return n?(e.setSelection(n),t&&t(e),!0):!1}).liftListItem(m).run():l.liftListItem(m);if(Zx(te.node.type.name,d)&&p.validContent(te.node.content))return c().command(()=>(a.setNodeMarkup(te.pos,p),!0)).command(()=>gS(a,p)).command(()=>_S(a,p)).run()}return!n||!b||!s?c().command(()=>u().wrapInList(p,r)?!0:l.clearNodes()).wrapInList(p,r).command(()=>gS(a,p)).command(()=>_S(a,p)).run():c().command(()=>{let e=u().wrapInList(p,r),t=b.filter(e=>f.includes(e.type.name));return a.ensureMarks(t),e?!0:l.clearNodes()}).wrapInList(p,r).command(()=>gS(a,p)).command(()=>_S(a,p)).run()},bS=(e,t={},n={})=>({state:r,commands:i})=>{let{extendEmptyMarkRange:a=!1}=n,o=gb(e,r.schema);return Kx(r,o,t)?i.unsetMark(o,{extendEmptyMarkRange:a}):i.setMark(o,t)},xS=(e,t,n={})=>({state:r,commands:i})=>{let a=nb(e,r.schema),o=nb(t,r.schema),s=Gb(r,a,n),c;return r.selection.$anchor.sameParent(r.selection.$head)&&(c=r.selection.$anchor.parent.attrs),s?i.setNode(o,c):i.setNode(a,{...c,...n})},SS=(e,t={})=>({state:n,commands:r})=>{let i=nb(e,n.schema);return Gb(n,i,t)?r.lift(i):r.wrapIn(i,t)},CS=()=>({state:e,dispatch:t})=>{let n=e.plugins;for(let r=0;r<n.length;r+=1){let i=n[r],a;if(i.spec.isInputRules&&(a=i.getState(e))){if(t){let t=e.tr,n=a.transform;
236for(let e=n.steps.length-1;e>=0;--e)t.step(n.steps[e].invert(n.docs[e]));if(a.text){let n=t.doc.resolve(a.from).marks();t.replaceWith(a.from,a.to,e.schema.text(a.text,n))}else t.delete(a.from,a.to)}return!0}}return!1},wS=(e={})=>({tr:t,dispatch:n,editor:r})=>{let{ignoreClearable:i=!1}=e,{selection:a}=t,{empty:o,ranges:s}=a;if(o)return!0;let{nonClearableMarks:c}=r.extensionManager;if(n){let e=Object.values(r.schema.marks).filter(e=>i||!c.includes(e.name));s.forEach(n=>{for(let r of e)t.removeMark(n.$from.pos,n.$to.pos,r)})}return!0},TS=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let{extendEmptyMarkRange:a=!1}=t,{selection:o}=n,s=gb(e,r.schema),{$from:c,empty:l,ranges:u}=o;if(!i)return!0;if(l&&a){let{from:e,to:t}=o,r=hb(c,s,c.marks().find(e=>e.type===s)?.attrs);r&&(e=r.from,t=r.to),n.removeMark(e,t,s)}else u.forEach(e=>{n.removeMark(e.$from.pos,e.$to.pos,s)});return n.removeStoredMark(s),!0},ES=e=>({tr:t,state:n,dispatch:r})=>{let{selection:i}=n,a,o;return typeof e==`number`?(a=e,o=e):e&&`from`in e&&`to`in e?(a=e.from,o=e.to):(a=i.from,o=i.to),r&&t.doc.nodesBetween(a,o,(e,n)=>{if(e.isText)return;let r={...e.attrs};delete r.dir,t.setNodeMarkup(n,void 0,r)}),!0},DS=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let a=null,o=null,s=Xb(typeof e==`string`?e:e.name,r.schema);if(!s)return!1;s===`node`&&(a=nb(e,r.schema)),s===`mark`&&(o=gb(e,r.schema));let c=!1;return n.selection.ranges.forEach(e=>{let s=e.$from.pos,l=e.$to.pos,u,d,f,p;n.selection.empty?r.doc.nodesBetween(s,l,(e,t)=>{a&&a===e.type&&(c=!0,f=Math.max(t,s),p=Math.min(t+e.nodeSize,l),u=t,d=e)}):r.doc.nodesBetween(s,l,(e,r)=>{r<s&&a&&a===e.type&&(c=!0,f=Math.max(r,s),p=Math.min(r+e.nodeSize,l),u=r,d=e),r>=s&&r<=l&&(a&&a===e.type&&(c=!0,i&&n.setNodeMarkup(r,void 0,{...e.attrs,...t})),o&&e.marks.length&&e.marks.forEach(a=>{if(o===a.type&&(c=!0,i)){let i=Math.max(r,s),c=Math.min(r+e.nodeSize,l);n.addMark(i,c,o.create({...a.attrs,...t}))}}))}),d&&(u!==void 0&&i&&n.setNodeMarkup(u,void 0,{...d.attrs,...t}),o&&d.marks.length&&d.marks.forEach(e=>{o===e.type&&i&&n.addMark(f,p,o.create({...e.attrs,...t}))}))}),c},OS=(e,t={})=>({state:n,dispatch:r})=>Gm(nb(e,n.schema),t)(n,r),kS=(e,t={})=>({state:n,dispatch:r})=>Qm(nb(e,n.schema),t)(n,r),AS=class{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){let n=this.callbacks[e];return n&&n.forEach(e=>e.apply(this,t)),this}off(e,t){let n=this.callbacks[e];return n&&(t?this.callbacks[e]=n.filter(e=>e!==t):delete this.callbacks[e]),this}once(e,t){let n=(...r)=>{this.off(e,n),t.apply(this,r)};return this.on(e,n)}removeAllListeners(){this.callbacks={}}};function jS(e,t){let{selection:n}=e,{$from:r}=n;if(n instanceof X){let e=r.index();return r.parent.canReplaceWith(e,e+1,t)}let i=r.depth;for(;i>=0;){let e=r.index(i);if(r.node(i).contentMatchAt(e).matchType(t))return!0;--i}return!1}function MS(e,t,n){let r=document.querySelector(`style[data-tiptap-style${n?`-${n}`:``}]`);if(r!==null)return r;let i=document.createElement(`style`);return t&&i.setAttribute(`nonce`,t),i.setAttribute(`data-tiptap-style${n?`-${n}`:``}`,``),i.innerHTML=e,document.getElementsByTagName(`head`)[0].appendChild(i),i}function NS(e){return typeof e==`number`}function PS(e){return Object.prototype.toString.call(e).slice(8,-1)}function FS(e){return PS(e)===`Object`?e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype:!1}Gy({},{createAtomBlockMarkdownSpec:()=>RS,createBlockMarkdownSpec:()=>zS,createInlineMarkdownSpec:()=>HS,parseAttributes:()=>IS,parseIndentedBlocks:()=>US,renderNestedMarkdownContent:()=>WS,serializeAttributes:()=>LS});function IS(e){if(!e?.trim())return{};let t={},n=[],r=e.replace(/["']([^"']*)["']/g,e=>(n.push(e),`__QUOTED_${n.length-1}__`)),i=r.match(/(?:^|\s)\.([\w-]+)/g);i&&(t.class=i.map(e=>e.trim().slice(1)).join(` `));let a=r.match(/(?:^|\s)#([\w-]+)/);a&&(t.id=a[1]),Array.from(r.matchAll(/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g)).forEach(([,e,r])=>{let i=n[parseInt(r.match(/__QUOTED_(\d+)__/)?.[1]||`0`,10)];i&&(t[e]=i.slice(1,-1))});let o=r.replace(/(?:^|\s)\.([\w-]+)/g,``).replace(/(?:^|\s)#([\w-]+)/g,``).replace(/([a-zA-Z][\
vendor: 20,213 bytes, lines 236-256
236w-]*)\s*=\s*__QUOTED_\d+__/g,``).trim();return o&&o.split(/\s+/).filter(Boolean).forEach(e=>{e.match(/^[a-zA-Z][\w-]*$/)&&(t[e]=!0)}),t}function LS(e){if(!e||Object.keys(e).length===0)return``;let t=[];return e.class&&String(e.class).split(/\s+/).filter(Boolean).forEach(e=>t.push(`.${e}`)),e.id&&t.push(`#${e.id}`),Object.entries(e).forEach(([e,n])=>{e===`class`||e===`id`||(n===!0?t.push(e):n!==!1&&n!=null&&t.push(`${e}="${String(n)}"`))}),t.join(` `)}function RS(e){let{nodeName:t,name:n,parseAttributes:r=IS,serializeAttributes:i=LS,defaultAttributes:a={},requiredAttributes:o=[],allowedAttributes:s}=e,c=n||t,l=e=>{if(!s)return e;let t={};return s.forEach(n=>{n in e&&(t[n]=e[n])}),t};return{parseMarkdown:(e,n)=>{let r={...a,...e.attributes};return n.createNode(t,r,[])},markdownTokenizer:{name:t,level:`block`,start(e){let t=RegExp(`^:::${c}(?:\\s|$)`,`m`),n=e.match(t)?.index;return n===void 0?-1:n},tokenize(e,n,i){let a=RegExp(`^:::${c}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),s=e.match(a);if(!s)return;let l=r(s[1]||``);if(!o.find(e=>!(e in l)))return{type:t,raw:s[0],attributes:l}}},renderMarkdown:e=>{let t=i(l(e.attrs||{}));return`:::${c}${t?` {${t}}`:``} :::`}}}function zS(e){let{nodeName:t,name:n,getContent:r,parseAttributes:i=IS,serializeAttributes:a=LS,defaultAttributes:o={},content:s=`block`,allowedAttributes:c}=e,l=n||t,u=e=>{if(!c)return e;let t={};return c.forEach(n=>{n in e&&(t[n]=e[n])}),t};return{parseMarkdown:(e,n)=>{let i;if(r){let t=r(e);i=typeof t==`string`?[{type:`text`,text:t}]:t}else i=s===`block`?n.parseChildren(e.tokens||[]):n.parseInline(e.tokens||[]);let a={...o,...e.attributes};return n.createNode(t,a,i)},markdownTokenizer:{name:t,level:`block`,start(e){let t=RegExp(`^:::${l}`,`m`),n=e.match(t)?.index;return n===void 0?-1:n},tokenize(e,n,r){let a=RegExp(`^:::${l}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),o=e.match(a);if(!o)return;let[c,u=``]=o,d=i(u),f=1,p=c.length,m=``,h=/^:::([\w-]*)(\s.*)?/gm,g=e.slice(p);for(h.lastIndex=0;;){let n=h.exec(g);if(n===null)break;let i=n.index,a=n[1];if(!n[2]?.endsWith(`:::`)){if(a)f+=1;else if(--f,f===0){let a=g.slice(0,i);m=a.trim();let o=e.slice(0,p+i+n[0].length),c=[];if(m)if(s===`block`)for(c=r.blockTokens(a),c.forEach(e=>{e.text&&(!e.tokens||e.tokens.length===0)&&(e.tokens=r.inlineTokens(e.text))});c.length>0;){let e=c[c.length-1];if(e.type===`paragraph`&&(!e.text||e.text.trim()===``))c.pop();else break}else c=r.inlineTokens(m);return{type:t,raw:o,attributes:d,content:m,tokens:c}}}}}},renderMarkdown:(e,t)=>{let n=a(u(e.attrs||{}));return`:::${l}${n?` {${n}}`:``} 237 238${t.renderChildren(e.content||[],` 239 240`)} 241 242:::`}}}function BS(e){if(!e.trim())return{};let t={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g,r=n.exec(e);for(;r!==null;){let[,i,a,o]=r;t[i]=a||o,r=n.exec(e)}return t}function VS(e){return Object.entries(e).filter(([,e])=>e!=null).map(([e,t])=>`${e}="${t}"`).join(` `)}function HS(e){let{nodeName:t,name:n,getContent:r,parseAttributes:i=BS,serializeAttributes:a=VS,defaultAttributes:o={},selfClosing:s=!1,allowedAttributes:c}=e,l=n||t,u=e=>{if(!c)return e;let t={};return c.forEach(n=>{let r=typeof n==`string`?n:n.name,i=typeof n==`string`?void 0:n.skipIfDefault;if(r in e){let n=e[r];if(i!==void 0&&n===i)return;t[r]=n}}),t},d=l.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);return{parseMarkdown:(e,n)=>{let i={...o,...e.attributes};if(s)return n.createNode(t,i);let a=r?r(e):e.content||``;return a?n.createNode(t,i,[n.createTextNode(a)]):n.createNode(t,i,[])},markdownTokenizer:{name:t,level:`inline`,start(e){let t=RegExp(s?`\\[${d}\\s*[^\\]]*\\]`:`\\[${d}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${d}\\]`),n=e.match(t)?.index;return n===void 0?-1:n},tokenize(e,n,r){let a=RegExp(s?`^\\[${d}\\s*([^\\]]*)\\]`:`^\\[${d}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${d}\\]`),o=e.match(a);if(!o)return;let c=``,l=``;if(s){let[,e]=o;l=e}else{let[,e,t]=o;l=e,c=t||``}let u=i(l.trim());return{type:t,raw:o[0],content:c.trim(),attributes:u}}},renderMarkdown:e=>{let t=``;r?t=r(e):e.content&&e.content.length>0&&(t=e.content.filter(e=>e.type===`text`).map(e=>e.text).join(``));let n=a(u(e.attrs||{})),i=n?` ${n}`:``;return s?`[${l}${i}]`:`[${l}${i}]${t}[/${l}]`}}}function US(e,t,n){let r=e.split(` 243`),i=[],a=``,o=0,s=t.baseIndentSize||2;for(;o<r.length;){let e=r[o],c=e.match(t.itemPattern);if(!c){if(i.length>0)break;if(e.trim()===``){o+=1,a=`${a}${e} 244`;continue}else return}let l=t.extractItemData(c),{indentLevel:u,mainContent:d}=l;a=`${a}${e} 245`;let f=[d];for(o+=1;o<r.length;){let e=r[o];if(e.trim()===``){let t=r.slice(o+1).findIndex(e=>e.trim()!==``);if(t===-1)break;if((r[o+1+t].match(/^(\s*)/)?.[1]?.length||0)>u){f.push(e),a=`${a}${e} 246`,o+=1;continue}else break}if((e.match(/^(\s*)/)?.[1]?.length||0)>u)f.push(e),a=`${a}${e} 247`,o+=1;else break}let p,m=f.slice(1);if(m.length>0){let e=m.map(e=>e.slice(u+s)).join(` 248`);e.trim()&&(p=t.customNestedParser?t.customNestedParser(e):n.blockTokens(e))}let h=t.createToken(l,p);i.push(h)}if(i.length!==0)return{items:i,raw:a}}function WS(e,t,n,r){if(!e||!Array.isArray(e.content))return``;let i=typeof n==`function`?n(r):n,[a,...o]=e.content,s=`${i}${t.renderChildren([a])}`;return o&&o.length>0&&o.forEach((e,n)=>{let r=t.renderChild?.call(t,e,n+1)??t.renderChildren([e]);if(r!=null){let n=r.split(` 249`).map(e=>e?t.indent(e):t.indent(``)).join(` 250`);s+=e.type===`paragraph`?` 251 252${n}`:` 253${n}`}}),s}function GS(e,t){let n={...e};return FS(e)&&FS(t)&&Object.keys(t).forEach(r=>{FS(t[r])&&FS(e[r])?n[r]=GS(e[r],t[r]):n[r]=t[r]}),n}function KS(e,t,n={}){let{state:r}=t,{doc:i,tr:a}=r,o=e;i.descendants((t,r)=>{let i=a.mapping.map(r),s=a.mapping.map(r)+t.nodeSize,c=null;if(t.marks.forEach(e=>{if(e!==o)return!1;c=e}),!c)return;let l=!1;if(Object.keys(n).forEach(e=>{n[e]!==c.attrs[e]&&(l=!0)}),l){let t=e.type.create({...e.attrs,...n});a.removeMark(i,s,e.type),a.addMark(i,s,t)}}),a.docChanged&&t.view.dispatch(a)}var qS=class{constructor(e){this.find=e.find,this.handler=e.handler,this.undoable=e.undoable??!0}},JS=(e,t)=>{if(db(t))return t.exec(e);let n=t(e);if(!n)return null;let r=[n.text];return r.index=n.index,r.input=e,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn(`[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".`),r.push(n.replaceWith)),r};function YS(e){let{editor:t,from:n,to:r,text:i,rules:a,plugin:o}=e,{view:s}=t;if(s.composing)return!1;let c=s.state.doc.resolve(n);if(c.parent.type.spec.code||(c.nodeBefore||c.nodeAfter)?.marks.find(e=>e.type.spec.code))return!1;let l=!1,u=Gx(c)+i;return a.forEach(e=>{if(l)return;let a=JS(u,e.find);if(!a)return;let c=s.state.tr,d=Ky({state:s.state,transaction:c}),f={from:n-(a[0].length-i.length),to:r},{commands:p,chain:m,can:h}=new qy({editor:t,state:d});e.handler({state:d,range:f,match:a,commands:p,chain:m,can:h})===null||!c.steps.length||(e.undoable&&c.setMeta(o,{transform:c,from:n,to:r,text:i}),s.dispatch(c),l=!0)}),l}function XS(e){let{editor:t,rules:n}=e,r=new dm({state:{init(){return null},apply(e,i,a){let o=e.getMeta(r);if(o)return o;let s=e.getMeta(`applyInputRules`);return s&&setTimeout(()=>{let{text:e}=s;e=typeof e==`string`?e:hx(G.from(e),a.schema);let{from:i}=s;YS({editor:t,from:i,to:i+e.length,text:e,rules:n,plugin:r})}),e.selectionSet||e.docChanged?null:i}},props:{handleTextInput(e,i,a,o){return YS({editor:t,from:i,to:a,text:o,rules:n,plugin:r})},handleDOMEvents:{compositionend:e=>(setTimeout(()=>{let{$cursor:i}=e.state.selection;i&&YS({editor:t,from:i.pos,to:i.pos,text:``,rules:n,plugin:r})}),!1)},handleKeyDown(e,i){if(i.key!==`Enter`)return!1;let{$cursor:a}=e.state.selection;return a?YS({editor:t,from:a.pos,to:a.pos,text:` 254`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}var ZS=class{constructor(e={}){this.type=`extendable`,this.parent=null,this.child=null,this.name=``,this.config={name:this.name},this.config={...this.config,...e},this.name=this.config.name}get options(){return{..._x(Z(this,`addOptions`,{name:this.name}))}}get storage(){return{..._x(Z(this,`addStorage`,{name:this.name,options:this.options}))}}configure(e={}){let t=this.extend({...this.config,addOptions:()=>GS(this.options,e)});return t.name=this.name,t.parent=this.parent,this.child=null,t}extend(e={}){let t=new this.constructor({...this.config,...e});return t.parent=this,this.child=t,t.name=`name`in e?e.name:t.parent.name,t}},QS=class e extends ZS{constructor(){super(...arguments),this.type=`mark`}static create(t={}){return new e(typeof t==`function`?t():t)}static handleExit({editor:e,mark:t}){let{tr:n}=e.state,r=e.state.selection.$from;if(r.pos===r.end()){let i=r.marks();if(!i.find(e=>e?.type.name===t.name))return!1;let a=i.find(e=>e?.type.name===t.name);return a&&n.removeStoredMark(a),n.insertText(` `,r.pos),e.view.dispatch(n),!0}return!1}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}},$S=class{constructor(e){this.find=e.find,this.handler=e.handler}},eC=(e,t,n)=>{if(db(t))return[...e.matchAll(t)];let r=t(e,n);return r?r.map(t=>{let n=[t.text];return n.index=t.index,n.input=e,n.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn(`[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".`),n.push(t.replaceWith)),n}):[]};function tC(e){let{editor:t,state:n,from:r,to:i,rule:a,pasteEvent:o,dropEvent:s}=e,{commands:c,chain:l,can:u}=new qy({editor:t,state:n}),d=[];return n.doc.nodesBetween(r,i,(e,t)=>{if(e.type?.spec?.code||!(e.isText||e.isTextblock||e.isInline))return;let f=e.content?.size??e.nodeSize??0,p=Math.max(r,t),m=Math.min(i,t+f);p>=m||eC(e.isText?e.text||``:e.textBetween(p-t,m-t,void 0,``),a.find,o).forEach(e=>{if(e.index===void 0)return;let t=p+e.index+1,r=t+e[0].length,i={from:n.tr.mapping.map(t),to:n.tr.mapping.map(r)},f=a.handler({state:n,range:i,match:e,commands:c,chain:l,can:u,pasteEvent:o,dropEvent:s});d.push(f)})}),d.every(e=>e!==null)}var nC=null,rC=e=>{var t;let n=new ClipboardEvent(`paste`,{clipboardData:new DataTransfer});return(t=n.clipboardData)==null||t.setData(`text/html`,e),n};function iC(e){let{editor:t,rules:n}=e,r=null,i=!1,a=!1,o=typeof ClipboardEvent<`u`?new ClipboardEvent(`paste`):null,s;try{s=typeof DragEvent<`u`?new DragEvent(`drop`):null}catch{s=null}let c=({state:e,from:n,to:r,rule:i,pasteEvt:a})=>{let c=e.tr;if(!(!tC({editor:t,state:Ky({state:e,transaction:c}),from:Math.max(n-1,0),to:r.b-1,rule:i,pasteEvent:a,dropEvent:s})||!c.steps.length)){try{s=typeof DragEvent<`u`?new DragEvent(`drop`):null}catch{s=null}return o=typeof ClipboardEvent<`u`?new ClipboardEvent(`paste`):null,c}};return n.map(e=>new dm({view(e){let n=n=>{r=e.dom.parentElement?.contains(n.target)?e.dom.parentElement:null,r&&(nC=t)},i=()=>{nC&&=null};return window.addEventListener(`dragstart`,n),window.addEventListener(`dragend`,i),{destroy(){window.removeEventListener(`dragstart`,n),window.removeEventListener(`dragend`,i)}}},props:{handleDOMEvents:{drop:(e,t)=>{if(a=r===e.dom.parentElement,s=t,!a){let e=nC;e?.isEditable&&setTimeout(()=>{let t=e.state.selection;t&&e.commands.deleteRange({from:t.from,to:t.to})},10)}return!1},paste:(e,t)=>{let n=t.clipboardData?.getData(`text/html`);return o=t,i=!!n?.includes(`data-pm-slice`),!1}}},appendTransaction:(t,n,r)=>{let s=t[0],l=s.getMeta(`uiEvent`)===`paste`&&!i,u=s.getMeta(`uiEvent`)===`drop`&&!a,d=s.getMeta(`applyPasteRules`),f=!!d;if(!l&&!u&&!f)return;if(f){let{text:t}=d;t=typeof t==`string`?t:hx(G.from(t),r.schema);let{from:n}=d,i=n+t.length,a=rC(t);return c({rule:e,state:r,from:n,to:{b:i},pasteEvt:a})}let p=n.doc.content.findDiffStart(r.doc.content),m=n.doc.content.findDiffEnd(r.doc.content);if(!(!NS(p)||!m||p===m.b))return c({rule:e,state:r,from:p,to:m,pasteEvt:o})}}))}var aC=class{constructor(e,t){this.splittableMarks=[],this.nonClearableMarks=[],this.editor=t,this.baseExtensions=e,this.extensions=Mx(e),this.schema=kx(this.extensions,t),this.setupExtensions()}get commands(){return this.extensions.reduce((e,t)=>{let n=Z(t,`addCommands`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:Ux(t.name,this.schema)});return n?{...e,...n()}:e},{})}get plugins(){let{editor:e}=this;return jx([...this.extensions].reverse()).flatMap(t=>{let n={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:Ux(t.name,this.schema)},r=[],i=Z(t,`addKeyboardShortcuts`,n),a={};if(t.type===`mark`&&Z(t,`exitable`,n)&&(a.ArrowRight=()=>QS.handleExit({editor:e,mark:t})),i){let t=Object.fromEntries(Object.entries(i()).map(([t,n])=>[t,()=>n({editor:e})]));a={...a,...t}}let o=By(a);r.push(o);let s=Z(t,`addInputRules`,n);if(Xx(t,e.options.enableInputRules)&&s){let t=s();if(t&&t.length){let n=XS({editor:e,rules:t}),i=Array.isArray(n)?n:[n];r.push(...i)}}let c=Z(t,`addPasteRules`,n);if(Xx(t,e.options.enablePasteRules)&&c){let t=c();if(t&&t.length){let n=iC({editor:e,rules:t});r.push(...n)}}let l=Z(t,`addProseMirrorPlugins`,n);if(l){let e=l();r.push(...e)}return r})}get attributes(){return bx(this.extensions)}get nodeViews(){let{editor:e}=this,{nodeExtensions:t}=yx(this.extensions);return Object.fromEntries(t.filter(e=>!!Z(e,`addNodeView`)).map(t=>{let n=this.attributes.filter(e=>e.type===t.name),r=Z(t,`addNodeView`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:nb(t.name,this.schema)});if(!r)return[];let i=r();return i?[t.name,(r,a,o,s,c)=>i({node:r,view:a,getPos:o,decorations:s,innerDecorations:c,editor:e,extension:t,HTMLAttributes:wx(r,n)})]:[]}))}dispatchTransaction(e){let{editor:t}=this;return jx([...this.extensions].reverse()).reduceRight((e,n)=>{let r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:Ux(n.name,this.schema)},i=Z(n,`dispatchTransaction`,r);return i?t=>{i.call(r,{transaction:t,next:e})}:e},e)}transformPastedHTML(e){let{editor:t}=this;return jx([...this.extensions]).reduce((e,n)=>{let r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:Ux(n.name,this.schema)},i=Z(n,`transformPastedHTML`,r);return i?(t,n)=>{let a=e(t,n);return i.call(r,a)}:e},e||(e=>e))}get markViews(){let{editor:e}=this,{markExtensions:t}=yx(this.extensions);return Object.fromEntries(t.filter(e=>!!Z(e,`addMarkView`)).map(t=>{let n=this.attributes.filter(e=>e.type===t.name),r=Z(t,`addMarkView`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:gb(t.name,this.schema)});return r?[t.name,(i,a,o)=>{let s=wx(i,n);return r()({mark:i,view:a,inline:o,editor:e,extension:t,HTMLAttributes:s,updateAttributes:t=>{KS(i,e,t)}})}]:[]}))}destroy(){this.extensions.forEach(e=>{let t=e;for(;t.parent;){let e=t.parent;e.child===t&&(e.child=null),t=e}}),this.extensions=[],this.baseExtensions=[],this.schema=null,this.editor=null}setupExtensions(){let e=this.extensions;this.editor.extensionStorage=Object.fromEntries(e.map(e=>[e.name,e.storage])),e.forEach(e=>{let t={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:Ux(e.name,this.schema)};e.type===`mark`&&((_x(Z(e,`keepOnSplit`,t))??!0)&&this.splittableMarks.push(e.name),(_x(Z(e,`clearable`,t))??!0)||this.nonClearableMarks.push(e.name));let n=Z(e,`onBeforeCreate`,t),r=Z(e,`onCreate`,t),i=Z(e,`onUpdate`,t),a=Z(e,`onSelectionUpdate`,t),o=Z(e,`onTransaction`,t),s=Z(e,`onFocus`,t),c=Z(e,`onBlur`,t),l=Z(e,`onDestroy`,t);n&&this.editor.on(`beforeCreate`,n),r&&this.editor.on(`create`,r),i&&this.editor.on(`update`,i),a&&this.editor.on(`selectionUpdate`,a),o&&this.editor.on(`transaction`,o),s&&this.editor.on(`focus`,s),c&&this.editor.on(`blur`,c),l&&this.editor.on(`destroy`,l)})}};aC.resolve=Mx,aC.sort=jx,aC.flatten=mx,Gy({},{ClipboardTextSerializer:()=>sC,Commands:()=>cC,Delete:()=>lC,Drop:()=>uC,Editable:()=>dC,FocusEvents:()=>pC,Keymap:()=>mC,Paste:()=>hC,Tabindex:()=>gC,TextDirection:()=>_C,focusEventsPluginKey:()=>fC});var oC=class e extends ZS{constructor(){super(...arguments),this.type=`extension`}static create(t={}){return new e(typeof t==`function`?t():t)}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}},sC=oC.create({name:`clipboardTextSerializer`,addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new dm({key:new mm(`clipboardTextSerializer`),props:{clipboardTextSerializer:()=>{let{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:i}=t,a=Fx(n),{blockSeparator:o}=this.options,s={...o===void 0?{}:{blockSeparator:o},textSerializers:a};return[...i.ranges].sort((e,t)=>e.$from.pos-t.$from.pos).map(({$from:e,$to:t})=>Nx(r,{from:e.pos,to:t.pos},s)).join(o??` 255 256`)}}})]}}),cC=oC.create({name:`commands`,addCommands(){return{...Jy}}}),lC=oC.create({name:`delete`,onUpdate({transaction:e,appendedTransactions:t}){let n=()=>{var n;if(((n=this.editor.options.coreExtensionOptions?.delete)?.filterTransaction)?.call(n,e)??e.getMeta(`y-sync$`))return;let r=lx(e.before,[e,...t]);Bx(r).forEach(t=>{r.mapping.mapResult(t.oldRange.from).deletedAfter&&r.mapping.mapResult(t.oldRange.to).deletedBefore&&r.before.nodesBetween(t.oldRange.from,t.oldRange.to,(n,i)=>{let a=i+n.nodeSize-2,o=t.oldRange.from<=i&&a<=t.oldRange.to;this.editor.emit(`delete`,{type:`node`,node:n,from:i,to:a,newFrom:r.mapping.map(i),newTo:r.mapping.map(a),deletedRange:t.oldRange,newRange:t.newRange,partial:!o,editor:this.editor,transaction:e,combinedTransform:r})})});let i=r.mapping;r.steps.forEach((t,n)=>{if(t instanceof Yf){let a=i.slice(n).map(t.from,-1),o=i.slice(n).map(t.to),s=i.invert().map(a,-1),c=i.invert().map(o),l=a>0?r.doc.nodeAt(a-1)?.marks.some(e=>e.eq(t.mark)):!1,u=r.doc.nodeAt(o)?.marks.some(e=>e.eq(t.mark));this.editor.emit(`delete`,{type:`mark`,mark:t.mark,from:t.from,to:t.to,deletedRange:{from:s,to:c},newRange:{from:a,to:o},partial:!!(u||l),editor:this.editor,transaction:e,combinedTransform:r})}})};this.editor.options.coreExtensionOptions?.delete?.async??!0?setTimeout(n,0):n()}}),uC=oC.create({name:`drop`,addProseMirrorPlugins(){return[new dm({key:new mm(`tiptapDrop`),props:{handleDrop:(e,t,n,r)=>{this.editor.emit(`drop`,{editor:this.editor,event:t,slice:n,moved:r})}}})]}}),dC=oC.create({name:`editable`,addProseMirrorPlugins(){return[new dm({key:new mm(`editable`),props:{editable:()=>this.editor.options.editable}})]}}),fC=new mm(`focusEvents`),pC=oC.create({name:`focusEvents`,addProseMirrorPlugins(){let{editor:e}=this;return[new dm({key:fC,props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;let r=e.state.tr.setMeta(`focus`,{event:n}).setMeta(`addToHistory`,!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;let r=e.state.tr.setMeta(`blur`,{event:n}).setMeta(`addToHistory`,!1);return t.dispatch(r),!1}}}})]}}),mC=oC.create({name:`keymap`,addKeyboardShortcuts(){let e=()=>this.editor.commands.first(({commands:e})=>[()=>e.undoInputRule(),()=>e.command(({tr:t})=>{let{selection:n,doc:r}=t,{empty:i,$anchor:a}=n,{pos:o,parent:s}=a,c=a.parent.isTextblock&&o>0?t.doc.resolve(o-1):a,l=c.parent.type.spec.isolating,u=a.pos-a.parentOffset,d=l&&c.parent.childCount===1?u===a.pos:J.atStart(r).from===o;return!i||!s.type.isTextblock||s.textContent.length||!d||d&&a.parent.type.name===`paragraph`?!1:e.clearNodes()}),()=>e.deleteSelection(),()=>e.joinBackward(),()=>e.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:e})=>[()=>e.deleteSelection(),()=>e.deleteCurrentNode(),()=>e.joinForward(),()=>e.selectNodeForward()]),n={Enter:()=>this.editor.commands.first(({commands:e})=>[()=>e.newlineInCode(),()=>e.createParagraphNear(),()=>e.liftEmptyBlock(),()=>e.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},r={...n},i={...n,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Cb()||Hb()?i:r},addProseMirrorPlugins(){return[new dm({key:new mm(`clearDocument`),appendTransaction:(e,t,n)=>{if(e.some(e=>e.getMeta(`composition`)))return;let r=e.some(e=>e.docChanged)&&!t.doc.eq(n.doc),i=e.some(e=>e.getMeta(`preventClearDocument`));if(!r||i)return;let{empty:a,from:o,to:s}=t.selection,c=J.atStart(t.doc).from,l=J.atEnd(t.doc).to;
256if(a||!(o===c&&s===l)||!Qx(n.doc))return;let u=n.tr,d=Ky({state:n,transaction:u}),{commands:f}=new qy({editor:this.editor,state:d});if(f.clearNodes(),u.steps.length)return u}})]}}),hC=oC.create({name:`paste`,addProseMirrorPlugins(){return[new dm({key:new mm(`tiptapPaste`),props:{handlePaste:(e,t,n)=>{this.editor.emit(`paste`,{editor:this.editor,event:t,slice:n})}}})]}}),gC=oC.create({name:`tabindex`,addOptions(){return{value:void 0}},addProseMirrorPlugins(){return[new dm({key:new mm(`tabindex`),props:{attributes:()=>!this.editor.isEditable&&this.options.value===void 0?{}:{tabindex:this.options.value??`0`}}})]}}),_C=oC.create({name:`textDirection`,addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];let{nodeExtensions:e}=yx(this.extensions);return[{types:e.filter(e=>e.name!==`text`).map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{let t=e.getAttribute(`dir`);return t&&(t===`ltr`||t===`rtl`||t===`auto`)?t:this.options.direction},renderHTML:e=>e.dir?{dir:e.dir}:{}}}}]},addProseMirrorPlugins(){return[new dm({key:new mm(`textDirection`),props:{attributes:()=>{let e=this.options.direction;return e?{dir:e}:{}}}})]}}),vC=class e{constructor(e,t,n=!1,r=null){this.currentNode=null,this.actualDepth=null,this.isBlock=n,this.resolvedPos=e,this.editor=t,this.currentNode=r}get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){return this.actualDepth??this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let t=this.from,n=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can\u2019t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}t=this.from+1,n=this.to-1}this.editor.commands.insertContentAt({from:t,to:n},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+ +!this.node.isText}get parent(){if(this.depth===0)return null;let t=this.resolvedPos.start(this.resolvedPos.depth-1);return new e(this.resolvedPos.doc.resolve(t),this.editor)}get before(){let t=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.from-3)),new e(t,this.editor)}get after(){let t=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.to+3)),new e(t,this.editor)}get children(){let t=[];return this.node.content.forEach((n,r)=>{let i=n.isBlock&&!n.isTextblock,a=n.isAtom&&!n.isText,o=n.isInline,s=this.pos+r+ +!a;if(s<0||s>this.resolvedPos.doc.nodeSize-2)return;let c=this.resolvedPos.doc.resolve(s);if(!i&&!o&&c.depth<=this.depth)return;let l=new e(c,this.editor,i,i||o?n:null);i&&(l.actualDepth=this.depth+1),t.push(l)}),t}get firstChild(){return this.children[0]||null}get lastChild(){let e=this.children;return e[e.length-1]||null}closest(e,t={}){let n=null,r=this.parent;for(;r&&!n;){if(r.node.type.name===e)if(Object.keys(t).length>0){let e=r.node.attrs,n=Object.keys(t);for(let r=0;r<n.length;r+=1){let i=n[r];if(e[i]!==t[i])break}}else n=r;r=r.parent}return n}querySelector(e,t={}){return this.querySelectorAll(e,t,!0)[0]||null}querySelectorAll(e,t={},n=!1){let r=[];if(!this.children||this.children.length===0)return r;let i=Object.keys(t);return this.children.forEach(a=>{n&&r.length>0||(a.node.type.name===e&&i.every(e=>t[e]===a.node.attrs[e])&&r.push(a),!(n&&r.length>0)&&(r=r.concat(a.querySelectorAll(e,t,n))))}),r}setAttribute(e){let{tr:t}=this.editor.state;t.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(t)}},yC=`.ProseMirror { 257 position: relative; 258} 259 260.ProseMirror { 261 word-wrap: break-word; 262 white-space: pre-wrap; 263 white-space: break-spaces; 264 -webkit-font-variant-ligatures: none; 265 font-variant-ligatures: none; 266 font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */ 267} 268 269.ProseMirror [contenteditable="false"] { 270 white-space: normal; 271} 272 273.ProseMirror [contenteditable="false"] [contenteditable="true"] { 274 white-space: pre-wrap; 275} 276 277.ProseMirror pre { 278 white-space: pre-wrap; 279} 280 281img.ProseMirror-separator { 282 display: inline !important; 283 border: none !important; 284 margin: 0 !important; 285 width: 0 !important; 286 height: 0 !important; 287} 288 289.ProseMirror-gapcursor { 290 display: none; 291 pointer-events: none; 292 position: absolute; 293 margin: 0; 294} 295 296.ProseMirror-gapcursor:after {
297 content: ""; 298 display: block; 299 position: absolute; 300 top: -2px; 301 width: 20px; 302 border-top: 1px solid black; 303 animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite; 304} 305 306@keyframes ProseMirror-cursor-blink { 307 to { 308 visibility: hidden; 309 } 310} 311 312.ProseMirror-hideselection *::selection { 313 background: transparent; 314} 315 316.ProseMirror-hideselection *::-moz-selection { 317 background: transparent; 318} 319 320.ProseMirror-hideselection * { 321 caret-color: transparent; 322} 323 324.ProseMirror-focused .ProseMirror-gapcursor { 325 display: block; 326}`,bC=class extends AS{constructor(e={}){super(),this.css=null,this.className=`tiptap`,this.editorView=null,this.isFocused=!1,this.destroyed=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.options={element:typeof document<`u`?document.createElement(`div`):null,content:``,injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:e})=>{throw e},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:tS,createMappablePosition:nS},this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on(`beforeCreate`,this.options.onBeforeCreate),this.emit(`beforeCreate`,{editor:this}),this.on(`mount`,this.options.onMount),this.on(`unmount`,this.options.onUnmount),this.on(`contentError`,this.options.onContentError),this.on(`create`,this.options.onCreate),this.on(`update`,this.options.onUpdate),this.on(`selectionUpdate`,this.options.onSelectionUpdate),this.on(`transaction`,this.options.onTransaction),this.on(`focus`,this.options.onFocus),this.on(`blur`,this.options.onBlur),this.on(`destroy`,this.options.onDestroy),this.on(`drop`,({event:e,slice:t,moved:n})=>this.options.onDrop(e,t,n)),this.on(`paste`,({event:e,slice:t})=>this.options.onPaste(e,t)),this.on(`delete`,this.options.onDelete);let t=this.createDoc(),n=xb(t,this.options.autofocus);this.editorState=lm.create({doc:t,schema:this.schema,selection:n||void 0}),this.options.element&&this.mount(this.options.element)}mount(e){if(typeof document>`u`)throw Error(`[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.`);this.createView(e),this.emit(`mount`,{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.options.autofocus!==!1&&this.options.autofocus!==null&&this.commands.focus(this.options.autofocus),this.emit(`create`,{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){let e=this.editorView.dom;e?.editor&&delete e.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{typeof this.css.remove==`function`?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(e){console.warn(`Failed to remove CSS element:`,e)}this.css=null,this.emit(`unmount`,{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&typeof document<`u`&&(this.css=MS(yC,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},!(!this.editorView||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,t=!0){this.setOptions({editable:e}),t&&this.emit(`update`,{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:e=>{this.editorState=e},dispatch:e=>{this.dispatchTransaction(e)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(e,t)=>{if(this.editorView)return this.editorView[t];if(t===`state`)return this.editorState;if(t in e)return Reflect.get(e,t);throw Error(`[tiptap error]: The editor view is not available. Cannot access view['${t}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(e,t){let n=gx(t)?t(e,[...this.state.plugins]):[...this.state.plugins,e],r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}unregisterPlugin(e){if(this.isDestroyed)return;let t=this.state.plugins,n=t;
326if([].concat(e).forEach(e=>{let t=typeof e==`string`?`${e}$`:e.key;n=n.filter(e=>!e.key.startsWith(t))}),t.length===n.length)return;let r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}createExtensionManager(){let e=[...this.options.enableCoreExtensions?[dC,sC.configure({blockSeparator:this.options.coreExtensionOptions?.clipboardTextSerializer?.blockSeparator}),cC,pC,mC,gC.configure({value:this.options.coreExtensionOptions?.tabindex?.value}),uC,hC,lC,_C.configure({direction:this.options.textDirection})].filter(e=>typeof this.options.enableCoreExtensions==`object`?this.options.enableCoreExtensions[e.name]!==!1:!0):[],...this.options.extensions].filter(e=>[`extension`,`node`,`mark`].includes(e?.type));this.extensionManager=new aC(e,this)}createCommandManager(){this.commandManager=new qy({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let e;try{e=ox(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(t){if(!(t instanceof Error)||![`[tiptap error]: Invalid JSON content`,`[tiptap error]: Invalid HTML content`].includes(t.message))throw t;this.emit(`contentError`,{editor:this,error:t,disableCollaboration:()=>{`collaboration`in this.storage&&typeof this.storage.collaboration==`object`&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(e=>e.name!==`collaboration`),this.createExtensionManager()}}),e=ox(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return e}createView(e){let{editorProps:t,enableExtensionDispatchTransaction:n}=this.options,r=t.dispatchTransaction||this.dispatchTransaction.bind(this),i=n?this.extensionManager.dispatchTransaction(r):r,a=t.transformPastedHTML,o=this.extensionManager.transformPastedHTML(a);this.editorView=new by(e,{...t,attributes:{role:`textbox`,...t?.attributes},dispatchTransaction:i,transformPastedHTML:o,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});let s=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(s),this.prependClass(),this.injectCSS();let c=this.view.dom;c.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;let t=this.capturedTransaction;return this.capturedTransaction=null,t}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(e=>this.capturedTransaction?.step(e));return}let{state:t,transactions:n}=this.state.applyTransaction(e),r=!this.state.selection.eq(t.selection),i=n.includes(e),a=this.state;if(this.emit(`beforeTransaction`,{editor:this,transaction:e,nextState:t}),!i)return;this.view.updateState(t),this.emit(`transaction`,{editor:this,transaction:e,appendedTransactions:n.slice(1)}),r&&this.emit(`selectionUpdate`,{editor:this,transaction:e});let o=n.findLast(e=>e.getMeta(`focus`)||e.getMeta(`blur`)),s=o?.getMeta(`focus`),c=o?.getMeta(`blur`);s&&this.emit(`focus`,{editor:this,event:s.event,transaction:o}),c&&this.emit(`blur`,{editor:this,event:c.event,transaction:o}),!(e.getMeta(`preventUpdate`)||!n.some(e=>e.docChanged)||a.doc.eq(t.doc))&&this.emit(`update`,{editor:this,transaction:e,appendedTransactions:n.slice(1)})}getAttributes(e){return Lx(this.state,e)}isActive(e,t){let n=typeof e==`string`?e:null,r=typeof e==`string`?t:e;return qx(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return hx(this.state.doc.content,this.schema)}getText(e){let{blockSeparator:t=` 327 328`,textSerializers:n={}}=e||{};return Px(this.state.doc,{blockSeparator:t,textSerializers:{...Fx(this.schema),...n}})}get isEmpty(){return Qx(this.state.doc)}
328destroy(){this.destroyed||(this.destroyed=!0,this.emit(`destroy`),this.unmount(),this.removeAllListeners(),this.extensionManager.destroy(),this.extensionManager=null,this.schema=null,this.commandManager=null,this.extensionStorage={})}get isDestroyed(){return this.editorView?.isDestroyed??!0}$node(e,t){return this.$doc?.querySelector(e,t)||null}$nodes(e,t){return this.$doc?.querySelectorAll(e,t)||null}$pos(e){let t=this.state.doc.resolve(e),n=e>0&&t.nodeAfter&&!t.nodeAfter.isText?t.nodeAfter:null;return new vC(t,this,!1,n)}get $doc(){return this.$pos(0)}};function xC(e){return new qS({find:e.find,handler:({state:t,range:n,match:r})=>{let i=_x(e.getAttributes,void 0,r);if(i===!1||i===null)return null;let{tr:a}=t,o=r[r.length-1],s=r[0];if(o){let r=s.search(/\S/),c=n.from+s.indexOf(o),l=c+o.length;if(Vx(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>c).length)return null;l<n.to&&a.delete(l,n.to),c>n.from&&a.delete(n.from+r,c);let u=n.from+r+o.length;a.addMark(n.from+r,u,e.type.create(i||{})),a.removeStoredMark(e.type)}},undoable:e.undoable})}function SC(e){return new qS({find:e.find,handler:({state:t,range:n,match:r})=>{let i=_x(e.getAttributes,void 0,r)||{},{tr:a}=t,o=n.from,s=n.to,c=e.type.create(i);if(r[1]){let e=o+r[0].lastIndexOf(r[1]);e>s?e=s:s=e+r[1].length;let t=r[0][r[0].length-1];a.insertText(t,o+r[0].length-1),a.replaceWith(e,s,c)}else if(r[0]){let t=e.type.isInline?o:o-1;a.insert(t,e.type.create(i)).delete(a.mapping.map(o),a.mapping.map(s))}a.scrollIntoView()},undoable:e.undoable})}function CC(e){return new qS({find:e.find,handler:({state:t,range:n,match:r})=>{let i=t.doc.resolve(n.from),a=_x(e.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,a)},undoable:e.undoable})}function wC(e){return new qS({find:e.find,handler:({state:t,range:n,match:r,chain:i})=>{let a=_x(e.getAttributes,void 0,r)||{},o=t.tr.delete(n.from,n.to),s=o.doc.resolve(n.from).blockRange(),c=s&&sp(s,e.type,a);if(!c)return null;if(o.wrap(s,c),e.keepMarks&&e.editor){let{selection:n,storedMarks:r}=t,{splittableMarks:i}=e.editor.extensionManager,a=r||n.$to.parentOffset&&n.$from.marks();if(a){let e=a.filter(e=>i.includes(e.type.name));o.ensureMarks(e)}}if(e.keepAttributes){let t=e.type.name===`bulletList`||e.type.name===`orderedList`?`listItem`:`taskList`;i().updateAttributes(t,a).run()}let l=o.doc.resolve(n.from-1).nodeBefore;l&&l.type===e.type&&yp(o.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,l))&&o.join(n.from-1)},undoable:e.undoable})}var TC=e=>`touches`in e,EC=class{constructor(e){this.directions=[`bottom-left`,`bottom-right`,`top-left`,`top-right`],this.minSize={height:8,width:8},this.preserveAspectRatio=!1,this.classNames={container:``,wrapper:``,handle:``,resizing:``},this.initialWidth=0,this.initialHeight=0,this.aspectRatio=1,this.isResizing=!1,this.activeHandle=null,this.startX=0,this.startY=0,this.startWidth=0,this.startHeight=0,this.isShiftKeyPressed=!1,this.lastEditableState=void 0,this.handleMap=new Map,this.handleMouseMove=e=>{if(!this.isResizing||!this.activeHandle)return;let t=e.clientX-this.startX,n=e.clientY-this.startY;this.handleResize(t,n)},this.handleTouchMove=e=>{if(!this.isResizing||!this.activeHandle)return;let t=e.touches[0];if(!t)return;let n=t.clientX-this.startX,r=t.clientY-this.startY;this.handleResize(n,r)},this.handleMouseUp=()=>{if(!this.isResizing)return;let e=this.element.offsetWidth,t=this.element.offsetHeight;this.onCommit(e,t),this.isResizing=!1,this.activeHandle=null,this.container.dataset.resizeState=`false`,this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener(`mousemove`,this.handleMouseMove),document.removeEventListener(`mouseup`,this.handleMouseUp),document.removeEventListener(`keydown`,this.handleKeyDown),document.removeEventListener(`keyup`,this.handleKeyUp)},this.handleKeyDown=e=>{e.key===`Shift`&&(this.isShiftKeyPressed=!0)},this.handleKeyUp=e=>{e.key===`Shift`&&(this.isShiftKeyPressed=!1)},this.node=e.node,this.editor=e.editor,this.element=e.element,this.element.draggable=!1,this.contentElement=e.contentElement,this.getPos=e.getPos,this.onResize=e.onResize,this.onCommit=e.onCommit,this.onUpdate=e.onUpdate,e.options?.min&&(this.minSize={...this.minSize,...e.options.min}),e.options?.max&&(this.maxSize=e.options.max),e?.options?.directions&&(this.directions=e.options.directions),e.options?.preserveAspectRatio&&(this.preserveAspectRatio=e.options.preserveAspectRatio),e.options?.className&&(this.classNames={container:e.options.className.container||``,wrapper:e.options.className.wrapper||``,handle:e.options.className.handle||``,resizing:e.options.className.resizing||``}),e.options?.createCustomHandle&&(this.createCustomHandle=e.options.createCustomHandle),this.wrapper=this.createWrapper(),this.container=this.createContainer(),this.applyInitialSize(),this.attachHandles(),this.editor.on(`update`,this.handleEditorUpdate.bind(this))}get dom(){return this.container}get contentDOM(){return this.contentElement??null}handleEditorUpdate(){let e=this.editor.isEditable;e!==this.lastEditableState&&(this.lastEditableState=e,e?e&&this.handleMap.size===0&&this.attachHandles():this.removeHandles())}update(e,t,n){return e.type===this.node.type?(this.node=e,this.onUpdate?this.onUpdate(e,t,n):!0):!1}destroy(){this.isResizing&&(this.container.dataset.resizeState=`false`,this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener(`mousemove`,this.handleMouseMove),document.removeEventListener(`mouseup`,this.handleMouseUp),document.removeEventListener(`ke
328ydown`,this.handleKeyDown),document.removeEventListener(`keyup`,this.handleKeyUp),this.isResizing=!1,this.activeHandle=null),this.editor.off(`update`,this.handleEditorUpdate.bind(this)),this.container.remove()}createContainer(){let e=document.createElement(`div`);return e.dataset.resizeContainer=``,e.dataset.node=this.node.type.name,e.style.display=this.node.type.isInline?`inline-flex`:`flex`,this.classNames.container&&(e.className=this.classNames.container),e.appendChild(this.wrapper),e}createWrapper(){let e=document.createElement(`div`);return e.style.position=`relative`,e.style.display=`block`,e.dataset.resizeWrapper=``,this.classNames.wrapper&&(e.className=this.classNames.wrapper),e.appendChild(this.element),e}createHandle(e){let t=document.createElement(`div`);return t.dataset.resizeHandle=e,t.style.position=`absolute`,this.classNames.handle&&(t.className=this.classNames.handle),t}positionHandle(e,t){let n=t.includes(`top`),r=t.includes(`bottom`),i=t.includes(`left`),a=t.includes(`right`);n&&(e.style.top=`0`),r&&(e.style.bottom=`0`),i&&(e.style.left=`0`),a&&(e.style.right=`0`),(t===`top`||t===`bottom`)&&(e.style.left=`0`,e.style.right=`0`),(t===`left`||t===`right`)&&(e.style.top=`0`,e.style.bottom=`0`)}attachHandles(){this.directions.forEach(e=>{let t;t=this.createCustomHandle?this.createCustomHandle(e):this.createHandle(e),t instanceof HTMLElement||(console.warn(`[ResizableNodeView] createCustomHandle("${e}") did not return an HTMLElement. Falling back to default handle.`),t=this.createHandle(e)),this.createCustomHandle||this.positionHandle(t,e),t.addEventListener(`mousedown`,t=>this.handleResizeStart(t,e)),t.addEventListener(`touchstart`,t=>this.handleResizeStart(t,e)),this.handleMap.set(e,t),this.wrapper.appendChild(t)})}removeHandles(){this.handleMap.forEach(e=>e.remove()),this.handleMap.clear()}applyInitialSize(){let e=this.node.attrs.width,t=this.node.attrs.height;e?(this.element.style.width=`${e}px`,this.initialWidth=e):this.initialWidth=this.element.offsetWidth,t?(this.element.style.height=`${t}px`,this.initialHeight=t):this.initialHeight=this.element.offsetHeight,this.initialWidth>0&&this.initialHeight>0&&(this.aspectRatio=this.initialWidth/this.initialHeight)}handleResizeStart(e,t){e.preventDefault(),e.stopPropagation(),this.isResizing=!0,this.activeHandle=t,TC(e)?(this.startX=e.touches[0].clientX,this.startY=e.touches[0].clientY):(this.startX=e.clientX,this.startY=e.clientY),this.startWidth=this.element.offsetWidth,this.startHeight=this.element.offsetHeight,this.startWidth>0&&this.startHeight>0&&(this.aspectRatio=this.startWidth/this.startHeight),this.getPos(),this.container.dataset.resizeState=`true`,this.classNames.resizing&&this.container.classList.add(this.classNames.resizing),document.addEventListener(`mousemove`,this.handleMouseMove),document.addEventListener(`touchmove`,this.handleTouchMove),document.addEventListener(`mouseup`,this.handleMouseUp),document.addEventListener(`keydown`,this.handleKeyDown),document.addEventListener(`keyup`,this.handleKeyUp)}handleResize(e,t){if(!this.activeHandle)return;let n=this.preserveAspectRatio||this.isShiftKeyPressed,{width:r,height:i}=this.calculateNewDimensions(this.activeHandle,e,t),a=this.applyConstraints(r,i,n);this.element.style.width=`${a.width}px`,this.element.style.height=`${a.height}px`,this.onResize&&this.onResize(a.width,a.height)}calculateNewDimensions(e,t,n){let r=this.startWidth,i=this.startHeight,a=e.includes(`right`),o=e.includes(`left`),s=e.includes(`bottom`),c=e.includes(`top`);return a?r=this.startWidth+t:o&&(r=this.startWidth-t),s?i=this.startHeight+n:c&&(i=this.startHeight-n),(e===`right`||e===`left`)&&(r=this.startWidth+(a?t:-t)),(e===`top`||e===`bottom`)&&(i=this.startHeight+(s?n:-n)),this.preserveAspectRatio||this.isShiftKeyPressed?this.applyAspectRatio(r,i,e):{width:r,height:i}}applyConstraints(e,t,n){if(!n){let n=Math.max(this.minSize.width,e),r=Math.max(this.minSize.height,t);return this.maxSize?.width&&(n=Math.min(this.maxSize.width,n)),this.maxSize?.height&&(r=Math.min(this.maxSize.height,r)),{width:n,height:r}}let r=e,i=t;return r<this.minSize.width&&(r=this.minSize.width,i=r/this.aspectRatio),i<this.minSize.height&&(i=this.minSize.height,r=i*this.aspectRatio),this.maxSize?.width&&r>this.maxSize.width&&(r=this.maxSize.width,i=r/this.aspectRatio),this.maxSize?.height&&i>this.maxSize.height&&(i=this.maxSize.height,r=i*this.aspectRatio),{width:r,height:i}}applyAspectRatio(e,t,n){return n===`left`||n===`right`?{width:e,height:e/this.aspectRatio}:n===`top`||n===`bottom`?{width:t*this.aspectRatio,height:t}:{width:e,height:e/this.aspectRatio}}},DC=class e extends ZS{constructor(){super(...arguments),this.type=`node`}static create(t={}){return new e(typeof t==`function`?t():t)}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}};function OC(e){return new $S({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:i})=>{let a=_x(e.getAttributes,void 0,r,i);if(a===!1||a===null)return null;let{tr:o}=t,s=r[r.length-1],c=r[0],l=n.to;if(s){let i=c.search(/\S/),u=n.from+c.indexOf(s),d=u+s.length;if(Vx(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>u).length)return null;
328d<n.to&&o.delete(d,n.to),u>n.from&&o.delete(n.from+i,u),l=n.from+i+s.length,o.addMark(n.from+i,l,e.type.create(a||{})),r.index!==void 0&&r.input!==void 0&&r.index+r[0].length>=r.input.length||o.removeStoredMark(e.type)}}})}var{getOwnPropertyNames:kC,getOwnPropertySymbols:AC}=Object,{hasOwnProperty:jC}=Object.prototype;function MC(e,t){return function(n,r,i){return e(n,r,i)&&t(n,r,i)}}function NC(e){return function(t,n,r){if(!t||!n||typeof t!=`object`||typeof n!=`object`)return e(t,n,r);let{cache:i}=r,a=i.get(t),o=i.get(n);if(a&&o)return a===n&&o===t;i.set(t,n),i.set(n,t);let s=e(t,n,r);return i.delete(t),i.delete(n),s}}function PC(e){return e?.[Symbol.toStringTag]}function FC(e){return kC(e).concat(AC(e))}var IC=Object.hasOwn||((e,t)=>jC.call(e,t));function LC(e,t){return e===t||!e&&!t&&e!==e&&t!==t}var RC=`__v`,zC=`__o`,BC=`_owner`,{getOwnPropertyDescriptor:VC,keys:HC}=Object;function UC(e,t){return e.byteLength===t.byteLength&&nw(new Uint8Array(e),new Uint8Array(t))}function WC(e,t,n){let r=e.length;if(t.length!==r)return!1;for(;r-->0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function GC(e,t){return e.byteLength===t.byteLength&&nw(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function KC(e,t){return LC(e.getTime(),t.getTime())}function qC(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function JC(e,t){return e===t}function YC(e,t,n){let r=e.size;if(r!==t.size)return!1;if(!r)return!0;let i=Array(r),a=e.entries(),o,s,c=0;for(;(o=a.next())&&!o.done;){let r=t.entries(),a=!1,l=0;for(;(s=r.next())&&!s.done;){if(i[l]){l++;continue}let r=o.value,u=s.value;if(n.equals(r[0],u[0],c,l,e,t,n)&&n.equals(r[1],u[1],r[0],u[0],e,t,n)){a=i[l]=!0;break}l++}if(!a)return!1;c++}return!0}var XC=LC;function ZC(e,t,n){let r=HC(e),i=r.length;if(HC(t).length!==i)return!1;for(;i-->0;)if(!iw(e,t,n,r[i]))return!1;return!0}function QC(e,t,n){let r=FC(e),i=r.length;if(FC(t).length!==i)return!1;let a,o,s;for(;i-->0;)if(a=r[i],!iw(e,t,n,a)||(o=VC(e,a),s=VC(t,a),(o||s)&&(!o||!s||o.configurable!==s.configurable||o.enumerable!==s.enumerable||o.writable!==s.writable)))return!1;return!0}function $C(e,t){return LC(e.valueOf(),t.valueOf())}function ew(e,t){return e.source===t.source&&e.flags===t.flags}function tw(e,t,n){let r=e.size;if(r!==t.size)return!1;if(!r)return!0;let i=Array(r),a=e.values(),o,s;for(;(o=a.next())&&!o.done;){let r=t.values(),a=!1,c=0;for(;(s=r.next())&&!s.done;){if(!i[c]&&n.equals(o.value,s.value,o.value,s.value,e,t,n)){a=i[c]=!0;break}c++}if(!a)return!1}return!0}function nw(e,t){let n=e.byteLength;if(t.byteLength!==n||e.byteOffset!==t.byteOffset)return!1;for(;n-->0;)if(e[n]!==t[n])return!1;return!0}function rw(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function iw(e,t,n,r){return(r===BC||r===zC||r===RC)&&(e.$$typeof||t.$$typeof)?!0:IC(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}var aw=`[object ArrayBuffer]`,ow=`[object Arguments]`,sw=`[object Boolean]`,cw=`[object DataView]`,lw=`[object Date]`,uw=`[object Error]`,dw=`[object Map]`,fw=`[object Number]`,pw=`[object Object]`,mw=`[object RegExp]`,hw=`[object Set]`,gw=`[object String]`,_w={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},vw=`[object URL]`,yw=Object.prototype.toString;function bw({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:i,areFunctionsEqual:a,areMapsEqual:o,areNumbersEqual:s,areObjectsEqual:c,arePrimitiveWrappersEqual:l,areRegExpsEqual:u,areSetsEqual:d,areTypedArraysEqual:f,areUrlsEqual:p,unknownTagComparators:m}){return function(h,g,_){if(h===g)return!0;if(h==null||g==null)return!1;let v=typeof h;if(v!==typeof g)return!1;if(v!==`object`)return v===`number`?s(h,g,_):v===`function`?a(h,g,_):!1;let y=h.constructor;if(y!==g.constructor)return!1;if(y===Object)return c(h,g,_);if(Array.isArray(h))return t(h,g,_);if(y===Date)return r(h,g,_);if(y===RegExp)return u(h,g,_);if(y===Map)return o(h,g,_);if(y===Set)return d(h,g,_);let b=yw.call(h);if(b===lw)return r(h,g,_);if(b===mw)return u(h,g,_);if(b===dw)return o(h,g,_);if(b===hw)return d(h,g,_);if(b===pw)return typeof h.then!=`function`&&typeof g.then!=`function`&&c(h,g,_);if(b===vw)return p(h,g,_);if(b===uw)return i(h,g,_);if(b===ow)return c(h,g,_);if(_w[b])return f(h,g,_);if(b===aw)return e(h,g,_);if(b===cw)return n(h,g,_);if(b===sw||b===fw||b===gw)return l(h,g,_);if(m){let e=m[b];if(!e){let t=PC(h);t&&(e=m[t])}if(e)return e(h,g,_)}return!1}}function xw({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:UC,areArraysEqual:n?QC:WC,areDataViewsEqual:GC,areDatesEqual:KC,areErrorsEqual:qC,areFunctionsEqual:JC,areMapsEqual:n?MC(YC,QC):YC,areNumbersEqual:XC,areObjectsEqual:n?QC:ZC,arePrimitiveWrappersEqual:$C,areRegExpsEqual:ew,areSetsEqual:n?MC(tw,QC):tw,areTypedArraysEqual:n?MC(nw,QC):nw,areUrlsEqual:rw,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){let e=NC(r.areArraysEqual),t=NC(r.areMapsEqual),n=NC(r.areObjectsEqual),i=NC(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:e,areMapsEqual:t,areObjectsEqual:n,areSetsEqual:i})}return r}function Sw(e){return function(t,n,r,i,a,o,s){return e(t,n,s)}}
328function Cw({circular:e,comparator:t,createState:n,equals:r,strict:i}){if(n)return function(a,o){let{cache:s=e?new WeakMap:void 0,meta:c}=n();return t(a,o,{cache:s,equals:r,meta:c,strict:i})};if(e)return function(e,n){return t(e,n,{cache:new WeakMap,equals:r,meta:void 0,strict:i})};let a={cache:void 0,equals:r,meta:void 0,strict:i};return function(e,n){return t(e,n,a)}}var ww=Tw();Tw({strict:!0}),Tw({circular:!0}),Tw({circular:!0,strict:!0}),Tw({createInternalComparator:()=>LC}),Tw({strict:!0,createInternalComparator:()=>LC}),Tw({circular:!0,createInternalComparator:()=>LC}),Tw({circular:!0,createInternalComparator:()=>LC,strict:!0});function Tw(e={}){let{circular:t=!1,createInternalComparator:n,createState:r,strict:i=!1}=e,a=bw(xw(e));return Cw({circular:t,comparator:a,createState:r,equals:n?n(a):Sw(a),strict:i})}var Ew=o((e=>{var t=u(),n=sd();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),Dw=o(((e,t)=>{t.exports=Ew()}))(),Ow=(...e)=>t=>{e.forEach(e=>{typeof e==`function`?e(t):e&&(e.current=t)})},kw=({contentComponent:e})=>{let t=(0,Uy.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getServerSnapshot);return(0,j.jsx)(j.Fragment,{children:Object.values(t)})};function Aw(){let e=new Set,t={};return{subscribe(t){return e.add(t),()=>{e.delete(t)}},getSnapshot(){return t},getServerSnapshot(){return t},setRenderer(n,r){t={...t,[n]:Hy.createPortal(r.reactElement,r.element,n)},e.forEach(e=>e())},removeRenderer(n){let r={...t};delete r[n],t=r,e.forEach(e=>e())}}}var jw=class extends _.Component{constructor(e){super(e),this.editorContentRef=_.createRef()}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){let e=this.props.editor;if(e&&!e.isDestroyed&&e.view.dom?.parentNode){if(e.contentComponent)return;let t=this.editorContentRef.current;t.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:t}),e.contentComponent=Aw(),e.createNodeViews(),e.isEditorContentInitialized=!0,this.forceUpdate()}}componentWillUnmount(){let e=this.props.editor;if(e){e.isEditorContentInitialized=!1,e.isDestroyed||e.view.setProps({nodeViews:{}}),e.contentComponent=null;try{if(!e.view.dom?.parentNode)return;let t=document.createElement(`div`);t.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:t})}catch{}}}render(){let{editor:e,innerRef:t,...n}=this.props;return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`div`,{ref:Ow(t,this.editorContentRef),...n}),e?.contentComponent&&(0,j.jsx)(kw,{contentComponent:e.contentComponent})]})}},Mw=(0,_.forwardRef)((e,t)=>{let n=_.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[e.editor]);return _.createElement(jw,{key:n,innerRef:t,...e})}),Nw=_.memo(Mw),Pw=typeof window<`u`?_.useLayoutEffect:_.useEffect,Fw=class{constructor(e){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=e,this.lastSnapshot={editor:e,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}watch(e){if(this.editor=e,this.editor){let e=()=>
328{this.transactionNumber+=1,this.subscribers.forEach(e=>e())},t=this.editor;return t.on(`transaction`,e),()=>{t.off(`transaction`,e)}}}};function Iw(e){let[t]=(0,_.useState)(()=>new Fw(e.editor)),n=(0,Dw.useSyncExternalStoreWithSelector)(t.subscribe,t.getSnapshot,t.getServerSnapshot,e.selector,e.equalityFn??ww);return Pw(()=>t.watch(e.editor),[e.editor,t]),(0,_.useDebugValue)(n),n}var Lw=!1,Rw=typeof window>`u`,zw=Rw||!!(typeof window<`u`&&window.next),Bw=class e{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId=``,this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(e=>e())}getInitialEditor(){let e=this.options.current.immediatelyRender,t=e??!0;return Rw?(t&&Lw&&console.warn("SSR detected. `immediatelyRender` has been set to false to avoid hydration mismatches"),t=!1):zw&&e===void 0&&(t=!1,Lw&&console.warn("Next.js detected. `immediatelyRender` defaults to false to avoid hydration mismatches. Pass `immediatelyRender: true` explicitly if you are rendering the editor only on the client.")),t?this.createEditor():null}createEditor(){return new bC({...this.options.current,onBeforeCreate:(...e)=>{var t;return(t=this.options.current).onBeforeCreate?.call(t,...e)},onBlur:(...e)=>{var t;return(t=this.options.current).onBlur?.call(t,...e)},onCreate:(...e)=>{var t;return(t=this.options.current).onCreate?.call(t,...e)},onDestroy:(...e)=>{var t;return(t=this.options.current).onDestroy?.call(t,...e)},onFocus:(...e)=>{var t;return(t=this.options.current).onFocus?.call(t,...e)},onSelectionUpdate:(...e)=>{var t;return(t=this.options.current).onSelectionUpdate?.call(t,...e)},onTransaction:(...e)=>{var t;return(t=this.options.current).onTransaction?.call(t,...e)},onUpdate:(...e)=>{var t;return(t=this.options.current).onUpdate?.call(t,...e)},onContentError:(...e)=>{var t;return(t=this.options.current).onContentError?.call(t,...e)},onDrop:(...e)=>{var t;return(t=this.options.current).onDrop?.call(t,...e)},onPaste:(...e)=>{var t;return(t=this.options.current).onPaste?.call(t,...e)},onDelete:(...e)=>{var t;return(t=this.options.current).onDelete?.call(t,...e)}})}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}static compareOptions(e,t){return Object.keys(e).every(n=>[`onCreate`,`onBeforeCreate`,`onDestroy`,`onUpdate`,`onTransaction`,`onFocus`,`onBlur`,`onSelectionUpdate`,`onContentError`,`onDrop`,`onPaste`].includes(n)?!0:n===`extensions`&&e.extensions&&t.extensions?e.extensions.length===t.extensions.length?e.extensions.every((e,n)=>e===t.extensions?.[n]):!1:e[n]===t[n])}onRender(t){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&t.length===0?e.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(t),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=e;return}if(this.previousDeps.length===e.length&&this.previousDeps.every((t,n)=>t===e[n]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){let e=this.instanceId,t=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===e){t&&t.setOptions(this.options.current);return}t&&!t.isDestroyed&&(t.destroy(),this.instanceId===e&&this.setEditor(null))}
328,1)}};function Vw(e={},t=[]){let n=(0,_.useRef)(e);n.current=e;let[r]=(0,_.useState)(()=>new Bw(n)),i=(0,Uy.useSyncExternalStore)(r.subscribe,r.getEditor,r.getServerSnapshot);return(0,_.useDebugValue)(i),(0,_.useEffect)(r.onRender(t)),Iw({editor:i,selector:({transactionNumber:t})=>e.shouldRerenderOnTransaction===!1||e.shouldRerenderOnTransaction===void 0?null:e.immediatelyRender&&t===0?0:t+1}),i}var Hw=(0,_.createContext)({editor:null});Hw.Consumer;var Uw=(0,_.createContext)({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),Ww=()=>(0,_.useContext)(Uw);_.forwardRef((e,t)=>{let{onDragStart:n}=Ww();return(0,j.jsx)(e.as||`div`,{...e,ref:t,"data-node-view-wrapper":``,onDragStart:n,style:{whiteSpace:`normal`,...e.style}})}),_.createContext({markViewContentRef:()=>{}});var Gw=(0,_.createContext)({get editor(){throw Error(`useTiptap must be used within a <Tiptap> provider`)}});Gw.displayName=`TiptapContext`;var Kw=()=>(0,_.useContext)(Gw);function qw({editor:e,instance:t,children:n}){let r=e??t;if(!r)throw Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");let i=(0,_.useMemo)(()=>({editor:r}),[r]),a=(0,_.useMemo)(()=>({editor:r}),[r]);return(0,j.jsx)(Hw.Provider,{value:a,children:(0,j.jsx)(Gw.Provider,{value:i,children:n})})}qw.displayName=`Tiptap`;function Jw({...e}){let{editor:t}=Kw();return(0,j.jsx)(Nw,{editor:t,...e})}Jw.displayName=`Tiptap.Content`,Object.assign(qw,{Content:Jw});var Yw=(e,t)=>{if(e===`slot`)return 0;if(e instanceof Function)return e(t);let{children:n,...r}=t??{};if(e===`svg`)throw Error(`SVG elements are not supported in the JSX syntax, use the array syntax instead`);return[e,r,n]};function Xw(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),a=t.child(r);if(i==a){n+=i.nodeSize;continue}if(!i.sameMarkup(a))return n;if(i.isText&&i.text!=a.text){for(let e=0;i.text[e]==a.text[e];e++)n++;return n}if(i.content.size||a.content.size){let e=Xw(i.content,a.content,n+1);if(e!=null)return e}n+=i.nodeSize}}function Zw(e,t,n,r){for(let i=e.childCount,a=t.childCount;;){if(i==0||a==0)return i==a?null:{a:n,b:r};let o=e.child(--i),s=t.child(--a),c=o.nodeSize;if(o==s){n-=c,r-=c;continue}if(!o.sameMarkup(s))return{a:n,b:r};if(o.isText&&o.text!=s.text){let e=0,t=Math.min(o.text.length,s.text.length);for(;e<t&&o.text[o.text.length-e-1]==s.text[s.text.length-e-1];)e++,n--,r--;return{a:n,b:r}}if(o.content.size||s.content.size){let e=Zw(o.content,s.content,n-1,r-1);if(e)return e}n-=c,r-=c}}var Qw=class e{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,i){for(let a=0,o=0;o<t;a++){let s=this.content[a],c=o+s.nodeSize;if(c>e&&n(s,r+o,i||null,a)!==!1&&s.content.size){let i=o+1;s.nodesBetween(Math.max(0,e-i),Math.min(s.content.size,t-i),n,r+i)}o=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i=``,a=!0;return this.nodesBetween(e,t,(o,s)=>{let c=o.isText?o.text.slice(Math.max(e,s)-s,t-s):o.isLeaf?r?typeof r==`function`?r(o):r:o.type.spec.leafText?o.type.spec.leafText(o):``:``;o.isBlock&&(o.isLeaf&&c||o.isTextblock)&&n&&(a?a=!1:i+=n),i+=c},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),a=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),a=1);a<t.content.length;a++)i.push(t.content[a]);return new e(i,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],i=0;if(n>t)for(let e=0,a=0;a<n;e++){let o=this.content[e],s=a+o.nodeSize;s>t&&((a<t||s>n)&&(o=o.isText?o.cut(Math.max(0,t-a),Math.min(o.text.length,n-a)):o.cut(Math.max(0,t-a-1),Math.min(o.content.size,n-a-1))),r.push(o),i+=o.nodeSize),a=s}return new e(r,i)}cutByIndex(t,n){return t==n?e.empty:t==0&&n==this.content.length?this:new e(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),a=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new e(i,a)}addToStart(t){return new e([t].concat(this.content),this.size+t.no
vendor: 14,503 bytes, line 328
328deSize)}addToEnd(t){return new e(this.content.concat(t),this.size+t.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw RangeError(`Index `+e+` out of range for `+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return Xw(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return Zw(this,e,t,n)}findIndex(e){if(e==0)return eT(0,e);if(e==this.size)return eT(this.content.length,e);if(e>this.size||e<0)throw RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let r=this.child(t),i=n+r.nodeSize;if(i>=e)return i==e?eT(t+1,i):eT(t,n);n=i}}toString(){return`<`+this.toStringInner()+`>`}toStringInner(){return this.content.join(`, `)}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(t,n){if(!n)return e.empty;if(!Array.isArray(n))throw RangeError(`Invalid input for Fragment.fromJSON`);return e.fromArray(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return e.empty;let n,r=0;for(let e=0;e<t.length;e++){let i=t[e];r+=i.nodeSize,e&&i.isText&&t[e-1].sameMarkup(i)?(n||=t.slice(0,e),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new e(n||t,r)}static from(t){if(!t)return e.empty;if(t instanceof e)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new e([t],t.nodeSize);throw RangeError(`Can not convert `+t+` to a Fragment`+(t.nodesBetween?` (looks like multiple versions of prosemirror-model were loaded)`:``))}};Qw.empty=new Qw([],0);var $w={index:0,offset:0};function eT(e,t){return $w.index=e,$w.offset=t,$w}function tT(e,t){if(e===t)return!0;if(!(e&&typeof e==`object`)||!(t&&typeof t==`object`))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!tT(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!tT(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}var nT=class e{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))t||=e.slice(0,r);else if(i.type.excludes(this.type))return e;else!n&&i.type.rank>this.type.rank&&(t||=e.slice(0,r),t.push(this),n=!0),t&&t.push(i)}return t||=e.slice(),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&tT(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Mark.fromJSON`);let n=e.marks[t.type];if(!n)throw RangeError(`There is no mark type ${t.type} in this schema`);let r=n.create(t.attrs);return n.checkAttrs(r.attrs),r}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return e.none;if(t instanceof e)return[t];let n=t.slice();return n.sort((e,t)=>e.type.rank-t.type.rank),n}};nT.none=[];var rT=class extends Error{},iT=class e{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=oT(this.content,t+this.openStart,n,this.openStart+1,this.openEnd+1);return r&&new e(r,this.openStart,this.openEnd)}removeBetween(t,n){return new e(aT(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+`(`+this.openStart+`,`+this.openEnd+`)`}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(t,n){if(!n)return e.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!=`number`||typeof i!=`number`)throw RangeError(`Invalid input for Slice.fromJSON`);return new e(Qw.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let e=t.firstChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.firstChild)r++;for(let e=t.lastChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.lastChild)i++;return new e(t,r,i)}};iT.empty=new iT(Qw.empty,0,0);function aT(e,t,n){let{index:r,offset:i}=e.findIndex(t),a=e.maybeChild(r),{index:o,offset:s}=e.findIndex(n);if(i==t||a.isText){if(s!=n&&!e.child(o).isText)throw RangeError(`Removing non-flat range`);return e.cut(0,t).append(e.cut(n))}if(r!=o)throw RangeError(`Removing non-flat range`);return e.replaceChild(r,a.copy(aT(a.content,t-i-1,n-i-1)))}function oT(e,t,n,r,i,a){let{index:o,offset:s}=e.findIndex(t),c=e.maybeChild(o);if(s==t||c.isText)return a&&r<=0&&i<=0&&!a.canReplace(o,o,n)?null:e.cut(0,t).append(n).append(e.cut(t));let l=oT(c.content,t-s-1,n,o==0?r-1:0,o==e.childCount-1?i-1:0,c);return l&&e.replaceChild(o,c.copy(l))}function sT(e,t,n){if(n.openStart>e.depth)throw new rT(`Inserted content deeper than insertion position`);if(e.depth-n.openStart!=t.depth-n.openEnd)throw new rT(`Inconsistent open depths`);return cT(e,t,n,0)}function cT(e,t,n,r){let i=e.index(r),a=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let o=cT(e,t,n,r+1);return a.copy(a.content.replaceChild(i,o))}else if(!n.content.size)return pT(a,hT(e,t,r));else if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let r=e.parent,i=r.content;return pT(r,i.cut(0,e.parentOffset).append(n.content).append(i.cut(t.parentOffset)))}else{let{start:i,end:o}=gT(n,e);return pT(a,mT(e,i,o,t,r))}}function lT(e,t){if(!t.type.compatibleContent(e.type))throw new rT(`Cannot join `+t.type.name+` onto `+e.type.name)}function uT(e,t,n){let r=e.node(n);return lT(r,t.node(n)),r}function dT(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function fT(e,t,n,r){let i=(t||e).node(n),a=0,o=t?t.index(n):i.childCount;e&&(a=e.index(n),e.depth>n?a++:e.textOffset&&(dT(e.nodeAfter,r),a++));for(let e=a;e<o;e++)dT(i.child(e),r);t&&t.depth==n&&t.textOffset&&dT(t.nodeBefore,r)}function pT(e,t){return e.type.checkContent(t),e.copy(t)}function mT(e,t,n,r,i){let a=e.depth>i&&uT(e,t,i+1),o=r.depth>i&&uT(n,r,i+1),s=[];return fT(null,e,i,s),a&&o&&t.index(i)==n.index(i)?(lT(a,o),dT(pT(a,mT(e,t,n,r,i+1)),s)):(a&&dT(pT(a,hT(e,t,i+1)),s),fT(t,n,i,s),o&&dT(pT(o,hT(n,r,i+1)),s)),fT(r,null,i,s),new Qw(s)}function hT(e,t,n){let r=[];return fT(null,e,n,r),e.depth>n&&dT(pT(uT(e,t,n+1),hT(e,t,n+1)),r),fT(t,null,n,r),new Qw(r)}function gT(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)r=t.node(e).copy(Qw.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}var _T=class e{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position before the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position after the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[t*3],r=t==0?0:this.path[t*3-1]+1;for(let t=0;t<e;t++)r+=n.child(t).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return nT.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let i=n.marks;for(var a=0;a<i.length;a++)i[a].type.spec.inclusive===!1&&(!r||!i[a].isInSet(r.marks))&&(i=i[a--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var i=0;i<n.length;i++)n[i].type.spec.inclusive===!1&&(!r||!n[i].isInSet(r.marks))&&(n=n[i--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new xT(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e=``;for(let t=1;t<=this.depth;t++)e+=(e?`/`:``)+this.node(t).type.name+`_`+this.index(t-1);return e+`:`+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw RangeError(`Position `+n+` out of range`);let r=[],i=0,a=n;for(let e=t;;){let{index:t,offset:n}=e.content.findIndex(a),o=a-n;if(r.push(e,t,i+n),!o||(e=e.child(t),e.isText))break;a=o-1,i+=n+1}return new e(n,r,a)}static resolveCached(t,n){let r=bT.get(t);if(r)for(let e=0;e<r.elts.length;e++){let t=r.elts[e];if(t.pos==n)return t}else bT.set(t,r=new vT);let i=r.elts[r.i]=e.resolve(t,n);return r.i=(r.i+1)%yT,i}},vT=class{constructor(){this.elts=[],this.i=0}},yT=12,bT=new WeakMap,xT=class{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}},ST=Object.create(null),CT=class e{constructor(e,t,n,r=nT.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||Qw.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,r=0){this.content.nodesBetween(e,t,n,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,``)}textBetween(e,t,n,r){return this.content.textBetween(e,t,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&tT(this.attrs,t||e.defaultAttrs||ST)&&nT.sameSet(this.marks,n||nT.none)}copy(t=null){return t==this.content?this:new e(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.content,t)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return iT.empty;let r=this.resolve(e),i=this.resolve(t),a=n?0:r.sharedDepth(t),o=r.start(a);return new iT(r.node(a).content.cut(r.pos-o,i.pos-o),r.depth-a,i.depth-a)}replace(e,t,n){return sT(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return _T.resolveCached(this,e)}resolveNoCache(e){return _T.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,e=>(n.isInSet(e.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+=`(`+this.content.toStringInner()+`)`),wT(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw Error(`Called contentMatchAt on a node with invalid content`);return t}canReplace(e,t,n=Qw.empty,r=0,i=n.childCount){let a=this.contentMatchAt(e).matchFragment(n,r,i),o=a&&a.matchFragment(this.content,t);if(!o||!o.validEnd)return!1;for(let e=r;e<i;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(e).matchType(n),a=i&&i.matchFragment(this.content,t);return a?a.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=nT.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!nT.sameSet(e,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>
328e.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(e=>e.toJSON())),e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Node.fromJSON`);let n;if(t.marks){if(!Array.isArray(t.marks))throw RangeError(`Invalid mark data for Node.fromJSON`);n=t.marks.map(e.markFromJSON)}if(t.type==`text`){if(typeof t.text!=`string`)throw RangeError(`Invalid text node in JSON`);return e.text(t.text,n)}let r=Qw.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,r,n);return i.type.checkAttrs(i.attrs),i}};CT.prototype.text=void 0;function wT(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+`(`+t+`)`;return t}var TT=class e{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new ET(t,n);if(r.next==null)return e.empty;let i=DT(r);r.next&&r.err(`Unexpected trailing text`);let a=LT(PT(i));return RT(a,r),a}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let r=this;for(let i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];function i(a,o){let s=a.matchFragment(e,n);if(s&&(!t||s.validEnd))return Qw.from(o.map(e=>e.createAndFill()));for(let e=0;e<a.next.length;e++){let{type:t,next:n}=a.next[e];if(!(t.isText||t.hasRequiredAttrs())&&r.indexOf(n)==-1){r.push(n);let e=i(n,o.concat(t));if(e)return e}}return null}return i(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<i.next.length;e++){let{type:a,next:o}=i.next[e];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in t)&&(!r.type||o.validEnd)&&(n.push({match:a.contentMatch,type:a,via:r}),t[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(n){e.push(n);for(let r=0;r<n.next.length;r++)e.indexOf(n.next[r].next)==-1&&t(n.next[r].next)}return t(this),e.map((t,n)=>{let r=n+(t.validEnd?`*`:` `)+` `;for(let n=0;n<t.next.length;n++)r+=(n?`, `:``)+t.next[n].type.name+`->`+e.indexOf(t.next[n].next);return r}).join(` 329`)}};TT.empty=new TT(!0);var ET=class{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==``&&this.tokens.pop(),this.tokens[0]==``&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw SyntaxError(e+` (in content expression '`+this.string+`')`)}};function DT(e){let t=[];do t.push(OT(e));while(e.eat(`|`));return t.length==1?t[0]:{type:`choice`,exprs:t}}function OT(e){let t=[];do t.push(kT(e));while(e.next&&e.next!=`)`&&e.next!=`|`);return t.length==1?t[0]:{type:`seq`,exprs:t}}function kT(e){let t=NT(e);for(;;)if(e.eat(`+`))t={type:`plus`,expr:t};else if(e.eat(`*`))t={type:`star`,expr:t};else if(e.eat(`?`))t={type:`opt`,expr:t};else if(e.eat(`{`))t=jT(e,t);else break;return t}function AT(e){/\D/.test(e.next)&&e.err(`Expected number, got '`+e.next+`'`);let t=Number(e.next);return e.pos++,t}function jT(e,t){let n=AT(e),r=n;return e.eat(`,`)&&(r=e.next==`}`?-1:AT(e)),e.eat(`}`)||e.err(`Unclosed braced range`),{type:`range`,min:n,max:r,expr:t}}function MT(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let e in n){let r=n[e];r.isInGroup(t)&&i.push(r)}return i.length==0&&e.err(`No node type or group '`+t+`' found`),i}function NT(e){if(e.eat(`(`)){let t=DT(e);return e.eat(`)`)||e.err(`Missing closing paren`),t}else if(/\W/.test(e.next))e.err(`Unexpected token '`+e.next+`'`);else{let t=MT(e,e.next).map(t=>(e.inline==null?e.inline=t.isInline:e.inline!=t.isInline&&e.err(`Mixing inline and block content`),{type:`name`,value:t}));return e.pos++,t.length==1?t[0]:{type:`choice`,exprs:t}}}function PT(e){let t=[[]];return i(a(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let i={term:r,to:n};return t[e].push(i),i}
vendor: 29,706 bytes, lines 329-354
329function i(e,t){e.forEach(e=>e.to=t)}function a(e,t){if(e.type==`choice`)return e.exprs.reduce((e,n)=>e.concat(a(n,t)),[]);if(e.type==`seq`)for(let r=0;;r++){let o=a(e.exprs[r],t);if(r==e.exprs.length-1)return o;i(o,t=n())}else if(e.type==`star`){let o=n();return r(t,o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`plus`){let o=n();return i(a(e.expr,t),o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`opt`)return[r(t)].concat(a(e.expr,t));else if(e.type==`range`){let o=t;for(let t=0;t<e.min;t++){let t=n();i(a(e.expr,o),t),o=t}if(e.max==-1)i(a(e.expr,o),o);else for(let t=e.min;t<e.max;t++){let t=n();r(o,t),i(a(e.expr,o),t),o=t}return[r(o)]}else if(e.type==`name`)return[r(t,void 0,e.value)];else throw Error(`Unknown expr type`)}}function FT(e,t){return t-e}function IT(e,t){let n=[];return r(t),n.sort(FT);function r(t){let i=e[t];if(i.length==1&&!i[0].term)return r(i[0].to);n.push(t);for(let e=0;e<i.length;e++){let{term:t,to:a}=i[e];!t&&n.indexOf(a)==-1&&r(a)}}}function LT(e){let t=Object.create(null);return n(IT(e,0));function n(r){let i=[];r.forEach(t=>{e[t].forEach(({term:t,to:n})=>{if(!t)return;let r;for(let e=0;e<i.length;e++)i[e][0]==t&&(r=i[e][1]);IT(e,n).forEach(e=>{r||i.push([t,r=[]]),r.indexOf(e)==-1&&r.push(e)})})});let a=t[r.join(`,`)]=new TT(r.indexOf(e.length-1)>-1);for(let e=0;e<i.length;e++){let r=i[e][1].sort(FT);a.next.push({type:i[e][0],next:t[r.join(`,`)]||n(r)})}return a}}function RT(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],i=!e.validEnd,a=[];for(let t=0;t<e.next.length;t++){let{type:n,next:o}=e.next[t];a.push(n.name),i&&!(n.isText||n.hasRequiredAttrs())&&(i=!1),r.indexOf(o)==-1&&r.push(o)}i&&t.err(`Only non-generatable nodes (`+a.join(`, `)+`) in a required position (see https://prosemirror.net/docs/guide/#generatable)`)}}var zT=65535,BT=2**16;function VT(e,t){return e+t*BT}function HT(e){return e&zT}function UT(e){return(e-(e&zT))/BT}var WT=1,GT=2,KT=4,qT=8,JT=class{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(this.delInfo&qT)>0}get deletedBefore(){return(this.delInfo&(WT|KT))>0}get deletedAfter(){return(this.delInfo&(GT|KT))>0}get deletedAcross(){return(this.delInfo&KT)>0}},YT=class e{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&e.empty)return e.empty}recover(e){let t=0,n=HT(e);if(!this.inverted)for(let e=0;e<n;e++)t+=this.ranges[e*3+2]-this.ranges[e*3+1];return this.ranges[n*3]+t+UT(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let r=0,i=this.inverted?2:1,a=this.inverted?1:2;for(let o=0;o<this.ranges.length;o+=3){let s=this.ranges[o]-(this.inverted?r:0);if(s>e)break;let c=this.ranges[o+i],l=this.ranges[o+a],u=s+c;if(e<=u){let i=c?e==s?-1:e==u?1:t:t,a=s+r+(i<0?0:l);if(n)return a;let d=e==(t<0?s:u)?null:VT(o/3,e-s),f=e==s?GT:e==u?WT:KT;return(t<0?e!=s:e!=u)&&(f|=qT),new JT(a,f,d)}r+=l-c}return n?e+r:new JT(e+r,0,null)}touches(e,t){let n=0,r=HT(t),i=this.inverted?2:1,a=this.inverted?1:2;for(let t=0;t<this.ranges.length;t+=3){let o=this.ranges[t]-(this.inverted?n:0);if(o>e)break;let s=this.ranges[t+i];if(e<=o+s&&t==r*3)return!0;n+=this.ranges[t+a]-s}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r<this.ranges.length;r+=3){let a=this.ranges[r],o=a-(this.inverted?i:0),s=a+(this.inverted?0:i),c=this.ranges[r+t],l=this.ranges[r+n];e(o,o+c,s,s+l),i+=l-c}}invert(){return new e(this.ranges,!this.inverted)}toString(){return(this.inverted?`-`:``)+JSON.stringify(this.ranges)}static offset(t){return t==0?e.empty:new e(t<0?[0,-t,0]:[0,0,t])}};YT.empty=new YT([]);var XT=Object.create(null),ZT=class{getMap(){return YT.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw RangeError(`Invalid input for Step.fromJSON`);let n=XT[t.stepType];if(!n)throw RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in XT)throw RangeError(`Duplicate use of step JSON ID `+e);return XT[e]=t,t.prototype.jsonID=e,t}},QT=class e{constructor(e,t){this.doc=e,this.failed=t}static ok(t){return new e(t,null)}static fail(t){return new e(null,t)}static fromReplace(t,n,r,i){try{return e.ok(t.replace(n,r,i))}catch(t){if(t instanceof rT)return e.fail(t.message);throw t}}};function $T(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let a=e.child(i);a.content.size&&(a=a.copy($T(a.content,t,a))),a.isInline&&(a=t(a,n,i)),r.push(a)}return Qw.fromArray(r)}var eE=class e extends ZT{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),r=n.node(n.sharedDepth(this.to)),i=new iT($T(t.content,(e,t)=>!e.isAtom||!t.type.allowsMarkType(this.mark.type)?e:e.mark(this.mark.addToSet(e.marks)),r),t.openStart,t.openEnd);return QT.fromReplace(e,this.from,this.to,i)}invert(){return new tE(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:`addMark`,mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for AddMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}};ZT.jsonID(`addMark`,eE);var tE=class e extends ZT{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new iT($T(t.content,e=>e.mark(this.mark.removeFromSet(e.marks)),e),t.openStart,t.openEnd);return QT.fromReplace(e,this.from,this.to,n)}invert(){return new eE(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:`removeMark`,mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for RemoveMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}};ZT.jsonID(`removeMark`,tE);var nE=class e extends ZT{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return QT.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return QT.fromReplace(e,this.pos,this.pos+1,new iT(Qw.from(n),0,+!t.isLeaf))}invert(t){let n=t.nodeAt(this.pos);if(n){let t=this.mark.addToSet(n.marks);if(t.length==n.marks.length){for(let r=0;r<n.marks.length;r++)if(!n.marks[r].isInSet(t))return new e(this.pos,n.marks[r]);return new e(this.pos,this.mark)}}return new rE(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:`addNodeMark`,pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for AddNodeMarkStep.fromJSON`);return new e(n.pos,t.markFromJSON(n.mark))}};ZT.jsonID(`addNodeMark`,nE);var rE=class e extends ZT{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return QT.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return QT.fromReplace(e,this.pos,this.pos+1,new iT(Qw.from(n),0,+!t.isLeaf))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new nE(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:`removeNodeMark`,pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for RemoveNodeMarkStep.fromJSON`);return new e(n.pos,t.markFromJSON(n.mark))}};ZT.jsonID(`removeNodeMark`,rE);var iE=class e extends ZT{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&oE(e,this.from,this.to)?QT.fail(`Structure replace would overwrite content`):QT.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new YT([this.from,this.to-this.from,this.slice.size])}invert(t){return new e(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.to,-1),r=this.from==this.to&&e.MAP_BIAS<0?n:t.mapResult(this.from,1);return r.deletedAcross&&n.deletedAcross?null:new e(r.pos,Math.max(r.pos,n.pos),this.slice,this.structure)}merge(t){if(!(t instanceof e)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let n=this.slice.size+t.slice.size==0?iT.empty:new iT(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new e(this.from,this.to+(t.to-t.from),n,this.structure)}else if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let n=this.slice.size+t.slice.size==0?iT.empty:new iT(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new e(t.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:`replace`,from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for ReplaceStep.fromJSON`);return new e(n.from,n.to,iT.fromJSON(t,n.slice),!!n.structure)}};iE.MAP_BIAS=1,ZT.jsonID(`replace`,iE);var aE=class e extends ZT{constructor(e,t,n,r,i,a,o=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=i,this.insert=a,this.structure=o}apply(e){if(this.structure&&(oE(e,this.from,this.gapFrom)||oE(e,this.gapTo,this.to)))return QT.fail(`Structure gap-replace would overwrite content`);let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return QT.fail(`Gap is not a flat range`);let n=this.slice.insertAt(this.insert,t.content);return n?QT.fromReplace(e,this.from,this.to,n):QT.fail(`Content does not fit in gap`)}getMap(){return new YT([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let n=this.gapTo-this.gapFrom;return new e(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:t.map(this.gapFrom,-1),a=this.to==this.gapTo?r.pos:t.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||a>r.pos?null:new e(n.pos,r.pos,i,a,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:`replaceAround`,from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`||typeof n.gapFrom!=`number`||typeof n.gapTo!=`number`||typeof n.insert!=`number`)throw RangeError(`Invalid input for ReplaceAroundStep.fromJSON`);return new e(n.from,n.to,n.gapFrom,n.gapTo,iT.fromJSON(t,n.slice),n.insert,!!n.structure)}};ZT.jsonID(`replaceAround`,aE);function oE(e,t,n){let r=e.resolve(t),i=n-t,a=r.depth;for(;i>0&&a>0&&r.indexAfter(a)==r.node(a).childCount;)a--,i--;if(i>0){let e=r.node(a).maybeChild(r.indexAfter(a));for(;i>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,i--}}return!1}var sE=class e extends ZT{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}apply(e){let t=e.nodeAt(this.pos);if(!t)return QT.fail(`No node at attribute step's position`);let n=Object.create(null);for(let e in t.attrs)n[e]=t.attrs[e];n[this.attr]=this.value;let r=t.type.create(n,null,t.marks);return QT.fromReplace(e,this.pos,this.pos+1,new iT(Qw.from(r),0,+!t.isLeaf))}getMap(){return YT.empty}invert(t){return new e(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.attr,this.value)}toJSON(){return{stepType:`attr`,pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!=`number`||typeof n.attr!=`string`)throw RangeError(`Invalid input for AttrStep.fromJSON`);return new e(n.pos,n.attr,n.value)}};ZT.jsonID(`attr`,sE);var cE=class e extends ZT{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let n in e.attrs)t[n]=e.attrs[n];t[this.attr]=this.value;let n=e.type.create(t,e.content,e.marks);return QT.ok(n)}getMap(){return YT.empty}invert(t){return new e(this.attr,t.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:`docAttr`,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.attr!=`string`)throw RangeError(`Invalid input for DocAttrStep.fromJSON`);return new e(n.attr,n.value)}};ZT.jsonID(`docAttr`,cE);var lE=class extends Error{};lE=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},lE.prototype=Object.create(Error.prototype),lE.prototype.constructor=lE,lE.prototype.name=`TransformError`;var uE=Object.create(null),dE=class{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new fE(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=iT.empty){let n=t.content.lastChild,r=null;for(let e=0;e<t.openEnd;e++)r=n,n=n.lastChild;let i=e.steps.length,a=this.ranges;for(let o=0;o<a.length;o++){let{$from:s,$to:c}=a[o],l=e.mapping.slice(i);e.replaceRange(l.map(s.pos),l.map(c.pos),o?iT.empty:t),o==0&&SE(e,i,(n?n.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:a,$to:o}=r[i],s=e.mapping.slice(n),c=s.map(a.pos),l=s.map(o.pos);i?e.deleteRange(c,l):(e.replaceRangeWith(c,l,t),SE(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let r=e.parent.inlineContent?new hE(e):xE(e.node(0),e.parent,e.pos,e.index(),t,n);if(r)return r;for(let r=e.depth-1;r>=0;r--){let i=t<0?xE(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):xE(e.node(0),e.node(r),e.after(r+1),e.index(r)+1,t,n);if(i)return i}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new yE(e.node(0))}static atStart(e){return xE(e,e,0,0,1)||new yE(e)}static atEnd(e){return xE(e,e,e.content.size,e.childCount,-1)||new yE(e)}static fromJSON(e,t){if(!t||!t.type)throw RangeError(`Invalid input for Selection.fromJSON`);let n=uE[t.type];if(!n)throw RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in uE)throw RangeError(`Duplicate use of selection JSON ID `+e);return uE[e]=t,t.prototype.jsonID=e,t}getBookmark(){return hE.between(this.$anchor,this.$head).getBookmark()}};dE.prototype.visible=!0;var fE=class{constructor(e,t){this.$from=e,this.$to=t}},pE=!1;function mE(e){!pE&&!e.parent.inlineContent&&(pE=!0,console.warn(`TextSelection endpoint not pointing into a node with inline content (`+e.parent.type.name+`)`))}var hE=class e extends dE{constructor(e,t=e){mE(e),mE(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,n){let r=t.resolve(n.map(this.head));if(!r.parent.inlineContent)return dE.near(r);let i=t.resolve(n.map(this.anchor));return new e(i.parent.inlineContent?i:r,r)}replace(e,t=iT.empty){if(super.replace(e,t),t==iT.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(t){return t instanceof e&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new gE(this.anchor,this.head)}toJSON(){return{type:`text`,anchor:this.anchor,head:this.head}}static fromJSON(t,n){if(typeof n.anchor!=`number`||typeof n.head!=`number`)throw RangeError(`Invalid input for TextSelection.fromJSON`);return new e(t.resolve(n.anchor),t.resolve(n.head))}static create(e,t,n=t){let r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))}static between(t,n,r){let i=t.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let e=dE.findFrom(n,r,!0)||dE.findFrom(n,-r,!0);if(e)n=e.$head;else return dE.near(n,r)}return t.parent.inlineContent||(i==0?t=n:(t=(dE.findFrom(t,-r,!0)||dE.findFrom(t,r,!0)).$anchor,t.pos<n.pos!=i<0&&(t=n))),new e(t,n)}};dE.jsonID(`text`,hE);var gE=class e{constructor(e,t){this.anchor=e,this.head=t}map(t){return new e(t.map(this.anchor),t.map(this.head))}resolve(e){return hE.between(e.resolve(this.anchor),e.resolve(this.head))}},_E=class e extends dE{constructor(e){let t=e.nodeAfter,n=e.node(0).resolve(e.pos+t.nodeSize);super(e,n),this.node=t}map(t,n){let{deleted:r,pos:i}=n.mapResult(this.anchor),a=t.resolve(i);return r?dE.near(a):new e(a)}content(){return new iT(Qw.from(this.node),0,0)}eq(t){return t instanceof e&&t.anchor==this.anchor}toJSON(){return{type:`node`,anchor:this.anchor}}getBookmark(){return new vE(this.anchor)}static fromJSON(t,n){if(typeof n.anchor!=`number`)throw RangeError(`Invalid input for NodeSelection.fromJSON`);return new e(t.resolve(n.anchor))}static create(t,n){return new e(t.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}};_E.prototype.visible=!1,dE.jsonID(`node`,_E);var vE=class e{constructor(e){this.anchor=e}map(t){let{deleted:n,pos:r}=t.mapResult(this.anchor);return n?new gE(r,r):new e(r)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&_E.isSelectable(n)?new _E(t):dE.near(t)}},yE=class e extends dE{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=iT.empty){if(t==iT.empty){e.delete(0,e.doc.content.size);let t=dE.atStart(e.doc);t.eq(e.selection)||e.setSelection(t)}else super.replace(e,t)}toJSON(){return{type:`all`}}static fromJSON(t){return new e(t)}map(t){return new e(t)}eq(t){return t instanceof e}getBookmark(){return bE}};dE.jsonID(`all`,yE);var bE={map(){return this},resolve(e){return new yE(e)}};function xE(e,t,n,r,i,a=!1){if(t.inlineContent)return hE.create(e,n);for(let o=r-(i>0?0:1);i>0?o<t.childCount:o>=0;o+=i){let r=t.child(o);if(!r.isAtom){let t=xE(e,r,n+i,i<0?r.childCount:0,i,a);if(t)return t}else if(!a&&_E.isSelectable(r))return _E.create(e,n-(i<0?r.nodeSize:0));n+=r.nodeSize*i}return null}function SE(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof iE||i instanceof aE))return;let a=e.mapping.maps[r],o;a.forEach((e,t,n,r)=>{o??=r}),e.setSelection(dE.near(e.doc.resolve(o),n))}function CE(e,t){return!t||!e?e:e.bind(t)}var wE=class{constructor(e,t,n){this.name=e,this.init=CE(t.init,n),this.apply=CE(t.apply,n)}};new wE(`doc`,{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new wE(`selection`,{init(e,t){return e.selection||dE.atStart(t.doc)},apply(e){return e.selection}}),new wE(`storedMarks`,{init(e){return e.storedMarks||null},apply(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new wE(`scrollToSelection`,{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}});var TE=(e,t)=>{let{state:n,view:r}=e,{selection:i}=n;if(!i.empty)return!1;let{$from:a}=i;if(a.parentOffset!==0)return!1;let o=a.depth-1,s=a.node(o),c=a.index(o);if(c===0)return!1;if(s.type===t)return e.commands.lift(t.name);let l=s.child(c-1);if(l.type!==t||!l.lastChild?.isTextblock)return!1;let u=a.before(),d=u-1-1,{tr:f}=n;return f.delete(u,a.after()).insert(d,a.parent.content),f.setSelection(hE.create(f.doc,d)),r.dispatch(f.scrollIntoView()),!0},EE=/^\s*>\s$/,DE=DC.create({name:`blockquote`,addOptions(){return{HTMLAttributes:{}}},content:`block+`,group:`block`,defining:!0,parseHTML(){return[{tag:`blockquote`}]},renderHTML({HTMLAttributes:e}){return Yw(`blockquote`,{...Cx(this.options.HTMLAttributes,e),children:Yw(`slot`,{})})},parseMarkdown:(e,t)=>{let n=t.parseBlockChildren??t.parseChildren;return t.createNode(`blockquote`,void 0,n(e.tokens||[]))},renderMarkdown:(e,t)=>{if(!e.content)return``;let n=[];return e.content.forEach((e,r)=>{let i=(t.renderChild?.call(t,e,r)??t.renderChildren([e])).split(` 330`).map(e=>e.trim()===``?`>`:`> ${e}`);n.push(i.join(` 331`))}),n.join(` 332> 333`)},addCommands(){return{setBlockquote:()=>({commands:e})=>e.wrapIn(this.name),toggleBlockquote:()=>({commands:e})=>e.toggleWrap(this.name),unsetBlockquote:()=>({commands:e})=>e.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote(),Backspace:()=>TE(this.editor,this.type)}},addInputRules(){return[wC({find:EE,type:this.type})]}}),OE=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,kE=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,AE=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,jE=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,ME=QS.create({name:`bold`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`strong`},{tag:`b`,getAttrs:e=>e.style.fontWeight!==`normal`&&null},{style:`font-weight=400`,clearMark:e=>e.type.name===this.name},{style:`font-weight`,getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}]},renderHTML({HTMLAttributes:e}){return Yw(`strong`,{...Cx(this.options.HTMLAttributes,e),children:Yw(`slot`,{})})},markdownTokenName:`strong`,parseMarkdown:(e,t)=>t.applyMark(`bold`,t.parseInline(e.tokens||[])),markdownOptions:{htmlReopen:{open:`<strong>`,close:`</strong>`}},renderMarkdown:(e,t)=>`**${t.renderChildren(e)}**`,addCommands(){return{setBold:()=>({commands:e})=>e.setMark(this.name),toggleBold:()=>({commands:e})=>e.toggleMark(this.name),unsetBold:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[xC({find:OE,type:this.type}),xC({find:AE,type:this.type})]},addPasteRules(){return[OC({find:kE,type:this.type}),OC({find:jE,type:this.type})]}}),NE=e=>{let t=/`([^`]+)`(?!`)$/.exec(e);return!t||t.index>0&&e[t.index-1]==="`"?null:{index:t.index,text:t[0],replaceWith:t[1]}},PE=e=>{let t=/`([^`]+)`(?!`)/g,n=[],r;for(;(r=t.exec(e))!==null;)r.index>0&&e[r.index-1]==="`"||n.push({index:r.index,text:r[0],replaceWith:r[1]});return n},FE=QS.create({name:`code`,addOptions(){return{HTMLAttributes:{}}},excludes:`_`,code:!0,exitable:!0,parseHTML(){return[{tag:`code`}]},renderHTML({HTMLAttributes:e}){return[`code`,Cx(this.options.HTMLAttributes,e),0]},markdownTokenName:`codespan`,parseMarkdown:(e,t)=>t.applyMark(`code`,[{type:`text`,text:e.text||``}]),renderMarkdown:(e,t)=>e.content?`\`${t.renderChildren(e.content)}\``:``,addCommands(){return{setCode:()=>({commands:e})=>e.setMark(this.name),toggleCode:()=>({commands:e})=>e.toggleMark(this.name),unsetCode:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[xC({find:NE,type:this.type})]},addPasteRules(){return[OC({find:PE,type:this.type})]}}),IE=4,LE=/^```([a-z]+)?[\s\n]$/,RE=/^~~~([a-z]+)?[\s\n]$/,zE=DC.create({name:`codeBlock`,addOptions(){return{languageClassPrefix:`language-`,exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:IE,HTMLAttributes:{}}},content:`text*`,marks:``,group:`block`,code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:e=>{let{languageClassPrefix:t}=this.options;return t&&[...e.firstElementChild?.classList||[]].filter(e=>e.startsWith(t)).map(e=>e.replace(t,``))[0]||null},rendered:!1}}},parseHTML(){return[{tag:`pre`,preserveWhitespace:`full`}]},renderHTML({node:e,HTMLAttributes:t}){return[`pre`,Cx(this.options.HTMLAttributes,t),[`code`,{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},markdownTokenName:`code`,parseMarkdown:(e,t)=>e.raw?.startsWith("```")===!1&&e.raw?.startsWith(`~~~`)===!1&&e.codeBlockStyle!==`indented`?[]:t.createNode(`codeBlock`,{language:e.lang||null},e.text?[t.createTextNode(e.text)]:[]),renderMarkdown:(e,t)=>{let n=``,r=e.attrs?.language||``;return n=e.content?[`\`\`\`${r}`,t.renderChildren(e.content),"```"].join(` 334`):`\`\`\`${r} 335 336\`\`\``,n},addCommands(){return{setCodeBlock:e=>({commands:t})=>t.setNode(this.name,e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode(this.name,`paragraph`,e)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{let{empty:e,$anchor:t}=this.editor.state.selection,n=t.pos===1;return!e||t.parent.type.name!==this.name?!1:n||!t.parent.textContent.length?this.editor.commands.clearNodes():!1},Tab:({editor:e})=>{if(!this.options.enableTabIndentation)return!1;let t=this.options.tabSize??IE,{state:n}=e,{selection:r}=n,{$from:i,empty:a}=r;if(i.parent.type!==this.type)return!1;let o=` `.repeat(t);return a?e.commands.insertContent(o):e.commands.command(({tr:e})=>{let{from:t,to:i}=r,a=n.doc.textBetween(t,i,` 337`,` 338`).split(` 339`).map(e=>o+e).join(` 340`);return e.replaceWith(t,i,n.schema.text(a)),!0})},"Shift-Tab":({editor:e})=>{if(!this.options.enableTabIndentation)return!1;let t=this.options.tabSize??IE,{state:n}=e,{selection:r}=n,{$from:i,empty:a}=r;return i.parent.type===this.type?a?e.commands.command(({tr:e})=>{let{pos:r}=i,a=i.start(),o=i.end(),s=n.doc.textBetween(a,o,` 341`,` 342`).split(` 343`),c=0,l=0,u=r-a;for(let e=0;e<s.length;e+=1){if(l+s[e].length>=u){c=e;break}l+=s[e].length+1}let d=s[c].match(/^ */)?.[0]||``,f=Math.min(d.length,t);if(f===0)return!0;let p=a;for(let e=0;e<c;e+=1)p+=s[e].length+1;return e.delete(p,p+f),r-p<=f&&e.setSelection(Y.create(e.doc,p)),!0}):e.commands.command(({tr:e})=>{let{from:i,to:a}=r,o=n.doc.textBetween(i,a,` 344`,` 345`).split(` 346`).map(e=>{let n=e.match(/^ */)?.[0]||``,r=Math.min(n.length,t);return e.slice(r)}).join(` 347`);return e.replaceWith(i,a,n.schema.text(o)),!0}):!1},Enter:({editor:e})=>{if(!this.options.exitOnTripleEnter)return!1;let{state:t}=e,{selection:n}=t,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;let a=r.parentOffset===r.parent.nodeSize-2,o=r.parent.textContent.endsWith(` 348 349`);return!a||!o?!1:e.chain().command(({tr:e})=>(e.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;let{state:t}=e,{selection:n,doc:r}=t,{$from:i,empty:a}=n;if(!a||i.parent.type!==this.type||i.parentOffset!==i.parent.nodeSize-2)return!1;let o=i.after();return o===void 0?!1:r.nodeAt(o)?e.commands.command(({tr:e})=>(e.setSelection(J.near(r.resolve(o))),!0)):e.commands.exitCode()}}},addInputRules(){return[CC({find:LE,type:this.type,getAttributes:e=>({language:e[1]})}),CC({find:RE,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new dm({key:new mm(`codeBlockVSCodeHandler`),props:{handlePaste:(e,t)=>{if(!t.clipboardData||this.editor.isActive(this.type.name))return!1;let n=t.clipboardData.getData(`text/plain`),r=t.clipboardData.getData(`vscode-editor-data`),i=(r?JSON.parse(r):void 0)?.mode;if(!n||!i)return!1;let{tr:a,schema:o}=e.state,s=o.text(n.replace(/\r\n?/g,` 350`));return a.replaceSelectionWith(this.type.create({language:i},s)),a.selection.$from.parent.type!==this.type&&a.setSelection(Y.near(a.doc.resolve(Math.max(0,a.selection.from-2)))),a.setMeta(`paste`,!0),e.dispatch(a),!0}}})]}}),BE=DC.create({name:`doc`,topNode:!0,content:`block+`,renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,` 351 352`):``}),VE=DC.create({name:`hardBreak`,markdownTokenName:`br`,addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:`inline`,selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:`br`}]},renderHTML({HTMLAttributes:e}){return[`br`,Cx(this.options.HTMLAttributes,e)]},renderText(){return` 353`},renderMarkdown:()=>` 354`,parseMarkdown:()=>({type:`hardBreak`}),addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command(()=>{let{selection:e,storedMarks:i}=n;if(e.$from.parent.type.spec.isolating)return!1;let{keepMarks:a}=this.options,{splittableMarks:o}=r.extensionManager,s=i||e.$to.parentOffset&&e.$from.marks();return t().insertContent({type:this.name}).command(({tr:e,dispatch:t})=>{if(t&&s&&a){let t=s.filter(e=>o.includes(e.type.name));e.ensureMarks(t)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),HE=DC.create({name:`heading`,addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:`inline*`,group:`block`,defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(e=>({tag:`h${e}`,attrs:{level:e}}))},renderHTML({node:e,HTMLAttributes:t}){return[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,Cx(this.options.HTMLAttributes,t),0]},parseMarkdown:(e,t)=>t.createNode(`heading`,{level:e.depth||1},t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>{let n=e.attrs?.level?parseInt(e.attrs.level,10):1,r=`#`.repeat(n);return e.content?`${r} ${t.renderChildren(e.content)}`:``},addCommands(){return{setHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.setNode(this.name,e):!1,toggleHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.toggleNode(this.name,`paragraph`,e):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((e,t)=>({...e,[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})}),{})},addInputRules(){return this.options.levels.map(e=>CC({find:RegExp(`^(#{${Math.min(...this.options.levels)},${e}}
354)\\s$`),type:this.type,getAttributes:{level:e}}))}}),UE=DC.create({name:`horizontalRule`,addOptions(){return{HTMLAttributes:{},nextNodeType:`paragraph`}},group:`block`,parseHTML(){return[{tag:`hr`}]},renderHTML({HTMLAttributes:e}){return[`hr`,Cx(this.options.HTMLAttributes,e)]},markdownTokenName:`hr`,parseMarkdown:(e,t)=>t.createNode(`horizontalRule`),renderMarkdown:()=>`---`,addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{if(!jS(t,t.schema.nodes[this.name]))return!1;let{selection:n}=t,{$to:r}=n,i=e();return $x(n)?i.insertContentAt(r.pos,{type:this.name}):i.insertContent({type:this.name}),i.command(({state:e,tr:t,dispatch:n})=>{if(n){let{$to:n}=t.selection,r=n.end();if(n.nodeAfter)n.nodeAfter.isTextblock?t.setSelection(Y.create(t.doc,n.pos+1)):n.nodeAfter.isBlock?t.setSelection(X.create(t.doc,n.pos)):t.setSelection(Y.create(t.doc,n.pos));else{let i=(e.schema.nodes[this.options.nextNodeType]||n.parent.type.contentMatch.defaultType)?.create();i&&(t.insert(r,i),t.setSelection(Y.create(t.doc,r+1)))}t.scrollIntoView()}return!0}).run()}}},addInputRules(){return[SC({find:/^(?:---|â-|___\s|\*\*\*\s)$/,type:this.t
vendor: 1,046 bytes, line 354
354ype})]}}),WE=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,GE=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,KE=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,qE=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,JE=QS.create({name:`italic`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`em`},{tag:`i`,getAttrs:e=>e.style.fontStyle!==`normal`&&null},{style:`font-style=normal`,clearMark:e=>e.type.name===this.name},{style:`font-style=italic`}]},renderHTML({HTMLAttributes:e}){return[`em`,Cx(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},markdownTokenName:`em`,parseMarkdown:(e,t)=>t.applyMark(`italic`,t.parseInline(e.tokens||[])),markdownOptions:{htmlReopen:{open:`<em>`,close:`</em>`}},renderMarkdown:(e,t)=>`*${t.renderChildren(e)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}}
354,addInputRules(){return[xC({find:WE,type:this.type}),xC({find:KE,type:this.type})]},addPasteRules(){return[OC({find:GE,type:this.type}),OC({find:qE,type:this.type})]}}),YE=`aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yac
354hts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2`,XE=`ελ1Ï 2бг1ел3деÑи4еÑ2каÑолик6ом3мкд2он1Ñква6онлайн5Ñг3ÑÑÑ2Ñ2ÑайÑ3Ñб3ÑкÑ3Òаз3Õ°Õ¡Õµ3×שר××5×§××3Ø§Ø¨ÙØ¸Ø¨Ù5را٠ÙÙ5ÙØ§Ø±Ø¯Ù4Ø¨ØØ±ÙÙ5جزائر5Ø³Ø¹ÙØ¯ÙØ©6عÙÙØ§Ù5٠غرب5٠ارات5ÛØ±Ø§Ù5بارت2زار4ÙØªÙ3ھارت5تÙÙØ³4Ø³ÙØ¯Ø§Ù3Ø±ÙØ©5Ø´Ø¨ÙØ©4عراÙ2ب2٠اÙ4ÙÙØ³Ø·ÙÙ6ÙØ·Ø±3ÙØ§Ø«ÙÙÙÙ6ÙÙ 3٠صر2ÙÙØ³Ùا5ÙØ±ÙتاÙÙØ§7ÙØ¹4Ù٠راÙ5پاکستاÙ7ÚØ§Ø±Øª4à¤à¥à¤®3नà¥à¤3à¤à¤¾à¤°à¤¤0मà¥3à¥à¤¤5सà¤à¤à¤ न5বাà¦à¦²à¦¾5à¦à¦¾à¦°à¦¤2ৰত4à¨à¨¾à¨°à¨¤4àªàª¾àª°àª¤4à¬à¬¾à¬°à¬¤4à®à®¨à¯à®¤à®¿à®¯à®¾6லà®à¯à®à¯6à®à®¿à®à¯à®à®ªà¯à®ªà¯à®°à¯11à°à°¾à°°à°¤à±5à²à²¾à²°à²¤4à´à´¾à´°à´¤à´5à¶½à¶à¶à·4à¸à¸à¸¡3à¹à¸à¸¢3ລາວ3áá2ã¿ããª3ã¢ãã¾ã³4ã¯ã©ã¦ã4ã°ã¼ã°ã«4ã³ã 2ã¹ãã¢3ã»ã¼ã«3ãã¡ãã·ã§ã³6ãã¤ã³ã4ä¸ç2ä¸ä¿¡1å½1å1æç½3äºé©¬é3ä¼ä¸2ä½å±±2ä¿¡æ¯2å¥åº·2å «å¦2å ¬å¸1ç2å°æ¹¾1ç£2åå1åº1æ 2åé0大é åº5å¨çº¿2大æ¿2天主æ3娱ä¹2å®¶é»2广ä¸2å¾®å2æ å2æç±ä½ 3ææº2æè2æ¿å¡1åº2æ°å å¡2é»2æ¶å°2æ¸ç±2æºæ2淡马é¡3游æ2æ¾³é2ç¹ç2ç§»å¨2ç»ç»æºæ4ç½å1åº1ç«1ç»2èé2è°·æ2è´ç©2é販2éå¢2é»è¨çç§4é£å©æµ¦3é£å2é¤å 2馿 ¼éæ3港2ë·ë·1ì»´2ì¼ì±2íêµ2`,ZE=`numeric`,QE=`ascii`,$E=`alpha`,eD=`asciinumeric`,tD=`alphanumeric`,nD=`domain`,rD=`emoji`,iD=`scheme`,aD=`slashscheme`,oD=`whitespace`;function sD(e,t){return e in t||(t[e]=[]),t[e]}function cD(e,t,n){t[ZE]&&(t[eD]=!0,t[tD]=!0),t[QE]&&(t[eD]=!0,t[$E]=!0),t[eD]&&(t[tD]=!0),t[$E]&&(t[tD]=!0),t[tD]&&(t[nD]=!0),t[rD]&&(t[nD]=!0);for(let r in t){let t=sD(r,n);t.indexOf(e)<0&&t.push(e)}}function lD(e,t){let n={};for(let r in t)t[r].indexOf(e)>=0&&(n[r]=!0);return n}function uD(e=null){this.j={},this.jr=[],this.jd=null,this.t=e}uD.groups={},uD.prototype={accepts(){return!!this.t},go(e){let t=this,n=t.j[e];if(n)return n;for(let n=0;n<t.jr.length;n++){let r=t.jr[n][0],i=t.jr[n][1];if(i&&r.test(e))return i}return t.jd},has(e,t=!1){return t?e in this.j:!!this.go(e)},ta(e,t,n,r){for(let i=0;i<e.length;i++)this.tt(e[i],t,n,r)},tr(e,t,n,r){r||=uD.groups;let i;return t&&t.j?i=t:(i=new uD(t),n&&r&&cD(t,n,r)),this.jr.push([e,i]),i},ts(e,t,n,r){let i=this,a=e.length;if(!a)return i;for(let t=0;t<a-1;t++)i=i.tt(e[t]);return i.tt(e[a-1],t,n,r)},tt(e,t,n,r){r||=uD.groups;let i=this;if(t&&t.j)return i.j[e]=t,t;let a=t,o,s=i.go(e);return s?(o=new uD,Object.assign(o.j,s.j),o.jr.push.apply(o.jr,s.jr),o.jd=s.jd,o.t=s.t):o=new uD,a&&(r&&(o.t&&typeof o.t==`string`?cD(a,Object.assign(lD(o.t,r),n),r):n&&cD(a,n,r)),o.t=a),i.j[e]=o,o}};var Q=(e,t,n,r,i)=>e.ta(t,n,r,i),dD=(e,t,n,r,i)=>e.tr(t,n,r,i),fD=(e,t,n,r,i)=>e.ts(t,n,r,i),$=(e,t,n,r,i)=>e.tt(t,n,r,i),pD=`WORD`,mD=`UWORD`,hD=`ASCIINUMERICAL`,gD=`ALPHANUMERICAL`,_D=`LOCALHOST`,vD=`TLD`,yD=`UTLD`,bD=`SCHEME`,xD=`SLASH_SCHEME`,SD=`NUM`,CD=`WS`,wD=`NL`,TD=`OPENBRACE`,ED=`CLOSEBRACE`,DD=`OPENBRACKET`,OD=`CLOSEBRACKET`,kD=`OPENPAREN`,AD=`CLOSEPAREN`,jD=`OPENANGLEBRACKET`,MD=`CLOSEANGLEBRACKET`,ND=`FULLWIDTHLEFTPAREN`,PD=`FULLWIDTHRIGHTPAREN`,FD=`LEFTCORNERBRACKET`,ID=`RIGHTCORNERBRACKET`,LD=`LEFTWHITECORNERBRACKET`,RD=`RIGHTWHITECORNERBRACKET`,zD=`FULLWIDTHLESSTHAN`,BD=`FULLWIDTHGREATERTHAN`,VD=`AMPERSAND`,HD=`APOSTROPHE`,UD=`ASTERISK`,WD=`AT`,GD=`BACKSLASH`,KD=`BACKTICK`,qD=`CARET`,JD=`COLON`,YD=`COMMA`,XD=`DOLLAR`,ZD=`DOT`,QD=`EQUALS`,$D=`EXCLAMATION`,eO=`HYPHEN`,tO=`PERCENT`,nO=`PIPE`,rO=`PLUS`,iO=`POUND`,aO=`QUERY`,oO=`QUOTE`,sO=`FULLWIDTHMIDDLEDOT`,cO=`SEMI`,lO=`SLASH`,uO=`TILDE`,dO=`UNDERSCORE`,fO=`EMOJI`,pO=`SYM`,mO=Object.freeze({__proto__:null,ALPHANUMERICAL:gD,AMPERSAND:VD,APOSTROPHE:HD,ASCIINUMERICAL:hD,ASTERISK:UD,AT:WD,BACKSLASH:GD,BACKTICK:KD,CARET:qD,CLOSEANGLEBRACKET:MD,CLOSEBRACE:ED,CLOSEBRACKET:OD,CLOSEPAREN:AD,COLON:JD,COMMA:YD,DOLLAR:XD,DOT:ZD,EMOJI:fO,EQUALS:QD,EXCLAMATION:$D,FULLWIDTHGREATERTHAN:BD,FULLWIDTHLEFTPAREN:ND,FULLWIDTHLESSTHAN:zD,FULLWIDTHMIDDLEDOT:sO,FULLWIDTHRIGHTPAREN:PD,HYPHEN:eO,LEFTCORNERBRACKET:FD,LEFTWHITECORNERBRACKET:LD,LOCALHOST:_D,NL:wD,NUM:SD,OPENANGLEBRACKET:jD,OPENBRACE:TD,OPENBRACKET:DD,OPENPAREN:kD,PERCENT:tO,PIPE:nO,PLUS:rO,POUND:iO,QUERY:aO,QUOTE:oO,RIGHTCORNERBRACKET:ID,RIGHTWHITECORNERBRACKET:RD,SCHEME:bD,SEMI:cO,SLASH:lO,SLASH_SCHEME:xD,SYM:pO,TILDE:uO,TLD:vD,UNDERSCORE:dO,UTLD:yD,UWORD:mD,WORD:pD,WS:CD}),hO=/[a-z]/,gO=/\p{L}/u,_O=/\p{Emoji}/u,vO=/\d/,yO=/\s/,bO=`\r`,xO=` 355`,SO=`ï¸`,CO=`â`,wO=``,TO=null,EO=null;function DO(e=[]){let t={};uD.groups=t;let n=new uD;TO??=jO(YE),EO??=jO(XE),$(n,`'`,HD),$(n,`{`,TD),$(n,`}`,ED),$(n,`[`,DD),$(n,`]`,OD),$(n,`(`,kD),$(n,`)`,AD),$(n,`<`,jD),$(n,`>`,MD),$(n,`ï¼`,ND),$(n,`ï¼`,PD),$(n,`ã`,FD),$(n,`ã`,ID),$(n,`ã`,LD),$(n,`ã`,RD),$(n,`ï¼`,zD),$(n,`ï¼`,BD),$(n,`&`,VD),$(n,`*`,UD),$(n,`@`,WD),$(n,"`",KD),$(n,`^`,qD),$(n,`:`,JD),$(n,`,`,YD),$(n,`$`,XD),$(n,`.`,ZD),$(n,`=`,QD),$(n,`!`,$D),$(n,`-`,eO),$(n,`%`,tO),$(n,`|`,nO),$(n,`+`,rO),$(n,`#`,iO),$(n,`?`,aO),$(n,`"`,oO),$(n,`/`,lO),$(n,`;`,cO),$(n,`~`,uO),$(n,`_`,dO),$(n,`\\`,GD),$(n,`ã»`,sO);let r=dD(n,vO,SD,{[ZE]:!0});dD(r,vO,r);let i=dD(r,hO,hD,{[eD]:!0}),a=dD(r,gO,gD,{[tD]:!0}),o=dD(n,hO,pD,{[QE]:!0});dD(o,vO,i),dD(o,hO,o),dD(i,vO,i),dD(i,hO,i);let s=dD(n,gO,mD,{[$E]:!0});dD(s,hO),dD(s,vO,a),dD(s,gO,s),dD(a,vO,a),dD(a,hO),dD(a,gO,a);let c=$(n,xO,wD,{[oD]:!0}),l=$(n,bO,CD,{[oD]:!0}),u=dD(n,yO,CD,{[oD]:!0});$(n,wO,u),$(l,xO,c),$(l,wO,u),dD(l,yO,u),$(u,bO),$(u,xO),dD(u,yO,u),$(u,wO,u);let d=dD(n,_O,fO,{[rD]:!0});$(d,`#`),dD(d,_O,d),$(d,SO,d);let f=$(d,CO);$(f,`#`),dD(f,_O,d);let p=[[hO,o],[vO,i]],m=[[hO,null],[gO,s],[vO,a]];for(let e=0;e<TO.length;e++)AO(n,TO[e],vD,pD,p);for(let e=0;e<EO.length;e++)AO(n,EO[e],yD,mD,m);cD(vD,{tld:!0,ascii:!0},t),cD(yD,{utld:!0,alpha:!0},t),AO(n,`file`,bD,pD,p),AO(n,`mailto`,bD,pD,p),AO(n,`http`,xD,pD,p),AO(n,`https`,xD,pD,p),AO(n,`ftp`,xD,pD,p),AO(n,`ftps`,xD,pD,p),cD(bD,{scheme:!0,ascii:!0},t),cD(xD,{slashscheme:!0,ascii:!0},t),e=e.sort((e,t)=>
vendor: 56,452 bytes, lines 355-369
355e[0]>t[0]?1:-1);for(let t=0;t<e.length;t++){let r=e[t][0],i=e[t][1]?{[iD]:!0}:{[aD]:!0};r.indexOf(`-`)>=0?i[nD]=!0:hO.test(r)?vO.test(r)?i[eD]=!0:i[QE]=!0:i[ZE]=!0,fD(n,r,r,i)}return fD(n,`localhost`,_D,{ascii:!0}),n.jd=new uD(pO),{start:n,tokens:Object.assign({groups:t},mO)}}function OO(e,t){let n=kO(t.replace(/[A-Z]/g,e=>e.toLowerCase())),r=n.length,i=[],a=0,o=0;for(;o<r;){let s=e,c=null,l=0,u=null,d=-1,f=-1;for(;o<r&&(c=s.go(n[o]));)s=c,s.accepts()?(d=0,f=0,u=s):d>=0&&(d+=n[o].length,f++),l+=n[o].length,a+=n[o].length,o++;a-=d,o-=f,l-=d,i.push({t:u.t,v:t.slice(a-l,a),s:a-l,e:a})}return i}function kO(e){let t=[],n=e.length,r=0;for(;r<n;){let i=e.charCodeAt(r),a,o=i<55296||i>56319||r+1===n||(a=e.charCodeAt(r+1))<56320||a>57343?e[r]:e.slice(r,r+2);t.push(o),r+=o.length}return t}function AO(e,t,n,r,i){let a,o=t.length;for(let n=0;n<o-1;n++){let o=t[n];e.j[o]?a=e.j[o]:(a=new uD(r),a.jr=i.slice(),e.j[o]=a),e=a}return a=new uD(n),a.jr=i.slice(),e.j[t[o-1]]=a,a}function jO(e){let t=[],n=[],r=0;for(;r<e.length;){let i=0;for(;`0123456789`.indexOf(e[r+i])>=0;)i++;if(i>0){t.push(n.join(``));for(let t=parseInt(e.substring(r,r+i),10);t>0;t--)n.pop();r+=i}else n.push(e[r]),r++}return t}var MO={defaultProtocol:`http`,events:null,format:PO,formatHref:PO,nl2br:!1,tagName:`a`,target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function NO(e,t=null){let n=Object.assign({},MO);e&&(n=Object.assign(n,e instanceof NO?e.o:e));let r=n.ignoreTags,i=[];for(let e=0;e<r.length;e++)i.push(r[e].toUpperCase());this.o=n,t&&(this.defaultRender=t),this.ignoreTags=i}NO.prototype={o:MO,ignoreTags:[],defaultRender(e){return e},check(e){return this.get(`validate`,e.toString(),e)},get(e,t,n){let r=t!=null,i=this.o[e];return i&&(typeof i==`object`?(i=n.t in i?i[n.t]:MO[e],typeof i==`function`&&r&&(i=i(t,n))):typeof i==`function`&&r&&(i=i(t,n.t,n)),i)},getObj(e,t,n){let r=this.o[e];return typeof r==`function`&&t!=null&&(r=r(t,n.t,n)),r},render(e){let t=e.render(this);return(this.get(`render`,null,e)||this.defaultRender)(t,e.t,e)}};function PO(e){return e}function FO(e,t){this.t=`token`,this.v=e,this.tk=t}FO.prototype={isLink:!1,toString(){return this.v},toHref(e){return this.toString()},toFormattedString(e){let t=this.toString(),n=e.get(`truncate`,t,this),r=e.get(`format`,t,this);return n&&r.length>n?r.substring(0,n)+`â¦`:r},toFormattedHref(e){return e.get(`formatHref`,this.toHref(e.get(`defaultProtocol`)),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(e=MO.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(e){return{type:this.t,value:this.toFormattedString(e),isLink:this.isLink,href:this.toFormattedHref(e),start:this.startIndex(),end:this.endIndex()}},validate(e){return e.get(`validate`,this.toString(),this)},render(e){let t=this,n=this.toHref(e.get(`defaultProtocol`)),r=e.get(`formatHref`,n,this),i=e.get(`tagName`,n,t),a=this.toFormattedString(e),o={},s=e.get(`className`,n,t),c=e.get(`target`,n,t),l=e.get(`rel`,n,t),u=e.getObj(`attributes`,n,t),d=e.getObj(`events`,n,t);return o.href=r,s&&(o.class=s),c&&(o.target=c),l&&(o.rel=l),u&&Object.assign(o,u),{tagName:i,attributes:o,content:a,eventListeners:d}}};function IO(e,t){class n extends FO{constructor(t,n){super(t,n),this.t=e}}for(let e in t)n.prototype[e]=t[e];return n.t=e,n}var LO=IO(`email`,{isLink:!0,toHref(){return`mailto:`+this.toString()}}),RO=IO(`text`),zO=IO(`nl`),BO=IO(`url`,{isLink:!0,toHref(e=MO.defaultProtocol){return this.hasProtocol()?this.v:`${e}://${this.v}`},hasProtocol(){let e=this.tk;return e.length>=2&&e[0].t!==_D&&e[1].t===JD}}),VO=e=>new uD(e);function HO({groups:e}){let t=e.domain.concat([VD,UD,WD,GD,KD,qD,XD,QD,eO,SD,tO,nO,rO,iO,lO,pO,uO,dO]),n=[HD,JD,YD,ZD,$D,tO,aO,oO,cO,jD,MD,TD,ED,OD,DD,kD,AD,ND,PD,FD,ID,LD,RD,zD,BD],r=[VD,HD,UD,GD,KD,qD,XD,QD,eO,TD,ED,tO,nO,rO,iO,aO,lO,pO,uO,dO],i=VO(),a=$(i,uO);Q(a,r,a),Q(a,e.domain,a);let o=VO(),s=VO(),c=VO();Q(i,e.domain,o),Q(i,e.scheme,s),Q(i,e.slashscheme,c),Q(o,r,a),Q(o,e.domain,o);let l=$(o,WD);$(a,WD,l),$(s,WD,l),$(c,WD,l);let u=$(a,ZD);Q(u,r,a),Q(u,e.domain,a);let d=VO();Q(l,e.domain,d),Q(d,e.domain,d);let f=$(d,ZD);Q(f,e.domain,d);let p=VO(LO);Q(f,e.tld,p),Q(f,e.utld,p),$(l,_D,p);let m=$(d,eO);$(m,eO,m),Q(m,e.domain,d),Q(p,e.domain,d),$(p,ZD,f),$(p,eO,m);let h=$(o,eO),g=$(o,ZD);$(h,eO,h),Q(h,e.domain,o),Q(g,r,a),Q(g,e.domain,o);let _=VO(BO);Q(g,e.tld,_),Q(g,e.utld,_),Q(_,e.domain,o),Q(_,r,a),$(_,ZD,g),$(_,eO,h),$(_,WD,l);let v=$(_,JD),y=VO(BO);Q(v,e.numeric,y);let b=VO(BO),x=VO();Q(b,t,b),Q(b,n,x),Q(x,t,b),Q(x,n,x),$(_,lO,b),$(y,lO,b);let S=$(s,JD),C=$($($(c,JD),lO),lO);Q(s,e.domain,o),$(s,ZD,g),$(s,eO,h),Q(c,e.domain,o),$(c,ZD,g),$(c,eO,h),Q(S,e.domain,b),$(S,lO,b),$(S,aO,b),Q(C,e.domain,b),Q(C,t,b),$(C,lO,b);let w=[[TD,ED],[DD,OD],[kD,AD],[jD,MD],[ND,PD],[FD,ID],[LD,RD],[zD,BD]];for(let e=0;e<w.length;e++){let[r,i]=w[e],a=$(b,r);$(x,r,a);let o=VO(BO);Q(a,t,o);let s=VO();Q(a,n,s),$(a,i,b),Q(o,t,o),Q(o,n,s),Q(s,t,o),Q(s,n,s),$(o,i,b),$(s,i,b)}return $(i,_D,_),$(i,wD,zO),{start:i,tokens:mO}}function UO(e,t,n){let r=n.length,i=0,a=[],o=[];for(;i<r;){let s=e,c=null,l=null,u=0,d=null,f=-1;for(;i<r&&!(c=s.go(n[i].t));)o.push(n[i++]);for(;i<r&&(l=c||s.go(n[i].t));)c=null,s=l,s.accepts()?(f=0,d=s):f>=0&&f++,i++,u++;if(f<0)i-=u,i<r&&(o.push(n[i]),i++);else{o.length>0&&(a.push(WO(RO,t,o)),o=[]),i-=f,u-=f;let e=d.t,r=n.slice(i-u,i);a.push(WO(e,t,r))}}return o.length>0&&a.push(WO(RO,t,o)),a}function WO(e,t,n){let r=n[0].s,i=n[n.length-1].e;return new e(t.slice(r,i),n)}var GO=typeof console<`u`&&console&&console.warn||(()=>{}),KO=`until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.`,qO={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function JO(){return uD.groups={},qO.scanner=null,qO.parser=null,qO.tokenQueue=[],qO.pluginQueue=[],qO.customSchemes=[],qO.initialized=!1,qO}function YO(e,t=!1){if(qO.initialized&&GO(`linkifyjs: already initialized - will not register custom scheme "${e}" ${KO}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(e))throw Error(`linkifyjs: incorrect scheme format. 3561. Must only contain digits, lowercase ASCII letters or "-" 3572. Cannot start or end with "-" 3583. "-" cannot repeat`);qO.customSchemes.push([e,t])}function XO(){qO.scanner=DO(qO.customSchemes);for(let e=0;e<qO.tokenQueue.length;e++)qO.tokenQueue[e][1]({scanner:qO.scanner});qO.parser=HO(qO.scanner.tokens);for(let e=0;e<qO.pluginQueue.length;e++)qO.pluginQueue[e][1]({scanner:qO.scanner,parser:qO.parser});return qO.initialized=!0,qO}function ZO(e){return qO.initialized||XO(),UO(qO.parser.start,e,OO(qO.scanner.start,e))}ZO.scan=OO;function QO(e,t=null,n=null){if(t&&typeof t==`object`){if(n)throw Error(`linkifyjs: Invalid link type ${t}; must be a string`);n=t,t=null}let r=new NO(n),i=ZO(e),a=[];for(let e=0;e<i.length;e++){let n=i[e];n.isLink&&(!t||n.t===t)&&r.check(n)&&a.push(n.toFormattedObject(r))}return a}var $O=`[\0- \xA0áá â-\u2029âã]`,ek=new RegExp($O),tk=RegExp(`${$O}$`),nk=new RegExp($O,`g`);function rk(e){return e.length===1?e[0].isLink:e.length===3&&e[1].isLink?[`()`,`[]`].includes(e[0].value+e[2].value):!1}function ik(e){return new dm({key:new mm(`autolink`),appendTransaction:(t,n,r)=>{let i=t.some(e=>e.docChanged)&&!n.doc.eq(r.doc),a=t.some(e=>e.getMeta(`preventAutolink`));if(!i||a)return;let{tr:o}=r;if(Bx(lx(n.doc,[...t])).forEach(({newRange:t})=>{let n=dx(r.doc,t,e=>e.isTextblock),i,a;if(n.length>1)i=n[0],a=r.doc.textBetween(i.pos,i.pos+i.node.nodeSize,void 0,` `);else if(n.length){let e=r.doc.textBetween(t.from,t.to,` `,` `);if(!tk.test(e))return;i=n[0],a=r.doc.textBetween(i.pos,t.to,void 0,` `)}if(i&&a){let t=a.split(ek).filter(Boolean);if(t.length<=0)return!1;let n=t[t.length-1],s=i.pos+a.lastIndexOf(n);if(!n)return!1;let c=ZO(n).map(t=>t.toObject(e.defaultProtocol));if(!rk(c))return!1;c.filter(e=>e.isLink).map(e=>({...e,from:s+e.start+1,to:s+e.end+1})).filter(e=>r.schema.marks.code?!r.doc.rangeHasMark(e.from,e.to,r.schema.marks.code):!0).filter(t=>e.validate(t.value)).filter(t=>e.shouldAutoLink(t.value)).forEach(t=>{Vx(t.from,t.to,r.doc).some(t=>t.mark.type===e.type)||o.addMark(t.from,t.to,e.type.create({href:t.href}))})}}),o.steps.length)return o}})}function ak(e){return new dm({key:new mm(`handleClickLink`),props:{handleClick:(t,n,r)=>{if(r.button!==0||!t.editable)return!1;let i=null;if(r.target instanceof HTMLAnchorElement)i=r.target;else{let t=r.target;if(!t)return!1;let n=e.editor.view.dom;i=t.closest(`a`),i&&!n.contains(i)&&(i=null)}if(!i)return!1;let a=!1;if(e.enableClickSelection&&(a=e.editor.commands.extendMarkRange(e.type.name)),e.openOnClick){let n=Lx(t.state,e.type.name),r=i.href??n.href,o=i.target??n.target;r&&(window.open(r,o),a=!0)}return a}}})}function ok(e){return new dm({key:new mm(`handlePasteLink`),props:{handlePaste:(t,n,r)=>{let{shouldAutoLink:i}=e,{state:a}=t,{selection:o}=a,{empty:s}=o;if(s)return!1;let c=``;r.content.forEach(e=>{c+=e.textContent});let l=QO(c,{defaultProtocol:e.defaultProtocol}).find(e=>e.isLink&&e.value===c);return!c||!l||i!==void 0&&!i(l.value)?!1:e.editor.commands.setMark(e.type,{href:l.href})}}})}function sk(e,t){let n=[`http`,`https`,`ftp`,`ftps`,`mailto`,`tel`,`callto`,`sms`,`cid`,`xmpp`];return t&&t.forEach(e=>{let t=typeof e==`string`?e:e.scheme;t&&n.push(t)}),!e||e.replace(nk,``).match(RegExp(`^(?:(?:${n.map(e=>e.replace(/[-/\\^$*+?.()|[\]{}]/g,`\\$&`)).join(`|`)}):|[^a-z]|[a-z0-9+.\\-]+(?:[^a-z+.\\-:]|$))`,`i`))}var ck=QS.create({name:`link`,priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(e=>{if(typeof e==`string`){YO(e);return}YO(e.scheme,e.optionalSlashes)})},onDestroy(){JO()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:`http`,HTMLAttributes:{target:`_blank`,rel:`noopener noreferrer nofollow`,class:null},isAllowedUri:(e,t)=>!!sk(e,t.protocols),validate:e=>!!e,shouldAutoLink:e=>{let t=/^[a-z][a-z0-9+.-]*:\/\//i.test(e),n=/^[a-z][a-z0-9+.-]*:/i.test(e);if(t||n&&!e.includes(`@`))return!0;let r=(e.includes(`@`)?e.split(`@`).pop():e).split(/[/?#:]/)[0];return!(/^\d{1,3}(\.\d{1,3}){3}$/.test(r)||!/\./.test(r))}}},addAttributes(){return{href:{default:null,parseHTML(e){return e.getAttribute(`href`)}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class},title:{default:null}}},parseHTML(){return[{tag:`a[href]`,getAttrs:e=>{let t=e.getAttribute(`href`);return!t||!this.options.isAllowedUri(t,{defaultValidate:e=>!!sk(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:e}){return this.options.isAllowedUri(e.href,{defaultValidate:e=>!!sk(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?[`a`,Cx(this.options.HTMLAttributes,e),0]:[`a`,Cx(this.options.HTMLAttributes,{...e,href:``}),0]},markdownTokenName:`link`,parseMarkdown:(e,t)=>t.applyMark(`link`,t.parseInline(e.tokens||[]),{href:e.href,title:e.title||null}),renderMarkdown:(e,t)=>{let n=e.attrs?.href??``,r=e.attrs?.title??``,i=t.renderChildren(e);return r?`[${i}](${n} "${r}")`:`[${i}](${n})`},addCommands(){return{setLink:e=>({chain:t})=>{let{href:n}=e;return this.options.isAllowedUri(n,{defaultValidate:e=>!!sk(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?t().setMark(this.name,e).setMeta(`preventAutolink`,!0).run():!1},toggleLink:e=>({chain:t})=>{let{href:n}=e||{};return n&&!this.options.isAllowedUri(n,{defaultValidate:e=>!!sk(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:t().toggleMark(this.name,e,{extendEmptyMarkRange:!0}).setMeta(`preventAutolink`,!0).run()},unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta(`preventAutolink`,!0).run()}},addPasteRules(){return[OC({find:e=>{let t=[];if(e){let{protocols:n,defaultProtocol:r}=this.options,i=QO(e).filter(e=>e.isLink&&this.options.isAllowedUri(e.value,{defaultValidate:e=>!!sk(e,n),protocols:n,defaultProtocol:r}));i.length&&i.forEach(e=>{this.options.shouldAutoLink(e.value)&&t.push({text:e.value,data:{href:e.href},index:e.start})})}return t},type:this.type,getAttributes:e=>({href:e.data?.href})})]},addProseMirrorPlugins(){let e=[],{protocols:t,defaultProtocol:n}=this.options;return this.options.autolink&&e.push(ik({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:e=>this.options.isAllowedUri(e,{defaultValidate:e=>!!sk(e,t),protocols:t,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),e.push(ak({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick===`whenNotEditable`?!0:this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&e.push(ok({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),e}}),lk=ck,uk=Object.defineProperty,dk=(e,t)=>{for(var n in t)uk(e,n,{get:t[n],enumerable:!0})},fk=`listItem`,pk=`textStyle`,mk=/^\s*([-+*])\s$/,hk=DC.create({name:`bulletList`,addOptions(){return{itemTypeName:`listItem`,HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:`block list`,content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul`}]},renderHTML({HTMLAttributes:e}){return[`ul`,Cx(this.options.HTMLAttributes,e),0]},markdownTokenName:`list`,parseMarkdown:(e,t)=>e.type!==`list`||e.ordered?[]:{type:`bulletList`,content:e.items?t.parseChildren(e.items):[]},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,` 359`):``,markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(fk,this.editor.getAttributes(pk)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=wC({find:mk,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=wC({find:mk,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(pk),editor:this.editor})),[e]}}),gk=(e,t,n)=>{let{selection:r}=e;if(!r.empty)return null;let{$from:i}=r;if(!i.parent.isTextblock||i.parentOffset!==i.parent.content.size)return null;let a=-1;for(let e=i.depth;e>0;--e)if(i.node(e).type.name===t){a=e;break}if(a<0)return null;let o=i.node(a),s=i.index(a);if(s+1>=o.childCount)return null;let c=o.child(s+1);if(!n.includes(c.type.name))return null;let l=e.schema.nodes[t],u=!1;if(c.forEach(e=>{e.type===l&&e.childCount>1&&(u=!0)}),!u)return null;let d=e.doc.resolve(i.after()).nodeAfter;if(!d||!n.includes(d.type.name))return null;let f=[];return d.forEach(e=>{f.push(e)}),f.length===0?null:{listItemDepth:a,nestedList:d,nestedListPos:i.after(),insertPos:i.after(a),items:f}},_k=(e,t,n,r)=>{let i=gk(e,n,r);if(!i)return!1;let{selection:a}=e,{nestedList:o,nestedListPos:s,insertPos:c,items:l}=i,u=e.tr;u.delete(s,s+o.nodeSize);let d=u.mapping.map(c);return u.insert(d,G.from(l)),u.setSelection(a.map(u.doc,u.mapping)),t&&t(u),!0},vk=(e,t,n)=>_k(e.state,e.view.dispatch,t,n),yk=(e,t)=>oC.create({name:`${e}BranchingDeleteKeymap`,priority:101,addKeyboardShortcuts(){let n=()=>vk(this.editor,e,t);return{Delete:n,"Mod-Delete":n}}}),bk=[[1e3,`m`],[900,`cm`],[500,`d`],[400,`cd`],[100,`c`],[90,`xc`],[50,`l`],[40,`xl`],[10,`x`],[9,`ix`],[5,`v`],[4,`iv`],[1,`i`]],xk=`abcdefghijklmnopqrstuvwxyz`,Sk=String.raw`\d+|[ivxlcdmIVXLCDM]+|${`[a-zA-Z]{1,2}`}`;function Ck(e){let t=e,n=``;for(let[e,r]of bk)for(;t>=e;)n+=r,t-=e;return n}function wk(e){return Ck(e).toUpperCase()}function Tk(e){let t=e.toLowerCase(),n=0,r=0;for(;n<t.length;){let e=!1;for(let[i,a]of bk)if(t.startsWith(a,n)){r+=i,n+=a.length,e=!0;break}if(!e)return 0}return r}function Ek(e){if(!/^[ivxlcdmIVXLCDM]+$/.test(e))return!1;let t=Tk(e);return t<=0?!1:(e===e.toLowerCase()?Ck(t):wk(t))===e}function Dk(e){let t=e.toLowerCase();if(t.length===1)return t.charCodeAt(0)-97+1;if(t.length===2){let e=t.charCodeAt(0)-97,n=t.charCodeAt(1)-97;return(e+1)*26+n+1}return 0}function Ok(e){if(e<=26)return xk[e-1];let t=Math.floor((e-1)/26)-1,n=(e-1)%26;return t<0?xk[n]:xk[t]+xk[n]}function kk(e){if(!(!e||/^\d+$/.test(e))){if(Ek(e))return e===e.toLowerCase()?`i`:`I`;if(/^[a-z]{1,2}$/.test(e))return`a`;if(/^[A-Z]{1,2}$/.test(e))return`A`}}function Ak(e){if(/^\d+$/.test(e))return parseInt(e,10);let t=kk(e);if(t===`i`||t===`I`)return Tk(e);if(t===`a`||t===`A`){let t=Dk(e);return t>0?t:1}let n=parseInt(e,10);return Number.isNaN(n)?1:n}function jk(e,t){if(e===`numeric`)return String(t);switch(e){case`a`:return Ok(t);case`A`:return Ok(t).toUpperCase();case`i`:return Ck(t);case`I`:return wk(t);default:return String(t)}}function Mk(e){if(e.length===0)return!1;let t=kk(e[0])??`numeric`,n=Ak(e[0]);if(n<1)return!1;for(let r=0;r<e.length;r++){let i=jk(t,n+r);if(e[r]!==i)return!1}return!0}function Nk(e){return{type:kk(e),start:Ak(e)}}function Pk(e){let{type:t,start:n}=Nk(e),r={};return t&&(r.type=t),n!==1&&(r.start=n),r}function Fk(e,t,n=`. `){let r=t+1;if(!e||e===`1`)return`${r}${n}`;switch(e){case`a`:return`${Ok(r)}${n}`;case`A`:return`${Ok(r).toUpperCase()}${n}`;case`i`:return`${Ck(r)}${n}`;case`I`:return`${wk(r)}${n}`;default:return`${r}${n}`}}function Ik(e){let t=e.tokens?.[0];return!!(e.text&&e.tokens?.length===1&&t?.type===`list`&&t.ordered&&t.raw===e.text)}function Lk(e,t){return t.tokenizeInline?t.parseInline(t.tokenizeInline(e)):t.parseInline([{type:`text`,raw:e,text:e}])}var Rk=DC.create({name:`listItem`,addOptions(){return{HTMLAttributes:{},bulletListTypeName:`bulletList`,orderedListTypeName:`orderedList`}},content:`paragraph block*`,defining:!0,parseHTML(){return[{tag:`li`}]},renderHTML({HTMLAttributes:e}){return[`li`,Cx(this.options.HTMLAttributes,e),0]},markdownTokenName:`list_item`,parseMarkdown:(e,t)=>{if(e.type!==`list_item`)return[];let n=t.parseBlockChildren??t.parseChildren,r=[];if(e.tokens&&e.tokens.length>0){if(Ik(e))return{type:`listItem`,content:[{type:`paragraph`,content:Lk(e.text||``,t)}]};if(e.tokens.some(e=>e.type===`paragraph`))r=n(e.tokens);else{let i=e.tokens[0];if(i&&i.type===`text`&&i.tokens&&i.tokens.length>0){if(r=[{type:`paragraph`,content:t.parseInline(i.tokens)}],e.tokens.length>1){let t=n(e.tokens.slice(1));r.push(...t)}}else r=n(e.tokens)}}return r.length===0&&(r=[{type:`paragraph`,content:[]}]),{type:`listItem`,content:r}},renderMarkdown:(e,t,n)=>WS(e,t,e=>{if(e.parentType===`bulletList`)return`- `;if(e.parentType===`orderedList`){let t=e.meta?.parentAttrs?.start||1;return Fk(e.meta?.parentAttrs?.type,t-1+(e.index||0),`. `)}return`- `},n),addExtensions(){return[yk(this.name,[this.options.bulletListTypeName,this.options.orderedListTypeName])]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}});dk({},{findListItemPos:()=>zk,getNextListDepth:()=>Bk,handleBackspace:()=>Hk,handleDelete:()=>Gk,hasListBefore:()=>Vk,hasListItemAfter:()=>Kk,hasListItemBefore:()=>qk,listItemHasSubList:()=>Jk,nextListIsDeeper:()=>Uk,nextListIsHigher:()=>Wk});var zk=(e,t)=>{let{$from:n}=t.selection,r=nb(e,t.schema),i=null,a=n.depth,o=n.pos,s=null;for(;a>0&&s===null;)i=n.node(a),i.type===r?s=a:(--a,--o);return s===null?null:{$pos:t.doc.resolve(o),depth:s}},Bk=(e,t)=>{let n=zk(e,t);if(!n)return!1;let[,r]=Hx(t,e,n.$pos.pos+4);return r},Vk=(e,t,n)=>{let{$anchor:r}=e.selection,i=Math.max(0,r.pos-2),a=e.doc.resolve(i).node();return!(!a||!n.includes(a.type.name))},Hk=(e,t,n)=>{if(e.commands.undoInputRule())return!0;if(e.state.selection.from!==e.state.selection.to)return!1;if(!Gb(e.state,t)&&Vk(e.state,t,n)){let{$anchor:n}=e.state.selection,r=e.state.doc.resolve(n.before()-1),i=[];r.node().descendants((e,n)=>{e.type.name===t&&i.push({node:e,pos:n})});let a=i.at(-1);if(!a)return!1;let o=e.state.doc.resolve(r.start()+a.pos+1);return e.chain().cut({from:n.start()-1,to:n.end()+1},o.end()).joinForward().run()}return!Gb(e.state,t)||!Yx(e.state)?!1:e.chain().liftListItem(t).run()},Uk=(e,t)=>{let n=Bk(e,t),r=zk(e,t);return!r||!n?!1:n>r.depth},Wk=(e,t)=>{let n=Bk(e,t),r=zk(e,t);return!r||!n?!1:n<r.depth},Gk=(e,t)=>{if(!Gb(e.state,t)||!Jx(e.state,t))return!1;let{selection:n}=e.state,{$from:r,$to:i}=n;return!n.empty&&r.sameParent(i)?!1:Uk(t,e.state)?e.chain().focus(e.state.selection.from+4).lift(t).joinBackward().run():Wk(t,e.state)?e.chain().joinForward().joinBackward().run():e.commands.joinItemForward()},Kk=(e,t)=>{let{$anchor:n}=t.selection,r=t.doc.resolve(n.pos-n.parentOffset-2);return!(r.index()===r.parent.childCount-1||r.nodeAfter?.type.name!==e)},qk=(e,t)=>{let{$anchor:n}=t.selection,r=t.doc.resolve(n.pos-2);return!(r.index()===0||r.nodeBefore?.type.name!==e)},Jk=(e,t,n)=>{if(!n)return!1;let r=nb(e,t.schema),i=!1;return n.descendants(e=>{e.type===r&&(i=!0)}),i},Yk=oC.create({name:`listKeymap`,addOptions(){return{listTypes:[{itemName:`listItem`,wrapperNames:[`bulletList`,`orderedList`]},{itemName:`taskItem`,wrapperNames:[`taskList`]}]}},addKeyboardShortcuts(){return{Delete:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{e.state.schema.nodes[n]!==void 0&&Gk(e,n)&&(t=!0)}),t},"Mod-Delete":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{e.state.schema.nodes[n]!==void 0&&Gk(e,n)&&(t=!0)}),t},Backspace:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{e.state.schema.nodes[n]!==void 0&&Hk(e,n,r)&&(t=!0)}),t},"Mod-Backspace":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{e.state.schema.nodes[n]!==void 0&&Hk(e,n,r)&&(t=!0)}),t}}}}),Xk=RegExp(`^(\\s*)(${Sk})([.)])\\s+(.*)$`),Zk=RegExp(`^(\\s*)(${Sk})([.)])\\s+`),Qk=/^\s/;function $k(e){return Xk.test(e.trimStart())}function eA(e){let t=e.trimStart();return/^[-+*]\s+/.test(t)||$k(t)||/^>\s?/.test(t)||/^```/.test(t)||/^~~~/.test(t)}function tA(e){let t=[],n=[],r=!1;return e.forEach(e=>{if(r){n.push(e);return}if(e.trim()===``){r=!0,n.push(e);return}if(t.length>0&&eA(e)){r=!0,n.push(e);return}t.push(e)}),{paragraphLines:t,blockLines:n}}function nA(e){let t=[],n=0,r=0;for(;n<e.length;){let i=e[n],a=i.match(Xk);if(!a)break;let[,o,s,c,l]=a,u=o.length,d=parseInt(s,10),f=isNaN(d)?kk(s):void 0,p=isNaN(d)?Ak(s):d,m=[l],h=n+1,g=[i],_=!1;for(;h<e.length;){let t=e[h];if(t.match(Xk))break;if(t.trim()===``)g.push(t),m.push(``),_=!0,h+=1;else if(t.match(Qk)){let e=t.length-t.trimStart().length,n=u+s.length+1;g.push(t),m.push(t.slice(Math.min(e,n))),h+=1}else{if(_)break;g.push(t),m.push(t),h+=1}}t.push({indent:u,number:p,type:f,content:m.join(` 360`).trim(),contentLines:m,raw:g.join(` 361`)}),r=h,n=h}return[t,r]}var rA=RegExp(`^(${Sk})([.)])\\s+(.+)$`);function iA(e){let t=e.split(` 362`).filter(e=>e.trim().length>0);if(t.length===0)return null;let n=[];for(let e of t){let t=e.trim().match(rA);if(!t)return null;n.push({marker:t[1],content:t[3]})}return Mk(n.map(e=>e.marker))?{type:`orderedList`,attrs:Pk(n[0].marker),content:n.map(e=>({type:`listItem`,content:[{type:`paragraph`,content:[{type:`text`,text:e.content}]}]}))}:null}function aA(e,t,n){let r=[],i=0;for(;i<e.length;){let a=e[i];if(a.indent===t){let{paragraphLines:o,blockLines:s}=tA(a.contentLines),c=o.join(` 363`).trim(),l=[];c&&l.push({type:`paragraph`,raw:c,tokens:n.inlineTokens(c)});let u=s.join(` 364`).trim();if(u){let e=n.blockTokens(u);l.push(...e)}let d=i+1,f=[];for(;d<e.length&&e[d].indent>t;)f.push(e[d]),d+=1;if(f.length>0){let e=aA(f,Math.min(...f.map(e=>e.indent)),n);l.push({type:`list`,ordered:!0,start:f[0].number,typeMarker:f[0].type,items:e,raw:f.map(e=>e.raw).join(` 365`)})}r.push({type:`list_item`,raw:a.raw,tokens:l}),i=d}else i+=1}return r}function oA(e,t){return e.map(e=>{if(e.type!==`list_item`)return t.parseChildren([e])[0];let n=[];return e.tokens&&e.tokens.length>0&&e.tokens.forEach(e=>{if(e.type===`paragraph`||e.type===`list`||e.type===`blockquote`||e.type===`code`)n.push(...t.parseChildren([e]));else if(e.type===`text`&&e.tokens){let r=t.parseChildren([e]);n.push({type:`paragraph`,content:r})}else{let r=t.parseChildren([e]);r.length>0&&n.push(...r)}}),{type:`listItem`,content:n}})}var sA=`listItem`,cA=`textStyle`,lA=/^(\d+)\.\s$/;function uA(e){let t=e.match(/list-style-type\s*:\s*([^;]+)/i);if(!t)return null;switch(t[1].trim().toLowerCase()){case`upper-roman`:return`I`;case`lower-roman`:return`i`;case`upper-alpha`:case`upper-latin`:return`A`;case`lower-alpha`:case`lower-latin`:return`a`;default:return null}}var dA=DC.create({name:`orderedList`,addOptions(){return{itemTypeName:`listItem`,HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:`block list`,content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:e=>e.hasAttribute(`start`)?parseInt(e.getAttribute(`start`)||``,10):1},type:{default:null,parseHTML:e=>{let t=e.getAttribute(`type`);if(t)return t;let n=e.getAttribute(`style`);if(n){let e=uA(n);if(e)return e}let r=e.querySelector(`li`);if(r){let e=r.getAttribute(`style`);if(e){let t=uA(e);if(t)return t}}return null}}}},parseHTML(){return[{tag:`ol`}]},renderHTML({HTMLAttributes:e}){let{start:t,type:n,...r}=e,i=Cx(this.options.HTMLAttributes,r);return t!==1&&(i.start=t),n&&n!==`1`&&(i.type=n),[`ol`,i,0]},markdownTokenName:`list`,parseMarkdown:(e,t)=>{if(e.type!==`list`||!e.ordered)return[];let n=e.start||1,r=e.typeMarker,i=e.items?oA(e.items,t):[],a={};return n!==1&&(a.start=n),r&&(a.type=r),Object.keys(a).length>0?{type:`orderedList`,attrs:a,content:i}:{type:`orderedList`,content:i}},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,` 366`):``,markdownTokenizer:{name:`orderedList`,level:`block`,start:e=>{let t=e.match(Zk)?.index;return t===void 0?-1:t},tokenize:(e,t,n)=>{let r=e.split(` 367`),[i,a]=nA(r);if(i.length===0)return;let o=aA(i,0,n);if(o.length!==0)return{type:`list`,ordered:!0,start:i[0]?.number||1,typeMarker:i[0]?.type,items:o,raw:r.slice(0,a).join(` 368`)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(sA,this.editor.getAttributes(cA)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addProseMirrorPlugins(){return[new dm({props:{handlePaste:(e,t)=>{if((t.clipboardData?.getData(`text/html`))?.trim())return!1;let n=t.clipboardData?.getData(`text/plain`);if(!n)return!1;let r=iA(n);if(!r)return!1;try{let t=e.state.schema.nodeFromJSON(r),n=e.state.tr.replaceSelectionWith(t);return e.dispatch(n),!0}catch{return!1}}}})]},addInputRules(){let e=(e,t)=>(!t.attrs.type||t.attrs.type===`1`)&&t.childCount+t.attrs.start===+e[1],t=wC({find:lA,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:e});return(this.options.keepMarks||this.options.keepAttributes)&&(t=wC({find:lA,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(cA)}),joinPredicate:e,editor:this.editor})),[t]}}),fA=/^\s*(\[([( |x])?\])\s$/,pA=DC.create({name:`taskItem`,addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:`taskList`,a11y:void 0}},content(){return this.options.nested?`paragraph block*`:`paragraph+`},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:e=>{let t=e.getAttribute(`data-checked`);return t===``||t===`true`},renderHTML:e=>({"data-checked":e.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:e,HTMLAttributes:t}){return[`li`,Cx(this.options.HTMLAttributes,t,{"data-type":this.name}),[`label`,[`input`,{type:`checkbox`,checked:e.attrs.checked?`checked`:null}],[`span`]],[`div`,0]]},parseMarkdown:(e,t)=>{let n=[];if(e.tokens&&e.tokens.length>0?n.push(t.createNode(`paragraph`,{},t.parseInline(e.tokens))):e.text?n.push(t.createNode(`paragraph`,{},[t.createNode(`text`,{text:e.text})])):n.push(t.createNode(`paragraph`,{},[])),e.nestedTokens&&e.nestedTokens.length>0){let r=t.parseChildren(e.nestedTokens);n.push(...r)}return t.createNode(`taskItem`,{checked:e.checked||!1},n)},renderMarkdown:(e,t)=>WS(e,t,`- [${e.attrs?.checked?`x`:` `}] `),addExtensions(){return this.options.nested?[yk(this.name,[this.options.taskListTypeName])]:[]},addKeyboardShortcuts(){let e={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...e,Tab:()=>this.editor.commands.sinkListItem(this.name)}:e},addNodeView(){return({node:e,HTMLAttributes:t,getPos:n,editor:r})=>{let i=document.createElement(`li`),a=document.createElement(`label`),o=document.createElement(`span`),s=document.createElement(`input`),c=document.createElement(`div`),l=e=>{var t;s.ariaLabel=((t=this.options.a11y)?.checkboxLabel)?.call(t,e,s.checked)||`Task item checkbox for ${e.textContent||`empty task item`}`};l(e),a.contentEditable=`false`,s.type=`checkbox`,s.addEventListener(`mousedown`,e=>e.preventDefault()),s.addEventListener(`change`,t=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){s.checked=!s.checked;return}let{checked:i}=t.target;r.isEditable&&typeof n==`function`&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:e})=>{let t=n();if(typeof t!=`number`)return!1;let r=e.doc.nodeAt(t);return e.setNodeMarkup(t,void 0,{...r?.attrs,checked:i}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(e,i)||(s.checked=!s.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([e,t])=>{i.setAttribute(e,t)}),i.dataset.checked=e.attrs.checked,s.checked=e.attrs.checked,a.append(s,o),i.append(a,c),Object.entries(t).forEach(([e,t])=>{i.setAttribute(e,t)});let u=new Set(Object.keys(t));return{dom:i,contentDOM:c,update:e=>{if(e.type!==this.type)return!1;i.dataset.checked=e.attrs.checked,s.checked=e.attrs.checked,l(e);let t=r.extensionManager.attributes,n=wx(e,t),a=new Set(Object.keys(n)),o=this.options.HTMLAttributes;return u.forEach(e=>{a.has(e)||(e in o?i.setAttribute(e,o[e]):i.removeAttribute(e))}),Object.entries(n).forEach(([e,t])=>{t==null?e in o?i.setAttribute(e,o[e]):i.removeAttribute(e):i.setAttribute(e,t)}),u=a,!0}}}},addInputRules(){return[wC({find:fA,type:this.type,getAttributes:e=>({checked:e[e.length-1]===`x`})})]}}),mA=DC.create({name:`taskList`,addOptions(){return{itemTypeName:`taskItem`,HTMLAttributes:{}}},group:`block list`,content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:e}){return[`ul`,Cx(this.options.HTMLAttributes,e,{"data-type":this.name}),0]},parseMarkdown:(e,t)=>t.createNode(`taskList`,{},t.parseChildren(e.items||[])),renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,` 369`):``,markdownTokenizer:{name:`taskList`,level:`block`,start(e){let t=e.match(/^\s*[-+*]\s+\[([ xX])\]\s+/)?.index;return t===void 0?-1:t},tokenize(e,t,n){let r=e=>{let t=US(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:e[3].toLowerCase()===`x`}),createToken:(e,t)=>({type:`taskItem`,raw:``,mainContent:e.mainContent,indentLevel:e.indentLevel,checked:e.checked,text:e.mainContent,tokens:n.inlineTokens(e.mainContent),nestedTokens:t}),customNestedParser:r},n);return t?[{type:`taskList`,raw:t.raw,items:t.items}]:n.blockTokens(e)},i=US(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:e[3].toLowerCase()===`x`}),createToken:(e,t)=>({type:`taskItem`,raw:``,mainContent:e.mainContent,indentLevel:e.indentLevel,checked:e.checked,text:e.mainContent,tokens:n.inlineTokens(e.mainContent),nestedTokens:t}),customNestedParser:r},n);if(i)return{type:`taskList`,raw:i.raw,items:i.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});oC.create({name:`listKit`,addExtensions(){let e=[];return this.options.bulletList!==!1&&e.push(hk.configure(this.options.bulletList)),this.options.listItem!==!1&&e.push(Rk.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(Yk.configure(this.options.listKeymap)),this.options.orderedList!==!1&&e.push(dA.configure(this.options.orderedList)),this.options.taskItem!==!1&&e.push(pA.configure(this.options.taskItem)),this.options.taskList!==!1&&e.push(mA.configure(this.options.taskList)),e}});var hA=` `,gA=`\xA0`,_A=DC.create({name:`paragraph`,priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:`block`,content:`inline*`,parseHTML(){return[{tag:`p`}]},renderHTML({HTMLAttributes:e}){return[`p`,Cx(this.options.HTMLAttributes,e),0]},parseMarkdown:(e,t)=>{let n=e.tokens||[];if(n.length===1&&n[0].type===`image`)return t.parseChildren([n[0]]);let r=t.parseInline(n);return n.length===1&&n[0].type===`text`&&(n[0].raw===hA||n[0].text===hA||n[0].raw===gA||n[0].text===gA)&&r.length===1&&r[0].type===`text`&&(r[0].text===hA||r[0].text===gA)?t.createNode(`paragraph`,void 0,[]):t.createNode(`paragraph`,void 0,r)},renderMarkdown:(e,t,n)=>{if(!e)return``;let r=Array.isArray(e.content)?e.content:[];if(r.length===0){let e=Array.isArray(n?.previousNode?.content)?n.previousNode.content:[];return n?.previousNode?.type===`paragraph`&&e.length===0?hA:``}return t.renderChildren(r)},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),vA=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,yA=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,bA=QS.create({name:`strike`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`s`},{tag:`del`},{tag:`strike`},{style:`text-decoration`,consuming:!1,getAttrs:e=>e.includes(`line-through`)?{}:!1}]},renderHTML({HTMLAttributes:e}){return[`s`,Cx(this.options.HTMLAttributes,e),0]},markdownTokenName:`del`,parseMarkdown:(e,t)=>t.applyMark(`strike`,t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>`~~${t.renderChildren(e)}~~`,addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[xC({find:vA,type:this.type})]},addPasteRules(){return[OC({find:yA,type:this.type})]}}),xA=DC.create({name:`text`,group:`inline`,parseMarkdown:e=>({type:`text`,text:e.text||``}),renderMarkdown:e=>e.text||``}),SA=QS.create({name:`underline`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`u`},{style:`text-decoration`,consuming:!1,getAttrs:e=>e.includes(`underline`)?{}:!1}]},renderHTML({HTMLAttributes:e}){return[`u`,Cx(this.options.HTMLAttributes,e),0]},parseMarkdown(e,t){return t.applyMark(this.name||`underline`,t.parseInline(e.tokens||[]))},renderMarkdown(e,t){return`++${t.renderChildren(e)}++`},markdownTokenizer:{name:`underline`,level:`inline`,start(e){return e.indexOf(`++`)},tokenize(e,t,n){let r=/^(\+\+)([\s\S]+?)(\+\+)/.exec(e);if(!r)return;let i=r[2].trim();return{type:`underline`,raw:r[0],text:i,tokens:n.inlineTokens(i)}}},addCommands(){return{setUnderline:()=>({commands:e})=>e.setMark(this.name),toggleUnderline:()=>({commands:e})=>e.toggleMark(this.name),unsetUnderline:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}});function CA(e={}){return new dm({view(t){return new wA(t,e)}})}var wA=class{constructor(e,t){this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=t.width??1,this.color=t.color===!1?void 0:t.color||`black`,this.class=t.class,this.handlers=[`dragover`,`dragend`,`drop`,`dragleave`].map(t=>{let n=e=>{this[t](e)};return e.dom.addEventListener(t,n),{name:t,handler:n}})}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){this.cursorPos!=null&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),t=!e.parent.inlineContent,n,r=this.editorView.dom,i=r.getBoundingClientRect(),a=i.width/r.offsetWidth,o=i.height/r.offsetHeight;if(t){let t=e.nodeBefore,r=e.nodeAfter;if(t||r){let e=this.editorView.nodeDOM(this.cursorPos-(t?t.nodeSize:0));if(e){let i=e.getBoundingClientRect(),a=t?i.bottom:i.top;t&&r&&(a=(a+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let s=this.width/2*o;n={left:i.left,right:i.right,top:a-s,bottom:a+s}}}}if(!n){let e=this.editorView.coordsAtPos(this.cursorPos),t=this.width/2*a;n={left:e.left-t,right:e.left+t,top:e.top,bottom:e.bottom}}let s=this.editorView.dom.offsetParent;this.element||(this.element=s.appendChild(document.createElement(`div`)),this.class&&(this.element.className=this.class),this.element.style.cssText=`position: absolute; z-index: 50; pointer-events: none;`,this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle(`prosemirror-dropcursor-block`,t),this.element.classList.toggle(`prosemirror-dropcursor-inline`,!t);let c,l;if(!s||s==document.body&&getComputedStyle(s).position==`static`)c=-pageXOffset,l=-pageYOffset;else{let e=s.getBoundingClientRect(),t=e.width/s.offsetWidth,n=e.height/s.offsetHeight;c=e.left-s.scrollLeft*t,l=e.top-s.scrollTop*n}this.element.style.left=(n.left-c)/a+`px`,this.element.style.top=(n.top-l)/o+`px`,this.element.style.width=(n.right-n.left)/a+`px`,this.element.style.height=(n.bottom-n.top)/o+`px`}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),r=n&&n.type.spec.disableDropCursor,i=typeof r==`function`?r(this.editorView,t,e):r;if(t&&!i){let e=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let t=Tp(this.editorView.state.doc,e,this.editorView.dragging.slice);t!=null&&(e=t)}this.setCursor(e),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}},TA=class e extends J{constructor(e){super(e,e)}map(t,n){let r=t.resolve(n.map(this.head));return e.valid(r)?new e(r):J.near(r)}content(){return K.empty}eq(t){return t instanceof e&&t.head==this.head}toJSON(){return{type:`gapcursor`,pos:this.head}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for GapCursor.fromJSON`);return new e(t.resolve(n.pos))}getBookmark(){return new EA(this.anchor)}static valid(e){let t=e.parent;if(t.inlineContent||!OA(e)||!kA(e))return!1;let n=t.type.spec.allowGapCursor;if(n!=null)return n;let r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(t,n,r=!1){search:for(;;){if(!r&&e.valid(t))return t;let i=t.pos,a=null;for(let r=t.depth;;r--){let o=t.node(r);if(n>0?t.indexAfter(r)<o.childCount:t.index(r)>0){a=o.child(n>0?t.indexAfter(r):t.index(r)-1);break}else if(r==0)return null;i+=n;let s=t.doc.resolve(i);if(e.valid(s))return s}for(;;){let o=n>0?a.firstChild:a.lastChild;if(!o){if(a.isAtom&&!a.isText&&!X.isSelectable(a)){t=t.doc.resolve(i+a.nodeSize*n),r=!1;continue search}break}a=o,i+=n;let s=t.doc.resolve(i);if(e.valid(s))return s}return null}}};TA.prototype.visible=!1,TA.findFrom=TA.findGapCursorFrom,J.jsonID(`gapcursor`,TA);var EA=class e{constructor(e){this.pos=e}map(t){return new e(t.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return TA.valid(t)?new TA(t):J.near(t)}};function DA(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}function OA(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n-1);;e=e.lastChild){if(e.childCount==0&&!e.inlineContent||DA(e.type))return!0;if(e.inlineContent)return!1}}return!0}function kA(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n);;e=e.firstChild){if(e.childCount==0&&!e.inlineContent||DA(e.type))return!0;if(e.inlineContent)return!1}}return!0}function AA(){return new dm({props:{decorations:FA,createSelectionBetween(e,t,n){return t.pos==n.pos&&TA.valid(n)?new TA(n):null},handleClick:NA,handleKeyDown:jA,handleDOMEvents:{beforeinput:PA}}})}var jA=Vy({ArrowLeft:MA(`horiz`,-1),ArrowRight:MA(`horiz`,1),ArrowUp:MA(`vert`,-1),ArrowDown:MA(`vert`,1)});function MA(e,t){let n=e==`vert`?t>0?`down`:`up`:t>0?`right`:`left`;return function(e,r,i){let a=e.selection,o=t>0?a.$to:a.$from,s=a.empty;if(a instanceof Y){if(!i.endOfTextblock(n)||o.depth==0)return!1;s=!1,o=e.doc.resolve(t>0?o.after():o.before())}let c=TA.findGapCursorFrom(o,t,s);return c?(r&&r(e.tr.setSelection(new TA(c))),!0):!1}}function NA(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!TA.valid(r))return!1;let i=e.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&X.isSelectable(e.state.doc.nodeAt(i.inside))?!1:(e.dispatch(e.state.tr.setSelection(new TA(r))),!0)}function PA(e,t){if(t.inputType!=`insertCompositionText`||!(e.state.selection instanceof TA))return!1;let{$from:n}=e.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;let i=G.empty;for(let e=r.length-1;e>=0;e--)i=G.from(r[e].createAndFill(null,i));let a=e.state.tr.replace(n.pos,n.pos,new K(i,0,0));return a.setSelection(Y.near(a.doc.resolve(n.pos+1))),e.dispatch(a),!1}function FA(e){if(!(e.selection instanceof TA))return null;let t=document.createElement(`div`);return t.className=`ProseMirror-gapcursor`,Vv.create(e.doc,[Rv.widget(e.selection.head,t,{key:`gapcursor`})])}var IA=200,LA=function(){};LA.prototype.append=function(e){return e.length?(e=LA.from(e),!this.length&&e||e.length<IA&&this.leafAppend(e)||this.length<IA&&e.leafPrepend(this)||this.appendInner(e)):this},LA.prototype.prepend=function(e){return e.length?LA.from(e).append(this):this},LA.prototype.appendInner=function(e){return new zA(this,e)},LA.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?LA.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},LA.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},LA.prototype.forEach=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},LA.prototype.map=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length);var r=[];return this.forEach(function(t,n){return r.push(e(t,n))},t,n),r},LA.from=function(e){return e instanceof LA?e:e&&e.length?new RA(e):LA.empty};var RA=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return e==0&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var i=t;i<n;i++)if(e(this.values[i],r+i)===!1)return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var i=t-1;i>=n;i--)if(e(this.values[i],r+i)===!1)return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=IA)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=IA)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(LA);LA.empty=new RA([]);var zA=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,n,r){var i=this.left.length;if(t<i&&this.left.forEachInner(e,t,Math.min(n,i),r)===!1||n>i&&this.right.forEachInner(e,Math.max(t-i,0),Math.min(this.length,n)-i,r+i)===!1)return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){var i=this.left.length;if(t>i&&this.right.forEachInvertedInner(e,t-i,Math.max(n,i)-i,r+i)===!1||n<i&&this.left.forEachInvertedInner(e,Math.min(t,i),n,r)===!1)return!1},t.prototype.sliceInner=function(e,t){if(e==0&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(LA),BA=500,VA=class e{constructor(e,t){this.items=e,this.eventCount=t}popEvent(t,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,a;n&&(i=this.remapping(r,this.items.length),a=i.maps.length);let o=t.tr,s,c,l=[],u=[];return this.items.forEach((t,n)=>{if(!t.step){i||(i=this.remapping(r,n+1),a=i.maps.length),a--,u.push(t);return}if(i){u.push(new UA(t.map));let e=t.step.map(i.slice(a)),n;e&&o.maybeStep(e).doc&&(n=o.mapping.maps[o.mapping.maps.length-1],l.push(new UA(n,void 0,void 0,l.length+u.length))),a--,n&&i.appendMap(n,a)}else o.maybeStep(t.step);if(t.selection)return s=i?t.selection.map(i.slice(a)):t.selection,c=new e(this.items.slice(0,r).append(u.reverse().concat(l)),this.eventCount-1),!1},this.items.length,0),{remaining:c,transform:o,selection:s}}addTransform(t,n,r,i){let a=[],o=this.eventCount,s=this.items,c=!i&&s.length?s.get(s.length-1):null;for(let e=0;e<t.steps.length;e++){let r=t.steps[e].invert(t.docs[e]),l=new UA(t.mapping.maps[e],r,n),u;(u=c&&c.merge(l))&&(l=u,e?a.pop():s=s.slice(0,s.length-1)),a.push(l),n&&=(o++,void 0),i||(c=l)}let l=o-r.depth;return l>GA&&(s=HA(s,l),o-=l),new e(s.append(a),o)}remapping(e,t){let n=new Uf;return this.items.forEach((t,r)=>{let i=t.mirrorOffset!=null&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,i)},e,t),n}addMaps(t){return this.eventCount==0?this:new e(this.items.append(t.map(e=>new UA(e))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),a=t.mapping,o=t.steps.length,s=this.eventCount;this.items.forEach(e=>{e.selection&&s--},i);let c=n;this.items.forEach(e=>{let n=a.getMirror(--c);if(n==null)return;o=Math.min(o,n);let i=a.maps[n];if(e.step){let o=t.steps[n].invert(t.docs[n]),l=e.selection&&e.selection.map(a.slice(c+1,n));l&&s++,r.push(new UA(i,o,l))}else r.push(new UA(i))},i);let l=[];for(let e=n;e<o;e++)l.push(new UA(a.maps[e]));let u=new e(this.items.slice(0,i).append(l).append(r),s);return u.emptyItemCount()>BA&&(u=u.compress(this.items.length-r.length)),u}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(t=this.items.length){let n=this.remapping(0,t),r=n.maps.length,i=[],a=0;return this.items.forEach((e,o)=>{if(o>=t)i.push(e),e.selection&&a++;else if(e.step){let t=e.step.map(n.slice(r)),o=t&&t.getMap();if(r--,o&&n.appendMap(o,r),t){let s=e.selection&&e.selection.map(n.slice(r));s&&a++;let c=new UA(o.invert(),t,s),l,u=i.length-1;(l=i.length&&i[u].merge(c))?i[u]=l:i.push(c)}}else e.map&&r--},this.items.length,0),new e(LA.from(i.reverse()),a)}};VA.empty=new VA(LA.empty,0);function HA(e,t){let n;return e.forEach((e,r)=>{if(e.selection&&t--==0)return n=r,!1}),e.slice(n)}var UA=class e{constructor(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new e(n.getMap().invert(),n,this.selection)}}},WA=class{constructor(e,t,n,r,i){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=i}},GA=20;function KA(e,t,n,r){let i=n.getMeta(ej),a;if(i)return i.historyState;n.getMeta(tj)&&(e=new WA(e.done,e.undone,null,0,-1));let o=n.getMeta(`appendedTransaction`);if(n.steps.length==0)return e;if(o&&o.getMeta(ej))return o.getMeta(ej).redo?new WA(e.done.addTransform(n,void 0,r,$A(t)),e.undone,JA(n.mapping.maps),e.prevTime,e.prevComposition):new WA(e.done,e.undone.addTransform(n,void 0,r,$A(t)),null,e.prevTime,e.prevComposition);if(n.getMeta(`addToHistory`)!==!1&&!(o&&o.getMeta(`addToHistory`)===!1)){let i=n.getMeta(`composition`),a=e.prevTime==0||!o&&e.prevComposition!=i&&(e.prevTime<(n.time||0)-r.newGroupDelay||!qA(n,e.prevRanges)),s=o?YA(e.prevRanges,n.mapping):JA(n.mapping.maps);return new WA(e.done.addTransform(n,a?t.selection.getBookmark():void 0,r,$A(t)),VA.empty,s,n.time,i??e.prevComposition)}else if(a=n.getMeta(`rebased`))return new WA(e.done.rebased(n,a),e.undone.rebased(n,a),YA(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);else return new WA(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),YA(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function qA(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((e,r)=>{for(let i=0;i<t.length;i+=2)e<=t[i+1]&&r>=t[i]&&(n=!0)}),n}function JA(e){let t=[];for(let n=e.length-1;n>=0&&t.length==0;n--)e[n].forEach((e,n,r,i)=>t.push(r,i));return t}function YA(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let i=t.map(e[r],1),a=t.map(e[r+1],-1);i<=a&&n.push(i,a)}return n}function XA(e,t,n){let r=$A(t),i=ej.get(t).spec.config,a=(n?e.undone:e.done).popEvent(t,r);if(!a)return null;let o=a.selection.resolve(a.transform.doc),s=(n?e.done:e.undone).addTransform(a.transform,t.selection.getBookmark(),i,r),c=new WA(n?s:a.remaining,n?a.remaining:s,null,0,-1);return a.transform.setSelection(o).setMeta(ej,{redo:n,historyState:c})}var ZA=!1,QA=null;function $A(e){let t=e.plugins;if(QA!=t){ZA=!1,QA=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){ZA=!0;break}}return ZA}var ej=new mm(`history`),tj=new mm(`closeHistory`);function nj(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new dm({key:ej,state:{init(){return new WA(VA.empty,VA.empty,null,0,-1)},apply(t,n,r){return KA(n,r,t,e)}},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r=n==`historyUndo`?ij:n==`historyRedo`?aj:null;return!r||!e.editable?!1:(t.preventDefault(),r(e.state,e.dispatch))}}}})}function rj(e,t){return(n,r)=>{let i=ej.getState(n);if(!i||(e?i.undone:i.done).eventCount==0)return!1;if(r){let a=XA(i,n,e);a&&r(t?a.scrollIntoView():a)}return!0}}var ij=rj(!1,!0),aj=rj(!0,!0);oC.create({name:`characterCount`,addOptions(){return{limit:null,autoTrim:!0,mode:`textSize`,textCounter:e=>e.length,wordCounter:e=>e.split(` `).filter(e=>e!==``).length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=e=>{let t=e?.node||this.editor.state.doc;if((e?.mode||this.options.mode)===`textSize`){let e=t.textBetween(0,t.content.size,void 0,` `);return this.options.textCounter(e)}return t.nodeSize},this.storage.words=e=>{let t=e?.node||this.editor.state.doc,n=t.textBetween(0,t.content.size,` `,` `);return this.options.wordCounter(n)}},addProseMirrorPlugins(){let e=!1;return[new dm({key:new mm(`characterCount`),appendTransaction:(t,n,r)=>{if(e)return;let i=this.options.limit,a=this.options.autoTrim;if(i==null||i===0||a===!1){e=!0;return}let o=this.storage.characters({node:r.doc});if(o>i){let t=o-i;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);let n=r.tr.deleteRange(0,t);return e=!0,n}e=!0},filterTransaction:(e,t)=>{let n=this.options.limit;if(!e.docChanged||n===0||n==null)return!0;let r=this.storage.characters({node:t.doc}),i=this.storage.characters({node:e.doc});if(i<=n||r>n&&i>n&&i<=r)return!0;if(r>n&&i>n&&i>r||!e.getMeta(`paste`))return!1;let a=e.selection.$head.pos,o=a-(i-n),s=a;return e.deleteRange(o,s),!(this.storage.characters({node:e.doc})>n)}})]}});var oj=oC.create({name:`dropCursor`,addOptions(){return{color:`currentColor`,width:1,class:void 0}},addProseMirrorPlugins(){return[CA(this.options)]}});oC.create({name:`focus`,addOptions(){return{className:`has-focus`,mode:`all`}},addProseMirrorPlugins(){return[new dm({key:new mm(`focus`),props:{decorations:({doc:e,selection:t})=>{let{isEditable:n,isFocused:r}=this.editor,{anchor:i}=t,a=[];if(!n||!r)return Vv.create(e,[]);let o=0;this.options.mode===`deepest`&&e.descendants((e,t)=>{if(!e.isText){if(!(i>=t&&i<=t+e.nodeSize-1))return!1;o+=1}});let s=0;return e.descendants((e,t)=>{if(e.isText||!(i>=t&&i<=t+e.nodeSize-1))return!1;if(s+=1,this.options.mode===`deepest`&&o-s>0||this.options.mode===`shallowest`&&s>1)return this.options.mode===`deepest`;a.push(Rv.node(t,t+e.nodeSize,{class:this.options.className}))}),Vv.create(e,a)}}})]}});var sj=oC.create({name:`gapCursor`,addProseMirrorPlugins(){return[AA()]},extendNodeSchema(e){return{allowGapCursor:_x(Z(e,`allowGapCursor`,{name:e.name,options:e.options,storage:e.storage}))??null}}}),cj=`placeholder`,lj=new mm(`tiptap__placeholder`),uj=200;function dj(e){let{editor:t,placeholder:n,dataAttribute:r,pos:i,node:a,isEmptyDoc:o,hasAnchor:s,classes:{emptyNode:c,emptyEditor:l}}=e,u=[c];return o&&u.push(l),Rv.node(i,i+a.nodeSize,{class:u.join(` `),[r]:typeof n==`function`?n({editor:t,node:a,pos:i,hasAnchor:s}):n})}function fj(e,t){return typeof e==`function`?e(t):e}function pj({editor:e,options:t,dataAttribute:n,doc:r,selection:i}){if(!(e.isEditable||!t.showOnlyWhenEditable))return null;let{anchor:a}=i,o=[],s=e.isEmpty;if(t.showOnlyCurrent&&!t.includeChildren){let i=r.resolve(a),c=i.depth>0?i.node(1):i.nodeAfter,l=i.depth>0?i.before(1):a;if(c&&c.type.isTextblock&&Qx(c)){let r=a>=l&&a<=l+c.nodeSize;o.push(dj({editor:e,isEmptyDoc:s,dataAttribute:n,hasAnchor:r,placeholder:t.placeholder,classes:{emptyEditor:t.emptyEditorClass,emptyNode:fj(t.emptyNodeClass,{editor:e,node:c,pos:l,hasAnchor:r})},node:c,pos:l}))}}else{let i=lj.getState(e.state),c=i?.topPos??0,l=i?.bottomPos??r.content.size;r.nodesBetween(c,l,(r,i)=>{let c=a>=i&&a<=i+r.nodeSize,l=!r.isLeaf&&Qx(r);return r.type.isTextblock&&(c||!t.showOnlyCurrent)&&l&&o.push(dj({editor:e,isEmptyDoc:s,dataAttribute:n,hasAnchor:c,placeholder:t.placeholder,classes:{emptyEditor:t.emptyEditorClass,emptyNode:fj(t.emptyNodeClass,{editor:e,node:r,pos:i,hasAnchor:c})},node:r,pos:i})),t.includeChildren})}return Vv.create(r,o)}function mj(e){return e.replace(/\s+/g,`-`).replace(/[^a-zA-Z0-9-]/g,``).replace(/^[0-9-]+/,``).replace(/^-+/,``).toLowerCase()}function hj(e){let t=getComputedStyle(e),n=`${t.overflow} ${t.overflowY} ${t.overflowX}`;return/auto|scroll|overlay/.test(n)}function gj(e){let t=e;for(;t;){if(hj(t))return t;let e=t.parentElement;if(!e){let e=t.getRootNode();if(e instanceof ShadowRoot){t=e.host;continue}return window}
369t=e}return window}function _j(e){return e===window?{top:0,bottom:window.innerHeight}:e.getBoundingClientRect()}function vj({view:e,scrollContainer:t}){let n=e.dom.getBoundingClientRect();if(n.width<=0||n.height<=0)return null;let r=t?_j(t):{top:0,bottom:window.innerHeight},i=Math.max(n.top,r.top)-uj,a=Math.min(n.bottom,r.bottom)+uj;if(i>=a)return null;let o=n.left+1,s=n.right-1;if(o>s)return null;let c=getComputedStyle(e.dom).direction===`rtl`?n.right-2:n.left+2,l=Math.min(Math.max(c,o),s),u=Math.max(i+2,n.top+1),d=Math.min(a-2,n.bottom-1);if(u>d)return null;let f=e.posAtCoords({left:l,top:u}),p=e.posAtCoords({left:l,top:d});return!f||!p?null:{top:f.pos,bottom:p.pos}}var yj={init(){return{topPos:null,bottomPos:null}},apply(e,t){let n=e.getMeta(lj);return n?.positions?{topPos:n.positions.top,bottomPos:n.positions.bottom}:e.docChanged?{topPos:t.topPos===null?null:e.mapping.map(t.topPos),bottomPos:t.bottomPos===null?null:e.mapping.map(t.bottomPos)}:t}};function bj(e){let t=gj(e.dom),n=()=>{let n=vj({view:e,scrollContainer:t});if(n===null)return;let r=lj.getState(e.state);if(r?.topPos===n.top&&r?.bottomPos===n.bottom)return;let i=e.state.tr.setMeta(lj,{positions:n});e.dispatch(i)},r=null,i=0,a=()=>{r===null&&(r=requestAnimationFrame(()=>{r=null;let e=performance.now();e-i>=150?(i=e,n()):a()}))};t.addEventListener(`scroll`,a,{passive:!0});let o=typeof ResizeObserver<`u`?new ResizeObserver(a):null;o?.observe(e.dom);let s=typeof IntersectionObserver<`u`?new IntersectionObserver(a):null;return s?.observe(e.dom),e.dom.addEventListener(`focus`,a),n(),{update(t,n){e.state.doc.content.size!==n.doc.content.size&&a()},destroy:()=>{r!==null&&cancelAnimationFrame(r),t.removeEventListener(`scroll`,a),o?.disconnect(),s?.disconnect(),e.dom.removeEventListener(`focus`,a)}}}function xj({editor:e,options:t}){let n=t.dataAttribute?`data-${mj(t.dataAttribute)}`:`data-${cj}`;return new dm({key:lj,state:yj,view:bj,props:{decorations:({doc:r,selection:i})=>pj({editor:e,options:t,dataAttribute:n,doc:r,selection:i})}})}var Sj=oC.create({name:`placeholder`,addOptions(){return{emptyEditorClass:`is-editor-empty`,emptyNodeClass:`is-empty`,dataAttribute:cj,placeholder:`Write something â¦`,showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[xj({editor:this.editor,options:this.options})]}}),Cj=`.ProseMirror:not(.ProseMirror-focused) *::selection { 370 background: transparent; 371} 372 373.ProseMirror:not(.ProseMirror-focused) *::-moz-selection { 374 background: transparent; 375}`;oC.create({name:`selection`,addOptions(){return{className:`selection`}},addProseMirrorPlugins(){let{editor:e,options:t}=this;return e.options.injectCSS&&typeof document<`u`&&MS(Cj,e.options.injectNonce,`selection`),[new dm({key:new mm(`selection`),props:{decorations(n){return n.selection.empty||e.isFocused||!e.isEditable||$x(n.selection)||e.view.dragging?null:Vv.create(n.doc,[Rv.inline(n.selection.from,n.selection.to,{class:t.className})])}}})]}});function wj({types:e,node:t}){return t&&Array.isArray(e)&&e.includes(t.type)||t?.type===e}var Tj=oC.create({name:`trailingNode`,addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){let e=new mm(this.name),t=this.options.node||this.editor.schema.topNodeType.contentMatch.defaultType?.name||`paragraph`,n=Object.entries(this.editor.schema.nodes).map(([,e])=>e).filter(e=>(this.options.notAfter||[]).concat(t).includes(e.name));return[new dm({key:e,appendTransaction:(n,r,i)=>{let{doc:a,tr:o,schema:s}=i,c=e.getState(i),l=a.content.size,u=s.nodes[t];if(!n.some(e=>e.getMeta(`skipTrailingNode`))&&c)return o.insert(l,u.create())},state:{init:(e,t)=>{let r=t.tr.doc.lastChild;return!wj({node:r,types:n})},apply:(e,t)=>{if(!e.docChanged||e.getMeta(`__uniqueIDTransaction`))return t;let r=e.doc.lastChild;return!wj({node:r,types:n})}}})]}}),Ej=oC.create({name:`undoRedo`,addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:e,dispatch:t})=>ij(e,t),redo:()=>({state:e,dispatch:t})=>aj(e,t)}},addProseMirrorPlugins(){return[nj(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-Ñ":()=>this.editor.commands.undo(),"Shift-Mod-Ñ":()=>this.editor.commands.redo()}}}),Dj=oC.create({name:`starterKit`,addExtensions(){let e=[];return this.options.bold!==!1&&e.push(ME.configure(this.options.bold)),this.options.blockquote!==!1&&e.push(DE.configure(this.options.blockquote)),this.options.bulletList!==!1&&e.push(hk.
375configure(this.options.bulletList)),this.options.code!==!1&&e.push(FE.configure(this.options.code)),this.options.codeBlock!==!1&&e.push(zE.configure(this.options.codeBlock)),this.options.document!==!1&&e.push(BE.configure(this.options.document)),this.options.dropcursor!==!1&&e.push(oj.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&e.push(sj.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&e.push(VE.configure(this.options.hardBreak)),this.options.heading!==!1&&e.push(HE.configure(this.options.heading)),this.options.undoRedo!==!1&&e.push(Ej.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&e.push(UE.configure(this.options.horizontalRule)),this.options.italic!==!1&&e.push(JE.configure(this.options.italic)),this.options.listItem!==!1&&e.push(Rk.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(Yk.configure(this.options?.listKeymap)),this.options.link!==!1&&e.push(ck.configure(this.options?.link)),this.options.orderedList!==!1&&e.push(dA.configure(this.options.orderedList)),this.options.paragraph!==!1&&e.push(_A.configure(this.options.paragraph)),this.options.strike!==!1&&e.push(bA.configure(this.options.strike)),this.options.text!==!1&&e.push(xA.configure(this.options.text)),this.options.underline!==!1&&e.push(SA.configure(this.options?.underline)),this.options.trailingNode!==!1&&e.push(Tj.configure(this.options?.trailingNode)),e}}),Oj=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,kj=DC.create({name:`image`,addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1}},inline(){return this.options.inline},group(){return this.options.inline?`inline`:`block`},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?`img[src]`:`img[src]:not([src^="data:"])`}]},renderHTML({HTMLAttributes:e}){return[`img`,Cx(this.options.HTMLAttributes,e)]},parseMarkdown:(e,t)=>t.createNode(`image`,{src:e.href,title:e.title,alt:e.text}),renderMarkdown:e=>{let t=e.attrs?.src??``,n=e.attrs?.alt??``,r=e.attrs?.title??``;return r?``:``},addNodeView(){if(!this.options.resize||!this.options.resize.enabled||typeof document>`u`)return null;let{directions:e,minWidth:t,minHeight:n,alwaysPreserveAspectRatio:r}=this.options.resize;return({node:i,getPos:a,HTMLAttributes:o,editor:s})=>{let c=document.createElement(`img`);c.draggable=!1;let l=Cx(this.options.HTMLAttributes,o);Object.entries(l).forEach(([e,t])=>
375{if(t!=null)switch(e){case`width`:case`height`:break;default:c.setAttribute(e,t);break}}),l.src!==null&&(c.src=l.src);let u=new EC({element:c,editor:s,node:i,getPos:a,onResize:(e,t)=>{c.style.width=`${e}px`,c.style.height=`${t}px`},onCommit:(e,t)=>{let n=a();n!==void 0&&this.editor.chain().setNodeSelection(n).updateAttributes(this.name,{width:e,height:t}).run()},onUpdate:(e,t,n)=>e.type===i.type,options:{directions:e,min:{width:t,height:n},preserveAspectRatio:r===!0}}),d=u.dom;return d.style.visibility=`hidden`,d.style.pointerEvents=`none`,c.onload=()=>{d.style.visibility=``,d.style.pointerEvents=``},u}},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[SC({find:Oj,type:this.type,getAttributes:e=>{let[,,t,n,r]=e;return{src:n,alt:t,title:r}}})]}}),Aj=Sj,jj={title:``,slug:``,excerpt:``,body:``,cover_image_url:``,published:!1},Mj=`#C0392B`;function Nj(){let[e,t]=(0,_.useState)([]),[n,r]=(0,_.useState)(null),[i,a]=(0,_.useState)(jj),[o,s]=(0,_.useState)(!1),[c,l]=(0,_.useState)(!1),u=(0,_.useRef)(),d=(0,_.useRef)();(0,_.useEffect)(()=>{f()},[]);async function f(){let{data:e}=await z.from(`posts`).select(`id, title, slug, excerpt, body, published, published_at, cover_image_url`).order(`created_at`,{ascending:!1});t(e||[])}function p(){r(`new`),a(jj)}function m(e){r(e.id),a({...jj,...e})}function h(){r(null),a(jj)}function g(e,t){a(n=>({...n,[e]:t}))}async function v(e){let t=e.target.files?.[0];if(!t)return;l(!0);let n=t.name.split(`.`).pop(),r=`posts/${Date.now()}.${n}`,{error:i}=await z.storage.from(`business-logos`).upload(r,t,{upsert:!0});if(!i){let{data:{publicUrl:e}}=z.storage.from(`business-logos`).getPublicUrl(r);g(`cover_image_url`,e)}l(!1)}async function y(){s(!0);let e={...i,slug:i.slug||i.title.toLowerCase().replace(/\s+/g,`-`).replace(/[^a-z0-9-]/g,``),published_at:i.published?i.published_at||new Date().toISOString():null};n===`new`?await z.from(`posts`).insert(e):await z.from(`posts`).update(e).eq(`id`,n),s(!1),h(),f()}async function b(e){confirm(`Delete this post?`)&&(await z.from(`posts`).delete().eq(`id`,e),f())}return(0,j.jsxs)(`div`,{style:{padding:32,maxWidth:960},children:[(0,j.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,marginBottom:24},children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`h1`,{style:{fontSize:22,fontWeight:900,color:`#111`,marginBottom:2},children:`Blog Posts`}),(0,j.jsxs)(`p`,{style:{fontSize:13,color:`#9CA3AF`},children:[e.length,` post`,e.length===1?``:`s`,` total`]})]}),(0,j.jsx)(`button`,{onClick:p,style:{background:Mj,color:`#fff`,fontWeight:700,fontSize:13,padding:`10px 20px`,borderRadius:8,border:`none`,cursor:`pointer`},children:`+ New Post`})]}),(0,j.jsx)(`div`,{style:{background:`#fff`,borderRadius:12,border:`1px solid #EBEBEB`,overflow:`hidden`},children:(0,j.jsxs)(`table`,{style:{width:`100%`,borderCollapse:`collapse`,fontSize:13},children:[(0,j.jsx)(`thead`,{children:(0,j.jsx)(`tr`,{style:{background:`#FAFAFA`,borderBottom:`1px solid #EBEBEB`},children:[`Cover`,`Title`,`Status`,`Date`,`Actions`].map(e=>(0,j.jsx)(`th`,{style:{textAlign:`left`,padding:`10px 16px`,fontWeight:600,color:`#6B7280`},children:e},e))})}),(0,j.jsx)(`tbody`,{children:e.length===0?(0,j.jsx)(`tr`,{children:(0,j.jsx)(`td`,{colSpan:5,style:{padding:`48px 16px`,textAlign:`center`,color:`#9CA3AF`},children:`No posts yet. Click "+ New Post" to get started.`})}):e.map((t,n)=>(0,j.jsxs)(`tr`,{style:{borderBottom:n<e.length-1?`1px solid #F5F5F5`:`none`},children:[(0,j.jsx)(`td`,{style:{padding:`10px 16px`},children:t.cover_image_url?(0,j.jsx)(`img`,{src:t.cover_image_url,alt:``,style:{width:48,height:36,objectFit:`cover`,borderRadius:6}}):(0,j.jsx)(`div`,{style:{width:48,height:36,borderRadius:6,background:`#F3F4F6`,display:`flex`,alignItems:`center`,justifyContent:`center`,fontSize:16},children:`ð`})}),(0,j.jsx)(`td`,{style:{padding:`12px 16px`,fontWeight:600,color:`#111`},children:t.title}),(0,j.jsx)(`td`,{style:{padding:`12px 16px`},children:(0,j.jsx)(`span`,{style:{fontSize:11,fontWeight:700,padding:`3px 10px`,borderRadius:999,background:t.published?`#F0FDF4`:`#F5F5F5`,color:t.published?`#15803D`:`#9CA3AF`},children:t.published?`Published`:`Draft`})}),(0,j.jsx)(`td`,{style:{padding:`12px 16px`,color:`#9CA3AF`,fontSize:12},children:t.published_at?new Date(t.published_at).toLocaleDateString(`en-US`,{month:`short`,day:`numeric`,year:`numeric`}):`â`}),(0,j.jsx)(`td`,{style:{padding:`12px 16px`},children:(0,j.jsxs)(`div`,{style:{display:`flex`,gap:12},children:[(0,j.jsx)(`a`,{href:`/blog/${t.slug||t.id}`,target:`_blank`,rel:`noopener noreferrer`,style:{fontSize:12,fontWeight:600,color:`#16A34A`,textDecoration:`none`},children:`View â`}),(0,j.jsx)(`button`,{onClick:()=>m(t),style:{fontSize:12,fontWeight:600,color:`#3B82F6`,background:`none`,border:`none`,cursor:`pointer`,padding:0},children:`Edit`}),(0,j.jsx)(`button`,{onClick:()=>b(t.id),style:{fontSize:12,fontWeight:600,color:`#EF4444`,background:`none`,border:`none`,cursor:`pointer`,padding:0},children:`Delete`})]})})]},t.id))})]})}),n&&(0,j.jsx)(Pj,{editing:n,form:i,set:g,saving:o,uploading:c,imgRef:u,inlineImgRef:d,onCoverUpload:v,onSave:y,onClose:h},n)]})}function Pj({editing:e,form:t,set:n,saving:r,uploading:i,imgRef:a,inlineImgRef:o,onCoverUpload:s,onSave:c,onClose:l}){let u=Vw({extensions:[Dj,kj.configure({inline:!1,allowBase64:!1}),lk.configure({openOnClick:!1}),Aj.configure({placeholder:`Start writing your post hereâ¦`})],content:t.body||``,onUpdate:({editor:e})=>{n(`body`,e.getHTML())}});async function d(e){let t=e.target.files?.[0];if(!t||!u)return;let n=t.name.split(`.`).pop(),r=`posts/${Date.now()}-inline.${n}`,{error:i}=await z.storage.from(`business-logos`).upload(r,t,{upsert:!0});if(!i){let{data:{publicUrl:e}}=z.storage.from(`business-logos`).getPublicUrl(r);u.chain().focus().setImage({src:e}).run()}e.target.value=``}return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`style`,{children:Bj}),(0,j.jsx)(`div`,{style:{position:`fixed`,inset:0,background:`rgba(0,0,0,0.5)`,display:`flex`,alignItems:`flex-start`,justifyContent:`center`,zIndex:50,padding:`24px 16px`,overflowY:`auto`},onClick:e=>e.target===e.currentTarget&&l(),children:(0,j.jsxs)(`div`,{style:{background:`#fff`,borderRadius:16,width:`100%`,maxWidth:780,boxShadow:`0 20px 60px rgba(0,0,0,0.18)`,marginBottom:24},children:[(0,j.jsxs)(`div`,{style:{padding:`20px 24px`,borderBottom:`1px solid #EBEBEB`,display:`flex`,alignItems:`center`,justifyContent:`space-between`},children:[(0,j.jsx)(`h2`,{style:{fontSize:17,fontWeight:900,color:`#111`},children:e===`new`?`New Post`:`Edit Post`}),(0,j.jsx)(`button`,{onClick:l,style:{background:`none`,border:`none`,fontSize:22,color:`#9CA3AF`,cursor:`pointer`,lineHeight:1},children:`Ã`})]}),(0,j.jsxs)(`div`,{style:{padding:`24px`,display:`flex`,flexDirection:`column`,gap:20},children:[(0,j.jsx)(zj,{label:`Title *`,value:t.title,onChange:e=>n(`title`,e)}),(0,j.jsx)(zj,{label:`Slug (auto-generated if blank)`,value:t.slug,onChange:e=>n(`slug`,e),placeholder:`url-friendly-slug`}),(0,j.jsx)(zj,{label:`Excerpt â short summary shown on blog listing`,value:t.excerpt,onChange:e=>n(`excerpt`,e)}),(0,j.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:8},children:[(0,j.jsx)(`label`,{style:Lj,children:`Cover Image`}),t.cover_image_url&&(0,j.jsxs)(`div`,{style:{position:`relative`,display:`inline-block`},children:[(0,j.jsx)(`img`,{src:t.cover_image_url,alt:`Cover`,style:{width:`100%`,maxHeight:200,objectFit:`cover`,borderRadius:10,display:`block`}}),(0,j.jsx)(`button`,{onClick:()=>n(`cover_image_url`,``),style:{position:`absolute`,top:8,right:8,background:`#fff`,border:`none`,borderRadius:`50%`,width:28,height:28,cursor:`pointer`,fontWeight:700,fontSize:15,color:Mj,boxShadow:`0 1px 4px rgba(0,0,0,0.2)`},children:`Ã`})]}
375),(0,j.jsx)(`input`,{ref:a,type:`file`,accept:`image/*`,onChange:s,style:{display:`none`}}),(0,j.jsx)(`button`,{type:`button`,onClick:()=>a.current?.click(),disabled:i,style:{padding:`9px 16px`,borderRadius:8,border:`1px dashed #D1D5DB`,background:`#FAFAFA`,fontSize:13,color:`#6B7280`,cursor:`pointer`,textAlign:`left`},children:i?`â³ Uploading...`:t.cover_image_url?`ð Replace Cover Image`:`ð· Upload Cover Image`})]}),(0,j.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:8},children:[(0,j.jsx)(`label`,{style:Lj,children:`Post Content`}),u&&(0,j.jsxs)(`div`,{style:{display:`flex`,gap:4,flexWrap:`wrap`,padding:`8px 10px`,background:`#F9FAFB`,border:`1px solid #E5E7EB`,borderBottom:`none`,borderRadius:`10px 10px 0 0`},children:[(0,j.jsx)(Fj,{onClick:()=>u.chain().focus().toggleBold().run(),active:u.isActive(`bold`),title:`Bold`,children:`B`}),(0,j.jsx)(Fj,{onClick:()=>u.chain().focus().toggleItalic().run(),active:u.isActive(`italic`),title:`Italic`,italic:!0,children:`I`}),(0,j.jsx)(Ij,{}),(0,j.jsx)(Fj,{onClick:()=>u.chain().focus().toggleHeading({level:2}).run(),active:u.isActive(`heading`,{level:2}),title:`Heading 2`,children:`H2`}),(0,j.jsx)(Fj,{onClick:()=>u.chain().focus().toggleHeading({level:3}).run(),active:u.isActive(`heading`,{level:3}),title:`Heading 3`,children:`H3`}),(0,j.jsx)(Ij,{}),(0,j.jsx)(Fj,{onClick:()=>u.chain().focus().toggleBulletList().run(),active:u.isActive(`bulletList`),title:`Bullet List`,children:`⢠List`}),(0,j.jsx)(Fj,{onClick:()=>u.chain().focus().toggleOrderedList().run(),active:u.isActive(`orderedList`),title:`Numbered List`,children:`1. List`}),(0,j.jsx)(Ij,{}),(0,j.jsx)(Fj,{onClick:()=>u.chain().focus().toggleBlockquote().run(),active:u.isActive(`blockquote`),title:`Quote`,children:`" Quote`}),(0,j.jsx)(Ij,{}),(0,j.jsx)(Fj,{onClick:()=>{let e=prompt(`Enter URL:`);e&&u.chain().focus().setLink({href:e}).run()},active:u.isActive(`link`),title:`Add Link`,children:`ð Link`}),(0,j.jsx)(`input`,{ref:o,type:`file`,accept:`image/*`,onChange:d,style:{display:`none`}}),(0,j.jsx)(Fj,{onClick:()=>o.current?.click(),title:`Insert Image`,children:`ð¼ Image`}),(0,j.jsx)(Ij,{}),(0,j.jsx)(Fj,{onClick:()=>u.chain().focus().undo().run(),title:`Undo`,children:`â© Undo`}),(0,j.jsx)(Fj,{onClick:()=>u.chain().focus().redo().run(),title:`Redo`,children:`⪠Redo`})]}),(0,j.jsx)(`div`,{className:`tiptap-editor`,style:{border:`1px solid #E5E7EB`,borderRadius:`0 0 10px 10px`,minHeight:320,cursor:`text`},children:(0,j.jsx)(Nw,{editor:u})})]}),(0,j.jsxs)(`label`,{style:{display:`flex`,alignItems:`center`,gap:8,fontSize:13,color:`#374151`,cursor:`pointer`},children:[(0,j.jsx)(`input`,{type:`checkbox`,checked:t.published||!1,onChange:e=>n(`published`,e.target.checked),style:{width:15,height:15}}),`Published â visible to the public`]})]}),(0,j.jsxs)(`div`,{style:{padding:`0 24px 24px`,display:`flex`,gap:10},children:[(0,j.jsx)(`button`,{onClick:c,disabled:r||!t.title,style:{flex:1,padding:12,background:Mj,color:`#fff`,fontWeight:700,fontSize:14,borderRadius:8,border:`none`,cursor:r||!t.title?`not-allowed`:`pointer`,opacity:r||!t.title?.6:1},children:r?`Saving...`:`Save Post`}),(0,j.jsx)(`button`,{onClick:l,style:{padding:`12px 20px`,background:`#F5F5F5`,color:`#374151`,fontWeight:600,fontSize:14,borderRadius:8,border:`none`,cursor:`pointer`},children:`Cancel`})]})]})})]})}function Fj({onClick:e,active:t,title:n,italic:r,children:i}){return(0,j.jsx)(`button`,{type:`button`,onClick:e,title:n,style:{padding:`4px 10px`,borderRadius:6,border:t?`1px solid #C0392B`:`1px solid transparent`,background:t?`#FEF2F2`:`transparent`,color:t?`#C0392B`:`#374151`,fontWeight:r?400:600,fontStyle:r?`italic`:`normal`,fontSize:12,cursor:`pointer`,lineHeight:`20px`},children:i})}function Ij(){return(0,j.jsx)(`div`,{style:{width:1,background:`#E5E7EB`,margin:`0 2px`,alignSelf:`stretch`}})}var Lj={fontSize:11,fontWeight:600,color:`#6B7280`,textTransform:`uppercase`,letterSpacing:`0.04em`},Rj={padding:`9px 12px`,borderRadius:8,border:`1px solid #E5E7EB`,fontSize:13,color:`#111`,outline:`none`,width:`100%`,boxSizing:`border-box`};function zj({label:e,value:t,onChange:n,placeholder:r=``}){return(0,j.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:4},children:[(0,j.jsx)(`label`,{style:Lj,children:e}),(0,j.jsx)(`input`,{type:`text`,value:t||``,onChange:e=>n(e.target.value),placeholder:r,style:Rj,onFocus:e=>e.target.style.borderColor=`#C0392B`,onBlur:e=>e.target.style.borderColor=`#E5E7EB`})]})}var Bj=` 376 .tiptap-editor .ProseMirror { 377 padding: 16px 18px; 378 outline: none; 379 min-height: 320px; 380 font-size: 14px; 381 line-height: 1.75; 382 color: #111; 383 } 384 .tiptap-editor .ProseMirror h2 { 385 font-size: 20px; 386 font-weight: 800; 387 margin: 20px 0 8px; 388 color: #111; 389 } 390 .tiptap-editor .ProseMirror h3 { 391 font-size: 16px; 392 font-weight: 700; 393 margin: 16px 0 6px; 394 color: #111; 395 } 396 .tiptap-editor .ProseMirror p { 397 margin: 0 0 12px; 398 } 399 .tiptap-editor .ProseMirror ul, 400 .tiptap-editor .ProseMirror ol { 401 padding-left: 24px; 402 margin: 0 0 12px; 403 } 404 .tiptap-editor .ProseMirror blockquote { 405 border-left: 3px solid #C0392B; 406 margin: 12px 0; 407 padding: 6px 16px; 408 color: #6B7280; 409 font-style: italic; 410 } 411 .tiptap-editor .ProseMirror img { 412 max-width: 100%; 413 border-radius: 8px; 414 margin: 12px 0; 415 } 416 .tiptap-editor .ProseMirror a { 417 color: #C0392B; 418 text-decoration: underline; 419 } 420 .tiptap-editor .ProseMirror p.is-editor-empty:first-child::before { 421 content: attr(data-placeholder); 422 float: left; 423 color: #9CA3AF; 424 pointer-events: none; 425 height: 0; 426 } 427`,Vj=[`homepage-infeed`,`homepage-sidebar`,`businesses-infeed`,`businesses-sidebar`,`business-profile-sidebar`,`events-top`,`events-middle`,`events-bottom`,`footer-banner`],Hj={zone:``,advertiser_name:``,is_listed_business:!1,image_url:``,link_url:``,start_date:``,end_date:``,active:!0},Uj={true:{background:`#EFF6FF`,color:`#1D4ED8`},false:{background:`#FFF7ED`,color:`#C2410C`}};function Wj(){let[e,t]=(0,_.useState)([]),[n,r]=(0,_.useState)(null),[i,a]=(0,_.useState)(Hj),[o,s]=(0,_.useState)(!1);(0,_.useEffect)(()=>{c()},[]);async function c(){let{data:e}=await z.from(`ads`).select(`*`).order(`created_at`,{ascending:!1});t(e||[])}function l(){r(`new`),a(Hj)}function u(e){r(e.id),a({...Hj,...e})}function d(){r(null),a(Hj)}function f(e,t){a(n=>({...n,[e]:t}))}async function p(){s(!0),n===`new`?await z.from(`ads`).insert(i):await z.from(`ads`).update(i).eq(`id`,n),s(!1),d(),c()}async function m(e){await z.from(`ads`).update({active:!e.active}).eq(`id`,e.id),c()}async function h(e){confirm(`Delete this ad?`)&&(await z.from(`ads`).delete().eq(`id`,e),c())}return(0,j.jsxs)(`div`,{style:{padding:32,maxWidth:1e3},children:[(0,j.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,marginBottom:24},children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`h1`,{style:{fontSize:22,fontWeight:900,color:`#111`,marginBottom:2},children:`Ad Placements`}),(0,j.jsxs)(`p`,{style:{fontSize:13,color:`#9CA3AF`},children:[e.length,` ad`,e.length===1?``:`s`,` total`]})]}),(0,j.jsx)(`button`,{onClick:l,style:{background:`#C0392B`,color:`#fff`,fontWeight:700,fontSize:13,padding:`10px 20px`,borderRadius:8,border:`none`,cursor:`pointer`},children:`+ New Ad`})]}),(0,j.jsx)(`div`,{style:{background:`#fff`,borderRadius:12,border:`1px solid #EBEBEB`,overflow:`hidden`},children:(0,j.jsxs)(`table`,{style:{width:`100%`,borderCollapse:`collapse`,fontSize:13},children:[(0,j.jsx)(`thead`,{children:(0,j.jsx)(`tr`,{style:{background:`#FAFAFA`,borderBottom:`1px solid #EBEBEB`},children:[`Advertiser`,`Zone`,`Type`,`Dates`,`Clicks`,`Status`,`Actions`].map(e=>(0,j.jsx)(`th`,{style:{textAlign:`left`,padding:`10px 16px`,fontWeight:600,color:`#6B7280`,whiteSpace:`nowrap`},children:e},e))})}),(0,j.jsx)(`tbody`,{children:e.length===0?(0,j.jsx)(`tr`,{children:(0,j.jsx)(`td`,{colSpan:7,style:{padding:`48px 16px`,textAlign:`center`,color:`#9CA3AF`},children:`No ads yet. Click "+ New Ad" to add your first placement.`})}):e.map((t,n)=>(0,j.jsxs)(`tr`,{style:{borderBottom:n<e.length-1?`1px solid #F5F5F5`:`none`},children:[(0,j.jsx)(`td`,{style:{padding:`12px 16px`,fontWeight:600,color:`#111`},children:t.advertiser_name}),(0,j.jsx)(`td`,{style:{padding:`12px 16px`},children:(0,j.jsx)(`span`,{style:{fontSize:11,fontWeight:600,padding:`3px 8px`,borderRadius:6,background:`#F5F5F5`,color:`#6B7280`,fontFamily:`monospace`},children:t.zone})}),(0,j.jsx)(`td`,{style:{padding:`12px 16px`},children:(0,j.jsx)(`span`,{style:{fontSize:11,fontWeight:700,padding:`3px 10px`,borderRadius:999,...Uj[String(t.is_listed_business)]},children:t.is_listed_business?`Listed`:`Non-Listed`})}),(0,j.jsxs)(`td`,{style:{padding:`12px 16px`,color:`#6B7280`,fontSize:12,whiteSpace:`nowrap`},children:[t.start_date||`â`,` â `,t.end_date||`â`]}),(0,j.jsx)(`td`,{style:{padding:`12px 16px`,color:`#6B7280`,fontWeight:600},children:t.click_count||0}),(0,j.jsx)(`td`,{style:{padding:`12px 16px`},children:(0,j.jsx)(`button`,{onClick:()=>m(t),style:{fontSize:11,fontWeight:700,padding:`3px 10px`,borderRadius:999,border:`none`,cursor:`pointer`,background:t.active?`#F0FDF4`:`#F5F5F5`,color:t.active?`#15803D`:`#9CA3AF`},children:t.active?`Active`:`Off`})}),(0,j.jsx)(`td`,{style:{padding:`12px 16px`},children:(0,j.jsxs)(`div`,{style:{display:`flex`,gap:12},children:[(0,j.jsx)(`button`,{onClick:()=>u(t),style:{fontSize:12,fontWeight:600,color:`#3B82F6`,background:`none`,border:`none`,cursor:`pointer`,padding:0},children:`Edit`}),(0,j.jsx)(`button`,{onClick:()=>h(t.id),style:{fontSize:12,fontWeight:600,color:`#EF4444`,background:`none`,border:`none`,cursor:`pointer`,padding:0},children:`Delete`})]})})]},t.id))})]})}),n&&(0,j.jsx)(`div`,{style:{position:`fixed`,inset:0,background:`rgba(0,0,0,0.45)`,display:`flex`,alignItems:`center`,justifyContent:`center`,zIndex:50,padding:24},onClick:e=>e.target===e.currentTarget&&d(),children:(0,j.jsxs)(`div`,{style:{background:`#fff`,borderRadius:16,width:`100%`,maxWidth:480,maxHeight:`90vh`,overflowY:`auto`,boxShadow:`0 20px 60px rgba(0,0,0,0.15)`},children:[(0,j.jsxs)(`div`,{style:{padding:`20px 24px 0`,display:`flex`,alignItems:`center`,justifyContent:`space-between`},children:[(0,j.jsx)(`h2`,{style:{fontSize:17,fontWeight:900,color:`#111`},children:n===`new`?`New Ad`:`Edit Ad`}),(0,j.jsx)(`button`,{onClick:d,style:{background:`none`,border:`none`,fontSize:20,color:`#9CA3AF`,cursor:`pointer`},children:`Ã`})]}),(0,j.jsxs)(`div`,{style:{padding:`20px 24px`,display:`flex`,flexDirection:`column`,gap:14},children:[(0,j.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:4},children:[(0,j.jsx)(`label`,{style:Gj,children:`Zone *`}),(0,j.jsxs)(`select`,{value:i.zone,onChange:e=>f(`zone`,e.target.value),style:{...Kj,background:`#fff`},onFocus:e=>e.target.style.borderColor=`#C0392B`,onBlur:e=>e.target.style.borderColor=`#E5E7EB`,children:[(0,j.jsx)(`option`,{value:``,children:`â Select zone â`}),Vj.map(e=>(0,j.jsx)(`option`,{value:e,children:e},e))]})]}),(0,j.jsx)(qj,{label:`Advertiser Name *`,value:i.advertiser_name,onChange:e=>f(`advertiser_name`,e)}),(0,j.jsx)(qj,{label:`Image URL`,value:i.image_url,onChange:e=>f(`image_url`,e),placeholder:`https://...`}),(0,j.jsx)(qj,{label:`Link URL`,value:i.link_url,onChange:e=>f(`link_url`,e),placeholder:`https://...`}),(0,j.jsxs)(`div`,{style:{display:`flex`,gap:12},children:[(0,j.jsxs)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`,gap:4},children:[(0,j.jsx)(`label`,{style:Gj,children:`Start Date`}),(0,j.jsx)(`input`,{type:`date`,value:i.start_date||``,onChange:e=>f(`start_date`,e.target.value),style:Kj,onFocus:e=>e.target.style.borderColor=`#C0392B`,onBlur:e=>e.target.style.borderColor=`#E5E7EB`})]}),(0,j.jsxs)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`,gap:4},children:[(0,j.jsx)(`label`,{style:Gj,children:`End Date`}),(0,j.jsx)(`input`,{type:`date`,value:i.end_date||``,onChange:e=>f(`end_date`,e.target.value),style:Kj,onFocus:e=>e.target.style.borderColor=`#C0392B`,onBlur:e=>e.target.style.borderColor=`#E5E7EB`})]})]}),(0,j.jsxs)(`div`,{style:{display:`flex`,gap:24,paddingTop:4},children:[(0,j.jsxs)(`label`,{style:{display:`flex`,alignItems:`center`,gap:8,fontSize:13,color:`#374151`,cursor:`pointer`},children:[(0,j.jsx)(`input`,{type:`checkbox`,checked:!!i.is_listed_business,onChange:e=>f(`is_listed_business`,e.target.checked),style:{width:15,height:15}}),`Listed business rate`]}),(0,j.jsxs)(`label`,{style:{display:`flex`,alignItems:`center`,gap:8,fontSize:13,color:`#374151`,cursor:`pointer`},children:[(0,j.jsx)(`input`,{type:`checkbox`,checked:!!i.active,onChange:e=>f(`active`,e.target.checked),style:{width:15,height:15}}),`Active`]})]})]}),(0,j.jsxs)(`div`,{style:{padding:`0 24px 24px`,display:`flex`,gap:10},children:[(0,j.jsx)(`button`,{onClick:p,disabled:o||!i.zone||!i.advertiser_name,style:{flex:1,padding:11,background:`#C0392B`,color:`#fff`,fontWeight:700,fontSize:14,borderRadius:8,border:`none`,cursor:`pointer`,o
427pacity:o||!i.zone||!i.advertiser_name?.6:1},children:o?`Saving...`:`Save Ad`}),(0,j.jsx)(`button`,{onClick:d,style:{padding:`11px 20px`,background:`#F5F5F5`,color:`#374151`,fontWeight:600,fontSize:14,borderRadius:8,border:`none`,cursor:`pointer`},children:`Cancel`})]})]})})]})}var Gj={fontSize:11,fontWeight:600,color:`#6B7280`,textTransform:`uppercase`,letterSpacing:`0.04em`},Kj={padding:`9px 12px`,borderRadius:8,border:`1px solid #E5E7EB`,fontSize:13,color:`#111`,outline:`none`,width:`100%`,boxSizing:`border-box`};function qj({label:e,value:t,onChange:n,placeholder:r=``}){return(0,j.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:4},children:[(0,j.jsx)(`label`,{style:Gj,children:e}),(0,j.jsx)(`input`,{type:`text`,value:t||``,onChange:e=>n(e.target.value),placeholder:r,style:Kj,onFocus:e=>e.target.style.borderColor=`#C0392B`,onBlur:e=>e.target.style.borderColor=`#E5E7EB`})]})}function Jj(){let[e,t]=(0,_.useState)([]),[n,r]=(0,_.useState)(null);(0,_.useEffect)(()=>{i()},[]);async function i(){let{data:e}=await z.from(`contact_submissions`).select(`*`).order(`created_at`,{ascending:!1});t(e||[])}async function a(e){await z.from(`contact_submissions`).update({read:!0}).eq(`id`,e),t(t=>t.map(t=>t.id===e?{...t,read:!0}:t))}async function o(e){confirm(`Delete this message?`)&&(await z.from(`contact_submissions`).delete().eq(`id`,e),t(t=>t.filter(t=>t.id!==e)),n?.id===e&&r(null))}let s=e.filter(e=>!e.read).length;return(0,j.jsxs)(`div`,{style:{padding:32,maxWidth:900},children:[(0,j.jsxs)(`div`,{style:{marginBottom:24},children:[(0,j.jsx)(`h1`,{style:{fontSize:22,fontWeight:900,color:`#111`,marginBottom:2},children:`Contact Submissions`}),(0,j.jsxs)(`p`,{style:{fontSize:13,color:`#9CA3AF`},children:[e.length,` message`,e.length===1?``:`s`,s>0&&(0,j.jsxs)(`span`,{style:{marginLeft:8,background:`#C0392B`,color:`#fff`,fontSize:11,fontWeight:700,padding:`2px 8px`,borderRadius:999},children:[s,` new`]})]})]}),(0,j.jsxs)(`div`,{style:{display:`flex`,gap:20,alignItems:`flex-start`},children:[(0,j.jsx)(`div`,{style:{flex:1,background:`#fff`,borderRadius:12,border:`1px solid #EBEBEB`,overflow:`hidden`},children:e.length===0?(0,j.jsx)(`div`,{style:{padding:`48px 16px`,textAlign:`center`,color:`#9CA3AF`,fontSize:14},children:`No messages yet.`}):e.map((t,i)=>(0,j.jsxs)(`div`,{onClick:()=>{r(t),t.read||a(t.id)},style:{padding:`14px 20px`,borderBottom:i<e.length-1?`1px solid #F5F5F5`:`none`,cursor:`pointer`,background:n?.id===t.id?`#FEF2F2`:t.read?`#fff`:`#FFFBF0`,transition:`background 0.15s`},onMouseEnter:e=>{n?.id!==t.id&&(e.currentTarget.style.background=`#F9F9F9`)},onMouseLeave:e=>{n?.id!==t.id&&(e.currentTarget.style.background=t.read?`#fff`:`#FFFBF0`)},children:[(0,j.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,marginBottom:2},children:[(0,j.jsx)(`span`,{style:{fontSize:13,fontWeight:t.read?600:800,color:`#111`},children:t.name}),(0,j.jsx)(`span`,{style:{fontSize:11,color:`#9CA3AF`},children:new Date(t.created_at).toLocaleDateString(`en-US`,{month:`short`,day:`numeric`})})]}),(0,j.jsx)(`div`,{style:{fontSize:11,fontWeight:700,color:`#C0392B`,marginBottom:2},children:t.topic}),(0,j.jsx)(`p`,{style:{fontSize:12,color:`#9CA3AF`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:t.message}),!t.read&&(0,j.jsx)(`div`,{style:{width:8,height:8,borderRadius:`50%`,background:`#C0392B`,display:`inline-block`,marginTop:4}})]},t.id))}),n&&(0,j.jsxs)(`div`,{style:{width:340,background:`#fff`,borderRadius:12,border:`1px solid #EBEBEB`,padding:24,flexShrink:0},children:[(0,j.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`flex-start`,marginBottom:16},children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`h2`,{style:{fontSize:16,fontWeight:900,color:`#111`,marginBottom:2},children:n.name}),(0,j.jsx)(`a`,{href:`mailto:${n.email}`,style:{fontSize:12,color:`#C0392B`,textDecoration:`none`},children:n.email})]}),(0,j.jsx)(`button`,{onClick:()=>r(null),style:{background:`none`,border:`none`,fontSize:18,color:`#9CA3AF`,cursor:`pointer`},children:`Ã`})]}),(0,j.jsx)(`div`,{style:{fontSize:11,fontWeight:700,color:`#fff`,background:`#C0392B`,display:`inline-block`,padding:`3px 10px`,borderRadius:999,marginBottom:16},children:n.topic}),(0,j.jsx)(`p`,{style:{fontSize:13,color:`#374151`,lineHeight:1.7,marginBottom:20},children:n.message}),(0,j.jsxs)(`p`,{style:{fontSize:11,color:`#9CA3AF`,marginBottom:20}
427,children:[`Received `,new Date(n.created_at).toLocaleString(`en-US`,{month:`long`,day:`numeric`,year:`numeric`,hour:`numeric`,minute:`2-digit`})]}),(0,j.jsxs)(`div`,{style:{display:`flex`,gap:8},children:[(0,j.jsx)(`a`,{href:`mailto:${n.email}?subject=Re: ${encodeURIComponent(n.topic)}`,style:{flex:1,background:`#C0392B`,color:`#fff`,fontWeight:700,fontSize:13,padding:`9px 0`,borderRadius:8,textDecoration:`none`,textAlign:`center`},children:`Reply via Email`}),(0,j.jsx)(`button`,{onClick:()=>o(n.id),style:{padding:`9px 14px`,borderRadius:8,border:`1px solid #FECACA`,background:`#FEF2F2`,color:`#DC2626`,fontWeight:600,fontSize:13,cursor:`pointer`},children:`Delete`})]})]})]})]})}function Yj(){let[e,t]=(0,_.useState)([]),[n,r]=(0,_.useState)(null);(0,_.useEffect)(()=>{i()},[]);async function i(){let{data:e}=await z.from(`business_inquiries`).select(`*`).order(`created_at`,{ascending:!1});t(e||[])}async function a(e){await z.from(`business_inquiries`).update({read:!0}).eq(`id`,e),t(t=>t.map(t=>t.id===e?{...t,read:!0}:t))}async function o(e){confirm(`Delete this inquiry?`)&&(await z.from(`business_inquiries`).delete().eq(`id`,e),t(t=>t.filter(t=>t.id!==e)),n?.id===e&&r(null))}let s=e.filter(e=>!e.read).length;return(0,j.jsxs)(`div`,{style:{padding:32,maxWidth:900},children:[(0,j.jsxs)(`div`,{style:{marginBottom:24},children:[(0,j.jsx)(`h1`,{style:{fontSize:22,fontWeight:900,color:`#111`,marginBottom:2},children:`Business Inquiries`}),(0,j.jsxs)(`p`,{style:{fontSize:13,color:`#9CA3AF`},children:[e.length,` inquiry`,e.length===1?``:`s`,s>0&&(0,j.jsxs)(`span`,{style:{marginLeft:8,background:`#C0392B`,color:`#fff`,fontSize:11,fontWeight:700,padding:`2px 8px`,borderRadius:999},children:[s,` new`]})]})]}),(0,j.jsxs)(`div`,{style:{display:`flex`,gap:20,alignItems:`flex-start`},children:[(0,j.jsx)(`div`,{style:{flex:1,background:`#fff`,borderRadius:12,border:`1px solid #EBEBEB`,overflow:`hidden`},children:e.length===0?(0,j.jsx)(`div`,{style:{padding:`48px 16px`,textAlign:`center`,color:`#9CA3AF`,fontSize:14},children:`No inquiries yet.`}):e.map((t,i)=>(0,j.jsxs)(`div`,{onClick:()=>{r(t),t.read||a(t.id)},style:{padding:`14px 20px`,borderBottom:i<e.length-1?`1px solid #F5F5F5`:`none`,cursor:`pointer`,background:n?.id===t.id?`#FEF2F2`:t.read?`#fff`:`#FFFBF0`},children:[(0,j.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,marginBottom:2},children:[(0,j.jsx)(`span`,{style:{fontSize:13,fontWeight:t.read?600:800,color:`#111`},children:t.sender_name}),(0,j.jsx)(`span`,{style:{fontSize:11,color:`#9CA3AF`},children:new Date(t.created_at).toLocaleDateString(`en-US`,{month:`short`,day:`numeric`})})]}),(0,j.jsxs)(`div`,{style:{fontSize:11,fontWeight:700,color:`#C0392B`,marginBottom:2},children:[`â `,t.business_name]}),(0,j.jsx)(`p`,{style:{fontSize:12,color:`#9CA3AF`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:t.message}),!t.read&&(0,j.jsx)(`div`,{style:{width:8,height:8,borderRadius:`50%`,background:`#C0392B`,display:`inline-block`,marginTop:4}})]},t.id))}),n&&(0,j.jsxs)(`div`,{style:{width:340,background:`#fff`,borderRadius:12,border:`1px solid #EBEBEB`,padding:24,flexShrink:0},children:[(0,j.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`flex-start`,marginBottom:12},children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`h2`,{style:{fontSize:15,fontWeight:900,color:`#111`,marginBottom:2},children:n.sender_name}),(0,j.jsx)(`a`,{href:`mailto:${n.sender_email}`,style:{fontSize:12,color:`#C0392B`,textDecoration:`none`},children:n.sender_email})]}),(0,j.jsx)(`button`,{onClick:()=>r(null),style:{background:`none`,border:`none`,fontSize:18,color:`#9CA3AF`,cursor:`pointer`},children:`Ã`})]}),(0,j.jsxs)(`div`,{style:{fontSize:12,color:`#6B7280`,marginBottom:16},children:[`Sent to: `,(0,j.jsx)(`strong`,{style:{color:`#111`},children:n.business_name})]}),(0,j.jsx)(`p`,{style:{fontSize:13,color:`#374151`,lineHeight:1.7,marginBottom:20},children:n.message}),(0,j.jsx)(`p`,{style:{fontSize:11,color:`#9CA3AF`,marginBottom:20},children:new Date(n.created_at).toLocaleString(`en-US`,{month:`long`,day:`numeric`,year:`numeric`,hour:`numeric`,minute:`2-digit`})}),(0,j.jsxs)(`div`,{style:{display:`flex`,gap:8},children:[(0,j.jsx)(`a`,{href:`mailto:${n.sender_email}?subject=Re: Your inquiry about ${encodeURIComponent(n.business_name)}`,style:{flex:1,background:`#C0392B`,color:`#fff`,fontWeight:700,fontSize:13,padding:`9px 0`,borderRadius:8,textDecoration:`none`,textAlign:`center`},children:`Reply via Email`}),(0,j.jsx)(`button`,{onClick:()=>
427o(n.id),style:{padding:`9px 14px`,borderRadius:8,border:`1px solid #FECACA`,background:`#FEF2F2`,color:`#DC2626`,fontWeight:600,fontSize:13,cursor:`pointer`},children:`Delete`})]})]})]})]})}function Xj(e){let t=`Hi ${e.contact_name}, 428 429Great news â ${e.business_name} has been accepted into the Palm Beach Comm Founding Business Beta! 430 431Here's what you get: 432- 60 days of full Elite-tier features 433- A permanent "Founding Business" badge on your listing 434- Guaranteed homepage Featured Spotlight for the trial period 435- Priority access to new features as they launch 436 437We'll be reaching out shortly to get your listing set up. In the meantime, feel free to reply to this email with any questions. 438 439Welcome aboard! 440Palm Beach Comm`;return`mailto:${e.email}?subject=You're%20in!%20Welcome%20to%20the%20Palm%20Beach%20Comm%20Beta&body=${encodeURIComponent(t)}`}function Zj(e){let t=`Hi ${e.contact_name}, 441 442Thank you so much for applying to the Palm Beach Comm Founding Business Beta for ${e.business_name}. We had a lot of interest and kept the beta group small so we could give everyone real, hands-on attention. 443 444We weren't able to include you in this first round, but we'd still love to have ${e.business_name} listed on Palm Beach Comm â it's always free to get started, and we'll keep you in mind for future opportunities. 445 446Thanks again for your interest! 447Palm Beach Comm`;return`mailto:${e.email}?subject=Update%20on%20your%20Palm%20Beach%20Comm%20Beta%20application&body=${encodeURIComponent(t)}`}var Qj={pending:{bg:`#FFFBEB`,color:`#92400E`},approved:{bg:`#F0FDF4`,color:`#15803D`},rejected:{bg:`#F5F5F5`,color:`#6B7280`}};function $j(){let[e,t]=(0,_.useState)([]),[n,r]=(0,_.useState)(null),[i,a]=(0,_.useState)(`all`);(0,_.useEffect)(()=>{o()},[]);async function o(){let{data:e}=await z.from(`beta_applications`).select(`*`).order(`created_at`,{ascending:!1});t(e||[])}async function s(e,n){await z.from(`beta_applications`).update({status:n}).eq(`id`,e),t(t=>t.map(t=>t.id===e?{...t,status:n}:t)),r(t=>t?.id===e?{...t,status:n}:t)}async function c(e){confirm(`Delete this application?`)&&(await z.from(`beta_applications`).delete().eq(`id`,e),t(t=>t.filter(t=>t.id!==e)),n?.id===e&&r(null))}let l=e.filter(e=>e.status===`pending`).length,u=i===`all`?e:e.filter(e=>e.status===i);return(0,j.jsxs)(`div`,{style:{padding:32,maxWidth:1e3},children:[(0,j.jsxs)(`div`,{style:{marginBottom:24},children:[(0,j.jsx)(`h1`,{style:{fontSize:22,fontWeight:900,color:`#111`,marginBottom:2},children:`Beta Applications`}),(0,j.jsxs)(`p`,{style:{fontSize:13,color:`#9CA3AF`},children:[e.length,` application`,e.length===1?``:`s`,l>0&&(0,j.jsxs)(`span`,{style:{marginLeft:8,background:`#C0392B`,color:`#fff`,fontSize:11,fontWeight:700,padding:`2px 8px`,borderRadius:999},children:[l,` pending`]})]})]}),(0,j.jsx)(`div`,{style:{display:`flex`,gap:8,marginBottom:16},children:[`all`,`pending`,`approved`,`rejected`].map(e=>(0,j.jsx)(`button`,{onClick:()=>a(e),style:{padding:`6px 14px`,borderRadius:999,fontSize:12,fontWeight:600,cursor:`pointer`,textTransform:`capitalize`,border:i===e?`none`:`1px solid #E5E7EB`,background:i===e?`#C0392B`:`#fff`,color:i===e?`#fff`:`#374151`},children:e},e))}),(0,j.jsxs)(`div`,{style:{display:`flex`,gap:20,alignItems:`flex-start`},children:[(0,j.jsx)(`div`,{style:{flex:1,background:`#fff`,borderRadius:12,border:`1px solid #EBEBEB`,overflow:`hidden`},children:u.length===0?(0,j.jsxs)(`div`,{style:{padding:`48px 16px`,textAlign:`center`,color:`#9CA3AF`,fontSize:14},children:[`No applications`,i===`all`?``:` marked ${i}`,` yet.`]}):u.map((e,t)=>{let i=Qj[e.status]||Qj.pending;return(0,j.jsxs)(`div`,{onClick:()=>r(e),style:{padding:`14px 20px`,borderBottom:t<u.length-1?`1px solid #F5F5F5`:`none`,cursor:`pointer`,background:n?.id===e.id?`#FEF2F2`:`#fff`},children:[(0,j.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:2},children:[(0,j.jsx)(`span`,{style:{fontSize:13,fontWeight:800,color:`#111`},children:e.business_name}),(0,j.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,j.jsx)(`span`,{style:{fontSize:10,fontWeight:700,padding:`2px 8px`,borderRadius:999,textTransform:`capitalize`,background:i.bg,color:i.color},children:e.status}),(0,j.jsx)(`span`,{style:{fontSize:11,color:`#9CA3AF`},children:new Date(e.created_at).toLocaleDateString(`en-US`,{month:`short`,day:`numeric`})})]})]}),(0,j.jsxs)(`div`,{style:{fontSize:11,color:`#6B7280`,marginBottom:2},children:[e.contact_name,` · `,e.category||`No category`,` · `,e.city||`No city`]}),(0,j.jsx)(`p`,{style:{fontSize:12,color:`#9CA3AF`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:e.why_join})]},e.id)})}),n&&(0,j.jsxs)(`div`,{style:{width:360,background:`#fff`,borderRadius:12,border:`1px solid #EBEBEB`,padding:24,flexShrink:0},children:[(0,j.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`flex-start`,marginBottom:12},children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`h2`,{style:{fontSize:15,fontWeight:900,color:`#111`,marginBottom:2},children:n.business_name}),(0,j.jsx)(`p`,{style:{fontSize:12,color:`#6B7280`},children:n.contact_name})]}),(0,j.jsx)(`button`,{onClick:()=>r(null),style:{background:`none`,border:`none`,fontSize:18,color:`#9CA3AF`,cursor:`pointer`},children:`Ã`})]}),(0,j.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:10,fontSize:13,color:`#374151`,marginBottom:16},children:[(0,j.jsx)(eM,{label:`Email`,value:(0,j.jsx)(`a`,{href:`mailto:${n.email}`,style:{color:`#C0392B`,textDecoration:`none`},children:n.email})}),n.phone&&(0,j.jsx)(eM,{label:`Phone`,value:n.phone}),(0,j.jsx)(eM,{label:`Category`,value:n.category||`â`}),(0,j.jsx)(eM,{label:`City`,value:n.city||`â`}),n.online_presence&&(0,j.jsx)(eM,{label:`Online`,value:(0,j.jsx)(`a`,{href:n.online_presence,target:`_blank`,rel:`noopener noreferrer`,style:{color:`#C0392B`,textDecoration:`none`},children:n.online_presence})}),(0,j.jsx)(eM,{label:`Feedback`,value:n.feedback_willing?`â Willing`:`â Not indicated`})]}),(0,j.jsxs)(`div`,{style:{marginBottom:20},children:[(0,j.jsx)(`p`,{style:{fontSize:11,fontWeight:700,color:`#9CA3AF`,textTransform:`uppercase`,letterSpacing:`0.04em`,marginBottom:6},children:`Why they want to join`}),(0,j.jsx)(`p`,{style:{fontSize:13,color:`#374151`,lineHeight:1.7},children:n.why_join})]}),(0,j.jsxs)(`p`,{style:{fontSize:11,color:`#9CA3AF`,marginBottom:20}
447,children:[`Applied `,new Date(n.created_at).toLocaleString(`en-US`,{month:`long`,day:`numeric`,year:`numeric`,hour:`numeric`,minute:`2-digit`})]}),n.status===`approved`&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`div`,{style:{background:`#FFFBEB`,border:`1px solid #FDE68A`,borderRadius:8,padding:`10px 12px`,fontSize:12,color:`#92400E`,lineHeight:1.6,marginBottom:12},children:`Approved â remember to manually apply the beta perks (Elite tier, "Founding Business" badge, Featured Spotlight) on their listing via Admin â Businesses. This isn't automatic yet.`}),(0,j.jsxs)(`a`,{href:Xj(n),style:{display:`block`,textAlign:`center`,width:`100%`,boxSizing:`border-box`,padding:`9px 0`,borderRadius:8,background:`#15803D`,color:`#fff`,fontWeight:700,fontSize:13,textDecoration:`none`,marginBottom:16},children:[`âï¸ Email Approval to `,n.contact_name]})]}),n.status===`rejected`&&(0,j.jsxs)(`a`,{href:Zj(n),style:{display:`block`,textAlign:`center`,width:`100%`,boxSizing:`border-box`,padding:`9px 0`,borderRadius:8,background:`#F5F5F5`,color:`#374151`,fontWeight:700,fontSize:13,textDecoration:`none`,marginBottom:16,border:`1px solid #E5E7EB`},children:[`âï¸ Email Decision to `,n.contact_name]}),(0,j.jsxs)(`div`,{style:{display:`flex`,gap:8,marginBottom:8},children:[n.status!==`approved`&&(0,j.jsx)(`button`,{onClick:()=>s(n.id,`approved`),style:{flex:1,background:`#15803D`,color:`#fff`,fontWeight:700,fontSize:13,padding:`9px 0`,borderRadius:8,border:`none`,cursor:`pointer`},children:`Approve`}),n.status!==`rejected`&&(0,j.jsx)(`button`,{onClick:()=>s(n.id,`rejected`),style:{flex:1,background:`#F5F5F5`,color:`#374151`,fontWeight:700,fontSize:13,padding:`9px 0`,borderRadius:8,border:`none`,cursor:`pointer`},children:`Reject`}),n.status!==`pending`&&(0,j.jsx)(`button`,{onClick:()=>s(n.id,`pending`),style:{padding:`9px 12px`,borderRadius:8,border:`1px solid #E5E7EB`,background:`#fff`,color:`#6B7280`,fontWeight:600,fontSize:13,cursor:`pointer`},children:`Reset`})]}),(0,j.jsx)(`button`,{onClick:()=>c(n.id),style:{width:`100%`,padding:`8px 0`,borderRadius:8,border:`1px solid #FECACA`,background:`#FEF2F2`,color:`#DC2626`,fontWeight:600,fontSize:12,cursor:`pointer`},children:`Delete`})]})]})]})}function eM({label:e,value:t}){return(0,j.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,gap:12},children:[(0,j.jsx)(`span`,{style:{color:`#9CA3AF`,flexShrink:0},children:e}),(0,j.jsx)(`span`,{style:{textAlign:`right`,wordBreak:`break-word`},children:t})]})}function tM(){let[e,t]=(0,_.useState)([]),[n,r]=(0,_.useState)(``),[i,a]=(0,_.useState)(`all`);(0,_.useEffect)(()=>{o()},[]);async function o(){let{data:e}=await z.from(`reviews`).select(`*, businesses(name)`).order(`created_at`,{ascending:!1});t(e||[])}async function s(e){await z.from(`reviews`).update({hidden:!e.hidden}).eq(`id`,e.id),t(t=>t.map(t=>t.id===e.id?{...t,hidden:!e.hidden}:t))}async function c(e){confirm(`Delete this review? This cannot be undone.`)&&(await z.from(`reviews`).delete().eq(`id`,e),t(t=>t.filter(t=>t.id!==e)))}let l=n.trim().toLowerCase(),u=e.filter(e=>i===`visible`&&e.hidden||i===`hidden`&&!e.hidden?!1:l?e.businesses?.name?.toLowerCase().includes(l)||e.reviewer_name?.toLowerCase().includes(l)||e.text?.toLowerCase().includes(l):!0),d=e.filter(e=>e.hidden).length;return(0,j.jsxs)(`div`,{style:{padding:32,maxWidth:1e3},children:[(0,j.jsxs)(`div`,{style:{marginBottom:24},children:[(0,j.jsx)(`h1`,{style:{fontSize:22,fontWeight:900,color:`#111`,marginBottom:2},children:`Reviews`}),(0,j.jsxs)(`p`,{style:{fontSize:13,color:`#9CA3AF`},children:[e.length,` review`,e.length===1?``:`s`,d>0&&(0,j.jsxs)(`span`,{style:{marginLeft:8,background:`#F5F5F5`,color:`#6B7280`,fontSize:11,fontWeight:700,padding:`2px 8px`,borderRadius:999},children:[d,` hidden`]})]})]}),(0,j.jsxs)(`div`,{style:{display:`flex`,gap:10,marginBottom:16,flexWrap:`wrap`},children:[(0,j.jsx)(`input`,{type:`text`,value:n,onChange:e=>r(e.target.value),placeholder:`Search by business, reviewer, or text...`,style:{flex:`1 1 260px`,padding:`9px 14px`,borderRadius:8,border:`1px solid #E5E7EB`,fontSize:13,color:`#111`,outline:`none`}}),(0,j.jsx)(`div`,{style:{display:`flex`,gap:8},children:[`all`,`visible`,`hidden`].map(e=>(0,j.jsx)(`button`,{onClick:()=>a(e),style:{padding:`6px 14px`,borderRadius:999,fontSize:12,fontWeight:600,cursor:`pointer`,textTransform:`capitalize`,border:i===e?`none`:`1px solid #E5E7EB`,background:i===e?`#C0392B`:`#fff`,color:i===e?`#fff`:`#374151`},children:e},e))})]}),(0,j.jsx)(`div`,{style:{background:`#fff`,borderRadius:12,border:`1px solid #EBEBEB`,overflow:`hidden`},children:u.length===0?(0,j.jsx)(`div`,{style:{padding:`48px 16px`,textAlign:`center`,color:`#9CA3AF`,fontSize:14},children:e.length===0?`No reviews yet.`:`No reviews match your search/filter.`}):u.map((e,t)=>(0,j.jsxs)(`div`,{style:{padding:`16px 20px`,borderBottom:t<u.length-1?`1px solid #F5F5F5`:`none`,opacity:e.hidden?.6:1},children:[(0,j.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`flex-start`,gap:12,marginBottom:6},children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`span`,{style:{fontSize:13,fontWeight:800,color:`#111`},children:e.businesses?.name||`Unknown business`}),(0,j.jsxs)(`span`,{style:{fontSize:12,color:`#9CA3AF`,marginLeft:8},children:[`reviewed by `,e.reviewer_name]})]}),(0,j.jsx)(`span`,{style:{fontSize:11,color:`#9CA3AF`,flexShrink:0},children:new Date(e.created_at).toLocaleDateString(`en-US`,{month:`short`,day:`numeric`,year:`numeric`})})]}),(0,j.jsxs)(`div`,{style:{color:`#F59E0B`,fontSize:13,marginBottom:6},children:[`â
`.repeat(e.rating),`â`.repeat(5-e.rating)]}),e.text&&(0,j.jsx)(`p`,{style:{fontSize:13,color:`#374151`,lineHeight:1.6,marginBottom:10},children:e.text}),(0,j.jsxs)(`div`,{style:{display:`flex`,gap:8},children:[(0,j.jsx)(`button`,{onClick:()=>s(e),style:{fontSize:11,fontWeight:700,padding:`4px 12px`,borderRadius:999,border:`none`,cursor:`pointer`,background:e.hidden?`#F0FDF4`:`#F5F5F5`,color:e.hidden?`#15803D`:`#6B7280`},children:e.hidden?`Unhide`:`Hide`}),(0,j.jsx)(`button`,{onClick:()=>c(e.id),style:{fontSize:11,fontWeight:700,padding:`4px 12px`,borderRadius:999,border:`1px solid #FECACA`,background:`#FEF2F2`,color:`#DC2626`,curs
447or:`pointer`},children:`Delete`})]})]},e.id))})]})}var nM=` 448 .blog-body { font-size: 15px; line-height: 1.8; color: #374151; } 449 .blog-body h2 { font-size: 20px; font-weight: 800; color: #111; margin: 28px 0 10px; } 450 .blog-body h3 { font-size: 17px; font-weight: 700; color: #111; margin: 22px 0 8px; } 451 .blog-body p { margin: 0 0 14px; } 452 .blog-body ul, .blog-body ol { padding-left: 24px; margin: 0 0 14px; } 453 .blog-body li { margin-bottom: 4px; } 454 .blog-body blockquote { border-left: 3px solid #C0392B; margin: 16px 0; padding: 6px 18px; color: #6B7280; font-style: italic; } 455 .blog-body img { max-width: 100%; border-radius: 10px; margin: 16px 0; display: block; } 456 .blog-body a { color: #C0392B; text-decoration: underline; } 457 .blog-body strong { font-weight: 700; color: #111; } 458 @media (max-width: 767px) { 459 .mob-hide { display: none !important; } 460 .mob-show { display: flex !important; } 461 .mob-1col { grid-template-columns: 1fr !important; } 462 .mob-2col { grid-template-columns: repeat(2,1fr) !important; } 463 .mob-stack { flex-direction: column !important; align-items: flex-start !important; } 464 .mob-full { width: 100% !important; max-width: 100% !important; } 465 .mob-footer { grid-template-columns: repeat(2,1fr) !important; gap: 24px !important; padding: 36px 0 24px !important; } 466 .mob-p { padding: 20px 16px !important; } 467 } 468 @media (min-width: 768px) { 469 .mob-show { display: none !important; } 470 } 471`;function rM(){let[e,t]=(0,_.useState)(!1);return e?null:(0,j.jsxs)(`div`,{style:{background:`#F0C419`,padding:`10px 16px`,textAlign:`center`,position:`relative`,display:`flex`,alignItems:`center`,justifyContent:`center`,gap:10,flexWrap:`wrap`},children:[(0,j.jsxs)(`span`,{style:{fontSize:13,fontWeight:700,color:`#111`},children:[`ð `,(0,j.jsx)(`strong`,{children:`14-Day Elite Free Trial`}),` â Guaranteed homepage placement, unlimited photos, custom badge & more. No credit card needed.`]}),(0,j.jsx)(A,{to:`/sign-up`,style:{fontSize:12,fontWeight:800,color:`#fff`,background:`#111`,padding:`5px 14px`,borderRadius:999,textDecoration:`none`,whiteSpace:`nowrap`},children:`Start Free Trial â`}),(0,j.jsx)(`button`,{onClick:()=>t(!0),style:{position:`absolute`,right:12,top:`50%`,transform:`translateY(-50%)`,background:`none`,border:`none`,fontSize:16,color:`#92400E`,cursor:`pointer`,lineHeight:1,padding:4},children:`Ã`})]})}function iM({children:e}){return(0,j.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,minHeight:`100vh`},children:[(0,j.jsx)(`style`,{dangerouslySetInnerHTML:{__html:nM}}),(0,j.jsx)(rM,{}),(0,j.jsx)(Ic,{}),(0,j.jsx)(`main`,{style:{flex:1},children:e}),(0,j.jsx)(Vc,{}),(0,j.jsx)(Su,{}),(0,j.jsx)(wu,{})]})}function aM({notifyTopic:e}){let[t,n]=(0,_.useState)(``),[r,i]=(0,_.useState)(`idle`);async function a(n){if(n.preventDefault(),!t.trim())return;i(`loading`);let{error:r}=await z.from(`contact_submissions`).insert({name:``,email:t.trim(),topic:e,message:`Notify me when ${e} launches.`,read:!1});i(r?`error`:`done`)}return r===`done`?(0,j.jsx)(`p`,{style:{fontSize:14,fontWeight:700,color:`#15803D`,marginBottom:32},children:`â You're on the list â we'll email you when it launches.`}):(0,j.jsxs)(`form`,{onSubmit:a,style:{display:`flex`,gap:8,marginBottom:r===`error`?10:32,flexWrap:`wrap`,justifyContent:`center`},children:[(0,j.jsx)(`input`,{type:`email`,required:!0,value:t,onChange:e=>n(e.target.value),placeholder:`[email protected]`,style:{flex:`1 1 220px`,padding:`11px 16px`,borderRadius:999,border:`1px solid #E5E7EB`,fontSize:14,outline:`none`}}),(0,j.jsx)(`button`,{type:`submit`,disabled:r===`loading`,style:{background:`#C0392B`,color:`#fff`,fontWeight:700,fontSize:14,padding:`11px 24px`,borderRadius:999,border:`none`,cursor:r===`loading`?`not-allowed`:`pointer`,opacity:r===`loading`?.7:1},children:r===`loading`?`Submitting...`:`Notify Me`}),r===`error`&&(0,j.jsx)(`p`,{style:{width:`100%`,fontSize:12,color:`#DC2626`,marginTop:4},children:`Something went wrong â please try again.`})]})}function oM(){return(0,j.jsxs)(`div`,{style:{background:`#FFFBEB`,border:`1px solid #FDE68A`,borderRadius:10,padding:`12px 16px`,marginBottom:20,fontSize:13,color:`#92400E`,lineHeight:1.6},children:[`ð° `,(0,j.jsx)(`strong`,{children:`Refer a business, earn 15%`}),` commission on their first year. `,(0,j.jsx)(A,{to:`/contact`,style:{color:`#92400E`,fontWeight:700,textDecoration:`underline`},children:`Contact us to learn more â`})]})}function sM({icon:e,title:t,description:n,extra:r,notifyTopic:i}){return(0,j.jsx)(`div`,{style:{minHeight:`60vh`,display:`flex`,alignItems:`center`,justifyContent:`center`,padding:`80px 24px`},children:(0,j.jsxs)(`div`,{style:{maxWidth:520,textAlign:`center`},children:[(0,j.jsx)(`span`,{style:{fontSize:56,display:`block`,marginBottom:20},children:e}),(0,j.jsx)(`h1`,{style:{fontSize:32,fontWeight:900,color:`#111`,marginBottom:12},children:t}),(0,j.jsx)(`p`,{style:{fontSize:15,color:`#6B7280`,lineHeight:1.7,marginBottom:32},children:n}
471),i&&(0,j.jsx)(aM,{notifyTopic:i}),r,(0,j.jsx)(A,{to:`/`,style:{display:`inline-block`,background:`#C0392B`,color:`#fff`,fontWeight:700,fontSize:14,padding:`12px 28px`,borderRadius:999,textDecoration:`none`},children:`Back to Home`})]})})}function cM(){return(0,j.jsx)(or,{children:(0,j.jsxs)(zn,{children:[(0,j.jsx)(sr,{}),(0,j.jsxs)(Yt,{children:[(0,j.jsx)(k,{path:`/admin/login`,element:(0,j.jsx)(zu,{})}),(0,j.jsxs)(k,{path:`/admin`,element:(0,j.jsx)(Vu,{}),children:[(0,j.jsx)(k,{index:!0,element:(0,j.jsx)(Ju,{})}),(0,j.jsx)(k,{path:`businesses`,element:(0,j.jsx)(Ju,{})}),(0,j.jsx)(k,{path:`events`,element:(0,j.jsx)(td,{})}),(0,j.jsx)(k,{path:`posts`,element:(0,j.jsx)(Nj,{})}),(0,j.jsx)(k,{path:`ads`,element:(0,j.jsx)(Wj,{})}),(0,j.jsx)(k,{path:`resources`,element:(0,j.jsx)(Fu,{})}),(0,j.jsx)(k,{path:`contacts`,element:(0,j.jsx)(Jj,{})}),(0,j.jsx)(k,{path:`inquiries`,element:(0,j.jsx)(Yj,{})}),(0,j.jsx)(k,{path:`beta`,element:(0,j.jsx)($j,{})}),(0,j.jsx)(k,{path:`reviews`,element:(0,j.jsx)(tM,{})})]}),(0,j.jsx)(k,{path:`/`,element:(0,j.jsx)(iM,{children:(0,j.jsx)(fl,{})})}),(0,j.jsx)(k,{path:`/businesses`,element:(0,j.jsx)(iM,{children:(0,j.jsx)(hl,{})})}),(0,j.jsx)(k,{path:`/businesses/:slug`,element:(0,j.jsx)(iM,{children:(0,j.jsx)(Cl,{})})}),(0,j.jsx)(k,{path:`/events`,element:(0,j.jsx)(iM,{children:(0,j.jsx)(El,{})})}),(0,j.jsx)(k,{path:`/events/:id`,element:(0,j.jsx)(iM,{children:(0,j.jsx)(Il,{})})}),(0,j.jsx)(k,{path:`/blog`,element:(0,j.jsx)(iM,{children:(0,j.jsx)(kl,{})})}),(0,j.jsx)(k,{path:`/blog/:slug`,element:(0,j.jsx)(iM,{children:(0,j.jsx)(Nl,{})})}),(0,j.jsx)(k,{path:`/pricing`,element:(0,j.jsx)(iM,{children:(0,j.jsx)(Rl,{})})}),(0,j.jsx)(k,{path:`/forums`,element:(0,j.jsx)(iM,{children:(0,j.jsx)(Bl,{})})}),(0,j.jsx)(k,{path:`/sign-in`,element:(0,j.jsx)(iM,{children:(0,j.jsx)(Vl,{})})}),(0,j.jsx)(k,{path:`/sign-up`,element:(0,j.jsx)(iM,{children:(0,j.jsx)(Ul,{})})}),(0,j.jsx)(k,{path:`/account`,element:(0,j.jsx)(iM,{children:(0,j.jsx)(Gl,{})})}),(0,j.jsx)(k,{path:`/resources`,element:(0,j.jsx)(iM,{children:(0,j.jsx)(nu,{})})}),(0,j.jsx)(k,{path:`/resources/:id`,element:(0,j.jsx)(iM,{children:(0,j.jsx)(su,{})})}),(0,j.jsx)(k,{path:`/join`,element:(0,j.jsx)(iM,{children:(0,j.jsx)(Rl,{})})}),(0,j.jsx)(k,{path:`/jobs`,element:(0,j.jsx)(iM,{children:(0,j.jsx)(sM,{icon:`ð¼`,title:`Job Board Coming Soon`,description:`Local businesses will soon be able to post openings directly on Palm Beach Comm. Check back soon â or list your business to be notified first.`,notifyTopic:`Job Board Notify Me`,extra:(0,j.jsx)(oM,{})})})}),(0,j.jsx)(k,{path:`/classifieds`,element:(0,j.jsx)(iM,{children:(0,j.jsx)(sM,{icon:`ð·ï¸`,title:`Classifieds Coming Soon`,description:`A paid classifieds section for Palm Beach County is in development. Buy, sell, and trade locally â right here.`,notifyTopic:`Classifieds Notify Me`,extra:(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(A,{to:`/pbc-classifieds`,style:{display:`block`,fontSize:14,fontWeight:700,color:`#C0392B`,textDecoration:`none`,marginBottom:20},children:`In the meantime, join PBC Classifieds on Facebook â`}),(0,j.jsx)(oM,{})]})})})}),(0,j.jsx)(k,{path:`/pbc-classifieds`,element:(0,j.jsx)(iM,{children:(0,j.jsx)(hu,{})})}),(0,j.jsx)(k,{path:`/podcasts`,element:(0,j.jsx)(iM,{children:(0,j.jsx)(sM,{icon:`ðï¸`,title:`Podcasts Coming Soon`,description:`The Palm Beach Comm podcast is in the works â no episodes yet, but we'll let you know the moment the first one drops.`,notifyTopic:`Podcasts Notify Me`})})}),(0,j.jsx)(k,{path:`/contact`,element:(0,j.jsx)(iM,{children:(0,j.jsx)(lu,{})})}),(0,j.jsx)(k,{path:`/terms`,element:(0,j.jsx)(iM,{children:(0,j.jsx)(Du,{})})}),(0,j.jsx)(k,{path:`/privacy`,element:(0,j.jsx)(iM,{children:(0,j.jsx)(Ou,{})})}),(0,j.jsx)(k,{path:`/featured-spotlight`,element:(0,j.jsx)(iM,{children:(0,j.jsx)(Mu,{})})}),(0,j.jsx)(k,{path:`/advertise`,element:(0,j.jsx)(iM,{children:(0,j.jsx)(Yl,{})})}),(0,j.jsx)(k,{path:`/beta`,element:(0,j.jsx)(iM,{children:(0,j.jsx)(_u,{})})})]})]})})}(0,v.createRoot)(document.getElementById(`root`)).render((0,j.jsx)(_.StrictMode,{children:(0,j.jsx)(cM,{})}));
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.