couriercrow 0.0.0-stage → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +19 -2
  3. package/bin/couriercrow.js +5 -0
  4. package/bin/crow.js +14 -0
  5. package/bundle/migrations/0001_initial.sql +463 -0
  6. package/bundle/version.json +3 -0
  7. package/bundle/web/_headers +6 -0
  8. package/bundle/web/assets/index-Bim8rHvG.css +2 -0
  9. package/bundle/web/assets/index-YpJn_3e5.js +13 -0
  10. package/bundle/web/index.html +14 -0
  11. package/bundle/worker/README.md +1 -0
  12. package/bundle/worker/worker.js +57841 -0
  13. package/bundle/wrangler.jsonc +64 -0
  14. package/package.json +61 -4
  15. package/src/app-credentials.ts +413 -0
  16. package/src/bin.ts +578 -0
  17. package/src/build-config.ts +264 -0
  18. package/src/build-id.ts +39 -0
  19. package/src/cloudflare/cloudflare-client.ts +361 -0
  20. package/src/cloudflare/cloudflare-live-access.ts +454 -0
  21. package/src/cloudflare/cloudflare-live-account.ts +95 -0
  22. package/src/cloudflare/cloudflare-live-api.ts +87 -0
  23. package/src/cloudflare/cloudflare-live-checks.ts +151 -0
  24. package/src/cloudflare/cloudflare-live-zone.ts +363 -0
  25. package/src/cloudflare/cloudflare-live.ts +270 -0
  26. package/src/cloudflare/cloudflare-state.ts +152 -0
  27. package/src/cloudflare/first-run.ts +322 -0
  28. package/src/credentials-show.ts +49 -0
  29. package/src/deploy.ts +807 -0
  30. package/src/doctor.ts +504 -0
  31. package/src/environment.ts +141 -0
  32. package/src/index.ts +4 -0
  33. package/src/init.ts +332 -0
  34. package/src/load-config.ts +47 -0
  35. package/src/mailbox-api.ts +345 -0
  36. package/src/permissions.ts +133 -0
  37. package/src/plan.ts +517 -0
  38. package/src/printable.ts +8 -0
  39. package/src/product.ts +63 -0
  40. package/src/purge.ts +93 -0
  41. package/src/render.ts +406 -0
  42. package/src/rotate-app-secret.ts +53 -0
  43. package/src/runtime.ts +33 -0
  44. package/src/set-secret.ts +63 -0
  45. package/src/terminal.ts +163 -0
  46. package/src/wrangler.ts +168 -0
@@ -0,0 +1,13 @@
1
+ var 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,t.exports),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,o)=>(o=n==null?{}:e(i(n)),s(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,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),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`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.for(`react.view_transition`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.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`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function b(){}b.prototype=y.prototype;function x(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var S=x.prototype=new b;S.constructor=x,_(S,y.prototype),S.isPureReactComponent=!0;var C=Array.isArray;function w(){}var T={H:null,A:null,T:null,S:null},ee=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function te(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var k=/\/+/g;function A(e,t){return typeof e==`object`&&e&&e.key!=null?te(``+e.key):t.toString(36)}function ne(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(w,w):(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 re(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,re(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+A(e,0):a,C(o)?(i=``,c!=null&&(i=c.replace(k,`$&/`)+`/`),re(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(k,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(C(e))for(var u=0;u<e.length;u++)a=e[u],s=l+A(a,u),c+=re(a,r,i,s,o);else if(u=h(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+A(a,u++),c+=re(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return re(ne(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 ie(e,t,n){if(e==null)return e;var r=[],i=0;return re(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function j(e){if(e._status===-1){var t=e._result,n=t();n.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t,n.status===void 0&&(n.status=`fulfilled`,n.value=t))},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t,n.status===void 0&&(n.status=`rejected`,n.reason=t))}),e._status===-1&&(e._status=0,e._result=n)}if(e._status===1)return e._result.default;throw e._result}var ae=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)};function oe(e){var t=T.T,n={};n.types=t===null?null:t.types,T.T=n;try{var r=e(),i=T.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(w,ae)}catch(e){ae(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),T.T=t}}function se(e){var t=T.T;if(t!==null){var n=t.types;n===null?t.types=[e]:n.indexOf(e)===-1&&n.push(e)}else oe(se.bind(null,e))}var ce={map:ie,forEach:function(e,t,n){ie(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ie(e,function(){t++}),t},toArray:function(e){return ie(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=ce,e.Component=y,e.Fragment=r,e.Profiler=a,e.PureComponent=x,e.StrictMode=i,e.Suspense=l,e.ViewTransition=p,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return T.H.useMemoCache(e)}},e.addTransitionType=se,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=_({},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 E(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 E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:j}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=oe,e.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},e.use=function(e){return T.H.use(e)},e.useActionState=function(e,t,n){return T.H.useActionState(e,t,n)},e.useCallback=function(e,t){return T.H.useCallback(e,t)},e.useContext=function(e){return T.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return T.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return T.H.useEffect(e,t)},e.useEffectEvent=function(e){return T.H.useEffectEvent(e)},e.useId=function(){return T.H.useId()},e.useImperativeHandle=function(e,t,n){return T.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return T.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return T.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return T.H.useMemo(e,t)},e.useOptimistic=function(e,t){return T.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return T.H.useReducer(e,t,n)},e.useRef=function(e){return T.H.useRef(e)},e.useState=function(e){return T.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return T.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return T.H.useTransition()},e.version=`19.3.1`})),u=o(((e,t)=>{t.exports=l()})),d=c(u(),1),f=d.createContext(!1),p=()=>d.useContext(f);f.Provider;var m=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})),h=o(((e,t)=>{t.exports=m()}))(),g=d.createContext(void 0),_=e=>{let t=d.useContext(g);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},v=({client:e,children:t})=>(d.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,h.jsx)(g.Provider,{value:e,children:t}));function y(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var b=d.createContext(y()),x=()=>d.useContext(b),S=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},C=new class extends S{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},w={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},T=new class{#e=w;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function ee(e){setTimeout(e,0)}var E=typeof window>`u`||`Deno`in globalThis;function D(){}function O(e,t){return typeof e==`function`?e(t):e}function te(e){return typeof e==`number`&&e>=0&&e!==1/0}function k(e,t){return Math.max(e+(t||0)-Date.now(),0)}function A(e,t){return typeof e==`function`?e(t):e}function ne(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==ie(o,t.options))return!1}else if(!ae(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function re(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(j(t.options.mutationKey)!==j(a))return!1}else if(!ae(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function ie(e,t){return(t?.queryKeyHashFn||j)(e)}function j(e){return JSON.stringify(e,(e,t)=>ue(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function ae(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)!==Array.isArray(t))return!1;if(Array.isArray(e)&&Array.isArray(t)){if(t.length>e.length)return!1;for(let n=0;n<t.length;n++)if(!ae(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!ae(e[r],t[r]))return!1;return!0}return!1}var oe=Object.prototype.hasOwnProperty;function se(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=le(e)&&le(t);if(!r&&!(ue(e)&&ue(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:oe.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=se(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function ce(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n of Object.keys(e))if(!oe.call(t,n)||e[n]!==t[n])return!1;return!0}function le(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ue(e){if(!de(e))return!1;let t=Object.getPrototypeOf(e),n=t?.constructor;if(n===void 0)return!0;if(typeof n!=`function`)return!1;let r=n.prototype;return!(!de(r)||!r.hasOwnProperty(`isPrototypeOf`)||t!==Object.prototype)}function de(e){return Object.prototype.toString.call(e)===`[object Object]`}function fe(e){return new Promise(t=>{T.setTimeout(t,e)})}function M(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:se(e,t)}function pe(e){return e}function me(e,t,n,r){let i=r?[t,...e]:[...e,t];return n&&i.length>n?r?i.slice(0,n):i.slice(-n):i}var he=Symbol();function N(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===he?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function P(e,t){return typeof e==`function`?e(...t):!!e}var ge=Symbol();function _e(e,t,n,r){let i=!1,a;return Object.defineProperties(e,{[ge]:{value:r},signal:{enumerable:!0,get:()=>(a??=t(),i||(i=!0,a.aborted?n():a.addEventListener(`abort`,n,{once:!0})),a)}}),e}var ve=()=>E,ye=()=>ve();function F(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=t,u=e=>{_e(e,()=>t.signal,()=>n=!0,l[ge])},d=N(t.options,t.fetchOptions),f=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return u(e),e})(),o=await d(a),{maxPages:s}=t.options;return{pages:me(e.pages,o,s,i),pageParams:me(e.pageParams,r,s,i)}};if(i&&a.length){let e=i===`backward`,t=e?L:I,n={pages:a,pageParams:o};s=await f(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]===void 0?r.initialPageParam:o[0]:I(r,s);if(c>0&&e==null)break;s=await f(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function I(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function L(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function be(e,t){return t?I(e,t)!=null:!1}function xe(e,t){return!t||!e.getPreviousPageParam?!1:L(e,t)!=null}var Se=ee;function Ce(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=Se,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var R=Ce(),we=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),te(this.gcTime)&&(this.#e=T.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ye()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(T.clearTimeout(this.#e),this.#e=void 0)}},Te=new class extends S{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function Ee(e){return Math.min(1e3*2**e,3e4)}function De(e){return(e??`online`)!==`online`||Te.isOnline()}var Oe=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function ke(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(D);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new Oe(t);h(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>C.isFocused()&&(e.networkMode===`always`||Te.isOnline())&&e.canRun(),p=()=>De(e.networkMode)&&e.canRun(),m=e=>{c()||(r?.(),i=`resolved`,a(e))},h=e=>{c()||(r?.(),i=`rejected`,o(e))},g=t=>new Promise(n=>{r=e=>{(c()||t())&&n(e)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),_=()=>{if(c())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(m).catch(r=>{if(c())return;let i=e.retry??(ye()?0:3),a=e.retryDelay??Ee,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);t||!s?h(r):(n++,e.onFail?.(n,r),fe(o).then(()=>c()||f()?void 0:g(f)).then(()=>{t?h(r):_()}))})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?_():g(p).then(_),s)}}var Ae=class extends we{#e;#t;#n;#r;#i;#a;#o;#s;#c;constructor(e){super(),this.#c=!1,this.#s=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=Ne(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#s,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=Ne(this.options);e.data!==void 0&&(this.setState(Me(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=M(this.state.data,e,this.options);return this.#u({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#u({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(D).catch(D):Promise.resolve()}destroy(){this.cancel({silent:!0}),super.destroy()}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>A(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===he||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.state.data!==void 0&&this.getObserversCount()>0&&this.observers.some(e=>A(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!k(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){let t=this.observers.indexOf(e);t!==-1&&(this.observers.splice(t,1),this.observers.length||(this.#a&&(this.#c||this.state.fetchStatus===`paused`&&this.state.status===`pending`?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.#l()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#u({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a&&this.#o)return this.#a.continueRetry(),this.#o}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperties(e,{[ge]:{value:n.signal,enumerable:!0},signal:{enumerable:!0,get:()=>(this.#c=!0,n.signal)}})},i=()=>{let e=N(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#c=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?F(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#u({type:`fetch`,meta:a.fetchOptions?.meta});let o=this.#a=ke({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof Oe&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#u({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#u({type:`pause`})},onContinue:()=>{this.#u({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0}),s=(async()=>{try{let e=await o.promise;if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof Oe){if(e.silent){if(this.#a!==o&&this.#o)return this.#o;throw e}if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#u({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.#a===o&&(this.#a=void 0,this.#o=void 0),this.#l()}})();return this.#o=s,o.start(),s}#l(){this.#r.get(this.queryHash)===this&&this.scheduleGc()}#u(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...je(t.data,this.options),fetchMeta:e.meta??null};case`success`:{let n={...t,...Me(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n}case`error`:{let n=e.error;return{...t,error:n,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:n,fetchStatus:`idle`,status:`error`,isInvalidated:!0}}case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),R.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function je(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:De(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function Me(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function Ne(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var Pe=class extends S{#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p=new Set;constructor(e,t){super(),this.options=t,this.#e=e,this.#a=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Ie(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Le(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Le(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof A(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!ce(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&Re(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||A(this.options.enabled,this.#t)!==A(t.enabled,this.#t)||A(this.options.staleTime,this.#t)!==A(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||A(this.options.enabled,this.#t)!==A(t.enabled,this.#t)||i!==this.#f)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return ce(this.getCurrentResult(),n)||(this.#r=n,this.#i=e),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),Reflect.get(e,n))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t),r=()=>{},i,a=new Promise(e=>{i=e,r=this.#e.getQueryCache().subscribe(i=>{i.type===`updated`&&i.query.queryHash===n.queryHash&&n.state.data!==void 0&&(r(),e(this.createResult(n,t)))})});return Promise.race([n.fetch(t).then(()=>{let e=this.createResult(n,t);return i?.(e),e}).finally(()=>{r()}),a])}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#m(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(D)),t}#h(e){return!ye()&&A(this.options.enabled,this.#t)!==!1&&te(e)}#g(){this.#b();let e=A(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=k(this.#r.dataUpdatedAt,e)+1;this.#u=T.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return A(this.options.refetchInterval,this.#t)??!1}#v(e){this.#x(),this.#f=e,this.#f!==0&&this.#h(this.#f)&&(this.#d=T.setInterval(()=>{(this.options.refetchIntervalInBackground||C.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(T.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(T.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=e===n?this.#n:e.state,{state:s}=e,c={...s},l=!1,u;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&Ie(e,t),o=i&&Re(e,n,t,r);(a||o)&&(c={...c,...je(s.data,e.options)}),t._optimisticResults===`isRestoring`&&(c.fetchStatus=`idle`)}let{error:d,errorUpdatedAt:f,status:p}=c;u=c.data;let m=!1;if(t.placeholderData!==void 0&&u===void 0&&p===`pending`){let e,n=i?.isPlaceholderData&&t.placeholderData===a?.placeholderData;n?(e=i.data,m=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#l?.state.data,this.#l):t.placeholderData,(n||e!==void 0)&&(p=`success`,u=M(t.select&&!m?this.#s:i?.data,e,t),l=!0)}if(t.select&&u!==void 0&&!m){if(u===this.#s&&t.select===this.#o)u=this.#c;else try{this.#o=t.select,this.#s=u,u=t.select(u),u=M(i?.data,u,t),this.#c=u,this.#a=null}catch(e){this.#a=e}}else u===void 0&&(this.#s=void 0,this.#a=null);this.#a&&(d=this.#a,u=this.#c,f=i?.error===d?i.errorUpdatedAt:Date.now(),p=`error`,l=!1);let h=c.fetchStatus===`fetching`,g=p===`pending`,_=p===`error`,v=g&&h,y=u!==void 0;return{status:p,fetchStatus:c.fetchStatus,isPending:g,isSuccess:p===`success`,isError:_,isInitialLoading:v,isLoading:v,data:u,dataUpdatedAt:c.dataUpdatedAt,error:d,errorUpdatedAt:f,failureCount:c.fetchFailureCount,failureReason:c.fetchFailureReason,errorUpdateCount:c.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:c.dataUpdateCount>o.dataUpdateCount||c.errorUpdateCount>o.errorUpdateCount,isFetching:h,isRefetching:h&&!g,isLoadingError:_&&!y,isPaused:c.fetchStatus===`paused`,isPlaceholderData:l,isRefetchError:_&&y,isStale:ze(e,t),refetch:this.refetch,isEnabled:A(t.enabled,e)!==!1}}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);if(this.#i=this.options,this.#t.state.data!==void 0&&(this.#l=this.#t),ce(t,e))return;this.#r=t;let n=(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#p.size||this.options.throwOnError&&this.#r.error!==e.error)return!0;for(let t of n??this.#p)if(this.#r[t]!==e[t])return!0;return!1})();R.batch(()=>{n&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}};function Fe(e,t){return A(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||A(t.retryOnMount,e)!==!1)}function Ie(e,t){return Fe(e,t)||e.state.data!==void 0&&Le(e,t,t.refetchOnMount)}function Le(e,t,n){if(A(t.enabled,e)!==!1&&A(t.staleTime,e)!==`static`){let r=A(n,e);return r===`always`||r!==!1&&ze(e,t)}return!1}function Re(e,t,n,r){return(e!==t||A(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&ze(e,n)}function ze(e,t){return A(t.enabled,e)!==!1&&e.isStaleByTime(A(t.staleTime,e))}var Be=class extends Pe{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type=`infinite`,super.setOptions(e)}getOptimisticResult(e){return e._type=`infinite`,super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(e,t){let{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:a,isError:o,isRefetchError:s}=r,c=n.fetchMeta?.fetchMore?.direction,l=o&&c===`forward`,u=i&&c===`forward`,d=o&&c===`backward`,f=i&&c===`backward`;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:be(t,n.data),hasPreviousPage:xe(t,n.data),isFetchNextPageError:l,isFetchingNextPage:u,isFetchPreviousPageError:d,isFetchingPreviousPage:f,isRefetchError:s&&!l&&!d,isRefetching:a&&!u&&!f}}},Ve=class extends we{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||He(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.#n.has(this)&&this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??(this.state.status===`pending`?this.execute(this.state.variables):Promise.resolve())}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},r=this.#r=ke({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),i=this.state.status===`pending`,a=!r.canStart();try{if(i)t();else{this.#i({type:`pending`,variables:e,isPaused:a}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:a})}this.state.isPaused&&r.canStart()&&t();let o=await r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#i({type:`success`,data:o}),o}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#r===r&&(this.#r=void 0),this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),R.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function He(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var Ue=class extends S{#e;#t;#n;constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}build(e,t,n){let r=new Ve({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=We(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){e.destroy();let t=We(e);if(typeof t==`string`){let n=this.#t.get(t);if(n){if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}}this.notify({type:`removed`,mutation:e})}has(e){return this.#e.has(e)}canRun(e){let t=We(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=We(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){R.batch(()=>{let e=this.getAll();this.#e.clear(),this.#t.clear(),e.forEach(e=>e.destroy()),e.forEach(e=>{this.notify({type:`removed`,mutation:e})})})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>re(t,e))}findAll(e={}){return this.getAll().filter(t=>re(e,t))}notify(e){R.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return R.batch(()=>Promise.all(e.map(e=>e.continue().catch(D))))}};function We(e){return e.options.scope?.id}var Ge=class extends S{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),ce(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&j(t.mutationKey)!==j(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onSubscribe(){this.listeners.size===1&&this.#n&&(this.#n.addObserver(this),this.#i())}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??He();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){R.batch(()=>{let t=this.#r;if(t&&this.hasListeners()){let n=this.#t.variables,r=this.#t.context,i={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{t.onSuccess?.(e.data,n,r,i)}catch(e){Promise.reject(e)}try{t.onSettled?.(e.data,null,n,r,i)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{t.onError?.(e.error,n,r,i)}catch(e){Promise.reject(e)}try{t.onSettled?.(void 0,e.error,n,r,i)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},Ke=class extends S{#e;constructor(e={}){super(),this.config=e,this.#e=new Map}build(e,t,n){let r=t.queryKey,i=t.queryHash??ie(r,t),a=this.get(i);return a||(a=new Ae({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){this.#e.get(e.queryHash)===e&&(e.destroy(),this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){R.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>ne(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>ne(e,t)):t}notify(e){R.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){R.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){R.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},qe=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new Ke,this.#t=e.mutationCache||new Ue,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=C.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=Te.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(A(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=O(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return R.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;R.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return R.batch(()=>{let r=n.findAll(e),i=new Set(r);return r.forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,predicate:e=>i.has(e)},t)})}cancelQueries(e,t={}){let n={revert:!0,...t},r=R.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(D).catch(D)}invalidateQueries(e,t={}){return R.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=R.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n),r=e.state.fetchStatus===`paused`;return(!n.throwOnError||r)&&(t=t.catch(D)),r?Promise.resolve():t}));return Promise.all(r).then(D)}async query(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t),r=n.isStaleByTime(A(t.staleTime,n))?await n.fetch(t):n.state.data,i=t.select;return i?i(r):r}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(A(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(D).catch(D)}infiniteQuery(e){return e._type=`infinite`,this.query(e)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(D).catch(D)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return Te.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(j(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{ae(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(j(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{ae(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=ie(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===he&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Je=(e,t,n)=>{let r=n?.state.status===`error`&&typeof e.throwOnError==`function`?P(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},Ye=e=>{d.useEffect(()=>{e.clearReset()},[e])},Xe=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||P(n,[e.error,r])),Ze=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},Qe=(e,t)=>e?.suspense&&t.isPending,$e=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function et(e,t,n){let r=p(),i=x(),a=_(n),o=a.defaultQueryOptions(e),s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,Ze(o),Je(o,i,s),Ye(i);let[l]=d.useState(()=>new t(a,o)),u=l.getOptimisticResult(o);d.useEffect(()=>{l.setOptions(o)},[o,l]);let f=!r&&c;if(d.useSyncExternalStore(d.useCallback(e=>{let t=f?l.subscribe(R.batchCalls(e)):D;return l.updateResult(),t},[l,f]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),Qe(o,u))throw $e(o,l,i);if(Xe({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return o.notifyOnChangeProps?u:l.trackResult(u)}function tt(e,t){return et(e,Pe,t)}function nt(e,t){let n=_(t),[r]=d.useState(()=>new Ge(n,e));d.useEffect(()=>{r.setOptions(e)},[r,e]);let i=d.useSyncExternalStore(d.useCallback(e=>r.subscribe(R.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=d.useCallback((...e)=>{r.mutate(e[0],e[1]).catch(D)},[r]);if(i.error&&P(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}function rt(e,t){return et(e,Be,t)}var it=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,D());else{var t=n(l);t!==null&&k(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function ee(){return g?!0:!(e.unstable_now()-T<w)}function E(){if(g=!1,S){var t=e.unstable_now();T=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&&ee());){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&&k(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?D():S=!1}}}var D;if(typeof y==`function`)D=function(){y(E)};else if(typeof MessageChannel<`u`){var O=new MessageChannel,te=O.port2;O.port1.onmessage=E,D=function(){te.postMessage(null)}}else D=function(){_(E,0)};function k(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,k(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,D()))),r},e.unstable_shouldYield=ee,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),at=o(((e,t)=>{t.exports=it()})),ot=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`),o=Symbol.for(`react.recoverable`),s=Symbol.for(`react.optimistic_key`);function c(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:r===s?s:``+r,children:e,containerInfo:t,implementation:n}}var l=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(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.browser=function(e){return{$$typeof:o,_reason:e}},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 c(e,t,null,r)},e.flushSync=function(e){var t=l.T,n=i.p;try{if(l.T=null,i.p=2,e)return e()}finally{l.T=t,i.p=n,i.d.f()}},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=d(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=d(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,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority: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=d(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=d(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,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority: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 l.H.useFormState(e,t,n)},e.useFormStatus=function(){return l.H.useHostTransitionStatus()},e.version=`19.3.1`})),st=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=ot()})),ct=o((e=>{var t=at(),n=u(),r=st();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){for(var t=e,n=t;n&&!n.alternate;)t=n,t.flags&4098&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e: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 f(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=f(e),t!==null)return t;e=e.sibling}return null}function p(e,t,n,r,i,a){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,r,i,a)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&p(e.child,t,n,r,i,a))return!0;e=e.sibling}return!1}function m(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function h(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),e.tag!==3&&e.tag!==5&&e.tag!==27);)e=e.return;return t}function g(e){var t=[null,null],n=m(e);return n===null||_(t,e,n.child,{foundSelf:!1}),t}function _(e,t,n,r){for(;n!==null;){if(n===t)r.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(r.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&_(e,t,n.child,r))return!0;n=n.sibling}return!1}function v(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(i(559))}}var y=null,b=null;function x(e,t,n){return e===n||e===t&&(y=e,!0)}function S(e,t,n){return e===n?(b=e,!1):e===t&&(b!==null&&(y=e),!0)}function C(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function w(e,t,n){for(var r=0,i=e;i;i=n(i))r++;i=0;for(var a=t;a;a=n(a))i++;for(;0<r-i;)e=n(e),r--;for(;0<i-r;)t=n(t),i--;for(;r--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var T=Object.assign,ee=Symbol.for(`react.element`),E=Symbol.for(`react.transitional.element`),D=Symbol.for(`react.portal`),O=Symbol.for(`react.fragment`),te=Symbol.for(`react.strict_mode`),k=Symbol.for(`react.profiler`),A=Symbol.for(`react.consumer`),ne=Symbol.for(`react.context`),re=Symbol.for(`react.forward_ref`),ie=Symbol.for(`react.suspense`),j=Symbol.for(`react.suspense_list`),ae=Symbol.for(`react.memo`),oe=Symbol.for(`react.lazy`),se=Symbol.for(`react.activity`),ce=Symbol.for(`react.legacy_hidden`),le=Symbol.for(`react.memo_cache_sentinel`),ue=Symbol.for(`react.view_transition`),de=Symbol.for(`react.recoverable`),fe=Symbol.iterator;function M(e){return typeof e!=`object`||!e?null:(e=fe&&e[fe]||e[`@@iterator`],typeof e==`function`?e:null)}var pe=Symbol.for(`react.client.reference`);function me(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===pe?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case O:return`Fragment`;case k:return`Profiler`;case te:return`StrictMode`;case ie:return`Suspense`;case j:return`SuspenseList`;case se:return`Activity`;case ue:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case D:return`Portal`;case ne:return e.displayName||`Context`;case A:return(e._context.displayName||`Context`)+`.Consumer`;case re:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case ae:return t=e.displayName||null,t===null?me(e.type)||`Memo`:t;case oe:t=e._payload,e=e._init;try{return me(e(t))}catch{}}return null}var he=Array.isArray,N=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ge={pending:!1,data:null,method:null,action:null},_e=[],ve=-1;function ye(e){return{current:e}}function F(e){0>ve||(e.current=_e[ve],_e[ve]=null,ve--)}function I(e,t){ve++,_e[ve]=e.current,e.current=t}var L=ye(null),be=ye(null),xe=ye(null),Se=ye(null);function Ce(e,t){switch(I(xe,t),I(be,e),I(L,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?up(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=up(t),e=dp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}F(L),I(L,e)}function R(){F(L),F(be),F(xe)}function we(e){var t=e.memoizedState;t!==null&&(sh._currentValue=t.memoizedState,I(Se,e)),t=L.current;var n=dp(t,e.type);t!==n&&(I(be,e),I(L,n))}function Te(e){be.current===e&&(F(L),F(be)),Se.current===e&&(F(Se),sh._currentValue=ge)}var Ee,De;function Oe(e){if(Ee===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Ee=t&&t[1]||``,De=-1<e.stack.indexOf(`
2
+ at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
3
+ `+Ee+e+De}var ke=!1;function Ae(e,t){if(!e||ke)return``;ke=!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)}else{try{n.call()}catch(e){r=e}n=!1;try{var i=Object.getOwnPropertyDescriptor(e.prototype,`props`);Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),n=!0,new e}finally{n&&(i===void 0?delete e.prototype.props:Object.defineProperty(e.prototype,"props",i))}}}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{ke=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Oe(n):``}function je(e,t){switch(e.tag){case 26:case 27:case 5:return Oe(e.type);case 16:return Oe(`Lazy`);case 13:return e.child!==t&&t!==null?Oe(`Suspense Fallback`):Oe(`Suspense`);case 19:return Oe(`SuspenseList`);case 0:case 15:return Ae(e.type,!1);case 11:return Ae(e.type.render,!1);case 1:return Ae(e.type,!0);case 31:return Oe(`Activity`);case 30:return Oe(`ViewTransition`);default:return``}}function Me(e){try{var t=``,n=null;do t+=je(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
7
+ Error generating stack: `+e.message+`
8
+ `+e.stack}}var Ne=Object.prototype.hasOwnProperty,Pe=t.unstable_scheduleCallback,Fe=t.unstable_cancelCallback,Ie=t.unstable_shouldYield,Le=t.unstable_requestPaint,Re=t.unstable_now,ze=t.unstable_getCurrentPriorityLevel,Be=t.unstable_ImmediatePriority,Ve=t.unstable_UserBlockingPriority,He=t.unstable_NormalPriority,Ue=t.unstable_LowPriority,We=t.unstable_IdlePriority,Ge=t.log,Ke=t.unstable_setDisableYieldValue,qe=null,Je=null;function Ye(e){if(typeof Ge==`function`&&Ke(e),Je&&typeof Je.setStrictMode==`function`)try{Je.setStrictMode(qe,e)}catch{}}var Xe=Math.clz32?Math.clz32:$e,Ze=Math.log,Qe=Math.LN2;function $e(e){return e>>>=0,e===0?32:31-(Ze(e)/Qe|0)|0}var et=256,tt=262144,nt=4194304;function rt(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&-e;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 it(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=rt(n))):i=rt(o):i=rt(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=rt(n))):i=rt(o)):i=rt(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 ot(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ct(e,t){t&8&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var r=31-Xe(n),i=1<<r;t|=e[r],n&=~i}return t}function lt(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 ut(){var e=nt;return nt<<=1,!(nt&62914560)&&(nt=4194304),e}function dt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ft(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function pt(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-Xe(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&&mt(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function mt(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Xe(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function ht(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Xe(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function gt(e,t){var n=t&-t;return n=n&42?1:_t(n),(n&(e.suspendedLanes|t))===0?n:0}function _t(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 vt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function yt(){var e=P.p;return e===0?(e=window.event,e===void 0?32:Ch(e.type)):e}function bt(e,t){var n=P.p;try{return P.p=e,t()}finally{P.p=n}}var xt=Math.random().toString(36).slice(2),St=`__reactFiber$`+xt,Ct=`__reactProps$`+xt,wt=`__reactContainer$`+xt,Tt=`__reactEvents$`+xt,Et=`__reactListeners$`+xt,Dt=`__reactHandles$`+xt,Ot=`__reactResources$`+xt,kt=`__reactMarker$`+xt,At=`__reactLoad$`+xt;function jt(e){delete e[St],delete e[Ct],delete e[Et],delete e[Dt]}function Mt(e){var t;if(t=e[St])return t;for(var n=e.parentNode;n;){if(t=n[wt]||n[St]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=fm(e);e!==null;){if(n=e[St])return n;e=fm(e)}return t}e=n,n=e.parentNode}return null}function Nt(e){if(e=e[St]||e[wt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Pt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function Ft(e){var t=e[Ot];return t||=e[Ot]={hoistableStyles:new Map,hoistableScripts:new Map},t}function It(e){e[kt]=!0}function Lt(e){e[At]=void 0}var Rt=new Set,zt={};function Bt(e,t){Vt(e,t),Vt(e+`Capture`,t)}function Vt(e,t){for(zt[e]=t,e=0;e<t.length;e++)Rt.add(t[e])}var Ht=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]*$`),Ut={},Wt={};function Gt(e){return Ne.call(Wt,e)?!0:Ne.call(Ut,e)?!1:Ht.test(e)?Wt[e]=!0:(Ut[e]=!0,!1)}var Kt=!1;function qt(){var e=Kt;return Kt=!1,e}function Jt(e,t,n){if(Gt(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 Yt(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 Xt(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 Zt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Qt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function $t(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 en(e){if(!e._valueTracker){var t=Qt(e)?`checked`:`value`;e._valueTracker=$t(e,t,``+e[t])}}function tn(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Qt(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var nn=/[\n"\\]/g;function rn(e){return e.replace(nn,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function an(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=``+Zt(t)):e.value!==``+Zt(t)&&(e.value=``+Zt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):sn(e,Zt(n)):o===`number`&&e.value==t?sn(e,Zt(e.value)):sn(e,Zt(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=``+Zt(s):e.removeAttribute(`name`)}function on(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)){en(e);return}n=n==null?``:``+Zt(n),t=t==null?n:``+Zt(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),en(e)}function sn(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function cn(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=``+Zt(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 ln(e,t,n){t!=null&&(t=``+Zt(t),t!==e.value&&(e.value=t),n==null)?e.defaultValue!==t&&(e.defaultValue=t):e.defaultValue=n==null?``:``+Zt(n)}function un(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(he(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Zt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),en(e)}function dn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var fn=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 pn(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||fn.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function mn(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]=``,Kt=!0);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&(pn(e,a,r),Kt=!0)}else for(var o in t)t.hasOwnProperty(o)&&pn(e,o,t[o])}function hn(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 gn=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`maskType`,`mask-type`],[`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`]]),_n=/^[\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 vn(e){return _n.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function yn(){}var bn=null;function xn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Sn=null,Cn=null;function wn(e){var t=Nt(e);if(t&&(e=t.stateNode)){var n=e[Ct]||null;a:switch(e=t.stateNode,t.type){case`input`:if(an(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="`+rn(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[Ct]||null;if(!a)throw Error(i(90));an(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&&tn(r)}break a;case`textarea`:ln(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&cn(e,!!n.multiple,t,!1)}}}var Tn=!1;function En(e,t,n){if(Tn)return e(t,n);Tn=!0;try{return e(t)}finally{if(Tn=!1,(Sn!==null||Cn!==null)&&(Bd(),Sn&&(t=Sn,e=Cn,Cn=Sn=null,wn(t),e)))for(t=0;t<e.length;t++)wn(e[t])}}function Dn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[Ct]||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 On=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,kn=!1;if(On)try{var An={};Object.defineProperty(An,"passive",{get:function(){kn=!0}}),window.addEventListener(`test`,An,An),window.removeEventListener(`test`,An,An)}catch{kn=!1}var jn=null,Mn=null,Nn=null;function Pn(){if(Nn)return Nn;var e,t=Mn,n=t.length,r,i=`value`in jn?jn.value:jn.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 Nn=i.slice(e,1<r?1-r:void 0)}function Fn(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 In(){return!0}function Ln(){return!1}function Rn(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)?In:Ln,this.isPropagationStopped=Ln,this}return T(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=In)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=In)},persist:function(){},isPersistent:In}),t}var zn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Bn=Rn(zn),Vn=T({},zn,{view:0,detail:0}),Hn=Rn(Vn),Un,Wn,Gn,Kn=T({},Vn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:rr,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!==Gn&&(Gn&&e.type===`mousemove`?(Un=e.screenX-Gn.screenX,Wn=e.screenY-Gn.screenY):Wn=Un=0,Gn=e),Un)},movementY:function(e){return`movementY`in e?e.movementY:Wn}}),qn=Rn(Kn),Jn=Rn(T({},Kn,{dataTransfer:0})),Yn=Rn(T({},Vn,{relatedTarget:0})),Xn=Rn(T({},zn,{animationName:0,elapsedTime:0,pseudoElement:0})),Zn=Rn(T({},zn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Qn=Rn(T({},zn,{data:0})),$n={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},er={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`},tr={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function nr(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=tr[e])?!!t[e]:!1}function rr(){return nr}var ir=Rn(T({},Vn,{key:function(e){if(e.key){var t=$n[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=Fn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?er[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:rr,charCode:function(e){return e.type===`keypress`?Fn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?Fn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),ar=Rn(T({},Kn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),or=Rn(T({},zn,{submitter:0})),sr=Rn(T({},Vn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:rr})),cr=Rn(T({},zn,{propertyName:0,elapsedTime:0,pseudoElement:0})),lr=Rn(T({},Kn,{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})),ur=Rn(T({},zn,{newState:0,oldState:0,source:0})),dr=[9,13,27,32],fr=On&&`CompositionEvent`in window,pr=null;On&&`documentMode`in document&&(pr=document.documentMode);var mr=On&&`TextEvent`in window&&!pr,hr=On&&(!fr||pr&&8<pr&&11>=pr),gr=` `,_r=!1;function vr(e,t){switch(e){case`keyup`:return dr.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function yr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var br=!1;function xr(e,t){switch(e){case`compositionend`:return yr(t);case`keypress`:return t.which===32?(_r=!0,gr):null;case`textInput`:return e=t.data,e===gr&&_r?null:e;default:return null}}function Sr(e,t){if(br)return e===`compositionend`||!fr&&vr(e,t)?(e=Pn(),Nn=Mn=jn=null,br=!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 hr&&t.locale!==`ko`?null:t.data;default:return null}}var Cr={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 wr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!Cr[e.type]:t===`textarea`}function Tr(e,t,n,r){Sn?Cn?Cn.push(r):Cn=[r]:Sn=r,t=qf(t,`onChange`),0<t.length&&(n=new Bn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var Er=null,Dr=null;function Or(e){Bf(e,0)}function kr(e){if(tn(Pt(e)))return e}function Ar(e,t){if(e===`change`)return t}var jr=!1;if(On){var Mr;if(On){var Nr=`oninput`in document;if(!Nr){var Pr=document.createElement(`div`);Pr.setAttribute(`oninput`,`return;`),Nr=typeof Pr.oninput==`function`}Mr=Nr}else Mr=!1;jr=Mr&&(!document.documentMode||9<document.documentMode)}function Fr(){Er&&(Er.detachEvent(`onpropertychange`,Ir),Dr=Er=null)}function Ir(e){if(e.propertyName===`value`&&kr(Dr)){var t=[];Tr(t,Dr,e,xn(e)),En(Or,t)}}function Lr(e,t,n){e===`focusin`?(Fr(),Er=t,Dr=n,Er.attachEvent(`onpropertychange`,Ir)):e===`focusout`&&Fr()}function Rr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return kr(Dr)}function zr(e,t){if(e===`click`)return kr(t)}function Br(e,t){if(e===`input`||e===`change`)return kr(t)}function Vr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Hr=typeof Object.is==`function`?Object.is:Vr;function Ur(e,t){if(Hr(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(!Ne.call(t,i)||!Hr(e[i],t[i]))return!1}return!0}function Wr(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function Gr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Kr(e,t){var n=Gr(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=Gr(n)}}function qr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?qr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Jr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Wr(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=Wr(e.document)}return t}function Yr(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 Xr=On&&`documentMode`in document&&11>=document.documentMode,Zr=null,Qr=null,$r=null,ei=!1;function ti(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ei||Zr==null||Zr!==Wr(r)||(r=Zr,`selectionStart`in r&&Yr(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}),$r&&Ur($r,r)||($r=r,r=qf(Qr,`onSelect`),0<r.length&&(t=new Bn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Zr)))}function ni(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var ri={animationend:ni(`Animation`,`AnimationEnd`),animationiteration:ni(`Animation`,`AnimationIteration`),animationstart:ni(`Animation`,`AnimationStart`),transitionrun:ni(`Transition`,`TransitionRun`),transitionstart:ni(`Transition`,`TransitionStart`),transitioncancel:ni(`Transition`,`TransitionCancel`),transitionend:ni(`Transition`,`TransitionEnd`)},ii={},ai={};On&&(ai=document.createElement(`div`).style,`AnimationEvent`in window||(delete ri.animationend.animation,delete ri.animationiteration.animation,delete ri.animationstart.animation),`TransitionEvent`in window||delete ri.transitionend.transition);function oi(e){if(ii[e])return ii[e];if(!ri[e])return e;var t=ri[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in ai)return ii[e]=t[n];return e}var si=oi(`animationend`),ci=oi(`animationiteration`),li=oi(`animationstart`),ui=oi(`transitionrun`),di=oi(`transitionstart`),fi=oi(`transitioncancel`),pi=oi(`transitionend`),mi=new Map,hi=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError 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(` `);hi.push(`scrollEnd`);function gi(e,t){mi.set(e,t),Bt(t,[e])}var _i=0;function vi(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=xd.identifierPrefix;var n=_i++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function yi(e){if(e==null||typeof e==`string`)return e;var t=null,n=kd;if(n!==null)for(var r=0;r<n.length;r++){var i=e[n[r]];if(i!=null){if(i===`none`)return`none`;t=t==null?i:t+(` `+i)}}return t??e.default}function bi(e,t){return e=yi(e),t=yi(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var xi=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)},Si=[],Ci=0,wi=0;function Ti(){for(var e=Ci,t=wi=Ci=0;t<e;){var n=Si[t];Si[t++]=null;var r=Si[t];Si[t++]=null;var i=Si[t];Si[t++]=null;var a=Si[t];if(Si[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&&ki(n,i,a)}}function Ei(e,t,n,r){Si[Ci++]=e,Si[Ci++]=t,Si[Ci++]=n,Si[Ci++]=r,wi|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Di(e,t,n,r){return Ei(e,t,n,r),Ai(e)}function Oi(e,t){return Ei(e,null,null,t),Ai(e)}function ki(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-Xe(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Ai(e){if(50<Ad)throw Ad=0,jd=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ji={};function Mi(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 Ni(e,t,n,r){return new Mi(e,t,n,r)}function Pi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Fi(e,t){var n=e.alternate;return n===null?(n=Ni(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&1206910976,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 Ii(e,t){e.flags&=1206910978;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 Li(e,t,n,r,a,o){var s=0;if(r=e,typeof r==`function`)Pi(r)&&(s=1);else if(typeof r==`string`)s=qm(e,n,L.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case se:return e=Ni(31,n,t,a),e.elementType=se,e.lanes=o,e;case O:return Ri(n.children,a,o,t);case te:s=8,a|=24;break;case k:return e=Ni(12,n,t,a|2),e.elementType=k,e.lanes=o,e;case ie:return e=Ni(13,n,t,a),e.elementType=ie,e.lanes=o,e;case j:return e=Ni(19,n,t,a),e.elementType=j,e.lanes=o,e;case ce:case ue:return e=a|32,e=Ni(30,n,t,e),e.elementType=ue,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case ne:s=10;break a;case A:s=9;break a;case re:s=11;break a;case ae:s=14;break a;case oe:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=Ni(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function Ri(e,t,n,r){return e=Ni(7,e,r,t),e.lanes=n,e}function zi(e,t,n){return e=Ni(6,e,null,t),e.lanes=n,e}function Bi(e){var t=Ni(18,null,null,0);return t.stateNode=e,t}function Vi(e,t,n){return t=Ni(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Hi=new WeakMap;function Ui(e,t){if(typeof e==`object`&&e){var n=Hi.get(e);return n===void 0?(t={value:e,source:t,stack:Me(t)},Hi.set(e,t),t):n}return{value:e,source:t,stack:Me(t)}}var Wi=[],Gi=0,Ki=null,qi=0,Ji=[],Yi=0,Xi=null,Zi=1,Qi=``;function $i(e,t){Wi[Gi++]=qi,Wi[Gi++]=Ki,Ki=e,qi=t}function ea(e,t,n){Ji[Yi++]=Zi,Ji[Yi++]=Qi,Ji[Yi++]=Xi,Xi=e;var r=Zi;e=Qi;var i=32-Xe(r)-1;r&=~(1<<i),n+=1;var a=32-Xe(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Zi=1<<32-Xe(t)+i|n<<i|r,Qi=a+e}else Zi=1<<a|n<<i|r,Qi=e}function ta(e){e.return!==null&&($i(e,1),ea(e,1,0))}function na(e){for(;e===Ki;)Ki=Wi[--Gi],Wi[Gi]=null,qi=Wi[--Gi],Wi[Gi]=null;for(;e===Xi;)Xi=Ji[--Yi],Ji[Yi]=null,Qi=Ji[--Yi],Ji[Yi]=null,Zi=Ji[--Yi],Ji[Yi]=null}function ra(e,t){Ji[Yi++]=Zi,Ji[Yi++]=Qi,Ji[Yi++]=Xi,Zi=t.id,Qi=t.overflow,Xi=e}var ia=null,aa=null,z=!1,oa=null,sa=!1,ca=Error(i(519));function la(e){throw ma(Ui(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),ca}function ua(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[St]=e,t[Ct]=r,n){case`dialog`:$(`cancel`,t),$(`close`,t);break;case`iframe`:case`object`:case`embed`:$(`load`,t);break;case`video`:case`audio`:for(n=0;n<Rf.length;n++)$(Rf[n],t);break;case`source`:$(`error`,t);break;case`img`:case`image`:case`link`:$(`error`,t),$(`load`,t);break;case`details`:$(`toggle`,t);break;case`input`:$(`invalid`,t),on(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:$(`invalid`,t);break;case`textarea`:$(`invalid`,t),un(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||$f(t.textContent,n)?(r.popover!=null&&($(`beforetoggle`,t),$(`toggle`,t)),r.onScroll!=null&&$(`scroll`,t),r.onScrollEnd!=null&&$(`scrollend`,t),r.onClick!=null&&(t.onclick=yn),t=!0):t=!1,t||la(e,!0)}function da(e){for(ia=e.return;ia;)switch(ia.tag){case 5:case 31:case 13:sa=!1;return;case 27:case 3:sa=!0;return;default:ia=ia.return}}function fa(e){if(e!==ia)return!1;if(!z)return da(e),z=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||pp(e.type,e.memoizedProps)),n=!n),n&&aa&&la(e),da(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));aa=dm(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));aa=dm(e)}else t===27?(t=aa,Sp(e.type)?(e=um,um=null,aa=e):aa=t):aa=ia?lm(e.stateNode.nextSibling):null;return!0}function B(){aa=ia=null,z=!1}function pa(){var e=oa;return e!==null&&(pd===null?pd=e:pd.push.apply(pd,e),oa=null),e}function ma(e){oa===null?oa=[e]:oa.push(e)}var ha=ye(null),ga=null,_a=null;function va(e,t,n){I(ha,t._currentValue),t._currentValue=n}function ya(e){e._currentValue=ha.current,F(ha)}function ba(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 xa(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),ba(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),ba(s,n,e),s=null}else a.tag===13&&a.memoizedState!==null&&a.memoizedState.dehydrated===null?(a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),ba(a.return,n,e),s=a.child,s=s===null?null:s.sibling):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 Sa(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;Hr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===Se.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[sh]:e.push(sh))}a=a.return}return e!==null&&xa(t,e,n,r),t.flags|=262144,e!==null}function Ca(e){for(e=e.firstContext;e!==null;){if(!Hr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function wa(e){ga=e,_a=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function V(e){return Ea(ga,e)}function Ta(e,t){return ga===null&&wa(e),Ea(e,t)}function Ea(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},_a===null){if(e===null)throw Error(i(308));_a=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else _a=_a.next=t;return n}var Da=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()})}},Oa=t.unstable_scheduleCallback,ka=t.unstable_NormalPriority,Aa={$$typeof:ne,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ja(){return{controller:new Da,data:new Map,refCount:0}}function Ma(e){e.refCount--,e.refCount===0&&Oa(ka,function(){e.controller.abort()})}function H(e,t){if(e.pendingLanes&4194048){var n=e.transitionTypes;for(n===null&&(n=e.transitionTypes=[]),e=0;e<t.length;e++){var r=t[e];n.indexOf(r)===-1&&n.push(r)}}}var Na=null;function Pa(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Fa=null,Ia=0,La=0,Ra=null;function za(e,t){if(Fa===null){var n=Fa=[];Ia=0,La=Nf(),Ra={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return Ia++,t.then(Ba,Ba),t}function Ba(){if(--Ia===0&&(Na=null,Fa!==null)){Ra!==null&&(Ra.status=`fulfilled`);var e=Fa;Fa=null,La=0,Ra=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Va(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 Ha=N.S;N.S=function(e,t){if(gd=Re(),typeof t==`object`&&t&&typeof t.then==`function`&&za(e,t),Na!==null)for(var n=xf;n!==null;)H(n,Na),n=n.next;if(n=e.types,n!==null){for(var r=xf;r!==null;)H(r,n),r=r.next;if(La!==0){r=Na,r===null&&(r=Na=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}Ha!==null&&Ha(e,t)};var Ua=ye(null);function Wa(){var e=Ua.current;return e===null?$u.pooledCache:e}function Ga(e,t){t===null?I(Ua,Ua.current):I(Ua,t.pool)}function Ka(){var e=Wa();return e===null?null:{parent:Aa._currentValue,pool:e}}var qa=Error(i(460)),Ja=Error(i(474)),Ya=Error(i(542)),Xa={then:function(){}};function Za(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Qa(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(yn,yn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,eo(e),e===void 0&&!(`reason`in t)?Error(i(600)):e;default:if(typeof t.status==`string`)t.then(yn,yn);else{if(e=$u,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,eo(e),e}throw $a=t,qa}}function U(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?($a=e,qa):e}}var $a=null;function W(){if($a===null)throw Error(i(459));var e=$a;return $a=null,e}function eo(e){if(e===qa||e===Ya)throw Error(i(483))}var to=null,no=0;function ro(e){var t=no;return no+=1,to===null&&(to=[]),Qa(to,e,t)}function io(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function ao(e,t){throw t.$$typeof===ee?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function oo(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=Fi(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|=134217730,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=134217730),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=zi(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===O?(e=d(e,t,n.props.children,r,n.key),io(e,n),e):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===oe&&U(i)===t.type)?(t=a(t,n.props),io(t,n),t.return=e,t):(t=Li(n.type,n.key,n.props,null,e.mode,r),io(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=Vi(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=Ri(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=zi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case E:return n=Li(t.type,t.key,t.props,null,e.mode,n),io(n,t),n.return=e,n;case D:return t=Vi(t,e.mode,n),t.return=e,t;case oe:return t=U(t),f(e,t,n)}if(he(t)||M(t))return t=Ri(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,ro(t),n);if(t.$$typeof===ne)return f(e,Ta(e,t),n);ao(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 E:return n.key===i?l(e,t,n,r):null;case D:return n.key===i?u(e,t,n,r):null;case oe:return n=U(n),p(e,t,n,r)}if(he(n)||M(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,ro(n),r);if(n.$$typeof===ne)return p(e,t,Ta(e,n),r);ao(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 E:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case D:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case oe:return r=U(r),m(e,t,n,r,i)}if(he(r)||M(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,ro(r),i);if(r.$$typeof===ne)return m(e,t,n,Ta(t,r),i);ao(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),z&&$i(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 z&&$i(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(_.key===null?h:_.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)}),z&&$i(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),z&&$i(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 z&&$i(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(_.key===null?g:_.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)}),z&&$i(a,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===O&&o.key===null&&o.props.ref===void 0&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case E:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===O){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),io(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===oe&&U(l)===r.type){n(e,r.sibling),c=a(r,o.props),io(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===O?(c=Ri(o.props.children,e.mode,c,o.key),io(c,o),c.return=e,e=c):(c=Li(o.type,o.key,o.props,null,e.mode,c),io(c,o),c.return=e,e=c)}return s(e);case D: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}n(e,r);break}t(e,r),r=r.sibling}c=Vi(o,e.mode,c),c.return=e,e=c}return s(e);case oe:return o=U(o),_(e,r,o,c)}if(he(o))return h(e,r,o,c);if(M(o)){if(l=M(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return _(e,r,ro(o),c);if(o.$$typeof===ne)return _(e,r,Ta(e,o),c);ao(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=zi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{no=0;var i=_(e,t,n,r);return to=null,i}catch(t){if(t===qa||t===Ya)throw t;var a=Ni(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var so=oo(!0),co=oo(!1),lo=!1;function uo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function fo(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 po(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function mo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Qu&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Ai(e),ki(e,null,n),t}return Ei(e,r,t,n),Ai(e)}function ho(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,ht(e,n)}}function go(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}else e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var _o=!1;function vo(){if(_o){var e=Ra;if(e!==null)throw e}}function yo(e,t,n,r){_o=!1;var i=e.updateQueue;lo=!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?(Y&f)===f:(r&f)===f){f!==0&&f===La&&(_o=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,h=s;f=t;var g=n;switch(h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(g,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(g,d,f):m,f==null)break a;d=T({},d,f);break a;case 2:lo=!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),sd|=o,e.lanes=o,e.memoizedState=d}}function bo(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function xo(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)bo(n[e],t)}var So=ye(null),Co=ye(0);function wo(e,t){e=ad,I(Co,e),I(So,t),ad=e|t.baseLanes}function To(){I(Co,ad),I(So,So.current)}function Eo(){ad=Co.current,F(So),F(Co)}var Do=ye(null),Oo=null;function ko(e){var t=e.alternate;I(Po,Po.current&1),I(Do,e),Oo===null&&(t===null||So.current!==null||t.memoizedState!==null)&&(Oo=e)}function Ao(e){I(Po,Po.current),I(Do,e),Oo===null&&(Oo=e)}function jo(e){e.tag===22?(I(Po,Po.current),I(Do,e),Oo===null&&(Oo=e)):Mo()}function Mo(){I(Po,Po.current),I(Do,Do.current)}function No(e){F(Do),Oo===e&&(Oo=null),F(Po)}var Po=ye(0);function Fo(e,t){I(Do,Do.current),I(Po,t)}function Io(e){F(Po),F(Do),Oo===e&&(Oo=null)}function Lo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||om(n)||sm(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==`independent`){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 Ro=0,G=null,zo=null,Bo=null,Vo=!1,Ho=!1,Uo=!1,Wo=0,Go=0,Ko=null,qo=0;function Jo(){throw Error(i(321))}function Yo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Hr(e[n],t[n]))return!1;return!0}function Xo(e,t,n,r,i,a){return Ro=a,G=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,N.H=e===null||e.memoizedState===null?pc:mc,Uo=!1,a=n(r,i),Uo=!1,Ho&&(a=Qo(t,n,r,i)),Zo(e),a}function Zo(e){N.H=fc;var t=zo!==null&&zo.next!==null;if(Ro=0,Bo=zo=G=null,Vo=!1,Go=0,Ko=null,t)throw Error(i(300));e===null||jc||(e=e.dependencies,e!==null&&Ca(e)&&(jc=!0))}function Qo(e,t,n,r){G=e;var a=0;do{if(Ho&&(Ko=null),Go=0,Ho=!1,25<=a)throw Error(i(301));if(a+=1,Bo=zo=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}N.H=hc,o=t(n,r)}while(Ho);return o}function $o(){var e=N.H,t=e.useState()[0];return t=typeof t.then==`function`?os(t):t,e=e.useState()[0],(zo===null?null:zo.memoizedState)!==e&&(G.flags|=1024),t}function es(){var e=Wo!==0;return Wo=0,e}function ts(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function ns(e){if(Vo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Vo=!1}Ro=0,Bo=zo=G=null,Ho=!1,Go=Wo=0,Ko=null}function rs(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Bo===null?G.memoizedState=Bo=e:Bo=Bo.next=e,Bo}function is(){if(zo===null){var e=G.alternate;e=e===null?null:e.memoizedState}else e=zo.next;var t=Bo===null?G.memoizedState:Bo.next;if(t!==null)Bo=t,zo=e;else{if(e===null)throw G.alternate===null?Error(i(467)):Error(i(310));zo=e,e={memoizedState:zo.memoizedState,baseState:zo.baseState,baseQueue:zo.baseQueue,queue:zo.queue,next:null},Bo===null?G.memoizedState=Bo=e:Bo=Bo.next=e}return Bo}function as(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function os(e){var t=Go;return Go+=1,Ko===null&&(Ko=[]),e=Qa(Ko,e,t),t=G,(Bo===null?t.memoizedState:Bo.next)===null&&(t=t.alternate,N.H=t===null||t.memoizedState===null?pc:mc),e}function ss(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return os(e);if(e.$$typeof===de)return;if(e.$$typeof===ne)return V(e)}throw Error(i(438,String(e)))}function cs(e){var t=null,n=G.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=G.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=as(),G.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]=le;return t.index++,n}function ls(e,t){return typeof t==`function`?t(e):t}function us(e){return ds(is(),zo,e)}function ds(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?(Ro&f)===f:(Y&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===La&&(d=!0);else if((Ro&p)===p){u=u.next,p===La&&(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,G.lanes|=p,sd|=p;f=u.action,Uo&&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,G.lanes|=f,sd|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Hr(o,e.memoizedState)&&(jc=!0,d&&(n=Ra,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 fs(e){var t=is(),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);Hr(o,t.memoizedState)||(jc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function ps(e,t,n){var r=G,a=is(),o=z;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Hr((zo||a).memoizedState,n);if(s&&(a.memoizedState=n,jc=!0),a=a.queue,Rs(gs.bind(null,r,a,e),[e]),e=a.getSnapshot!==t||s||Bo!==null&&!!(Bo.memoizedState.tag&1),Ns(e?9:8,{destroy:void 0},hs.bind(null,r,a,n,t),null),e){if(r.flags|=2048,$u===null)throw Error(i(349));o||Ro&127||ms(r,t,n)}return n}function ms(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=G.updateQueue,t===null?(t=as(),G.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function hs(e,t,n,r){t.value=n,t.getSnapshot=r,_s(t)&&vs(e)}function gs(e,t,n){return n(function(){_s(t)&&vs(e)})}function _s(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Hr(e,n)}catch{return!0}}function vs(e){var t=Oi(e,2);t!==null&&Fd(t,e,2)}function ys(e){var t=rs();if(typeof e==`function`){var n=e;if(e=n(),Uo){Ye(!0);try{n()}finally{Ye(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ls,lastRenderedState:e},t}function bs(e,t,n,r){return e.baseState=n,ds(e,zo,typeof r==`function`?r:ls)}function xs(e,t,n,r,a){if(lc(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)}};N.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Ss(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Ss(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=N.T,o={};o.types=a===null?null:a.types,N.T=o;try{var s=n(i,r),c=N.S;c!==null&&c(o,s),Cs(e,t,s)}catch(n){Ts(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),N.T=a}}else try{a=n(i,r),Cs(e,t,a)}catch(n){Ts(e,t,n)}}function Cs(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){ws(e,t,n)},function(n){return Ts(e,t,n)}):ws(e,t,n)}function ws(e,t,n){t.status=`fulfilled`,t.value=n,Es(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Ss(e,n)))}function Ts(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Es(t),t=t.next;while(t!==r)}e.action=null}function Es(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Ds(e,t){return t}function Os(e,t){if(z){var n=$u.formState;if(n!==null){a:{var r=G;if(z){if(aa){b:{for(var i=aa,a=sa;i.nodeType!==8;)if(!a||(i=lm(i.nextSibling),i===null)){i=null;break b}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){aa=lm(i.nextSibling),r=i.data===`F!`;break a}}la(r)}r=!1}r&&(t=n[0])}}return n=rs(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ds,lastRenderedState:t},n.queue=r,n=oc.bind(null,G,r),r.dispatch=n,r=ys(!1),a=cc.bind(null,G,!1,r.queue),r=rs(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=xs.bind(null,G,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function ks(e){return As(is(),zo,e)}function As(e,t,n){if(t=ds(e,t,Ds)[0],e=us(ls)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=os(t)}catch(e){throw e===qa?Ya:e}else r=t;t=is();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(G.flags|=2048,Ns(9,{destroy:void 0},js.bind(null,i,n),null)),[r,a,e]}function js(e,t){e.action=t}function Ms(e){var t=is(),n=zo;if(n!==null)return As(t,n,e);is(),t=t.memoizedState,n=is();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Ns(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=G.updateQueue,t===null&&(t=as(),G.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 Ps(){return is().memoizedState}function Fs(e,t,n,r){var i=rs();G.flags|=e,i.memoizedState=Ns(1|t,{destroy:void 0},n,r===void 0?null:r)}function Is(e,t,n,r){var i=is();r=r===void 0?null:r;var a=i.memoizedState.inst;zo!==null&&r!==null&&Yo(r,zo.memoizedState.deps)?i.memoizedState=Ns(t,a,n,r):(G.flags|=e,i.memoizedState=Ns(1|t,a,n,r))}function Ls(e,t){Fs(8390656,8,e,t)}function Rs(e,t){Is(2048,8,e,t)}function zs(e){G.flags|=4;var t=G.updateQueue;if(t===null)t=as(),G.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Bs(e){var t=is().memoizedState;return zs({ref:t,nextImpl:e}),function(){if(Qu&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function Vs(e,t){return Is(4,2,e,t)}function Hs(e,t){return Is(4,4,e,t)}function Us(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 Ws(e,t,n){n=n==null?null:n.concat([e]),Is(4,4,Us.bind(null,t,e),n)}function Gs(){}function Ks(e,t){var n=is();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Yo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function qs(e,t){var n=is();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Yo(t,r[1]))return r[0];if(r=e(),Uo){Ye(!0);try{e()}finally{Ye(!1)}}return n.memoizedState=[r,t],r}function Js(e,t,n){return n===void 0||Ro&1073741824&&!(Y&261930)?e.memoizedState=t:(e.memoizedState=n,e=Nd(),G.lanes|=e,sd|=e,n)}function Ys(e,t,n,r){return Hr(n,t)?n:So.current===null?!(Ro&106)||Ro&1073741824&&!(Y&261930)?(jc=!0,e.memoizedState=n):(e=Nd(),G.lanes|=e,sd|=e,t):(e=Js(e,n,r),Hr(e,t)||(jc=!0),e)}function Xs(e,t,n,r,i){var a=P.p;P.p=a!==0&&8>a?a:8;var o=N.T,s={};s.types=o===null?null:o.types,N.T=s,cc(e,!1,t,n);try{var c=i(),l=N.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?sc(e,t,Va(c,r),Md(e)):sc(e,t,r,Md(e))}catch(n){sc(e,t,{then:function(){},status:`rejected`,reason:n},Md())}finally{P.p=a,o!==null&&s.types!==null&&(o.types=s.types),N.T=o}}function Zs(){}function Qs(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=$s(e).queue;Xs(e,a,t,ge,n===null?Zs:function(){return ec(e),n(r)})}function $s(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ge,baseState:ge,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ls,lastRenderedState:ge},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ls,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function ec(e){var t=$s(e);t.next===null&&(t=e.alternate.memoizedState),sc(e,t.next.queue,{},Md())}function tc(){return V(sh)}function nc(){return is().memoizedState}function rc(){return is().memoizedState}function ic(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Md();e=po(n);var r=mo(t,e,n);r!==null&&(Fd(r,t,n),ho(r,t,n)),t={cache:ja()},e.payload=t;return}t=t.return}}function ac(e,t,n){var r=Md();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},lc(e)?uc(t,n):(n=Di(e,t,n,r),n!==null&&(Fd(n,e,r),dc(n,t,r)))}function oc(e,t,n){sc(e,t,n,Md())}function sc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(lc(e))uc(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,Hr(s,o))return Ei(e,t,i,0),$u===null&&Ti(),!1}catch{}if(n=Di(e,t,i,r),n!==null)return Fd(n,e,r),dc(n,t,r),!0}return!1}function cc(e,t,n,r){if(r={lane:2,revertLane:Nf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},lc(e)){if(t)throw Error(i(479))}else t=Di(e,n,r,2),t!==null&&Fd(t,e,2)}function lc(e){var t=e.alternate;return e===G||t!==null&&t===G}function uc(e,t){Ho=Vo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function dc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ht(e,n)}}var fc={readContext:V,use:ss,useCallback:Jo,useContext:Jo,useEffect:Jo,useImperativeHandle:Jo,useLayoutEffect:Jo,useInsertionEffect:Jo,useMemo:Jo,useReducer:Jo,useRef:Jo,useState:Jo,useDebugValue:Jo,useDeferredValue:Jo,useTransition:Jo,useSyncExternalStore:Jo,useId:Jo,useHostTransitionStatus:Jo,useFormState:Jo,useActionState:Jo,useOptimistic:Jo,useMemoCache:Jo,useCacheRefresh:Jo,useEffectEvent:Jo},pc={readContext:V,use:ss,useCallback:function(e,t){return rs().memoizedState=[e,t===void 0?null:t],e},useContext:V,useEffect:Ls,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Fs(4194308,4,Us.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Fs(4194308,4,e,t)},useInsertionEffect:function(e,t){Fs(4,2,e,t)},useMemo:function(e,t){var n=rs();t=t===void 0?null:t;var r=e();if(Uo){Ye(!0);try{e()}finally{Ye(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=rs();if(n!==void 0){var i=n(t);if(Uo){Ye(!0);try{n(t)}finally{Ye(!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=ac.bind(null,G,e),[r.memoizedState,e]},useRef:function(e){var t=rs();return e={current:e},t.memoizedState=e},useState:function(e){e=ys(e);var t=e.queue,n=oc.bind(null,G,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Gs,useDeferredValue:function(e,t){return Js(rs(),e,t)},useTransition:function(){var e=ys(!1);return e=Xs.bind(null,G,e.queue,!0,!1),rs().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=G,a=rs();if(z){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),$u===null)throw Error(i(349));Y&127||ms(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Ls(gs.bind(null,r,o,e),[e]),r.flags|=2048,Ns(9,{destroy:void 0},hs.bind(null,r,o,n,t),null),n},useId:function(){var e=rs(),t=$u.identifierPrefix;if(z){var n=Qi,r=Zi;n=(r&~(1<<32-Xe(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Wo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=qo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:tc,useFormState:Os,useActionState:Os,useOptimistic:function(e){var t=rs();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=cc.bind(null,G,!0,n),n.dispatch=t,[e,t]},useMemoCache:cs,useCacheRefresh:function(){return rs().memoizedState=ic.bind(null,G)},useEffectEvent:function(e){var t=rs(),n={impl:e};return t.memoizedState=n,function(){if(Qu&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},mc={readContext:V,use:ss,useCallback:Ks,useContext:V,useEffect:Rs,useImperativeHandle:Ws,useInsertionEffect:Vs,useLayoutEffect:Hs,useMemo:qs,useReducer:us,useRef:Ps,useState:function(){return us(ls)},useDebugValue:Gs,useDeferredValue:function(e,t){return Ys(is(),zo.memoizedState,e,t)},useTransition:function(){var e=us(ls)[0],t=is().memoizedState;return[typeof e==`boolean`?e:os(e),t]},useSyncExternalStore:ps,useId:nc,useHostTransitionStatus:tc,useFormState:ks,useActionState:ks,useOptimistic:function(e,t){return bs(is(),zo,e,t)},useMemoCache:cs,useCacheRefresh:rc,useEffectEvent:Bs},hc={readContext:V,use:ss,useCallback:Ks,useContext:V,useEffect:Rs,useImperativeHandle:Ws,useInsertionEffect:Vs,useLayoutEffect:Hs,useMemo:qs,useReducer:fs,useRef:Ps,useState:function(){return fs(ls)},useDebugValue:Gs,useDeferredValue:function(e,t){var n=is();return zo===null?Js(n,e,t):Ys(n,zo.memoizedState,e,t)},useTransition:function(){var e=fs(ls)[0],t=is().memoizedState;return[typeof e==`boolean`?e:os(e),t]},useSyncExternalStore:ps,useId:nc,useHostTransitionStatus:tc,useFormState:Ms,useActionState:Ms,useOptimistic:function(e,t){var n=is();return zo===null?(n.baseState=e,[e,n.queue.dispatch]):bs(n,zo,e,t)},useMemoCache:cs,useCacheRefresh:rc,useEffectEvent:Bs};function gc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:T({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var _c={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Md(),i=po(r);i.payload=t,n!=null&&(i.callback=n),t=mo(e,i,r),t!==null&&(Fd(t,e,r),ho(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Md(),i=po(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=mo(e,i,r),t!==null&&(Fd(t,e,r),ho(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Md(),r=po(n);r.tag=2,t!=null&&(r.callback=t),t=mo(e,r,n),t!==null&&(Fd(t,e,n),ho(t,e,n))}};function vc(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?!Ur(n,r)||!Ur(i,a):!0}function yc(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&&_c.enqueueReplaceState(t,t.state,null)}function bc(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=T({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function xc(e){xi(e)}function Sc(e){console.error(e)}function Cc(e){xi(e)}function wc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Tc(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 Ec(e,t,n){return n=po(n),n.tag=3,n.payload={element:null},n.callback=function(){wc(e,t)},n}function Dc(e){return e=po(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(){Tc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Tc(t,n,r),typeof i!=`function`&&(yd===null?yd=new Set([this]):yd.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function kc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Sa(t,n,a,!0),n=Do.current,n!==null){switch(n.tag){case 31:case 13:case 19:return Oo===null?qd():n.alternate===null&&od===0&&(od=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Xa?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),gf(e,r,a)),!1;case 22:return n.flags|=65536,r===Xa?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)),gf(e,r,a)),!1}throw Error(i(435,n.tag))}return gf(e,r,a),qd(),!1}if(z)return t=Do.current,t===null?(r!==ca&&(t=Error(i(423),{cause:r}),ma(Ui(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=Ui(r,n),a=Ec(e.stateNode,r,a),go(e,a),od!==4&&(od=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==ca&&(e=Error(i(422),{cause:r}),ma(Ui(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=Ui(o,n),fd===null?fd=[o]:fd.push(o),od!==4&&(od=2),t===null)return!0;r=Ui(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Ec(n.stateNode,r,e),go(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`&&(yd===null||!yd.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Dc(a),Oc(a,e,n,r),go(n,a),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Ac=Error(i(461)),jc=!1;function Mc(e,t,n,r){t.child=e===null?co(t,null,n,r):so(t,e.child,n,r)}function Nc(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 wa(t),r=Xo(e,t,n,o,a,i),s=es(),e!==null&&!jc?(ts(e,t,i),ol(e,t,i)):(z&&s&&ta(t),t.flags|=1,Mc(e,t,r,i),t.child)}function Pc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Pi(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Fc(e,t,a,r,i)):(e=Li(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!sl(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Ur:n,n(o,r)&&e.ref===t.ref)return ol(e,t,i)}return t.flags|=1,e=Fi(a,r),e.ref=t.ref,e.return=t,t.child=e}function Fc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Ur(a,r)&&e.ref===t.ref){if(jc=!1,t.pendingProps=r=a,sl(e,i))e.flags&131072&&(jc=!0);else return t.lanes=e.lanes,ol(e,t,i)}}return Hc(e,t,n,r,i)}function Ic(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 Lc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ga(t,a===null?null:a.cachePool),a===null?To():wo(t,a),jo(t);else return r=t.lanes=536870912,Lc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Ga(t,null),To(),Mo()):(Ga(t,a.cachePool),wo(t,a),Mo(),t.memoizedState=null);return Mc(e,t,i,n),t.child}function K(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Lc(e,t,n,r,i){var a=Wa();return a=a===null?null:{parent:Aa._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Ga(t,null),To(),jo(t),e!==null&&Sa(e,t,r,!0),t.childLanes=i,null}function Rc(e,t){return t=Zc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function zc(e,t,n){return so(t,e.child,null,n),e=Rc(t,t.pendingProps),e.flags|=2,No(t),t.memoizedState=null,e}function Bc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(z){if(r.mode===`hidden`)return e=Rc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},K(null,e);if(Ao(t),(e=aa)?(e=am(e,sa),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Xi===null?null:{id:Zi,overflow:Qi},retryLane:536870912,hydrationErrors:null},n=Bi(e),n.return=t,t.child=n,ia=t,aa=null)):e=null,e===null)throw la(t);return t.lanes=536870912,null}return Rc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(Ao(t),a){if(t.flags&256)t.flags&=-257,t=zc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(jc||Sa(e,t,n,!1),a=(n&e.childLanes)!==0,jc||a){if(So.current===null){if(r=$u,r!==null&&(s=gt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Oi(e,s),Fd(r,e,s),Ac;qd()}t=zc(e,t,n)}else e=o.treeContext,aa=lm(s.nextSibling),ia=t,z=!0,oa=null,sa=!1,e!==null&&ra(t,e),t=Rc(t,r),t.flags|=134221824;return t}return e=Fi(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Vc(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 Hc(e,t,n,r,i){return wa(t),n=Xo(e,t,n,r,void 0,i),r=es(),e!==null&&!jc?(ts(e,t,i),ol(e,t,i)):(z&&r&&ta(t),t.flags|=1,Mc(e,t,n,i),t.child)}function Uc(e,t,n,r,i,a){return wa(t),t.updateQueue=null,n=Qo(t,r,n,i),Zo(e),r=es(),e!==null&&!jc?(ts(e,t,a),ol(e,t,a)):(z&&r&&ta(t),t.flags|=1,Mc(e,t,n,a),t.child)}function Wc(e,t,n,r,i){if(wa(t),t.stateNode===null){var a=ji,o=n.contextType;typeof o==`object`&&o&&(a=V(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=_c,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},uo(t),o=n.contextType,a.context=typeof o==`object`&&o?V(o):ji,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(gc(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&&_c.enqueueReplaceState(a,a.state,null),yo(t,r,a,i),vo(),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=bc(n,s);a.props=c;var l=a.context,u=n.contextType;o=ji,typeof u==`object`&&u&&(o=V(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)&&yc(t,a,r,o),lo=!1;var f=t.memoizedState;a.state=f,yo(t,r,a,i),vo(),l=t.memoizedState,s||f!==l||lo?(typeof d==`function`&&(gc(t,n,d,r),l=t.memoizedState),(c=lo||vc(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,fo(e,t),o=t.memoizedProps,u=bc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=ji,typeof l==`object`&&l&&(c=V(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)&&yc(t,a,r,c),lo=!1,f=t.memoizedState,a.state=f,yo(t,r,a,i),vo();var p=t.memoizedState;o!==d||f!==p||lo||e!==null&&e.dependencies!==null&&Ca(e.dependencies)?(typeof s==`function`&&(gc(t,n,s,r),p=t.memoizedState),(u=lo||vc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Ca(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,Vc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=so(t,e.child,null,i),t.child=so(t,null,n,i)):Mc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=ol(e,t,i),e}function Gc(e,t,n,r){return B(),t.flags|=256,Mc(e,t,n,r),t.child}var Kc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function qc(e){return{baseLanes:e,cachePool:Ka()}}function Jc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=ud),e}function Yc(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(Po.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(z){if(i?ko(t):Mo(),(e=aa)?(e=am(e,sa),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Xi===null?null:{id:Zi,overflow:Qi},retryLane:536870912,hydrationErrors:null},n=Bi(e),n.return=t,t.child=n,ia=t,aa=null)):e=null,e===null)throw la(t);return t.lanes=sm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(Mo(),i=t.mode,a=Zc({mode:`hidden`,children:a},i),r=Ri(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=qc(n),r.childLanes=Jc(e,o,n),t.memoizedState=Kc,K(null,r)):(ko(t),Xc(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return $c(e,t,a,o,r,c,s,n)}return i?(Mo(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=Fi(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=Ri(i,a,n,null),i.flags|=2):i=Fi(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,K(null,r),r=t.child,i=e.child.memoizedState,i===null?i=qc(n):(a=i.cachePool,a===null?a=Ka():(s=Aa._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=Jc(e,o,n),t.memoizedState=Kc,K(e.child,r)):(ko(t),n=e.child,e=n.sibling,n=Fi(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n)}function Xc(e,t){return t=Zc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Zc(e,t){return e=Ni(22,e,null,t),e.lanes=0,e}function Qc(e,t,n){return so(t,e.child,null,n),e=Xc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function $c(e,t,n,r,a,o,s,c){if(n)return t.flags&256?(ko(t),t.flags&=-257,Qc(e,t,c)):t.memoizedState===null?(Mo(),o=a.fallback,s=t.mode,a=Zc({mode:`visible`,children:a.children},s),o=Ri(o,s,c,null),o.flags|=2,a.return=t,o.return=t,a.sibling=o,t.child=a,so(t,e.child,null,c),a=t.child,a.memoizedState=qc(c),a.childLanes=Jc(e,r,c),t.memoizedState=Kc,K(null,a)):(Mo(),t.child=e.child,t.flags|=128,null);if(ko(t),sm(o)){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,r!==``&&(a=Error(i(419)),a.stack=``,a.digest=r,ma({value:a,source:null,stack:null})),Qc(e,t,c)}if(jc||Sa(e,t,c,!1),r=(c&e.childLanes)!==0,jc||r){if(So.current!==null)return Qc(e,t,c);if(r=$u,r!==null&&(a=gt(r,c),a!==0&&a!==s.retryLane))throw s.retryLane=a,Oi(e,a),Fd(r,e,a),Ac;return om(o)||qd(),Qc(e,t,c)}return om(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,aa=lm(o.nextSibling),ia=t,z=!0,oa=null,sa=!1,e!==null&&ra(t,e),t=Xc(t,a.children),t.flags|=134221824,t)}function el(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ba(e.return,t,n)}function tl(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Lo(n)===null&&(t=e),e=e.sibling}return t}function nl(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 rl(e){var t=e.child;for(e.child=null;t!==null;){var n=t.sibling;t.sibling=e.child,e.child=t,t=n}}function il(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=Po.current;if(t.flags&128)return Fo(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,Fo(t,o),i===`backwards`&&e!==null?(rl(e),Mc(e,t,r,n),rl(e)):Mc(e,t,r,n),r=z?qi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&el(e,n,t);else if(e.tag===19)el(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`backwards`:n=tl(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,rl(t)),nl(t,!0,i,null,a,r);break;case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Lo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}nl(t,!0,n,null,a,r);break;case`together`:nl(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=tl(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),nl(t,!1,i,n,a,r)}return t.child}function al(e,t,n){var r=t.pendingProps;return va(t,t.type,r.value),Mc(e,t,r.children,n),t.child}function ol(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),sd|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(Sa(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=Fi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Fi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function sl(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&Ca(e)))}function cl(e,t,n){switch(t.tag){case 3:Ce(t,t.stateNode.containerInfo),va(t,Aa,e.memoizedState.cache),B();break;case 27:case 5:we(t);break;case 4:Ce(t,t.stateNode.containerInfo);break;case 10:va(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Ao(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return ko(t),t.flags|=128,null;r=Sa(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?Yc(e,t,n):(ko(t),e=ol(e,t,n),e===null?null:e.sibling)}ko(t);break;case 19:if(t.flags&128)return il(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(Sa(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return il(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Fo(t,Po.current),r)break;return null;case 22:return t.lanes=0,Ic(e,t,n,t.pendingProps);case 24:va(t,Aa,e.memoizedState.cache)}return ol(e,t,n)}function ll(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)jc=!0;else{if(!sl(e,n)&&!(t.flags&128))return jc=!1,cl(e,t,n);jc=!!(e.flags&131072)}}else jc=!1,z&&t.flags&1048576&&ea(t,qi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=U(t.elementType),t.type=e,typeof e==`function`)Pi(e)?(r=bc(e,r),t.tag=1,t=Wc(null,t,e,r,n)):(t.tag=0,t=Hc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===re){t.tag=11,t=Nc(null,t,e,r,n);break a}if(a===ae){t.tag=14,t=Pc(null,t,e,r,n);break a}if(a===ne){t.tag=10,t.type=e,t=al(null,t,n);break a}}throw t=me(e)||e,Error(i(306,t,``))}}return t;case 0:return Hc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=bc(r,t.pendingProps),Wc(e,t,r,a,n);case 3:a:{if(Ce(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,fo(e,t),yo(t,r,null,n);var s=t.memoizedState;if(r=s.cache,va(t,Aa,r),r!==o.cache&&xa(t,[Aa],n,!0),vo(),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=Gc(e,t,r,n);break a}if(r!==a){a=Ui(Error(i(424)),t),ma(a),t=Gc(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(aa=lm(e.firstChild),ia=t,z=!0,oa=null,sa=!0,n=co(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(B(),r===a){t=ol(e,t,n);break a}Mc(e,t,r,n)}t=t.child}return t;case 26:return Vc(e,t),e===null?(n=Nm(t.type,null,t.pendingProps,null))?t.memoizedState=n:z||(t.stateNode=fp(t.type,t.pendingProps,xe.current,t)):t.memoizedState=Nm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return we(t),e===null&&z&&(r=t.stateNode=hm(t.type,t.pendingProps,xe.current),ia=t,sa=!0,a=aa,Sp(t.type)?(um=a,aa=lm(r.firstChild)):aa=a),Mc(e,t,t.pendingProps.children,n),Vc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&z&&((a=r=aa)&&(r=rm(r,t.type,t.pendingProps,sa),r===null?a=!1:(t.stateNode=r,ia=t,aa=lm(r.firstChild),sa=!1,a=!0)),a||la(t)),we(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,pp(a,o)?r=null:s!==null&&pp(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=Xo(e,t,$o,null,null,n),sh._currentValue=a),Vc(e,t),Mc(e,t,r,n),t.child;case 6:return e===null&&z&&((e=n=aa)&&(n=im(n,t.pendingProps,sa),n===null?e=!1:(t.stateNode=n,ia=t,aa=null,e=!0)),e||la(t)),null;case 13:return Yc(e,t,n);case 4:return Ce(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=so(t,null,r,n):Mc(e,t,r,n),t.child;case 11:return Nc(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Vc(e,t),Mc(e,t,r,n),t.child;case 8:return Mc(e,t,t.pendingProps.children,n),t.child;case 12:return Mc(e,t,t.pendingProps.children,n),t.child;case 10:return al(e,t,n);case 9:return a=t.type._context,r=t.pendingProps.children,wa(t),a=V(a),r=r(a),t.flags|=1,Mc(e,t,r,n),t.child;case 14:return Pc(e,t,t.type,t.pendingProps,n);case 15:return Fc(e,t,t.type,t.pendingProps,n);case 19:return il(e,t,n);case 31:return Bc(e,t,n);case 22:return Ic(e,t,n,t.pendingProps);case 24:return wa(t),r=V(Aa),e===null?(a=Wa(),a===null&&(a=$u,o=ja(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},uo(t),va(t,Aa,a)):((e.lanes&n)!==0&&(fo(e,t),yo(t,null,null,n),vo()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,va(t,Aa,r),r!==a.cache&&xa(t,[Aa],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),va(t,Aa,r))),Mc(e,t,t.pendingProps.children,n),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),r=t.pendingProps,r.name!=null&&r.name!==`auto`?t.flags|=e===null?18882560:18874368:z&&ta(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Vc(e,t),Mc(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function ul(e){e.flags|=4}function dl(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?Jm(t,r):Jm(t,r)&&(r.src!==n.src||r.srcSet!==n.srcSet)),a){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(Wd())e.flags|=8192;else throw $a=Xa,Ja}}else e.flags&=-16777217}function fl(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Ym(t)){if(Wd())e.flags|=8192;else throw $a=Xa,Ja}}function pl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:ut(),e.lanes|=t,dd|=t)}function ml(e,t){if(!z)switch(e.tailMode){case`visible`:break;case`collapsed`:for(var n=e.tail,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;break;default:for(t=e.tail,n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null}}function hl(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&1206910976,r|=i.flags&1206910976,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 gl(e,t,n){var r=t.pendingProps;switch(na(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return hl(t),null;case 1:return hl(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),ya(Aa),R(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(fa(t)?ul(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,pa())),hl(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(ul(t),o===null?(hl(t),dl(t,a,null,r,n)):(hl(t),fl(t,o))):o?o===e.memoizedState?(hl(t),t.flags&=-16777217):(ul(t),hl(t),fl(t,o)):(e=e.memoizedProps,e!==r&&ul(t),hl(t),dl(t,a,e,r,n)),null;case 27:if(Te(t),n=xe.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&ul(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return hl(t),t.subtreeFlags&=-33554433,null}e=L.current,fa(t)?ua(t,e):(e=hm(a,r,n),t.stateNode=e,ul(t))}return hl(t),t.subtreeFlags&=-33554433,null;case 5:if(Te(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&ul(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return hl(t),t.subtreeFlags&=-33554433,null}if(o=L.current,fa(t))ua(t,o);else{var s=lp(xe.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[St]=t,o[Ct]=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(np(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&&ul(t)}}return hl(t),t.subtreeFlags&=-33554433,dl(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&ul(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=xe.current,fa(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=ia,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[St]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||$f(e.nodeValue,n)),e||la(t,!0)}else e=lp(e).createTextNode(r),e[St]=t,t.stateNode=e}return hl(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=fa(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[St]=t}else B(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;hl(t),e=!1}else n=pa(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(No(t),t):(No(t),null);if(t.flags&128)throw Error(i(558))}return hl(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=fa(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[St]=t}else B(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;hl(t),a=!1}else a=pa(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(No(t),t):(No(t),null)}return No(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),pl(t,t.updateQueue),hl(t),null);case 4:return R(),e===null&&Uf(t.stateNode.containerInfo),t.flags|=67108864,hl(t),null;case 10:return ya(t.type),hl(t),null;case 19:if(Io(t),r=t.memoizedState,r===null)return hl(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)ml(r,!1);else{if(od!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Lo(e),o!==null){for(t.flags|=128,ml(r,!1),e=o.updateQueue,t.updateQueue=e,pl(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Ii(n,e),n=n.sibling;return Fo(t,Po.current&1|2),z&&$i(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Re()>_d&&(t.flags|=128,a=!0,ml(r,!1),t.lanes=4194304)}}else{if(!a){if(e=Lo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,pl(t,e),ml(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!z)return hl(t),null}else 2*Re()-r.renderingStartTime>_d&&n!==536870912&&(t.flags|=128,a=!0,ml(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)}if(r.tail!==null){e=r.tail;a:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break a}n=n.sibling}n=!0}return r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Re(),e.sibling=null,o=Po.current,o=a?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||z?Fo(t,o):(n=o,I(Do,t),I(Po,n),Oo===null&&(Oo=t)),z&&$i(t,r.treeForkCount),e}return hl(t),null;case 22:case 23:return No(t),Eo(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(hl(t),t.subtreeFlags&6&&(t.flags|=8192)):hl(t),n=t.updateQueue,n!==null&&pl(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&&F(Ua),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ya(Aa),hl(t),null;case 25:return null;case 30:return t.flags|=33554432,hl(t),null}throw Error(i(156,t.tag))}function _l(e,t){switch(na(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ya(Aa),R(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Te(t),null;case 31:if(t.memoizedState!==null){if(No(t),t.alternate===null)throw Error(i(340));B()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(No(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));B()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Io(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return R(),null;case 10:return ya(t.type),null;case 22:case 23:return No(t),Eo(),e!==null&&F(Ua),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ya(Aa),null;case 25:return null;default:return null}}function vl(e,t){switch(na(t),t.tag){case 3:ya(Aa),R();break;case 26:case 27:case 5:Te(t);break;case 4:R();break;case 31:t.memoizedState!==null&&No(t);break;case 13:No(t);break;case 19:Io(t);break;case 10:ya(t.type);break;case 22:case 23:No(t),Eo(),e!==null&&F(Ua);break;case 24:ya(Aa)}}function yl(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){hf(t,t.return,e)}}function bl(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){hf(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){hf(t,t.return,e)}}function xl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{xo(t,n)}catch(t){hf(e,e.return,t)}}}function Sl(e,t,n){n.props=bc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){hf(e,t,n)}}function Cl(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:var i=e.stateNode,a=vi(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Pp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Fp(e);p(e.child,!1,Qp,o,void 0,void 0),e.stateNode=o}r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){hf(e,t,n)}}function wl(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){hf(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){hf(e,t,n)}else n.current=null}}function Tl(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n<t.length;n++)em(e.stateNode,t[n])}function El(e){for(var t=e.return;t!==null&&(kl(t)&&em(e.stateNode,t.stateNode),!Ol(t));)t=t.return}function Dl(e){for(var t=e.return;t!==null&&(kl(t)&&tm(e.stateNode,t.stateNode),!Ol(t));)t=t.return}function Ol(e){return e.tag===5||e.tag===3||e.tag===27}function kl(e){return e&&e.tag===7&&e.stateNode!==null}function Al(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){hf(e,e.return,t)}}function jl(e,t,n){try{var r=e.stateNode;ip(r,e.type,n,t),r[Ct]=t}catch(t){hf(e,e.return,t)}}function Ml(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Sp(e.type)||e.tag===4}function Nl(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Ml(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&&Sp(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 Pl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(i,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(i),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=yn)),Tl(e,r),Kt=!0;else if(i!==4&&(i===27&&(Tl(e,r),r=null,Sp(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Pl(e,t,n,r),e=e.sibling;e!==null;)Pl(e,t,n,r),e=e.sibling}function Fl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),Tl(e,r),Kt=!0;else if(i!==4&&(i===27&&(Tl(e,r),r=null,Sp(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(Fl(e,t,n,r),e=e.sibling;e!==null;)Fl(e,t,n,r),e=e.sibling}function Il(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);np(t,r,n),t[St]=e,t[Ct]=n}catch(t){hf(e,e.return,t)}}var Ll=!1,Rl=null;function zl(e){(e.tag===30||e.subtreeFlags&33554432)&&(Ll=!0)}var Bl=null;function Vl(){var e=Bl;return Bl=null,e}var Hl=0;function Ul(e,t,n,r,i){return Hl=0,Wl(e.child,t,n,r,i)}function Wl(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=Op(o);r.push(s),s.view&&(a=!0)}else a||Op(o).view&&(a=!0);Ll=!0,Tp(o,Hl===0?t:t+`_`+Hl,n),Hl++}else e.tag===22&&e.memoizedState!==null||e.tag===30&&i||Wl(e.child,t,n,r,i)&&(a=!0);e=e.sibling}return a}function Gl(e,t){for(;e!==null;)e.tag===5?Ep(e.stateNode,e.memoizedProps):e.tag===22&&e.memoizedState!==null||e.tag===30&&t||Gl(e.child,t),e=e.sibling}function Kl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Kl(e),e.tag===30&&e.flags&18874368&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name===`auto`)throw Error(i(544));var n=t.name;t=bi(t.default,t.share),t!==`none`&&(Ul(e,n,t,null,!1)||Gl(e.child,!1))}e=e.sibling}}function ql(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=vi(r,n),a=bi(r.default,n.paired?r.share:r.enter);a===`none`?Kl(e):Ul(e,i,a,null,!1)?(Kl(e),n.paired||t||Pd(e,r.onEnter)):Gl(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)ql(e,t),e=e.sibling;else Kl(e)}function Jl(e){if(Rl!==null&&Rl.size!==0){var t=Rl;if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var n=e.memoizedProps,r=n.name;if(r!=null&&r!==`auto`){var i=t.get(r);if(i!==void 0){var a=bi(n.default,n.share);if(a!==`none`&&(Ul(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,Pd(e,n.onShare)):Gl(e.child,!1)),t.delete(r),t.size===0)break}}}Jl(e)}e=e.sibling}}}function Yl(e){if(e.tag===30){var t=e.memoizedProps,n=vi(t,e.stateNode),r=Rl===null?void 0:Rl.get(n),i=bi(t.default,r===void 0?t.exit:t.share);i!==`none`&&(Ul(e,n,i,null,!1)?r===void 0?Pd(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Rl.delete(n),Pd(e,t.onShare)):Gl(e.child,!1)),Rl!==null&&Jl(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Yl(e),e=e.sibling;else Rl!==null&&Jl(e)}function Xl(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=vi(t,e.stateNode);t=bi(t.default,t.update),e.flags&=-5,t!==`none`&&Ul(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&Xl(e);e=e.sibling}}function Zl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var t=e.stateNode;t.paired!==null&&(t.paired=null,Gl(e.child,!1))}Zl(e)}e=e.sibling}}function Ql(e){if(e.tag===30)e.stateNode.paired=null,Gl(e.child,!1),Zl(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Ql(e),e=e.sibling;else Zl(e)}function $l(e){for(e=e.child;e!==null;)e.tag===30?Gl(e.child,!1):e.subtreeFlags&33554432&&$l(e),e=e.sibling}function eu(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&Hl<a.length){var l=a[Hl],u=Op(c);(l.view||u.view)&&(s=!0);var d;if(d=!(e.flags&4)){if(u.clip)d=!0;else{d=l.rect;var f=u.rect;d=d.y!==f.y||d.x!==f.x||d.height!==f.height||d.width!==f.width}}d&&(e.flags|=4),u.abs?u=!l.abs:(l=l.rect,u=u.rect,u=l.height!==u.height||l.width!==u.width),u&&(e.flags|=32)}else e.flags|=32;e.flags&4&&Tp(c,Hl===0?n:n+`_`+Hl,i),s&&e.flags&4||(Bl===null&&(Bl=[]),Bl.push(c,Hl===0?r:r+`_`+Hl,t.memoizedProps)),Hl++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:eu(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function tu(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=vi(n,r),a=bi(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(kp)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;Hl=0,i=eu(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||Pd(e,n.onUpdate))}else e.subtreeFlags&33554432&&tu(e,t);e=e.sibling}}var nu=!1,q=!1,ru=!1,iu=!1,au=typeof WeakSet==`function`?WeakSet:Set,ou=null,su=!1,cu=!1,lu=!1,uu=!1;function du(e,t,n){if(e=e.containerInfo,sp=gh,e=Jr(e),Yr(e)){if(`selectionStart`in e)var r={start:e.selectionStart,end:e.selectionEnd};else a:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==r||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===r&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}r=c===-1||l===-1?null:{start:c,end:l}}else r=null}r||={start:0,end:0}}else r=null;for(cp={focusedElem:e,selectionRange:r},gh=!1,n=(n&335544064)===n,ou=t,t=n?9270:1024;ou!==null;){if(e=ou,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&Yl(r[a]);if(e.alternate===null&&e.flags&2)n&&zl(e),fu(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&Yl(r),fu(n);continue}if(r!==null&&r.memoizedState!==null){n&&zl(e),fu(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,ou=r):(n&&Xl(e),fu(n))}}Rl=null}function fu(e){for(;ou!==null;){var t=ou,n=e,r=t.alternate,a=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if(a&1024&&r!==null){n=void 0,a=r.memoizedProps,r=r.memoizedState;var o=t.stateNode;try{var s=bc(t.type,a);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){hf(t,t.return,e)}}break;case 3:if(a&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)nm(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:nm(r);break;default:r.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:n&&r!==null&&(n=vi(r.memoizedProps,r.stateNode),a=t.memoizedProps,a=bi(a.default,a.update),a!==`none`&&Ul(r,n,a,r.memoizedState=[],!0));break;default:if(a&1024)throw Error(i(163))}if(r=t.sibling,r!==null){r.return=t.return,ou=r;break}ou=t.return}}function pu(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Nu(e,n),r&4&&yl(5,n);break;case 1:if(Nu(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){hf(n,n.return,e)}else{var i=bc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){hf(n,n.return,e)}}}r&64&&xl(n),r&512&&Cl(n,n.return);break;case 3:if(Nu(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{xo(e,t)}catch(e){hf(n,n.return,e)}}break;case 27:t===null&&r&4&&Il(n);case 26:case 5:Nu(e,n),t===null&&r&4&&Al(n),r&512&&Cl(n,n.return);break;case 12:Nu(e,n);break;case 31:Nu(e,n),r&4&&Su(e,n);break;case 13:Nu(e,n),r&4&&Cu(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=yf.bind(null,n),cm(e,n))));break;case 22:if(r=n.memoizedState!==null||nu,!r){var a=t!==null&&t.memoizedState!==null||q;t=nu,i=q,nu=r,(q=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),Fu(e,n,r)):Nu(e,n),nu=t,q=i}break;case 30:Nu(e,n),r&512&&Cl(n,n.return);break;case 7:r&512&&Cl(n,n.return);default:Nu(e,n)}}function mu(e,t){for(e=e.child;e!==null;)hu(e,t),e=e.sibling}function hu(e,t){switch(e.tag){case 5:case 26:try{var n=e.stateNode;if(t){var r=n.style;typeof r.setProperty==`function`?r.setProperty(`display`,`none`,`important`):r.display=`none`}else{var i=e.stateNode,a=e.memoizedProps.style,o=a!=null&&a.hasOwnProperty(`display`)?a.display:null;i.style.display=o==null||typeof o==`boolean`?``:(``+o).trim()}}catch(t){hf(e,e.return,t)}gu(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,Kt=!0}catch(t){hf(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?wp(s,!0):wp(e.stateNode,!1)}catch(t){hf(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&mu(e,t);break;default:mu(e,t)}}function gu(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:hu(n,r);break a;case 22:n.memoizedState===null&&gu(n,r);break a;default:gu(n,r)}}e=e.sibling}}function _u(e){var t=e.alternate;t!==null&&(e.alternate=null,_u(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&jt(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 vu=null,yu=!1;function bu(e,t,n){for(n=n.child;n!==null;)xu(e,t,n),n=n.sibling}function xu(e,t,n){if(Je&&typeof Je.onCommitFiberUnmount==`function`)try{Je.onCommitFiberUnmount(qe,n)}catch{}switch(n.tag){case 26:q||wl(n,t),bu(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!q&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:q||wl(n,t),Dl(n);var r=vu,i=yu;Sp(n.type)&&(vu=n.stateNode,yu=!1),bu(e,t,n),gm(n.stateNode,n.type,n.memoizedProps),vu=r,yu=i;break;case 5:q||wl(n,t),Dl(n);case 6:if(n.tag===6&&Dl(n),r=vu,i=yu,vu=null,bu(e,t,n),vu=r,yu=i,vu!==null){if(yu)try{(vu.nodeType===9?vu.body:vu.nodeName===`HTML`?vu.ownerDocument.body:vu).removeChild(n.stateNode),Kt=!0}catch(e){hf(n,t,e)}else try{vu.removeChild(n.stateNode),Kt=!0}catch(e){hf(n,t,e)}}break;case 18:vu!==null&&(yu?(e=vu,Cp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Hh(e)):Cp(vu,n.stateNode));break;case 4:r=vu,i=yu,vu=n.stateNode.containerInfo,yu=!0,bu(e,t,n),vu=r,yu=i;break;case 0:case 11:case 14:case 15:bl(2,n,t),q||bl(4,n,t),bu(e,t,n);break;case 1:q||(wl(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Sl(n,t,r)),bu(e,t,n);break;case 21:bu(e,t,n);break;case 22:q=(r=q)||n.memoizedState!==null,bu(e,t,n),q=r;break;case 30:wl(n,t),bu(e,t,n);break;case 7:q||wl(n,t),bu(e,t,n);break;default:bu(e,t,n)}}function Su(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Hh(e)}catch(e){hf(t,t.return,e)}}}function Cu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Hh(e)}catch(e){hf(t,t.return,e)}}function wu(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new au),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new au),t;default:throw Error(i(435,e.tag))}}function Tu(e,t){var n=wu(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=X.bind(null,e,t);t.then(r,r)}})}function Eu(e,t,n){var r=t.deletions;if(r!==null)for(var a=0;a<r.length;a++){var o=r[a],s=e,c=t,l=c;a:for(;l!==null;){switch(l.tag){case 27:if(Sp(l.type)){vu=l.stateNode,yu=!1;break a}break;case 5:vu=l.stateNode,yu=!1;break a;case 3:case 4:vu=l.stateNode.containerInfo,yu=!0;break a}l=l.return}if(vu===null)throw Error(i(160));xu(s,c,o),vu=null,yu=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Ou(t,e,n),t=t.sibling}var Du=null;function Ou(e,t,n){var r=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(a&4&&(r=e.updateQueue,r=r===null?null:r.events,r!==null))for(var o=0;o<r.length;o++){var s=r[o];s.ref.impl=s.nextImpl}Eu(t,e,n),ku(e),a&4&&(bl(3,e,e.return),yl(3,e),bl(5,e,e.return));break;case 1:Eu(t,e,n),ku(e),a&512&&(q||r===null||wl(r,r.return)),a&64&&nu&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?t:n.concat(t))));break;case 26:if(o=Du,Eu(t,e,n),ku(e),a&512&&(q||r===null||wl(r,r.return)),a&4){if(a=r===null?null:r.memoizedState,n=e.memoizedState,r===null){if(n===null){if(e.stateNode===null){if(nu)e.stateNode=fp(e.type,e.memoizedProps,t.containerInfo,e);else{a:{t=e.type,n=e.memoizedProps,a=o.ownerDocument||o;b:switch(t){case`title`:r=a.getElementsByTagName(`title`)[0],(!r||r[kt]||r[St]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=a.createElement(t),a.head.insertBefore(r,a.querySelector(`head > title`))),np(r,t,n),r[St]=e,It(r),t=r;break a;case`link`:if(o=Gm(`link`,`href`,a).get(t+(n.href||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&r.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&r.getAttribute(`title`)===(n.title==null?null:n.title)&&r.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){o.splice(s,1);break b}}r=a.createElement(t),np(r,t,n),a.head.appendChild(r);break;case`meta`:if(o=Gm(`meta`,`content`,a).get(t+(n.content||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`content`)===(n.content==null?null:``+n.content)&&r.getAttribute(`name`)===(n.name==null?null:n.name)&&r.getAttribute(`property`)===(n.property==null?null:n.property)&&r.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&r.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){o.splice(s,1);break b}}r=a.createElement(t),np(r,t,n),a.head.appendChild(r);break;default:throw Error(i(468,t))}r[St]=e,It(r),t=r}e.stateNode=t}}else nu||Km(o,e.type,e.stateNode)}else e.stateNode=Bm(o,n,e.memoizedProps)}else a===n?n===null&&e.stateNode!==null&&jl(e,e.memoizedProps,r.memoizedProps):(a===null?(t=r.stateNode,t===null||q||t.parentNode.removeChild(t)):a.count--,n===null?nu||Km(o,e.type,e.stateNode):Bm(o,n,e.memoizedProps))}break;case 27:Eu(t,e,n),ku(e),a&512&&(q||r===null||wl(r,r.return)),r!==null&&a&4&&jl(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=ru,ru=!1,Eu(t,e,n),ru=o,ku(e),a&512&&(q||r===null||wl(r,r.return)),e.flags&32){t=e.stateNode;try{dn(t,``),Kt=!0}catch(t){hf(e,e.return,t)}}a&4&&e.stateNode!=null&&(t=e.memoizedProps,jl(e,t,r===null?t:r.memoizedProps)),a&1024&&(iu=!0);break;case 6:if(Eu(t,e,n),ku(e),a&4){if(e.stateNode===null)throw Error(i(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,Kt=!0}catch(t){hf(e,e.return,t)}}break;case 3:if(Kt=!1,Wm=null,o=Du,Du=bm(t.containerInfo),Eu(t,e,n),Du=o,ku(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{Hh(t.containerInfo)}catch(t){hf(e,e.return,t)}iu&&(iu=!1,Au(e)),Kt=!1;break;case 4:a=ru,ru=nu,r=qt(),o=Du,Du=bm(e.stateNode.containerInfo),Eu(t,e,n),ku(e),Du=o,Kt&&cu&&(lu=!0),Kt=r,ru=a;break;case 12:Eu(t,e,n),ku(e);break;case 31:Eu(t,e,n),ku(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Tu(e,t)));break;case 13:Eu(t,e,n),ku(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(hd=Re()),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Tu(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=nu,l=q,u=ru;nu=c||o,ru=u||o,q=l||s,Eu(t,e,n),q=l,ru=u,nu=c,ku(e),a&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||nu||q||(t=s||q,n=nu,r=q,nu=o||nu,q=t,Pu(e,2),nu=n,q=r),!o&&ru||mu(e,o)),a&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,Tu(e,n))));break;case 19:Eu(t,e,n),ku(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Tu(e,t)));break;case 30:a&512&&(q||r===null||wl(r,r.return)),a=qt(),o=cu,s=(n&335544064)===n,c=e.memoizedProps,cu=s&&bi(c.default,c.update)!==`none`,Eu(t,e,n),ku(e),s&&r!==null&&Kt&&(e.flags|=4),cu=o,Kt=a;break;case 21:break;case 7:a&512&&(q||r===null||wl(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:Eu(t,e,n),ku(e)}}function ku(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Ml(r)){n=r;break}r=r.return}r=null;for(var a=e.return;a!==null;){if(kl(a)){var o=a.stateNode;r===null?r=[o]:r.push(o)}if(Ol(a))break;a=a.return}var s=r;if(n==null)throw Error(i(160));switch(n.tag){case 27:var c=n.stateNode;Fl(e,Nl(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(dn(l,``),n.flags&=-33),Fl(e,Nl(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;Pl(e,Nl(e),u,s);break;default:throw Error(i(161))}}catch(t){hf(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Au(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Au(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,gh=!0,t.reset(),gh=!1),e=e.sibling}}function ju(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Mu(t,e),t=t.sibling;else tu(t,!1)}function Mu(e,t){var n=e.alternate;if(n===null)ql(e,!1);else switch(e.tag){case 3:if(uu=su=!1,Vl(),ju(t,e),!su&&!lu){if(e=Bl,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Ep(n,e[r+2]),n=n.ownerDocument.documentElement,n!==null&&n.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(`+i+`)`})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===``&&(e.style.viewTransitionName=`none`,e.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(root)`}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition`})),uu=!0}Bl=null;break;case 5:ju(t,e);break;case 4:r=su,su=!1,ju(t,e),su&&(lu=!0),su=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?ju(t,e):ql(e,!1));break;case 30:r=su,i=Vl(),su=!1,ju(t,e),su&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=vi(a,o),o=vi(n.memoizedProps,o);var s=bi(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,Hl=0,t=eu(e,n,t,o,s,a,!0),Hl!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(Pd(e,e.memoizedProps.onUpdate),Bl=i):i!==null&&(i.push.apply(i,Bl),Bl=i),su=e.flags&32?!0:r;break;default:ju(t,e)}}function Nu(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)pu(e,t.alternate,t),t=t.sibling}function Pu(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:bl(4,n,n.return),Pu(n,r);break;case 1:wl(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&Sl(n,n.return,i),Pu(n,r);break;case 27:r&2&&gm(n.stateNode,n.type,n.memoizedProps);case 5:wl(n,n.return),n.tag!==5&&n.tag!==27||Dl(n),Pu(n,r);break;case 6:Dl(n);break;case 26:wl(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||q||i.parentNode.removeChild(i),Pu(n,r);break;case 22:n.memoizedState===null&&Pu(n,r);break;case 30:wl(n,n.return),Pu(n,r);break;case 7:wl(n,n.return);default:Pu(n,r)}e=e.sibling}}function Fu(e,t,n){for(n=t.subtreeFlags&8772?n:n&-2,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags,s=!!(n&1);switch(a.tag){case 0:case 11:case 15:Fu(i,a,n),yl(4,a);break;case 1:if(Fu(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){hf(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var c=r.stateNode;try{var l=i.shared.hiddenCallbacks;if(l!==null)for(i.shared.hiddenCallbacks=null,i=0;i<l.length;i++)bo(l[i],c)}catch(e){hf(r,r.return,e)}}s&&o&64&&xl(a),Cl(a,a.return);break;case 27:n&2&&Il(a);case 5:a.tag!==5&&a.tag!==27||El(a),Fu(i,a,n),s&&r===null&&o&4&&Al(a),Cl(a,a.return);break;case 6:El(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||nu||Km(bm(c.ownerDocument),a.type,c),Fu(i,a,n),s&&r===null&&o&4&&Al(a),Cl(a,a.return);break;case 12:Fu(i,a,n);break;case 31:Fu(i,a,n),s&&o&4&&Su(i,a);break;case 13:Fu(i,a,n),s&&o&4&&Cu(i,a);break;case 22:a.memoizedState===null&&Fu(i,a,n),Cl(a,a.return);break;case 30:Fu(i,a,n),Cl(a,a.return);break;case 7:Cl(a,a.return);default:Fu(i,a,n)}t=t.sibling}}function Iu(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 Lu(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 Ru(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)zu(e,t,n,r),t=t.sibling;else i&&$l(t)}function zu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&Ql(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Ru(e,t,n,r),a&2048&&yl(9,t);break;case 1:Ru(e,t,n,r);break;case 3:Ru(e,t,n,r),i&&uu&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,e.style.viewTransitionName===`root`&&(e.style.viewTransitionName=``),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===`none`&&(e.style.viewTransitionName=``)),a&2048&&(a=null,t.alternate!==null&&(a=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==a&&(t.refCount++,a!=null&&Ma(a)));break;case 12:if(a&2048){Ru(e,t,n,r),a=t.stateNode;try{var o=t.memoizedProps,s=o.id,c=o.onPostCommit;typeof c==`function`&&c(s,t.alternate===null?`mount`:`update`,a.passiveEffectDuration,-0)}catch(e){hf(t,t.return,e)}}else Ru(e,t,n,r);break;case 31:Ru(e,t,n,r);break;case 13:Ru(e,t,n,r);break;case 23:break;case 22:o=t.stateNode,s=t.alternate,t.memoizedState===null?(i&&s!==null&&s.memoizedState!==null&&Ql(t),o._visibility&2?Ru(e,t,n,r):(o._visibility|=2,Bu(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&Ql(s),o._visibility&2?Ru(e,t,n,r):Vu(e,t)),a&2048&&Iu(s,t);break;case 24:Ru(e,t,n,r),a&2048&&Lu(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(Gl(a.child,!0),Gl(t.child,!0))),Ru(e,t,n,r);break;default:Ru(e,t,n,r)}}function Bu(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!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:Bu(a,o,s,c,i),yl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Bu(a,o,s,c,i)):u._visibility&2?Bu(a,o,s,c,i):Vu(a,o),i&&l&2048&&Iu(o.alternate,o);break;case 24:Bu(a,o,s,c,i),i&&l&2048&&Lu(o.alternate,o);break;default:Bu(a,o,s,c,i)}t=t.sibling}}function Vu(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:Vu(n,r),i&2048&&Iu(r.alternate,r);break;case 24:Vu(n,r),i&2048&&Lu(r.alternate,r);break;default:Vu(n,r)}t=t.sibling}}var Hu=8192;function Uu(e,t,n){if(e.subtreeFlags&Hu)for(e=e.child;e!==null;)Wu(e,t,n),e=e.sibling}function Wu(e,t,n){switch(e.tag){case 26:Uu(e,t,n),e.flags&Hu&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&Zm(n,e)):Qm(n,Du,e.memoizedState,e.memoizedProps));break;case 5:Uu(e,t,n),e.flags&Hu&&(e=e.stateNode,(t&335544128)===t&&Zm(n,e));break;case 3:case 4:var r=Du;Du=bm(e.stateNode.containerInfo),Uu(e,t,n),Du=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Hu,Hu=16777216,Uu(e,t,n),Hu=r):Uu(e,t,n));break;case 30:if((e.flags&Hu)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Rl===null&&(Rl=new Map),Rl.set(r,i)}Uu(e,t,n);break;default:Uu(e,t,n)}}function Gu(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 Ku(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];ou=r,Yu(r,e)}Gu(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)qu(e),e=e.sibling}function qu(e){switch(e.tag){case 0:case 11:case 15:Ku(e),e.flags&2048&&bl(9,e,e.return);break;case 3:Ku(e);break;case 12:Ku(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Ju(e)):Ku(e);break;default:Ku(e)}}function Ju(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];ou=r,Yu(r,e)}Gu(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:bl(8,t,t.return),Ju(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Ju(t));break;default:Ju(t)}e=e.sibling}}function Yu(e,t){for(;ou!==null;){var n=ou;switch(n.tag){case 0:case 11:case 15:bl(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,ou=r;else a:for(n=e;ou!==null;){r=ou;var i=r.sibling,a=r.return;if(_u(r),r===n){ou=null;break a}if(i!==null){i.return=a,ou=i;break a}ou=a}}}var Xu={getCacheForType:function(e){var t=V(Aa),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return V(Aa).controller.signal}},Zu=typeof WeakMap==`function`?WeakMap:Map,Qu=0,$u=null,J=null,Y=0,ed=0,td=null,nd=!1,rd=!1,id=!1,ad=0,od=0,sd=0,cd=0,ld=0,ud=0,dd=0,fd=null,pd=null,md=!1,hd=0,gd=0,_d=1/0,vd=null,yd=null,bd=0,xd=null,Sd=null,Cd=0,wd=0,Td=null,Ed=null,Dd=null,Od=null,kd=null,Ad=0,jd=null;function Md(){return Qu&2&&Y!==0?Y&-Y:N.T===null?yt():Nf()}function Nd(){if(ud===0){if(!(Y&536870912)||z){var e=tt;tt<<=1,!(tt&3932160)&&(tt=262144),ud=e}else ud=536870912}return e=Do.current,e!==null&&(e.flags|=32),ud}function Pd(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Pp(vi(e.memoizedProps,n))),Od===null&&(Od=[]),Od.push(t.bind(null,r))}}function Fd(e,t,n){(e===$u&&(ed===2||ed===9)||e.cancelPendingCommit!==null)&&(Hd(e,0),zd(e,Y,ud,!1)),ft(e,n),Qu&2&&e===$u||(e===$u&&(!(Qu&2)&&(cd|=n),od===4&&zd(e,Y,ud,!1)),Df(e))}function Id(e,t,n){if(Qu&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||ot(e,t),a=r?Xd(e,t):Jd(e,t,!0),o=r;do{if(a===0){rd&&!r&&zd(e,t,0,!1);break}if(n=e.current.alternate,o&&!Rd(n))a=Jd(e,t,!1),o=!1;else{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=fd;var l=c.current.memoizedState.isDehydrated;if(l&&(Hd(c,s).flags|=256),s=Jd(c,s,!1),s!==2&&s!==6){if(id&&!l){c.errorRecoveryDisabledLanes|=o,cd|=o,a=4;break a}o=pd,pd=a,o!==null&&(pd===null?pd=o:pd.push.apply(pd,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Hd(e,0),zd(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&&(t&62914560)!==t)break;case 6:zd(r,t,ud,!nd);break a;case 2:pd=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=hd+300-Re(),10<a)){if(zd(r,t,ud,!nd),it(r,0,!0)!==0)break a;Cd=t,r.timeoutHandle=gp(Ld.bind(null,r,n,pd,vd,md,t,ud,cd,dd,nd,o,`Throttled`,-0,0),a);break a}Ld(r,n,pd,vd,md,t,ud,cd,dd,nd,o,null,-0,0)}break}}while(1);Df(e)}function Ld(e,t,n,r,i,a,o,s,c,l,u,d,f,p){e.timeoutHandle=-1;var m=t.subtreeFlags,h=(a&335544064)===a;d=null,(h||m&8192||(m&16785408)==16785408)&&(d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:yn},Rl=null,Wu(t,a,d),h&&(m=d,h=e.containerInfo,h=(h.nodeType===9?h:h.ownerDocument).__reactViewTransition,h!=null&&(m.count++,m.waitingForViewTransition=!0,m=nh.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?hd-Re():(a&4194048)===a?gd-Re():0,m=eh(d,m),m!==null)?(Cd=a,e.cancelPendingCommit=m(rf.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),zd(e,a,o,!l)):rf(e,t,a,n,r,i,o,s,c,l,u,d)}function Rd(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(!Hr(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 zd(e,t,n,r){t=ct(e,t),t&=~ld,t&=~cd,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Xe(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&mt(e,n,t)}function Bd(){return Qu&6?!0:(Of(0,!1),!1)}function Vd(){if(J!==null){if(ed===0)var e=J.return;else e=J,_a=ga=null,ns(e),to=null,no=0,e=J;for(;e!==null;)vl(e.alternate,e),e=e.return;J=null}}function Hd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,_p(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Cd=0,Vd(),$u=e,J=n=Fi(e.current,null),Y=t,ed=0,td=null,nd=!1,rd=ot(e,t),id=!1,dd=ud=ld=cd=sd=od=0,pd=fd=null,md=!1,ad=ct(e,t),Ti(),n}function Ud(e,t){G=null,N.H=fc,t===qa||t===Ya?(t=W(),ed=3):t===Ja?(t=W(),ed=4):ed=t===Ac?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,td=t,J===null&&(od=1,wc(e,Ui(t,e.current)))}function Wd(){var e=Do.current;return e===null?!0:(Y&4194048)===Y?Oo===null:(Y&62914560)===Y||Y&536870912?e===Oo:!1}function Gd(){var e=N.H;return N.H=fc,e===null?fc:e}function Kd(){var e=N.A;return N.A=Xu,e}function qd(){od=4,nd||(Y&4194048)!==Y&&Do.current!==null||(rd=!0),!(sd&134217727)&&!(cd&134217727)||$u===null||zd($u,Y,ud,!1)}function Jd(e,t,n){var r=Qu;Qu|=2;var i=Gd(),a=Kd();($u!==e||Y!==t)&&(vd=null,Hd(e,t)),t=!1;var o=od;a:do try{if(ed!==0&&J!==null){var s=J,c=td;switch(ed){case 8:Vd(),o=6;break a;case 3:case 2:case 9:case 6:Do.current===null&&(t=!0);var l=ed;if(ed=0,td=null,ef(e,s,c,l),n&&rd){o=0;break a}break;default:l=ed,ed=0,td=null,ef(e,s,c,l)}}Yd(),o=od;break}catch(t){Ud(e,t)}while(1);return t&&e.shellSuspendCounter++,_a=ga=null,Qu=r,N.H=i,N.A=a,J===null&&($u=null,Y=0,Ti()),o}function Yd(){for(;J!==null;)Qd(J)}function Xd(e,t){var n=Qu;Qu|=2;var r=Gd(),a=Kd();$u!==e||Y!==t?(vd=null,_d=Re()+500,Hd(e,t)):rd=ot(e,t);a:do try{if(ed!==0&&J!==null){t=J;var o=td;b:switch(ed){case 1:ed=0,td=null,ef(e,t,o,1);break;case 2:case 9:if(Za(o)){ed=0,td=null,$d(t);break}t=function(){ed!==2&&ed!==9||$u!==e||(ed=7),Df(e)},o.then(t,t);break a;case 3:ed=7;break a;case 4:ed=5;break a;case 7:Za(o)?(ed=0,td=null,$d(t)):(ed=0,td=null,ef(e,t,o,7));break;case 5:var s=null;switch(J.tag){case 26:s=J.memoizedState;case 5:case 27:var c=J;if(s?Ym(s):c.stateNode.complete){ed=0,td=null;var l=c.sibling;if(l!==null)J=l;else{var u=c.return;u===null?J=null:(J=u,tf(u))}break b}}ed=0,td=null,ef(e,t,o,5);break;case 6:ed=0,td=null,ef(e,t,o,6);break;case 8:Vd(),od=6;break a;default:throw Error(i(462))}}Zd();break}catch(t){Ud(e,t)}while(1);return _a=ga=null,N.H=r,N.A=a,Qu=n,J===null?($u=null,Y=0,Ti(),od):0}function Zd(){for(;J!==null&&!Ie();)Qd(J)}function Qd(e){var t=ll(e.alternate,e,ad);e.memoizedProps=e.pendingProps,t===null?tf(e):J=t}function $d(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Uc(n,t,t.pendingProps,t.type,void 0,Y);break;case 11:t=Uc(n,t,t.pendingProps,t.type.render,t.ref,Y);break;case 5:ns(t);var r=t;r===ia&&(z?(da(r),r.tag===5&&r.stateNode!=null&&(aa=r.stateNode)):(da(r),z=!0));default:vl(n,t),t=J=Ii(t,ad),t=ll(n,t,ad)}e.memoizedProps=e.pendingProps,t===null?tf(e):J=t}function ef(e,t,n,r){_a=ga=null,ns(t),to=null,no=0;var i=t.return;try{if(kc(e,i,t,n,Y)){od=1,wc(e,Ui(n,e.current)),J=null;return}}catch(t){if(i!==null)throw J=i,t;od=1,wc(e,Ui(n,e.current)),J=null;return}t.flags&32768?(z||r===1?e=!0:rd||Y&536870912?e=!1:(nd=e=!0,(r===2||r===9||r===3||r===6)&&(r=Do.current,r!==null&&r.tag===13&&(r.flags|=16384))),nf(t,e)):tf(t)}function tf(e){var t=e;do{if(t.flags&32768){nf(t,nd);return}e=t.return;var n=gl(t.alternate,t,ad);if(n!==null){J=n;return}if(t=t.sibling,t!==null){J=t;return}J=t=e}while(t!==null);od===0&&(od=5)}function nf(e,t){do{var n=_l(e.alternate,e);if(n!==null){n.flags&=32767,J=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){J=e;return}J=e=n}while(e!==null);od=6,J=null}function rf(e,t,n,r,a,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do ff();while(bd!==0);if(Qu&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));e===$u&&(J=$u=null,Y=0),Sd=t,xd=e,Cd=n,Td=a,Ed=r,af(e,t,n,s,c,l,f)}}function af(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(wd=s,s|=wi,pt(e,n,s,r,i,a),Od=null,(n&335544064)===n?(kd=Pa(e),r=10262):(kd=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,bf(He,function(){return pf(),null})):(e.callbackNode=null,e.callbackPriority=0),Ll=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=N.T,N.T=null,i=P.p,P.p=2,a=Qu,Qu|=4;try{du(e,t,n)}finally{Qu=a,P.p=i,N.T=r}}bd=1,Ll?Dd=Mp(o,e.containerInfo,kd,cf,lf,sf,uf,pf,of,null,null):(cf(),lf(),uf())}function of(e){if(bd!==0){var t=xd.onRecoverableError;t(e,{componentStack:null})}}function sf(){bd===3&&(bd=0,Mu(Sd,xd),bd=4)}function cf(){if(bd===1){bd=0;var e=xd,t=Sd,n=Cd,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=N.T,N.T=null;var i=P.p;P.p=2;var a=Qu;Qu|=4;try{cu=lu=!1,Ou(t,e,n),n=cp;var o=Jr(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&qr(s.ownerDocument.documentElement,s)){if(c!==null&&Yr(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 _=Kr(s,h),v=Kr(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}}gh=!!sp,cp=sp=null}finally{Qu=a,P.p=i,N.T=r}}e.current=t,bd=2}}function lf(){if(bd===2){bd=0;var e=xd,t=Sd,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=N.T,N.T=null;var r=P.p;P.p=2;var i=Qu;Qu|=4;try{pu(e,t.alternate,t)}finally{Qu=i,P.p=r,N.T=n}}bd=3}}function uf(){if(bd===4||bd===3){bd=0;var e=Dd;Dd=null,Le();var t=xd,n=Sd,r=Cd,i=Ed,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?bd=5:(bd=0,Sd=xd=null,df(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(yd=null),vt(r),n=n.stateNode,Je&&typeof Je.onCommitFiberRoot==`function`)try{Je.onCommitFiberRoot(qe,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=N.T,a=P.p,P.p=2,N.T=null;try{for(var o=t.onRecoverableError,s=0;s<i.length;s++){var c=i[s];o(c.value,{componentStack:c.stack})}}finally{N.T=n,P.p=a}}if(i=Od,o=kd,kd=null,i!==null&&(Od=null,o===null&&(o=[]),e!==null))for(c=0;c<i.length;c++)n=(0,i[c])(o),n!==void 0&&e.finished.finally(n);Cd&3&&ff(),Df(t),a=t.pendingLanes,r&261930&&a&42?t===jd?Ad++:(Ad=0,jd=t):(Ad=0,jd=null),Of(0,!1)}}function df(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Ma(t)))}function ff(){return Dd!==null&&(Dd.skipTransition(),Dd=null),cf(),lf(),uf(),pf()}function pf(){if(bd!==5)return!1;var e=xd,t=wd;wd=0;var n=vt(Cd),r=N.T,a=P.p;try{P.p=32>n?32:n,N.T=null,n=Td,Td=null;var o=xd,s=Cd;if(bd=0,Sd=xd=null,Cd=0,Qu&6)throw Error(i(331));var c=Qu;if(Qu|=4,qu(o.current),zu(o,o.current,s,n),Qu=c,Of(0,!1),Je&&typeof Je.onPostCommitFiberRoot==`function`)try{Je.onPostCommitFiberRoot(qe,o)}catch{}return!0}finally{P.p=a,N.T=r,df(e,t)}}function mf(e,t,n){t=Ui(n,t),t=Ec(e.stateNode,t,2),e=mo(e,t,2),e!==null&&(ft(e,2),Df(e))}function hf(e,t,n){if(e.tag===3)mf(e,e,n);else for(;t!==null;){if(t.tag===3){mf(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(yd===null||!yd.has(r))){e=Ui(n,e),n=Dc(2),r=mo(t,n,2),r!==null&&(Oc(n,r,t,e),ft(r,2),Df(r));break}}t=t.return}}function gf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Zu;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)||(id=!0,i.add(n),e=_f.bind(null,e,t,n),t.then(e,e))}function _f(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,$u===e&&(Y&n)===n&&(od===4||od===3&&(Y&62914560)===Y&&300>Re()-hd?Qu&2?ld|=n:Hd(e,0):ld|=n,dd===Y&&(dd=0)),Df(e)}function vf(e,t){t===0&&(t=ut()),e=Oi(e,t),e!==null&&(ft(e,t),Df(e))}function yf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),vf(e,n)}function X(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),vf(e,n)}function bf(e,t){return Pe(e,t)}var xf=null,Sf=null,Cf=!1,wf=!1,Tf=!1,Ef=0;function Df(e){e!==Sf&&e.next===null&&(Sf===null?xf=Sf=e:Sf=Sf.next=e),wf=!0,Cf||(Cf=!0,Mf())}function Of(e,t){if(!Tf&&wf){Tf=!0;do for(var n=!1,r=xf;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-Xe(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,jf(r,a))}else a=Y,a=it(r,r===$u?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||ot(r,a)||(n=!0,jf(r,a))}r=r.next}while(n);Tf=!1}}function Z(){Q()}function Q(){wf=Cf=!1;var e=0;Ef!==0&&hp()&&(e=Ef);for(var t=Re(),n=null,r=xf;r!==null;){var i=r.next,a=kf(r,t);a===0?(r.next=null,n===null?xf=i:n.next=i,i===null&&(Sf=n)):(n=r,(e!==0||a&3)&&(wf=!0)),r=i}bd!==0&&bd!==5||Of(e,!1),Ef!==0&&(Ef=0)}function kf(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Xe(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=lt(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=$u,n=Y,n=it(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(ed===2||ed===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Fe(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||ot(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Fe(r),vt(n)){case 2:case 8:n=Ve;break;case 32:n=He;break;case 268435456:n=We;break;default:n=He}return r=Af.bind(null,e),n=Pe(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Fe(r),e.callbackPriority=2,e.callbackNode=null,2}function Af(e,t){if(bd!==0&&bd!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(ff()&&e.callbackNode!==n)return null;var r=Y;return r=it(e,e===$u?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Id(e,r,t),kf(e,Re()),e.callbackNode!=null&&e.callbackNode===n?Af.bind(null,e):null)}function jf(e,t){if(ff())return null;Id(e,t,!0)}function Mf(){bp(function(){Qu&6?Pe(Be,Z):Q()})}function Nf(){if(Ef===0){var e=La;e===0&&(e=et,et<<=1,!(et&261888)&&(et=256)),Ef=e}return Ef}function Pf(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:vn(e)}function Ff(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Pf((i[Ct]||null).action),o=r.submitter;o&&(t=(t=o[Ct]||null)?Pf(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Bn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Ef!==0){var e=new FormData(i,o);Qs(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),Qs(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var If=0;If<hi.length;If++){var Lf=hi[If];gi(Lf.toLowerCase(),`on`+(Lf[0].toUpperCase()+Lf.slice(1)))}gi(si,`onAnimationEnd`),gi(ci,`onAnimationIteration`),gi(li,`onAnimationStart`),gi(`dblclick`,`onDoubleClick`),gi(`focusin`,`onFocus`),gi(`focusout`,`onBlur`),gi(ui,`onTransitionRun`),gi(di,`onTransitionStart`),gi(fi,`onTransitionCancel`),gi(pi,`onTransitionEnd`),Vt(`onMouseEnter`,[`mouseout`,`mouseover`]),Vt(`onMouseLeave`,[`mouseout`,`mouseover`]),Vt(`onPointerEnter`,[`pointerout`,`pointerover`]),Vt(`onPointerLeave`,[`pointerout`,`pointerover`]),Bt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Bt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Bt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Bt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Bt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Bt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Rf=`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(` `),zf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Rf));function Bf(e,t){t=!!(t&4);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){xi(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){xi(e)}i.currentTarget=null,a=c}}}}function $(e,t){var n=t[Tt];n===void 0&&(n=t[Tt]=new Set);var r=e+`__bubble`;n.has(r)||(Wf(t,e,2,!1),n.add(r))}function Vf(e,t,n){var r=0;t&&(r|=4),Wf(n,e,r,t)}var Hf=`_reactListening`+Math.random().toString(36).slice(2);function Uf(e){if(!e[Hf]){e[Hf]=!0,Rt.forEach(function(t){t!==`selectionchange`&&(zf.has(t)||Vf(t,!1,e),Vf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Hf]||(t[Hf]=!0,Vf(`selectionchange`,!1,t))}}function Wf(e,t,n,r){switch(Ch(t)){case 2:var i=_h;break;case 8:i=vh;break;default:i=yh}n=i.bind(null,t,n,e),i=void 0,!kn||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 Gf(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=Mt(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}En(function(){var r=a,i=xn(n),s=[];a:{var c=mi.get(e);if(c!==void 0){var l=Bn,u=e;switch(e){case`keypress`:if(Fn(n)===0)break a;case`keydown`:case`keyup`:l=ir;break;case`focusin`:u=`focus`,l=Yn;break;case`focusout`:u=`blur`,l=Yn;break;case`beforeblur`:case`afterblur`:l=Yn;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=qn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Jn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=sr;break;case si:case ci:case li:l=Xn;break;case pi:l=cr;break;case`scroll`:case`scrollend`:l=Hn;break;case`wheel`:l=lr;break;case`copy`:case`cut`:case`paste`:l=Zn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=ar;break;case`submit`:l=or;break;case`toggle`:case`beforetoggle`:l=ur}var d=!!(t&4),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=Dn(m,p),g!=null&&d.push(Kf(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(l=e===`mouseover`||e===`pointerover`,c=e===`mouseout`||e===`pointerout`,l&&n!==bn&&(u=n.relatedTarget||n.fromElement)&&(Mt(u)||u[wt]))break a;(c||l)&&(u=i.window===i?i:(l=i.ownerDocument)?l.defaultView||l.parentWindow:window,c?(l=n.relatedTarget||n.toElement,c=r,l=l?Mt(l):null,l!==null&&(f=o(l),d=l.tag,l!==f||d!==5&&d!==27&&d!==6)&&(l=null)):(c=null,l=r),c!==l&&(d=qn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=ar,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?u:Pt(c),h=l==null?u:Pt(l),u=new d(g,m+`leave`,c,n,i),u.target=f,u.relatedTarget=h,g=null,Mt(i)===r&&(d=new d(p,m+`enter`,l,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,d=c&&l?w(c,l,Jf):null,c!==null&&Yf(s,u,c,d,!1),l!==null&&f!==null&&Yf(s,f,l,d,!0)))}a:{if(c=r?Pt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var _=Ar;else if(wr(c)){if(jr)_=Br;else{_=Rr;var v=Lr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&hn(r.elementType)&&(_=Ar):_=zr;if(_&&=_(e,r)){Tr(s,_,n,i);break a}v&&v(e,c,r)}switch(v=r?Pt(r):window,e){case`focusin`:(wr(v)||v.contentEditable===`true`)&&(Zr=v,Qr=r,$r=null);break;case`focusout`:$r=Qr=Zr=null;break;case`mousedown`:ei=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:ei=!1,ti(s,n,i);break;case`selectionchange`:if(Xr)break;case`keydown`:case`keyup`:ti(s,n,i)}var y;if(fr)b:{switch(e){case`compositionstart`:var b=`onCompositionStart`;break b;case`compositionend`:b=`onCompositionEnd`;break b;case`compositionupdate`:b=`onCompositionUpdate`;break b}b=void 0}else br?vr(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(hr&&n.locale!==`ko`&&(br||b!==`onCompositionStart`?b===`onCompositionEnd`&&br&&(y=Pn()):(jn=i,Mn=`value`in jn?jn.value:jn.textContent,br=!0)),v=qf(r,b),0<v.length&&(b=new Qn(b,e,null,n,i),s.push({event:b,listeners:v}),y?b.data=y:(y=yr(n),y!==null&&(b.data=y)))),(y=mr?xr(e,n):Sr(e,n))&&(b=qf(r,`onBeforeInput`),0<b.length&&(v=new Qn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:v,listeners:b}),v.data=y)),Ff(s,e,r,n,i)}Bf(s,t)})}function Kf(e,t,n){return{instance:e,listener:t,currentTarget:n}}function qf(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=Dn(e,n),i!=null&&r.unshift(Kf(e,i,a)),i=Dn(e,t),i!=null&&r.push(Kf(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Jf(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Yf(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=Dn(n,a),l!=null&&o.unshift(Kf(n,l,c))):i||(l=Dn(n,a),l!=null&&o.push(Kf(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Xf=/\r\n?/g,Zf=/\u0000|\uFFFD/g;function Qf(e){return(typeof e==`string`?e:``+e).replace(Xf,`
9
+ `).replace(Zf,``)}function $f(e,t){return t=Qf(t),Qf(e)===t}function ep(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||dn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&dn(e,``+r);else return;break;case`className`:Yt(e,`class`,r);break;case`tabIndex`:Yt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Yt(e,n,r);break;case`style`:mn(e,r,o);return;case`data`:if(t!==`object`){Yt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)||r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=vn(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}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&ep(e,t,`name`,a.name,a,null),ep(e,t,`formEncType`,a.formEncType,a,null),ep(e,t,`formMethod`,a.formMethod,a,null),ep(e,t,`formTarget`,a.formTarget,a,null)):(ep(e,t,`encType`,a.encType,a,null),ep(e,t,`method`,a.method,a,null),ep(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=vn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=yn);return;case`onScroll`:r!=null&&$(`scroll`,e);return;case`onScrollEnd`:r!=null&&$(`scrollend`,e);return;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));o?.__html!==n&&(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=vn(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`credentialless`: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`:$(`beforetoggle`,e),$(`toggle`,e),Jt(e,`popover`,r);break;case`xlinkActuate`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Xt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Xt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Xt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Jt(e,`is`,r);break;case`innerText`:case`textContent`:return;default:if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)n=gn.get(n)||n,Jt(e,n,r);else return}Kt=!0}function tp(e,t,n,r,a,o){switch(n){case`style`:mn(e,r,o);return;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));o?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)dn(e,r);else if(typeof r==`number`||typeof r==`bigint`)dn(e,``+r);else return;break;case`onScroll`:r!=null&&$(`scroll`,e);return;case`onScrollEnd`:r!=null&&$(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=yn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!zt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),o=n.slice(2,a?n.length-7:void 0),t=e[Ct]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(o,t,a),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(o,r,a);break a}Kt=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Jt(e,n,r)}return}Kt=!0}function np(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:$(`error`,e),$(`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:ep(e,t,o,s,n,null)}}a&&ep(e,t,`srcSet`,n.srcSet,n,null),r&&ep(e,t,`src`,n.src,n,null);return;case`input`:$(`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:ep(e,t,r,d,n,null)}}on(e,o,c,l,u,s,a,!1);return;case`select`:for(a in $(`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:ep(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&cn(e,!!r,n,!0):cn(e,!!r,t,!1);return;case`textarea`:for(s in $(`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:ep(e,t,s,c,n,null)}un(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:ep(e,t,l,r,n,null)}return;case`dialog`:$(`beforetoggle`,e),$(`toggle`,e),$(`cancel`,e),$(`close`,e);break;case`iframe`:case`object`:$(`load`,e);break;case`video`:case`audio`:for(r=0;r<Rf.length;r++)$(Rf[r],e);break;case`image`:$(`error`,e),$(`load`,e);break;case`details`:$(`toggle`,e);break;case`embed`:case`source`:case`link`:$(`error`,e),$(`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:ep(e,t,u,r,n,null)}return;default:if(hn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&tp(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&ep(e,t,c,r,n,null))}var rp={};function ip(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)||ep(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`:m!==f&&(Kt=!0),o=m;break;case`name`:m!==f&&(Kt=!0),a=m;break;case`checked`:m!==f&&(Kt=!0),u=m;break;case`defaultChecked`:m!==f&&(Kt=!0),d=m;break;case`value`:m!==f&&(Kt=!0),s=m;break;case`defaultValue`:m!==f&&(Kt=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&ep(e,t,p,m,r,f)}}an(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)||ep(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`:o!==l&&(Kt=!0),p=o;break;case`defaultValue`:o!==l&&(Kt=!0),c=o;break;case`multiple`:o!==l&&(Kt=!0),s=o;default:o!==l&&ep(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?cn(e,!!n,n?[]:``,!1):cn(e,!!n,t,!0)):cn(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:ep(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`:a!==o&&(Kt=!0),p=a;break;case`defaultValue`:a!==o&&(Kt=!0),m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&ep(e,t,s,a,r,o)}ln(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:ep(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`:p!==m&&(Kt=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:ep(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)&&ep(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:ep(e,t,u,p,r,m)}return;default:if(hn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&tp(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||tp(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&ep(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||ep(e,t,f,p,r,m)}function ap(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function op(){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&&ap(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&&ap(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 sp=null,cp=null;function lp(e){return e.nodeType===9?e:e.ownerDocument}function up(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 dp(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 fp(e,t,n,r){return n=lp(n).createElement(e),n[St]=r,n[Ct]=t,np(n,e,t),It(n),n}function pp(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 mp=null;function hp(){var e=window.event;return e&&e.type===`popstate`?e!==mp&&(mp=e,!0):(mp=null,!1)}var gp=typeof setTimeout==`function`?setTimeout:void 0,_p=typeof clearTimeout==`function`?clearTimeout:void 0,vp=typeof Promise==`function`?Promise:void 0,yp=typeof requestAnimationFrame==`function`?requestAnimationFrame:gp,bp=typeof queueMicrotask==`function`?queueMicrotask:vp===void 0?gp:function(e){return vp.resolve(null).then(e).catch(xp)};function xp(e){setTimeout(function(){throw e})}function Sp(e){return e===`head`}function Cp(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),Hh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)_m(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,_m(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[kt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&_m(e.ownerDocument.body)}n=i}while(n);Hh(t)}function wp(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 Tp(e,t,n){if(t=CSS.escape(t)===t?t:`r-`+btoa(t).replace(/=/g,``),e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display===`inline`){if(t=e.getClientRects(),t.length===1)var r=1;else for(var i=r=0;i<t.length;i++){var a=t[i];0<a.width&&0<a.height&&r++}r===1&&(e=e.style,e.display=t.length===1?`inline-block`:`block`,e.marginTop=`-`+n.paddingTop,e.marginBottom=`-`+n.paddingBottom)}}function Ep(e,t){e=e.style,t=t.style;var n=t==null?null:t.hasOwnProperty(`viewTransitionName`)?t.viewTransitionName:t.hasOwnProperty(`view-transition-name`)?t[`view-transition-name`]:null;e.viewTransitionName=n==null||typeof n==`boolean`?``:(``+n).trim(),n=t==null?null:t.hasOwnProperty(`viewTransitionClass`)?t.viewTransitionClass:t.hasOwnProperty(`view-transition-class`)?t[`view-transition-class`]:null,e.viewTransitionClass=n==null||typeof n==`boolean`?``:(``+n).trim(),e.display===`inline-block`&&(t==null?e.display=e.margin=``:(n=t.display,e.display=n==null||typeof n==`boolean`?``:n,n=t.margin,n==null?(n=t.hasOwnProperty(`marginTop`)?t.marginTop:t[`margin-top`],e.marginTop=n==null||typeof n==`boolean`?``:n,t=t.hasOwnProperty(`marginBottom`)?t.marginBottom:t[`margin-bottom`],e.marginBottom=t==null||typeof t==`boolean`?``:t):e.margin=n))}function Dp(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position===`absolute`||t.position===`fixed`,clip:t.clipPath!==`none`||t.overflow!==`visible`||t.filter!==`none`||t.mask!==`none`||t.mask!==`none`||t.borderRadius!==`0px`,view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function Op(e){return Dp(e.getBoundingClientRect(),getComputedStyle(e),e)}function kp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Dp(t,n,e)}function Ap(e){return e.documentElement.clientHeight}function jp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Mp(e,t,n,r,i,a,o,s,c){var l=t.nodeType===9?t:t.ownerDocument;try{var u=l.startViewTransition({update:function(){var t=l.defaultView,n=t.navigation&&t.navigation.transition,o=l.fonts.status;r();var s=[];if(o===`loaded`&&(Ap(l),l.fonts.status===`loading`&&s.push(l.fonts.ready)),o=s.length,e!==null)for(var c=e.suspenseyImages,u=0,d=0;d<c.length;d++){var f=c[d];if(!f.complete){var p=f.getBoundingClientRect();if(0<p.bottom&&0<p.right&&p.top<t.innerHeight&&p.left<t.innerWidth){if(u+=Xm(f),u>$m){s.length=o;break}f=new Promise(jp.bind(f)),s.push(f)}}}if(0<s.length)return t=Promise.race([Promise.all(s),new Promise(function(e){return setTimeout(e,500)})]).then(i,i),(n?Promise.allSettled([n.finished,t]):t).then(a,a);if(i(),n)return n.finished.then(a,a);a()},types:n});l.__reactViewTransition=u;var d=[];return u.ready.then(function(){for(var e=l.documentElement.getAnimations({subtree:!0}),t=0;t<e.length;t++){var n=e[t],r=n.effect,i=r.pseudoElement;if(i!=null&&i.startsWith(`::view-transition`)){d.push(n),n=r.getKeyframes();for(var a=i=void 0,s=!0,c=0;c<n.length;c++){var u=n[c],f=u.width;if(i===void 0)i=f;else if(i!==f){s=!1;break}if(f=u.height,a===void 0)a=f;else if(a!==f){s=!1;break}delete u.width,delete u.height,u.transform===`none`&&delete u.transform}s&&i!==void 0&&a!==void 0&&(r.setKeyframes(n),s=getComputedStyle(r.target,r.pseudoElement),s.width!==i||s.height!==a)&&(s=n[0],s.width=i,s.height=a,s=n[n.length-1],s.width=i,s.height=a,r.setKeyframes(n))}}o()},function(e){l.__reactViewTransition===u&&(l.__reactViewTransition=null);try{if(typeof e==`object`&&e)switch(e.name){case`InvalidStateError`:(e.message===`View transition was skipped because document visibility state is hidden.`||e.message===`Skipping view transition because document visibility state has become hidden.`||e.message===`Skipping view transition because viewport size changed.`||e.message===`Transition was aborted because of invalid state`)&&(e=null)}e!==null&&c(e)}finally{r(),i(),o()}}),u.finished.finally(function(){for(var e=0;e<d.length;e++)d[e].cancel();l.__reactViewTransition===u&&(l.__reactViewTransition=null),s()}),u}catch{return r(),i(),o(),null}}function Np(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Np.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:T({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Np.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),r=[],i=0;i<n.length;i++){var a=n[i].effect;a!==null&&a.target===e&&a.pseudoElement===t&&r.push(n[i])}return r},Np.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Pp(e){return{name:e,group:new Np(`group`,e),imagePair:new Np(`image-pair`,e),old:new Np(`old`,e),new:new Np(`new`,e)}}function Fp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Fp.prototype.addEventListener=function(e,t,n){var r=null,i=null;if(!(n!=null&&typeof n!=`boolean`&&(r=n.signal||null,r!==null&&r.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var a=this._eventListeners;if(Bp(a,e,t,n)===-1){var o=this,s=t;n!=null&&typeof n!=`boolean`&&!0===n.once&&(s=function(r){o.removeEventListener(e,t,n),typeof t==`function`?t.call(this,r):t.handleEvent(r)}),r!==null&&(i=o.removeEventListener.bind(o,e,t,n),r.addEventListener(`abort`,i,{once:!0}),i=r.removeEventListener.bind(r,`abort`,i)),r=Rp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),p(this._fragmentFiber.child,!1,Ip,e,s,r)}this._eventListeners=a}};function Ip(e,t,n,r){return v(e).addEventListener(t,n,r),!1}Fp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Bp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=Rp(i.optionsOrUseCapture),p(this._fragmentFiber.child,!1,Lp,e,n,i),r.splice(t,1),a!==null&&a()}};function Lp(e,t,n,r){return v(e).removeEventListener(t,n,r),!1}function Rp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function zp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Bp(e,t,n,r){if(e.length===0)return-1;r=zp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&zp(a.optionsOrUseCapture)===r)return i}return-1}Fp.prototype.dispatchEvent=function(e){var t=m(this._fragmentFiber);if(t===null)return!0;t=v(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var r=t.nodeType===9?t.createComment(``):document.createTextNode(``);if(n)for(var i=0;i<n.length;i++){var a=n[i];r.addEventListener(a.type,a.attachedListener,Rp(a.optionsOrUseCapture))}if(t.appendChild(r),e=r.dispatchEvent(e),n)for(i=0;i<n.length;i++)a=n[i],r.removeEventListener(a.type,a.attachedListener,Rp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Fp.prototype.focus=function(e){p(this._fragmentFiber.child,!0,Vp,e,void 0,void 0)};function Vp(e,t){return e.tag!==6&&(e=v(e),pm(e,t))}Fp.prototype.focusLast=function(e){var t=[];p(this._fragmentFiber.child,!0,Hp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Vp(t[n],e);n--);};function Hp(e,t){return t.push(e),!1}Fp.prototype.blur=function(){var e=m(this._fragmentFiber);e!==null&&(e=v(e),e=lp(e).activeElement,e!==null&&p(this._fragmentFiber.child,!1,Up,e,void 0,void 0))};function Up(e,t){return e.tag!==6&&(e=v(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Fp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),p(this._fragmentFiber.child,!1,Wp,e,void 0,void 0)};function Wp(e,t){return e.tag===6||(e=v(e),t.observe(e)),!1}Fp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),p(this._fragmentFiber.child,!1,Gp,e,void 0,void 0);for(var n=t=0;n<Kp.length;n++){var r=Kp[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):Kp[t++]=r}Kp.length=t}};function Gp(e,t){return e.tag===6||(e=v(e),t.unobserve(e)),!1}var Kp=[],qp=!1;function Jp(e,t,n){Kp.push({fragmentInstance:e,observer:t,instance:n}),qp||(qp=!0,mm(function(){qp=!1;var e=Kp;Kp=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Fp.prototype.getClientRects=function(){var e=[];return p(this._fragmentFiber.child,!1,Yp,e,void 0,void 0),e};function Yp(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=v(e),t.push.apply(t,e.getClientRects());return!1}Fp.prototype.getRootNode=function(e){var t=m(this._fragmentFiber);return t===null?this:v(t).getRootNode(e)},Fp.prototype.compareDocumentPosition=function(e){var t=m(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];p(this._fragmentFiber.child,!1,Hp,n,void 0,void 0);var r=v(t);if(n.length===0){if(n=r,h(this._fragmentFiber)){a:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break a}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var i=r=n.compareDocumentPosition(e);return n===e?i=Node.DOCUMENT_POSITION_CONTAINS:r&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=g(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=v(n).compareDocumentPosition(e),i=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),i|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=v(n[0]),i=v(n[n.length-1]);var a=h(this._fragmentFiber)?t.parentElement:r;if(a==null)return Node.DOCUMENT_POSITION_DISCONNECTED;r=a.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,a=a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY;var o=t.compareDocumentPosition(e),s=i.compareDocumentPosition(e),c=o&Node.DOCUMENT_POSITION_CONTAINED_BY||s&Node.DOCUMENT_POSITION_CONTAINED_BY;return s=r&&a&&o&Node.DOCUMENT_POSITION_FOLLOWING&&s&Node.DOCUMENT_POSITION_PRECEDING,t=r&&t===e||a&&i===e||c||s?Node.DOCUMENT_POSITION_CONTAINED_BY:!r&&t===e||!a&&i===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:o,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||Xp(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function Xp(e,t,n,r,i){var a=Mt(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!a)a:{for(;a!==null;){if(a.tag===7&&(a===t||a.alternate===t)){n=!0;break a}a=a.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(a===null)return a=i.ownerDocument,i===a||i===a.documentElement||i===a.body;a:{for(a=t,t=m(t);a!==null;){if(!(a.tag!==5&&a.tag!==3&&a.tag!==27||a!==t&&a.alternate!==t)){a=!0;break a}a=a.return}a=!1}return a}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!a)&&!(t=a===n)&&(t=w(n,a,C),t===null?t=!1:(p(t,!0,x,a,n),a=y,y=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=w(r,a,C),t===null?t=!1:(p(t,!0,S,a,r),a=y,b=y=null,t=a!==null)),t):!1}function Zp(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Fp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];p(this._fragmentFiber.child,!1,Hp,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=g(this._fragmentFiber);if(r=n?r[1]||r[0]||m(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=v(r),Zp(e,n);return}if(r=v(r),r.nodeType!==9){if(r.nodeType===11){n=`host`in r?r.host:null,n!==null&&n.scrollIntoView(e);return}r.scrollIntoView(e)}}for(r=n?t.length-1:0;r!==(n?-1:t.length);){var a=t[r];a.tag===6?(a=v(a),Zp(a,n)):v(a).scrollIntoView(e),r+=n?-1:1}};function Qp(e,t){return e=v(e),$p(e,t),!1}function $p(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function em(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.addEventListener(i.type,i.attachedListener,Rp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<Kp.length;i++){var a=Kp[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(Kp[r++]=a)}Kp.length=r,n.observe(e)}),$p(e,t))}function tm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.removeEventListener(i.type,i.attachedListener,Rp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?Jp(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function nm(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`:nm(n),jt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function rm(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[kt])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=lm(e.nextSibling),e===null)break}return null}function im(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=lm(e.nextSibling),e===null))return null;return e}function am(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=lm(e.nextSibling),e===null))return null;return e}function om(e){return e.data===`$?`||e.data===`$~`}function sm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function cm(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 lm(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 um=null;function dm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return lm(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function fm(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 pm(e,t){function n(){r=!0}if(e.ownerDocument.activeElement===e)return!0;var r=!1;try{e.ownerDocument.addEventListener(`focus`,n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener(`focus`,n,!0)}return r}function mm(e){yp(function(){yp(function(t){return e(t)})})}function hm(e,t,n){switch(t=lp(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 gm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&ep(e,t,r,null,rp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===yn&&(e.onclick=null),jt(e)}function _m(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);jt(e)}var vm=new Map,ym=new Set;function bm(e){if(typeof e.getRootNode==`function`){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var xm=P.d;P.d={f:Sm,r:Cm,D:Em,C:Dm,L:Om,m:km,X:jm,S:Am,M:Mm};function Sm(){var e=xm.f(),t=Bd();return e||t}function Cm(e){var t=Nt(e);t!==null&&t.tag===5&&t.type===`form`?ec(t):xm.r(e)}var wm=typeof document>`u`?null:document;function Tm(e,t,n){var r=wm;if(r&&typeof t==`string`&&t){var i=rn(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),ym.has(i)||(ym.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),np(t,`link`,e),It(t),r.head.appendChild(t)))}}function Em(e){xm.D(e),Tm(`dns-prefetch`,e,null)}function Dm(e,t){xm.C(e,t),Tm(`preconnect`,e,t)}function Om(e,t,n){xm.L(e,t,n);var r=wm;if(r&&e&&t){var i=`link[rel="preload"][as="`+rn(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+rn(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+rn(n.imageSizes)+`"]`)):i+=`[href="`+rn(e)+`"]`;var a=i;switch(t){case`style`:a=Pm(e);break;case`script`:a=Rm(e)}if(!(vm.has(a)||(e=T({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),vm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Fm(a))||t===`script`&&r.querySelector(zm(a))))){var o=r.createElement(`link`);np(o,`link`,e),t===`style`&&(o[At]=!0,o.onload=o.onerror=function(){Lt(o)}),It(o),r.head.appendChild(o)}}}function km(e,t){xm.m(e,t);var n=wm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+rn(r)+`"][href="`+rn(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Rm(e)}if(!vm.has(a)&&(e=T({rel:`modulepreload`,href:e},t),vm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(zm(a)))return}r=n.createElement(`link`),np(r,`link`,e),It(r),n.head.appendChild(r)}}}function Am(e,t,n){xm.S(e,t,n);var r=wm;if(r&&e){var i=Ft(r).hoistableStyles,a=Pm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Fm(a)))s.loading=5;else{e=T({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=vm.get(a))&&Hm(e,n);var c=o=r.createElement(`link`);It(c),np(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,Vm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function jm(e,t){xm.X(e,t);var n=wm;if(n&&e){var r=Ft(n).hoistableScripts,i=Rm(e),a=r.get(i);a||(a=n.querySelector(zm(i)),a||(e=T({src:e,async:!0},t),(t=vm.get(i))&&Um(e,t),a=n.createElement(`script`),It(a),np(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Mm(e,t){xm.M(e,t);var n=wm;if(n&&e){var r=Ft(n).hoistableScripts,i=Rm(e),a=r.get(i);a||(a=n.querySelector(zm(i)),a||(e=T({src:e,async:!0,type:`module`},t),(t=vm.get(i))&&Um(e,t),a=n.createElement(`script`),It(a),np(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Nm(e,t,n,r){var a=(a=xe.current)?bm(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`?(n=Pm(n.href),t=Ft(a).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,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=Pm(n.href);var o=Ft(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(Fm(e)))?o._p||(s.instance=o,s.state.loading=5):(o=vm.get(e),o||(o={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},vm.set(e,o)),Lm(a,e,o,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`?(n=Rm(n),t=Ft(a).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Pm(e){return`href="`+rn(e)+`"`}function Fm(e){return`link[rel="stylesheet"][`+e+`]`}function Im(e){return T({},e,{"data-precedence":e.precedence,precedence:null})}function Lm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[At]){r.loading=1;return}}else t=e.createElement(`link`),t[At]=!0,t.onload=t.onerror=Lt.bind(null,t),np(t,`link`,n),It(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function Rm(e){return`[src="`+rn(e)+`"]`}function zm(e){return`script[async]`+e}function Bm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+rn(n.href)+`"]`);if(r)return t.instance=r,It(r),r;var a=T({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),It(r),np(r,`style`,a),Vm(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Pm(n.href);var o=e.querySelector(Fm(a));if(o)return t.state.loading|=4,t.instance=o,It(o),o;r=Im(n),(a=vm.get(a))&&Hm(r,a),o=(e.ownerDocument||e).createElement(`link`),It(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),np(o,`link`,r),t.state.loading|=4,Vm(o,n.precedence,e),t.instance=o;case`script`:return o=Rm(n.src),(a=e.querySelector(zm(o)))?(t.instance=a,It(a),a):(r=n,(a=vm.get(o))&&(r=T({},n),Um(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),It(a),np(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,Vm(r,n.precedence,e));return t.instance}function Vm(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 Hm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Um(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Wm=null;function Gm(e,t,n){if(Wm===null){var r=new Map,i=Wm=new Map;i.set(n,r)}else i=Wm,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[kt]||a[St]||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 Km(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function qm(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 Jm(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function Ym(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Xm(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function Zm(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=Xm(t),e.suspenseyImages.push(t)),e=rh.bind(e),t.decode().then(e,e))}function Qm(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=Pm(r.href),a=t.querySelector(Fm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=nh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,It(a);return}a=t.ownerDocument||t,r=Im(r),(i=vm.get(i))&&Hm(r,i),a=a.createElement(`link`),It(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),np(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=nh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var $m=0;function eh(e,t){return e.stylesheets&&e.count===0&&ah(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&ah(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&$m===0&&($m=62500*op());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ah(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>$m?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function th(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)ah(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function nh(){this.count--,th(this)}function rh(){this.imgCount--,th(this)}var ih=null;function ah(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ih=new Map,t.forEach(oh,e),ih=null,nh.call(e))}function oh(e,t){if(!(t.state.loading&4)){var n=ih.get(e);if(n)var r=n.get(null);else{n=new Map,ih.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=nh.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 sh={$$typeof:ne,Provider:null,Consumer:null,_currentValue:ge,_currentValue2:ge,_threadCount:0};function ch(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=dt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=dt(0),this.hiddenUpdates=dt(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.transitionTypes=null,this.incompleteTransitions=new Map}function lh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new ch(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Ni(3,null,null,t),e.current=a,a.stateNode=e,t=ja(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},uo(a),e}function uh(e){return e?(e=ji,e):ji}function dh(e,t,n,r,i,a){i=uh(i),r.context===null?r.context=i:r.pendingContext=i,r=po(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=mo(e,r,t),n!==null&&(Fd(n,e,t),ho(n,e,t))}function fh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ph(e,t){fh(e,t),(e=e.alternate)&&fh(e,t)}function mh(e){if(e.tag===13||e.tag===31){var t=Oi(e,67108864);t!==null&&Fd(t,e,67108864),ph(e,67108864)}}function hh(e){if(e.tag===13||e.tag===31){var t=Md();t=_t(t);var n=Oi(e,t);n!==null&&Fd(n,e,t),ph(e,t)}}var gh=!0;function _h(e,t,n,r){var i=N.T;N.T=null;var a=P.p;try{P.p=2,yh(e,t,n,r)}finally{P.p=a,N.T=i}}function vh(e,t,n,r){var i=N.T;N.T=null;var a=P.p;try{P.p=8,yh(e,t,n,r)}finally{P.p=a,N.T=i}}function yh(e,t,n,r){if(gh){var i=bh(r);if(i===null)Gf(e,t,r,xh,n),Mh(e,r);else if(Ph(i,e,t,n,r))r.stopPropagation();else if(Mh(e,r),t&4&&-1<jh.indexOf(e)){for(;i!==null;){var a=Nt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=rt(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Xe(o);s.entanglements[1]|=c,o&=~c}Df(a),!(Qu&6)&&(_d=Re()+500,Of(0,!1))}}break;case 31:case 13:s=Oi(a,2),s!==null&&Fd(s,a,2),Bd(),ph(a,2)}if(a=bh(r),a===null&&Gf(e,t,r,xh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Gf(e,t,r,null,n)}}function bh(e){return e=xn(e),Sh(e)}var xh=null;function Sh(e){if(xh=null,e=Mt(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 xh=e,null}function Ch(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`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`fullscreenerror`: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`resize`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(ze()){case Be:return 2;case Ve:return 8;case He:case Ue:return 32;case We:return 268435456;default:return 32}default:return 32}}var wh=!1,Th=null,Eh=null,Dh=null,Oh=new Map,kh=new Map,Ah=[],jh=`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 Mh(e,t){switch(e){case`focusin`:case`focusout`:Th=null;break;case`dragenter`:case`dragleave`:Eh=null;break;case`mouseover`:case`mouseout`:Dh=null;break;case`pointerover`:case`pointerout`:Oh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:kh.delete(t.pointerId)}}function Nh(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=Nt(t),t!==null&&mh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Ph(e,t,n,r,i){switch(t){case`focusin`:return Th=Nh(Th,e,t,n,r,i),!0;case`dragenter`:return Eh=Nh(Eh,e,t,n,r,i),!0;case`mouseover`:return Dh=Nh(Dh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Oh.set(a,Nh(Oh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,kh.set(a,Nh(kh.get(a)||null,e,t,n,r,i)),!0}return!1}function Fh(e){var t=Mt(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,bt(e.priority,function(){hh(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,bt(e.priority,function(){hh(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 Ih(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=bh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);bn=r,n.target.dispatchEvent(r),bn=null}else return t=Nt(n),t!==null&&mh(t),e.blockedOn=n,!1;t.shift()}return!0}function Lh(e,t,n){Ih(e)&&n.delete(t)}function Rh(){wh=!1,Th!==null&&Ih(Th)&&(Th=null),Eh!==null&&Ih(Eh)&&(Eh=null),Dh!==null&&Ih(Dh)&&(Dh=null),Oh.forEach(Lh),kh.forEach(Lh)}function zh(e,n){e.blockedOn===n&&(e.blockedOn=null,wh||(wh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Rh)))}var Bh=null;function Vh(e){Bh!==e&&(Bh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Bh===e&&(Bh=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(Sh(r||n)===null)continue;break}var a=Nt(n);a!==null&&(e.splice(t,3),t-=3,Qs(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Hh(e){function t(t){return zh(t,e)}Th!==null&&zh(Th,e),Eh!==null&&zh(Eh,e),Dh!==null&&zh(Dh,e),Oh.forEach(t),kh.forEach(t);for(var n=0;n<Ah.length;n++){var r=Ah[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Ah.length&&(n=Ah[0],n.blockedOn===null);)Fh(n),n.blockedOn===null&&Ah.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[Ct]||null;if(typeof a==`function`)o||Vh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[Ct]||null)s=o.formAction;else if(Sh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Vh(n)}}}function Uh(){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 Wh(e){this._internalRoot=e}Gh.prototype.render=Wh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;dh(n,Md(),e,t,null,null)},Gh.prototype.unmount=Wh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;dh(e.current,2,null,e,null,null),Bd(),t[wt]=null}};function Gh(e){this._internalRoot=e}Gh.prototype.unstable_scheduleHydration=function(e){if(e){var t=yt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ah.length&&t!==0&&t<Ah[n].priority;n++);Ah.splice(n,0,e),n===0&&Fh(e)}};var Kh=n.version;if(Kh!==`19.3.1`)throw Error(i(527,Kh,`19.3.1`));P.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:f(e),e=e===null?null:e.stateNode,e};var qh={bundleType:0,version:`19.3.1`,rendererPackageName:`react-dom`,currentDispatcherRef:N,reconcilerVersion:`19.3.1`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Jh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Jh.isDisabled&&Jh.supportsFiber)try{qe=Jh.inject(qh),Je=Jh}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=xc,s=Sc,c=Cc;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=lh(e,1,!1,null,null,n,r,null,o,s,c,Uh),e[wt]=t.current,Uf(e),new Wh(t)}})),lt=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=ct()})),ut=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,dt=/^[\\/]{2}/;function ft(e,t){return t+e.replace(/\\/g,`/`)}var pt=`popstate`;function mt(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function ht(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return bt(``,{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:xt(t)}return Ct(t,n,null,e)}function gt(e,t){if(e===!1||e==null)throw Error(t)}function _t(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function vt(){return Math.random().toString(36).substring(2,10)}function yt(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 bt(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?St(t):t,state:n,key:t&&t.key||r||vt(),mask:i}}function xt({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 St(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 Ct(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=mt(e)?e:bt(h.location,e,t);n&&n(r,e),l=u()+1;let d=yt(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=mt(e)?e:bt(h.location,e,t);n&&n(r,e),l=u();let i=yt(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 wt(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(pt,d),c=e,()=>{i.removeEventListener(pt,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 wt(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),gt(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:xt(t);return i=i.replace(/ $/,`%20`),!n&&dt.test(i)&&(i=r+i),new URL(i,r)}var Tt=new URL(`http://localhost`);function Et(e){if(e.createURL)return e.createURL(`/`);try{return new URL(e.createHref(`/`),Tt)}catch{return Tt}}function Dt(e,t){return e.origin===t.origin&&(e.origin!==`null`||e.protocol===t.protocol&&e.host===t.host)}function Ot(e,t){if(e.startsWith(`//`))return!0;let n=t.protocol.toLowerCase();return e.toLowerCase().startsWith(n)?t.host===``||e.slice(n.length).startsWith(`//`):!1}function kt(e){let t=e.replace(/[\t\n\r]/g,``),n=0;for(;t.charCodeAt(n)<=32;)n++;if(t=t.slice(n),!ut.test(t))return;let r;try{r=new URL(e,Tt)}catch{return}if(!Ot(e,r))throw Error(`External navigation is not allowed`)}function At(e,t,n,r){let i=null;try{i=e==null?null:new URL(e,n)}catch{}let a=new URL(t,n),o=i!=null&&!Dt(i,n),s=!Dt(a,n);if(r===`reject`){if(o||s)throw Error(`External navigation is not allowed`)}else if(s&&(i==null||!Ot(e,i)||!Dt(i,a)))throw Error(`External navigation is not allowed`)}function jt(e,t,n=`/`){return Mt(e,t,n,!1)}function Mt(e,t,n,r,i){let a=$t((typeof t==`string`?St(t):t).pathname||`/`,n);if(a==null)return null;let o=i??Nt(e),s=null,c=Qt(a);for(let e=0;s==null&&e<o.length;++e)s=Jt(o[e],c,r);return s}function Nt(e){let t=Pt(e);return It(t),t}function Pt(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;gt(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" 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=cn([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(gt(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),Pt(e.children,t,u,l,o)),(e.path!=null||e.index)&&t.push({path:l,score:Kt(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=Zt(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 Ft(e.path))a(e,t,!0,n)}),t}function Ft(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=Ft(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 It(e){e.sort((e,t)=>e.score===t.score?qt(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var Lt=/^:[\w-]+$/,Rt=/^:[\w-]+/,zt=3.5,Bt=3,Vt=2,Ht=1,Ut=10,Wt=-2,Gt=e=>e===`*`;function Kt(e,t){let n=e.split(`/`),r=n.length;return n.some(Gt)&&(r+=Wt),t&&(r+=Vt),n.filter(e=>!Gt(e)).reduce((e,t)=>e+(Lt.test(t)?Bt:Rt.test(t)?zt:t===``?Ht:Ut),r)}function qt(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 Jt(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?Xt(u,l,s.matcher,s.compiledParams):Yt(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=Yt({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:cn([a,d.pathname]),pathnameBase:un(cn([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=cn([a,d.pathnameBase]))}return o}function Yt(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Zt(e.path,e.caseSensitive,e.end);return Xt(e,t,n,r)}function Xt(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=ln(a,1),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=ln(a.slice(0,a.length-e.length),1)}let i=s[r];return e[t]=n&&!i?void 0:(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function Zt(e,t=!1,n=!0){_t(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(/\/((?:[^/?()[\]*^\\]|\\.)+)\?(?=\/|$|\()/g,`(?:/$1)?`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function Qt(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return _t(!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 $t(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 en(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?St(e):e,a;return n?(n=sn(n),a=n.startsWith(`/`)||n.startsWith(`\\`)?tn(n.substring(1),`/`):tn(n,t)):a=t,{pathname:a,search:dn(r),hash:fn(i)}}function tn(e,t){let n=ln(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function nn(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 rn(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function an(e){let t=rn(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function on(e,t,n,r=!1){let i;typeof e==`string`?i=St(e):(i={...e},gt(!i.pathname||!i.pathname.includes(`?`),nn(`?`,`pathname`,`search`,i)),gt(!i.pathname||!i.pathname.includes(`#`),nn(`#`,`pathname`,`hash`,i)),gt(!i.search||!i.search.includes(`#`),nn(`#`,`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=en(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var sn=e=>e.replace(/[\\/]{2,}/g,`/`),cn=e=>sn(e.join(`/`));function ln(e,t=0){let n=e.length;for(;n>t&&e.charCodeAt(n-1)===47;)n--;return n===e.length?e:e.slice(0,n)}var un=e=>ln(e).replace(/^\/*/,`/`),dn=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,fn=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,pn=class{status;statusText;data;error;internal;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 mn(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function hn(e){return cn(e.map(e=>e.route.path).filter(Boolean))||`/`}var gn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function _n(e,t){let n=e;if(typeof n!=`string`||!ut.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(gn)try{let e=new URL(window.location.href),r=dt.test(n)?new URL(ft(n,e.protocol)):new URL(n),a=$t(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{_t(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}var vn=[`POST`,`PUT`,`PATCH`,`DELETE`];new Set(vn);var yn=[`GET`,...vn];new Set(yn);var bn=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function xn(e){try{return bn.includes(new URL(e).protocol)}catch{return!1}}var Sn=d.createContext(null);Sn.displayName=`DataRouter`;var Cn=d.createContext(null);Cn.displayName=`DataRouterState`;var wn=d.createContext(null);wn.displayName=`DataRouterData`;var Tn=d.createContext(null);Tn.displayName=`DataRouterNavigation`;var En=d.createContext(!1);function Dn(){return d.useContext(En)}var On=d.createContext({isTransitioning:!1});On.displayName=`ViewTransition`;var kn=d.createContext(null);kn.displayName=`Fetchers`;var An=d.createContext(null);An.displayName=`Await`;var jn=d.createContext(null);jn.displayName=`Navigation`;var Mn=d.createContext(null);Mn.displayName=`Location`;var Nn=d.createContext({outlet:null,matches:[],isDataRoute:!1});Nn.displayName=`Route`;var Pn=d.createContext(!1);Pn.displayName=`IsDataRoute`;var Fn=d.createContext(void 0);Fn.displayName=`RouteId`;var In=d.createContext(null);In.displayName=`RouteError`;var Ln=`REACT_ROUTER_ERROR`,Rn=`REDIRECT`,zn=`ROUTE_ERROR_RESPONSE`;function Bn(e){if(e.startsWith(`${Ln}:${Rn}:{`))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 Vn(e){if(e.startsWith(`${Ln}:${zn}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new pn(t.status,t.statusText,t.data)}catch{}}function Hn(e,{relative:t}={}){gt(Un(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=d.useContext(jn),{hash:i,pathname:a,search:o}=Zn(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:cn([n,a])),r.createHref({pathname:s,search:o,hash:i})}function Un(){return d.useContext(Mn)!=null}function Wn(){return gt(Un(),`useLocation() may be used only in the context of a <Router> component.`),d.useContext(Mn).location}var Gn=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function Kn(){return d.useContext(Pn)?pr():qn()}function qn(){gt(Un(),`useNavigate() may be used only in the context of a <Router> component.`);let e=d.useContext(Sn),{basename:t,navigator:n}=d.useContext(jn),{matches:r}=d.useContext(Nn),{pathname:i}=Wn(),a=JSON.stringify(an(r)),o=d.useRef(!1);return d.useLayoutEffect(()=>{o.current=!0}),d.useCallback((r,s={})=>{if(_t(o.current,Gn),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=on(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:cn([t,c.pathname])),At(typeof r==`string`?r:xt(r),n.createHref(c),Et(n),`reject`),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}var Jn=d.createContext(null);function Yn(e){let t=d.useContext(Nn).outlet;return d.useMemo(()=>t&&d.createElement(Jn.Provider,{value:e},t),[t,e])}function Xn(){let{matches:e}=d.useContext(Nn);return e[e.length-1]?.params??{}}function Zn(e,{relative:t}={}){let{matches:n}=d.useContext(Nn),{pathname:r}=Wn(),i=JSON.stringify(an(n));return d.useMemo(()=>on(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function Qn(e,t){return $n(e,t)}function $n(e,t,n){gt(Un(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=d.useContext(jn),{matches:i}=d.useContext(Nn),a=i[i.length-1],o=a?a.params:{};a&&a.pathname;let s=a?a.pathnameBase:`/`;a&&a.route;let c=Wn(),l;if(t){let e=typeof t==`string`?St(t):t;gt(s===`/`||e.pathname?.startsWith(s),`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 "${s}" but pathname "${e.pathname}" was given in the \`location\` prop.`),l=e}else l=c;let u=l.pathname||`/`,f=u;if(s!==`/`){let e=s.replace(/^\//,``).split(`/`);f=`/`+u.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let p;p=n?n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):n.router.match(n.state.location):jt(e,{pathname:f});let m=or(p&&p.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:cn([s,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?s:cn([s,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&m?d.createElement(Mn.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...l},navigationType:`POP`}},m):m}function er(){let e=fr(),t=mn(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null;return d.createElement(d.Fragment,null,d.createElement(`h2`,null,`Unexpected Application Error!`),d.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?d.createElement(`pre`,{style:{padding:`0.5rem`,backgroundColor:`rgba(200,200,200, 0.5)`}},n):null,null)}var tr=d.createElement(er,null),nr=class extends d.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static contextType=En;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=Vn(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:d.createElement(Nn.Provider,{value:this.props.routeContext},d.createElement(Pn.Provider,{value:this.props.routeContext.isDataRoute},d.createElement(Fn.Provider,{value:this.props.routeContext.matches[this.props.routeContext.matches.length-1]?.route.id},d.createElement(In.Provider,{value:e,children:this.props.component}))));return this.context?d.createElement(ir,{error:e},t):t}},rr=new WeakMap;function ir({children:e,error:t}){let{basename:n,navigator:r}=d.useContext(jn);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=Bn(t.digest);if(e){let i=rr.get(t);if(i)throw i;let a=_n(e.location,n),o=a.absoluteURL||a.to;if(At(e.location,o,Et(r),`allow-explicit`),xn(o))throw Error(`Invalid redirect location`);if(gn&&!rr.get(t)){if(a.isExternal||e.reloadDocument)window.location.href=o;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:e.replace}));throw rr.set(t,n),n}}return d.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${o}`})}}return e}function ar({routeContext:e,match:t,children:n}){let r=d.useContext(Sn);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),d.createElement(Nn.Provider,{value:e},d.createElement(Pn.Provider,{value:e.isDataRoute},d.createElement(Fn.Provider,{value:t.route.id},n)))}function or(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);gt(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:hn(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let u,f=!1,p=null,m=null;r&&(u=a&&n.route.id?a[n.route.id]:void 0,p=n.route.errorElement||tr,o&&(s<0&&c===0?(hr(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),f=!0,m=null):s===c&&(f=!0,m=n.route.hydrateFallbackElement||null)));let h=t.concat(i.slice(0,c+1)),g=()=>{let t;return t=u?p:f?m:n.route.Component?d.createElement(n.route.Component,null):n.route.element?n.route.element:e,d.createElement(ar,{match:n,routeContext:{outlet:e,matches:h,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?d.createElement(nr,{location:r.location,revalidation:r.revalidation,component:p,error:u,children:g(),routeContext:{outlet:null,matches:h,isDataRoute:!0},onError:l}):g()},null)}function sr(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function cr(e){let t=d.useContext(Sn);return gt(t,sr(e)),t}function lr(e){let t=d.useContext(Cn);return gt(t,sr(e)),t}function ur(e){let t=d.useContext(wn);return gt(t,sr(e)),t}function dr(e){let t=d.useContext(Fn);return gt(t,`${e} can only be used on routes that contain a unique "id"`),t}function fr(){let e=d.useContext(In),t=ur(`useRouteError`),n=dr(`useRouteError`);return e===void 0?t.errors?.[n]:e}function pr(){let{router:e}=cr(`useNavigate`),t=dr(`useNavigate`),n=d.useRef(!1);return d.useLayoutEffect(()=>{n.current=!0}),d.useCallback(async(r,i={})=>{_t(n.current,Gn),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var mr={};function hr(e,t,n){!t&&!mr[e]&&(mr[e]=!0,_t(!1,n))}function gr(e,t){if(e===!1||e==null)throw Error(t)}function _r(e,t,n){let r=typeof e==`string`?new URL(e,n??(typeof window>`u`?`server://singlefetch/`:window.location.origin)):new URL(e);return n&&r.origin!==n&&(r=new URL(r.pathname+r.search+r.hash,n)),r.pathname.endsWith(`/`)?r.pathname=`${r.pathname}_.${t}`:r.pathname=`${r.pathname}.${t}`,r}async function vr(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function yr(e){return e!=null&&typeof e.page==`string`}function br(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 xr(e,t,n){return Er((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await vr(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(br).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function Sr(e,t,n,r,i,a){let o=(e,t)=>!n[t]||e.route.id!==n[t].route.id,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 Cr(e,t,{includeHydrateFallback:n}={}){return wr(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 wr(e){return[...new Set(e)]}function Tr(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function Er(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!yr(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(Tr(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}var Dr=d.createContext(void 0);Dr.displayName=`FrameworkContext`;function Or(){let e=d.useContext(Dr);return gr(e,`You must render this element inside a <HydratedRouter> element`),e}function kr(e,t){let n=d.useContext(Dr),[r,i]=d.useState(!1),[a,o]=d.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:f}=t,p=d.useRef(null);d.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return p.current&&e.observe(p.current),()=>{e.disconnect()}}},[e]),d.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let m=()=>{i(!0)},h=()=>{i(!1),o(!1)};return n?e===`intent`?[a,p,{onFocus:Ar(s,m),onBlur:Ar(c,h),onMouseEnter:Ar(l,m),onMouseLeave:Ar(u,h),onTouchStart:Ar(f,m)}]:[a,p,{}]:[!1,p,{}]}function Ar(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function jr({page:e,...t}){let n=Dn(),{nonce:r}=Or(),{router:i}=cr(`PrefetchPageLinks`),a=d.useMemo(()=>i.match(e),[i,i.routes,e]);return a?(t.nonce==null&&r&&(t={...t,nonce:r}),n?d.createElement(Nr,{page:e,matches:a,...t}):d.createElement(Pr,{page:e,matches:a,...t})):null}function Mr(e){let{manifest:t,routeModules:n}=Or(),[r,i]=d.useState([]);return d.useEffect(()=>{let r=!1;return xr(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function Nr({page:e,matches:t,...n}){let r=Wn(),{unstable_apiServerOrigin:i}=Or(),a=d.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=_r(e,`rsc`,i),a=!1,o=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?a=!0:o.push(e.route.id);return a&&o.length>0&&n.searchParams.set(`_routes`,o.join(`,`)),[i?n.toString():n.pathname+n.search]},[e,r,t,i]);return d.createElement(d.Fragment,null,a.map(e=>d.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function Pr({page:e,matches:t,...n}){let r=Wn(),{manifest:i,routeModules:a,unstable_apiServerOrigin:o}=Or(),{matches:s}=lr(`PrefetchPageLinks`),{loaderData:c}=ur(`PrefetchPageLinks`),l=d.useMemo(()=>Sr(e,t,s,i,r,`data`),[e,t,s,i,r]),u=d.useMemo(()=>Sr(e,t,s,i,r,`assets`),[e,t,s,i,r]),f=d.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,s=!1;if(t.forEach(e=>{let t=i.routes[e.route.id];t&&t.hasLoader&&(!l.some(t=>t.route.id===e.route.id)&&e.route.id in c&&a[e.route.id]?.shouldRevalidate||t.hasClientLoader?s=!0:n.add(e.route.id))}),n.size===0)return[];let u=_r(e,`data`,o);return s&&n.size>0&&u.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[o?u.toString():u.pathname+u.search]},[c,r,i,l,t,e,a,o]),p=d.useMemo(()=>Cr(u,i),[u,i]),m=Mr(u);return d.createElement(d.Fragment,null,f.map(e=>d.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),p.map(e=>d.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),m.map(({key:e,link:t})=>d.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function Fr(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}d.memo(Ir);function Ir({routes:e,manifest:t,state:n,isStatic:r,onError:i}){let a=d.useContext(Sn);gt(a,`You must render this element inside a <DataRouterContext.Provider> element`);let o=d.useContext(Dr)?.routeDiscoveryRuntime;return d.useEffect(()=>{n.initialized&&o?.markReady()},[n.initialized,o]),$n(e,void 0,{router:a.router,manifest:t,state:n,isStatic:r,onError:i})}function Lr({to:e,replace:t,state:n,relative:r}){gt(Un(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:i,navigator:a}=d.useContext(jn);_t(!i,`<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`);let{matches:o}=d.useContext(Nn),{pathname:s}=Wn(),c=Kn(),l=on(e,an(o),s,r===`path`);At(typeof e==`string`?e:xt(e),a.createHref(l),Et(a),`reject`);let u=JSON.stringify(l);return d.useEffect(()=>{c(JSON.parse(u),{replace:t,state:n,relative:r})},[c,u,r,t,n]),null}function Rr(e){return Yn(e.context)}function zr(e){gt(!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 Br({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){gt(!Un(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=d.useMemo(()=>({basename:s,navigator:i,static:a,useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=St(n));let{pathname:l=`/`,search:u=``,hash:f=``,state:p=null,key:m=`default`,mask:h}=n,g=d.useMemo(()=>{let e=$t(l,s);return e==null?null:{location:{pathname:e,search:u,hash:f,state:p,key:m,mask:h},navigationType:r}},[s,l,u,f,p,m,r,h]);return _t(g!=null,`<Router basename="${s}"> is not able to match the URL "${l}${u}${f}" because it does not start with the basename, so the <Router> won't render anything.`),g==null?null:d.createElement(jn.Provider,{value:c},d.createElement(Mn.Provider,{children:t,value:g}))}function Vr({children:e,location:t}){return Qn(Hr(e),t)}d.Component;function Hr(e,t=[]){let n=[];return d.Children.forEach(e,(e,r)=>{if(!d.isValidElement(e))return;let i=[...t,r];if(e.type===d.Fragment){n.push.apply(n,Hr(e.props.children,i));return}gt(e.type===zr,`[${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>`);let a=e.props;gt(!a.index||!a.children,`An index route cannot have child routes.`);let o={id:a.id||i.join(`-`),caseSensitive:a.caseSensitive,element:a.element,Component:a.Component,index:a.index,path:a.path,middleware:a.middleware,loader:a.loader,action:a.action,hydrateFallbackElement:a.hydrateFallbackElement,HydrateFallback:a.HydrateFallback,errorElement:a.errorElement,ErrorBoundary:a.ErrorBoundary,shouldRevalidate:a.shouldRevalidate,handle:a.handle,lazy:a.lazy};a.children&&(o.children=Hr(a.children,i)),n.push(o)}),n}var Ur=`application/x-www-form-urlencoded`;function Wr(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function Gr(e){return Wr(e)&&e.tagName.toLowerCase()===`button`}function Kr(e){return Wr(e)&&e.tagName.toLowerCase()===`form`}function qr(e){return Wr(e)&&e.tagName.toLowerCase()===`input`}function Jr(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Yr(e,t){return e.button===0&&(!t||t===`_self`)&&!Jr(e)}function Xr(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 Zr(e,t){let n=Xr(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var Qr=null;function $r(){if(Qr===null)try{new FormData(document.createElement(`form`),0),Qr=!1}catch{Qr=!0}return Qr}var ei=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function ti(e){return e!=null&&!ei.has(e)?(_t(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Ur}"`),null):e}function ni(e,t){if(t===`/`)return e;let n=St(e),r=$t(n.pathname||``,t);return r==null?null:xt({...n,pathname:r})}function ri(e,t){let n,r,i,a,o;if(Kr(e)){let o=e.getAttribute(`action`);r=o?ni(o,t):null,n=e.getAttribute(`method`)||`get`,i=ti(e.getAttribute(`enctype`))||Ur,a=new FormData(e)}else if(Gr(e)||qr(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?ni(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||`get`,i=ti(e.getAttribute(`formenctype`))||ti(o.getAttribute(`enctype`))||Ur,a=new FormData(o,e),!$r()){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(Wr(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=`get`,r=null,i=Ur,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}var ii=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{ii&&(window.__reactRouterVersion=`8`)}catch{}function ai({basename:e,children:t,useTransitions:n,window:r}){let i=d.useRef(null);i.current??=ht({window:r,v5Compat:!0});let a=i.current,[o,s]=d.useState({action:a.action,location:a.location}),c=d.useCallback(e=>{n===!1?s(e):d.startTransition(()=>s(e))},[n]);return d.useLayoutEffect(()=>a.listen(c),[a,c]),d.createElement(Br,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a,useTransitions:n})}var oi=d.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:f,defaultShouldRevalidate:p,...m},h){let{basename:g,navigator:_,useTransitions:v}=d.useContext(jn),y=typeof l==`string`&&ut.test(l),b=_n(l,g);l=b.to;let x=Hn(l,{relative:r}),S=Wn(),C=null;if(o){let e=on(o,[],S.mask?S.mask.pathname:`/`,!0);g!==`/`&&(e.pathname=e.pathname===`/`?g:cn([g,e.pathname])),C=_.createHref(e)}let[w,T,ee]=kr(n,m),E=li(l,{replace:a,mask:o,state:s,target:c,preventScrollReset:u,relative:r,viewTransition:f,defaultShouldRevalidate:p,useTransitions:v});function D(t){e&&e(t),t.defaultPrevented||E(t)}let O=!(b.isExternal||i),te=(O?C:void 0)||b.absoluteURL||x;kt(te);let k=d.createElement(`a`,{...m,...ee,href:te,onClick:O?D:e,ref:Fr(h,T),target:c,"data-discover":!y&&t===`render`?`true`:void 0});return w&&!y?d.createElement(d.Fragment,null,k,d.createElement(jr,{page:x})):k});oi.displayName=`Link`;var si=d.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=Zn(a,{relative:c.relative}),f=Wn(),p=d.useContext(Tn),{navigator:m,basename:h}=d.useContext(jn),g=p!=null&&hi(u)&&o===!0,_=m.encodeLocation?m.encodeLocation(u).pathname:u.pathname,v=f.pathname,y=p?.navigation.location?p.navigation.location.pathname:null;t||(v=v.toLowerCase(),y=y?y.toLowerCase():null,_=_.toLowerCase()),y&&h&&(y=$t(y,h)||y);let b=_!==`/`&&_.endsWith(`/`)?_.length-1:_.length,x=v===_||!r&&v.startsWith(_)&&v.charAt(b)===`/`,S=y!=null&&(y===_||!r&&y.startsWith(_)&&y.charAt(b)===`/`),C={isActive:x,isPending:S,isTransitioning:g},w=x?e:void 0,T;T=typeof n==`function`?n(C):[n,x?`active`:null,S?`pending`:null,g?`transitioning`:null].filter(Boolean).join(` `);let ee=typeof i==`function`?i(C):i;return d.createElement(oi,{...c,"aria-current":w,className:T,ref:l,style:ee,to:a,viewTransition:o},typeof s==`function`?s(C):s)});si.displayName=`NavLink`;var ci=d.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=`get`,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:f,defaultShouldRevalidate:p,...m},h)=>{let{useTransitions:g}=d.useContext(jn),_=pi(),v=mi(s,{relative:l}),y=o.toLowerCase()===`get`?`get`:`post`,b=typeof s==`string`&&ut.test(s);return d.createElement(`form`,{ref:h,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,m=()=>_(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:l,preventScrollReset:u,viewTransition:f,defaultShouldRevalidate:p});g&&n!==!1?d.startTransition(()=>m()):m()},...m,"data-discover":!b&&e===`render`?`true`:void 0})});ci.displayName=`Form`;function li(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c,useTransitions:l}={}){let u=Kn(),f=Wn(),p=Zn(e,{relative:o});return d.useCallback(m=>{if(Yr(m,t)){m.preventDefault();let t=n===void 0?xt(f)===xt(p):n,h=()=>u(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c});l?d.startTransition(()=>h()):h()}},[f,u,p,n,r,i,t,e,a,o,s,c,l])}function ui(e){_t(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=d.useRef(Xr(e)),n=d.useRef(!1),r=Wn(),i=d.useMemo(()=>Zr(r.search,n.current?null:t.current),[r.search]),a=Kn();return[i,d.useCallback((e,t)=>{let r=Xr(typeof e==`function`?e(new URLSearchParams(i)):e);n.current=!0,a(`?`+r,t)},[a,i])]}var di=0,fi=()=>`__${String(++di)}__`;function pi(){let{router:e}=cr(`useSubmit`),{basename:t}=d.useContext(jn),n=dr(`useSubmit`),r=e.fetch,i=e.navigate;return d.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=ri(e,t);a.navigate===!1?await r(a.fetcherKey||fi(),n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,relative:a.relative,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,relative:a.relative,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 mi(e,{relative:t}={}){let{basename:n}=d.useContext(jn),r=d.useContext(Nn);gt(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...Zn(e||`.`,{relative:t})},o=Wn();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}`:``}}(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:cn([n,a.pathname]));let s=xt(a);return kt(s),s}function hi(e,{relative:t}={}){let n=d.useContext(On);gt(n!=null,"`useViewTransitionState` must be used within `react-router/dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=cr(`useViewTransitionState`),i=Zn(e,{relative:t});if(!n.isTransitioning)return!1;let a=$t(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=$t(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Yt(i.pathname,o)!=null||Yt(i.pathname,a)!=null}var gi=lt(),_i=`Invariant failed`;function vi(e,t){if(!e)throw Error(_i)}function yi(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=yi(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function bi(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=yi(e))&&(r&&(r+=` `),r+=t);return r}var xi=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,Si=bi,Ci=(e,t)=>n=>{if(t?.variants==null)return Si(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=xi(t)||xi(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return Si(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},wi=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Ti=(e,t)=>({classGroupId:e,validator:t}),Ei=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Di=`-`,Oi=[],ki=`arbitrary..`,Ai=e=>{let t=Ni(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return Mi(e);let n=e.split(Di);return ji(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?wi(i,t):t:i||Oi}return n[e]||Oi}}},ji=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=ji(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(Di):e.slice(t).join(Di),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},Mi=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?ki+r:void 0})(),Ni=e=>{let{theme:t,classGroups:n}=e;return Pi(n,t)},Pi=(e,t)=>{let n=Ei();for(let r in e){let i=e[r];Fi(i,n,r,t)}return n},Fi=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];Ii(i,t,n,r)}},Ii=(e,t,n,r)=>{typeof e==`string`?Li(e,t,n):typeof e==`function`?Ri(e,t,n,r):zi(e,t,n,r)},Li=(e,t,n)=>{let r=e===``?t:Bi(t,e);r.classGroupId=n},Ri=(e,t,n,r)=>{Vi(e)?Fi(e(r),t,n,r):(t.validators===null&&(t.validators=[]),t.validators.push(Ti(n,e)))},zi=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];Fi(o,Bi(t,a),n,r)}},Bi=(e,t)=>{let n=e,r=t.split(Di),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=Ei(),n.nextPart.set(t,i)),n=i}return n},Vi=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,Hi=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},Ui=`!`,Wi=`:`,Gi=[],Ki=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),qi=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let c=e[s];if(n===0&&r===0){if(c===Wi){t.push(e.slice(i,s)),i=s+1;continue}if(c===`/`){a=s;continue}}if(c===`[`)n++;else if(c===`]`)n--;else if(c===`(`)r++;else if(c===`)`)r--;else if(c===`\\`)s++;else if(c===`"`||c===`'`)for(;++s<o;){let t=e[s];if(t===`\\`)s++;else if(t===c)break}}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(Ui)?(c=s.slice(0,-1),l=!0):s.startsWith(Ui)&&(c=s.slice(1),l=!0);let u=l&&s.startsWith(Ui)?1:0,d=a&&a>i?a-i-u:void 0;return Ki(t,l,c,d)};if(t){let e=t+Wi,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):Ki(Gi,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},Ji=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},Yi=e=>({cache:Hi(e.cacheSize),parseClassName:qi(e),sortModifiers:Ji(e),postfixLookupClassGroupIds:Xi(e),...Ai(e)}),Xi=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},Zi=/\s+/,Qi=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(Zi),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h||(g=r(p),!g)){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+Ui:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},$i=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=ea(n))&&(i&&(i+=` `),i+=r);return i},ea=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=ea(e[r]))&&(n&&(n+=` `),n+=t);return n},ta=(e,...t)=>{let n,r,i,a,o=o=>(n=Yi(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=Qi(e,n);return i(e,a),a};return a=o,(...e)=>a($i(...e))},na=[],ra=e=>{let t=t=>t[e]||na;return t.isThemeGetter=!0,t.themeKey=e,t},ia=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,aa=/^\((?:(\w[\w-]*):)?(.+)\)$/i,z=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,oa=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,sa=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|Q|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^--spacing\(.+\)|^0$/,ca=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark|contrast-color|device-cmyk|--alpha)\(.+\)$/i,la=/^(?:_*[+-]?(?:\d|\.\d)|[\w-]+\(|_*(?:inherit|initial|revert(?:-layer)?|unset)_*$)/i,ua=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,da=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,fa=e=>z.test(e),B=e=>!!e&&!Number.isNaN(Number(e)),pa=e=>!!e&&Number.isInteger(Number(e)),ma=e=>e.endsWith(`%`)&&B(e.slice(0,-1)),ha=e=>oa.test(e),ga=()=>!0,_a=e=>sa.test(e)&&!ca.test(e),va=e=>la.test(e)&&!ca.test(e),ya=()=>!1,ba=e=>ua.test(e),xa=e=>da.test(e),Sa=e=>!V(e)&&!H(e),Ca=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),wa=e=>Va(e,Ga,ya),V=e=>ia.test(e),Ta=e=>Va(e,Ka,_a),Ea=e=>Va(e,qa,va),Da=e=>Va(e,Ja,B),Oa=e=>Va(e,Xa,ga),ka=e=>Va(e,Ya,ya),Aa=e=>Va(e,Ua,ya),ja=e=>Va(e,Wa,xa),Ma=e=>Va(e,Za,ba),H=e=>aa.test(e),Na=e=>Ha(e,Ka),Pa=e=>Ha(e,qa,!0),Fa=e=>Ha(e,Ya),Ia=e=>Ha(e,Ua),La=e=>Ha(e,Ga),Ra=e=>Ha(e,Wa),za=e=>Ha(e,Za,!0),Ba=e=>Ha(e,Xa,!0),Va=(e,t,n)=>{let r=ia.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Ha=(e,t,n=!1)=>{let r=aa.exec(e);return r?r[1]?t(r[1]):n:!1},Ua=e=>e===`position`||e===`percentage`,Wa=e=>e===`image`||e===`url`,Ga=e=>e===`length`||e===`size`||e===`bg-size`,Ka=e=>e===`length`,qa=e=>e!==`color`,Ja=e=>e===`number`,Ya=e=>e===`family-name`,Xa=e=>e===`number`||e===`weight`,Za=e=>e===`shadow`,Qa=ta(()=>{let e=ra(`color`),t=ra(`font`),n=ra(`text`),r=ra(`font-weight`),i=ra(`tracking`),a=ra(`leading`),o=ra(`breakpoint`),s=ra(`container`),c=ra(`spacing`),l=ra(`radius`),u=ra(`shadow`),d=ra(`inset-shadow`),f=ra(`text-shadow`),p=ra(`drop-shadow`),m=ra(`blur`),h=ra(`perspective`),g=ra(`aspect`),_=ra(`ease`),v=ra(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),H,V],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[H,V,c],T=()=>[fa,`full`,`auto`,...w()],ee=()=>[pa,`none`,`subgrid`,H,V],E=()=>[`auto`,{span:[`full`,pa,H,V]},pa,H,V],D=()=>[pa,`auto`,H,V],O=()=>[`auto`,`min`,`max`,`fr`,H,V],te=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],k=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],A=()=>[`auto`,...w()],ne=()=>[fa,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],re=()=>[s,fa,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],ie=()=>[fa,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],j=()=>[e,H,V],ae=()=>[...b(),Ia,Aa,{position:[H,V]}],oe=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],se=()=>[`auto`,`cover`,`contain`,La,wa,{size:[H,V]}],ce=()=>[ma,Na,Ta],le=()=>[``,`none`,`full`,l,H,V],ue=()=>[``,B,Na,Ta],de=()=>[`solid`,`dashed`,`dotted`,`double`],fe=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],M=()=>[B,ma,Pa,Ea],pe=()=>[``,`none`,m,H,V],me=()=>[`none`,B,H,V],he=()=>[`none`,B,H,V],N=()=>[B,H,V],P=()=>[fa,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[ha],breakpoint:[ha],color:[ga],container:[ha],"drop-shadow":[ha],ease:[`in`,`out`,`in-out`],font:[Sa],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[ha],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[ha],shadow:[ha],spacing:[`px`,B],text:[ha],"text-shadow":[ha],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,fa,V,H,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,H,V]}],"container-named":[Ca],columns:[{columns:[B,`auto`,V,H,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`],"not-sr":[`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[pa,`auto`,H,V]}],basis:[{basis:[fa,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[B,fa,`auto`,`initial`,`none`,H,V]}],grow:[{grow:[``,B,H,V]}],shrink:[{shrink:[``,B,H,V]}],order:[{order:[pa,`first`,`last`,`none`,H,V]}],"grid-cols":[{"grid-cols":ee()}],"col-start-end":[{col:E()}],"col-start":[{"col-start":D()}],"col-end":[{"col-end":D()}],"grid-rows":[{"grid-rows":ee()}],"row-start-end":[{row:E()}],"row-start":[{"row-start":D()}],"row-end":[{"row-end":D()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":O()}],"auto-rows":[{"auto-rows":O()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...te(),`normal`]}],"justify-items":[{"justify-items":[...k(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...k()]}],"align-content":[{content:[`normal`,...te()]}],"align-items":[{items:[...k(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...k(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":te()}],"place-items":[{"place-items":[...k(),`baseline`]}],"place-self":[{"place-self":[`auto`,...k()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:A()}],mx:[{mx:A()}],my:[{my:A()}],ms:[{ms:A()}],me:[{me:A()}],mbs:[{mbs:A()}],mbe:[{mbe:A()}],mt:[{mt:A()}],mr:[{mr:A()}],mb:[{mb:A()}],ml:[{ml:A()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:ne()}],"inline-size":[{inline:[`auto`,...re()]}],"min-inline-size":[{"min-inline":[`auto`,...re()]}],"max-inline-size":[{"max-inline":[`none`,...re()]}],"block-size":[{block:[`auto`,...ie()]}],"min-block-size":[{"min-block":[`auto`,...ie()]}],"max-block-size":[{"max-block":[`none`,...ie()]}],w:[{w:[s,`screen`,...ne()]}],"min-w":[{"min-w":[s,`screen`,`none`,...ne()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...ne()]}],h:[{h:[`screen`,`lh`,...ne()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...ne()]}],"max-h":[{"max-h":[`screen`,`lh`,`none`,...ne()]}],"font-size":[{text:[`base`,n,Na,Ta]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,Ba,Oa]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,ma,V]}],"font-family":[{font:[Fa,ka,t]}],"font-features":[{"font-features":[V]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,H,V]}],"line-clamp":[{"line-clamp":[B,`none`,H,V]}],leading:[{leading:[`none`,a,...w()]}],"list-image":[{"list-image":[`none`,H,V]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,H,V]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:j()}],"text-color":[{text:j()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...de(),`wavy`]}],"text-decoration-thickness":[{decoration:[B,`from-font`,`auto`,Na,Ia,Ta]}],"text-decoration-color":[{decoration:j()}],"underline-offset":[{"underline-offset":[B,`auto`,H,V]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[pa,H,V]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,H,V]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,H,V]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:ae()}],"bg-repeat":[{bg:oe()}],"bg-size":[{bg:se()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},pa,H,V],radial:[``,H,V],conic:[``,pa,H,V]},Ra,ja]}],"bg-color":[{bg:j()}],"gradient-from-pos":[{from:ce()}],"gradient-via-pos":[{via:ce()}],"gradient-to-pos":[{to:ce()}],"gradient-from":[{from:j()}],"gradient-via":[{via:j()}],"gradient-to":[{to:j()}],rounded:[{rounded:le()}],"rounded-s":[{"rounded-s":le()}],"rounded-e":[{"rounded-e":le()}],"rounded-t":[{"rounded-t":le()}],"rounded-r":[{"rounded-r":le()}],"rounded-b":[{"rounded-b":le()}],"rounded-l":[{"rounded-l":le()}],"rounded-ss":[{"rounded-ss":le()}],"rounded-se":[{"rounded-se":le()}],"rounded-ee":[{"rounded-ee":le()}],"rounded-es":[{"rounded-es":le()}],"rounded-tl":[{"rounded-tl":le()}],"rounded-tr":[{"rounded-tr":le()}],"rounded-br":[{"rounded-br":le()}],"rounded-bl":[{"rounded-bl":le()}],"border-w":[{border:ue()}],"border-w-x":[{"border-x":ue()}],"border-w-y":[{"border-y":ue()}],"border-w-s":[{"border-s":ue()}],"border-w-e":[{"border-e":ue()}],"border-w-bs":[{"border-bs":ue()}],"border-w-be":[{"border-be":ue()}],"border-w-t":[{"border-t":ue()}],"border-w-r":[{"border-r":ue()}],"border-w-b":[{"border-b":ue()}],"border-w-l":[{"border-l":ue()}],"divide-x":[{"divide-x":ue()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":ue()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...de(),`hidden`,`none`]}],"divide-style":[{divide:[...de(),`hidden`,`none`]}],"border-color":[{border:j()}],"border-color-x":[{"border-x":j()}],"border-color-y":[{"border-y":j()}],"border-color-s":[{"border-s":j()}],"border-color-e":[{"border-e":j()}],"border-color-bs":[{"border-bs":j()}],"border-color-be":[{"border-be":j()}],"border-color-t":[{"border-t":j()}],"border-color-r":[{"border-r":j()}],"border-color-b":[{"border-b":j()}],"border-color-l":[{"border-l":j()}],"divide-color":[{divide:j()}],"outline-style":[{outline:[...de(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[B,H,V]}],"outline-w":[{outline:[``,B,Na,Ta]}],"outline-color":[{outline:j()}],shadow:[{shadow:[``,`inner`,`none`,u,za,Ma]}],"shadow-color":[{shadow:j()}],"inset-shadow":[{"inset-shadow":[`none`,d,za,Ma]}],"inset-shadow-color":[{"inset-shadow":j()}],"ring-w":[{ring:ue()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:j()}],"ring-offset-w":[{"ring-offset":[B,Ta]}],"ring-offset-color":[{"ring-offset":j()}],"inset-ring-w":[{"inset-ring":ue()}],"inset-ring-color":[{"inset-ring":j()}],"text-shadow":[{"text-shadow":[`none`,f,za,Ma]}],"text-shadow-color":[{"text-shadow":j()}],opacity:[{opacity:[B,H,V]}],"mix-blend":[{"mix-blend":[...fe(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":fe()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[B]}],"mask-image-linear-from-pos":[{"mask-linear-from":M()}],"mask-image-linear-to-pos":[{"mask-linear-to":M()}],"mask-image-linear-from-color":[{"mask-linear-from":j()}],"mask-image-linear-to-color":[{"mask-linear-to":j()}],"mask-image-t-from-pos":[{"mask-t-from":M()}],"mask-image-t-to-pos":[{"mask-t-to":M()}],"mask-image-t-from-color":[{"mask-t-from":j()}],"mask-image-t-to-color":[{"mask-t-to":j()}],"mask-image-r-from-pos":[{"mask-r-from":M()}],"mask-image-r-to-pos":[{"mask-r-to":M()}],"mask-image-r-from-color":[{"mask-r-from":j()}],"mask-image-r-to-color":[{"mask-r-to":j()}],"mask-image-b-from-pos":[{"mask-b-from":M()}],"mask-image-b-to-pos":[{"mask-b-to":M()}],"mask-image-b-from-color":[{"mask-b-from":j()}],"mask-image-b-to-color":[{"mask-b-to":j()}],"mask-image-l-from-pos":[{"mask-l-from":M()}],"mask-image-l-to-pos":[{"mask-l-to":M()}],"mask-image-l-from-color":[{"mask-l-from":j()}],"mask-image-l-to-color":[{"mask-l-to":j()}],"mask-image-x-from-pos":[{"mask-x-from":M()}],"mask-image-x-to-pos":[{"mask-x-to":M()}],"mask-image-x-from-color":[{"mask-x-from":j()}],"mask-image-x-to-color":[{"mask-x-to":j()}],"mask-image-y-from-pos":[{"mask-y-from":M()}],"mask-image-y-to-pos":[{"mask-y-to":M()}],"mask-image-y-from-color":[{"mask-y-from":j()}],"mask-image-y-to-color":[{"mask-y-to":j()}],"mask-image-radial":[{"mask-radial":[H,V]}],"mask-image-radial-from-pos":[{"mask-radial-from":M()}],"mask-image-radial-to-pos":[{"mask-radial-to":M()}],"mask-image-radial-from-color":[{"mask-radial-from":j()}],"mask-image-radial-to-color":[{"mask-radial-to":j()}],"mask-image-radial-shape":[{mask:[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[B]}],"mask-image-conic-from-pos":[{"mask-conic-from":M()}],"mask-image-conic-to-pos":[{"mask-conic-to":M()}],"mask-image-conic-from-color":[{"mask-conic-from":j()}],"mask-image-conic-to-color":[{"mask-conic-to":j()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:ae()}],"mask-repeat":[{mask:oe()}],"mask-size":[{mask:se()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,H,V]}],filter:[{filter:[``,`none`,H,V]}],blur:[{blur:pe()}],brightness:[{brightness:[B,H,V]}],contrast:[{contrast:[B,H,V]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,za,Ma]}],"drop-shadow-color":[{"drop-shadow":j()}],grayscale:[{grayscale:[``,B,H,V]}],"hue-rotate":[{"hue-rotate":[B,H,V]}],invert:[{invert:[``,B,H,V]}],saturate:[{saturate:[B,H,V]}],sepia:[{sepia:[``,B,H,V]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,H,V]}],"backdrop-blur":[{"backdrop-blur":pe()}],"backdrop-brightness":[{"backdrop-brightness":[B,H,V]}],"backdrop-contrast":[{"backdrop-contrast":[B,H,V]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,B,H,V]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[B,H,V]}],"backdrop-invert":[{"backdrop-invert":[``,B,H,V]}],"backdrop-opacity":[{"backdrop-opacity":[B,H,V]}],"backdrop-saturate":[{"backdrop-saturate":[B,H,V]}],"backdrop-sepia":[{"backdrop-sepia":[``,B,H,V]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,H,V]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[B,`initial`,H,V]}],ease:[{ease:[`linear`,`initial`,_,H,V]}],delay:[{delay:[B,H,V]}],animate:[{animate:[`none`,v,H,V]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,H,V]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:me()}],"rotate-x":[{"rotate-x":me()}],"rotate-y":[{"rotate-y":me()}],"rotate-z":[{"rotate-z":me()}],scale:[{scale:he()}],"scale-x":[{"scale-x":he()}],"scale-y":[{"scale-y":he()}],"scale-z":[{"scale-z":he()}],"scale-3d":[`scale-3d`],skew:[{skew:N()}],"skew-x":[{"skew-x":N()}],"skew-y":[{"skew-y":N()}],transform:[{transform:[H,V,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:P()}],"translate-x":[{"translate-x":P()}],"translate-y":[{"translate-y":P()}],"translate-z":[{"translate-z":P()}],"translate-none":[`translate-none`],zoom:[{zoom:[pa,H,V]}],accent:[{accent:j()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:j()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,H,V]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":j()}],"scrollbar-track-color":[{"scrollbar-track":j()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,H,V]}],fill:[{fill:[`none`,...j()]}],"stroke-w":[{stroke:[B,Na,Ta,Da]}],stroke:[{stroke:[`none`,...j()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`start`,`end`,`right`,`left`],"inset-y":[`inset-bs`,`inset-be`,`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],"place-content":[`align-content`,`justify-content`],"place-items":[`align-items`,`justify-items`],"place-self":[`align-self`,`justify-self`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`ps`,`pe`,`pr`,`pl`],py:[`pbs`,`pbe`,`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`ms`,`me`,`mr`,`ml`],my:[`mbs`,`mbe`,`mt`,`mb`],size:[`w`,`h`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],sr:`not-sr.position.size.w.h.p.px.py.ps.pe.pbs.pbe.pt.pr.pb.pl.m.mx.my.ms.me.mbs.mbe.mt.mr.mb.ml.overflow.overflow-x.overflow-y.whitespace`.split(`.`),"not-sr":[`sr`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-s`,`border-w-e`,`border-w-r`,`border-w-l`],"border-w-y":[`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-s`,`border-color-e`,`border-color-r`,`border-color-l`],"border-color-y":[`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-b`],"mask-image-x-from-pos":[`mask-image-r-from-pos`,`mask-image-l-from-pos`],"mask-image-x-to-pos":[`mask-image-r-to-pos`,`mask-image-l-to-pos`],"mask-image-x-from-color":[`mask-image-r-from-color`,`mask-image-l-from-color`],"mask-image-x-to-color":[`mask-image-r-to-color`,`mask-image-l-to-color`],"mask-image-y-from-pos":[`mask-image-t-from-pos`,`mask-image-b-from-pos`],"mask-image-y-to-pos":[`mask-image-t-to-pos`,`mask-image-b-to-pos`],"mask-image-y-from-color":[`mask-image-t-from-color`,`mask-image-b-from-color`],"mask-image-y-to-color":[`mask-image-t-to-color`,`mask-image-b-to-color`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-ms`,`scroll-me`,`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-ps`,`scroll-pe`,`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function U(...e){return Qa(bi(e))}var $a=Ci(`inline-flex min-h-11 shrink-0 items-center justify-center gap-2 rounded-md px-4 text-sm font-medium whitespace-nowrap transition-colors outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface disabled:pointer-events-none disabled:opacity-50 md:min-h-9`,{defaultVariants:{variant:`default`},variants:{variant:{default:`bg-accent text-accent-foreground hover:bg-accent/90`,ghost:`text-foreground hover:bg-muted`,outline:`border border-border bg-surface text-foreground hover:bg-muted`}}});function W({className:e,type:t,variant:n,...r}){return(0,h.jsx)(`button`,{className:U($a({variant:n}),e),type:t??`button`,...r})}var eo=st(),to=`a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])`;function no({children:e,description:t,onClose:n,open:r,title:i}){return r?(0,eo.createPortal)((0,h.jsx)(io,{description:t,onClose:n,title:i,children:e}),document.body):null}function ro(e){return e instanceof HTMLElement&&e.isConnected&&!e.hasAttribute(`disabled`)}function io({children:e,description:t,onClose:n,title:r}){let i=(0,d.useId)(),a=(0,d.useId)(),o=(0,d.useRef)(null),s=(0,d.useRef)(null);(0,d.useEffect)(()=>{let e=document.activeElement,t=[];for(let e of document.body.children)e!==o.current&&!e.hasAttribute(`inert`)&&(e.setAttribute(`inert`,``),t.push(e));return s.current?.querySelector(to)?.focus(),()=>{for(let e of t)e.removeAttribute(`inert`);if(e===null)return;if(ro(e)){e.focus();return}let n=e.closest(`[tabindex="-1"]`);n!==null&&ro(n)&&n.focus()}},[]);function c(e){if(e.key===`Escape`){e.stopPropagation(),n();return}if(e.key!==`Tab`||s.current===null)return;let t=[...s.current.querySelectorAll(to)],r=t[0],i=t.at(-1);r!==void 0&&i!==void 0&&(e.shiftKey&&document.activeElement===r?(e.preventDefault(),i.focus()):!e.shiftKey&&document.activeElement===i&&(e.preventDefault(),r.focus()))}return(0,h.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-end justify-center bg-foreground/40 p-4 sm:items-center`,onKeyDown:c,ref:o,role:`presentation`,children:(0,h.jsxs)(`div`,{"aria-describedby":i,"aria-labelledby":a,"aria-modal":`true`,className:`flex w-full max-w-md flex-col gap-4 rounded-lg border border-border bg-surface p-5 text-foreground shadow-lg`,ref:s,role:`dialog`,children:[(0,h.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,h.jsx)(`h2`,{className:`text-base font-semibold`,id:a,children:r}),(0,h.jsx)(`p`,{className:`text-sm text-muted-foreground`,id:i,children:t})]}),(0,h.jsx)(`div`,{className:`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,children:e})]})})}function ao({className:e,type:t,...n}){return(0,h.jsx)(`input`,{className:U(`min-h-11 w-full rounded-md border border-border bg-surface px-3 text-base text-foreground outline-none placeholder:text-muted-foreground focus-visible:ring-2 focus-visible:ring-accent md:min-h-9 md:text-sm`,e),type:t??`text`,...n})}function oo({className:e,...t}){return(0,h.jsx)(`div`,{"aria-hidden":`true`,className:U(`animate-pulse rounded-md bg-muted`,e),...t})}function so({className:e,...t}){return(0,h.jsx)(`textarea`,{className:U(`min-h-32 w-full resize-y rounded-md border border-border bg-surface px-3 py-2 text-base text-foreground outline-none placeholder:text-muted-foreground focus-visible:ring-2 focus-visible:ring-accent md:text-sm`,e),...t})}var co=e=>(e.match(/\d+[xX]\d+|[A-Z]?[a-z]+|[A-Z]|\d+/g)??[]).join(`-`).toLowerCase();function lo(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:co(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}var uo=e=>{let t=``,n=!1;for(let r of e)r===`-`||r===`_`||r<=` `?n=t.length>0:(t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1);return t},fo=e=>{let t=uo(e);return t.charAt(0).toUpperCase()+t.slice(1)},po=(...e)=>{let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of n.split(/\s+/))e&&t.add(e);return[...t].join(` `)},mo={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`};function ho(e){return e!=null}function go(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??mo.width,a=e.size??e.height??mo.height,o=e.aliases?.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>`lucide-${e}`)??[],s=[...e.name?[`lucide-${e.name}`]:[],...o],c=t.className?.split(` `).filter(Boolean)??[],l=t.includeDefaultClasses===!1?po(...c):po(`lucide`,...s,...c),u=t.strokeWidth??mo[`stroke-width`];if(t.absoluteStrokeWidth){let n=Number(u)*Number(e.size??e.width??mo.width)/Number(t.size??t.width??mo.width);Number.isFinite(n)&&(u=n)}return[`svg`,{...Object.entries(mo).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&ho(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&ho(t.width)&&{[r(`width`)]:t.width},...`height`in t&&ho(t.height)&&{[r(`height`)]:t.height},[r(`stroke-width`)]:u,...l&&{[r(`class`)]:l},[r(`viewBox`)]:`0 0 ${i} ${a}`,...t.hasA11yProp===!1?{[r(`aria-hidden`)]:`true`}:{},...`attributes`in t&&t.attributes},e.node.map(e=>{let[n,i,a]=e,o=t.nonScalingStroke?{[r(`vector-effect`)]:`non-scaling-stroke`,...i}:i;return a?[n,o,a]:[n,o]})]}function _o(e,t={}){return go(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}var vo=e=>{if(typeof e!=`object`||!e)return!1;for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&(t.startsWith(`aria-`)||t===`role`||t===`title`)&&e[t]!=null)return!0;return!1},yo=(0,d.createContext)({}),bo=()=>(0,d.useContext)(yo),xo=(0,d.forwardRef)(({color:e,size:t,width:n,height:r,strokeWidth:i,absoluteStrokeWidth:a,nonScalingStroke:o,className:s=``,children:c,iconNode:l=[],icon:u={node:l,aliases:[],size:24},...f},p)=>{let{size:m=24,strokeWidth:h=2,absoluteStrokeWidth:g=!1,nonScalingStroke:_=!1,color:v=`currentColor`,className:y=``}=bo()??{},b=!!c||vo(f),[x,S,C=[]]=_o(u,{color:e??v,width:n??t??m,height:r??t??m,strokeWidth:i??h,absoluteStrokeWidth:a??g,nonScalingStroke:o??_,className:po(y,s),hasA11yProp:b,attributes:f});return(0,d.createElement)(x,{ref:p,...S},[...C.map(([e,t])=>(0,d.createElement)(e,t)),...Array.isArray(c)?c:[c]])});function So(e,t=[],n=[]){let r=typeof e==`string`?lo(e,t,n):e,i=(0,d.forwardRef)(({className:e,...t},n)=>(0,d.createElement)(xo,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=fo(r.name)),i}var Co={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};Co.node;var wo=So(Co),To={name:`chevron-left`,size:24,node:[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]};To.node;var Eo=So(To),Do={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};Do.node;var Oo=So(Do),ko={name:`download`,size:24,node:[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]};ko.node;var Ao=So(ko),jo={name:`file-text`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]};jo.node;var Mo=So(jo),No={name:`image-off`,size:24,node:[[`line`,{x1:`2`,x2:`22`,y1:`2`,y2:`22`,key:`a6p6uj`}],[`path`,{d:`M10.41 10.41a2 2 0 1 1-2.83-2.83`,key:`1bzlo9`}],[`line`,{x1:`13.5`,x2:`6`,y1:`13.5`,y2:`21`,key:`1q0aeu`}],[`line`,{x1:`18`,x2:`21`,y1:`12`,y2:`15`,key:`5mozeu`}],[`path`,{d:`M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59`,key:`mmje98`}],[`path`,{d:`M21 15V5a2 2 0 0 0-2-2H9`,key:`43el77`}]]};No.node;var Po=So(No),Fo={name:`paperclip`,size:24,node:[[`path`,{d:`m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551`,key:`1miecu`}]]};Fo.node;var Io=So(Fo),Lo={name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]};Lo.node;var Ro=So(Lo),G={name:`square-pen`,size:24,node:[[`path`,{d:`M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7`,key:`1m0v6g`}],[`path`,{d:`M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z`,key:`ohrbg2`}]],aliases:[`pen-box`,`edit`,`pen-square`]};G.node;var zo=So(G),Bo={name:`user-round`,size:24,node:[[`circle`,{cx:`12`,cy:`8`,r:`5`,key:`1hypcn`}],[`path`,{d:`M20 21a8 8 0 0 0-16 0`,key:`rfgkzh`}]],aliases:[`user-2`]};Bo.node;var Vo=So(Bo),Ho={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};Ho.node;var Uo=So(Ho),Wo=`You seem to be offline. Check your connection and try again.`,Go=`The server took too long to answer. Try again.`,Ko=`Something went wrong. Try again.`,qo=`Your session could not be refreshed. Reload the page or sign in again.`,Jo=3e4,Yo=3e4,Xo=`mailbox:last-reload`,Zo=class extends Error{status;constructor(e,t){super(e),this.name=`ApiError`,this.status=t}};async function Qo(e,t={}){let{response:n,timeout:r}=await es(e,t);if(n.status!==204)try{return await n.json()}catch{throw new Zo(r.aborted?Go:Ko,0)}}async function $o(e){let{response:t,timeout:n}=await es(e,{});try{let e=/filename="([^"]+)"/.exec(t.headers.get(`content-disposition`)??``);return{blob:await t.blob(),filename:e?.[1]??null}}catch{throw new Zo(n.aborted?Go:Ko,0)}}async function es(e,t){let n=AbortSignal.timeout(Jo),r=t.signal===void 0||t.signal===null?n:AbortSignal.any([t.signal,n]),i;try{i=await fetch(e,{...t,credentials:`same-origin`,redirect:`manual`,signal:r})}catch(e){throw t.signal?.aborted?e:n.aborted?new Zo(Go,0):new Zo(Wo,0)}if(i.type===`opaqueredirect`||i.status===401)return cs();if(!i.ok)throw new Zo(await us(i),i.status);return{response:i,timeout:n}}var ts=1e4,ns=!1,rs=new Set,is=new Set;function as(){ns=!1;let e=new Zo(qo,401);for(let t of rs)t(e);rs.clear()}function os(){return ns}function ss(e){return is.add(e),()=>{is.delete(e)}}function cs(){if(!ns){if(ls())return Promise.reject(new Zo(qo,401));ns=!0;for(let e of is)try{e()}catch{}setTimeout(as,ts),window.location.reload()}return new Promise((e,t)=>{rs.add(t)})}function ls(){let e=Date.now();try{if(e-Number(window.sessionStorage.getItem(Xo)??0)<Yo)return!0;window.sessionStorage.setItem(Xo,String(e))}catch{return!0}return!1}async function us(e){try{let t=await e.json();if(typeof t==`object`&&t&&`message`in t&&typeof t.message==`string`)return t.message}catch{return Ko}return Ko}var ds=6e4;function fs(e={}){return tt({...Cs(),refetchInterval:e.poll===!0&&ds,refetchIntervalInBackground:!1})}function ps(e,t){return tt({queryFn:({signal:n})=>Qo(`/api/apps/${encodeURIComponent(e)}/messages/${encodeURIComponent(t)}`,{signal:n}),queryKey:[`app-message`,e,t],refetchInterval:e=>e.state.data?.state===`queued`&&Ts,refetchIntervalInBackground:!1})}function ms(e,t,n){return rt({getNextPageParam:e=>e.nextCursor??void 0,initialPageParam:null,placeholderData:pe,queryFn:({pageParam:r,signal:i})=>{let a=new URLSearchParams({state:t});return n!==``&&a.set(`search`,n),r!==null&&a.set(`cursor`,r),Qo(`/api/apps/${encodeURIComponent(e)}/messages?${a}`,{signal:i})},queryKey:[`app-messages`,e,t,n],refetchInterval:ds,refetchIntervalInBackground:!1})}function hs(e){return rt({getNextPageParam:e=>e.nextCursor??void 0,initialPageParam:null,queryFn:({pageParam:t,signal:n})=>Qo(`/api/apps/${encodeURIComponent(e)}/enrollments${t===null?``:`?${new URLSearchParams({cursor:t})}`}`,{signal:n}),queryKey:[`app-enrollments`,e],refetchInterval:ds,refetchIntervalInBackground:!1})}function gs(e){return rt({getNextPageParam:e=>e.nextCursor??void 0,initialPageParam:null,queryFn:({pageParam:t,signal:n})=>Qo(`/api/apps/${encodeURIComponent(e)}/suppressions${t===null?``:`?${new URLSearchParams({cursor:t})}`}`,{signal:n}),queryKey:[`app-suppressions`,e]})}function _s(e,t){return tt({queryFn:({signal:n})=>Qo(`/api/apps/${encodeURIComponent(e)}/enrollments/${encodeURIComponent(t)}`,{signal:n}),queryKey:[`app-enrollment`,e,t],refetchInterval:ds,refetchIntervalInBackground:!1})}function vs(e,t){return{queryFn:({signal:n})=>Qo(`/api/mailboxes/${encodeURIComponent(e)}/contacts/${encodeURIComponent(t)}`,{signal:n}),queryKey:[`contact`,e,t.toLowerCase()]}}function ys(e,t){return tt(vs(e,t))}function bs(e,t){return rt({getNextPageParam:e=>e.nextCursor??void 0,initialPageParam:null,placeholderData:pe,queryFn:({pageParam:n,signal:r})=>{let i=xs(t);return n!==null&&i.set(`cursor`,n),Qo(`/api/mailboxes/${encodeURIComponent(e)}/contacts?${i}`,{signal:r})},queryKey:[`contacts`,e,t.filter,t.search,t.waitingDays]})}function xs(e){let t=new URLSearchParams({filter:e.filter});return e.filter===`waiting`&&t.set(`waitingDays`,String(e.waitingDays)),e.search!==``&&t.set(`search`,e.search),t}function Ss(e){return tt({queryFn:({signal:t})=>Qo(`/api/mailboxes/${encodeURIComponent(e)}/outreach-today`,{signal:t}),queryKey:[`outreach-today`,e],retry:!1,staleTime:6e4})}function Cs(){return{queryFn:({signal:e})=>Qo(`/api/me`,{signal:e}),queryKey:[`me`]}}function ws(e,t=``){return rt({getNextPageParam:e=>e.nextCursor??void 0,initialPageParam:null,placeholderData:pe,queryFn:({pageParam:n,signal:r})=>{let i=new URLSearchParams;t!==``&&i.set(`search`,t),n!==null&&i.set(`cursor`,n);let a=i.size===0?``:`?${i}`;return Qo(`/api/mailboxes/${encodeURIComponent(e)}/snippets${a}`,{signal:r})},queryKey:[`snippets`,e,t]})}var Ts=3e4;function Es(e){return tt({queryFn:({signal:t})=>Qo(`/api/threads/${encodeURIComponent(e)}`,{signal:t}),queryKey:[`thread`,e],refetchInterval:e=>e.state.data?.messages.some(e=>e.state===`queued`)===!0&&Ts,refetchIntervalInBackground:!1})}function Ds(e,t,n){return rt({getNextPageParam:e=>e.nextCursor??void 0,initialPageParam:null,placeholderData:pe,queryFn:({pageParam:r,signal:i})=>{let a=new URLSearchParams({filter:t});return n!==``&&a.set(`search`,n),r!==null&&a.set(`cursor`,r),Qo(`/api/mailboxes/${encodeURIComponent(e)}/threads?${a}`,{signal:i})},queryKey:[`threads`,e,t,n],refetchInterval:ds,refetchIntervalInBackground:!1})}function Os(e,t){return`${ks(e)}/${encodeURIComponent(t)}`}function ks(e){return`/apps/${encodeURIComponent(e)}`}function As(e){return`${ks(e)}/series`}function js(e){return`${ks(e)}/unsubscribed`}function Ms(e,t){return`${As(e)}/${encodeURIComponent(t)}`}function Ns(e){return`${Ps(e)}/compose`}function Ps(e){return`/${encodeURIComponent(e)}`}function Fs(e,t){return`${Is(e)}/${encodeURIComponent(t)}`}function Is(e){return`${Ps(e)}/contacts`}function Ls(e,t){return`${Ns(e)}?${new URLSearchParams({to:t})}`}function Rs(e){return`${Ps(e)}/snippets`}function zs(e,t){return`${Ps(e)}/${encodeURIComponent(t)}`}function Bs(e,t){this.v=e,this.k=t}function Vs(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Hs(e){if(Array.isArray(e))return e}function Us(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function Ws(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
10
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Gs(e,t){return Hs(e)||Us(e,t)||Ks(e,t)||Ws()}function Ks(e,t){if(e){if(typeof e==`string`)return Vs(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Vs(e,t):void 0}}function qs(e){var t,n;function r(t,n){try{var a=e[t](n),o=a.value,s=o instanceof Bs;Promise.resolve(s?o.v:o).then(function(n){if(s){var c=t===`return`&&o.k?t:`next`;if(!o.k||n.done)return r(c,n);n=e[c](n).value}i(!!a.done,n)},function(e){r(`throw`,e)})}catch(e){i(2,e)}}function i(e,i){e===2?t.reject(i):t.resolve({value:i,done:e}),(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(e,i){return new Promise(function(a,o){var s={key:e,arg:i,resolve:a,reject:o,next:null};n?n=n.next=s:(t=n=s,r(e,i))})},typeof e.return!=`function`&&(this.return=void 0)}qs.prototype[typeof Symbol==`function`&&Symbol.asyncIterator||`@@asyncIterator`]=function(){return this},qs.prototype.next=function(e){return this._invoke(`next`,e)},qs.prototype.throw=function(e){return this._invoke(`throw`,e)},qs.prototype.return=function(e){return this._invoke(`return`,e)};var Js=Object.entries,Ys=Object.keys,Xs=Object.setPrototypeOf,Zs=Object.isFrozen,Qs=Object.getPrototypeOf,$s=Object.getOwnPropertyDescriptor,ec=Object.freeze,tc=Object.seal,nc=Object.create,rc=typeof Reflect<`u`&&Reflect,ic=rc.apply,ac=rc.construct;ec||=function(e){return e},tc||=function(e){return e},ic||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},ac||=function(e){return new e(...[...arguments].slice(1))};var oc=Fc(Array.prototype.forEach),sc=Fc(Array.prototype.lastIndexOf),cc=Fc(Array.prototype.pop),lc=Fc(Array.prototype.push),uc=Fc(Array.prototype.slice),dc=Fc(Array.prototype.splice),fc=Array.isArray,pc=Ic(Set),mc=Fc(Set.prototype.add),hc=Fc(Set.prototype.has),gc=Fc(Set.prototype.delete),_c=Ic(Map),vc=Fc(Map.prototype.get),yc=Fc(Map.prototype.set),bc=Fc(String.prototype.toLowerCase),xc=Fc(String.prototype.toString),Sc=Fc(String.prototype.match),Cc=Fc(String.prototype.replace),wc=Fc(String.prototype.indexOf),Tc=Fc(String.prototype.trim),Ec=Fc(Number.prototype.toString),Dc=Fc(Boolean.prototype.toString),Oc=typeof BigInt>`u`?null:Fc(BigInt.prototype.toString),kc=typeof Symbol>`u`?null:Fc(Symbol.prototype.toString),Ac=Fc(Object.prototype.hasOwnProperty),jc=Fc(Object.prototype.toString),Mc=RegExp.prototype.test,Nc=function(e,t){return e instanceof RegExp&&(e.lastIndex=0),ic(Mc,e,[t])},Pc=Ic(TypeError);function Fc(e){return function(t){var n=[...arguments].slice(1);return ic(e,t,n)}}function Ic(e){return function(){return ac(e,[...arguments])}}function K(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:bc;if(Xs&&Xs(e,null),!fc(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(Zs(t)||(t[r]=e),i=e)}e[i]=!0}return e}function Lc(e){for(let t=0;t<e.length;t++)Ac(e,t)||(e[t]=null);return e}function Rc(e){let t=nc(null);for(let r of Js(e)){var n=Gs(r,2);let i=n[0],a=n[1];Ac(e,i)&&(t[i]=fc(a)?Lc(a):a&&typeof a==`object`&&a.constructor===Object?Rc(a):a)}return t}function zc(e){let t=nc(null),n=Ys(e),r=n.length;for(;r--;)t[n[r]]=e[n[r]];return t}function Bc(e){switch(typeof e){case`string`:return e;case`number`:return Ec(e);case`boolean`:return Dc(e);case`bigint`:return Oc?Oc(e):`0`;case`symbol`:return kc?kc(e):`Symbol()`;case`undefined`:return jc(e);case`function`:case`object`:{if(e===null)return jc(e);let t=e,n=Vc(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:jc(e)}return jc(e)}default:return jc(e)}}function Vc(e,t){for(;e!==null;){let n=$s(e,t);if(n){if(n.get)return Fc(n.get);if(typeof n.value==`function`)return Fc(n.value)}e=Qs(e)}function n(){return null}return n}function Hc(e,t){for(;e!==null;){let n=$s(e,t);if(n)return n.get?Fc(n.get):null;e=Qs(e)}return null}function Uc(e){if(!e)return!1;try{return Nc(e,``),!0}catch{return!1}}var Wc=ec(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),Gc=ec(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.filter.font.g.glyph.glyphref.hkern.image.line.lineargradient.marker.mask.metadata.mpath.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),Kc=ec([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),qc=ec([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),Jc=ec(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),Yc=ec([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),Xc=ec([`#text`]),Zc=ec(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),Qc=ec(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.pointer-events.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.vector-effect.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),$c=ec(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),el=ec([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),tl=tc(/{{[\w\W]*|^[\w\W]*}}/g),nl=tc(/<%[\w\W]*|^[\w\W]*%>/g),rl=tc(/\${[\w\W]*/g),il=tc(/{{|}}|\${|<%|%>/),al=tc(/[^\t\n\f\r ]/),ol=tc(/\u0000/g),sl=tc(/^data-[\-\w.\u00B7-\uFFFF]+$/),cl=tc(/^aria-[\-\w]+$/),ll=tc(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),ul=tc(/^(?:\w+script|data):/i),dl=tc(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),fl=tc(/^html$/i),pl=tc(/^[a-z][.\w]*(-[.\w]+)+$/i),ml=tc(/<[/\w!]/g),hl=tc(/<[/\w]/g),gl=tc(/<[/\w]|^-?>|--!?>|<!-$/g),_l=tc(/<\/no(script|embed|frames)/i),vl=tc(/\/>/i),yl=tc(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i),bl=tc(/^[\r\n\t ]+/),xl={element:1,text:3,processingInstruction:7,comment:8,document:9,documentFragment:11},Sl=ec(K({},[`style`,`script`,`xmp`,`iframe`,`noembed`,`noframes`,`plaintext`,`noscript`])),Cl=ec(K({},[`textarea`,`title`])),wl=ec(K({},[`area`,`base`,`basefont`,`bgsound`,`br`,`col`,`embed`,`frame`,`hr`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`])),Tl=function(){return typeof window>`u`?null:window},El=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},Dl=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Ol=function(e,t,n,r){return Ac(e,t)&&fc(e[t])?K(r.base?zc(r.base):{},e[t],r.transform):n},kl=function(e,t,n){let r=Ac(e,t)?e[t]:void 0;return r&&typeof r==`object`?Rc(r):n};function Al(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Tl(),t=e=>Al(e);if(t.version=`3.5.0`,t.removed=[],!e||!e.document||e.document.nodeType!==xl.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript,a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter,l=e.DOMParser,u=e.trustedTypes,d=s.prototype,f=Vc(d,`cloneNode`),p=Vc(d,`remove`),m=Vc(d,`removeChild`),h=Vc(d,`removeAttributeNode`),g=Vc(d,`nextSibling`),_=Vc(d,`childNodes`),v=Vc(d,`parentNode`),y=Vc(d,`shadowRoot`),b=Vc(d,`attributes`),x=o&&o.prototype?Vc(o.prototype,`nodeType`):null,S=o&&o.prototype?Vc(o.prototype,`nodeName`):null,C=o&&o.prototype?Vc(o.prototype,`ownerDocument`):null,w=function(e){return x?x(e):e.nodeType},T=function(e){return S?S(e):e.nodeName},ee=Hc(d,`namespaceURI`),E=function(e){return ee?ee(e):e.namespaceURI},D=function(e){return w(e)===xl.element?b(e):null};if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let O,te=``,k,A=!1,ne=0,re=function(){if(ne>0)throw Pc(`A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.`)},ie=function(e){re(),ne++;try{return O.createHTML(e)}finally{ne--}},j=function(e){return O&&Le?ie(e):e},ae=function(e){re(),ne++;try{return O.createScriptURL(e)}finally{ne--}},oe=function(){return A||=(k=El(u,i),!0),k},se=n,ce=se.implementation,le=se.createNodeIterator,ue=se.createDocumentFragment,de=se.getElementsByTagName,fe=r.importNode,M=Dl();t.isSupported=typeof Js==`function`&&typeof v==`function`&&ce&&ce.createHTMLDocument!==void 0;let pe=tl,me=nl,he=rl,N=sl,P=cl,ge=ul,_e=dl,ve=pl,ye=ll,F=null,I=K({},[...Wc,...Gc,...Kc,...Jc,...Xc]),L=null,be=K({},[...Zc,...Qc,...$c,...el]),xe=null,Se=null,Ce=null,R=Object.seal(nc(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),we=!0,Te=!0,Ee=!1,De=!0,Oe=!1,ke=!0,Ae=!1,je=!1,Me=null,Ne=null,Pe=!1,Fe=!1,Ie=!1,Le=!1,Re=!0,ze=!1,Be=`user-content-`,Ve=!0,He=!1,Ue=null,We=null,Ge=!1,Ke=null,qe=K({},`annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp`.split(`.`)),Je=null,Ye=K({},[`audio`,`video`,`img`,`source`,`image`,`track`]),Xe=null,Ze=K({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),Qe=`http://www.w3.org/1998/Math/MathML`,$e=`http://www.w3.org/2000/svg`,et=`http://www.w3.org/1999/xhtml`,tt=et,nt=!1,rt=null,it=K({},[Qe,$e,et],xc),at=ec(K({},[`mi`,`mo`,`mn`,`ms`,`mtext`])),ot=null,st=ec(K({},[`annotation-xml`])),ct=null,lt=ec(nc(null)),ut=K({},[`title`,`style`,`font`,`a`,`script`]),dt=null,ft=[`application/xhtml+xml`,`text/html`],pt=null,mt=null,ht=null,gt=n.createElement(`form`),_t=function(e){return e instanceof RegExp||e instanceof Function},vt=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};e&&typeof e==`object`||(e={}),e=Rc(e),dt=ft.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,pt=dt===`application/xhtml+xml`?xc:bc,F=Ol(e,`ALLOWED_TAGS`,I,{transform:pt}),L=Ol(e,`ALLOWED_ATTR`,be,{transform:pt}),rt=Ol(e,`ALLOWED_NAMESPACES`,it,{transform:xc}),Xe=Ol(e,`ADD_URI_SAFE_ATTR`,Ze,{transform:pt,base:Ze}),Je=Ol(e,`ADD_DATA_URI_TAGS`,Ye,{transform:pt,base:Ye}),Ke=Ol(e,`FORBID_CONTENTS`,qe,{transform:pt}),Se=Ol(e,`FORBID_TAGS`,nc(null),{transform:pt}),Ce=Ol(e,`FORBID_ATTR`,nc(null),{transform:pt}),Ge=Ac(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?Rc(e.USE_PROFILES):e.USE_PROFILES:!1,we=e.ALLOW_ARIA_ATTR!==!1,Te=e.ALLOW_DATA_ATTR!==!1,Ee=e.ALLOW_UNKNOWN_PROTOCOLS||!1,De=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Oe=e.SAFE_FOR_TEMPLATES||!1,ke=e.SAFE_FOR_XML!==!1,Ae=e.WHOLE_DOCUMENT||!1,Fe=e.RETURN_DOM||!1,Ie=e.RETURN_DOM_FRAGMENT||!1,Le=e.RETURN_TRUSTED_TYPE||!1,Pe=e.FORCE_BODY||!1,Re=e.SANITIZE_DOM!==!1,ze=e.SANITIZE_NAMED_PROPS||!1,Ve=e.KEEP_CONTENT!==!1,He=e.IN_PLACE||!1,ye=Uc(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:ll,tt=typeof e.NAMESPACE==`string`?e.NAMESPACE:et,ot=kl(e,`MATHML_TEXT_INTEGRATION_POINTS`,at),ct=kl(e,`HTML_INTEGRATION_POINTS`,st);let t=kl(e,`CUSTOM_ELEMENT_HANDLING`,lt);if(xe=nc(null),Ac(t,`tagNameCheck`)&&_t(t.tagNameCheck)&&(xe.tagNameCheck=t.tagNameCheck),Ac(t,`attributeNameCheck`)&&_t(t.attributeNameCheck)&&(xe.attributeNameCheck=t.attributeNameCheck),Ac(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(xe.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),tc(xe),Oe&&(Te=!1),Ie&&(Fe=!0),Ge&&((Ac(e,`ALLOWED_TAGS`)||Ac(e,`ALLOWED_ATTR`))&&typeof console<`u`&&typeof console.warn==`function`&&console.warn(`DOMPurify: USE_PROFILES overrides ALLOWED_TAGS and ALLOWED_ATTR. Do not use these options together.`),F=K({},Xc),L=nc(null),Ge.html===!0&&(K(F,Wc),K(L,Zc)),Ge.svg===!0&&(K(F,Gc),K(L,Qc),K(L,el)),Ge.svgFilters===!0&&(K(F,Kc),K(L,Qc),K(L,el)),Ge.mathMl===!0&&(K(F,Jc),K(L,$c),K(L,el))),R.tagCheck=null,R.attributeCheck=null,Ac(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?R.tagCheck=e.ADD_TAGS:fc(e.ADD_TAGS)&&(F===I&&(F=zc(F)),K(F,e.ADD_TAGS,pt))),Ac(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?R.attributeCheck=e.ADD_ATTR:fc(e.ADD_ATTR)&&(L===be&&(L=zc(L)),K(L,e.ADD_ATTR,pt))),Ac(e,`ADD_FORBID_CONTENTS`)&&fc(e.ADD_FORBID_CONTENTS)&&(Ke===qe&&(Ke=zc(Ke)),K(Ke,e.ADD_FORBID_CONTENTS,pt)),Ve&&(F[`#text`]=!0),Ae&&K(F,[`html`,`head`,`body`]),F.table&&(F.tbody=!0,delete Se.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw Pc(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw Pc(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=O;O=e.TRUSTED_TYPES_POLICY;try{te=ie(``)}catch(e){throw O=t,e}}else e.TRUSTED_TYPES_POLICY===null?(O=void 0,te=``):(O===void 0&&(O=oe()),O&&typeof te==`string`&&(te=ie(``)));mt=ec(e)},yt=K({},[...Gc,...Kc,...qc]),bt=K({},[...Jc,...Yc]),xt=function(e,t,n){return t===et?e===`svg`:t===Qe?e===`svg`&&(n===`annotation-xml`||ot[n]):!!yt[e]},St=function(e,t,n){return t===et?e===`math`:t===$e?e===`math`&&ct[n]:!!bt[e]},Ct=function(e,t,n){return t===$e&&!ct[n]||t===Qe&&!ot[n]?!1:!bt[e]&&(ut[e]||!yt[e])},wt=function(e){let t=E(e),n=bc(T(e)),r=v(e),i=tt,a=`template`;return r&&w(r)===xl.element&&(i=E(r),a=bc(T(r))),rt[t]?t===$e?xt(n,i,a):t===Qe?St(n,i,a):t===et?Ct(n,i,a):dt===`application/xhtml+xml`:!1},Tt=function(e){lc(t.removed,{element:e}),zt(e);try{v(e).removeChild(e)}catch{if(p(e),!v(e))throw Pc(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},Et=function(e,t,n){try{h(e,t)}catch{try{e.removeAttribute(n)}catch{}}},Dt=function(e){jt(e);let t=_(e);t&&oc(uc(t),t=>{try{m(e,t)}catch{}}),w(e)===xl.element&&kt(e,!1)},Ot=function(e,n,r){if(!r)try{r=n.getAttributeNode(e)}catch{r=null}if(lc(t.removed,{attribute:r||null,from:n}),r)Et(n,r,e);else try{n.removeAttribute(e)}catch{}if(e===`is`){if(Fe||Ie)try{Tt(n)}catch{}else try{n.setAttribute(e,``)}catch{}}},kt=function(e,t){let n=b(e);if(n)for(let r=n.length-1;r>=0;--r){let i=n[r],a=i&&i.name;typeof a==`string`&&!(t&&L[pt(a)])&&Et(e,i,a)}},At=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0&&arguments[2],r=[e];for(;r.length>0;){let e=r.pop();if(t(e)===!1)continue;if(n&&w(e)===xl.element){let t=y(e);Zt(t)&&r.push(t)}let i=_(e);if(i)for(let e=i.length-1;e>=0;--e)r.push(i[e])}},jt=function(e){At(e,e=>{w(e)===xl.element&&kt(e,!0)})},Mt=function(e){let t=[];return At(e,e=>{t.push(e)},!0),t},Nt=function(e,t){let n=pc();oc(Mt(e),e=>{w(e)===xl.element&&mc(n,e)}),oc(t,e=>{w(e)===xl.element&&!hc(n,e)&&kt(e,!0)})},Pt=function(e,n){let r=!1;return oc(t.removed,t=>{t.element&&(r||=t.element===e,jt(t.element))}),Nt(e,n),r},Ft=function(e,t){Dt(e),Pt(e,t)},It=function(e,t){let n=Ue,r=null,i=()=>(r||(r=pc(),oc(t,e=>{mc(r,e)})),r);for(let t=0;;t++){let r=Mt(e),a=[e],o=!1;if(oc(r,e=>{w(e)===xl.documentFragment?lc(a,e):!o&&!hc(n,e)&&(o=hc(i(),e))}),!o)return;if(t>=8)throw Pc(`the tree kept changing during in-place sanitization; refusing to return it`);oc(a,(t,n)=>{Lt(t,n>0,e,i())})}},Lt=function(e,t,n,r){let i=Ut(e),a;for(;a=i.nextNode();)hc(r,a)&&!hc(Ue,a)&&(t&&$t(M.uponSanitizeShadowNode,a,null),hn(a,n))},Rt=function(e){if(!Ue)return;mc(Ue,e);let t=vc(We,e);if(t!==void 0){if(t>=8)throw Pc(`the tree kept changing during in-place sanitization; refusing to return it`);yc(We,e,t+1)}},zt=function(e){Ue&&(gc(Ue,e),vc(We,e)===void 0&&yc(We,e,0))},Bt=function(e,t){return ke?e===`patchsrc`||e===`for`&&t!==`label`&&t!==`output`:!1},Vt=function(e){ke&&At(e,e=>{let t=w(e);if(t===xl.processingInstruction||t===xl.comment&&Nc(hl,e.data)){try{p(e)}catch{}return!1}if(t===xl.element){let t=e,n=pt(T(e));try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&Bt(`for`,n)&&t.removeAttribute(`for`)}catch{}}return!0})},Ht=function(e){let t=null,r=null;if(Pe)e=`<remove></remove>`+e;else{let t=Sc(e,bl);r=t&&t[0]}dt===`application/xhtml+xml`&&tt===et&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=O?ie(e):e;if(tt===et)try{t=new l().parseFromString(i,dt)}catch{}if(!t||!t.documentElement){t=ce.createDocument(tt,`template`,null);try{t.documentElement.innerHTML=nt?te:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),tt===et?de.call(t,Ae?`html`:`body`)[0]:Ae?t.documentElement:a},Ut=function(e){let t=arguments.length>1&&arguments[1]!==void 0&&arguments[1],n=C?C(e):e.ownerDocument;return le.call(n||e,e,(t?0:c.SHOW_ELEMENT)|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Wt=function(e){return e=Cc(e,pe,` `),e=Cc(e,me,` `),e=Cc(e,he,` `),e},Gt=function(e){Jt(e);let t=e.querySelectorAll?.call(e,`template`);t&&oc(t,e=>{Zt(e.content)&&Gt(e.content)})},Kt=K({},[`caption`,`colgroup`,`col`,`thead`,`tbody`,`tfoot`,`tr`,`td`,`th`,`style`,`script`,`template`]),qt=function(e){if(dt===`application/xhtml+xml`)return;let t=e.querySelectorAll?.call(e,`table,tbody,thead,tfoot,tr,colgroup`);t&&t.length!==0&&oc(t,t=>{oc(uc(_(t)),n=>{let r=w(n);if(!(r===xl.text?Nc(al,n.data):r===xl.element&&!Kt[bc(T(n))]))return;let i=t;for(;i&&bc(T(i))!==`table`;)i=i===e?null:v(i);let a=i&&i!==e?v(i):null;if(a)try{a.insertBefore(n,i)}catch{}})})},Jt=function(e){qt(e),e.normalize();let t=Ut(e,!0),n=null,r=t.nextNode();for(;r;){let e=r.data;if(Nc(ol,e)&&(e=Cc(e,ol,``),r.data=e),Nc(il,e)&&(e=Wt(e),r.data=e),e&&w(r)===xl.text){if(n){let t=n.data;Nc(il,t[t.length-1]+e[0])&&(n.data=Wt(t+e[0]))}n=r}r=t.nextNode()}},Yt=function(e){let t=S?S(e):null;return typeof t!=`string`||pt(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==b(e)||typeof e.removeAttribute!=`function`||typeof e.removeAttributeNode!=`function`||typeof e.getAttributeNode!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==x(e)||e.childNodes!==_(e)},Xt=function(e){if(!x||typeof e!=`object`||!e)return null;try{let t=x(e);return typeof t==`number`?t:null}catch{return null}},Zt=function(e){return Xt(e)===xl.documentFragment},Qt=function(e){return Xt(e)!==null};function $t(e,n,r){e.length!==0&&oc(e,e=>{e.call(t,n,r,mt)})}let en=function(e,t){let n=!!wl[t],r=!!Sl[t];return!n&&!r&&!Cl[t]||E(e)!==et?!1:n?e.hasChildNodes():Qt(e.firstElementChild)?!0:r&&typeof e.textContent==`string`&&Nc(ml,e.textContent)},tn=function(e,t,n){return!!(ke&&n===xl.element&&e.hasChildNodes()&&!Qt(e.firstElementChild)&&Nc(ml,e.textContent)&&Nc(ml,e.innerHTML)||ke&&n===xl.element&&en(e,t)||n===xl.processingInstruction||ke&&n===xl.comment&&Nc(gl,e.data))},nn=function(e,t){return e instanceof RegExp?Nc(e,t):e instanceof Function&&!!e(t,...[...arguments].slice(2))},rn=function(e,t,n){if(!Se[t]&&un(t)&&nn(xe.tagNameCheck,t))return!1;if(Ve&&!Ke[t]&&!Ke[bc(t)]){let t=v(e),r=_(e);if(r&&t){let i=r.length;for(let a=i-1;a>=0;--a){let i=e===n?f(r[a],!0):r[a];t.insertBefore(i,g(e))}}}return Tt(e),!0},an=function(e,t,n,r){return e.length===0?t:t===n||t===r?zc(t):t},on=function(e,t){return e===t||v(e)!==null?!1:(He&&jt(e),zt(e),!0)},sn=function(e,n){if(Rt(e),$t(M.beforeSanitizeElements,e,null),on(e,n))return!0;if(Yt(e))return Tt(e),!0;let r=pt(T(e)),i=w(e);if(F=an(M.uponSanitizeElement,F,I,Me),$t(M.uponSanitizeElement,e,{tagName:r,allowedTags:F}),on(e,n))return!0;if(tn(e,r,i))return Tt(e),!0;if((Se[r]||!(R.tagCheck instanceof Function&&R.tagCheck(r))&&!F[r])&&rn(e,r,n))return!0;if(i===xl.element&&!wt(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&Nc(_l,e.innerHTML))return Tt(e),!0;if(Oe&&i===xl.text){let n=e.textContent,r=Wt(n);n!==r&&(lc(t.removed,{element:e.cloneNode()}),e.textContent=r)}return $t(M.afterSanitizeElements,e,null),on(e,n)},cn=function(e,t,r){if(Ce[t]||Bt(t,e)||Re&&(t===`id`||t===`name`)&&(r in n||r in gt))return!1;let i=L[t]||R.attributeCheck instanceof Function&&R.attributeCheck(t,e);if(Te&&Nc(N,t)||we&&Nc(P,t))return!0;if(!i)return un(e)&&nn(xe.tagNameCheck,e)&&nn(xe.attributeNameCheck,t,e)||t===`is`&&xe.allowCustomizedBuiltInElements&&nn(xe.tagNameCheck,r);if(Xe[t])return!0;let a=Cc(r,_e,``);return Nc(ye,a)||(t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&wc(r,`data:`)===0&&Je[e]||Ee&&!Nc(ge,a)?!0:!r},ln=K({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),un=function(e){return!ln[bc(e)]&&Nc(ve,e)},dn=function(e,t,n,r){if(O&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!n)switch(u.getAttributeType(e,t)){case`TrustedHTML`:return ie(r);case`TrustedScriptURL`:return ae(r)}return r},fn=function(e,t,n,r){try{return n?e.setAttributeNS(n,t,r):e.setAttribute(t,r),!Yt(e)||(Tt(e),!1)}catch{return Ot(t,e),!1}},pn=function(e,t){return ke&&Nc(yl,t)?!0:bc(e)===`attributename`&&wc(t,`href`)!==-1},mn=function(e,n){if($t(M.beforeSanitizeAttributes,e,null),on(e,n))return;let r=D(e);if(!r||Yt(e))return;L=an(M.uponSanitizeAttribute,L,be,Ne);let i={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:L,forceKeepAttr:void 0},a=r.length,o=pt(T(e));for(;a--;){let n=r[a];if(!n)continue;let s=n.name,c=n.namespaceURI,l=n.value,u=pt(s),d=l,f=s===`value`?d:Tc(d),p=!1;i.attrName=u,i.attrValue=f,i.keepAttr=!0,i.forceKeepAttr=void 0,$t(M.uponSanitizeAttribute,e,i),f=i.attrValue,ze&&(u===`id`||u===`name`)&&wc(f,Be)!==0&&(Ot(s,e,n),f=Be+f,p=!0),pn(s,f)?Ot(s,e,n):i.forceKeepAttr||(i.keepAttr?!De&&Nc(vl,f)?Ot(s,e,n):(Oe&&(f=Wt(f)),cn(o,u,f)?(f=dn(o,u,c,f),f!==d&&fn(e,s,c,f)&&p&&cc(t.removed)):Ot(s,e,n)):Ot(s,e,n))}$t(M.afterSanitizeAttributes,e,null),on(e,n)},hn=function(e,t){sn(e,t),mn(e,t),Zt(e.content)&&gn(e.content)},gn=function(e){let t=null,n=Ut(e);for($t(M.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if($t(M.uponSanitizeShadowNode,t,null),hn(t,e),w(t)===xl.element){let e=y(t);Zt(e)&&(_n(e),gn(e))}Oe&&Jt(e),$t(M.afterSanitizeShadowDOM,e,null)},_n=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){gn(e.shadow);continue}let n=e.node,r=w(n)===xl.element,i=_(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=S?S(n):null;if(typeof e==`string`&&pt(e)===`template`){let e=n.content;Zt(e)&&t.push({node:e,shadow:null})}}if(r){let e=y(n);Zt(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}},vn=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(nt=!e,nt&&(e=`<!-->`),typeof e!=`string`&&!Qt(e)&&(e=Bc(e),typeof e!=`string`))throw Pc(`dirty is not a string, aborting`);if(!t.isSupported)return e;je?(F=Me,L=Ne):vt(n),ht=mt,t.removed=[];let c=He&&typeof e!=`string`&&Qt(e),l=[],u=Ue,d=We;if(c){Vt(e),l=Mt(e);let t=T(e);if(typeof t==`string`){let n=pt(t);if(!F[n]||Se[n])throw Ft(e,l),Pc(`root node is forbidden and cannot be sanitized in-place`)}if(Yt(e))throw Ft(e,l),Pc(`root node is clobbered and cannot be sanitized in-place`);Ue=pc(),We=_c()}else if(Qt(e))i=Ht(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===xl.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),_n(i);else{if(!Fe&&!Oe&&!Ae&&e.indexOf(`<`)===-1)return j(e);if(i=Ht(e),!i)return Fe?null:Le?te:``}i&&Pe&&Tt(i.firstChild);let f=c?e:i;try{c&&_n(e);let t=Ut(f);for(;o=t.nextNode();)hn(o,f);c&&It(e,l)}catch(t){throw c&&Ft(e,l),t}finally{Ue=u,We=d}if(c){if(Pt(e,l))throw Pc(`a node selected for removal could not be safely returned; refusing to sanitize in place`);return Oe&&Gt(e),e}if(Fe){if(Oe&&Gt(i),Ie)for(s=ue.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(L.shadowroot||L.shadowrootmode)&&(s=fe.call(r,s,!0)),s}Oe&&Jt(i);let p=Ae?i.outerHTML:i.innerHTML;return Ae&&F[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&Nc(fl,i.ownerDocument.doctype.name)&&(p=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
11
+ `+p),j(p)};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=ht,i=F,a=L,o=t.removed;ht=null;try{return vn(e,n)}finally{ht=r,r&&(je||vt(r),F=i,L=a,t.removed=o)}},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};vt(e),je=!0,Me=F,Ne=L},t.clearConfig=function(){mt=null,je=!1,Me=null,Ne=null,O=k,te=``},t.isValidAttribute=function(e,t,n){mt||vt({});let r=pt(e),i=pt(t);return typeof n==`string`&&(pn(t,n)||!De&&Nc(vl,n))?!1:cn(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&Ac(M,e)&&lc(M[e],t)},t.removeHook=function(e,t){if(Ac(M,e)){if(t!==void 0){let n=sc(M[e],t);return n===-1?void 0:dc(M[e],n,1)[0]}return cc(M[e])}},t.removeHooks=function(e){Ac(M,e)&&(M[e]=[])},t.removeAllHooks=function(){M=Dl()},t}var jl=Al(),Ml=`default-src 'none'; style-src 'unsafe-inline'; img-src data:`,Nl=`default-src 'none'; style-src 'unsafe-inline'; img-src data: https:`,Pl=`body{margin:0;padding:12px;font-family:ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;font-size:14px;line-height:1.5;color:#1b1f27;overflow-wrap:anywhere}img{max-width:100%;height:auto}`,Fl={FORBID_ATTR:[`shadowrootclonable`,`shadowrootdelegatesfocus`,`shadowrootmode`,`shadowrootserializable`],FORBID_TAGS:[`audio`,`base`,`button`,`embed`,`form`,`frame`,`frameset`,`iframe`,`input`,`link`,`math`,`meta`,`object`,`script`,`select`,`source`,`svg`,`template`,`textarea`,`track`,`video`],USE_PROFILES:{html:!0},WHOLE_DOCUMENT:!0},Il=/url\(|image-set\(|@import/i,Ll=/url\(([^)]*)\)/gi,Rl=/image-set\([^;}]*/gi,zl=/@import[^;]*;?/gi;function Bl(e,t){let n=e.trim(),r=(t.includes(`http`)||t.includes(`https`)?/^(https?):\/\//i:/^mailto:/i).test(n),i=t.includes(`mailto`)&&/^mailto:/i.test(n);if(!r&&!i)return null;try{let e=new URL(n),r=e.protocol.slice(0,-1);return t.some(e=>e===r)?e.href:null}catch{return null}}function Vl(e){return/^data:image\//i.test(e.trim())}function Hl(e,t){if(e.includes(`\\`))return null;let n=!1,r=e.replaceAll(zl,()=>(n=!0,``)).replaceAll(Rl,()=>(n=!0,`none`)).replaceAll(Ll,(e,r)=>{let i=r.trim().replaceAll(/^['"]|['"]$/g,``);return Vl(i)||t&&Bl(i,[`https`])!==null?e:(n=!0,`none`)});return{blanked:n,css:r}}function Ul(e,t){let n=t(e),r=t(n);if(r===n)return r;let i=t(r);return i===r?i:null}function Wl(e){let t=new DOMParser().parseFromString(e,`text/html`),n=[...t.querySelectorAll(`style`)];if(n.length===0)return e;for(let e of n){let t=e.textContent.replaceAll(`<!--`,``).replaceAll(`-->`,``);t.includes(`<`)?e.remove():e.textContent=t}return`<!doctype html>${t.documentElement.outerHTML}`}function Gl(e,t,n){let r=jl.sanitize(Wl(e),Fl),i=new DOMParser().parseFromString(r,`text/html`);for(let e of i.querySelectorAll(`base, embed, frame, frameset, iframe, link, meta, object, script, svg, math, template, track`))e.remove();for(let e of i.querySelectorAll(`*`))for(let t of[...e.attributes]){let n=t.name.toLowerCase();(n.startsWith(`on`)||n===`referrerpolicy`||n.startsWith(`shadowroot`))&&e.removeAttribute(t.name)}for(let e of i.querySelectorAll(`[action], [formaction]`))e.removeAttribute(`action`),e.removeAttribute(`formaction`);for(let e of i.querySelectorAll(`a, area`)){for(let t of[`href`,`xlink:href`]){let n=e.getAttribute(t);if(n===null)continue;let r=Bl(n,[`http`,`https`,`mailto`]);r===null?e.removeAttribute(t):e.setAttribute(t,r)}e.removeAttribute(`download`),e.removeAttribute(`ping`),e.setAttribute(`target`,`_blank`),e.setAttribute(`rel`,`noopener noreferrer`)}for(let e of i.querySelectorAll(`img`)){let r=e.getAttribute(`src`),i=e.getAttribute(`srcset`);if(i!==null&&(e.removeAttribute(`srcset`),/(?:https?:)?\/\//i.test(i)&&!t&&n()),r===null)continue;if(Vl(r)){e.setAttribute(`src`,r.trim());continue}let a=Bl(r,[`https`]);a===null?e.removeAttribute(`src`):t?e.setAttribute(`src`,a):(e.removeAttribute(`src`),n())}for(let e of i.querySelectorAll(`source[srcset]`))e.removeAttribute(`srcset`),n();for(let e of i.querySelectorAll(`[background]`)){let r=e.getAttribute(`background`)??``;e.removeAttribute(`background`),/^\s*(?:https?:)?\/\//i.test(r)&&!t&&n()}for(let e of i.querySelectorAll(`[style]`)){let r=e.getAttribute(`style`)??``;if(!Il.test(r)&&!r.includes(`\\`))continue;let i=Hl(r,t);(i===null||i.blanked)&&(e.removeAttribute(`style`),t||n())}for(let e of i.querySelectorAll(`style`)){let r=Hl(e.textContent,t);r===null?(e.remove(),n()):r.blanked&&(e.textContent=r.css,t||n())}return`<!doctype html>${i.documentElement.outerHTML}`}function Kl(e,t){if(!jl.isSupported)return{_tag:`Unsafe`};let n=!1,r=!0,i;try{i=Ul(e,e=>{let i=r;return r=!1,Gl(e,t.allowImages,()=>{i&&(n=!0)})})}catch{return{_tag:`Unsafe`}}if(i===null)return{_tag:`Unsafe`};let a=new DOMParser().parseFromString(i,`text/html`),o=a.createElement(`meta`);o.setAttribute(`http-equiv`,`Content-Security-Policy`),o.setAttribute(`content`,t.allowImages?Nl:Ml);let s=a.createElement(`meta`);s.setAttribute(`name`,`referrer`),s.setAttribute(`content`,`no-referrer`);let c=a.createElement(`style`);return c.textContent=Pl,a.head.prepend(o,s,c),{_tag:`Html`,blockedSomething:n,srcdoc:`<!doctype html>${a.documentElement.outerHTML}`}}function ql({html:e,title:t,unsafe:n}){let[r,i]=(0,d.useState)(!1),a=(0,d.useMemo)(()=>Kl(e,{allowImages:!1}),[e]),o=(0,d.useMemo)(()=>r?Kl(e,{allowImages:!0}):a,[r,a,e]);return a._tag===`Unsafe`||o._tag===`Unsafe`?(0,h.jsx)(h.Fragment,{children:n}):(0,h.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[a.blockedSomething&&!r?(0,h.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2 rounded-md bg-muted px-3 py-2 text-sm`,children:[(0,h.jsxs)(`span`,{className:`flex items-center gap-2 text-muted-foreground`,children:[(0,h.jsx)(Po,{"aria-hidden":`true`,className:`size-4 shrink-0`}),`Images from the internet are blocked.`]}),(0,h.jsx)(W,{onClick:()=>{i(!0)},variant:`outline`,children:`Show images`})]}):null,(0,h.jsx)(`iframe`,{className:`h-[32rem] max-h-[70dvh] w-full rounded-md border border-border bg-white`,sandbox:`allow-popups allow-popups-to-escape-sandbox`,srcDoc:o.srcdoc,title:t})]})}function Jl(e){switch(e.state){case`failed`:return e.isOutcomeUncertain?`May have been sent`:`Failed`;case`queued`:return`Sending…`;case`sent`:return`Sent`}}function Yl(e){switch(e.state){case`failed`:return e.isOutcomeUncertain?`text-amber-700 dark:text-amber-300`:`text-red-700 dark:text-red-300`;case`queued`:return`text-muted-foreground`;case`sent`:return`text-foreground`}}function Xl(){let{id:e,name:t}=Xn();return vi(t,`The route always has an app name.`),vi(e,`The route always has a message id.`),(0,h.jsx)(Zl,{id:e,name:t},e)}function Zl({id:e,name:t}){let n=ps(t,e);return(0,h.jsxs)(`div`,{className:`flex min-h-full flex-col bg-background`,children:[(0,h.jsx)(`div`,{className:`border-b border-border bg-surface`,children:(0,h.jsxs)(oi,{className:`inline-flex min-h-12 items-center gap-1 px-3 text-sm font-medium text-accent-text outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-inset md:min-h-10 md:px-5`,to:ks(t),children:[(0,h.jsx)(Eo,{"aria-hidden":`true`,className:`size-4`}),`Back to the log of `,t]})}),n.isPending?(0,h.jsxs)(`div`,{"aria-busy":`true`,"aria-label":`Loading the message`,className:`flex flex-col gap-3 p-4 md:p-6`,role:`status`,children:[(0,h.jsx)(oo,{className:`h-6 w-1/2`}),(0,h.jsx)(oo,{className:`h-4 w-2/3`}),(0,h.jsx)(oo,{className:`h-64 w-full`})]}):null,n.isError?(0,h.jsxs)(`div`,{className:`flex flex-col items-start gap-3 p-4 md:p-6`,role:`alert`,children:[(0,h.jsx)(`p`,{className:`text-sm`,children:n.error.message}),(0,h.jsx)(W,{onClick:()=>{n.refetch()},variant:`outline`,children:`Try again`})]}):null,n.isSuccess?(0,h.jsx)(Ql,{message:n.data}):null]})}function Ql({message:e}){let t=e.html!==null&&e.html!==``,[n,r]=(0,d.useState)(t?`html`:`text`),i=[[`From`,e.from],[`To`,e.to],...e.replyTo===null?[]:[[`Reply-To`,e.replyTo]],[`Template`,e.templateName],[`Idempotency key`,e.idempotencyKey],[`State`,Jl(e)],[`Created`,eu(e.createdAt)],...e.sentAt===null?[]:[[`Sent`,eu(e.sentAt)]]];return(0,h.jsxs)(`article`,{className:`flex flex-col gap-4 p-4 md:p-6`,children:[(0,h.jsx)(`h2`,{className:`text-lg font-semibold break-words`,children:e.subject===``?`(no subject)`:e.subject}),(0,h.jsx)(`ul`,{"aria-label":`Details`,className:`flex flex-col gap-2 text-sm sm:gap-1`,children:i.map(([e,t])=>(0,h.jsxs)(`li`,{className:`flex flex-col sm:flex-row sm:gap-4`,children:[(0,h.jsx)(`span`,{className:`shrink-0 text-muted-foreground sm:w-32`,children:e}),(0,h.jsx)(`span`,{className:`min-w-0 wrap-anywhere`,children:t})]},e))}),e.state===`failed`&&e.notice!==null?(0,h.jsx)(`p`,{className:`rounded-md border border-red-300 bg-red-50 p-3 text-sm wrap-anywhere text-red-900 dark:border-red-800 dark:bg-red-950 dark:text-red-100`,role:`alert`,children:e.notice}):null,e.isBodyExpired?(0,h.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`The content of this message is no longer stored.`}):(0,h.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,h.jsxs)(`div`,{"aria-label":`Content`,className:`flex gap-1`,role:`tablist`,children:[t?(0,h.jsx)($l,{isSelected:n===`html`,label:`HTML`,onSelect:()=>r(`html`)}):null,(0,h.jsx)($l,{isSelected:n===`text`,label:`Text`,onSelect:()=>r(`text`)})]}),(0,h.jsx)(`div`,{role:`tabpanel`,children:n===`html`&&e.html!==null?(0,h.jsx)(ql,{html:e.html,title:`Message from ${e.from}`,unsafe:(0,h.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`This message could not be displayed safely. Open the Text tab instead.`})}):(0,h.jsx)(`p`,{className:U(`text-sm leading-relaxed break-words whitespace-pre-wrap`,(e.text??``)===``&&`text-muted-foreground`),children:(e.text??``)===``?`This message has no text.`:e.text})})]})]})}function $l({isSelected:e,label:t,onSelect:n}){return(0,h.jsx)(`button`,{"aria-selected":e,className:U(`min-h-11 rounded-md px-4 text-sm font-medium outline-none focus-visible:ring-2 focus-visible:ring-accent md:min-h-8`,e?`bg-accent-soft text-accent-text`:`text-muted-foreground hover:bg-muted`),onClick:n,role:`tab`,type:`button`,children:t})}function eu(e){let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString(void 0,{dateStyle:`medium`,timeStyle:`short`})}var tu=`Courier Crow`,nu={dark:[[.19,.012,255],[.22,.014,255]],light:[[.975,.004,255],[.995,.002,255]]},q={blue:255,green:255,red:255},ru=`#0b0f19`;function iu(e){let t=/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i.exec(e),n=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(e),r=t===null?n?.slice(1):t.slice(1).map(e=>e+e);if(r===void 0)return;let[i,a,o]=r.map(e=>Number.parseInt(e,16));return i===void 0||a===void 0||o===void 0?void 0:{blue:o,green:a,red:i}}function au(e){let t=Math.min(1,Math.max(0,e)),n=t<=.0031308?12.92*t:1.055*t**(1/2.4)-.055;return Math.round(n*255)}function ou(e,t,n){let r=n*Math.PI/180,i=t*Math.cos(r),a=t*Math.sin(r),o=(e+.3963377774*i+.2158037573*a)**3,s=(e-.1055613458*i-.0638541728*a)**3,c=(e-.0894841775*i-1.291485548*a)**3;return{blue:au(-.0041960863*o-.7034186147*s+1.707614701*c),green:au(-1.2684380046*o+2.6097574011*s-.3413193965*c),red:au(4.0767416621*o-3.3077115913*s+.2309699292*c)}}function su(e){let t=e=>{let t=e/255;return t<=.04045?t/12.92:((t+.055)/1.055)**2.4};return .2126*t(e.red)+.7152*t(e.green)+.0722*t(e.blue)}function cu(e,t){let[n,r]=[su(e),su(t)].sort((e,t)=>t-e);return((n??0)+.05)/((r??0)+.05)}var lu=4.5,uu=.18;function du(e){let t=e/255;return t<=.04045?t/12.92:((t+.055)/1.055)**2.4}function fu(e){let t=du(e.red),n=du(e.green),r=du(e.blue),i=Math.cbrt(.4122214708*t+.5363325363*n+.0514459929*r),a=Math.cbrt(.2119034982*t+.6806995451*n+.1073969566*r),o=Math.cbrt(.0883024619*t+.2817188376*n+.6299787005*r),s=.2104542553*i+.793617785*a-.0040720468*o,c=1.9779984951*i-2.428592205*a+.4505937099*o,l=.0259040371*i+.7827717662*a-.808675766*o,u=Math.atan2(l,c)*180/Math.PI;return[s,Math.hypot(c,l),u<0?u+360:u]}function pu(e){return fu(iu(e)??q)}function mu(e){return`#${[e.red,e.green,e.blue].map(e=>e.toString(16).padStart(2,`0`)).join(``)}`}function hu([e,t,n]){return mu(ou(e,t,n))}function gu(e,t,n){let[r,i]=t[2]-e[2]>180?[e[2]+360,t[2]]:e[2]-t[2]>180?[e[2],t[2]+360]:[e[2],t[2]],a=(e,t)=>e*n+t*(1-n);return[a(e[0],t[0]),a(e[1],t[1]),a(r,i)%360]}function _u(e,t){let[n,r,i]=pu(e),[a]=nu[t],o=hu(gu([n,r,i],[a[0],a[1],i],uu)),s=[iu(o)??q,...nu[t].map(([e,t,n])=>ou(e,t,n))],c=e=>s.every(t=>cu(e,t)>=lu);if(c(iu(e)??q))return{soft:o,text:e.toLowerCase()};let l=t===`dark`?.01:-.01;for(let e=n+l;e>0&&e<1;e+=l){let t=ou(e,r,i);if(c(t))return{soft:o,text:mu(t)}}return{soft:o,text:t===`dark`?`#ffffff`:`#000000`}}function vu(e){return{dark:_u(e,`dark`),light:_u(e,`light`)}}function yu(e){let t=iu(e)??q;return cu(t,q)>=cu(t,iu(ru)??q)?`#ffffff`:ru}var bu=1048576,xu={attachmentCount:32,htmlBytes:5e5,recipientCount:50,sizeInBytes:25*bu,subjectLength:1e3,textBytes:5e5},Su={keyLength:200,lastStepAfterMilliseconds:7776e6,nameLength:100,stepCount:10};2*Su.stepCount*(xu.htmlBytes+xu.textBytes)+65536,`${Su.keyLength}`,`${Su.nameLength}`;var Cu=/^[^\s\p{Cc}@<>",;.\u00ad\u061c\u200b-\u200f\u202a-\u202e\u2060\u2066-\u2069\ufeff]+(\.[^\s\p{Cc}@<>",;.\u00ad\u061c\u200b-\u200f\u202a-\u202e\u2060\u2066-\u2069\ufeff]+)*@[^\s\p{Cc}@<>",;.\u00ad\u061c\u200b-\u200f\u202a-\u202e\u2060\u2066-\u2069\ufeff]+(\.[^\s\p{Cc}@<>",;.\u00ad\u061c\u200b-\u200f\u202a-\u202e\u2060\u2066-\u2069\ufeff]+)+$/u;function wu(e){return Math.ceil(e*4/3)}function Tu(e){return e<1024?`${e} B`:e<1048576?`${Bu(e/1024)} KiB`:`${Bu(e/bu)} MiB`}function Eu(e){let t=Du(e,` `).replaceAll(/ {2,}/g,` `).replace(/^(\s*re:\s*)+/i,``).trim();return t===``?`Re: (no subject)`:`Re: ${t}`}function Du(e,t=``){return e.replaceAll(/\p{Cc}/gu,t)}function Ou(e){return`This message is ${Math.ceil(e/bu)} MiB. The limit is ${xu.sizeInBytes/bu} MiB. Remove an attachment or share a link instead.`}var ku=[`none`,`contacted`,`replied`,`interested`,`not interested`,`customer`],Au={exportRows:1e4,newAddressesNotice:20,noteLength:2e3,snippetNameLength:60,snippetTextLength:1e4},ju={changedWhileEditing:`Someone else changed this while you were editing. Reload to see their version, then make your change again.`,exportTooLarge:`This list has more than 10,000 contacts. Narrow it with a filter or search and export again.`,noteTooLong:`A note can be at most 2,000 characters.`,noteWithoutTime:`Send noteUpdatedAt with the note: the noteUpdatedAt of the contact as you last read it.`,snippetNameMissing:`Give the snippet a name.`,snippetNameTooLong:`A snippet name can be at most 60 characters.`};function Mu(e){return`A snippet can be at most 10,000 characters. This one has ${e.toLocaleString(`en-US`)}.`}var Nu=/\{\{[^{}]*\}\}/g,Pu=/\{\{\s*(firstName|myName|name)\s*\}\}/g;function Fu(e,t){return e.replaceAll(Pu,(e,n)=>{let r=t[n]?.trim()??``;return r===``?e:r})}function Iu(e){return[...e.matchAll(Nu)].map(e=>({end:e.index+e[0].length,start:e.index,text:e[0]}))}function Lu(e){let t=e?.trim().split(/\s+/)[0]??``;return t===``?null:t}function Ru(e){return`This message still contains ${e}. Send it anyway?`}function zu(e){return[...e].length}function Bu(e){return String(Math.round(e*10)/10)}function Vu(e){return e?.branding?.name??`Courier Crow`}function Hu(e){(0,d.useEffect)(()=>{if(e==null||iu(e)===void 0)return;let t=document.documentElement.style,n=vu(e),r={"--accent":e,"--accent-foreground":yu(e),"--accent-soft-dark":n.dark.soft,"--accent-soft-light":n.light.soft,"--accent-text-dark":n.dark.text,"--accent-text-light":n.light.text};for(let[e,n]of Object.entries(r))t.setProperty(e,n);return()=>{for(let e of Object.keys(r))t.removeProperty(e)}},[e])}function Uu(e,t){let n=URL.createObjectURL(e),r=document.createElement(`a`);r.href=n,r.download=t;try{document.body.append(r),r.click()}finally{r.remove(),setTimeout(()=>{URL.revokeObjectURL(n)},0)}}var Wu=3e5;function Gu(e,t){return Qo(`/api/apps/${encodeURIComponent(e)}/suppressions/${encodeURIComponent(t)}`,{method:`DELETE`})}async function Ku(e,t){let{blob:n,filename:r}=await $o(`/api/mailboxes/${encodeURIComponent(e)}/contacts.csv?${t.toString()}`);Uu(n,r??`contacts.csv`)}function qu(e,t){return Qo(`/api/mailboxes/${encodeURIComponent(e)}/snippets`,ad(`POST`,t))}function Ju(e,t){return Qo(`/api/mailboxes/${encodeURIComponent(e)}/drafts`,ad(`POST`,t))}function Yu(e,t){return Qo(`/api/mailboxes/${encodeURIComponent(e)}/snippets/${encodeURIComponent(t)}`,{method:`DELETE`})}function Xu(e){return Qo(`/api/drafts/${encodeURIComponent(e)}`,{method:`DELETE`})}function Zu(e){return Qo(`/api/messages/${encodeURIComponent(e)}/give-up`,{method:`POST`})}function Qu(e,t={}){return Qo(`/api/messages/${encodeURIComponent(e)}/retry`,t.confirmPossibleDuplicate===!0?ad(`POST`,{confirmPossibleDuplicate:!0}):{method:`POST`})}function $u(e){return Qo(`/api/drafts/${encodeURIComponent(e)}/send`,{method:`POST`})}function J(e,t){return Qo(`/api/threads/${encodeURIComponent(e)}/flags`,ad(`POST`,t))}function Y(e,t){return Qo(`/api/drafts/${encodeURIComponent(e)}`,ad(`PUT`,t))}function ed(e,t,n){return Qo(`/api/mailboxes/${encodeURIComponent(e)}/contacts/${encodeURIComponent(t)}`,ad(`PUT`,n))}function td(e,t,n){return Qo(`/api/mailboxes/${encodeURIComponent(e)}/snippets/${encodeURIComponent(t)}`,ad(`PUT`,n))}function nd(e){if(e===``)return!1;try{return new URL(e,window.location.href).origin!==window.location.origin}catch{return!1}}function rd(){return new DOMException(`The upload was cancelled.`,`AbortError`)}var id=(e,t,n,r)=>new Promise((i,a)=>{if(r.aborted){a(rd());return}let o=new XMLHttpRequest,s=new URLSearchParams({filename:t.name});function c(){o.abort()}r.addEventListener(`abort`,c,{once:!0}),o.onabort=()=>{r.removeEventListener(`abort`,c),a(rd())},o.open(`POST`,`/api/mailboxes/${encodeURIComponent(e)}/attachments?${s}`),o.timeout=Wu,o.setRequestHeader(`content-type`,t.type===``?`application/octet-stream`:t.type),o.upload.onprogress=e=>{e.lengthComputable&&n(e.loaded/e.total)},o.onerror=()=>{r.removeEventListener(`abort`,c);let e=new Zo(`You seem to be offline. Check your connection and try again.`,0);Qo(`/api/me`).then(()=>{a(e)},t=>{a(t instanceof Zo&&t.status!==0?t:e)})},o.ontimeout=()=>{r.removeEventListener(`abort`,c),a(new Zo(`The upload took too long. Try again.`,0))},o.onload=()=>{if(r.removeEventListener(`abort`,c),o.status===401||nd(o.responseURL)||o.status>=200&&o.status<300&&!(o.getResponseHeader(`content-type`)??``).includes(`json`))cs().then(i,a);else{if(o.status>=200&&o.status<300)try{let e=JSON.parse(o.responseText);if(typeof e==`object`&&e&&`id`in e&&typeof e.id==`string`){i({id:e.id});return}}catch{}a(new Zo(od(o.responseText),o.status))}},o.send(t)});function ad(e,t){return{body:JSON.stringify(t),headers:{"content-type":`application/json`},method:e}}function od(e){try{let t=JSON.parse(e);if(typeof t==`object`&&t&&`message`in t&&typeof t.message==`string`)return t.message}catch{}return`Something went wrong. Try again.`}function sd(e){switch(e){case`active`:return`Active`;case`cancelled`:return`Cancelled`;case`finished`:return`Finished`;case`unsubscribed`:return`Unsubscribed`}}function cd(e){switch(e){case`active`:return`text-foreground`;case`cancelled`:case`finished`:return`text-muted-foreground`;case`unsubscribed`:return`text-amber-700 dark:text-amber-300`}}function ld(e){switch(e.state){case`failed`:return e.isOutcomeUncertain?`May have been sent`:`Failed`;case`queued`:return`Sending…`;case`scheduled`:return`Scheduled`;case`sent`:return`Sent`;case`skipped`:return`Skipped`}}function ud(e){switch(e.state){case`failed`:return e.isOutcomeUncertain?`text-amber-700 dark:text-amber-300`:`text-red-700 dark:text-red-300`;case`queued`:case`scheduled`:case`skipped`:return`text-muted-foreground`;case`sent`:return`text-foreground`}}function dd(e){let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString(void 0,{dateStyle:`medium`,timeStyle:`short`})}var fd=864e5;function pd(e){return e.length===0?`No sender`:e.length<=3?e.join(`, `):`${e.slice(0,2).join(`, `)} +${e.length-2}`}function md(e,t){let n=new Date(e),{locale:r,now:i,timeZone:a}=t;if(Number.isNaN(n.getTime()))return``;let o=hd(i,a,r)-hd(n,a,r);return o<=0?n.toLocaleTimeString(r,{hour:`2-digit`,minute:`2-digit`,timeZone:a}):o<7?n.toLocaleDateString(r,{timeZone:a,weekday:`short`}):gd(n,a)===gd(i,a)?n.toLocaleDateString(r,{day:`numeric`,month:`short`,timeZone:a}):n.toLocaleDateString(r,{day:`numeric`,month:`short`,timeZone:a,year:`numeric`})}function hd(e,t,n){let r=new Intl.DateTimeFormat(n??`en-US`,{day:`numeric`,month:`numeric`,timeZone:t,year:`numeric`}).formatToParts(e),i=e=>Number(r.find(t=>t.type===e)?.value);return Math.floor(Date.UTC(i(`year`),i(`month`)-1,i(`day`))/fd)}function gd(e,t){return Number(new Intl.DateTimeFormat(`en-US`,{timeZone:t,year:`numeric`}).format(e))}var _d=ku;function vd(e){switch(e){case`contacted`:return`Contacted`;case`customer`:return`Customer`;case`interested`:return`Interested`;case`none`:return`No status`;case`not interested`:return`Not interested`;case`replied`:return`Replied`}}function yd(e){switch(e){case`customer`:case`interested`:return`bg-green-100 text-green-900 dark:bg-green-950 dark:text-green-100`;case`none`:case`not interested`:return`bg-muted text-muted-foreground`;case`replied`:return`bg-accent-soft text-accent-text`;default:return`bg-amber-100 text-amber-900 dark:bg-amber-950 dark:text-amber-100`}}var bd=10,xd=`mailbox:unsaved`,Sd=new Map,Cd=new Set,wd=!0;function Td(){for(let e of Cd)e()}function Ed(){try{let e=[...Sd].map(([e,t])=>t.kind===`draft`?{...t.draft,key:e}:{...t.note,key:e,kind:`note`});window.sessionStorage.setItem(xd,JSON.stringify(e)),wd=!0}catch{wd=!1}}function Dd(e){return Array.isArray(e)&&e.every(e=>typeof e==`string`)}function Od(e){if(typeof e!=`object`||!e)return null;let t=e;if(t.kind===`note`){let{contact:e,key:n,mailbox:r,message:i,note:a,noteUpdatedAt:o}=t;return typeof e!=`string`||typeof n!=`string`||typeof r!=`string`||typeof i!=`string`||typeof a!=`string`||o!==null&&typeof o!=`string`?null:{entry:{kind:`note`,note:{contact:e,mailbox:r,message:i,note:a,noteUpdatedAt:o}},key:n}}let{cc:n,draftId:r,from:i,isConflict:a,key:o,message:s,replyToMessageId:c,subject:l,text:u,to:d}=t;return typeof o!=`string`||typeof i!=`string`||typeof a!=`boolean`||typeof s!=`string`||typeof l!=`string`||typeof u!=`string`||!Dd(n)||!Dd(d)||r!==null&&typeof r!=`string`||c!==void 0&&typeof c!=`string`?null:{entry:{draft:{cc:n,draftId:r,from:i,isConflict:a,message:s,replyToMessageId:c,subject:l,text:u,to:d},kind:`draft`},key:o}}function kd(){for(let e of[`draft`,`note`]){let t=[...Sd].filter(([,t])=>t.kind===e).map(([e])=>e);for(let e of t.slice(0,Math.max(0,t.length-bd)))Sd.delete(e)}}function Ad(e,t){Sd.delete(e),Sd.set(e,t),kd(),Ed(),Td()}function jd(){try{let e=JSON.parse(window.sessionStorage.getItem(xd)??`[]`);if(Array.isArray(e)){for(let t of e.slice(-20)){let e=Od(t);e!==null&&Sd.set(e.key,e.entry)}kd(),Td()}}catch{}}function Md(e){Sd.delete(e)&&(Ed(),Td())}function Nd(e={needsLeavePrompt:!1}){return Sd.size>0&&(!e.needsLeavePrompt||!wd)}function Pd(e){return e?.kind===`draft`?e.draft:void 0}function Fd(e){return e?.kind===`note`?e.note:void 0}function Id(e){return Pd(Sd.get(e))}function Ld(e){return Fd(Sd.get(e))}function Rd(e,t){Ad(e,{draft:{cc:t.cc,draftId:t.draftId,from:t.from,isConflict:t.isConflict,message:t.message,replyToMessageId:t.replyToMessageId,subject:t.subject,text:t.text,to:t.to},kind:`draft`})}function zd(e,t){Ad(e,{kind:`note`,note:{contact:t.contact,mailbox:t.mailbox,message:t.message,note:t.note,noteUpdatedAt:t.noteUpdatedAt}})}function Bd(e){return Cd.add(e),()=>{Cd.delete(e)}}function Vd(e){return(0,d.useSyncExternalStore)(Bd,()=>Pd(Sd.get(e)))}function Hd(e){return(0,d.useSyncExternalStore)(Bd,()=>Fd(Sd.get(e)))}typeof window<`u`&&(jd(),window.addEventListener(`beforeunload`,e=>{Nd({needsLeavePrompt:!0})&&e.preventDefault()}));var Ud=class{conflicted=!1;disposed=!1;latest;running=null;saved;timer=null;options;constructor(e){this.latest=e.initial,this.options=e,this.saved=e.initial}get hasUnsavedChanges(){return this.latest!==this.saved||this.running!==null}get isConflicted(){return this.conflicted}get note(){return this.latest}activate(){this.disposed=!1}adopt(e){return this.hasUnsavedChanges||this.timer!==null?!1:(this.latest=e,this.saved=e,!0)}change(e){this.disposed||(this.latest=e,this.clearTimer(),this.conflicted||(this.timer=setTimeout(()=>{this.timer=null,this.save(this.latest)},this.options.delayInMilliseconds)))}dispose(){this.disposed=!0,this.clearTimer()}async disposeAndFlush(){for(this.dispose();this.running!==null;)await this.running.catch(()=>void 0);this.conflicted||await this.drain()}markConflicted(){this.conflicted=!0,this.clearTimer()}async save(e){if(this.latest=e,this.clearTimer(),!this.conflicted){if(this.running!==null)return this.running.catch(()=>void 0);await this.drain().catch(()=>void 0)}}clearTimer(){this.timer!==null&&(clearTimeout(this.timer),this.timer=null)}async drain(){let e=this.saveLatest();this.running=e;try{await e}finally{this.running=null}}report(e,t){this.disposed||this.options.onStatus(e,t)}async saveLatest(){if(this.latest!==this.saved){for(;this.latest!==this.saved&&!this.conflicted;){let e=this.latest;this.report(`saving`);try{await this.options.save(e),this.saved=e}catch(e){throw this.report(`error`,e instanceof Error?e.message:`The note could not be saved. Try again.`),e}}this.conflicted||this.report(`saved`)}}},Wd=2e3;function Gd(e,t){return`note:${e}:${t.toLowerCase()}`}function Kd({contact:e,isReadOnly:t,mailbox:n,onSaved:r,stored:i,storedAt:a}){let o=Gd(n,e),[s]=(0,d.useState)(()=>t?void 0:Ld(o)),c=Hd(o),[l,u]=(0,d.useState)(s?.note??i),[f,p]=(0,d.useState)({message:null,value:`idle`}),m=(0,d.useRef)(s===void 0?a:s.noteUpdatedAt),[h]=(0,d.useState)(()=>new Ud({delayInMilliseconds:Wd,initial:i,onStatus:(e,t)=>{p({message:t??null,value:e}),e===`saved`&&Md(o)},save:async t=>{try{let i=await ed(n,e,{note:t,noteUpdatedAt:m.current});m.current=i.noteUpdatedAt,r(i)}catch(e){throw e instanceof Zo&&e.status===409&&(h.markConflicted(),Md(o)),e}}}));return(0,d.useEffect)(()=>{h.activate(),s!==void 0&&h.save(s.note);function t(t){zd(o,{contact:e,mailbox:n,message:t,note:h.note,noteUpdatedAt:m.current})}let r=ss(()=>{h.hasUnsavedChanges&&!h.isConflicted&&t(`Your session expired while you were writing.`)});function i(e){os()||h.isConflicted||h.hasUnsavedChanges&&(h.save(h.note),e.preventDefault())}return window.addEventListener(`beforeunload`,i),()=>{r(),window.removeEventListener(`beforeunload`,i),h.disposeAndFlush().catch(e=>{e instanceof Zo&&e.status===409||t(e instanceof Error?e.message:`The note could not be saved. Try again.`)})}},[e,n,s,o,h]),(0,d.useEffect)(()=>{a!==m.current&&h.adopt(i)&&(m.current=a,u(i))},[h,i,a]),{change:e=>{u(e),h.change(e)},leave:()=>{h.save(l)},note:l,recoveredMessage:s!==void 0&&c!==void 0?c.message:null,status:f}}var qd=`min-h-11 w-full rounded-md border border-border bg-surface px-3 text-base text-foreground outline-none focus-visible:ring-2 focus-visible:ring-accent disabled:opacity-70 md:min-h-9 md:w-60 md:text-sm`;function Jd({mailbox:e}){let{contactAddress:t}=Xn();vi(t,`The route always has a contact address.`);let n=ys(e.address,t);return(0,h.jsxs)(`div`,{className:`flex min-h-full flex-col bg-background`,children:[(0,h.jsx)(`div`,{className:`border-b border-border bg-surface`,children:(0,h.jsxs)(oi,{className:`inline-flex min-h-12 items-center gap-1 px-3 text-sm font-medium text-accent-text outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-inset`,to:Is(e.address),children:[(0,h.jsx)(Eo,{"aria-hidden":`true`,className:`size-4`}),`Contacts of `,e.address]})}),(0,h.jsx)(`div`,{className:`mx-auto flex w-full max-w-3xl flex-col gap-6 p-4 md:p-6`,children:n.isPending?(0,h.jsxs)(`div`,{"aria-busy":`true`,"aria-label":`Loading the contact`,className:`flex flex-col gap-3`,role:`status`,children:[(0,h.jsx)(oo,{className:`h-6 w-1/2`}),(0,h.jsx)(oo,{className:`h-4 w-2/3`})]}):n.isError?(0,h.jsxs)(`div`,{className:`flex flex-col items-start gap-3`,role:`alert`,children:[(0,h.jsx)(`p`,{className:`text-sm`,children:n.error.message}),(0,h.jsx)(W,{onClick:()=>{n.refetch()},variant:`outline`,children:`Try again`})]}):(0,h.jsx)(Yd,{details:n.data,mailbox:e},n.data.contact.address)})]})}function Yd({details:e,mailbox:t}){let{contact:n,threads:r}=e,i=t.state===`archived`,a=_(),o=n.name??n.address,s=new Date;function c(e){a.setQueryData(vs(t.address,n.address).queryKey,t=>t===void 0?t:{...t,contact:e}),a.invalidateQueries({queryKey:[`contacts`,t.address]})}let l=nt({mutationFn:e=>ed(t.address,n.address,{status:e}),onSuccess:c});return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,h.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,h.jsx)(`h1`,{className:`text-xl font-semibold wrap-anywhere`,children:o}),n.name===null?null:(0,h.jsx)(`p`,{className:`text-sm text-muted-foreground wrap-anywhere`,children:n.address})]}),i?null:(0,h.jsxs)(oi,{className:`inline-flex min-h-11 items-center gap-2 rounded-md bg-accent px-4 text-sm font-medium text-accent-foreground outline-none hover:bg-accent/90 focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 md:min-h-9`,to:Ls(t.address,n.address),children:[(0,h.jsx)(zo,{"aria-hidden":`true`,className:`size-4`}),`Write`]})]}),i?(0,h.jsxs)(`p`,{className:`text-sm`,role:`note`,children:[t.address,` is archived. The status and the note can be read but not changed.`]}):null,(0,h.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,h.jsx)(`label`,{className:`text-sm font-medium`,htmlFor:`contact-status`,children:`Status`}),(0,h.jsx)(`select`,{className:qd,disabled:i||l.isPending,id:`contact-status`,onChange:e=>{let t=_d.find(t=>t===e.target.value);t!==void 0&&l.mutate(t)},value:l.isPending?l.variables??n.status:n.status,children:_d.map(e=>(0,h.jsx)(`option`,{value:e,children:vd(e)},e))}),l.isError?(0,h.jsx)(`p`,{className:`text-sm text-red-700 dark:text-red-300`,role:`alert`,children:l.error.message}):null]}),(0,h.jsx)(Zd,{contact:n,isReadOnly:i,mailbox:t.address,onSaved:c}),(0,h.jsxs)(`ul`,{"aria-label":`Facts`,className:`grid grid-cols-2 gap-3 text-sm sm:grid-cols-3`,children:[(0,h.jsx)(Xd,{label:`Wrote first`,value:n.wroteFirst===`mailbox`?`We did`:`They did`}),(0,h.jsx)(Xd,{label:`Sent`,value:String(n.sentCount)}),(0,h.jsx)(Xd,{label:`Received`,value:String(n.receivedCount)}),(0,h.jsx)(Xd,{label:`First mail`,value:dd(n.firstContactAt)}),(0,h.jsx)(Xd,{label:`Last sent`,value:n.lastSentAt===null?`Never`:dd(n.lastSentAt)}),(0,h.jsx)(Xd,{label:`Last received`,value:n.lastReceivedAt===null?`Never`:dd(n.lastReceivedAt)})]}),(0,h.jsxs)(`section`,{className:`flex flex-col gap-2`,children:[(0,h.jsx)(`h2`,{className:`text-base font-semibold`,children:`Threads`}),(0,h.jsx)(`ul`,{"aria-label":`Threads with ${o}`,className:`flex flex-col divide-y divide-border rounded-lg border border-border bg-surface`,children:r.map(e=>(0,h.jsx)(`li`,{children:(0,h.jsxs)(oi,{className:`flex min-h-12 items-center justify-between gap-3 px-4 py-2 text-sm outline-none hover:bg-muted focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-inset`,to:zs(t.address,e.id),children:[(0,h.jsx)(`span`,{className:e.isRead?`min-w-0 truncate`:`min-w-0 truncate font-semibold`,children:e.subject===``?`(no subject)`:e.subject}),(0,h.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground tabular-nums`,children:md(e.lastMessageAt,{now:s})})]})},e.id))})]})]})}function Xd({label:e,value:t}){return(0,h.jsxs)(`li`,{className:`flex flex-col gap-0.5 rounded-md bg-muted px-3 py-2`,children:[(0,h.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e}),(0,h.jsx)(`span`,{children:t})]})}function Zd({contact:e,isReadOnly:t,mailbox:n,onSaved:r}){let{change:i,leave:a,note:o,recoveredMessage:s,status:c}=Kd({contact:e.address,isReadOnly:t,mailbox:n,onSaved:r,stored:e.note,storedAt:e.noteUpdatedAt});return(0,h.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,h.jsx)(`label`,{className:`text-sm font-medium`,htmlFor:`contact-note`,children:`Note`}),s===null?null:(0,h.jsxs)(`p`,{className:`text-sm text-red-700 dark:text-red-300`,role:`alert`,children:[`Your last changes to the note could not be saved. `,s]}),(0,h.jsx)(so,{className:`min-h-28`,id:`contact-note`,onBlur:a,onChange:e=>{i(e.target.value)},placeholder:t?void 0:`Where things stand, what to do next`,readOnly:t,value:o}),(0,h.jsx)(`p`,{"aria-label":`Note status`,"aria-live":`polite`,className:c.value===`error`?`min-h-5 text-sm text-red-700 dark:text-red-300`:`min-h-5 text-sm text-muted-foreground`,role:`status`,children:c.value===`saving`?`Saving…`:c.value===`saved`?`Saved`:c.value===`error`?`Not saved. ${c.message??`Try again.`}`:``})]})}function Qd({address:e,now:t,thread:n}){let r=!n.isRead;return(0,h.jsxs)(oi,{className:`flex min-h-16 gap-3 border-b border-border px-4 py-2.5 outline-none hover:bg-muted focus-visible:bg-muted focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-inset`,to:zs(e,n.id),children:[(0,h.jsx)(`span`,{className:`flex w-2 shrink-0 justify-center pt-2`,children:r?(0,h.jsx)(`span`,{"aria-label":`Unread`,className:`size-2 rounded-full bg-accent`,role:`img`}):null}),(0,h.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,h.jsxs)(`span`,{className:`flex items-baseline gap-2`,children:[(0,h.jsx)(`span`,{className:U(`min-w-0 flex-1 truncate text-sm`,r?`font-semibold text-foreground`:`text-foreground`),children:pd(n.participants)}),(0,h.jsx)(`time`,{className:U(`shrink-0 text-xs tabular-nums`,r?`font-medium text-accent-text`:`text-muted-foreground`),dateTime:n.lastMessageAt,children:md(n.lastMessageAt,{now:t})})]}),(0,h.jsx)(`span`,{className:U(`truncate text-sm`,r?`text-foreground`:`text-muted-foreground`),children:n.subject})]})]})}var $d=[{label:`Inbox`,value:`open`},{label:`Unread`,value:`unread`},{label:`Archived`,value:`archived`}],ef=300;function tf({address:e}){let[t,n]=ui(),r=of(t.get(`filter`)),i=t.get(`q`)??``,[a,o]=(0,d.useState)(i),s=(0,d.useRef)(i),c=Ds(e,r,i),{fetchNextPage:l}=c,u=(0,d.useCallback)(()=>{l()},[l]);(0,d.useEffect)(()=>{i!==s.current&&o(i),s.current=i},[i]),(0,d.useEffect)(()=>{let e=a.trim();if(e===i)return;let t=setTimeout(()=>{s.current=e,n(t=>{let n=new URLSearchParams(t);return e===``?n.delete(`q`):n.set(`q`,e),n},{replace:!0})},ef);return()=>{clearTimeout(t)}},[i,n,a]);function f(e){n(t=>{let n=new URLSearchParams(t);return e===`open`?n.delete(`filter`):n.set(`filter`,e),n})}let p=new Date,m=c.data?.pages.flatMap(e=>e.threads)??[];return(0,h.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,h.jsxs)(`div`,{className:`flex flex-col gap-2 border-b border-border p-3`,children:[(0,h.jsxs)(`div`,{className:`relative`,children:[(0,h.jsx)(Ro,{"aria-hidden":`true`,className:`pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2 text-muted-foreground`}),(0,h.jsx)(ao,{"aria-label":`Search mail`,className:`pl-9`,onChange:e=>{o(e.target.value)},placeholder:`Search mail`,type:`search`,value:a})]}),(0,h.jsx)(`div`,{"aria-label":`Filter`,className:`flex gap-1`,role:`group`,children:$d.map(e=>(0,h.jsx)(`button`,{"aria-pressed":r===e.value,className:U(`min-h-11 flex-1 rounded-md text-sm font-medium outline-none focus-visible:ring-2 focus-visible:ring-accent md:min-h-8`,r===e.value?`bg-accent-soft text-accent-text`:`text-muted-foreground hover:bg-muted`),onClick:()=>{f(e.value)},type:`button`,children:e.label},e.value))})]}),(0,h.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:[c.isPending?(0,h.jsx)(rf,{}):null,c.isError?(0,h.jsxs)(`div`,{className:`flex flex-col items-start gap-3 p-4`,role:`alert`,children:[(0,h.jsx)(`p`,{className:`text-sm`,children:c.error.message}),(0,h.jsx)(W,{onClick:()=>{c.refetch()},variant:`outline`,children:`Try again`})]}):null,c.isSuccess&&m.length===0?(0,h.jsx)(`p`,{className:`p-4 text-sm text-muted-foreground`,children:nf(e,r,i)}):null,m.length>0?(0,h.jsx)(`ul`,{children:m.map(t=>(0,h.jsx)(`li`,{children:(0,h.jsx)(Qd,{address:e,now:p,thread:t})},t.id))}):null,c.hasNextPage?(0,h.jsx)(af,{isLoading:c.isFetchingNextPage,onLoad:u}):null]})]})}function nf(e,t,n){return n===``?t===`unread`?`No unread mail.`:t===`archived`?`Nothing is archived.`:`No mail in ${e} yet.`:`No mail matches "${n}".`}function rf(){return(0,h.jsx)(`div`,{"aria-busy":`true`,"aria-label":`Loading mail`,role:`status`,children:Array.from({length:8},(e,t)=>(0,h.jsxs)(`div`,{className:`flex flex-col gap-2 border-b border-border px-4 py-3.5`,children:[(0,h.jsx)(oo,{className:`h-3.5 w-2/5`}),(0,h.jsx)(oo,{className:`h-3.5 w-4/5`})]},t))})}function af({isLoading:e,onLoad:t}){let[n,r]=(0,d.useState)(null);return(0,d.useEffect)(()=>{if(n===null||e||typeof IntersectionObserver>`u`)return;let r=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&t()},{rootMargin:`200px`});return r.observe(n),()=>{r.disconnect()}},[e,t,n]),(0,h.jsx)(`div`,{className:`flex justify-center p-3`,ref:r,children:(0,h.jsx)(W,{disabled:e,onClick:t,variant:`ghost`,children:e?`Loading more`:`Load more`})})}function of(e){return e===`archived`||e===`unread`?e:`open`}function sf({draft:e,onDiscard:t}){let n=(0,d.useId)();return(0,h.jsxs)(`section`,{"aria-labelledby":n,className:`flex flex-col items-start gap-2 rounded-md border border-border bg-surface px-3 py-3 text-sm`,children:[(0,h.jsx)(`h2`,{className:`font-semibold`,id:n,children:`Unsaved text`}),(0,h.jsxs)(`p`,{className:`text-muted-foreground`,children:[e.from,` is archived, so this text cannot be sent. Copy what you need, then discard it.`]}),(0,h.jsxs)(`dl`,{className:`flex w-full flex-col gap-1`,children:[e.to.length>0?(0,h.jsxs)(`div`,{className:`flex gap-2`,children:[(0,h.jsx)(`dt`,{className:`w-16 shrink-0 text-muted-foreground`,children:`To`}),(0,h.jsx)(`dd`,{className:`min-w-0 break-words`,children:e.to.join(`, `)})]}):null,e.subject===``?null:(0,h.jsxs)(`div`,{className:`flex gap-2`,children:[(0,h.jsx)(`dt`,{className:`w-16 shrink-0 text-muted-foreground`,children:`Subject`}),(0,h.jsx)(`dd`,{className:`min-w-0 break-words`,children:e.subject})]})]}),(0,h.jsx)(`p`,{className:`w-full rounded-md bg-muted px-3 py-2 break-words whitespace-pre-wrap select-text`,children:e.text===``?`There is no text.`:e.text}),(0,h.jsx)(W,{onClick:t,variant:`outline`,children:`Discard`})]})}var cf=e=>e.type===`checkbox`,lf=e=>e.type===`file`,uf=e=>e instanceof Date,df=e=>e==null,ff=e=>typeof e==`object`,pf=e=>!df(e)&&!Array.isArray(e)&&ff(e)&&!uf(e),mf=e=>pf(e)&&e.target?cf(e.target)?e.target.checked:lf(e.target)?e.target.files:e.target.value:e,hf=/[.[\]'"]/,gf=e=>e.split(hf).filter(Boolean);function _f(e,t){let n=gf(t),r=e._formValues,i=e._defaultValues;for(let e=0;e<n.length-1;e++){let t=n[e];if(r=r==null?r:r[t],i=i==null?i:i[t],r===null||i===null)return null}}var vf=(e,t)=>t.split(`.`).some((t,n,r)=>!isNaN(Number(t))&&e.has(r.slice(0,n).join(`.`))),yf=typeof window<`u`&&window.HTMLElement!==void 0&&typeof document<`u`;function X(e){if(typeof e!=`object`||!e)return e;if(e instanceof Date)return new Date(e);let t=typeof Blob<`u`&&e instanceof Blob,n=typeof FileList<`u`&&e instanceof FileList;if(yf&&(t||n))return e;let r=Array.isArray(e),i=Object.getPrototypeOf(e);if(!r&&i&&i.constructor!==Object)return e;let a=r?Array(e.length):Object.create(i);for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&(a[t]=X(e[t]));return a}var bf={BLUR:`blur`,FOCUS_OUT:`focusout`,CHANGE:`change`,SUBMIT:`submit`,TRIGGER:`trigger`,VALID:`valid`},xf={onBlur:`onBlur`,onChange:`onChange`,onSubmit:`onSubmit`,onTouched:`onTouched`,all:`all`},Sf={max:`max`,min:`min`,maxLength:`maxLength`,minLength:`minLength`,pattern:`pattern`,required:`required`,validate:`validate`},Cf=[Sf.required,Sf.min,Sf.max,Sf.minLength,Sf.maxLength,Sf.pattern,Sf.validate],wf=`form`,Tf=`root`,Ef=[`__proto__`,`constructor`,`prototype`],Df=/^\w*$/,Of=e=>Df.test(e),Z=e=>e===void 0,Q=(e,t,n)=>{if(!t||!pf(e))return n;let r=Of(t)?[t]:gf(t);if(r.some(e=>Ef.includes(e)))return n;let i=r.reduce((e,t)=>df(e)?void 0:e[t],e);return Z(i)||i===e?Z(e[t])?n:e[t]:i},kf=e=>typeof e==`boolean`,Af=e=>typeof e==`function`,jf=(e,t,n)=>{let r=-1,i=Of(t)?[t]:gf(t),a=i.length,o=a-1;for(;++r<a;){let t=i[r],a=n;if(r!==o){let n=e[t];a=pf(n)||Array.isArray(n)?n:isNaN(+i[r+1])?{}:[]}if(Ef.includes(t))return;e[t]=a,e=e[t]}},Mf=d.createContext(null);Mf.displayName=`HookFormControlContext`;var Nf=()=>d.useContext(Mf),Pf=(e,t,n,r=!0)=>{let i={};for(let a in e)Object.defineProperty(i,a,{get:()=>{let i=a;return t._proxyFormState[i]!==xf.all&&(t._proxyFormState[i]=!r||xf.all),n&&(n[i]=!0),e[i]}});return i},Ff=typeof window<`u`?d.useLayoutEffect:d.useEffect,If=e=>{let t=e.constructor&&e.constructor.prototype;return pf(t)&&t.hasOwnProperty(`isPrototypeOf`)},Lf=e=>df(e)||!ff(e),Rf=(e,t)=>t.length===0&&!Array.isArray(e)&&Object.getPrototypeOf(e)!==null&&!If(e);function zf(e,t,n=!1,r=new WeakMap){if(e===t)return!0;if(Lf(e)||Lf(t))return Object.is(e,t);if(uf(e)&&uf(t))return Object.is(e.getTime(),t.getTime());if(Array.isArray(e)&&Array.isArray(t)&&e.length!==t.length)return!1;let i=Object.keys(e),a=Object.keys(t);if(i.length!==a.length)return!1;if(Rf(e,i)||Rf(t,a))return Object.is(e,t);if(!i.length&&Array.isArray(e)!==Array.isArray(t))return!1;let o=r.get(e);if(o&&o.has(t))return!0;if(o)o.add(t);else{let n=new WeakSet;n.add(t),r.set(e,n)}for(let a of i){let i=e[a];if(!Object.prototype.hasOwnProperty.call(t,a))return!1;if(!n||a!==`ref`){let e=t[a];if(uf(i)&&uf(e)||(pf(i)||Array.isArray(i))&&(pf(e)||Array.isArray(e))?!zf(i,e,n,r):!Object.is(i,e))return!1}}return!0}var Bf=({defaultValues:e,...t})=>({...X(t),defaultValues:e});function $(e,t=X){let n=d.useRef(!1),r=d.useRef(!1),i=d.useRef(void 0),a=d.useRef(0);return a.current++,!r.current&&e&&(r.current=!0,i.current=t(e())),{resyncIfNeeded:d.useCallback((e,t,o)=>{if(e&&(n.current||r.current&&a.current>1)){let e=t();zf(i.current,e)||o(e)}n.current=!0},[]),snapshot:d.useCallback((e,n)=>{e&&(i.current=t(n()))},[t])}}function Vf(e){let t=Nf(),{control:n=t,disabled:r,name:i,exact:a}=e||{},o=()=>({...n._formState,defaultValues:n._defaultValues}),[s,c]=d.useState(o),l=d.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),{resyncIfNeeded:u,snapshot:f}=$(o,Bf);return Ff(()=>{u(!r,o,c);let e=n._subscribe({name:i,formState:l.current,exact:a,callback:e=>{!r&&c({...n._formState,...e,defaultValues:n._defaultValues})}});return()=>{e(),f(!r,o)}},[n,i,r,a,u,f]),d.useEffect(()=>{l.current.isValid&&n._setValid(!0)},[n]),d.useMemo(()=>Pf(s,n,l.current,!1),[s,n])}var Hf=e=>typeof e==`string`,Uf=(e,t,n,r,i)=>Hf(e)?(r&&t.watch.add(e),Q(n,e,i)):Array.isArray(e)?e.map(e=>(r&&t.watch.add(e),Q(n,e,Q(i,e)))):(r&&(t.watchAll=!0),n);function Wf(e){let t=Nf(),{control:n=t,name:r,defaultValue:i,disabled:a,exact:o,compute:s}=e||{},c=d.useRef(i),l=d.useRef(s),u=d.useRef(n),f=d.useRef(r);l.current=s;let p=()=>{let e=n._getWatch(r,c.current);return l.current?l.current(e):e},[m,h]=d.useState(p),g=d.useRef(m),_=d.useCallback(e=>{let t=Uf(r,n._names,e||n._formValues,!1,c.current);return l.current?l.current(t):t},[n._formValues,n._names,r]),v=d.useCallback(e=>{if(!a){let t=Uf(r,n._names,e||n._formValues,!1,c.current);if(l.current){let e=l.current(t);zf(e,g.current)||(h(e),g.current=e)}else h(t),g.current=t}},[n._formValues,n._names,a,r]),{resyncIfNeeded:y,snapshot:b}=$(p),x=d.useRef(v);x.current=v;let S=d.useRef(_);S.current=_,Ff(()=>{u.current!==n||!zf(f.current,r)?(u.current=n,f.current=r,x.current()):y(!a,()=>S.current(),e=>{let t=X(e);h(t),g.current=t});let e=n._subscribe({name:r,formState:{values:!0},exact:o,callback:e=>{x.current(e.values)}});return()=>{e(),b(!a,()=>S.current())}},[n,o,r,a,y,b]),d.useEffect(()=>n._removeUnmounted());let C=u.current!==n,w=f.current,T=d.useMemo(()=>!C&&!zf(w,r),[C,r,w]);return(C||T)&&(c.current=i),!a&&(C||T)?_():m}function Gf(e){let t=Nf(),{name:n,disabled:r,control:i=t,shouldUnregister:a,defaultValue:o,exact:s=!0}=e,c=vf(i._names.array,n),l=Wf({control:i,name:n,defaultValue:d.useMemo(()=>{let e=Q(i._formValues,n,Q(i._defaultValues,n,o));return Z(e)?_f(i,n):e},[i,n,o]),exact:s}),u=Vf({control:i,name:n,exact:s}),f=d.useRef(e),p=d.useRef(a),m=d.useRef(null),h=d.useRef(void 0),g=d.useRef(i.register(n,{...e.rules,value:h.current===n&&!Q(i._fields,n)?void 0:l,...kf(e.disabled)?{disabled:e.disabled}:{}}));h.current=n,f.current=e;let _=d.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Q(u.errors,n)},isDirty:{enumerable:!0,get:()=>!!Q(u.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!Q(u.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!Q(u.validatingFields,n)},error:{enumerable:!0,get:()=>Q(u.errors,n)}}),[u,n]),v=d.useCallback(e=>{let t=mf(e);return Q(i._fields,n)||(g.current=i.register(n,{...f.current.rules,value:t})),g.current.onChange({target:{value:mf(e),name:n},type:bf.CHANGE})},[n,i]),y=d.useCallback(()=>{let e=Q(i._formValues,n);return Q(i._fields,n)||(g.current=i.register(n,{...f.current.rules,value:e})),g.current.onBlur({target:{value:e,name:n},type:bf.BLUR})},[n,i]),b=d.useCallback(e=>{e&&(m.current={focus:()=>Af(e.focus)&&e.focus(),select:()=>Af(e.select)&&e.select(),setCustomValidity:t=>Af(e.setCustomValidity)&&e.setCustomValidity(t),reportValidity:()=>Af(e.reportValidity)&&e.reportValidity()});let t=Q(i._fields,n);t&&t._f&&e&&(t._f.ref=m.current,t._f._c=!0)},[i._fields,n]),x=d.useMemo(()=>({name:n,value:l,...kf(r)||u.disabled?{disabled:u.disabled||r}:{},onChange:v,onBlur:y,ref:b}),[n,r,u.disabled,v,y,b,l]);return d.useEffect(()=>{if(p.current=a,i._options.shouldUnregister||a){let e=X(Q(a?i._defaultValues:i._options.values||i._defaultValues,n,Q(i._options.defaultValues,n,f.current.defaultValue)));jf(i._defaultValues,n,e),Z(Q(i._formValues,n))&&jf(i._formValues,n,e)}else!c&&!Z(f.current.defaultValue)&&Z(Q(i._defaultValues,n))&&(jf(i._defaultValues,n,X(f.current.defaultValue)),i._subjects.state.next({defaultValues:i._defaultValues}))},[i,n,c,a]),d.useEffect(()=>{g.current=i.register(n,{...f.current.rules,...kf(f.current.disabled)?{disabled:f.current.disabled}:{}});let e=(e,t)=>{let n=Q(i._fields,e);n&&n._f&&(n._f.mount=t,n._f._c=t)};if(e(n,!0),!c&&i.register(n,{...f.current.rules,...kf(f.current.disabled)?{disabled:f.current.disabled}:{}}),m.current){let e=Q(i._fields,n);e&&e._f&&(e._f.ref=m.current)}return()=>{let t=i._options.shouldUnregister||p.current;(c?t&&!i._state.action:t)?i.unregister(n):e(n,!1)}},[n,i,c]),d.useEffect(()=>{i._setDisabledField({disabled:r,name:n})},[r,n,i]),d.useMemo(()=>({field:x,formState:u,fieldState:_}),[x,u,_])}var Kf=e=>e.render(Gf(e)),qf=e=>({isOnSubmit:!e||e===xf.onSubmit,isOnBlur:e===xf.onBlur,isOnChange:e===xf.onChange,isOnAll:e===xf.all,isOnTouch:e===xf.onTouched}),Jf=(e,t,n)=>{if(n)return!1;if(t.watchAll||t.watch.has(e))return!0;for(let n of t.watch)if(e.startsWith(n)&&e.charAt(n.length)===`.`)return!0;return!1},Yf=(e,t,n)=>{for(let r of n||Object.keys(e)){if(r===`_f`)continue;let i=n?Q(e,r):e[r];if(i){let{_f:e}=i;if(e){let n=e.refs?.find(e=>!e.disabled);if(n&&t(n,e.name)||e.ref&&t(e.ref,e.name)||Yf(i,t))return!0}else if((pf(i)||Array.isArray(i))&&Yf(i,t))return!0}}},Xf=(e,t,n)=>{let r=Q(e,n),i=Array.isArray(r)?r:[];return jf(i,Tf,Q(t[n],Tf,t[n])),jf(e,n,i),e},Zf=e=>pf(e)&&!Object.keys(e).length,Qf=e=>{if(!yf)return!1;let t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},$f=e=>e.type===`radio`,ep=e=>e instanceof RegExp,tp=(e,t,n,r,i)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:i||!0}}:{},np={value:!1,isValid:!1},rp={value:!0,isValid:!0},ip=e=>{if(!Array.isArray(e))return np;if(e.length>1){let t=e.filter(e=>e&&e.checked&&!e.disabled).map(e=>e.value);return{value:t,isValid:!!t.length}}let t=e[0];return!t||!t.checked||t.disabled?np:!t.attributes||!(`value`in t.attributes)||Z(t.value)||t.value===``?rp:{value:t.value,isValid:!0}},ap={isValid:!1,value:null},op=e=>Array.isArray(e)?e.reduce((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e,ap):ap;function sp(e,t,n=`validate`){if(Hf(e)||Array.isArray(e)&&e.length&&e.every(Hf)||kf(e)&&!e)return{type:n,message:Hf(e)?e:``,ref:t}}var cp=e=>pf(e)&&!ep(e)?e:{value:e,message:``},lp=async(e,t,n,r,i,a)=>{let{ref:o,refs:s,required:c,maxLength:l,minLength:u,min:d,max:f,pattern:p,validate:m,name:h,valueAsNumber:g,mount:_,_c:v}=e._f,y=Q(n,h);if(!_||t.has(h))return{};let b=s?s[0]:o,x=e=>{if(i&&b.reportValidity){let t=kf(e)?``:e||``;s?s.forEach(e=>Af(e.setCustomValidity)&&e.setCustomValidity(t)):b.setCustomValidity(t),b.reportValidity()}},S={},C=!v&&$f(o),w=!v&&cf(o),T=C||w,ee=(g||lf(o))&&Z(o.value)&&Z(y)||Qf(o)&&o.value===``&&!v||y===``||Array.isArray(y)&&!y.length,E=tp.bind(null,h,r,S),D=(e,t,n,r=Sf.maxLength,i=Sf.minLength)=>{let a=e?t:n;S[h]={type:e?r:i,message:a,ref:o,...E(e?r:i,a)}};if(a?!Array.isArray(y)||!y.length:c&&(!T&&(ee||df(y))||kf(y)&&!y||w&&!ip(s).isValid||C&&!op(s).isValid)){let{value:e,message:t}=Hf(c)?{value:!!c,message:c}:cp(c);if(e&&(S[h]={type:Sf.required,message:t,ref:b,...E(Sf.required,t)},!r))return x(t),S}if(!ee&&(!df(d)||!df(f))){let e,t,n=cp(f),i=cp(d);if(!df(y)&&!uf(y)&&!isNaN(y)){let r=!v&&o.valueAsNumber||y&&+y;df(n.value)||(e=r>n.value),df(i.value)||(t=r<i.value)}else{let r=!v&&o.valueAsDate||new Date(y),a=e=>new Date(new Date().toDateString()+` `+e),s=o.type==`time`,c=o.type==`week`;Hf(n.value)&&y&&(e=s?a(y)>a(n.value):c?y>n.value:r>new Date(n.value)),Hf(i.value)&&y&&(t=s?a(y)<a(i.value):c?y<i.value:r<new Date(i.value))}if((e||t)&&(D(!!e,n.message,i.message,Sf.max,Sf.min),!r))return x(S[h].message),S}if((!df(l)||!df(u))&&!ee&&(Hf(y)||a&&Array.isArray(y))){let e=cp(l),t=cp(u),n=!df(e.value)&&y.length>+e.value,i=!df(t.value)&&y.length<+t.value;if((n||i)&&(D(n,e.message,t.message),!r))return x(S[h].message),S}if(p&&!ee&&Hf(y)){let{value:e,message:t}=cp(p);if(ep(e)&&!y.match(e)&&(S[h]={type:Sf.pattern,message:t,ref:o,...E(Sf.pattern,t)},!r))return x(t),S}if(m){if(Af(m)){let e=sp(await m(y,n),b);if(e&&(S[h]={...e,...E(Sf.validate,e.message)},!r))return x(e.message),S}else if(pf(m)){let e={};for(let t in m){if(!Zf(e)&&!r)break;let i=sp(await m[t](y,n),b,t);i&&(e={...i,...E(t,i.message)},r||x(i.message),r&&(S[h]=e))}if(!Zf(e)&&(S[h]={ref:b,...e},!r))return S}}let O=S[h];return x(!O||O.message),S},up=e=>Array.isArray(e)?e:[e],dp=e=>Array.isArray(e)?e.filter(Boolean):[];function fp(e,t){let n=t.length-1,r=0;for(;r<n;){if(df(e)){e=void 0;break}e=e[t[r]],r++}return e}function pp(e){for(let t in e)if(e.hasOwnProperty(t)&&!Z(e[t]))return!1;return!0}function mp(e,t){if(!pf(e)&&!Array.isArray(e))return e;if(Hf(t)&&Object.prototype.hasOwnProperty.call(e,t))return delete e[t],e;let n=Array.isArray(t)?t:Of(t)?[t]:gf(t);if(n.some(e=>Ef.includes(String(e))))return e;let r=n.length===1?e:fp(e,n),i=n.length-1,a=n[i];return r&&(pf(r)||Array.isArray(r))&&delete r[a],i!==0&&(pf(r)&&Zf(r)||Array.isArray(r)&&pp(r))&&mp(e,n.slice(0,-1)),e}var hp=()=>{let e=new Set,t=0;return{get observers(){return Array.from(e)},next:n=>{let r=e;t++;for(let e of r)e.next&&e.next(n);r===e&&t--},subscribe:n=>(e.add(n),{unsubscribe:()=>{t&&=(e=new Set(e),0),e.delete(n)}}),unsubscribe:()=>{e=new Set,t=0}}};function gp(e,t){let n=Array.isArray(e)?[]:{};for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r)){let i=e[r],a=t[r];i&&(pf(i)||Array.isArray(i))&&a?n[r]=gp(i,a):e[r]&&(n[r]=a)}return n}var _p=(e,t)=>e!==null&&ff(e)&&Object.prototype.hasOwnProperty.call(e,t),vp=(e,t)=>{if(!t)return!1;let n=e;for(let r of Of(t)?[t]:gf(t)){if(!_p(n,r))return _p(e,t);n=n[r]}return!0},yp=e=>e.type===`select-multiple`,bp=e=>{let t=[...e.options];return!e.multiple&&e.size<2&&!t.some(e=>e.defaultSelected)?e.selectedIndex!==t.findIndex(e=>!e.disabled&&!e.parentElement?.matches(`optgroup[disabled]`)):t.some(e=>e.selected!==e.defaultSelected)},xp=e=>cf(e)?e.checked!==e.defaultChecked:e.type===`select-one`||yp(e)?bp(e):!$f(e)&&e.type!==`range`&&e.type!==`color`&&`defaultValue`in e&&e.value!==e.defaultValue,Sp=e=>$f(e)||cf(e),Cp=e=>Qf(e)&&e.isConnected;function wp(e){return Array.isArray(e)||pf(e)}function Tp(e,t,n=``,r=[]){for(let i in e){let a=n?`${n}.${i}`:i,o=e[i];wp(o)&&wp(Q(t,a))?Tp(o,t,a,r):o&&r.push(a)}return r}var Ep=e=>{for(let t in e)if(Af(e[t]))return!0;return!1};function Dp(e){return Array.isArray(e)||pf(e)&&!Ep(e)}function Op(e){return!!(e&&`_f`in e)}function kp(e){return Array.isArray(e)?!e.some(e=>!Z(e)):!Object.keys(e).length}function Ap(e,t){Array.isArray(e)?e[t]=void 0:delete e[t]}function jp(e,t={},n){for(let r in e){let i=e[r],a=n&&n[r];Dp(i)&&(!Array.isArray(i)||!Op(a))?(t[r]=Array.isArray(i)?[]:{},jp(i,t[r],a),kp(t[r])&&Ap(t,r)):Z(i)||(t[r]=!0)}return t}function Mp(e,t,n,r){n||=jp(t,Array.isArray(df(t)?e:t)?[]:{},r);for(let i in e){let a=e[i],o=r&&r[i];Dp(a)&&(!Array.isArray(a)||!Op(o))?(Z(t)||Lf(n[i])?n[i]=jp(a,Array.isArray(a)?[]:{},o):Mp(a,df(t)?{}:t[i],n[i],o),kp(n[i])&&Ap(n,i)):zf(a,df(t)?void 0:t[i])?Ap(n,i):n[i]=!0}return n}var Np=(e,t)=>{let n=t.split(`.`),r=[],i=n[0];for(let t=1;t<n.length;i+=`.`+n[t++])!isNaN(+n[t])&&e.has(i)&&r.push(`${i}.${n[t]}`);return r},Pp=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>Z(e)?e:t?e===``?NaN:e&&+e:n&&Hf(e)?new Date(e):r?r(e):e;function Fp(e){let t=e.ref;return lf(t)?t.files:$f(t)?op(e.refs).value:yp(t)?[...t.selectedOptions].filter(e=>!e.disabled&&!e.closest?.call(e,`optgroup[disabled]`)).map(({value:e})=>e):cf(t)?ip(e.refs).value:Pp(t.value,e)}var Ip=(e,t,n,r)=>{let i={};for(let n of e){let e=Q(t,n);e&&jf(i,n,X(e._f))}return{criteriaMode:n,names:[...e],fields:i,shouldUseNativeValidation:r}},Lp=e=>Z(e)?e:ep(e)?e.source:pf(e)?ep(e.value)?e.value.source:e.value:e,Rp=`AsyncFunction`,zp=e=>{if(!e||!e.validate)return!1;if(Af(e.validate))return e.validate.constructor.name===Rp;if(pf(e.validate)){for(let t in e.validate)if(e.validate[t].constructor.name===Rp)return!0}return!1},Bp=e=>e.mount&&(e.required||!Z(e.required)&&e.required!==!1||!Z(e.min)||!Z(e.max)||!Z(e.maxLength)||!Z(e.minLength)||e.pattern||e.validate);function Vp(e,t,n){let r=Q(e,n);if(r&&(r.type||r.message)||Array.isArray(r))return{error:r,name:n};let i=n.split(`.`);for(;i.length;){let r=i.join(`.`),a=Q(t,r),o=Q(e,r);if(a&&!Array.isArray(a)&&n!==r)return{name:n};if(o&&o.type)return{name:r,error:o};if(o&&o.root&&o.root.type)return{name:`${r}.root`,error:o.root};i.pop()}return{name:n}}var Hp=(e,t,n)=>{let r=Object.keys(e).filter(e=>e!==`name`);return!r.length||n&&r.length>=Object.keys(t).length||r.find(e=>t[e]===(!n||xf.all))},Up=(e,t,n)=>n?e===t||e.startsWith(t+`.`):e.startsWith(t)||t.startsWith(e),Wp=(e,t,n)=>{if(!e||!t||e===t)return!0;if(!Array.isArray(e))return Up(e,t,n);for(let r of e)if(r&&Up(r,t,n))return!0;return!1},Gp=(e,t,n,r,i)=>i.isOnAll?!1:!n&&i.isOnTouch?!(t||e):(n?r.isOnBlur:i.isOnBlur)?!e:!(n?r.isOnChange:i.isOnChange)||e,Kp=(e,t)=>{let n=Q(e,t);!dp(n).length&&!(n&&n.root)&&mp(e,t)},qp={mode:xf.onSubmit,reValidateMode:xf.onChange,shouldFocusError:!0},Jp=(e,t)=>{for(let t in e)delete e[t];Object.assign(e,t)},Yp={submitCount:0,isDirty:!1,isReady:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{}};function Xp(e={}){let t={...qp,...e},n={...X(Yp),isLoading:Af(t.defaultValues),errors:X(t.errors)||{},disabled:t.disabled||!1},r={},i=(pf(t.defaultValues)||pf(t.values))&&X(t.defaultValues||t.values)||{},a=t.shouldUnregister?{}:X(i),o={action:!1,actionArrayLengths:new Map,mount:!1,watch:!1,keepIsValid:!1},s=!1,c={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set},l={},u={},d=new Set,f=qf(t.mode),p=qf(t.reValidateMode),m={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},h={...m},g={},_=(...e)=>e.some(e=>h[e]||g[e]),v=e=>{for(let t of d)if(Wp(t.name,e,t.exact))return!0;return!1},y={array:hp(),state:hp()},b=0,x=0,S=0,C=0,w={},T=t.criteriaMode===xf.all,ee=(e,t)=>n=>{clearTimeout(u[e]),u[e]=setTimeout(t,n)},E=e=>{clearTimeout(u[e]),delete u[e],delete l[e]},D=e=>{E(e);let t=`${e}.`;for(let e of Object.keys(l))e.startsWith(t)&&E(e)},O=async e=>{if(!o.keepIsValid&&!t.disabled&&(_(`isValid`)||e)){let i=++b,a=S,o;if(t.resolver?(o=Zf((await de()).errors),i===b&&k()):o=await pe({fields:r,onlyCheckValid:!0,eventType:bf.VALID}),i!==b)return;if(a!==S)return O(e);o!==n.isValid&&y.state.next({isValid:o})}},te=(e,t)=>{let r=[...e];if(!r.some(e=>e&&(t?Q(n.validatingFields,e)!==!0:vp(n.validatingFields,e))))return;let i=X(n.validatingFields);for(let e of r)e&&(t?jf(i,e,!0):mp(i,e));zf(n.validatingFields,i)||(n.validatingFields=i)},k=(e,r)=>{!t.disabled&&_(`isValidating`,`validatingFields`)&&(te(e||c.mount,r),y.state.next({validatingFields:n.validatingFields,isValidating:!Zf(n.validatingFields)}))},A=()=>{n.dirtyFields=Mp(i,a,void 0,r)},ne=(e,i=[],c,l,u=!0,d=!0)=>{if(l&&c&&!t.disabled){o.action=!0,o.keepIsValid=!1;let t=Q(r,e),a=t&&t._f,f=a?Object.assign([],t):t;if(o.actionArrayLengths.has(e)||o.actionArrayLengths.set(e,Array.isArray(f)?f.length:0),d&&Array.isArray(f)){let t=c(f,l.argA,l.argB)||f;a?jf(r,e,{...t,_f:a}):u&&jf(r,e,t)}let p=Q(n.errors,e);if(d&&Array.isArray(p)){let t=p.root,r=c(p,l.argA,l.argB)||p;t&&(r.root=t),u&&jf(n.errors,e,r),Kp(n.errors,e),n.errors={...n.errors}}let m=Q(n.touchedFields,e),h=d&&Array.isArray(m);if(h){let t=c(m,l.argA,l.argB);u&&jf(n.touchedFields,e,t)}let g=Q(n.dirtyFields,e);if(d&&Array.isArray(g)){let t=c(g,l.argA,l.argB)||g;u&&jf(n.dirtyFields,e,t)}_(`dirtyFields`)?A():s=!0,y.state.next({name:e,isDirty:he(e,i),dirtyFields:n.dirtyFields,...h&&{touchedFields:n.touchedFields},errors:n.errors,isValid:n.isValid})}else jf(a,e,i)},re=(e,t)=>{jf(n.errors,e,t),n.errors={...n.errors},y.state.next({errors:n.errors})},ie=e=>{Object.keys(l).forEach(E);let t=!Zf(e);n.errors=X(e),y.state.next({errors:n.errors,...t?{isValid:!1}:{}}),!t&&o.mount&&O()},j=e=>Of(e)?[e]:gf(e),ae=e=>{let t=j(e),n=a,r=i;for(let e=0;e<t.length-1;e++){let i=t[e];if(n=df(n)?n:n[i],r=df(r)?r:r[i],n===null&&r!==null)return!0}return!1},oe=e=>{if(!o.actionArrayLengths.size)return!1;let t=j(e),n=a,r=``,i=-1,s=0;for(let e=0;e<t.length;e++){if(df(n))return!1;let a=t[e];if(r=r?`${r}.${a}`:a,Array.isArray(n)&&+a>=n.length)return i===-1?!1:e!==i||+a<s;if(o.actionArrayLengths.has(r)&&(i=e+1,s=o.actionArrayLengths.get(r)),n=n[a],Z(n)&&i!==-1&&e>i&&+t[i]<s)return!0}return!1},se=e=>{let t=a;for(let n of j(e)){if(Array.isArray(t)&&+n>=t.length)return!0;t&&=t[n]}return!1},ce=(e,l,u,d)=>{let f=Q(r,e);if(f){if(ae(e)||oe(e))return;let r=Z(Q(a,e)),p=Q(a,e,Z(u)?Q(i,e):u),m=!!d&&!n.isReady&&xp(d);if(Z(p)||d&&d.defaultChecked||m||l){let t=l?p:Fp(f._f);Z(t)&&se(e)||(_(`dirtyFields`)&&!zf(Q(a,e),t)&&(s=!0),jf(a,e,t),m&&le(e,t))}else ge(e,p);o.mount&&!o.action&&(t.resolver&&_(`isValidating`,`validatingFields`)?Promise.resolve().then(()=>O()):O(),r&&n.isDirty&&_(`isDirty`)&&(he()||(n.isDirty=!1,y.state.next({...n}))),t.shouldUnregister&&r&&!Z(Q(a,e))&&Jf(e,c)&&(o.watch=!0))}},le=(e,o,c,l,u)=>{let d=!1,f=!1,p={name:e};if(!t.disabled||l===!0){if(!c||l){let t=zf(Q(i,e),o);if(_(`isDirty`)&&(f=n.isDirty,n.isDirty=p.isDirty=!t||he(),d=f!==p.isDirty),f=!!Q(n.dirtyFields,e),t)mp(n.dirtyFields,e);else{let t=Q(i,e),a=Q(r,e),s=!(a&&a._f)&&(pf(t)||Array.isArray(t))?Mp(t,o,void 0,a):!0;jf(n.dirtyFields,e,s)}let c=!1;if(s||t&&(_(`isDirty`)?n.isDirty:he())){s=!1;let e=Mp(i,a,void 0,r);zf(n.dirtyFields,e)||(c=!0,Jp(n.dirtyFields,e))}p.dirtyFields=n.dirtyFields,d||=_(`dirtyFields`)&&(c||f!==!t)}if(c){let t=vp(n.touchedFields,e)?Q(n.touchedFields,e):void 0;t||(jf(n.touchedFields,e,c),p.touchedFields=n.touchedFields,d||=_(`touchedFields`)&&t!==c)}d&&u&&y.state.next(p)}return d?p:{}},ue=(e,r,i,a)=>{let o=Q(n.errors,e),s=_(`isValid`)&&kf(r)&&n.isValid!==r;if(t.delayError&&i?(l[e]=ee(e,()=>re(e,i)),l[e](t.delayError)):(E(e),i?jf(n.errors,e,i):mp(n.errors,e),n.errors={...n.errors}),(i?!zf(o,i,!0):o)||!Zf(a)||s){let t={...a,...s&&kf(r)?{isValid:r}:{},errors:n.errors,name:e};y.state.next(t)}},de=async e=>(k(e,!0),await t.resolver(a,t.context,Ip(e||c.mount,r,t.criteriaMode,t.shouldUseNativeValidation))),fe=async e=>{let t=S,i=C,a=e?e.filter(e=>Q(r,e)):[],{errors:o}=await de(e);if(t!==S)return o;if(k(e),e){for(let t of e){if(a.includes(t)&&(!Q(r,t)||w[t]>i)){mp(o,t);continue}let e=Q(o,t);D(t);let s=c.array.has(t)&&pf(e)&&!Object.keys(e).some(e=>!Number.isNaN(Number(e))),l=Q(r,t),u=pf(l)&&Object.keys(l).some(e=>e!==`_f`);s?Xf(n.errors,{[t]:e},t):e&&(e.type||e.message)||Array.isArray(e)||pf(e)&&u?jf(n.errors,t,e):mp(n.errors,t)}n.errors={...n.errors}}else Object.keys(l).forEach(E),n.errors=o;return o},M=async({name:e,eventType:r,onlyCheckValid:i})=>{if(t.validate){let o=S,s=++x,c=await t.validate({formValues:a,formState:n,name:e,eventType:r});if(o!==S||r!==bf.SUBMIT&&s!==x)return!0;if(i&&(pf(c)?Object.values(c).some(Boolean):Hf(c)||!c))return!1;if(pf(c)){let e=!0;R(wf);for(let t in c){let n=c[t];n&&(e=!1,we(`${wf}.${t}`,{message:Hf(n.message)?n.message:``,type:n.type||Sf.validate}))}return e}return Hf(c)||!c?(R(wf),we(wf,{message:c||``,type:Sf.validate}),!1):(R(wf),!0)}return!0},pe=async({fields:e,onlyCheckValid:i,name:o,eventType:s,context:l={valid:!0,runRootValidation:!1}})=>{let u=S;if(t.validate&&!l.runRootValidation&&(l.runRootValidation=!0,!await M({name:o,eventType:s,onlyCheckValid:i})&&(l.valid=!1,i)))return l.valid;for(let o in e){let d=e[o];if(d){let{_f:e,...f}=d;if(e){let o=c.array.has(e.name),s=d._f&&zp(d._f),f=_(`isValidating`,`validatingFields`);s&&f&&k([e.name],!0);let p=C,m=await lp(d,c.disabled,a,T,t.shouldUseNativeValidation&&!i,o);if(u!==S)return l.valid;if(s&&f&&k([e.name]),!Q(r,e.name)||w[e.name]>p)continue;if(m[e.name]&&(l.valid=!1,i)||(i||(E(e.name),Q(m,e.name)?o?Xf(n.errors,m,e.name):jf(n.errors,e.name,m[e.name]):mp(n.errors,e.name)),t.shouldUseNativeValidation&&m[e.name]))break}!Zf(f)&&await pe({context:l,onlyCheckValid:i,fields:f,name:o,eventType:s})}}return l.valid},me=()=>{for(let e of c.unMount){let t=Q(r,e);t&&(t._f.refs?t._f.refs.every(e=>!Cp(e)):!Cp(t._f.ref))&&Oe(e)}c.unMount=new Set},he=(e,t)=>(e&&!Z(t)&&jf(a,e,t),!zf(o.mount?a:i,i)),N=(e,t,n)=>{let r=o.mount?a:Z(t)||!Z(e)?i:t;return Uf(e,c,Z(e)?{...r}:r,n,t)},P=e=>dp(Q(o.mount?a:i,e,t.shouldUnregister?Q(i,e,[]):[])),ge=(e,t,n={},i=!1,o=!1,s=!1)=>{let c=Q(r,e),l=t;if(c){let n=c._f;n&&(!n.disabled&&jf(a,e,Pp(t,n)),l=Qf(n.ref)&&df(t)?``:t,yp(n.ref)?[...n.ref.options].forEach(e=>e.selected=l.includes(e.value)):n.refs?cf(n.ref)?n.refs.forEach(e=>{e.defaultChecked&&e.disabled||(e.checked=Array.isArray(l)?!Z(e.value)&&l.includes(e.value):l===e.value||!!l)}):n.refs.forEach(e=>e.checked=e.value===l):lf(n.ref)?n.ref.value=``:(n.ref.value=l,n.ref.type||o||s||y.state.next({name:e,values:i?a:v(e)?X(a):void 0})))}(n.shouldDirty||n.shouldTouch)&&le(e,c&&c._f&&!c._f.disabled&&(c._f.valueAsNumber||c._f.valueAsDate||c._f.setValueAs)?Pp(t,c._f):l,n.shouldTouch,n.shouldDirty,!o),n.shouldValidate&&be(e,{delayError:n.delayError}),n.shouldValidate&&c&&c._f&&c._f.deps&&(!Array.isArray(c._f.deps)||c._f.deps.length>0)&&be(c._f.deps)},_e=(e,t,n,i=!1,o=!1,s=!1)=>{for(let l in t){if(!Object.prototype.hasOwnProperty.call(t,l))continue;let u=t[l],d=e+`.`+l,f=Q(r,d);c.array.has(d)&&y.array.next({name:d,values:i?a:X(a)}),(c.array.has(e)||pf(u)||f&&!f._f)&&!uf(u)?_e(d,u,n,i,o,s):ge(d,u,n,i,o,s)}},ve=(e,t,i,s,l=!1)=>{let u=Q(r,e),d=c.array.has(e),f=s?t:X(t),p=zf(Q(a,e),f);if(p||jf(a,e,f),d)y.array.next({name:e,values:s?a:X(a)}),_(`isDirty`,`dirtyFields`)&&i.shouldDirty&&(A(),n.isDirty=he(e,f),l||y.state.next({name:e,dirtyFields:n.dirtyFields,isDirty:n.isDirty})),i.shouldValidate&&be(e,{delayError:i.delayError});else{let t=Array.isArray(f)&&!f.length||Zf(f),n=!p&&!l;!u||u._f||df(f)||t?ge(e,f,i,s,l,n):_e(e,f,i,s,l,n)}if(!p&&!l){let t=Jf(e,c),r=o.mount||t?e:void 0,i=d?[]:Np(c.array,e),l=s?a:v(r)||i.some(v)?X(a):void 0;y.state.next({...t&&n,name:r,values:l});for(let e of i)y.state.next({name:e,values:l&&X(a)})}},ye=(e,t,n={})=>ve(e,t,n,!1),F=(e,t={})=>{let r=Af(e)?e(a):e;if(!zf(a,r)||t.shouldValidate||t.shouldDirty||t.shouldTouch){a={...a,...r};for(let e of new Set([...c.mount,...c.array]))vp(r,e)&&ve(e,Q(r,e),t,!0,!0);if(t.shouldDirty&&_(`isDirty`,`dirtyFields`))for(let e of Object.keys(r))le(e,a[e],!1,!0);y.state.next({...n,name:void 0,type:void 0,...d.size?{values:a}:{}}),t.shouldValidate&&O()}},I=async e=>{o.mount=!0;let i=e.target,s=i.name,u=!0,d=Q(r,s),m=C,h=e=>{u=!!Q(r,s)&&!(w[s]>m)&&zf(e,Q(a,s,e))};if(d){o.keepIsValid=!1;let m,g,x=!1,C=i.type?Fp(d._f):mf(e),w=e.type===bf.BLUR||e.type===bf.FOCUS_OUT,ee=!Bp(d._f)&&!t.validate&&!t.resolver&&!Q(n.errors,s)&&!d._f.deps,E=ee||Gp(w,Q(n.touchedFields,s),n.isSubmitted,p,f),D=Jf(s,c,w);jf(a,s,X(C)),w?i&&i.readOnly||(d._f.onBlur&&d._f.onBlur(e),Object.prototype.hasOwnProperty.call(l,s)&&(x=!0,l[s](0))):d._f.onChange&&d._f.onChange(e);let te=le(s,C,w),A=!Zf(te)||D;if(!w&&y.state.next({name:s,type:e.type,...v(s)?{values:X(a)}:{}}),E)return ee&&n.isValid||!_(`isValid`)||(t.mode===`onBlur`?w&&O():w||O()),A&&y.state.next({name:s,...D?{}:te});if(!t.resolver&&t.validate&&await M({name:s,eventType:e.type}),!w&&D&&y.state.next({...n}),t.resolver){let e=S,{errors:t}=await de([s]);if(e!==S)return;if(k([s]),h(C),!u){!Zf(te)&&y.state.next(te);return}let i=Vp(n.errors,r,s),a=Vp(t,r,i.name||s);m=a.error,s=a.name,g=Zf(t)}else{let n=S,i=++b;if(k([s],!0),m=(await lp(d,c.disabled,a,T,t.shouldUseNativeValidation))[s],n!==S)return;if(k([s]),h(C),u){if(m)g=!1;else if(_(`isValid`)){if(g=await pe({fields:r,onlyCheckValid:!0,name:s,eventType:e.type}),n!==S)return;h(C),i!==b&&(g=void 0)}}}u&&(d._f.deps&&(!Array.isArray(d._f.deps)||d._f.deps.length>0)&&be(d._f.deps),ue(s,g,m,te),x&&Object.prototype.hasOwnProperty.call(l,s)&&l[s](0))}},L=(e,t)=>{if(Q(n.errors,t)&&e.focus)return e.focus(),1},be=async(e,i={})=>{o.keepIsValid=!1;let a,s,u=up(e),d=S;if(t.resolver){let t=await fe(Z(e)?e:u);a=Zf(t),s=e?!u.some(e=>Q(t,e)):a}else e?(s=(await Promise.all(u.map(async e=>{let t=Q(r,e);return await pe({fields:t&&t._f?{[e]:t}:t,eventType:bf.TRIGGER})}))).every(Boolean),(s||n.isValid)&&O()):s=a=await pe({fields:r,name:e,eventType:bf.TRIGGER});if(d!==S)return s;if(i.delayError&&t.delayError&&Hf(e)){let r=Q(n.errors,e);r?(mp(n.errors,e),l[e]=ee(e,()=>re(e,r)),l[e](t.delayError)):E(e)}if(i.shouldTouch){let t=e=>{!c.array.has(e)&&jf(n.touchedFields,e,!0)};for(let n of e?u:c.mount){let e=Q(r,n);pf(e)||Array.isArray(e)?Yf(r,(e,n)=>t(n),[n]):t(n)}}return n.errors={...n.errors},y.state.next({...!Hf(e)||_(`isValid`)&&a!==n.isValid?{}:{name:e},...t.resolver||!e?{isValid:a}:{},...i.shouldTouch&&_(`touchedFields`)?{touchedFields:n.touchedFields}:{},errors:n.errors}),i.shouldFocus&&!s&&Yf(r,L,e?u:c.mount),s},xe=((e,t)=>{let r=Z(e)&&!t?{...o.mount?a:i}:o.mount?a:i;return t&&(r=gp(t.dirtyFields?n.dirtyFields:n.touchedFields,r)),Z(e)?r:Hf(e)?Q(r,e):e.map(e=>Q(r,e))}),Se=(e=>Z(e)?{...n.errors}:Hf(e)?Q(n.errors,e):e.map(e=>Q(n.errors,e))),Ce=(e,t)=>{let r=t||n,i=Q(r.errors,e);return{invalid:!!i,isDirty:!!Q(r.dirtyFields,e),error:i,isValidating:!!Q(r.validatingFields,e),isTouched:!!Q(r.touchedFields,e)}},R=e=>{let t=e?up(e):void 0;t?t.forEach(e=>{D(e),mp(n.errors,e),n.errors={...n.errors},y.state.next({name:e,errors:n.errors})}):(Object.keys(l).forEach(E),n.errors={},y.state.next({errors:n.errors}))},we=(e,t,i)=>{D(e);let a=Q(r,e,{_f:{}}),o=a._f&&a._f.ref,{ref:s,message:c,type:l,types:u,...d}=Q(n.errors,e)||{};if(jf(n.errors,e,{...d,...t,ref:o}),n.errors={...n.errors},y.state.next({name:e,errors:n.errors,isValid:!1}),i&&i.shouldFocus){let e=a._f?.refs?a._f.refs.find(e=>!e.disabled)||a._f.refs[0]:o;e&&e.focus&&e.focus()}},Te=(e,t)=>{if(Af(e)){let n={};d.add(n);let{unsubscribe:r}=y.state.subscribe({next:n=>`values`in n&&e(n.values||N(void 0,t),n)});return{unsubscribe:()=>{d.delete(n),r()}}}return N(e,t,!0)},Ee=e=>{let t={name:e.name,exact:e.exact};e.formState&&e.formState.values&&d.add(t);let{unsubscribe:r}=y.state.subscribe({next:t=>{if(Wp(e.name,t.name,e.exact)&&Hp(t,e.formState||h,e.reRenderRoot)){let r=t.values||{...a};e.callback({...n,...t,validatingFields:n.validatingFields,isValidating:n.isValidating,values:r,defaultValues:i})}}});return()=>{d.delete(t),r()}},De=e=>{o.mount=!0;let t=Object.keys(e.formState||{}).filter(t=>e.formState&&e.formState[t]);for(let e of t)g[e]=(g[e]||0)+1;let n=Ee({...e,formState:{...m,...e.formState}});return()=>{for(let e of t.splice(0))g[e]--;n()}},Oe=(e,o={})=>{let s=e?up(e):[...c.mount],l=new Set(s);if(e)for(let e of c.mount)s.some(t=>e.startsWith(`${t}.`))&&l.add(e);o.keepIsValidating||te(l);for(let e of l)c.mount.delete(e),c.array.delete(e),c.disabled.delete(e),mp(r,e),!o.keepValue&&mp(a,e),o.keepError||(D(e),mp(n.errors,e)),!o.keepDirty&&mp(n.dirtyFields,e),!o.keepTouched&&mp(n.touchedFields,e),!t.shouldUnregister&&!o.keepDefaultValue&&mp(i,e);o.keepError||(n.errors={...n.errors}),d.size&&y.state.next({values:X(a)}),y.state.next({...n,...o.keepDirty?{}:{isDirty:he()},...o.keepIsValidating?{}:{isValidating:!Zf(n.validatingFields)}}),!o.keepIsValid&&O()},ke=({disabled:e,name:t})=>{if(kf(e)&&o.mount||e||c.disabled.has(t)){let n=c.disabled.has(t)!==!!e;e?c.disabled.add(t):c.disabled.delete(t),n&&o.mount&&!o.action&&O()}},Ae=(e,n={})=>{let a=Q(r,e),s=kf(n.disabled)||kf(t.disabled),l=!c.registerName.has(e)&&a&&a._f&&!a._f.mount;if(a&&a._f||(w[e]=++C),jf(r,e,{...a||{},_f:{...a&&a._f?a._f:{ref:{name:e}},name:e,mount:!0,...n}}),c.mount.add(e),a&&a._f){let t=Q(r,e);for(let e of Cf)e in n||delete t._f[e]}return a&&!l?ke({disabled:kf(n.disabled)?n.disabled:t.disabled,name:e}):ce(e,!0,n.value),{...s?{disabled:n.disabled||t.disabled}:{},...t.progressive?{required:!!Lp(n.required),min:Lp(n.min),max:Lp(n.max),minLength:Lp(n.minLength),maxLength:Lp(n.maxLength),pattern:Lp(n.pattern)}:{},name:e,onChange:I,onBlur:I,ref:s=>{if(s){c.registerName.add(e),Ae(e,n),c.registerName.delete(e),a=Q(r,e);let t=Z(s.value)&&s.querySelectorAll&&s.querySelectorAll(`input,select,textarea`)[0]||s,o=Sp(t),l=a._f.refs||[];if(o?l.find(e=>e===t):t===a._f.ref)return;let u={...a._f};o?(u.refs=[...l.filter(Cp),t,...Array.isArray(Q(i,e))?[{}]:[]],u.ref={type:t.type,name:e}):(u.ref=t,delete u.refs),jf(r,e,{_f:u}),ce(e,!1,void 0,t)}else a=Q(r,e,{}),a._f&&(a._f.mount=!1),(t.shouldUnregister||n.shouldUnregister)&&!(vf(c.array,e)&&o.action)&&c.unMount.add(e)}}},je=()=>t.shouldFocusError&&!t.shouldUseNativeValidation&&Yf(r,L,c.mount),Me=e=>{kf(e)&&(y.state.next({disabled:e}),Yf(r,(t,n)=>{let i=Q(r,n);i&&(t.disabled=i._f.disabled||e,Array.isArray(i._f.refs)&&i._f.refs.forEach(t=>{t.disabled=i._f.disabled||e}))},0))},Ne=(e,i)=>async o=>{let s,u,d=!1;o&&(o.preventDefault&&o.preventDefault(),o.persist&&o.persist());let f=X(a);y.state.next({isSubmitting:!0});let p=S,m=e=>{throw p===S&&y.state.next({isSubmitting:!1}),e};if(t.resolver){let e;try{e=await de()}catch(e){m(e)}let{errors:t,values:r}=e;if(p!==S)return;k(),Object.keys(l).forEach(E),n.errors=t,f=X(r)}else{try{await pe({fields:r,eventType:bf.SUBMIT})}catch(e){m(e)}if(p!==S)return;mp(n.errors,Tf),n.errors={...n.errors}}if(c.disabled.size&&(pf(f)||Array.isArray(f)))for(let e of c.disabled)mp(f,e);if(Zf(n.errors)){y.state.next({errors:{}});try{s=await e(f,o)}catch(e){d=!0,u=e}}else{if(i)try{await i({...n.errors},o)}catch(e){m(e)}p===S&&(je(),setTimeout(je))}if(p===S&&y.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Zf(n.errors)&&!d,submitCount:n.submitCount+1,errors:n.errors}),d)throw u;return s},Pe=(e,t={})=>{Q(r,e)&&(te([e]),Z(t.defaultValue)?ye(e,X(Q(i,e))):(ye(e,t.defaultValue),i=X(i),jf(i,e,X(t.defaultValue))),t.keepTouched||mp(n.touchedFields,e),t.keepDirty||(mp(n.dirtyFields,e),n.isDirty=Z(t.defaultValue)?he():he(e,X(Q(i,e)))),t.keepError||(D(e),mp(n.errors,e),n.errors={...n.errors},O()),y.state.next({...n,isValidating:!Zf(n.validatingFields)}))},Fe=(e,u={})=>{S++;let d=e?X(e):i,f=X(d),p=Zf(e),m=f,g=r;if(Object.keys(l).forEach(E),u.keepDefaultValues||(i=d),!u.keepValues){if(u.keepDirtyValues){let e=new Set([...c.mount,...Tp(Mp(i,a,void 0,g),n.dirtyFields)]);for(let t of e){let e=Q(n.dirtyFields,t),r=Q(a,t),i=Q(m,t);e&&!Z(r)?jf(m,t,r):!e&&!Z(i)&&ye(t,i)}}else{if(yf&&Z(e))for(let e of c.mount){let t=Q(r,e);if(t&&t._f){let e=Array.isArray(t._f.refs)?t._f.refs[0]:t._f.ref;if(Qf(e)){let t=e.closest(`form`);if(t){t.reset();break}}}}if(u.keepFieldsRef)for(let e of c.mount)ye(e,Q(m,e));else r={}}if(t.shouldUnregister){if(a=u.keepDefaultValues?X(i):{},u.keepFieldsRef)for(let e of c.mount)jf(a,e,Q(m,e))}else a=X(m);y.array.next({values:{...m}}),y.state.next({name:void 0,type:void 0,values:{...m}})}c={mount:u.keepDirtyValues||u.keepFieldsRef?c.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:u.keepValues||u.keepDirtyValues||u.keepFieldsRef?new Set([...c.disabled].filter(e=>Q(r,e))):new Set,watch:new Set,watchAll:!1,focus:``},o.mount=!h.isValid||!!u.keepIsValid||!!u.keepDirtyValues||!t.shouldUnregister&&!Zf(m),o.watch=!!t.shouldUnregister,o.keepIsValid=!!u.keepIsValid,o.action=!1,o.actionArrayLengths.clear(),s=!1,u.keepErrors||(n.errors={}),y.state.next({submitCount:u.keepSubmitCount?n.submitCount:0,isDirty:p?!1:u.keepDirty?n.isDirty:u.keepValues?he():!!(u.keepDefaultValues&&e&&!zf(e,i)),isSubmitted:u.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:p?{}:u.keepDirtyValues?u.keepDefaultValues&&a?Mp(i,a,void 0,g):n.dirtyFields:u.keepDefaultValues&&e?Mp(i,e,void 0,g):u.keepDirty?n.dirtyFields:u.keepValues?Mp(i,a,void 0,g):{},touchedFields:u.keepTouched?n.touchedFields:{},...!u.keepIsValidating&&(n.isValidating||!Zf(n.validatingFields))?{validatingFields:{},isValidating:!1}:null,errors:u.keepErrors?n.errors:{},isSubmitSuccessful:u.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:i})},Ie=(e,n)=>Fe(Af(e)?e(a):e,{...t.resetOptions,...n}),Le=(e,t={})=>{let n=Q(r,e),i=n&&n._f;if(i){let e=i.refs?i.refs.find(e=>!e.disabled)||i.refs[0]:i.ref;e.focus&&setTimeout(()=>{e.focus(),t.shouldSelect&&Af(e.select)&&e.select()})}};y.state.subscribe({next:e=>{let{name:t,type:r,values:i,...a}=e;Object.keys(a).length&&(n={...n,...a})}});let Re={control:{register:Ae,unregister:Oe,getFieldState:Ce,handleSubmit:Ne,setError:we,_subscribe:Ee,_runSchema:de,_updateIsValidating:k,_focusError:je,_getWatch:N,_getDirty:he,_setValid:O,_setFieldArray:ne,_setDisabledField:ke,_setErrors:ie,_getFieldArray:P,_reset:Fe,_resetDefaultValues:()=>Af(t.defaultValues)&&t.defaultValues().then(e=>{Ie(e,t.resetOptions),y.state.next({isLoading:!1})}),_removeUnmounted:me,_disableForm:Me,_subjects:y,_proxyFormState:h,get _fields(){return r},get _formValues(){return a},get _state(){return o},set _state(e){o=e},get _defaultValues(){return i},get _names(){return c},set _names(e){c=e},get _formState(){return n},get _options(){return t},set _options(e){t={...t,...e},f=qf(t.mode),p=qf(t.reValidateMode),T=t.criteriaMode===xf.all}},subscribe:De,trigger:be,register:Ae,handleSubmit:Ne,watch:Te,setValue:ye,setValues:F,getValues:xe,getErrors:Se,reset:Ie,resetField:Pe,resetDefaultValues:(e,t={})=>{if(i=X(e),!t.keepDirty){let e=Mp(i,a,void 0,r);n.dirtyFields=e,n.isDirty=!Zf(e)}t.keepIsValid||O(),y.state.next({...n,defaultValues:i})},clearErrors:R,unregister:Oe,setError:we,setFocus:Le,getFieldState:Ce};return{...Re,formControl:Re}}var Zp={mode:qp.mode,reValidateMode:qp.reValidateMode,shouldFocusError:qp.shouldFocusError,resolver:void 0,criteriaMode:void 0,delayError:void 0,shouldUnregister:void 0,shouldUseNativeValidation:void 0,context:void 0,progressive:void 0,resetOptions:void 0};function Qp(e={}){let t=d.useRef(void 0),n=d.useRef(void 0),r=d.useRef(e.formControl),i=d.useRef(!1),a=d.useRef(!!e.validate),o=d.useRef(!!e.errors),s=d.useRef(!1),[c,l]=d.useState(()=>({...X(Yp),isLoading:Af(e.defaultValues),errors:e.errors||{},disabled:e.disabled||!1,defaultValues:Af(e.defaultValues)?void 0:e.defaultValues}));if(!t.current||e.formControl&&r.current!==e.formControl){if(r.current=e.formControl,i.current=!1,e.formControl)t.current={...e.formControl,formState:c},e.defaultValues&&!Af(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{let{formControl:n,...r}=Xp(e);t.current={...r,formState:c}}}let u=t.current.control,f=u._options,p={};for(let t in Zp)t in f&&!(t in e)&&(p[t]=Zp[t]);i.current&&!e.disabled&&(p.disabled=!1),u._options={...p,...e,validate:e.validate};let m=()=>({...u._formState,defaultValues:u._defaultValues}),{resyncIfNeeded:h,snapshot:g}=$(m,Bf);return Ff(()=>{h(!0,m,l);let e=u._subscribe({formState:u._proxyFormState,callback:()=>l({...u._formState,defaultValues:u._defaultValues}),reRenderRoot:!0});return l(e=>({...e,isReady:!0})),u._formState.isReady=!0,u._subjects.state.next({isReady:!0}),()=>{e(),g(!0,m)}},[u,h,g]),d.useEffect(()=>{u._disableForm(i.current&&!e.disabled?!1:e.disabled),i.current=!!e.disabled},[u,e.disabled]),d.useEffect(()=>{e.mode&&(u._options.mode=e.mode),e.reValidateMode&&(u._options.reValidateMode=e.reValidateMode)},[u,e.mode,e.reValidateMode]),d.useEffect(()=>{e.errors?(u._setErrors(e.errors),u._focusError()):o.current&&u._setErrors({}),o.current=!!e.errors},[u,e.errors]),d.useEffect(()=>{a.current&&!e.validate&&t.current&&t.current.clearErrors(wf),a.current=!!e.validate},[e.validate]),d.useEffect(()=>{e.shouldUnregister&&u._subjects.state.next({values:u._getWatch()})},[u,e.shouldUnregister]),d.useEffect(()=>{if(u._proxyFormState.isDirty){let e=u._getDirty();e!==c.isDirty&&u._subjects.state.next({isDirty:e})}},[u,c.isDirty]),d.useEffect(()=>{e.values&&!zf(e.values,n.current)?(u._reset(e.values,{keepFieldsRef:!0,...u._options.resetOptions}),u._options.resetOptions&&u._options.resetOptions.keepIsValid||u._setValid(),n.current=e.values,l(e=>({...e}))):u._resetDefaultValues()},[u,e.values]),d.useEffect(()=>{u._state.mount&&(s.current||e.values)||(u._setValid(),u._state.mount=!0),s.current=!0,u._state.watch&&(u._state.watch=!1,u._subjects.state.next({...u._formState})),u._removeUnmounted()}),t.current.formState=d.useMemo(()=>Pf(c,u),[u,c]),t.current}var $p=d.createContext(null);$p.displayName=`HookFormContext`;function em({address:e,onClose:t,onPick:n}){let[r,i]=(0,d.useState)(``),[a,o]=(0,d.useState)(0),s=(0,d.useRef)(null),c=(0,d.useId)(),l=(0,d.useId)(),u=ws(e,r.trim()),f=u.data?.pages.flatMap(e=>e.snippets)??[],p=f[Math.min(a,f.length-1)];(0,d.useEffect)(()=>{s.current?.focus()},[]);function m(e){e.key===`Escape`?(e.preventDefault(),e.stopPropagation(),t()):e.key===`Enter`?(e.preventDefault(),e.stopPropagation(),p!==void 0&&n(p)):f.length!==0&&(e.key===`ArrowDown`?(e.preventDefault(),o(e=>(Math.min(e,f.length-1)+1)%f.length)):e.key===`ArrowUp`&&(e.preventDefault(),o(e=>(Math.min(e,f.length-1)-1+f.length)%f.length)))}return(0,h.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-md border border-border bg-surface p-2 shadow-sm`,children:[(0,h.jsx)(`label`,{className:`sr-only`,htmlFor:`${c}-search`,children:`Find a snippet`}),(0,h.jsx)(ao,{"aria-activedescendant":p===void 0?void 0:`${l}-${p.id}`,"aria-autocomplete":`list`,"aria-controls":c,"aria-expanded":`true`,autoComplete:`off`,id:`${c}-search`,onChange:e=>{i(e.target.value),o(0)},onKeyDown:m,placeholder:`Find a snippet`,ref:s,role:`combobox`,value:r}),(0,h.jsx)(`ul`,{"aria-label":`Snippets`,className:`flex max-h-64 flex-col overflow-y-auto`,id:c,role:`listbox`,children:f.map(e=>(0,h.jsxs)(`li`,{"aria-selected":e===p,className:U(`flex cursor-pointer flex-col rounded px-2 py-2 text-sm`,e===p?`bg-accent-soft text-accent-text`:`hover:bg-muted`),id:`${l}-${e.id}`,onClick:()=>{n(e)},onMouseDown:e=>{e.preventDefault()},role:`option`,children:[(0,h.jsx)(`span`,{className:`font-medium`,children:e.name}),(0,h.jsx)(`span`,{className:`truncate text-muted-foreground`,children:e.text.split(`
12
+ `)[0]})]},e.id))}),(0,h.jsx)(`p`,{"aria-live":`polite`,className:`px-2 text-sm text-muted-foreground`,role:`status`,children:u.isError?u.error.message:u.data===void 0?`Loading snippets…`:f.length>0?``:r.trim()===``?(0,h.jsxs)(h.Fragment,{children:[`This mailbox has no snippets yet.`,` `,(0,h.jsx)(oi,{className:`font-medium text-accent-text underline underline-offset-2`,to:Rs(e),children:`Add snippets`})]}):`No snippet matches “${r.trim()}”.`})]})}var tm=Math.floor(xu.sizeInBytes*3/4/bu);function nm(e){return e<=xu.sizeInBytes?null:Ou(e)}function rm(e,t){let n=am(t),r=n.invalid[0];return{error:r===void 0?null:im(r),recipients:[...new Set([...e,...n.valid])],text:n.invalid.join(`, `)}}function im(e){return`"${e}" is not a valid email address. Check it and try again.`}function am(e){let t={invalid:[],valid:[]};for(let n of e.split(/[,;\n]/)){let e=n.trim();if(e===``)continue;let r=(/<([^<>]*)>\s*$/.exec(e)?.[1]??e).trim();Cu.test(r)?t.valid.push(r):t.invalid.push(e)}return t}function om(e){let t=e.filter(e=>e.state===`received`||e.state===`sent`),n=t.findLast(e=>e.state===`received`);if(n!==void 0)return{messageId:n.id,to:[n.replyTo[0]??n.from.address]};let r=t.at(-1);return r===void 0?null:{messageId:r.id,to:[...r.to]}}function sm({entries:e,limitError:t,onAdd:n,onRemove:r}){let[i,a]=(0,d.useState)(!1);return(0,h.jsxs)(`div`,{className:U(`flex flex-col gap-2 rounded-md border border-dashed border-border p-3`,i&&`border-accent bg-accent-soft`),onDragLeave:()=>{a(!1)},onDragOver:e=>{e.preventDefault(),a(!0)},onDrop:e=>{e.preventDefault(),a(!1),n([...e.dataTransfer.files])},children:[(0,h.jsxs)(`label`,{className:`inline-flex min-h-11 w-fit cursor-pointer items-center gap-2 rounded-md border border-border bg-surface px-3 text-sm font-medium has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-accent hover:bg-muted md:min-h-9`,children:[(0,h.jsx)(Io,{"aria-hidden":`true`,className:`size-4`}),`Attach files`,(0,h.jsx)(`input`,{className:`sr-only`,multiple:!0,onChange:e=>{n([...e.target.files??[]]),e.target.value=``},type:`file`})]}),(0,h.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Or drop files here. Up to `,tm,` MiB of files in total.`]}),t===null?null:(0,h.jsx)(`p`,{className:`text-sm text-red-700 dark:text-red-300`,role:`alert`,children:t}),e.length>0?(0,h.jsx)(`ul`,{"aria-label":`Attached files`,className:`flex flex-col gap-2`,children:e.map(e=>(0,h.jsxs)(`li`,{className:`flex items-center gap-2 rounded-md bg-muted px-3 py-1.5 text-sm`,children:[(0,h.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,h.jsx)(`span`,{className:`truncate`,children:e.filename}),(0,h.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[Tu(e.sizeInBytes),e.attachment===null&&e.error===null?` · Uploading…`:``]}),e.attachment===null&&e.error===null?(0,h.jsx)(`progress`,{"aria-label":`Uploading ${e.filename}`,className:`h-1.5 w-full`,max:1,value:e.progress}):null,e.error===null?null:(0,h.jsx)(`span`,{className:`text-xs text-red-700 dark:text-red-300`,role:`alert`,children:e.error})]}),(0,h.jsx)(`button`,{"aria-label":`Remove ${e.filename}`,className:`inline-flex size-11 shrink-0 items-center justify-center rounded-md outline-none hover:bg-border focus-visible:ring-2 focus-visible:ring-accent md:size-8`,onClick:()=>{r(e.key)},type:`button`,children:(0,h.jsx)(Uo,{"aria-hidden":`true`,className:`size-4`})})]},e.key))}):null]})}function cm({onCancel:e,onDiscard:t,open:n}){return(0,h.jsxs)(no,{description:`It will be deleted for everyone with access to this mailbox.`,onClose:e,open:n,title:`Discard this draft?`,children:[(0,h.jsx)(W,{onClick:e,variant:`outline`,children:`Cancel`}),(0,h.jsx)(W,{onClick:t,children:`Discard`})]})}function lm(e,t){let n=getComputedStyle(e),r=um(n.borderLeftWidth)+um(n.borderRightWidth),i=Math.max(0,e.offsetWidth-e.clientWidth-r);t.style.paddingRight=`${um(n.paddingRight)+i}px`,t.scrollTop=e.scrollTop,t.scrollLeft=e.scrollLeft}function um(e){let t=Number.parseFloat(e);return Number.isNaN(t)?0:t}function dm({className:e,onScroll:t,ref:n,text:r,...i}){let a=(0,d.useRef)(null),o=(0,d.useRef)(null),s=Iu(r),c=[],l=0;for(let e of s)c.push(r.slice(l,e.start)),c.push((0,h.jsx)(`mark`,{className:`rounded-sm bg-amber-200 text-transparent dark:bg-amber-500/40`,"data-placeholder":``,children:e.text},e.start)),l=e.end;c.push(`${r.slice(l)}\n`);function u(){o.current!==null&&a.current!==null&&lm(o.current,a.current)}return(0,d.useLayoutEffect)(u,[r]),(0,d.useLayoutEffect)(()=>{let e=o.current;if(e===null||typeof ResizeObserver>`u`)return;let t=new ResizeObserver(u);return t.observe(e),()=>{t.disconnect()}},[]),(0,h.jsxs)(`div`,{className:`relative rounded-md bg-surface`,children:[(0,h.jsx)(`div`,{"aria-hidden":`true`,className:U(`pointer-events-none absolute inset-0 overflow-hidden rounded-md border border-transparent px-3 py-2 text-base break-words whitespace-pre-wrap text-transparent md:text-sm`,e),ref:a,children:s.length===0?null:c}),(0,h.jsx)(so,{className:U(`relative bg-transparent`,e),onScroll:e=>{u(),t?.(e)},ref:e=>{o.current=e,typeof n==`function`?n(e):n!=null&&(n.current=e)},...i})]})}function fm({error:e,inputRef:t,label:n,onCommit:r,onTextChange:i,recipients:a,text:o}){let s=(0,d.useId)(),c=(0,d.useId)();function l(e){r(rm(a,e))}function u(e){e.key===`Enter`&&!e.metaKey&&!e.ctrlKey&&(e.preventDefault(),l(o)),e.key===`Backspace`&&o===``&&a.length>0&&r({error:null,recipients:a.slice(0,-1),text:``})}return(0,h.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,h.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,h.jsx)(`label`,{className:`w-16 shrink-0 pt-3 text-sm text-muted-foreground md:pt-2`,htmlFor:c,children:n}),(0,h.jsxs)(`div`,{className:`flex min-h-11 min-w-0 flex-1 flex-wrap items-center gap-1.5 rounded-md border border-border bg-surface px-2 py-1.5 focus-within:ring-2 focus-within:ring-accent md:min-h-9`,children:[a.map(e=>(0,h.jsxs)(`span`,{className:`inline-flex max-w-full items-center gap-1 rounded-full bg-accent-soft py-0.5 pr-0.5 pl-2.5 text-sm text-accent-text`,children:[(0,h.jsx)(`span`,{className:`truncate`,children:e}),(0,h.jsx)(`button`,{"aria-label":`Remove ${e} from ${n}`,className:`inline-flex size-6 items-center justify-center rounded-full outline-none hover:bg-accent/15 focus-visible:ring-2 focus-visible:ring-accent`,onClick:()=>{r({error:null,recipients:a.filter(t=>t!==e),text:o})},type:`button`,children:(0,h.jsx)(Uo,{"aria-hidden":`true`,className:`size-3.5`})})]},e)),(0,h.jsx)(`input`,{"aria-describedby":e===null?void 0:s,"aria-invalid":e!==null,autoCapitalize:`none`,autoComplete:`off`,className:`min-w-32 flex-1 bg-transparent py-1 text-base outline-none md:text-sm`,id:c,inputMode:`email`,onBlur:()=>{o.trim()!==``&&l(o)},onChange:e=>{let t=e.target.value;/[,;\n]/.test(t)?l(t):i(t)},onKeyDown:u,ref:t,spellCheck:!1,type:`text`,value:o})]})]}),(0,h.jsx)(`p`,{"aria-live":`polite`,className:`pl-18 text-sm text-red-700 dark:text-red-300`,id:s,children:e})]})}function pm({onFill:e,onSkip:t}){let[n,r]=(0,d.useState)(``),i=(0,d.useId)();return(0,h.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-md border border-border bg-muted/40 p-3 sm:flex-row sm:items-end`,children:[(0,h.jsxs)(`div`,{className:`flex flex-1 flex-col gap-1`,children:[(0,h.jsx)(`label`,{className:`text-sm font-medium`,htmlFor:i,children:`What is their name?`}),(0,h.jsx)(ao,{autoComplete:`off`,autoFocus:!0,id:i,onChange:e=>{r(e.target.value)},onKeyDown:r=>{r.key===`Enter`?(r.preventDefault(),r.stopPropagation(),e(n)):r.key===`Escape`&&(r.preventDefault(),r.stopPropagation(),t())},value:n})]}),(0,h.jsxs)(`div`,{className:`flex gap-2`,children:[(0,h.jsx)(W,{onClick:()=>{e(n)},type:`button`,children:`Fill in`}),(0,h.jsx)(W,{onClick:t,type:`button`,variant:`outline`,children:`Skip`})]})]})}function mm({attachments:e,getAddress:t,onChanged:n,uploadFile:r=id}){let[i,a]=(0,d.useState)(()=>e.map(e=>({attachment:e,error:null,filename:e.filename,key:e.id,progress:1,sizeInBytes:e.sizeInBytes}))),[o,s]=(0,d.useState)(null),c=(0,d.useRef)(i),l=(0,d.useRef)(new Map),u=(0,d.useRef)(0);(0,d.useEffect)(()=>{let e=l.current;return()=>{for(let t of e.values())t.abort();e.clear()}},[]);function f(e){c.current=e(c.current),a(c.current)}function p(e){if(e.length===0)return;let i=nm(c.current.filter(e=>e.error===null).reduce((e,t)=>e+wu(t.sizeInBytes),0)+e.reduce((e,t)=>e+wu(t.size),0));if(s(i),i!==null)return;let a=t();for(let t of e){u.current+=1;let e=new AbortController,i=`upload-${u.current}`;l.current.set(i,e),f(e=>[...e,{attachment:null,error:null,filename:t.name,key:i,progress:0,sizeInBytes:t.size}]),r(a,t,e=>{f(t=>t.map(t=>t.key===i?{...t,progress:e}:t))},e.signal).then(({id:r})=>{l.current.delete(i),!e.signal.aborted&&c.current.some(e=>e.key===i)&&(f(e=>e.map(e=>e.key===i?{...e,attachment:{contentType:t.type,filename:t.name,id:r,sizeInBytes:t.size},progress:1}:e)),n())},t=>{l.current.delete(i),e.signal.aborted||f(e=>e.map(e=>e.key===i?{...e,error:t instanceof Error?t.message:`The file could not be uploaded. Try again.`}:e))})}}function m(e){let t=c.current.find(t=>t.key===e);t!==void 0&&(l.current.get(e)?.abort(),l.current.delete(e),f(t=>t.filter(t=>t.key!==e)),s(null),t.attachment!==null&&n())}return{add:p,attachments:()=>c.current.flatMap(e=>e.attachment===null?[]:[e.attachment]),entries:i,isUploading:i.some(e=>e.attachment===null&&e.error===null),limitError:o,remove:m}}var hm=class{conflictError=null;dirty=!1;discarded=!1;disposed=!1;id;running=null;timer=null;options;constructor(e){this.id=e.draftId,this.options=e}get draftId(){return this.id}get hasUnsavedChanges(){return this.dirty||this.running!==null}activate(){this.disposed=!1}async discard(){for(this.discarded=!0,this.dispose();this.running!==null;)await this.running.catch(()=>void 0);return this.id}dispose(){this.disposed=!0,this.clearTimer()}async disposeAndFlush(){let e=this.hasUnsavedChanges;this.dispose(),e&&!this.discarded&&await this.drain()}flush(){return this.disposed?this.id===null?Promise.reject(Error(`The draft is closed.`)):Promise.resolve(this.id):this.drain()}async drain(){for(this.clearTimer();;){if(this.conflictError!==null)throw this.conflictError;if(this.running!==null){await this.running.catch(()=>void 0);continue}if(this.id!==null&&!this.dirty)return this.id;if(this.discarded)throw Error(`The draft was discarded.`);let e=this.save();this.running=e;try{await e}finally{this.running=null}}}markChanged(){this.conflictError!==null||this.disposed||(this.dirty=!0,this.clearTimer(),this.id===null&&this.running===null?this.flush().catch(()=>void 0):this.timer=setTimeout(()=>{this.timer=null,this.flush().catch(()=>void 0)},this.options.delayInMilliseconds))}resume(){this.discarded=!1,this.activate()}clearTimer(){this.timer!==null&&(clearTimeout(this.timer),this.timer=null)}report(e,t){this.disposed||this.options.onStatus(e,t)}async save(){let e=this.options.getBody();this.dirty=!1,this.report(`saving`);try{this.id===null?this.id=(await Ju(this.options.getAddress(),e)).id:await Y(this.id,e)}catch(e){throw this.dirty=!0,e instanceof Zo&&e.status===409?(this.conflictError=e,this.disposed||this.options.onConflict(e.message)):this.report(`error`,e instanceof Error?e.message:`The draft could not be saved. Try again.`),e}this.report(`saved`)}};function gm({delayInMilliseconds:e,draftId:t,form:n,getAttachments:r,getPending:i,isRecovered:a,onConflict:o,onDraftCreated:s,recoveryKey:c,replyToMessageId:l}){let[u,f]=(0,d.useState)(t!==null),[p,m]=(0,d.useState)(null),[h,g]=(0,d.useState)(`idle`),_=(0,d.useRef)(t),[v]=(0,d.useState)(()=>new hm({delayInMilliseconds:e,draftId:t,getAddress:()=>n.getValues(`from`),getBody:()=>{let e=n.getValues();return{attachmentIds:r().map(e=>e.id),cc:e.cc,...l===void 0?{}:{replyToMessageId:l},subject:e.subject,text:e.text,to:e.to}},onConflict:o,onStatus:(e,t)=>{g(e),m(t??null),f(v.draftId!==null),e===`saved`&&Md(c),v.draftId!==null&&v.draftId!==_.current&&(_.current=v.draftId,s?.(v.draftId))}}));return(0,d.useEffect)(()=>{v.activate(),a&&(v.markChanged(),v.flush().catch(()=>void 0));let e=n.watch((e,{name:t})=>{t!==`from`&&v.markChanged()});function t(e,t){let r=n.getValues();Rd(c,{cc:r.cc,draftId:v.draftId,from:r.from,isConflict:t,message:e,replyToMessageId:l,subject:r.subject,text:r.text,to:r.to})}let r=ss(()=>{v.hasUnsavedChanges&&t(`Your session expired while you were writing.`,!1)});function o(e){os()||v.hasUnsavedChanges&&(v.flush().catch(()=>void 0),e.preventDefault())}return window.addEventListener(`beforeunload`,o),()=>{e.unsubscribe(),r(),window.removeEventListener(`beforeunload`,o);for(let e of[`cc`,`to`]){let t=rm(n.getValues(e),i()[e]);t.recipients.length!==n.getValues(e).length&&(n.setValue(e,t.recipients),v.markChanged())}v.disposeAndFlush().catch(e=>{t(e instanceof Error?e.message:`The draft could not be saved. Try again.`,e instanceof Zo&&e.status===409)})}},[n,c,v]),{hasDraft:u,saveMessage:p,saveStatus:h,saver:v}}var _m=/^\{\{\s*(firstName|name)\s*\}\}$/,vm=2e3,ym=`min-h-11 w-full rounded-md border border-border bg-surface px-3 text-base text-foreground outline-none focus-visible:ring-2 focus-visible:ring-accent disabled:opacity-70 md:min-h-9 md:text-sm`;function bm({attachments:e=[],delayInMilliseconds:t=vm,draftId:n=null,from:r,initialValues:i,isFromFixed:a,isRecovered:o=!1,mailboxes:s,onClose:c,onConflict:l,onDiscarded:u,onDraftCreated:f,onSent:p,recoveryKey:m,replyToMessageId:g,uploadFile:v}){let y=Qp({defaultValues:{cc:i.cc,from:r,subject:i.subject,text:i.text,to:i.to}}),[b,x]=(0,d.useState)(null),[S,C]=(0,d.useState)(!1),[w,T]=(0,d.useState)(!1),[ee,E]=(0,d.useState)(!1),[D,O]=(0,d.useState)({cc:``,to:``}),[te,k]=(0,d.useState)({}),[A,ne]=(0,d.useState)(null),[re,ie]=(0,d.useState)(null),[j,ae]=(0,d.useState)(null),[oe,se]=(0,d.useState)(null),ce=_(),le=(0,d.useRef)(!1),ue=(0,d.useRef)(D),de=(0,d.useRef)(null),fe=(0,d.useRef)(i.text);ue.current=D;let{hasDraft:M,saveMessage:pe,saveStatus:me,saver:he}=gm({delayInMilliseconds:t,draftId:n,form:y,getAttachments:()=>N.attachments(),getPending:()=>ue.current,isRecovered:o,onConflict:l,onDraftCreated:f,recoveryKey:m,replyToMessageId:g}),N=mm({attachments:e,getAddress:()=>y.getValues(`from`),onChanged:()=>{he.markChanged()},uploadFile:v});(0,d.useEffect)(()=>{y.setFocus(i.to.length>0?`text`:`to`)},[]);let P=Wf({control:y.control,name:`from`}),ge=Wf({control:y.control,name:`text`}),_e=Ss(P).data?.newAddressesToday??0,ve=y.register(`text`),ye=Iu(ge).length>0,F=!s.includes(P),I=a||M||N.entries.length>0,L=ee||N.isUploading||me===`saving`||F;function be(e){let t=rm(y.getValues(e),D[e]);return t.recipients.length!==y.getValues(e).length&&y.setValue(e,t.recipients,{shouldValidate:!0}),O(n=>({...n,[e]:t.text})),k(n=>({...n,[e]:t.error})),t.error===null}async function xe(){ne(null),E(!0);try{let e;try{e=await he.flush()}catch(e){e instanceof Zo&&e.status===409||ne(xm(e));return}try{let t=await $u(e);Md(m),p(t)}catch(e){e instanceof Zo&&e.status===409?l(e.message):ne(xm(e))}}finally{E(!1)}}async function Se(e={}){if(!le.current){le.current=!0;try{let t=be(`to`),n=be(`cc`);if(!t||!n)return;await y.handleSubmit(async t=>{let n=Iu(`${t.subject}\n${t.text}`)[0];n!==void 0&&e.isPlaceholderConfirmed!==!0?se(n.text):await xe()})()}finally{le.current=!1}}}function Ce(){let e=j?.cursor??null;ae(null),requestAnimationFrame(()=>{let t=de.current;t!==null&&(t.focus(),e!==null&&t.setSelectionRange(e,e))})}function R(e){let t=de.current,n=y.getValues(`text`),r=t?.selectionEnd??n.length;ae({cursor:r,slashAt:e})}function we(e){let t=e.target,n=t.value,r=fe.current,i=t.selectionEnd;fe.current=n;let a=t.selectionStart===i&&i>0&&n[i-1]===`/`&&n.length===r.length+1&&n.slice(0,i-1)+n.slice(i)===r,o=i===1||n[i-2]===`
13
+ `;a&&o&&ae({cursor:i,slashAt:i-1})}async function Te(e){if(j===null)return;let t=j;ae(null),ie(null);let n=rm(y.getValues(`to`),ue.current.to).recipients[0],[r,i]=await Promise.all([n===void 0?Promise.resolve(null):ce.fetchQuery(vs(y.getValues(`from`),n)).then(e=>e.contact.name).catch(()=>null),ce.fetchQuery({...Cs(),staleTime:1/0}).then(e=>e.name).catch(()=>null)]),a=Fu(e.text,{firstName:Lu(r),myName:i,name:r}),o=y.getValues(`text`),s=t.slashAt!==null&&o[t.slashAt]===`/`,c=s&&t.slashAt!==null?t.slashAt:t.cursor,l=s?c+1:t.cursor,u=o.slice(0,c)+a+o.slice(l),d=Iu(a).some(e=>_m.test(e.text));fe.current=u,y.setValue(`text`,u,{shouldDirty:!0}),d?ie({inserted:a,start:c}):Oe(c+a.length)}function Ee(e){let t=re;if(ie(null),t===null)return;let n=y.getValues(`text`),r=n.slice(t.start,t.start+t.inserted.length)===t.inserted?t.start:n.indexOf(t.inserted);if(r===-1||e.trim()===``){Oe(null);return}let i=Fu(t.inserted,{firstName:Lu(e),myName:null,name:e.trim()}),a=n.slice(0,r)+i+n.slice(r+t.inserted.length);fe.current=a,y.setValue(`text`,a,{shouldDirty:!0}),Oe(r+i.length)}function De(){let e=re;ie(null),Oe(e===null?null:e.start+e.inserted.length)}function Oe(e){requestAnimationFrame(()=>{let t=de.current;t!==null&&(t.focus(),e!==null&&t.setSelectionRange(e,e))})}async function ke(){if(be(`to`)&&be(`cc`)){if(he.hasUnsavedChanges)try{await he.flush()}catch{return}c()}}async function Ae(){C(!1),x(null),T(!0);try{let e=await he.discard();e!==null&&await Xu(e)}catch(e){if(!(e instanceof Zo&&e.status===404)){he.resume(),T(!1),e instanceof Zo&&e.status===409?l(e.message):x(e instanceof Error?e.message:`The draft could not be discarded. Try again.`);return}}Md(m),u()}function je(){y.getValues(`text`).trim()!==``||N.entries.length>0?C(!0):Ae()}function Me(e){e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),L||Se())}function Ne(e,t){return(0,h.jsx)(Kf,{control:y.control,name:e,render:({field:n,fieldState:r})=>(0,h.jsx)(fm,{error:te[e]??r.error?.message??null,inputRef:n.ref,label:t,onCommit:t=>{(t.recipients.length!==n.value.length||t.recipients.some((e,t)=>e!==n.value[t]))&&n.onChange(t.recipients),O(n=>({...n,[e]:t.text})),k(n=>({...n,[e]:t.error}))},onTextChange:t=>{O(n=>({...n,[e]:t})),k(t=>({...t,[e]:null}))},recipients:n.value,text:D[e]}),rules:e===`to`?{validate:e=>e.length>0||`Add at least one recipient before sending.`}:{}})}return(0,h.jsxs)(`form`,{"aria-label":`New message`,className:`flex flex-col gap-3`,noValidate:!0,onKeyDown:Me,onSubmit:e=>{e.preventDefault(),Se()},children:[(0,h.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,h.jsx)(`label`,{className:`w-16 shrink-0 pt-3 text-sm text-muted-foreground md:pt-2`,htmlFor:`compose-from`,children:`From`}),(0,h.jsx)(Kf,{control:y.control,name:`from`,render:({field:e})=>(0,h.jsxs)(`select`,{className:ym,disabled:I,id:`compose-from`,name:e.name,onBlur:e.onBlur,onChange:e.onChange,ref:e.ref,value:e.value,children:[F?(0,h.jsxs)(`option`,{value:P,children:[P,` (archived)`]}):null,s.map(e=>(0,h.jsx)(`option`,{value:e,children:e},e))]})})]}),F?(0,h.jsxs)(`p`,{className:`text-sm text-red-700 dark:text-red-300`,children:[P,` is archived. Add it back to mail.config.ts and deploy before sending from it.`]}):null,_e>=Au.newAddressesNotice?(0,h.jsxs)(`p`,{className:`rounded-md border border-amber-300 bg-amber-50 px-3 py-2 text-sm text-amber-900 dark:border-amber-800 dark:bg-amber-950 dark:text-amber-100`,role:`note`,children:[`This mailbox has written to `,_e,` new people today. Cloudflare's mail sending is not meant for bulk cold mail; many of these in a day can get sending suspended.`]}):null,Ne(`to`,`To`),Ne(`cc`,`Cc`),(0,h.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,h.jsx)(`label`,{className:`w-16 shrink-0 pt-3 text-sm text-muted-foreground md:pt-2`,htmlFor:`compose-subject`,children:`Subject`}),(0,h.jsx)(ao,{id:`compose-subject`,...y.register(`subject`)})]}),(0,h.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,h.jsx)(dm,{"aria-describedby":ye?`compose-placeholder-hint`:void 0,"aria-label":`Message`,className:`min-h-48`,name:ve.name,onBlur:ve.onBlur,onChange:e=>{ve.onChange(e),we(e)},ref:e=>{ve.ref(e),de.current=e},text:ge}),ye?(0,h.jsx)(`p`,{className:`text-sm text-amber-800 dark:text-amber-300`,id:`compose-placeholder-hint`,children:`Fill in the highlighted parts before sending.`}):null,re===null?null:(0,h.jsx)(pm,{onFill:Ee,onSkip:De}),(0,h.jsx)(`div`,{children:(0,h.jsxs)(W,{"aria-expanded":j!==null,onClick:()=>{j===null?R(null):Ce()},variant:`outline`,children:[(0,h.jsx)(Mo,{"aria-hidden":`true`,className:`size-4`}),`Snippets`]})}),j===null?null:(0,h.jsx)(em,{address:P,onClose:Ce,onPick:e=>{Te(e)}})]}),(0,h.jsx)(sm,{entries:N.entries,limitError:N.limitError,onAdd:N.add,onRemove:N.remove}),A===null?null:(0,h.jsx)(`p`,{className:`text-sm text-red-700 dark:text-red-300`,role:`alert`,children:A}),b===null?null:(0,h.jsx)(`p`,{className:`text-sm text-red-700 dark:text-red-300`,role:`alert`,children:b}),(0,h.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,h.jsx)(W,{disabled:L||w,type:`submit`,children:`Send`}),(0,h.jsx)(W,{disabled:w,onClick:()=>void ke(),variant:`outline`,children:`Close`}),(0,h.jsx)(W,{disabled:ee||w,onClick:je,variant:`outline`,children:`Discard`}),(0,h.jsx)(`p`,{"aria-live":`polite`,className:`min-w-0 flex-1 text-sm text-muted-foreground`,role:`status`,children:ee?`Sending…`:Sm(me,pe)})]}),(0,h.jsx)(cm,{onCancel:()=>{C(!1)},onDiscard:()=>void Ae(),open:S}),(0,h.jsxs)(no,{description:Ru(oe??``),onClose:()=>{se(null)},open:oe!==null,title:`Send with a placeholder?`,children:[(0,h.jsx)(W,{onClick:()=>{se(null)},variant:`outline`,children:`Keep editing`}),(0,h.jsx)(W,{onClick:()=>{se(null),Se({isPlaceholderConfirmed:!0})},children:`Send anyway`})]})]})}function xm(e){return e instanceof Error?e.message:`The message could not be sent. Try again.`}function Sm(e,t){return e===`saving`?`Saving…`:e===`saved`?`Saved`:e===`error`?`Not saved. ${t??`Try again.`}`:``}function Cm({attachments:e}){return e.length===0?null:(0,h.jsx)(`ul`,{"aria-label":`Attachments`,className:`flex flex-wrap gap-2`,children:e.map(e=>(0,h.jsx)(`li`,{className:`min-w-0 max-w-full`,children:(0,h.jsxs)(`a`,{className:`inline-flex min-h-11 max-w-full items-center gap-2 rounded-md border border-border bg-surface px-3 text-sm outline-none hover:bg-muted focus-visible:ring-2 focus-visible:ring-accent md:min-h-9`,download:e.filename,href:`/api/attachments/${encodeURIComponent(e.id)}`,children:[(0,h.jsx)(Io,{"aria-hidden":`true`,className:`size-4 shrink-0 text-muted-foreground`}),(0,h.jsx)(`span`,{className:`min-w-0 truncate`,children:e.filename}),(0,h.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground`,children:Tu(e.sizeInBytes)})]})},e.id))})}var wm=new Set([`fail`,`permerror`,`softfail`,`temperror`]);function Tm({canEditDraft:e,failureNotice:t,isDraftLocked:n,isExpanded:r,mailbox:i,message:a,now:o,onDraftDiscarded:s,onEditDraft:c,onRetried:l,onToggle:u}){let d=tt({...vs(i,a.from.address),enabled:a.state===`received`,retry:!1,staleTime:6e4}).data?.contact;if(a.state===`draft`)return(0,h.jsx)(km,{canEdit:e,isLocked:n,message:a,onDiscarded:s,onEdit:c});let f=a.sentAt??a.createdAt,p=Rm(a);return(0,h.jsxs)(`article`,{"aria-label":`Message from ${p.name}`,className:`rounded-lg border border-border bg-surface outline-none`,tabIndex:-1,children:[(0,h.jsxs)(`button`,{"aria-expanded":r,className:`flex min-h-14 w-full items-center gap-3 rounded-lg px-4 py-2 text-left outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-inset`,onClick:u,type:`button`,children:[r?(0,h.jsx)(wo,{"aria-hidden":`true`,className:`size-4 shrink-0 text-muted-foreground`}):(0,h.jsx)(Oo,{"aria-hidden":`true`,className:`size-4 shrink-0 text-muted-foreground`}),(0,h.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,h.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,h.jsx)(`span`,{className:`truncate text-sm font-semibold`,children:p.name}),d===void 0||d.status===`none`?null:(0,h.jsx)(`span`,{className:U(`shrink-0 rounded-sm px-1.5 py-0.5 text-xs font-normal`,yd(d.status)),children:vd(d.status)})]}),r?(0,h.jsx)(`span`,{className:`truncate text-xs text-muted-foreground`,children:p.address}):(0,h.jsx)(`span`,{className:`truncate text-sm text-muted-foreground`,children:Bm(a)})]}),a.state===`sent`?(0,h.jsx)(`span`,{className:`shrink-0 rounded-sm bg-muted px-1.5 py-0.5 text-xs text-muted-foreground`,title:`Accepted by Cloudflare for delivery`,children:`Sent`}):null,a.automatic===`reply`?(0,h.jsx)(`span`,{className:`shrink-0 rounded-sm bg-muted px-1.5 py-0.5 text-xs text-muted-foreground`,title:`Sent by a program, such as an out-of-office reply. It does not count as a reply.`,children:`Automatic reply`}):null,a.automatic===`list`?(0,h.jsx)(`span`,{className:`shrink-0 rounded-sm bg-muted px-1.5 py-0.5 text-xs text-muted-foreground`,title:`Sent through a mailing list or as bulk mail.`,children:`List mail`}):null,(0,h.jsx)(Lm,{now:o,value:f})]}),r?(0,h.jsxs)(`div`,{className:`flex flex-col gap-4 border-t border-border px-4 py-4`,children:[d===void 0?null:(0,h.jsxs)(oi,{"aria-label":`Contact page of ${p.name}`,className:`inline-flex min-h-11 w-fit items-center gap-1 text-sm font-medium text-accent-text underline-offset-2 outline-none hover:underline focus-visible:ring-2 focus-visible:ring-accent md:min-h-0`,to:Fs(i,d.address),children:[(0,h.jsx)(Vo,{"aria-hidden":`true`,className:`size-4`}),`Contact page`]}),(0,h.jsx)(Om,{message:a}),(0,h.jsx)(Im,{failureNotice:t,message:a,now:o,onRetried:l}),(0,h.jsx)(Cm,{attachments:a.attachments})]}):null]})}function Em(e){if(e==null)return`Not checked`;let t=e.toLowerCase();return t===`pass`?`Passed`:wm.has(t)?`Failed`:`Not checked`}function Dm({label:e,value:t}){return(0,h.jsxs)(`div`,{className:`flex gap-2`,children:[(0,h.jsx)(`dt`,{className:`w-16 shrink-0 text-muted-foreground`,children:e}),(0,h.jsx)(`dd`,{className:`min-w-0 break-words`,children:t})]})}function Om({message:e}){let[t,n]=(0,d.useState)(!1),r=e.authentication;return(0,h.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,h.jsxs)(`button`,{"aria-expanded":t,className:`inline-flex min-h-11 w-fit items-center gap-1 rounded-md pr-2 text-sm text-muted-foreground outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-accent md:min-h-8`,onClick:()=>{n(e=>!e)},type:`button`,children:[t?(0,h.jsx)(wo,{"aria-hidden":`true`,className:`size-4`}):(0,h.jsx)(Oo,{"aria-hidden":`true`,className:`size-4`}),`Details`]}),t?(0,h.jsxs)(`dl`,{className:`flex flex-col gap-1 rounded-md bg-muted px-3 py-2 text-sm`,children:[(0,h.jsx)(Dm,{label:`From`,value:zm(e)}),Pm(e)?(0,h.jsx)(Dm,{label:`Reply-To`,value:e.replyTo.join(`, `)}):null,(0,h.jsx)(Dm,{label:`To`,value:e.to.join(`, `)}),e.cc.length>0?(0,h.jsx)(Dm,{label:`Cc`,value:e.cc.join(`, `)}):null,(0,h.jsx)(Dm,{label:`Date`,value:Fm(e.sentAt??e.createdAt)}),(0,h.jsx)(Dm,{label:`SPF`,value:Em(r?.spf)}),(0,h.jsx)(Dm,{label:`DKIM`,value:Em(r?.dkim)}),(0,h.jsx)(Dm,{label:`DMARC`,value:Em(r?.dmarc)})]}):null]})}function km({canEdit:e,isLocked:t,message:n,onDiscarded:r,onEdit:i}){let[a,o]=(0,d.useState)(null),[s,c]=(0,d.useState)(!1),[l,u]=(0,d.useState)(!1);async function f(){c(!1),o(null),u(!0);try{await Xu(n.id),r()}catch(e){if(e instanceof Zo&&e.status===404){r();return}o(e instanceof Error?e.message:`The draft could not be discarded. Try again.`)}finally{u(!1)}}function p(){n.text.trim()!==``||n.attachments.length>0?c(!0):f()}return e?(0,h.jsxs)(`article`,{"aria-label":`Draft`,className:`flex flex-col gap-2 rounded-lg border border-dashed border-border bg-surface px-4 py-2`,children:[(0,h.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,h.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,h.jsx)(`span`,{className:`text-sm font-semibold`,children:`Draft`}),(0,h.jsxs)(`span`,{className:`truncate text-sm text-muted-foreground`,children:[n.to.length>0?`To ${n.to.join(`, `)}. `:``,Bm(n)]}),t?(0,h.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Reopen or discard your unsaved draft first.`}):null]}),(0,h.jsxs)(`div`,{className:`flex gap-2`,children:[(0,h.jsx)(W,{disabled:t||l,onClick:()=>{i(n)},variant:`outline`,children:`Edit draft`}),(0,h.jsx)(W,{disabled:l,onClick:p,variant:`outline`,children:`Discard`})]})]}),a===null?null:(0,h.jsx)(`p`,{className:`text-sm text-red-700 dark:text-red-300`,role:`alert`,children:a}),(0,h.jsx)(cm,{onCancel:()=>{c(!1)},onDiscard:()=>void f(),open:s})]}):(0,h.jsxs)(`article`,{"aria-label":`Draft`,className:`flex flex-col gap-2 rounded-lg border border-dashed border-border bg-surface px-4 py-3`,children:[(0,h.jsx)(`span`,{className:`text-sm font-semibold`,children:`Draft`}),n.to.length>0?(0,h.jsxs)(`span`,{className:`text-sm text-muted-foreground`,children:[`To `,n.to.join(`, `)]}):null,(0,h.jsx)(`p`,{className:`text-sm break-words whitespace-pre-wrap`,children:n.text===``?`This draft has no text.`:n.text}),(0,h.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`This mailbox is archived. Drafts can be read but not sent.`})]})}function Am(e,t){if(t!==void 0)return t;if(e.notice!==void 0&&e.notice!==null)return e.notice;let n=e.to[0]??`the recipient`,r=e.to.length+e.cc.length-1,i=r>0?`${n} and ${r} more`:n;return e.isOutcomeUncertain?`We could not confirm that the message to ${i} was sent. Check with the recipient before sending it again.`:`The message to ${i} was not sent: ${e.failureReason??`the reason is unknown`}.`}function jm({message:e,onRetried:t}){let[n,r]=(0,d.useState)(null),[i,a]=(0,d.useState)(!1),[o,s]=(0,d.useState)(!1);async function c(n){r(null),s(!0);try{t(await Qu(e.id,{confirmPossibleDuplicate:n}))}catch(e){r(e instanceof Error?e.message:`The message could not be sent. Try again.`)}finally{s(!1)}}return(0,h.jsxs)(`div`,{className:`flex flex-col items-start gap-2`,children:[e.isOutcomeUncertain?(0,h.jsx)(W,{disabled:o,onClick:()=>{a(!0)},children:`Send again`}):(0,h.jsx)(W,{disabled:o,onClick:()=>{c(!1)},children:`Retry`}),n===null?null:(0,h.jsx)(`p`,{className:`text-sm text-red-700 dark:text-red-300`,role:`alert`,children:n}),(0,h.jsxs)(no,{description:`This message may already have been sent. Sending again could deliver it twice.`,onClose:()=>{a(!1)},open:i,title:`Send again?`,children:[(0,h.jsx)(W,{onClick:()=>{a(!1)},variant:`outline`,children:`Cancel`}),(0,h.jsx)(W,{onClick:()=>{a(!1),c(!0)},children:`Send again`})]})]})}function Mm(e,t){if(e.queuedAt===void 0||e.queuedAt===null)return!1;let n=new Date(e.queuedAt).getTime();return!Number.isNaN(n)&&t.getTime()-n>3e5}function Nm({message:e,onGivenUp:t}){let[n,r]=(0,d.useState)(null),[i,a]=(0,d.useState)(!1);async function o(){r(null),a(!0);try{t(await Zu(e.id))}catch(e){r(e instanceof Error?e.message:`The message could not be changed. Try again.`)}finally{a(!1)}}return(0,h.jsxs)(`div`,{className:`flex flex-col items-start gap-3 rounded-md border border-border bg-muted p-3`,role:`status`,children:[(0,h.jsx)(`p`,{className:`text-sm`,children:`This message has been sending for a while. It may or may not have been sent.`}),(0,h.jsx)(W,{disabled:i,onClick:()=>{o()},variant:`outline`,children:`Stop waiting`}),n===null?null:(0,h.jsx)(`p`,{className:`text-sm text-red-700 dark:text-red-300`,role:`alert`,children:n})]})}function Pm(e){return e.replyTo.some(t=>t!==e.from.address)}function Fm(e){let t=new Date(e);return Number.isNaN(t.getTime())?``:t.toLocaleString(void 0,{dateStyle:`full`,timeStyle:`short`})}function Im({failureNotice:e,message:t,now:n,onRetried:r}){let i=(0,h.jsx)(`a`,{className:`text-sm font-medium text-accent-text underline underline-offset-2`,download:!0,href:`/api/messages/${encodeURIComponent(t.id)}/raw`,children:`Download original`}),a=(0,h.jsx)(`p`,{className:U(`text-sm leading-relaxed break-words whitespace-pre-wrap`,t.text===``&&`text-muted-foreground`),children:t.text===``?`This message has no text.`:t.text});return t.state===`queued`?Mm(t,n)?(0,h.jsx)(Nm,{message:t,onGivenUp:r}):(0,h.jsx)(`p`,{className:`text-sm text-muted-foreground`,role:`status`,children:`Sending…`}):t.isParsed?(0,h.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[t.state===`failed`?(0,h.jsxs)(`div`,{className:`flex flex-col gap-3 rounded-md border border-red-300 bg-red-50 p-3 text-red-900 dark:border-red-800 dark:bg-red-950 dark:text-red-100`,role:`alert`,children:[(0,h.jsx)(`p`,{className:`text-sm`,children:Am(t,e)}),(0,h.jsx)(jm,{message:t,onRetried:r})]}):null,t.html!==null&&t.html!==``?(0,h.jsx)(ql,{html:t.html,title:`Message from ${Rm(t).name}`,unsafe:(0,h.jsxs)(`div`,{className:`flex flex-col items-start gap-2`,children:[(0,h.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`This message could not be displayed safely. Showing its text instead.`}),a,i]})}):a,t.isTruncated?(0,h.jsxs)(`div`,{className:`flex flex-col items-start gap-2`,children:[(0,h.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`This message is too large to show in full.`}),i]}):null]}):(0,h.jsxs)(`div`,{className:`flex flex-col items-start gap-2`,children:[(0,h.jsx)(`p`,{className:`text-sm`,children:`This message could not be displayed.`}),i]})}function Lm({now:e,value:t}){return(0,h.jsx)(`time`,{className:`shrink-0 text-xs text-muted-foreground tabular-nums`,dateTime:t,title:Fm(t),children:Number.isNaN(new Date(t).getTime())?``:md(t,{now:e})})}function Rm(e){return{address:e.from.address,name:e.from.name??e.from.address}}function zm(e){return e.from.name===null?e.from.address:`${e.from.name} <${e.from.address}>`}function Bm(e){let t=e.text.replaceAll(/\s+/g,` `).trim();return t===``?`No text`:t.slice(0,120)}var Vm=6e3,Hm=`Sent. Cloudflare accepted it for delivery. If it bounces, the bounce is not shown here.`;function Um(){let{address:e,threadId:t}=Xn();return vi(e,`The route always has an address.`),vi(t,`The route always has a thread id.`),(0,h.jsx)(Jm,{address:e,threadId:t},t)}function Wm({address:e}){return(0,h.jsxs)(oi,{className:`inline-flex min-h-12 items-center gap-1 px-3 text-sm font-medium text-accent-text outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-inset md:hidden`,to:Ps(e),children:[(0,h.jsx)(Eo,{"aria-hidden":`true`,className:`size-4`}),`Back to `,e]})}function Gm(e,t){return e.messages.at(-1)?.id===t.id}function Km(e){return{attachments:e.attachments,isRecovered:!1,cc:e.cc,draftId:e.id,replyToMessageId:void 0,subject:e.subject,text:e.text,to:e.to}}function qm(e){return{attachments:[],isRecovered:!0,cc:e.cc,draftId:e.isConflict?null:e.draftId,replyToMessageId:e.replyToMessageId,subject:e.subject,text:e.text,to:e.to}}function Jm({address:e,threadId:t}){let n=Wn(),r=Kn(),i=_(),a=fs(),o=Es(t),s=Xm(n.state),[c,l]=(0,d.useState)(null),u=Vd(t),[f,p]=(0,d.useState)({}),[m,g]=(0,d.useState)(s.failureNotice===void 0?{}:{[s.failureNotice.id]:s.failureNotice.message}),[v,y]=(0,d.useState)(s.notice??null),b=(0,d.useRef)(`unknown`),x=(0,d.useRef)(!1),S=(0,d.useRef)(0),C=(0,d.useRef)(0);function w(){return Promise.all([i.invalidateQueries({queryKey:[`thread`,t]}),i.invalidateQueries({queryKey:[`threads`]}),i.invalidateQueries({queryKey:[`me`]})])}(0,d.useEffect)(()=>{o.data!==void 0&&(b.current===`unknown`&&(b.current=o.data.isRead?`leave`:`mark`),b.current!==`mark`||x.current||(x.current=!0,S.current+=1,J(t,{isRead:!0}).then(()=>(b.current=`leave`,w()),e=>{console.error(`The thread could not be marked read.`,e),S.current>=2&&(b.current=`leave`)}).finally(()=>{x.current=!1})))},[o.data,o.dataUpdatedAt,t]),(0,d.useEffect)(()=>{if(v===null)return;let e=setTimeout(()=>{y(null)},Vm);return()=>{clearTimeout(e)}},[v]);let T=nt({mutationFn:e=>J(t,e),onSuccess:async(t,n)=>{await w(),(n.isArchived===!0||n.isRead===!1)&&r(Ps(e))}});function ee(e){y(null),C.current+=1,l({draftId:e.draftId,key:C.current,start:e})}function E(e){l(null),e.state===`failed`?e.notice!==null&&g(t=>({...t,[e.id]:e.notice??``})):y(Hm),w()}function D(e){l(null),y(e),w()}function O(e){e.state===`failed`&&e.notice!==null&&g(t=>({...t,[e.id]:e.notice??``})),w()}return(0,h.jsxs)(`div`,{className:`flex min-h-full flex-col bg-background`,children:[(0,h.jsx)(`div`,{className:`border-b border-border bg-surface md:hidden`,children:(0,h.jsx)(Wm,{address:e})}),o.isPending?(0,h.jsx)(Ym,{}):null,o.isError?(0,h.jsxs)(`div`,{className:`flex flex-col items-start gap-3 p-4`,role:`alert`,children:[(0,h.jsx)(`p`,{className:`text-sm`,children:o.error.message}),(0,h.jsx)(W,{onClick:()=>{o.refetch()},variant:`outline`,children:`Try again`})]}):null,o.isSuccess?te(o.data):null]});function te(n){let s=new Date(Math.max(Date.now(),o.dataUpdatedAt)),d=n.messages.filter(e=>e.id!==c?.draftId||e.state!==`draft`),g=om(n.messages),_=(a.data?.mailboxes??[]).filter(e=>e.state===`active`).map(e=>e.address).includes(n.mailbox),y=u!==void 0;function b(a){n.messages.every(e=>e.id===a)?(i.removeQueries({queryKey:[`thread`,t]}),i.invalidateQueries({queryKey:[`threads`]}),i.invalidateQueries({queryKey:[`me`]}),r(Ps(e))):w()}function x(){ee({attachments:[],cc:[],draftId:null,isRecovered:!1,replyToMessageId:g?.messageId,subject:Eu(n.subject),text:``,to:g?.to??[]})}return(0,h.jsxs)(`div`,{className:`mx-auto flex w-full max-w-3xl flex-col gap-4 p-4`,children:[(0,h.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,h.jsx)(`h1`,{className:`text-xl font-semibold break-words`,children:n.subject===``?`(no subject)`:n.subject}),(0,h.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,h.jsx)(W,{disabled:T.isPending,onClick:()=>{T.mutate({isArchived:!n.isArchived})},variant:`outline`,children:n.isArchived?`Move to inbox`:`Archive`}),(0,h.jsx)(W,{disabled:T.isPending,onClick:()=>{T.mutate({isRead:!1})},variant:`outline`,children:`Mark unread`})]}),T.isError?(0,h.jsx)(`p`,{className:`text-sm text-red-700 dark:text-red-300`,role:`alert`,children:T.error.message}):null]}),u!==void 0&&c===null&&!_?(0,h.jsx)(sf,{draft:u,onDiscard:()=>{Md(t)}}):null,u!==void 0&&c===null&&_?(0,h.jsxs)(`div`,{className:`flex flex-col items-start gap-2 rounded-md border border-red-300 bg-red-50 px-3 py-2 text-sm text-red-900 dark:border-red-800 dark:bg-red-950 dark:text-red-100`,role:`alert`,children:[(0,h.jsxs)(`p`,{children:[`Your last changes could not be saved. `,u.message]}),(0,h.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,h.jsx)(W,{onClick:()=>{ee(qm(u))},variant:`outline`,children:`Reopen draft`}),(0,h.jsx)(W,{onClick:()=>{Md(t)},variant:`outline`,children:`Discard`})]})]}):null,v===null?null:(0,h.jsx)(`p`,{className:`rounded-md bg-accent-soft px-3 py-2 text-sm text-accent-text`,role:`status`,children:v}),(0,h.jsx)(`div`,{className:`flex flex-col gap-3`,children:d.map(e=>(0,h.jsx)(Tm,{canEditDraft:_,failureNotice:m[e.id],isDraftLocked:y,isExpanded:f[e.id]??Gm(n,e),mailbox:n.mailbox,message:e,now:s,onDraftDiscarded:()=>{b(e.id)},onEditDraft:e=>{ee(Km(e))},onRetried:O,onToggle:()=>{p(t=>({...t,[e.id]:!(t[e.id]??Gm(n,e))}))}},e.id))}),c===null&&_?(0,h.jsxs)(`div`,{className:`flex flex-col items-start gap-2`,children:[(0,h.jsx)(W,{disabled:y,onClick:x,children:`Reply`}),y?(0,h.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Reopen or discard your unsaved draft first.`}):null]}):null,c===null?null:(0,h.jsx)(`section`,{"aria-label":`Reply`,className:`rounded-lg border border-border bg-surface p-4`,children:(0,h.jsx)(bm,{attachments:c.start.attachments,draftId:c.start.draftId,from:n.mailbox,isRecovered:c.start.isRecovered,initialValues:{cc:c.start.cc,subject:c.start.subject,text:c.start.text,to:c.start.to},isFromFixed:!0,mailboxes:_?[n.mailbox]:[],onClose:()=>{l(null),w()},onConflict:D,onDiscarded:()=>{let e=c.draftId;l(null),e===null?w():b(e)},onDraftCreated:e=>{l(t=>t===null?t:{...t,draftId:e})},onSent:E,recoveryKey:t,replyToMessageId:c.start.replyToMessageId},c.key)})]})}}function Ym(){return(0,h.jsxs)(`div`,{"aria-busy":`true`,"aria-label":`Loading conversation`,className:`flex flex-col gap-3 p-4`,role:`status`,children:[(0,h.jsx)(oo,{className:`h-7 w-2/3`}),(0,h.jsx)(oo,{className:`h-24 w-full`}),(0,h.jsx)(oo,{className:`h-24 w-full`})]})}function Xm(e){if(typeof e!=`object`||!e)return{};let t={};return`notice`in e&&typeof e.notice==`string`&&(t.notice=e.notice),`failureNotice`in e&&typeof e.failureNotice==`object`&&e.failureNotice!==null&&`id`in e.failureNotice&&`message`in e.failureNotice&&typeof e.failureNotice.id==`string`&&typeof e.failureNotice.message==`string`&&(t.failureNotice={id:e.failureNotice.id,message:e.failureNotice.message}),t}var Zm=5,Qm=[1,2,3,5,7,10,14,21,30],$m=300,eh=`min-h-11 rounded-md border border-border bg-surface px-3 text-base text-foreground outline-none focus-visible:ring-2 focus-visible:ring-accent md:min-h-9 md:text-sm`;function th(e){if(e===`replied`||e===`waiting`)return e;let t=_d.find(t=>e===`status:${t}`);return t===void 0?`all`:`status:${t}`}function nh(e){let t=Number(e);return Qm.includes(t)?t:Zm}function rh({mailbox:e}){let t=e.address,[n,r]=ui(),i=th(n.get(`filter`)),a=nh(n.get(`days`)),o=n.get(`search`)??``,[s,c]=(0,d.useState)(o),l=(0,d.useRef)(o),u=bs(t,{filter:i,search:o,waitingDays:a}),{fetchNextPage:f}=u,p=(0,d.useCallback)(()=>{f()},[f]),m=nt({mutationFn:()=>Ku(t,xs({filter:i,search:o,waitingDays:a}))});(0,d.useEffect)(()=>{o!==l.current&&c(o),l.current=o},[o]),(0,d.useEffect)(()=>{let e=s.trim();if(e===o)return;let t=setTimeout(()=>{l.current=e,r(t=>{let n=new URLSearchParams(t);return e===``?n.delete(`search`):n.set(`search`,e),n},{replace:!0})},$m);return()=>{clearTimeout(t)}},[o,r,s]);function g(e){r(t=>{let n=new URLSearchParams(t),r=e.filter??i;r===`all`?n.delete(`filter`):n.set(`filter`,r),r===`waiting`?n.set(`days`,String(e.days??a)):n.delete(`days`);let o=n.get(`search`);return n.delete(`search`),o!==null&&n.set(`search`,o),n})}let _=u.data?.pages.flatMap(e=>e.contacts)??[],v=new Date;return(0,h.jsxs)(`div`,{className:`flex min-h-full flex-col bg-background`,children:[(0,h.jsx)(`div`,{className:`border-b border-border bg-surface md:hidden`,children:(0,h.jsx)(Wm,{address:t})}),(0,h.jsxs)(`div`,{className:`mx-auto flex w-full max-w-5xl flex-col gap-4 p-4 md:p-6`,children:[(0,h.jsxs)(`div`,{className:`flex flex-wrap items-end justify-between gap-3`,children:[(0,h.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,h.jsx)(`h1`,{className:`text-xl font-semibold`,children:`Contacts`}),(0,h.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Everyone `,t,` wrote to or heard from.`]})]}),(0,h.jsxs)(W,{"aria-busy":m.isPending,className:`min-h-11 gap-2 md:min-h-9`,disabled:m.isPending,onClick:()=>{m.mutate()},variant:`outline`,children:[(0,h.jsx)(Ao,{"aria-hidden":`true`,className:`size-4`}),`Export CSV`]})]}),m.isError?(0,h.jsx)(`p`,{className:`text-sm text-red-700 dark:text-red-300`,role:`alert`,children:m.error.message}):null,(0,h.jsxs)(`div`,{className:`flex flex-col gap-2 md:flex-row md:items-end`,children:[(0,h.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,h.jsx)(`label`,{className:`text-sm text-muted-foreground`,htmlFor:`contacts-filter`,children:`Show`}),(0,h.jsxs)(`select`,{className:eh,id:`contacts-filter`,onChange:e=>{g({filter:th(e.target.value)})},value:i,children:[(0,h.jsx)(`option`,{value:`all`,children:`All contacts`}),(0,h.jsx)(`option`,{value:`waiting`,children:`Waiting for reply`}),(0,h.jsx)(`option`,{value:`replied`,children:`Wrote back`}),(0,h.jsx)(`optgroup`,{label:`With status`,children:_d.map(e=>(0,h.jsx)(`option`,{value:`status:${e}`,children:vd(e)},e))})]})]}),i===`waiting`?(0,h.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,h.jsx)(`label`,{className:`text-sm text-muted-foreground`,htmlFor:`contacts-days`,children:`No reply for`}),(0,h.jsx)(`select`,{className:eh,id:`contacts-days`,onChange:e=>{g({days:nh(e.target.value)})},value:String(a),children:Qm.map(e=>(0,h.jsx)(`option`,{value:String(e),children:e===1?`1 day`:`${e} days`},e))})]}):null,(0,h.jsxs)(`div`,{className:`relative md:ml-auto md:w-72`,children:[(0,h.jsx)(Ro,{"aria-hidden":`true`,className:`pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2 text-muted-foreground`}),(0,h.jsx)(ao,{"aria-label":`Search contacts`,className:`pl-9`,onChange:e=>{c(e.target.value)},placeholder:`Search names and addresses`,type:`search`,value:s})]})]}),u.isPending?(0,h.jsxs)(`div`,{"aria-busy":`true`,"aria-label":`Loading the contacts`,className:`flex flex-col gap-3`,role:`status`,children:[(0,h.jsx)(oo,{className:`h-4 w-1/2`}),(0,h.jsx)(oo,{className:`h-4 w-2/3`})]}):null,u.isError?(0,h.jsxs)(`div`,{className:`flex flex-col items-start gap-3`,role:`alert`,children:[(0,h.jsx)(`p`,{className:`text-sm`,children:u.error.message}),(0,h.jsx)(W,{onClick:()=>{u.refetch()},variant:`outline`,children:`Try again`})]}):null,u.isSuccess&&_.length===0?(0,h.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:i===`all`&&o===``?`${t} has no contacts yet. Everyone it writes to or hears from shows up here.`:`No contact matches this filter.`}):null,_.length>0?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`ul`,{"aria-label":`Contacts`,className:`flex flex-col gap-2 md:hidden`,children:_.map(e=>(0,h.jsx)(`li`,{children:(0,h.jsxs)(oi,{className:`flex flex-col gap-1 rounded-lg border border-border bg-surface p-3 outline-none hover:bg-muted focus-visible:ring-2 focus-visible:ring-accent`,to:Fs(t,e.address),children:[(0,h.jsxs)(`span`,{className:`flex items-center justify-between gap-2`,children:[(0,h.jsx)(`span`,{className:`min-w-0 truncate text-sm font-semibold`,children:e.name??e.address}),(0,h.jsx)(ih,{contact:e})]}),e.name===null?null:(0,h.jsx)(`span`,{className:`truncate text-sm text-muted-foreground`,children:e.address}),(0,h.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:ah(e,v)})]})},e.address))}),(0,h.jsxs)(`table`,{"aria-label":`Contacts`,className:`hidden w-full border-collapse text-sm md:table`,children:[(0,h.jsx)(`thead`,{children:(0,h.jsxs)(`tr`,{className:`border-b border-border text-left text-xs text-muted-foreground`,children:[(0,h.jsx)(`th`,{className:`py-2 pr-3 font-medium`,scope:`col`,children:`Contact`}),(0,h.jsx)(`th`,{className:`py-2 pr-3 font-medium`,scope:`col`,children:`Status`}),(0,h.jsx)(`th`,{className:`py-2 pr-3 font-medium`,scope:`col`,children:`Last mail`}),(0,h.jsx)(`th`,{className:`py-2 pr-3 text-right font-medium`,scope:`col`,children:`Sent`}),(0,h.jsx)(`th`,{className:`py-2 text-right font-medium`,scope:`col`,children:`Received`})]})}),(0,h.jsx)(`tbody`,{children:_.map(e=>(0,h.jsxs)(`tr`,{className:`border-b border-border`,children:[(0,h.jsxs)(`td`,{className:`max-w-80 py-2 pr-3`,children:[(0,h.jsx)(oi,{className:`block truncate font-medium text-foreground underline-offset-2 outline-none hover:underline focus-visible:ring-2 focus-visible:ring-accent`,to:Fs(t,e.address),children:e.name??e.address}),e.name===null?null:(0,h.jsx)(`span`,{className:`block truncate text-muted-foreground`,children:e.address})]}),(0,h.jsx)(`td`,{className:`py-2 pr-3`,children:(0,h.jsx)(ih,{contact:e})}),(0,h.jsx)(`td`,{className:`py-2 pr-3 text-muted-foreground`,children:ah(e,v)}),(0,h.jsx)(`td`,{className:`py-2 pr-3 text-right tabular-nums`,children:e.sentCount}),(0,h.jsx)(`td`,{className:`py-2 text-right tabular-nums`,children:e.receivedCount})]},e.address))})]})]}):null,u.hasNextPage?(0,h.jsx)(af,{isLoading:u.isFetchingNextPage,onLoad:p}):null]})]})}function ih({contact:e}){return(0,h.jsx)(`span`,{className:U(`shrink-0 rounded-sm px-1.5 py-0.5 text-xs whitespace-nowrap`,yd(e.status)),children:vd(e.status)})}function ah(e,t){let n=e.lastSentAt!==null&&(e.lastReceivedAt===null||e.lastSentAt>e.lastReceivedAt),r=md(e.lastMessageAt,{now:t});return n?`We wrote ${r}`:`They wrote ${r}`}var oh=[{label:`All`,value:`all`},{label:`Failed`,value:`failed`}],sh=300;function ch({name:e}){let[t,n]=ui(),r=ph(t.get(`state`)),i=t.get(`q`)??``,[a,o]=(0,d.useState)(i),s=(0,d.useRef)(i),c=ms(e,r,i),{fetchNextPage:l}=c,u=(0,d.useCallback)(()=>{l()},[l]);(0,d.useEffect)(()=>{i!==s.current&&o(i),s.current=i},[i]),(0,d.useEffect)(()=>{let e=a.trim();if(e===i)return;let t=setTimeout(()=>{s.current=e,n(t=>{let n=new URLSearchParams(t);return e===``?n.delete(`q`):n.set(`q`,e),n},{replace:!0})},sh);return()=>{clearTimeout(t)}},[i,n,a]);function f(e){n(t=>{let n=new URLSearchParams(t);return e===`all`?n.delete(`state`):n.set(`state`,e),n})}let p=new Date,m=c.data?.pages.flatMap(e=>e.messages)??[],g=`Mail sent by ${e}`;return(0,h.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,h.jsxs)(`div`,{className:`flex flex-col gap-3 border-b border-border p-3 md:flex-row md:items-center md:px-6 md:py-4`,children:[(0,h.jsx)(`h2`,{className:`text-base font-semibold md:flex-1`,children:g}),(0,h.jsxs)(`div`,{className:`relative md:w-72`,children:[(0,h.jsx)(Ro,{"aria-hidden":`true`,className:`pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2 text-muted-foreground`}),(0,h.jsx)(ao,{"aria-label":`Search the log`,className:`pl-9`,onChange:e=>{o(e.target.value)},placeholder:`Recipient or subject`,type:`search`,value:a})]}),(0,h.jsx)(`div`,{"aria-label":`Filter`,className:`flex gap-1`,role:`group`,children:oh.map(e=>(0,h.jsx)(`button`,{"aria-pressed":r===e.value,className:U(`min-h-11 flex-1 rounded-md px-4 text-sm font-medium outline-none focus-visible:ring-2 focus-visible:ring-accent md:min-h-8 md:flex-none`,r===e.value?`bg-accent-soft text-accent-text`:`text-muted-foreground hover:bg-muted`),onClick:()=>{f(e.value)},type:`button`,children:e.label},e.value))})]}),(0,h.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:[c.isPending?(0,h.jsx)(fh,{}):null,c.isError?(0,h.jsxs)(`div`,{className:`flex flex-col items-start gap-3 p-4 md:px-6`,role:`alert`,children:[(0,h.jsx)(`p`,{className:`text-sm`,children:c.error.message}),(0,h.jsx)(W,{onClick:()=>{c.refetch()},variant:`outline`,children:`Try again`})]}):null,c.isSuccess&&m.length===0?(0,h.jsx)(`p`,{className:`p-4 text-sm text-muted-foreground md:px-6`,children:dh(e,r,i)}):null,m.length>0?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`ul`,{"aria-label":g,className:`md:hidden`,children:m.map(t=>(0,h.jsx)(`li`,{children:(0,h.jsx)(uh,{message:t,name:e,now:p})},t.id))}),(0,h.jsxs)(`table`,{"aria-label":g,className:`hidden w-full text-sm md:table`,children:[(0,h.jsx)(`thead`,{className:`text-left text-xs text-muted-foreground`,children:(0,h.jsxs)(`tr`,{className:`border-b border-border`,children:[(0,h.jsx)(`th`,{className:`px-6 py-2 font-medium`,scope:`col`,children:`Time`}),(0,h.jsx)(`th`,{className:`px-3 py-2 font-medium`,scope:`col`,children:`Recipient`}),(0,h.jsx)(`th`,{className:`px-3 py-2 font-medium`,scope:`col`,children:`Subject`}),(0,h.jsx)(`th`,{className:`px-3 py-2 font-medium`,scope:`col`,children:`Template`}),(0,h.jsx)(`th`,{className:`px-6 py-2 font-medium`,scope:`col`,children:`State`})]})}),(0,h.jsx)(`tbody`,{children:m.map(t=>(0,h.jsx)(lh,{message:t,name:e,now:p},t.id))})]})]}):null,c.hasNextPage?(0,h.jsx)(af,{isLoading:c.isFetchingNextPage,onLoad:u}):null]})]})}function lh({message:e,name:t,now:n}){return(0,h.jsxs)(`tr`,{className:`border-b border-border hover:bg-muted`,children:[(0,h.jsx)(`td`,{className:`px-6 py-2.5 whitespace-nowrap text-muted-foreground tabular-nums`,children:(0,h.jsx)(`time`,{dateTime:e.createdAt,children:md(e.createdAt,{now:n})})}),(0,h.jsx)(`td`,{className:`max-w-56 truncate px-3 py-2.5`,children:e.to}),(0,h.jsx)(`td`,{className:`max-w-80 truncate px-3 py-2.5`,children:(0,h.jsx)(oi,{className:`font-medium outline-none hover:underline focus-visible:underline focus-visible:ring-2 focus-visible:ring-accent`,to:Os(t,e.id),children:e.subject===``?`(no subject)`:e.subject})}),(0,h.jsx)(`td`,{className:`max-w-40 truncate px-3 py-2.5 text-muted-foreground`,children:e.templateName}),(0,h.jsx)(`td`,{className:U(`px-6 py-2.5 whitespace-nowrap`,Yl(e)),children:Jl(e)})]})}function uh({message:e,name:t,now:n}){return(0,h.jsxs)(oi,{className:`flex min-h-16 flex-col gap-0.5 border-b border-border px-4 py-2.5 outline-none hover:bg-muted focus-visible:bg-muted focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-inset`,to:Os(t,e.id),children:[(0,h.jsxs)(`span`,{className:`flex items-baseline gap-2`,children:[(0,h.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm`,children:e.to}),(0,h.jsx)(`time`,{className:`shrink-0 text-xs text-muted-foreground tabular-nums`,dateTime:e.createdAt,children:md(e.createdAt,{now:n})})]}),(0,h.jsx)(`span`,{className:`truncate text-sm text-muted-foreground`,children:e.subject===``?`(no subject)`:e.subject}),(0,h.jsxs)(`span`,{className:`flex items-baseline gap-2 text-xs`,children:[(0,h.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-muted-foreground`,children:e.templateName}),(0,h.jsx)(`span`,{className:U(`shrink-0 font-medium`,Yl(e)),children:Jl(e)})]})]})}function dh(e,t,n){return n===``?t===`failed`?`No failed mail.`:`${e} has not sent any mail yet. See the README for how to send from your app.`:`No mail matches "${n}".`}function fh(){return(0,h.jsx)(`div`,{"aria-busy":`true`,"aria-label":`Loading the log`,role:`status`,children:Array.from({length:8},(e,t)=>(0,h.jsxs)(`div`,{className:`flex flex-col gap-2 border-b border-border px-4 py-3.5 md:px-6`,children:[(0,h.jsx)(oo,{className:`h-3.5 w-2/5`}),(0,h.jsx)(oo,{className:`h-3.5 w-4/5`})]},t))})}function ph(e){return e===`failed`?`failed`:`all`}function mh({name:e}){let t=hs(e),{fetchNextPage:n}=t,r=(0,d.useCallback)(()=>{n()},[n]),i=t.data?.pages.flatMap(e=>e.enrollments)??[],a=t.data?.pages[0]?.pause??null,o=`Series of ${e}`;return(0,h.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:[(0,h.jsx)(`h2`,{className:`sr-only`,children:o}),a===null?null:(0,h.jsxs)(`p`,{"aria-label":`Series are paused`,className:`m-4 rounded-md border border-amber-300 bg-amber-50 p-3 text-sm wrap-anywhere text-amber-900 md:mx-6 dark:border-amber-800 dark:bg-amber-950 dark:text-amber-100`,role:`status`,children:[`Series are paused: `,a.reason,`. Nothing is lost; steps go out when this is fixed.`]}),t.isPending?(0,h.jsx)(_h,{}):null,t.isError?(0,h.jsxs)(`div`,{className:`flex flex-col items-start gap-3 p-4 md:px-6`,role:`alert`,children:[(0,h.jsx)(`p`,{className:`text-sm`,children:t.error.message}),(0,h.jsx)(W,{onClick:()=>{t.refetch()},variant:`outline`,children:`Try again`})]}):null,t.isSuccess&&i.length===0?(0,h.jsxs)(`p`,{className:`p-4 text-sm text-muted-foreground md:px-6`,children:[e,` has not enrolled anyone in a series yet. See the README for how to send a series.`]}):null,i.length>0?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`ul`,{"aria-label":o,className:`md:hidden`,children:i.map(t=>(0,h.jsx)(`li`,{children:(0,h.jsx)(gh,{entry:t,name:e})},t.id))}),(0,h.jsxs)(`table`,{"aria-label":o,className:`hidden w-full text-sm md:table`,children:[(0,h.jsx)(`thead`,{className:`text-left text-xs text-muted-foreground`,children:(0,h.jsxs)(`tr`,{className:`border-b border-border`,children:[(0,h.jsx)(`th`,{className:`px-6 py-2 font-medium`,scope:`col`,children:`Recipient`}),(0,h.jsx)(`th`,{className:`px-3 py-2 font-medium`,scope:`col`,children:`Series`}),(0,h.jsx)(`th`,{className:`px-3 py-2 font-medium`,scope:`col`,children:`State`}),(0,h.jsx)(`th`,{className:`px-6 py-2 font-medium`,scope:`col`,children:`Next step`})]})}),(0,h.jsx)(`tbody`,{children:i.map(t=>(0,h.jsxs)(`tr`,{className:`border-b border-border hover:bg-muted`,children:[(0,h.jsx)(`td`,{className:`max-w-64 truncate px-6 py-2.5`,children:(0,h.jsx)(oi,{className:`font-medium outline-none hover:underline focus-visible:underline focus-visible:ring-2 focus-visible:ring-accent`,to:Ms(e,t.id),children:t.to})}),(0,h.jsx)(`td`,{className:`max-w-56 truncate px-3 py-2.5`,children:t.series}),(0,h.jsx)(`td`,{className:U(`px-3 py-2.5 whitespace-nowrap`,cd(t.state)),children:sd(t.state)}),(0,h.jsx)(`td`,{className:`px-6 py-2.5 whitespace-nowrap text-muted-foreground tabular-nums`,children:(0,h.jsx)(hh,{entry:t})})]},t.id))})]})]}):null,t.hasNextPage?(0,h.jsx)(af,{isLoading:t.isFetchingNextPage,onLoad:r}):null]})}function hh({entry:e}){return e.nextStepAt===null?(0,h.jsx)(`span`,{"aria-label":`No step left`,children:`—`}):(0,h.jsx)(`time`,{dateTime:e.nextStepAt,children:dd(e.nextStepAt)})}function gh({entry:e,name:t}){return(0,h.jsxs)(oi,{className:`flex min-h-16 flex-col gap-0.5 border-b border-border px-4 py-2.5 outline-none hover:bg-muted focus-visible:bg-muted focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-inset`,to:Ms(t,e.id),children:[(0,h.jsx)(`span`,{className:`truncate text-sm`,children:e.to}),(0,h.jsxs)(`span`,{className:`flex items-baseline gap-2 text-xs`,children:[(0,h.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-muted-foreground`,children:e.series}),(0,h.jsx)(`span`,{className:U(`shrink-0 font-medium`,cd(e.state)),children:sd(e.state)})]}),e.nextStepAt===null?null:(0,h.jsxs)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:[`Next step `,(0,h.jsx)(hh,{entry:e})]})]})}function _h(){return(0,h.jsx)(`div`,{"aria-busy":`true`,"aria-label":`Loading the series`,role:`status`,children:Array.from({length:6},(e,t)=>(0,h.jsxs)(`div`,{className:`flex flex-col gap-2 border-b border-border px-4 py-3.5 md:px-6`,children:[(0,h.jsx)(oo,{className:`h-3.5 w-2/5`}),(0,h.jsx)(oo,{className:`h-3.5 w-4/5`})]},t))})}function vh({name:e}){let t=_(),n=gs(e),{fetchNextPage:r}=n,i=(0,d.useCallback)(()=>{r()},[r]),[a,o]=(0,d.useState)(null),s=nt({mutationFn:t=>Gu(e,t),onSuccess:async()=>{await t.invalidateQueries({queryKey:[`app-suppressions`,e]})}}),c=n.data?.pages.flatMap(e=>e.suppressions)??[],l=`Unsubscribed from ${e}`;return(0,h.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:[(0,h.jsx)(`h2`,{className:`sr-only`,children:l}),s.isError?(0,h.jsx)(`p`,{className:`m-4 rounded-md border border-red-300 bg-red-50 p-3 text-sm wrap-anywhere text-red-900 md:mx-6 dark:border-red-800 dark:bg-red-950 dark:text-red-100`,role:`alert`,children:s.error.message}):null,n.isPending?(0,h.jsxs)(`div`,{"aria-busy":`true`,"aria-label":`Loading the addresses`,className:`flex flex-col gap-3 p-4 md:px-6`,role:`status`,children:[(0,h.jsx)(oo,{className:`h-4 w-1/2`}),(0,h.jsx)(oo,{className:`h-4 w-2/3`})]}):null,n.isError?(0,h.jsxs)(`div`,{className:`flex flex-col items-start gap-3 p-4 md:px-6`,role:`alert`,children:[(0,h.jsx)(`p`,{className:`text-sm`,children:n.error.message}),(0,h.jsx)(W,{onClick:()=>{n.refetch()},variant:`outline`,children:`Try again`})]}):null,n.isSuccess&&c.length===0?(0,h.jsxs)(`p`,{className:`p-4 text-sm text-muted-foreground md:px-6`,children:[`Nobody has unsubscribed from the series of `,e,`.`]}):null,c.length>0?(0,h.jsx)(`ul`,{"aria-label":l,children:c.map(e=>(0,h.jsxs)(`li`,{className:`flex flex-col gap-2 border-b border-border px-4 py-3 sm:flex-row sm:items-center sm:gap-4 md:px-6`,children:[(0,h.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,h.jsx)(`span`,{className:`truncate text-sm`,children:e.address}),(0,h.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`Unsubscribed `,(0,h.jsx)(`time`,{dateTime:e.createdAt,children:dd(e.createdAt)})]})]}),(0,h.jsxs)(W,{className:`self-start sm:self-auto`,disabled:s.isPending,onClick:()=>{s.reset(),o(e.address)},variant:`outline`,children:[`Allow again`,(0,h.jsxs)(`span`,{className:`sr-only`,children:[` `,e.address]})]})]},e.address))}):null,n.hasNextPage?(0,h.jsx)(af,{isLoading:n.isFetchingNextPage,onLoad:i}):null,(0,h.jsxs)(no,{description:`Only do this if the person asked to get these mails again.`,onClose:()=>{o(null)},open:a!==null,title:`Allow ${a??``} again?`,children:[(0,h.jsx)(W,{onClick:()=>{o(null)},variant:`outline`,children:`Cancel`}),(0,h.jsx)(W,{onClick:()=>{a!==null&&s.mutate(a),o(null)},children:`Allow again`})]})]})}function yh({name:e,tab:t}){let n=[{label:`Sent`,path:ks(e),value:`sent`},{label:`Series`,path:As(e),value:`series`},{label:`Unsubscribed`,path:js(e),value:`unsubscribed`}];return(0,h.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,h.jsx)(`nav`,{"aria-label":e,className:`flex gap-1 overflow-x-auto border-b border-border px-3 pt-3 md:px-6`,children:n.map(e=>(0,h.jsx)(oi,{"aria-current":e.value===t?`page`:void 0,className:U(`inline-flex min-h-11 shrink-0 items-center border-b-2 px-3 text-sm font-medium outline-none focus-visible:ring-2 focus-visible:ring-accent md:min-h-9`,e.value===t?`border-accent text-accent-text`:`border-transparent text-muted-foreground hover:text-foreground`),to:e.path,children:e.label},e.value))}),t===`sent`?(0,h.jsx)(ch,{name:e}):null,t===`series`?(0,h.jsx)(mh,{name:e}):null,t===`unsubscribed`?(0,h.jsx)(vh,{name:e}):null]})}function bh(){let{id:e,name:t}=Xn();return vi(t,`The route always has an app name.`),vi(e,`The route always has an enrolment id.`),(0,h.jsx)(xh,{id:e,name:t},e)}function xh({id:e,name:t}){let n=_s(t,e);return(0,h.jsxs)(`div`,{className:`flex min-h-full flex-col bg-background`,children:[(0,h.jsx)(`div`,{className:`border-b border-border bg-surface`,children:(0,h.jsxs)(oi,{className:`inline-flex min-h-12 items-center gap-1 px-3 text-sm font-medium text-accent-text outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-inset md:min-h-10 md:px-5`,to:As(t),children:[(0,h.jsx)(Eo,{"aria-hidden":`true`,className:`size-4`}),`Back to the series of `,t]})}),n.isPending?(0,h.jsxs)(`div`,{"aria-busy":`true`,"aria-label":`Loading the enrolment`,className:`flex flex-col gap-3 p-4 md:p-6`,role:`status`,children:[(0,h.jsx)(oo,{className:`h-6 w-1/2`}),(0,h.jsx)(oo,{className:`h-4 w-2/3`}),(0,h.jsx)(oo,{className:`h-40 w-full`})]}):null,n.isError?(0,h.jsxs)(`div`,{className:`flex flex-col items-start gap-3 p-4 md:p-6`,role:`alert`,children:[(0,h.jsx)(`p`,{className:`text-sm`,children:n.error.message}),(0,h.jsx)(W,{onClick:()=>{n.refetch()},variant:`outline`,children:`Try again`})]}):null,n.isSuccess?(0,h.jsx)(Sh,{enrollment:n.data}):null]})}function Sh({enrollment:e}){let t=[[`To`,e.to],[`Key`,e.key],[`State`,sd(e.state)],[`Enrolled`,dd(e.createdAt)]];return(0,h.jsxs)(`article`,{className:`flex flex-col gap-4 p-4 md:p-6`,children:[(0,h.jsx)(`h2`,{className:`text-lg font-semibold break-words`,children:e.series}),(0,h.jsx)(`ul`,{"aria-label":`Details`,className:`flex flex-col gap-2 text-sm sm:gap-1`,children:t.map(([e,t])=>(0,h.jsxs)(`li`,{className:`flex flex-col sm:flex-row sm:gap-4`,children:[(0,h.jsx)(`span`,{className:`shrink-0 text-muted-foreground sm:w-32`,children:e}),(0,h.jsx)(`span`,{className:`min-w-0 wrap-anywhere`,children:t})]},e))}),e.isBodyExpired?(0,h.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`The content of this enrolment is no longer stored.`}):null,(0,h.jsx)(`ol`,{"aria-label":`Steps`,className:`flex flex-col gap-4`,children:e.steps.map(t=>(0,h.jsx)(`li`,{className:`flex flex-col gap-3 rounded-md border border-border p-3 md:p-4`,children:(0,h.jsx)(Ch,{isBodyExpired:e.isBodyExpired,series:e.series,step:t})},t.position))})]})}function Ch({isBodyExpired:e,series:t,step:n}){let r=n.html!==null&&n.html!==``,[i,a]=(0,d.useState)(r?`html`:`text`);return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)(`div`,{className:`flex flex-col gap-1 sm:flex-row sm:items-baseline sm:gap-3`,children:[(0,h.jsxs)(`h3`,{className:`min-w-0 flex-1 text-sm font-semibold break-words`,children:[n.position,`. `,n.subject===``?`(no subject)`:n.subject]}),(0,h.jsxs)(`span`,{className:`flex items-baseline gap-2 text-xs`,children:[(0,h.jsxs)(`span`,{className:`text-muted-foreground tabular-nums`,children:[n.sentAt===null?`Due `:`Sent `,(0,h.jsx)(`time`,{dateTime:n.sentAt??n.dueAt,children:dd(n.sentAt??n.dueAt)})]}),(0,h.jsx)(`span`,{className:U(`font-medium`,ud(n)),"data-testid":`step-state`,children:ld(n)})]})]}),n.state===`failed`&&n.notice!==null?(0,h.jsx)(`p`,{className:`rounded-md border border-red-300 bg-red-50 p-3 text-sm wrap-anywhere text-red-900 dark:border-red-800 dark:bg-red-950 dark:text-red-100`,role:`alert`,children:n.notice}):null,e?null:(0,h.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,h.jsxs)(`div`,{"aria-label":`Content of step ${n.position}`,className:`flex gap-1`,role:`tablist`,children:[r?(0,h.jsx)(wh,{isSelected:i===`html`,label:`HTML`,onSelect:()=>a(`html`)}):null,(0,h.jsx)(wh,{isSelected:i===`text`,label:`Text`,onSelect:()=>a(`text`)})]}),(0,h.jsx)(`div`,{role:`tabpanel`,children:i===`html`&&n.html!==null?(0,h.jsx)(ql,{html:n.html,title:`Step ${n.position} of ${t}`,unsafe:(0,h.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`This mail could not be displayed safely. Open the Text tab instead.`})}):(0,h.jsx)(`p`,{className:U(`text-sm leading-relaxed break-words whitespace-pre-wrap`,(n.text??``)===``&&`text-muted-foreground`),children:(n.text??``)===``?`This mail has no text.`:n.text})})]})]})}function wh({isSelected:e,label:t,onSelect:n}){return(0,h.jsx)(`button`,{"aria-selected":e,className:U(`min-h-11 rounded-md px-4 text-sm font-medium outline-none focus-visible:ring-2 focus-visible:ring-accent md:min-h-8`,e?`bg-accent-soft text-accent-text`:`text-muted-foreground hover:bg-muted`),onClick:n,role:`tab`,type:`button`,children:t})}function Th(e){let t=new Map;for(let n of e){let e=Dh(n.address);t.set(e,[...t.get(e)??[],n])}return[...t.entries()].sort(([e],[t])=>e.localeCompare(t)).map(([e,t])=>({domain:e,mailboxes:t.sort((e,t)=>Number(e.state===`archived`)-Number(t.state===`archived`)||e.address.localeCompare(t.address))}))}function Eh({apps:e=[],currentAddress:t,currentApp:n,currentPage:r,mailboxes:i,onNavigate:a}){let o=[...e].sort((e,t)=>e.name.localeCompare(t.name));return(0,h.jsxs)(`nav`,{"aria-label":`Mailboxes`,className:`flex flex-col gap-4 py-2`,children:[Th(i).map(e=>(0,h.jsxs)(`div`,{"aria-label":e.domain,className:`flex flex-col`,role:`group`,children:[(0,h.jsx)(`p`,{"aria-hidden":`true`,className:`px-4 pb-1 text-xs font-medium tracking-wide text-muted-foreground`,children:e.domain}),e.mailboxes.map(e=>e.address===t?(0,h.jsxs)(`div`,{className:`flex flex-col`,children:[(0,h.jsx)(kh,{isCurrent:r===void 0,mailbox:e,onNavigate:a}),(0,h.jsx)(Oh,{isCurrent:r===`contacts`,label:`Contacts`,onNavigate:a,to:Is(e.address)}),(0,h.jsx)(Oh,{isCurrent:r===`snippets`,label:`Snippets`,onNavigate:a,to:Rs(e.address)})]},e.address):(0,h.jsx)(kh,{isCurrent:!1,mailbox:e,onNavigate:a},e.address))]},e.domain)),o.length>0?(0,h.jsxs)(`div`,{"aria-label":`Sent by apps`,className:`flex flex-col`,role:`group`,children:[(0,h.jsx)(`p`,{"aria-hidden":`true`,className:`px-4 pb-1 text-xs font-medium tracking-wide text-muted-foreground`,children:`Sent by apps`}),o.map(e=>{let t=e.name===n;return(0,h.jsx)(oi,{"aria-current":t?`page`:void 0,className:U(`flex min-h-11 items-center gap-2 px-4 text-sm outline-none hover:bg-muted focus-visible:bg-muted focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-inset md:min-h-9`,t&&`bg-accent-soft font-medium text-accent-text`),onClick:a,title:`Mail sent by ${e.name} from ${e.domain}`,to:ks(e.name),children:(0,h.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.name})},e.name)})]}):null]})}function Dh(e){return e.slice(e.lastIndexOf(`@`)+1)}function Oh({isCurrent:e,label:t,onNavigate:n,to:r}){return(0,h.jsx)(oi,{"aria-current":e?`page`:void 0,className:U(`flex min-h-11 items-center pr-4 pl-8 text-sm text-muted-foreground outline-none hover:bg-muted focus-visible:bg-muted focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-inset md:min-h-8`,e&&`bg-accent-soft font-medium text-accent-text`),onClick:n,to:r,children:t})}function kh({isCurrent:e,mailbox:t,onNavigate:n}){let[r=t.address]=t.address.split(`@`),i=[t.address,t.state===`archived`?`archived`:null,t.unreadCount>0?`${t.unreadCount} unread`:null].filter(e=>e!==null).join(`, `);return(0,h.jsxs)(oi,{"aria-current":e?`page`:void 0,"aria-label":i,className:U(`flex min-h-11 items-center gap-2 px-4 text-sm outline-none hover:bg-muted focus-visible:bg-muted focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-inset md:min-h-9`,e&&`bg-accent-soft font-medium text-accent-text`,t.state===`archived`&&!e&&`text-muted-foreground`),onClick:n,to:Ps(t.address),children:[(0,h.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:r}),t.state===`archived`?(0,h.jsx)(`span`,{className:`rounded border border-border px-1.5 text-xs text-muted-foreground`,children:`Archived`}):null,t.unreadCount>0?(0,h.jsx)(`span`,{className:`min-w-6 rounded-full bg-accent px-2 text-center text-xs font-semibold text-accent-foreground`,children:t.unreadCount}):null]})}function Ah(e,t=tu){(0,d.useEffect)(()=>{document.title=e>0?`(${e}) ${t}`:t},[t,e])}function jh({mailbox:e}){let t=e.address,n=e.state===`archived`,r=_(),i=ws(t),{fetchNextPage:a}=i,o=(0,d.useCallback)(()=>{a()},[a]),[s,c]=(0,d.useState)(null),[l,u]=(0,d.useState)(null),f=nt({mutationFn:e=>Yu(t,e.id),onSuccess:()=>r.invalidateQueries({queryKey:[`snippets`,t]})}),p=i.data?.pages.flatMap(e=>e.snippets)??[];return(0,h.jsxs)(`div`,{className:`flex min-h-full flex-col bg-background`,children:[(0,h.jsx)(`div`,{className:`border-b border-border bg-surface md:hidden`,children:(0,h.jsx)(Wm,{address:t})}),(0,h.jsxs)(`div`,{className:`mx-auto flex w-full max-w-3xl flex-col gap-4 p-4 md:p-6`,children:[(0,h.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,h.jsx)(`h1`,{className:`text-xl font-semibold`,children:`Snippets`}),(0,h.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Saved text for mail from `,t,`, shared by everyone with access to it. In a mail, type / at the start of a line or use the Snippets button to insert one. `,`{{firstName}}`,`, `,`{{name}}`,` and`,` `,`{{myName}}`,` are filled in when you insert it.`]})]}),n?(0,h.jsxs)(`p`,{className:`text-sm`,role:`note`,children:[t,` is archived. Its snippets can be read but not changed.`]}):s===`new`?(0,h.jsx)(Mh,{address:t,onDone:()=>{c(null)}}):(0,h.jsx)(`div`,{children:(0,h.jsx)(W,{onClick:()=>{c(`new`)},children:`Add snippet`})}),f.isError?(0,h.jsx)(`p`,{className:`text-sm text-red-700 dark:text-red-300`,role:`alert`,children:f.error.message}):null,i.isPending?(0,h.jsxs)(`div`,{"aria-busy":`true`,"aria-label":`Loading the snippets`,className:`flex flex-col gap-3`,role:`status`,children:[(0,h.jsx)(oo,{className:`h-4 w-1/2`}),(0,h.jsx)(oo,{className:`h-4 w-2/3`})]}):null,i.isError?(0,h.jsxs)(`div`,{className:`flex flex-col items-start gap-3`,role:`alert`,children:[(0,h.jsx)(`p`,{className:`text-sm`,children:i.error.message}),(0,h.jsx)(W,{onClick:()=>{i.refetch()},variant:`outline`,children:`Try again`})]}):null,i.isSuccess&&p.length===0?(0,h.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`This mailbox has no snippets yet.`}):null,p.length>0?(0,h.jsx)(`ul`,{"aria-label":`Snippets`,className:`flex flex-col gap-3`,children:p.map(e=>(0,h.jsx)(`li`,{className:`flex flex-col gap-3 rounded-lg border border-border bg-surface p-4`,children:s===e.id?(0,h.jsx)(Mh,{address:t,onDone:()=>{c(null)},snippet:e}):(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`h2`,{className:`text-sm font-semibold wrap-anywhere`,children:e.name}),(0,h.jsx)(`p`,{className:`line-clamp-4 text-sm whitespace-pre-wrap wrap-anywhere text-muted-foreground`,children:e.text}),n?null:(0,h.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,h.jsx)(W,{"aria-label":`Edit ${e.name}`,onClick:()=>{c(e.id)},variant:`outline`,children:`Edit`}),(0,h.jsx)(W,{"aria-label":`Delete ${e.name}`,onClick:()=>{u(e)},variant:`outline`,children:`Delete`})]})]})},e.id))}):null,i.hasNextPage?(0,h.jsx)(af,{isLoading:i.isFetchingNextPage,onLoad:o}):null]}),(0,h.jsxs)(no,{description:`It is deleted for everyone with access to this mailbox.`,onClose:()=>{u(null)},open:l!==null,title:`Delete the snippet “${l?.name??``}”?`,children:[(0,h.jsx)(W,{onClick:()=>{u(null)},variant:`outline`,children:`Cancel`}),(0,h.jsx)(W,{onClick:()=>{l!==null&&f.mutate(l),u(null)},children:`Delete`})]})]})}function Mh({address:e,onDone:t,snippet:n}){let r=_(),i=(0,d.useId)(),a=Qp({defaultValues:{name:n?.name??``,text:n?.text??``}}),o=nt({mutationFn:t=>n===void 0?qu(e,t):td(e,n.id,{...t,updatedAt:n.updatedAt}),onSuccess:async()=>{await r.invalidateQueries({queryKey:[`snippets`,e]}),t()}}),s=a.formState.errors.name?.message,c=a.formState.errors.text?.message;return(0,h.jsxs)(`form`,{"aria-label":n===void 0?`New snippet`:`Edit ${n.name}`,className:`flex flex-col gap-3`,noValidate:!0,onSubmit:e=>{a.handleSubmit(e=>{o.mutate({name:e.name.trim(),text:e.text})})(e)},children:[(0,h.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,h.jsx)(`label`,{className:`text-sm font-medium`,htmlFor:`${i}-name`,children:`Name`}),(0,h.jsx)(ao,{"aria-describedby":s===void 0?void 0:`${i}-name-error`,"aria-invalid":s!==void 0,autoFocus:!0,id:`${i}-name`,...a.register(`name`,{validate:e=>e.trim()===``?ju.snippetNameMissing:zu(e.trim())>Au.snippetNameLength?ju.snippetNameTooLong:!0})}),s===void 0?null:(0,h.jsx)(`p`,{className:`text-sm text-red-700 dark:text-red-300`,id:`${i}-name-error`,children:s})]}),(0,h.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,h.jsx)(`label`,{className:`text-sm font-medium`,htmlFor:`${i}-text`,children:`Text`}),(0,h.jsx)(so,{"aria-describedby":c===void 0?void 0:`${i}-text-error`,"aria-invalid":c!==void 0,className:`min-h-40`,id:`${i}-text`,...a.register(`text`,{validate:e=>zu(e)>Au.snippetTextLength?Mu(zu(e)):!0})}),c===void 0?null:(0,h.jsx)(`p`,{className:`text-sm text-red-700 dark:text-red-300`,id:`${i}-text-error`,children:c})]}),o.isError?(0,h.jsx)(`p`,{className:`text-sm text-red-700 dark:text-red-300`,role:`alert`,children:o.error.message}):null,(0,h.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,h.jsx)(W,{disabled:o.isPending,type:`submit`,children:o.isPending?`Saving…`:`Save`}),(0,h.jsx)(W,{disabled:o.isPending,onClick:t,variant:`outline`,children:`Cancel`})]})]})}function Nh(){let{address:e}=Xn(),[t]=ui(),n=fs(),r=Kn(),i=_(),[a,o]=(0,d.useState)(null);vi(e,`The route always has an address.`),vi(n.data,`The shell only renders routes once /api/me has loaded.`);let s=e,c=`compose:${e}`,[l]=(0,d.useState)(()=>{let e=t.get(`to`)?.trim()??``;return Cu.test(e)?e:null}),[u]=(0,d.useState)(()=>Id(c)),f=Vd(c),p=n.data.mailboxes.filter(e=>e.state===`active`).map(e=>e.address),[m]=(0,d.useState)(()=>u!==void 0&&!p.includes(u.from)),g=m?void 0:u,v=m?f:void 0;function y(e){let t=e.state===`failed`?e.notice===null?{}:{failureNotice:{id:e.id,message:e.notice}}:{notice:Hm};i.invalidateQueries({queryKey:[`threads`]}),r(zs(e.from.address,e.threadId),{state:t})}function b(){i.invalidateQueries({queryKey:[`threads`]}),r(Ps(s))}return(0,h.jsxs)(`div`,{className:`flex min-h-full flex-col bg-background`,children:[(0,h.jsx)(`div`,{className:`border-b border-border bg-surface md:hidden`,children:(0,h.jsx)(Wm,{address:e})}),(0,h.jsxs)(`div`,{className:`mx-auto flex w-full max-w-3xl flex-col gap-4 p-4`,children:[(0,h.jsx)(`h1`,{className:`text-xl font-semibold`,children:`New message`}),a===null?v===void 0?p.length===0?(0,h.jsx)(`p`,{className:`text-sm`,role:`alert`,children:`All of your mailboxes are archived, so you cannot send mail. Add a mailbox back to mail.config.ts and deploy.`}):(0,h.jsxs)(`div`,{className:`flex flex-col gap-3 rounded-lg border border-border bg-surface p-4`,children:[g===void 0||f===void 0?null:(0,h.jsxs)(`p`,{className:`text-sm text-red-700 dark:text-red-300`,role:`alert`,children:[`Your last changes could not be saved. `,g.message]}),(0,h.jsx)(bm,{draftId:g?.isConflict===!0?null:g?.draftId??null,from:g?.from??(p.includes(e)?e:p[0]??e),isRecovered:g!==void 0,initialValues:{cc:g?.cc??[],subject:g?.subject??``,text:g?.text??``,to:g?.to??(l===null?[]:[l])},isFromFixed:!1,mailboxes:p,onClose:b,onConflict:o,onDiscarded:b,onSent:y,recoveryKey:c,replyToMessageId:g?.replyToMessageId})]}):(0,h.jsx)(sf,{draft:v,onDiscard:()=>{Md(c)}}):(0,h.jsx)(`p`,{className:`text-sm`,role:`alert`,children:a})]})]})}function Ph(){return(0,h.jsx)(Vr,{children:(0,h.jsxs)(zr,{element:(0,h.jsx)(Vh,{}),children:[(0,h.jsx)(zr,{element:(0,h.jsx)(Lh,{}),index:!0}),(0,h.jsxs)(zr,{element:(0,h.jsx)(Fh,{}),path:`apps/:name`,children:[(0,h.jsx)(zr,{element:(0,h.jsx)(Ih,{tab:`series`}),path:`series`}),(0,h.jsx)(zr,{element:(0,h.jsx)(bh,{}),path:`series/:id`}),(0,h.jsx)(zr,{element:(0,h.jsx)(Ih,{tab:`unsubscribed`}),path:`unsubscribed`}),(0,h.jsx)(zr,{element:(0,h.jsx)(Xl,{}),path:`:id`})]}),(0,h.jsx)(zr,{element:(0,h.jsx)(zh,{page:e=>(0,h.jsx)(rh,{mailbox:e})}),path:`:address/contacts`}),(0,h.jsx)(zr,{element:(0,h.jsx)(zh,{page:e=>(0,h.jsx)(Jd,{mailbox:e},e.address)}),path:`:address/contacts/:contactAddress`}),(0,h.jsx)(zr,{element:(0,h.jsx)(zh,{page:e=>(0,h.jsx)(jh,{mailbox:e})}),path:`:address/snippets`}),(0,h.jsxs)(zr,{element:(0,h.jsx)(Bh,{}),path:`:address`,children:[(0,h.jsx)(zr,{element:(0,h.jsx)(Nh,{}),path:`compose`}),(0,h.jsx)(zr,{element:(0,h.jsx)(Um,{}),path:`:threadId`})]})]})})}function Fh(){let{name:e}=Xn(),t=Yn();return vi(e,`The route always has an app name.`),(0,h.jsx)(`main`,{className:`flex min-h-0 flex-1 flex-col overflow-y-auto`,children:t??(0,h.jsx)(yh,{name:e,tab:`sent`},e)})}function Ih({tab:e}){let{name:t}=Xn();return vi(t,`The route always has an app name.`),(0,h.jsx)(yh,{name:t,tab:e},t)}function Lh(){let e=fs();vi(e.data,`The shell only renders routes once /api/me has loaded.`);let t=e.data.mailboxes.find(e=>e.state===`active`)??e.data.mailboxes[0];if(t===void 0){let t=[...e.data.apps??[]].sort((e,t)=>e.name.localeCompare(t.name))[0];return vi(t,`The shell shows a message when there is nothing to open.`),(0,h.jsx)(Lr,{replace:!0,to:ks(t.name)})}return(0,h.jsx)(Lr,{replace:!0,to:Ps(t.address)})}function Rh({children:e}){let{address:t}=Xn(),n=Wn(),r=fs();vi(t,`The route always has an address.`),vi(r.data,`The shell only renders routes once /api/me has loaded.`);let i=r.data.mailboxes.find(e=>e.address.toLowerCase()===t.toLowerCase());if(i!==void 0&&i.address!==t){let e=n.pathname.indexOf(`/`,1),t=e===-1?``:n.pathname.slice(e);return(0,h.jsx)(Lr,{replace:!0,state:n.state,to:`${Ps(i.address)}${t}${n.search}`})}return i===void 0?(0,h.jsxs)(`main`,{className:`flex flex-1 flex-col items-start gap-3 p-6`,children:[(0,h.jsxs)(`p`,{className:`text-sm`,role:`alert`,children:[`You do not have access to `,t,`. Ask the owner to add you to that mailbox in mail.config.ts.`]}),(0,h.jsx)(oi,{className:`text-sm font-medium text-accent-text underline underline-offset-2`,to:`/`,children:`Back to your mailboxes`})]}):e(i)}function zh({page:e}){return(0,h.jsx)(Rh,{children:t=>(0,h.jsx)(`main`,{className:`flex min-h-0 flex-1 flex-col overflow-y-auto`,children:e(t)})})}function Bh(){let e=Yn();return(0,h.jsx)(Rh,{children:({address:t})=>(0,h.jsxs)(`div`,{className:`flex min-h-0 flex-1`,children:[(0,h.jsxs)(`section`,{"aria-label":`Threads`,className:U(`min-h-0 w-full flex-col border-border bg-surface md:flex md:w-96 md:shrink-0 md:border-r`,e===null?`flex`:`hidden`),children:[(0,h.jsx)(tf,{address:t},t),(0,h.jsx)(`div`,{className:`border-t border-border p-3`,children:(0,h.jsxs)(oi,{className:`inline-flex min-h-11 w-full items-center justify-center gap-2 rounded-md bg-accent px-4 text-sm font-medium text-accent-foreground outline-none hover:bg-accent/90 focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface md:min-h-9`,to:Ns(t),children:[(0,h.jsx)(zo,{"aria-hidden":`true`,className:`size-4`}),`Compose`]})})]}),(0,h.jsx)(`main`,{className:U(`min-h-0 flex-1 overflow-y-auto md:block`,e===null?`hidden`:`block`),children:e??(0,h.jsx)(`p`,{className:`p-6 text-sm text-muted-foreground`,children:`Choose a conversation to read it.`})})]})})}function Vh(){let e=fs({poll:!0}),{address:t,name:n}=Xn(),r=Wn(),[i,a]=(0,d.useState)(!1),o=t??n,s=t===void 0?void 0:Hh(r.pathname),c=Vu(e.data);return Ah(Gh(e.data),c),Hu(e.data?.branding?.accentColor),e.data===void 0?e.isError?(0,h.jsxs)(Wh,{appName:c,children:[(0,h.jsx)(`p`,{className:`text-sm`,role:`alert`,children:e.error.message}),(0,h.jsx)(W,{onClick:()=>{e.refetch()},variant:`outline`,children:`Try again`})]}):(0,h.jsx)(Uh,{appName:c}):e.data.mailboxes.length===0&&(e.data.apps??[]).length===0?(0,h.jsx)(Wh,{appName:c,children:(0,h.jsx)(`p`,{className:`text-sm`,role:`alert`,children:`You do not have access to any mailbox yet. Ask the owner to add you in mail.config.ts.`})}):(0,h.jsxs)(`div`,{className:`flex h-dvh flex-col md:flex-row`,children:[(0,h.jsx)(`h1`,{className:`sr-only`,children:c}),(0,h.jsx)(`header`,{className:`border-b border-border bg-surface md:hidden`,children:(0,h.jsxs)(`button`,{"aria-controls":`mailbox-switcher`,"aria-label":o===void 0?`Mailboxes`:`Mailboxes, current: ${o}`,"aria-expanded":i,className:`flex min-h-12 w-full items-center justify-between gap-2 px-4 text-left text-sm font-semibold outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-inset`,onClick:()=>{a(e=>!e)},type:`button`,children:[(0,h.jsx)(`span`,{className:`truncate`,children:o??c}),(0,h.jsx)(wo,{"aria-hidden":`true`,className:U(`size-4 shrink-0`,i&&`rotate-180`)})]})}),(0,h.jsxs)(`aside`,{"aria-label":`Mailbox sidebar`,className:U(`max-h-[60dvh] overflow-y-auto border-b border-border bg-surface md:block md:max-h-none md:w-60 md:shrink-0 md:border-r md:border-b-0`,i?`block`:`hidden`),id:`mailbox-switcher`,children:[(0,h.jsx)(`p`,{className:`hidden truncate px-4 pt-4 pb-2 text-sm font-semibold md:block`,children:c}),(0,h.jsx)(Eh,{apps:e.data.apps??[],currentAddress:t,currentApp:n,currentPage:s,mailboxes:e.data.mailboxes,onNavigate:()=>{a(!1)}})]}),(0,h.jsx)(Rr,{})]})}function Hh(e){let t=e.split(`/`)[2];return t===`contacts`||t===`snippets`?t:void 0}function Uh({appName:e}){return(0,h.jsxs)(`main`,{className:`p-4`,children:[(0,h.jsx)(`h1`,{className:`sr-only`,children:e}),(0,h.jsxs)(`div`,{"aria-busy":`true`,"aria-label":`Loading`,className:`flex flex-col gap-3`,role:`status`,children:[(0,h.jsx)(oo,{className:`h-6 w-1/2`}),(0,h.jsx)(oo,{className:`h-6 w-2/3`}),(0,h.jsx)(oo,{className:`h-6 w-1/3`})]})]})}function Wh({appName:e,children:t}){return(0,h.jsxs)(`main`,{className:`flex flex-col items-start gap-3 p-6`,children:[(0,h.jsx)(`h1`,{className:`sr-only`,children:e}),t]})}function Gh(e){return(e?.mailboxes??[]).reduce((e,t)=>e+t.unreadCount,0)}var Kh=class extends d.Component{static getDerivedStateFromError(){return{hasFailed:!0}}state={hasFailed:!1};componentDidCatch(e,t){console.error(e,t.componentStack)}render(){return this.state.hasFailed?(0,h.jsx)(qh,{}):this.props.children}};function qh(){let e=Vu(_().getQueryData([`me`]));return(0,h.jsxs)(`main`,{className:`flex flex-col items-start gap-3 p-6`,children:[(0,h.jsx)(`h1`,{className:`sr-only`,children:e}),(0,h.jsx)(`p`,{className:`text-sm`,role:`alert`,children:`Something went wrong. Reload the page.`}),(0,h.jsx)(W,{onClick:()=>{window.location.reload()},variant:`outline`,children:`Reload`})]})}var Jh=document.getElementById(`root`);vi(Jh,`The page has no #root element to render the app into.`);var Yh=new qe({defaultOptions:{queries:{retry:1}}});(0,gi.createRoot)(Jh).render((0,h.jsx)(d.StrictMode,{children:(0,h.jsx)(v,{client:Yh,children:(0,h.jsx)(ai,{children:(0,h.jsx)(Kh,{children:(0,h.jsx)(Ph,{})})})})}));