@lattice-php/lattice 0.71.0 → 0.72.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.
@@ -1,138 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./date-picker-view-CyYnhUeK.js","./rolldown-runtime-hePW80VL.js","./react-CwJFpaho.js","./react-dom-Dl-LT-t1.js","./locale-D9oL6nV7.js","./jsx-runtime-NZYk81nU.js","./floating-ui.dom-C6CLKWO6.js","./clsx-CjueKrWZ.js","./input-B7b-fHQh.js","./pattern-input-view-dTVbJbc_.js","./instance-CloWXP86.js","./timezone-gE1nfovq.js","./dist-CDI2N5YZ.js","./registry-context-gXwNT8GJ.js","./w3c-keyname-BOAvb0qz.js","./with-selector-Cse0iXU1.js","./dist-BTYZr5rg.js","./rich-editor-view-CVY3bSw7.js","./notifications-echo-BLO9_g1w.js","./dist-D2qBbka0.js","./chart-view-ZlKGh0mY.js","./materialize-CWqnSEHR.js","./color-CXV-Y5Qv.js","./code-block-view-4IbUdTmO.js","./subscriptions-DBWo_xL2.js"])))=>i.map(i=>d[i]);
2
- import{n as e,r as t,t as n}from"./rolldown-runtime-hePW80VL.js";import{t as r}from"./react-CwJFpaho.js";import{n as i,t as a}from"./materialize-CWqnSEHR.js";import{t as o}from"./react-dom-Dl-LT-t1.js";import{a as s,n as c,o as l,r as u,s as d}from"./locale-D9oL6nV7.js";import{t as f}from"./jsx-runtime-NZYk81nU.js";import{i as p,n as m,t as h}from"./registry-context-gXwNT8GJ.js";import{_ as g,a as _,d as v,f as y,g as b,h as x,i as S,l as C,m as w,n as T,o as E,p as D,r as O,s as ee,t as k,u as A,v as j,y as M}from"./floating-ui.dom-C6CLKWO6.js";import{a as te,c as N,i as P,n as F,o as ne,r as re,s as ie}from"./instance-CloWXP86.js";import{a as I,i as L,o as ae,r as oe,s as se}from"./timezone-gE1nfovq.js";import{$ as ce,$t as R,A as le,At as ue,B as de,Bt as fe,C as pe,Cn as me,Ct as he,Dt as ge,Et as _e,Ft as ve,Gt as ye,Ht as be,It as xe,J as Se,Jt as Ce,Kt as we,M as Te,Mt as Ee,Nt as De,Ot as Oe,Pt as ke,Q as Ae,Qt as je,R as Me,Rt as Ne,Sn as Pe,St as Fe,Tt as Ie,Ut as Le,V as Re,Vt as ze,W as Be,Wt as Ve,X as He,Xt as Ue,Y as We,Yt as Ge,Z as Ke,Zt as qe,_ as Je,_n as Ye,_t as Xe,an as Ze,b as Qe,bn as $e,c as et,cn as tt,ct as nt,d as rt,dn as it,dt as at,en as ot,et as st,fn as ct,ft as lt,g as ut,gn as dt,gt as ft,h as pt,hn as mt,ht,i as gt,in as _t,it as vt,j as yt,jt as bt,k as xt,kt as St,l as Ct,ln as wt,lt as Tt,m as Et,mn as Dt,mt as Ot,nn as kt,nt as At,o as jt,on as Mt,ot as Nt,pn as Pt,pt as Ft,qt as It,rn as Lt,sn as Rt,st as zt,tn as Bt,tt as Vt,un as Ht,ut as Ut,vn as Wt,vt as Gt,wn as Kt,wt as qt,xn as Jt,xt as Yt,y as Xt,yn as Zt,yt as Qt,z as $t,zt as en}from"./dist-CDI2N5YZ.js";import{n as tn,r as nn,t as rn}from"./input-B7b-fHQh.js";import{i as an,n as on,r as sn,t as cn}from"./color-CXV-Y5Qv.js";var z=t(r(),1),ln=`modulepreload`,un=function(e,t){return new URL(e,t).href},dn={},fn=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=un(t,n),t=s(t),t in dn)return;dn[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:ln,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})};function B(e){return{component:e,mode:`eager`}}var pn=[250,1e3,4e3];function mn(e){return async()=>{try{return await e()}catch(t){for(let t of pn){await new Promise(e=>setTimeout(e,t));try{return await e()}catch{continue}}throw t}}}function hn(e){let t=mn(e);return{component:(0,z.lazy)(t),load:t,mode:`lazy`}}var gn=e=>fn(()=>import(e),[],import.meta.url);function _n(e){return e===void 0||a(e)&&Object.values(e).every(e=>a(e)&&(e.mode===`eager`&&typeof e.component==`function`||e.mode===`lazy`&&a(e.component)&&typeof e.load==`function`))}function vn(e){return e===void 0||a(e)&&Object.values(e).every(e=>a(e))}function yn(e,t){let n=a(e)?e.default:void 0;if(!a(n)||typeof n.name!=`string`||n.name.trim()===``||!_n(n.components)||!vn(n.extensions)||n.i18n!==void 0&&(!a(n.i18n)||typeof n.i18n.namespace!=`string`||n.i18n.namespace.trim()===``))throw TypeError(`[lattice] Plugin module [${t}] must default export a Plugin object.`);return n}function bn(e,t=gn){return Promise.all(e.map(async e=>yn(await t(e),e)))}function xn(...e){let t={};for(let n of e)for(let[e,r]of Object.entries(n??{}))t[e]={...t[e],...r};return t}function Sn(...e){return e.reduce((e,t)=>({components:{...e.components,...t.components},extensions:xn(e.extensions,t.extensions)}),{components:{},extensions:{}})}function Cn(e,...t){return Sn({name:`registry`,...e},...t)}var wn=typeof globalThis==`object`&&globalThis||typeof window==`object`&&window||typeof self==`object`&&self||typeof global==`object`&&global||(function(){return this})();function Tn(e,t,{signal:n,edges:r}={}){let i,a=null,o=r!=null&&r.includes(`leading`),s=r==null||r.includes(`trailing`),c=()=>{a!==null&&(e.apply(i,a),i=void 0,a=null)},l=()=>{s&&c(),p()},u=null,d=()=>{u!=null&&clearTimeout(u),u=setTimeout(()=>{u=null,l()},t)},f=()=>{u!==null&&(clearTimeout(u),u=null)},p=()=>{f(),i=void 0,a=null},m=()=>{c()},h=function(...e){if(n?.aborted)return;i=this,a=e;let t=u==null;d(),o&&t&&c()};return h.schedule=d,h.cancel=p,h.flush=m,n?.addEventListener(`abort`,p,{once:!0}),h}function En(){}function Dn(e){return e==null||typeof e!=`object`&&typeof e!=`function`}function On(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function kn(e){if(Dn(e))return e;if(Array.isArray(e)||On(e)||e instanceof ArrayBuffer||typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer)return e.slice(0);let t=Object.getPrototypeOf(e);if(t==null)return Object.assign(Object.create(t),e);let n=t.constructor;if(e instanceof Date||e instanceof Map||e instanceof Set)return new n(e);if(e instanceof RegExp){let t=new n(e);return t.lastIndex=e.lastIndex,t}if(e instanceof DataView)return new n(e.buffer.slice(0));if(e instanceof Error){let t;return t=e instanceof AggregateError?new n(e.errors,e.message,{cause:e.cause}):new n(e.message,{cause:e.cause}),t.stack=e.stack,Object.assign(t,e),t}return typeof File<`u`&&e instanceof File?new n([e],e.name,{type:e.type,lastModified:e.lastModified}):typeof e==`object`?Object.assign(Object.create(t),e):e}function An(e){return wn.Buffer!==void 0&&wn.Buffer.isBuffer(e)}function jn(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function Mn(e){return e==null?e===void 0?`[object Undefined]`:`[object Null]`:Object.prototype.toString.call(e)}var Nn=`[object RegExp]`,Pn=`[object String]`,Fn=`[object Number]`,In=`[object Boolean]`,Ln=`[object Arguments]`,Rn=`[object Symbol]`,zn=`[object Date]`,Bn=`[object Map]`,Vn=`[object Set]`,Hn=`[object Array]`,Un=`[object Function]`,Wn=`[object ArrayBuffer]`,Gn=`[object Object]`,Kn=`[object Error]`,qn=`[object DataView]`,Jn=`[object Uint8Array]`,Yn=`[object Uint8ClampedArray]`,Xn=`[object Uint16Array]`,Zn=`[object Uint32Array]`,Qn=`[object BigUint64Array]`,$n=`[object Int8Array]`,er=`[object Int16Array]`,tr=`[object Int32Array]`,nr=`[object BigInt64Array]`,rr=`[object Float32Array]`,ir=`[object Float64Array]`;function ar(e,t){return or(e,void 0,e,new Map,t)}function or(e,t,n,r=new Map,i=void 0){let a=i?.(e,t,n,r);if(a!==void 0)return a;if(Dn(e))return e;if(r.has(e))return r.get(e);if(Array.isArray(e)){let t=Array(e.length);r.set(e,t);for(let a=0;a<e.length;a++)t[a]=or(e[a],a,n,r,i);return Object.hasOwn(e,`index`)&&(t.index=e.index),Object.hasOwn(e,`input`)&&(t.input=e.input),t}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){let t=new RegExp(e.source,e.flags);return t.lastIndex=e.lastIndex,t}if(e instanceof Map){let t=new Map;r.set(e,t);for(let[a,o]of e)t.set(a,or(o,a,n,r,i));return t}if(e instanceof Set){let t=new Set;r.set(e,t);for(let a of e)t.add(or(a,void 0,n,r,i));return t}if(An(e))return e.subarray();if(On(e)){let t=new(Object.getPrototypeOf(e)).constructor(e.length);r.set(e,t);for(let a=0;a<e.length;a++)t[a]=or(e[a],a,n,r,i);return t}if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){let t=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return r.set(e,t),sr(t,e,n,r,i),t}if(typeof File<`u`&&e instanceof File){let t=new File([e],e.name,{type:e.type});return r.set(e,t),sr(t,e,n,r,i),t}if(typeof Blob<`u`&&e instanceof Blob){let t=new Blob([e],{type:e.type});return r.set(e,t),sr(t,e,n,r,i),t}if(e instanceof Error){let t=structuredClone(e);return r.set(e,t),t.message=e.message,t.name=e.name,t.stack=e.stack,t.cause=e.cause,t.constructor=e.constructor,sr(t,e,n,r,i),t}if(e instanceof Boolean){let t=new Boolean(e.valueOf());return r.set(e,t),sr(t,e,n,r,i),t}if(e instanceof Number){let t=new Number(e.valueOf());return r.set(e,t),sr(t,e,n,r,i),t}if(e instanceof String){let t=new String(e.valueOf());return r.set(e,t),sr(t,e,n,r,i),t}if(typeof e==`object`&&cr(e)){let t=Object.create(Object.getPrototypeOf(e));return r.set(e,t),sr(t,e,n,r,i),t}return e}function sr(e,t,n=e,r,i){let a=[...Object.keys(t),...jn(t)];for(let o=0;o<a.length;o++){let s=a[o],c=Object.getOwnPropertyDescriptor(e,s);(c==null||c.writable)&&(e[s]=or(t[s],s,n,r,i))}}function cr(e){switch(Mn(e)){case Ln:case Hn:case Wn:case qn:case In:case zn:case rr:case ir:case $n:case er:case tr:case Bn:case Fn:case Gn:case Nn:case Vn:case Pn:case Rn:case Jn:case Yn:case Xn:case Zn:return!0;default:return!1}}function lr(e){return or(e,void 0,e,new Map,void 0)}function ur(e){if(!e||typeof e!=`object`)return!1;let t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null?!1:Object.prototype.toString.call(e)===`[object Object]`}function dr(e){return e===`__proto__`}function fr(e){if(typeof e!=`object`||!e)return!1;if(Object.getPrototypeOf(e)===null)return!0;if(Object.prototype.toString.call(e)!==`[object Object]`){let t=e[Symbol.toStringTag];return t==null||!Object.getOwnPropertyDescriptor(e,Symbol.toStringTag)?.writable?!1:e.toString()===`[object ${t}]`}let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function pr(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}function mr(e,t,n){return hr(e,t,void 0,void 0,void 0,void 0,n)}function hr(e,t,n,r,i,a,o){let s=o(e,t,n,r,i,a);if(s!==void 0)return s;if(typeof e==typeof t)switch(typeof e){case`bigint`:case`string`:case`boolean`:case`symbol`:case`undefined`:return e===t;case`number`:return e===t||Object.is(e,t);case`function`:return e===t;case`object`:return gr(e,t,a,o)}return gr(e,t,a,o)}function gr(e,t,n,r){if(Object.is(e,t))return!0;let i=Mn(e),a=Mn(t);if(i===`[object Arguments]`&&(i=Gn),a===`[object Arguments]`&&(a=Gn),i!==a)return!1;switch(i){case Pn:return e.toString()===t.toString();case Fn:return pr(e.valueOf(),t.valueOf());case In:case zn:case Rn:return Object.is(e.valueOf(),t.valueOf());case Nn:return e.source===t.source&&e.flags===t.flags;case Un:return e===t}n??=new Map;let o=n.get(e),s=n.get(t);if(o!=null&&s!=null)return o===t;n.set(e,t),n.set(t,e);try{switch(i){case Bn:if(e.size!==t.size)return!1;for(let[i,a]of e.entries())if(!t.has(i)||!hr(a,t.get(i),i,e,t,n,r))return!1;return!0;case Vn:{if(e.size!==t.size)return!1;let i=Array.from(e.values()),a=Array.from(t.values());for(let o=0;o<i.length;o++){let s=i[o],c=a.findIndex(i=>hr(s,i,void 0,e,t,n,r));if(c===-1)return!1;a.splice(c,1)}return!0}case Hn:case Jn:case Yn:case Xn:case Zn:case Qn:case $n:case er:case tr:case nr:case rr:case ir:if(An(e)!==An(t)||e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(!hr(e[i],t[i],i,e,t,n,r))return!1;return!0;case Wn:return e.byteLength===t.byteLength&&gr(new Uint8Array(e),new Uint8Array(t),n,r);case qn:return e.byteLength!==t.byteLength||e.byteOffset!==t.byteOffset?!1:gr(new Uint8Array(e),new Uint8Array(t),n,r);case Kn:return e.name===t.name&&e.message===t.message;case Gn:{if(!(gr(e.constructor,t.constructor,n,r)||ur(e)&&ur(t)))return!1;let i=[...Object.keys(e),...jn(e)],a=[...Object.keys(t),...jn(t)];if(i.length!==a.length)return!1;for(let a=0;a<i.length;a++){let o=i[a],s=e[o];if(!Object.hasOwn(t,o))return!1;let c=t[o];if(!hr(s,c,o,e,t,n,r))return!1}return!0}default:return!1}}finally{n.delete(e),n.delete(t)}}function _r(e,t){return mr(e,t,En)}function vr(e){return Number.isSafeInteger(e)&&e>=0}var yr={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`};function br(e){return e.replace(/[&<>"']/g,e=>yr[e])}function xr(e){return e!=null&&typeof e!=`function`&&vr(e.length)}function Sr(e){if(e==null)return``;if(typeof e==`string`)return e;if(Array.isArray(e))return e.map(Sr).join(`,`);let t=String(e);return t===`0`&&Object.is(Number(e),-0)?`-0`:t}function Cr(e){return typeof e==`string`||typeof e==`symbol`?e:Object.is(e?.valueOf?.(),-0)?`-0`:String(e)}function wr(e){if(Array.isArray(e))return e.map(Cr);if(typeof e==`symbol`)return[e];e=Sr(e);let t=[],n=e.length;if(n===0)return t;let r=0,i=``,a=``,o=!1;for(e.charCodeAt(0)===46&&t.push(``);r<n;){let s=e[r];if(a)s===`\\`&&r+1<n?(r++,i+=e[r]):s===a?a=``:i+=s;else if(o)s===`"`||s===`'`?a=s:s===`]`?(o=!1,t.push(i),i=``):i+=s;else if(s===`[`)o=!0,i&&=(t.push(i),``);else if(s===`.`){i&&=(t.push(i),``);let n=e[r+1];(n===void 0||n===`.`)&&t.push(``)}else i+=s;r++}return i&&t.push(i),t}var Tr=/\.|(\[(?:[^[\]]*|(["'])(?:(?!\2)[^\\]|\\.)*?\2)\])/;function Er(e){switch(typeof e){case`number`:case`symbol`:return!1;case`string`:return e===``||e.startsWith(`.`)||e.endsWith(`.`)?!1:Tr.test(e);default:return!1}}function Dr(e,t,n){if(e==null)return n;switch(typeof t){case`string`:{if(dr(t))return n;let r=e[t];return r===void 0?Er(t)&&!Object.hasOwn(e,t)?Dr(e,wr(t),n):n:r}case`number`:case`symbol`:{typeof t==`number`&&(t=Cr(t));let r=e[t];return r===void 0?n:r}default:{if(Array.isArray(t))return Or(e,t,n);if(t=Object.is(t?.valueOf(),-0)?`-0`:String(t),dr(t))return n;let r=e[t];return r===void 0?n:r}}}function Or(e,t,n){if(t.length===0)return n;let r=e;for(let e=0;e<t.length;e++){if(r==null||dr(t[e]))return n;r=r[t[e]]}return r===void 0?n:r}function kr(e){return e!==null&&(typeof e==`object`||typeof e==`function`)}function Ar(e,t){return ar(e,(n,r,i,a)=>{let o=t?.(n,r,i,a);if(o!==void 0)return o;if(typeof e==`object`){if(Mn(e)===`[object Object]`&&typeof e.constructor!=`function`){let t={};return a.set(e,t),sr(t,e,i,a),t}switch(Object.prototype.toString.call(e)){case Fn:case Pn:case In:{let t=new e.constructor(e?.valueOf());return sr(t,e),t}case Ln:{let t={};return sr(t,e),t.length=e.length,t[Symbol.iterator]=e[Symbol.iterator],t}default:return}}})}function jr(e){return Ar(e)}function Mr(e){return typeof e==`object`&&!!e&&Mn(e)===`[object Arguments]`}var Nr=/^(?:0|[1-9]\d*)$/;function Pr(e,t=2**53-1){switch(typeof e){case`number`:return Number.isInteger(e)&&e>=0&&e<t;case`symbol`:return!1;case`string`:return Nr.test(e)}}function Fr(e,t){let n;if(n=Array.isArray(t)?t:typeof t==`string`&&Er(t)&&!(t in Object(e))?wr(t):[t],n.length===0)return!1;let r=e;for(let e=0;e<n.length;e++){let t=n[e];if((r==null||!Object.hasOwn(r,t))&&!((Array.isArray(r)||Mr(r))&&Pr(t)&&t<r.length))return!1;r=r[t]}return!0}function Ir(e){return typeof e==`object`&&!!e}function Lr(e){return Ir(e)&&xr(e)}function Rr(e){return typeof e==`symbol`||e instanceof Symbol}var zr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Br=/^\w*$/;function Vr(e,t){return Array.isArray(e)?!1:typeof e==`number`||typeof e==`boolean`||e==null||Rr(e)?!0:typeof e==`string`&&(Br.test(e)||!zr.test(e))||t!=null&&Object.hasOwn(t,e)}function Hr(e){return On(e)}var Ur=(e,t,n)=>{let r=e[t];(!(Object.hasOwn(e,t)&&pr(r,n))||n===void 0&&!(t in e))&&(e[t]=n)};function Wr(e,t,n,r){if(e==null&&!kr(e))return e;let i;i=Vr(t,e)?[t]:Array.isArray(t)?t:wr(t);let a=n(Dr(e,i)),o=e;for(let t=0;t<i.length&&o!=null;t++){let n=Cr(i[t]);if(dr(n))continue;let s;if(t===i.length-1)s=a;else{let a=o[n],c=r?.(a,n,e);s=c===void 0?kr(a)?a:Pr(i[t+1])?[]:{}:c}Ur(o,n,s),o=o[n]}return e}function Gr(e,t,n){return Wr(e,t,()=>n,()=>void 0)}function Kr(e,t=0,n={}){typeof n!=`object`&&(n={});let{leading:r=!1,trailing:i=!0,maxWait:a}=n,o=[,,];r&&(o[0]=`leading`),i&&(o[1]=`trailing`);let s,c=null,l=Tn(function(...t){s=e.apply(this,t),c=null},t,{edges:o}),u=function(...t){return a!=null&&(c===null&&(c=Date.now()),Date.now()-c>=a)?(s=e.apply(this,t),c=Date.now(),l.cancel(),l.schedule(),s):(l.apply(this,t),s)};return u.cancel=l.cancel,u.flush=()=>(l.flush(),s),u}function qr(e,...t){let n=t.slice(0,-1),r=t[t.length-1],i=e;for(let e=0;e<n.length;e++){let t=n[e];i=Jr(i,t,r,new Map)}return i}function Jr(e,t,n,r){if(Dn(e)&&(e=Object(e)),typeof t!=`object`||!t)return e;if(r.has(t))return kn(r.get(t));if(r.set(t,e),Array.isArray(t)){t=t.slice();for(let e=0;e<t.length;e++)t[e]=t[e]??void 0}let i=[...Object.keys(t),...jn(t)];for(let a=0;a<i.length;a++){let o=i[a];if(dr(o))continue;let s=t[o],c=e[o];if(Mr(s)&&(s={...s}),Mr(c)&&(c={...c}),An(s)&&(s=jr(s)),Array.isArray(s))if(Array.isArray(c)){let e=[],t=Reflect.ownKeys(c);for(let n=0;n<t.length;n++){let r=t[n];e[r]=c[r]}c=e}else if(Lr(c)){let e=[];for(let t=0;t<c.length;t++)e[t]=c[t];c=e}else c=[];let l=n(c,s,o,e,t,r);l===void 0?Array.isArray(s)||Ir(c)&&Ir(s)&&(fr(c)||fr(s)||Hr(c)||Hr(s))?e[o]=Jr(c,s,n,r):c==null&&fr(s)?e[o]=Jr({},s,n,r):c==null&&Hr(s)?e[o]=jr(s):(c===void 0||s!==void 0)&&(e[o]=s):e[o]=l}return e}function Yr(e,...t){return qr(e,...t,En)}function Xr(e){return br(Sr(e))}var Zr=e=>typeof File<`u`&&e instanceof File||e instanceof Blob||typeof FileList<`u`&&e instanceof FileList&&e.length>0,Qr=e=>e instanceof FormData||Zr(e)||typeof e==`object`&&!!e&&Object.values(e).some(e=>Qr(e)),$r=class extends Error{response;constructor(e){super(`HTTP error ${e.status}`),this.name=`HttpResponseError`,this.response=e}},ei=class extends Error{constructor(e=`Request was cancelled`){super(e),this.name=`HttpCancelledError`}},ti=class extends Error{constructor(e=`Network error`){super(e),this.name=`HttpNetworkError`}};function ni(e){let t=new URLSearchParams;return Object.entries(e).forEach(([e,n])=>{n!=null&&(Array.isArray(n)?n.forEach(n=>t.append(`${e}[]`,String(n))):typeof n==`object`?t.append(e,JSON.stringify(n)):t.append(e,String(n)))}),t.toString()}function ri(e,t,n){if(t&&!e.startsWith(`http://`)&&!e.startsWith(`https://`)&&(e=t.replace(/\/$/,``)+`/`+e.replace(/^\//,``)),n&&Object.keys(n).length>0){let t=ni(n);t&&(e+=(e.includes(`?`)?`&`:`?`)+t)}return e}function ii(){return typeof window>`u`?null:window.axios?.defaults?.headers?.common?.[`X-Requested-With`]??null}function ai(e,t=new FormData,n=null){for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&oi(t,n?`${n}[${r}]`:r,e[r]);return t}function oi(e,t,n){if(Array.isArray(n))return n.forEach((n,r)=>oi(e,`${t}[${r}]`,n));if(n instanceof Date)return e.append(t,n.toISOString());if(typeof File<`u`&&n instanceof File)return e.append(t,n,n.name);if(n instanceof Blob)return e.append(t,n);if(typeof n==`boolean`)return e.append(t,n?`1`:`0`);if(typeof n==`string`)return e.append(t,n);if(typeof n==`number`)return e.append(t,`${n}`);if(n==null)return e.append(t,``);ai(n,e,t)}function si(e,t){if(e!=null)return e instanceof FormData?e:typeof e==`object`&&Qr(e)?ai(e):typeof e==`object`||t[`Content-Type`]?.includes(`application/json`)?JSON.stringify(e):String(e)}function ci(e){let t={};return e.forEach((e,n)=>{t[n.toLowerCase()]=e}),t}function li(e={}){let t=e.xsrfCookieName??`XSRF-TOKEN`,n=e.xsrfHeaderName??`X-XSRF-TOKEN`;function r(){if(typeof document>`u`)return null;let e=document.cookie.match(RegExp(`(^|;\\s*)`+t+`=([^;]*)`));return e?decodeURIComponent(e[2]):null}return{setXsrfCookieName(e){t=e},setXsrfHeaderName(e){n=e},async request(e){let t=ri(e.url,e.baseURL,e.params),i=e.method.toUpperCase(),a={},o=ii();o&&(a[`X-Requested-With`]=o),e.data!==void 0&&![`GET`,`DELETE`].includes(i)&&!(e.data instanceof FormData)&&!Qr(e.data)&&(a[`Content-Type`]=`application/json`),e.headers&&Object.entries(e.headers).forEach(([e,t])=>{t!==void 0&&(a[e]=String(t))});let s=r();s&&![`GET`,`HEAD`,`OPTIONS`].includes(i)&&(a[n]=s);let c=e.signal,l,u=e.timeout??3e4;if(u>0&&!c){let e=new AbortController;c=e.signal,l=setTimeout(()=>e.abort(),u)}let d=[`GET`,`DELETE`].includes(i)?void 0:si(e.data,a);d instanceof FormData&&delete a[`Content-Type`];try{let n=await fetch(t,{method:i,headers:a,body:d,signal:c,credentials:e.credentials??`same-origin`});l&&clearTimeout(l);let r;r=n.headers.get(`content-type`)?.includes(`application/json`)?await n.json():await n.text();let o={status:n.status,data:r,headers:ci(n.headers)};if(!n.ok)throw new $r(o);return o}catch(e){throw l&&clearTimeout(l),e instanceof $r?e:e instanceof DOMException&&e.name===`AbortError`?new ei:e instanceof TypeError?new ti(e.message):e}}}}var ui=li(),di=ui,fi=void 0,pi=void 0,mi=`same-origin`,hi=e=>`${e.method}:${e.baseURL??fi??``}${e.url}`,gi=e=>e.status===204&&e.headers[`precognition-success`]===`true`,_i={},vi={get:(e,t={},n={})=>bi(yi(`get`,e,t,n)),post:(e,t={},n={})=>bi(yi(`post`,e,t,n)),patch:(e,t={},n={})=>bi(yi(`patch`,e,t,n)),put:(e,t={},n={})=>bi(yi(`put`,e,t,n)),delete:(e,t={},n={})=>bi(yi(`delete`,e,t,n)),useHttpClient(e){return di=e,vi},withBaseURL(e){return fi=e,vi},withTimeout(e){return pi=e,vi},withCredentials(e){return mi=typeof e==`string`?e:e?`include`:`omit`,vi},fingerprintRequestsUsing(e){return hi=e===null?()=>null:e,vi},determineSuccessUsing(e){return gi=e,vi},withXsrfCookieName(e){return ui.setXsrfCookieName(e),vi},withXsrfHeaderName(e){return ui.setXsrfHeaderName(e),vi}},yi=(e,t,n,r)=>({url:t,method:e,...r,...[`get`,`delete`].includes(e)?{params:Yr({},n,r?.params)}:{data:Yr({},n,r?.data)}}),bi=(e={})=>{let t=[xi,Ci,wi].reduce((e,t)=>t(e),e);return(t.onBefore??(()=>!0))()===!1?Promise.resolve(null):((t.onStart??(()=>null))(),di.request({method:t.method,url:t.url,baseURL:t.baseURL??fi,data:t.data,params:t.params,headers:t.headers,signal:t.signal,timeout:t.timeout,credentials:mi}).then(async e=>{t.precognitive&&Ti(e);let n=e.status,r=e;return t.precognitive&&t.onPrecognitionSuccess&&gi(e)&&(r=await Promise.resolve(t.onPrecognitionSuccess(e)??r)),t.onSuccess&&Si(n)&&(r=await Promise.resolve(t.onSuccess(r)??r)),(Di(t,n)??(e=>e))(r)??r},e=>{if(Ei(e))return Promise.reject(e);let n=e;return t.precognitive&&Ti(n.response),(Di(t,n.response.status)??((e,t)=>Promise.reject(t)))(n.response,n)}).finally(t.onFinish??(()=>null)))},xi=e=>{let t=e.only??e.validate;return{...e,timeout:e.timeout??pi,precognitive:e.precognitive!==!1,fingerprint:e.fingerprint===void 0?hi(e,di):e.fingerprint,headers:{...e.headers,Accept:`application/json`,"Content-Type":Oi(e),...e.precognitive===!1?{}:{Precognition:!0},...t?{"Precognition-Validate-Only":Array.from(t).join()}:{}}}},Si=e=>e>=200&&e<300,Ci=e=>typeof e.fingerprint==`string`?(_i[e.fingerprint]?.abort(),delete _i[e.fingerprint],e):e,wi=e=>typeof e.fingerprint!=`string`||e.signal||!e.precognitive?e:(_i[e.fingerprint]=new AbortController,{...e,signal:_i[e.fingerprint].signal}),Ti=e=>{if(e.headers?.precognition!==`true`)throw Error(`Did not receive a Precognition response. Ensure you have the Precognition middleware in place for the route.`)},Ei=e=>!(e instanceof $r)||typeof e.response?.status!=`number`,Di=(e,t)=>({401:e.onUnauthorized,403:e.onForbidden,404:e.onNotFound,409:e.onConflict,422:e.onValidationError,423:e.onLocked})[t],Oi=e=>e.headers?.[`Content-Type`]??e.headers?.[`Content-type`]??e.headers?.[`content-type`]??(Qr(e.data)?`multipart/form-data`:`application/json`),ki=(e,t)=>{if(!e.includes(`*`))return[e];let n=e.split(`.`),r=[``];for(let e of n)if(e===`*`){let e=[];for(let n of r){let r=n?Dr(t,n):t;if(Array.isArray(r))for(let t=0;t<r.length;t++)e.push(n?`${n}.${t}`:String(t));else if(typeof r==`object`&&r)for(let t of Object.keys(r))e.push(n?`${n}.${t}`:t)}r=e}else r=r.map(t=>t?`${t}.${e}`:e);return r},Ai=(e,t)=>t.includes(`*`)?RegExp(`^`+t.replace(/\./g,`\\.`).replace(/\*/g,`[^.]+`)+`$`).test(e):e===t,ji=(e,t)=>Object.fromEntries(Object.entries(e).filter(([e])=>!t.some(t=>Ai(e,t)))),V=(e,t={})=>{let n={errorsChanged:[],touchedChanged:[],validatingChanged:[],validatedChanged:[]},r=!1,i=!1,a=e=>e===i?[]:(i=e,n.validatingChanged),o=[],s=e=>{let t=[...new Set(e)];return o.length!==t.length||!t.every(e=>o.includes(e))?(o=t,n.validatedChanged):[]},c=()=>o.filter(e=>d[e]===void 0),l=[],u=e=>{let t=[...new Set(e)];return l.length!==t.length||!t.every(e=>l.includes(e))?(l=t,n.touchedChanged):[]},d={},f=e=>{let t=Ni(e);return _r(d,t)?[]:(d=t,n.errorsChanged)},p=e=>{let t={...d};return delete t[Pi(e)],f(t)},m=()=>Object.keys(d).length>0,h=1500,g=e=>{h=e,S.cancel(),S=x()},_=t,v=null,y=[],b=null,x=()=>Kr(t=>{e({get:(e,n={},r={})=>vi.get(e,T(n),C(r,t,n)),post:(e,n={},r={})=>vi.post(e,T(n),C(r,t,n)),patch:(e,n={},r={})=>vi.patch(e,T(n),C(r,t,n)),put:(e,n={},r={})=>vi.put(e,T(n),C(r,t,n)),delete:(e,n={},r={})=>vi.delete(e,T(n),C(r,t,n))}).catch(e=>e instanceof ei||e instanceof $r&&e.response?.status===422?null:Promise.reject(e))},h,{leading:!0,trailing:!0}),S=x(),C=(e,t,n={})=>{let r={...e,...t},i=Array.from(r.only??r.validate??l);return{...t,...Yr({},e,t),only:i,timeout:r.timeout??5e3,onValidationError:(e,t)=>([...s([...o,...i]),...f(Yr(ji({...d},i),e.data.errors))].forEach(e=>e()),r.onValidationError?r.onValidationError(e,t):Promise.reject(t)),onSuccess:e=>(s([...o,...i]).forEach(e=>e()),r.onSuccess?r.onSuccess(e):e),onPrecognitionSuccess:e=>([...s([...o,...i]),...f(ji({...d},i))].forEach(e=>e()),r.onPrecognitionSuccess?r.onPrecognitionSuccess(e):e),onBefore:()=>{let e=l.some(e=>e.includes(`*`)),t=e?[...new Set(l.flatMap(e=>ki(e,n)))]:l;return r.onBeforeValidation&&r.onBeforeValidation({data:n,touched:t},{data:_,touched:y})===!1||(r.onBefore||(()=>!0))()===!1?!1:(e&&u(t).forEach(e=>e()),b=l,v=n,!0)},onStart:()=>{a(!0).forEach(e=>e()),(r.onStart??(()=>null))()},onFinish:()=>{a(!1).forEach(e=>e()),y=b,_=v,b=v=null,(r.onFinish??(()=>null))()}}},w=(e,t,n)=>{if(e===void 0){let e=Array.from(n?.only??n?.validate??[]);u([...l,...e]).forEach(e=>e()),S(n??{});return}if(Zr(t)&&!r){console.warn(`Precognition file validation is not active. Call the "validateFiles" function on your form to enable it.`);return}e=Pi(e),(e.includes(`*`)||Dr(_,e)!==t)&&(u([e,...l]).forEach(e=>e()),S(n??{}))},T=e=>r===!1?Fi(e):e,E={touched:()=>l,validate(e,t,n){return typeof e==`object`&&!(`target`in e)&&(n=e,e=t=void 0),w(e,t,n),E},touch(e){let t=Array.isArray(e)?e:[Pi(e)];return u([...l,...t]).forEach(e=>e()),E},validating:()=>i,valid:c,errors:()=>d,hasErrors:m,setErrors(e){return f(e).forEach(e=>e()),E},forgetError(e){return p(e).forEach(e=>e()),E},defaults(e){return t=e,_=e,E},reset(...e){if(e.length===0)u([]).forEach(e=>e());else{let n=[...l];e.forEach(e=>{n.includes(e)&&n.splice(n.indexOf(e),1),Gr(_,e,Dr(t,e))}),u(n).forEach(e=>e())}return E},setTimeout(e){return g(e),E},on(e,t){return n[e].push(t),E},validateFiles(){return r=!0,E},withoutFileValidation(){return r=!1,E}};return E},Mi=e=>Object.keys(e).reduce((t,n)=>({...t,[n]:Array.isArray(e[n])?e[n][0]:e[n]}),{}),Ni=e=>Object.keys(e).reduce((t,n)=>({...t,[n]:typeof e[n]==`string`?[e[n]]:e[n]}),{}),Pi=e=>typeof e==`string`?e:e.target.name,Fi=e=>{let t={...e};return Object.keys(t).forEach(e=>{let n=t[e];if(n!==null){if(Zr(n)){delete t[e];return}if(Array.isArray(n)){t[e]=Object.values(Fi({...n}));return}if(typeof n==`object`){t[e]=Fi(t[e]);return}}}),t},Ii=new class{config={};defaults;constructor(e){this.defaults=e}extend(e){return e&&(this.defaults={...this.defaults,...e}),this}replace(e){this.config=e}get(e){return Fr(this.config,e)?Dr(this.config,e):Dr(this.defaults,e)}set(e,t){typeof e==`string`?Gr(this.config,e,t):Object.entries(e).forEach(([e,t])=>{Gr(this.config,e,t)})}}({form:{recentlySuccessfulDuration:2e3,forceIndicesArrayFormatInFormData:!0,withAllErrors:!1},prefetch:{cacheFor:3e4,hoverDelay:75}});function Li(e,t){let n;return function(...r){clearTimeout(n),n=setTimeout(()=>e.apply(this,r),t)}}function Ri(e,t){return document.dispatchEvent(new CustomEvent(`inertia:${e}`,t))}var zi=e=>Ri(`before`,{cancelable:!0,detail:{visit:e}}),Bi=(e,{page:t,visitId:n}={})=>Ri(`error`,{detail:{errors:e,page:t,visitId:n}}),Vi=e=>Ri(`networkError`,{cancelable:!0,detail:{error:e}}),Hi=e=>Ri(`finish`,{detail:{visit:e}}),Ui=e=>Ri(`httpException`,{cancelable:!0,detail:{response:e}}),Wi=e=>Ri(`beforeUpdate`,{detail:{page:e}}),Gi=(e,{cached:t=!1,visitId:n}={})=>Ri(`navigate`,{detail:{page:e,cached:t,visitId:n}}),Ki=(e,{replace:t,visitId:n})=>Ri(`clientVisit`,{detail:{page:e,replace:t,visitId:n}}),qi=e=>Ri(`progress`,{detail:{progress:e}}),Ji=e=>Ri(`start`,{detail:{visit:e}}),Yi=(e,{visitId:t}={})=>Ri(`success`,{detail:{page:e,visitId:t}}),Xi=(e,t)=>Ri(`prefetched`,{detail:{fetchedAt:Date.now(),response:e,visit:t}}),Zi=e=>Ri(`prefetching`,{detail:{visit:e}}),Qi=e=>Ri(`flash`,{detail:{flash:e}}),$i=(e,t)=>Ri(`location`,{cancelable:!0,detail:{url:e,versionChange:t}}),ea=class{static locationVisitKey=`inertiaLocationVisit`;static set(e,t){typeof window<`u`&&window.sessionStorage.setItem(e,JSON.stringify(t))}static get(e){if(typeof window<`u`)return JSON.parse(window.sessionStorage.getItem(e)||`null`)}static merge(e,t){let n=this.get(e);n===null?this.set(e,t):this.set(e,{...n,...t})}static remove(e){typeof window<`u`&&window.sessionStorage.removeItem(e)}static removeNested(e,t){let n=this.get(e);n!==null&&(delete n[t],this.set(e,n))}static exists(e){try{return this.get(e)!==null}catch{return!1}}static clear(){typeof window<`u`&&window.sessionStorage.clear()}},ta=async e=>{if(typeof window>`u`)throw Error(`Unable to encrypt history`);let t=oa(),n=await la(await ua());if(!n)throw Error(`Unable to encrypt history`);return await ia(t,n,e)},na={key:`historyKey`,iv:`historyIv`},ra=async e=>{let t=oa(),n=await ua();if(!n)throw Error(`Unable to decrypt history`);return await aa(t,n,e)},ia=async(e,t,n)=>{if(typeof window>`u`)throw Error(`Unable to encrypt history`);if(window.crypto.subtle===void 0)return console.warn(`Encryption is not supported in this environment. SSL is required.`),Promise.resolve(n);let r=new TextEncoder,i=JSON.stringify(n),a=new Uint8Array(i.length*3),o=r.encodeInto(i,a);return window.crypto.subtle.encrypt({name:`AES-GCM`,iv:e},t,a.subarray(0,o.written))},aa=async(e,t,n)=>{if(window.crypto.subtle===void 0)return console.warn(`Decryption is not supported in this environment. SSL is required.`),Promise.resolve(n);let r=await window.crypto.subtle.decrypt({name:`AES-GCM`,iv:e},t,n);return JSON.parse(new TextDecoder().decode(r))},oa=()=>{let e=ea.get(na.iv);if(e)return new Uint8Array(e);let t=window.crypto.getRandomValues(new Uint8Array(12));return ea.set(na.iv,Array.from(t)),t},sa=async()=>window.crypto.subtle===void 0?(console.warn(`Encryption is not supported in this environment. SSL is required.`),Promise.resolve(null)):window.crypto.subtle.generateKey({name:`AES-GCM`,length:256},!0,[`encrypt`,`decrypt`]),ca=async e=>{if(window.crypto.subtle===void 0)return console.warn(`Encryption is not supported in this environment. SSL is required.`),Promise.resolve();let t=await window.crypto.subtle.exportKey(`raw`,e);ea.set(na.key,Array.from(new Uint8Array(t)))},la=async e=>{if(e)return e;let t=await sa();return t?(await ca(t),t):null},ua=async()=>{let e=ea.get(na.key);return e?await window.crypto.subtle.importKey(`raw`,new Uint8Array(e),{name:`AES-GCM`,length:256},!0,[`encrypt`,`decrypt`]):null},da=e=>{let t={};for(let n of Object.keys(e))e[n]!==void 0&&(t[n]=e[n]);return t},fa=(e,t,n)=>{if(e===t)return!0;for(let r in e)if(!n.includes(r)&&e[r]!==t[r]&&!pa(e[r],t[r]))return!1;for(let r in t)if(!n.includes(r)&&!(r in e))return!1;return!0},pa=(e,t)=>{switch(typeof e){case`object`:return fa(e,t,[]);case`function`:return e.toString()===t.toString();default:return e===t}},ma={ms:1,s:1e3,m:6e4,h:36e5,d:864e5},ha=e=>{if(typeof e==`number`)return e;for(let[t,n]of Object.entries(ma))if(e.endsWith(t))return parseFloat(e)*n;return parseInt(e)},ga=new class{cached=[];inFlightRequests=[];removalTimers=[];currentUseId=null;add(e,t,{cacheFor:n,cacheTags:r}){if(this.findInFlight(e))return Promise.resolve();let i=this.findCached(e);if(!e.fresh&&i&&i.staleTimestamp>Date.now())return Promise.resolve();let[a,o]=this.extractStaleValues(n),s=new Promise((n,r)=>{t({...e,onCancel:()=>{this.remove(e),e.onCancel(),r()},onError:t=>{this.remove(e),e.onError(t),r()},onPrefetching(t){e.onPrefetching(t)},onPrefetched(t,n){e.onPrefetched(t,n)},onPrefetchResponse(e){n(e)},onPrefetchError(t){ga.removeFromInFlight(e),r(t)}})}).then(t=>{this.remove(e);let n=t.getPageResponse();H.mergeOncePropsIntoResponse(n),this.cached.push({params:{...e},staleTimestamp:Date.now()+a,expiresAt:Date.now()+o,response:s,singleUse:o===0,timestamp:Date.now(),inFlight:!1,tags:Array.isArray(r)?r:[r]});let i=this.getShortestOncePropTtl(n);return this.scheduleForRemoval(e,i?Math.min(o,i):o),this.removeFromInFlight(e),t.handlePrefetch(),t});return this.inFlightRequests.push({params:{...e},response:s,staleTimestamp:null,inFlight:!0}),s}removeAll(){this.cached=[],this.removalTimers.forEach(e=>{clearTimeout(e.timer)}),this.removalTimers=[]}removeByTags(e){this.cached=this.cached.filter(t=>!t.tags.some(t=>e.includes(t)))}remove(e){this.cached=this.cached.filter(t=>!this.paramsAreEqual(t.params,e)),this.clearTimer(e)}removeFromInFlight(e){this.inFlightRequests=this.inFlightRequests.filter(t=>!this.paramsAreEqual(t.params,e))}extractStaleValues(e){let[t,n]=this.cacheForToStaleAndExpires(e);return[ha(t),ha(n)]}cacheForToStaleAndExpires(e){if(!Array.isArray(e))return[e,e];switch(e.length){case 0:return[0,0];case 1:return[e[0],e[0]];default:return[e[0],e[1]]}}clearTimer(e){let t=this.removalTimers.find(t=>this.paramsAreEqual(t.params,e));t&&(clearTimeout(t.timer),this.removalTimers=this.removalTimers.filter(e=>e!==t))}scheduleForRemoval(e,t){if(!(typeof window>`u`)&&(this.clearTimer(e),t>0)){let n=window.setTimeout(()=>this.remove(e),t);this.removalTimers.push({params:e,timer:n})}}get(e){return this.findCached(e)||this.findInFlight(e)}use(e,t){let n=`${t.url.pathname}-${Date.now()}-${Math.random().toString(36).substring(7)}`;this.currentUseId=n;let r={...t,cached:!0};return e.response.then(e=>{if(this.currentUseId===n)return e.mergeParams({...r,onPrefetched:()=>{}}),this.removeSingleUseItems(t),e.handle()})}removeSingleUseItems(e){this.cached=this.cached.filter(t=>!this.paramsAreEqual(t.params,e)||!t.singleUse)}findCached(e){return this.cached.find(t=>this.paramsAreEqual(t.params,e))||null}findInFlight(e){return this.inFlightRequests.find(t=>this.paramsAreEqual(t.params,e))||null}withoutPurposePrefetchHeader(e){let t=lr(e);return t.headers.Purpose===`prefetch`&&delete t.headers.Purpose,t}paramsAreEqual(e,t){return fa(this.withoutPurposePrefetchHeader(e),this.withoutPurposePrefetchHeader(t),[`id`,`showProgress`,`replace`,`prefetch`,`preserveScroll`,`preserveState`,`onBefore`,`onBeforeUpdate`,`onStart`,`onProgress`,`onFinish`,`onCancel`,`onSuccess`,`onError`,`onFlash`,`onPrefetched`,`onCancelToken`,`onPrefetching`,`async`,`viewTransition`,`optimistic`,`component`,`pageProps`,`cached`])}updateCachedOncePropsFromCurrentPage(){this.cached.forEach(e=>{e.response.then(t=>{let n=t.getPageResponse();H.mergeOncePropsIntoResponse(n,{force:!0});for(let[e,t]of Object.entries(n.deferredProps??{})){let r=t.filter(e=>Dr(n.props,e)===void 0);r.length>0?n.deferredProps[e]=r:delete n.deferredProps[e]}let r=this.getShortestOncePropTtl(n);if(r===null)return;let i=e.expiresAt-Date.now(),a=Math.min(i,r);a>0?this.scheduleForRemoval(e.params,a):this.remove(e.params)})})}getShortestOncePropTtl(e){let t=Object.values(e.onceProps??{}).map(e=>e.expiresAt).filter(e=>!!e);return t.length===0?null:Math.min(...t)-Date.now()}},_a=e=>{if(e.offsetParent===null)return!1;let t=e.getBoundingClientRect(),n=t.top<window.innerHeight&&t.bottom>=0,r=t.left<window.innerWidth&&t.right>=0;return n&&r},va=e=>{let t=e=>{let t=window.getComputedStyle(e);return t.overflowY===`scroll`?!0:t.overflowY===`auto`?[`visible`,`clip`].includes(t.overflowX)?!0:r(t.maxHeight,e.style.height)||i(e,`height`):!1},n=e=>{let t=window.getComputedStyle(e);return t.overflowX===`scroll`?!0:t.overflowX===`auto`?[`visible`,`clip`].includes(t.overflowY)?!0:r(t.maxWidth,e.style.width)||i(e,`width`):!1},r=(e,t)=>!!(e&&e!==`none`&&e!==`0px`||t&&t!==`auto`&&t!==`0`),i=(e,t)=>{let n=e.parentElement;if(!n)return!1;let r=window.getComputedStyle(n);if([`flex`,`inline-flex`].includes(r.display)){let e=[`column`,`column-reverse`].includes(r.flexDirection);return t===`height`?e:!e}return[`grid`,`inline-grid`].includes(r.display)},a=e?.parentElement;for(;a;){let e=t(a)||n(a);if(window.getComputedStyle(a).display!==`contents`&&e)return a;a=a.parentElement}return null},ya=(e,t)=>{if(!t)return e.filter(e=>_a(e));let n=e.indexOf(t),r=[],i=[];for(let t=n;t>=0;t--){let n=e[t];if(_a(n))r.push(n);else break}for(let t=n+1;t<e.length;t++){let n=e[t];if(_a(n))i.push(n);else break}return[...r.reverse(),...i]},ba=(e,t=1)=>{window.requestAnimationFrame(()=>{t>1?ba(e,t-1):e()})},xa=e=>{if(typeof window>`u`)return null;let t=document.querySelector(`script[data-page="${e}"][type="application/json"]`);return t?.textContent?JSON.parse(t.textContent):null},Sa=typeof window>`u`,Ca=!Sa&&/Firefox/i.test(window.navigator.userAgent),wa=class{static save(){U.saveScrollPositions(this.getScrollRegions())}static getScrollRegions(){return Array.from(this.regions()).map(e=>({top:e.scrollTop,left:e.scrollLeft}))}static regions(){return document.querySelectorAll(`[scroll-region]`)}static scrollToTop(){if(Ca&&getComputedStyle(document.documentElement).scrollBehavior===`smooth`)return ba(()=>window.scrollTo(0,0),2);window.scrollTo(0,0)}static reset(){!Sa&&window.location.hash||this.scrollToTop(),this.regions().forEach(e=>{typeof e.scrollTo==`function`?e.scrollTo(0,0):(e.scrollTop=0,e.scrollLeft=0)}),this.save(),this.scrollToAnchor()}static scrollToAnchor(){let e=Sa?null:window.location.hash;e&&setTimeout(()=>{let t=document.getElementById(e.slice(1));t?t.scrollIntoView():this.scrollToTop()})}static restore(e){Sa||window.requestAnimationFrame(()=>{this.restoreDocument(),this.restoreScrollRegions(e)})}static restoreScrollRegions(e){Sa||this.regions().forEach((t,n)=>{let r=e[n];r&&(typeof t.scrollTo==`function`?t.scrollTo(r.left,r.top):(t.scrollTop=r.top,t.scrollLeft=r.left))})}static restoreDocument(){let e=U.getDocumentScrollPosition();window.scrollTo(e.left,e.top)}static onScroll(e){let t=e.target;typeof t.hasAttribute==`function`&&t.hasAttribute(`scroll-region`)&&this.save()}static onWindowScroll(){U.saveDocumentScrollPosition({top:window.scrollY,left:window.scrollX})}},Ta=e=>typeof File<`u`&&e instanceof File||e instanceof Blob||typeof FileList<`u`&&e instanceof FileList&&e.length>0;function Ea(e){return Ta(e)||e instanceof FormData&&Array.from(e.values()).some(e=>Ea(e))||typeof e==`object`&&!!e&&Object.values(e).some(e=>Ea(e))}var Da=e=>e instanceof FormData;function Oa(e,t=new FormData,n=null,r=`brackets`){e||={};for(let i in e)Object.prototype.hasOwnProperty.call(e,i)&&Aa(t,ka(n,i,`indices`),e[i],r);return t}function ka(e,t,n){return e?n===`brackets`?`${e}[]`:`${e}[${t}]`:t}function Aa(e,t,n,r){if(Array.isArray(n))return Array.from(n.keys()).forEach(i=>Aa(e,ka(t,i.toString(),r),n[i],r));if(n instanceof Date)return e.append(t,n.toISOString());if(n instanceof File)return e.append(t,n,n.name);if(n instanceof Blob)return e.append(t,n);if(typeof n==`boolean`)return e.append(t,n?`1`:`0`);if(typeof n==`string`)return e.append(t,n);if(typeof n==`number`)return e.append(t,`${n}`);if(n==null)return e.append(t,``);Oa(n,e,t,r)}function ja(e){return/\[\d+\]/.test(decodeURIComponent(e.search))}function Ma(e){if(!e||e===`?`)return{};let t={};return e.replace(/^\?/,``).split(`&`).filter(Boolean).forEach(e=>{let[n,r]=Pa(e);Ia(t,Fa(n),Fa(r))}),t}function Na(e,t){let n=[];return Ra(e,``,n,t),n.length?`?`+n.join(`&`):``}function Pa(e){let t=e.indexOf(`=`);return t===-1?[e,``]:[e.substring(0,t),e.substring(t+1)]}function Fa(e){return decodeURIComponent(e.replace(/\+/g,` `))}function Ia(e,t,n){let r=La(t);if(r.some(e=>e===`__proto__`))return;let i=e;for(;r.length>1;){let e=r.shift(),t=r[0]===``;(typeof i[e]!=`object`||i[e]===null)&&(i[e]=t?[]:{}),i=i[e]}let a=r.shift();a===``&&Array.isArray(i)?i.push(n):i[a]=n}function La(e){let t=[],n=e.split(`[`)[0];n&&t.push(n);let r,i=/\[([^\]]*)\]/g;for(;(r=i.exec(e))!==null;)t.push(r[1]);return t}function Ra(e,t,n,r){if(e!==void 0){if(e===null){n.push(`${t}=`);return}if(Array.isArray(e)){e.forEach((e,i)=>{Ra(e,r===`indices`?`${t}[${i}]`:`${t}[]`,n,r)});return}if(typeof e==`object`){Object.keys(e).forEach(i=>{Ra(e[i],t?`${t}[${i}]`:i,n,r)});return}n.push(`${t}=${encodeURIComponent(String(e))}`)}}function za(e){return new URL(e.toString(),typeof window>`u`?void 0:window.location.toString())}var Ba=(e,t,n,r,i)=>{let a=typeof e==`string`?za(e):e;if((Ea(t)||r)&&!Da(t)&&(Ii.get(`form.forceIndicesArrayFormatInFormData`)&&(i=`indices`),t=Oa(t,new FormData,null,i)),Da(t))return[a,t];let[o,s]=Va(n,a,t,i);return[za(o),s]};function Va(e,t,n,r=`brackets`){let i=e===`get`&&!Da(n)&&Object.keys(n).length>0,a=Ja(t.toString()),o=a||t.toString().startsWith(`/`)||t.toString()===``,s=!o&&!t.toString().startsWith(`#`)&&!t.toString().startsWith(`?`),c=/^[.]{1,2}([/]|$)/.test(t.toString()),l=t.toString().includes(`?`)||i,u=t.toString().includes(`#`),d=new URL(t.toString(),typeof window>`u`?`http://localhost`:window.location.toString());if(i){let e=ja(d)?`indices`:r;d.search=Na({...Ma(d.search),...n},e)}return[[a?`${d.protocol}//${d.host}`:``,o?d.pathname:``,s?d.pathname.substring(+!c):``,l?d.search:``,u?d.hash:``].join(``),i?{}:n]}function Ha(e){return e=new URL(e.href),e.hash=``,e}var Ua=(e,t)=>{e.hash&&!t.hash&&Ha(e).href===t.href&&(t.hash=e.hash)},Wa=(e,t)=>Ha(e).href===Ha(t).href,Ga=(e,t)=>e.origin===t.origin&&e.pathname===t.pathname;function Ka(e){return typeof e==`object`&&!!e&&e!==void 0&&`url`in e&&`method`in e}function qa(e){return e.component?typeof e.component==`string`?e.component:(console.error(`The "component" property on the URL method pair received multiple components (${Object.keys(e.component).join(`, `)}), but only a single component string is supported for instant visits. Use the withComponent() method to specify which component to use.`),null):null}function Ja(e){return/^([a-z][a-z0-9+.-]*:)?\/\/[^/]/i.test(e)}function Ya(e,t){let n=typeof e==`string`?za(e):e;return t?`${n.protocol}//${n.host}${n.pathname}${n.search}${n.hash}`:`${n.pathname}${n.search}${n.hash}`}var H=new class{page;swapComponent;resolveComponent;onFlashCallback;componentId={};listeners=[];isFirstPageLoad=!0;cleared=!1;pendingDeferredProps=null;historyQuotaExceeded=!1;optimisticBaseline={};pendingOptimistics=[];optimisticCounter=0;init({initialPage:e,swapComponent:t,resolveComponent:n,onFlash:r}){return this.page={...e,flash:e.flash??{},rescuedProps:e.rescuedProps??[]},this.swapComponent=t,this.resolveComponent=n,this.onFlashCallback=r,to.on(`historyQuotaExceeded`,()=>{this.historyQuotaExceeded=!0}),this}set(e,{replace:t=!1,preserveScroll:n=!1,preserveState:r=!1,viewTransition:i=!1,cached:a=!1,visitId:o}={}){Object.keys(e.deferredProps||{}).length&&(this.pendingDeferredProps={deferredProps:e.deferredProps,component:e.component,url:e.url},e.initialDeferredProps===void 0&&(e.initialDeferredProps=e.deferredProps)),this.componentId={};let s=this.componentId;return e.clearHistory&&U.clear(),this.resolve(e.component,e).then(c=>{if(s!==this.componentId)return;e.rememberedState??={};let l=typeof window>`u`,u=l?new URL(e.url):window.location,d=!l&&n?wa.getScrollRegions():[];t||=Wa(za(e.url),u);let f={...e,flash:{}};return new Promise(e=>t?U.replaceState(f,e):U.pushState(f,e)).then(()=>{let s=!this.isTheSame(e);if(!s&&Object.keys(e.props.errors||{}).length>0&&(i=!1),this.page=e,this.cleared=!1,this.hasOnceProps()&&ga.updateCachedOncePropsFromCurrentPage(),s&&this.fireEventsFor(`newComponent`),this.isFirstPageLoad&&this.fireEventsFor(`firstLoad`),this.isFirstPageLoad=!1,this.historyQuotaExceeded){this.historyQuotaExceeded=!1;return}return this.swap({component:c,page:e,preserveState:r,viewTransition:i}).then(()=>{n?window.requestAnimationFrame(()=>wa.restoreScrollRegions(d)):wa.reset(),this.pendingDeferredProps&&this.pendingDeferredProps.component===e.component&&this.pendingDeferredProps.url===e.url&&to.fireInternalEvent(`loadDeferredProps`,this.pendingDeferredProps.deferredProps),this.pendingDeferredProps=null,t||Gi(e,{cached:a,visitId:o})})})})}setQuietly(e,{preserveState:t=!1}={}){return this.resolve(e.component,e).then(n=>(this.page=e,this.cleared=!1,U.setCurrent(e),this.swap({component:n,page:e,preserveState:t,viewTransition:!1})))}clear(){this.cleared=!0}isCleared(){return this.cleared}get(){return this.page}getWithoutFlashData(){return{...this.page,flash:{}}}hasOnceProps(){return Object.keys(this.page.onceProps??{}).length>0}merge(e){this.page={...this.page,...e}}setPropsQuietly(e){return this.page={...this.page,props:e},this.resolve(this.page.component,this.page).then(e=>this.swap({component:e,page:this.page,preserveState:!0,viewTransition:!1}))}setFlash(e){this.page={...this.page,flash:e},this.onFlashCallback?.(e)}setUrlHash(e){this.page.url.includes(e)||(this.page.url+=e)}remember(e){this.page.rememberedState=e}swap({component:e,page:t,preserveState:n,viewTransition:r}){let i=()=>this.swapComponent({component:e,page:t,preserveState:n});if(!r||!document?.startViewTransition||document.visibilityState===`hidden`)return i();let a=typeof r==`boolean`?()=>null:r;return new Promise(e=>{let t=document.startViewTransition(()=>i().then(e));t.ready.catch(()=>{}),a(t)})}resolve(e,t){return Promise.resolve(this.resolveComponent(e,t))}nextOptimisticId(){return++this.optimisticCounter}setBaseline(e,t){e in this.optimisticBaseline||(this.optimisticBaseline[e]=t)}updateBaseline(e,t){e in this.optimisticBaseline&&(this.optimisticBaseline[e]=t)}hasBaseline(e){return e in this.optimisticBaseline}registerOptimistic(e,t){this.pendingOptimistics.push({id:e,callback:t})}unregisterOptimistic(e){this.pendingOptimistics=this.pendingOptimistics.filter(t=>t.id!==e)}replayOptimistics(){let e=Object.keys(this.optimisticBaseline);if(e.length===0)return{};let t=lr(this.page.props);for(let n of e)t[n]=lr(this.optimisticBaseline[n]);for(let{callback:e}of this.pendingOptimistics){let n=e(lr(t));n&&Object.assign(t,n)}let n={};for(let r of e)n[r]=t[r];return n}pendingOptimisticCount(){return this.pendingOptimistics.length}clearOptimisticState(){this.optimisticBaseline={},this.pendingOptimistics=[]}isTheSame(e){return this.page.component===e.component}on(e,t){return this.listeners.push({event:e,callback:t}),()=>{this.listeners=this.listeners.filter(n=>n.event!==e&&n.callback!==t)}}fireEventsFor(e){this.listeners.filter(t=>t.event===e).forEach(e=>e.callback())}mergeOncePropsIntoResponse(e,{force:t=!1}={}){Object.entries(e.onceProps??{}).forEach(([n,r])=>{let i=this.page.onceProps?.[n];i!==void 0&&(t||Dr(e.props,r.prop)===void 0)&&(Gr(e.props,r.prop,Dr(this.page.props,i.prop)),e.onceProps[n].expiresAt=i.expiresAt)})}},Xa=class{items=[];processingPromise=null;add(e){return this.items.push(e),this.process()}process(){return this.processingPromise??=this.processNext().finally(()=>{this.processingPromise=null}),this.processingPromise}processNext(){let e=this.items.shift();return e?Promise.resolve(e()).then(()=>this.processNext()):Promise.resolve()}},Za=typeof window>`u`,Qa=new Xa,$a=!Za&&/CriOS/.test(window.navigator.userAgent),eo=class{rememberedState=`rememberedState`;scrollRegions=`scrollRegions`;preserveUrl=!1;current={};initialState=null;remember(e,t){this.replaceState({...H.getWithoutFlashData(),rememberedState:{...H.get()?.rememberedState??{},[t]:e}})}restore(e){if(!Za)return this.current[this.rememberedState]?.[e]===void 0?this.initialState?.[this.rememberedState]?.[e]:this.current[this.rememberedState]?.[e]}pushState(e,t=null){if(!Za){if(this.preserveUrl){t&&t();return}this.current=e,Qa.add(()=>this.getPageData(e).then(n=>{let r=()=>this.doPushState({page:n},e.url).then(()=>t?.());return $a?new Promise(e=>{setTimeout(()=>r().then(e))}):r()}))}}clonePageProps(e){try{return structuredClone(e.props),e}catch{return{...e,props:lr(e.props)}}}getPageData(e){let t=this.clonePageProps(e);return new Promise(n=>e.encryptHistory?ta(t).then(n):n(t))}processQueue(){return Qa.process()}decrypt(e=null){if(Za)return Promise.resolve(e??H.get());let t=e??window.history.state?.page;return this.decryptPageData(t).then(e=>{if(!e)throw Error(`Unable to decrypt history`);return this.initialState===null?this.initialState=e??void 0:this.current=e??{},e})}decryptPageData(e){return e instanceof ArrayBuffer?ra(e):Promise.resolve(e)}saveScrollPositions(e){Qa.add(()=>Promise.resolve().then(()=>{if(window.history.state?.page&&!_r(this.getScrollRegions(),e))return this.doReplaceState({page:window.history.state.page,scrollRegions:e})}))}saveDocumentScrollPosition(e){Qa.add(()=>Promise.resolve().then(()=>{if(window.history.state?.page&&!_r(this.getDocumentScrollPosition(),e))return this.doReplaceState({page:window.history.state.page,documentScrollPosition:e})}))}getScrollRegions(){return window.history.state?.scrollRegions||[]}getDocumentScrollPosition(){return window.history.state?.documentScrollPosition||{top:0,left:0}}replaceState(e,t=null){if(_r(this.current,e)){t&&t();return}let{flash:n,...r}=e;if(H.merge(r),!Za){if(this.preserveUrl){t&&t();return}this.current=e,Qa.add(()=>this.getPageData(e).then(n=>{let r=()=>this.doReplaceState({page:n},e.url).then(()=>t?.());return $a?new Promise(e=>{setTimeout(()=>r().then(e))}):r()}))}}isHistoryThrottleError(e){return e instanceof Error&&e.name===`SecurityError`&&(e.message.includes(`history.pushState`)||e.message.includes(`history.replaceState`))}isQuotaExceededError(e){return e instanceof Error&&e.name===`QuotaExceededError`}withThrottleProtection(e){return Promise.resolve().then(()=>{try{return e()}catch(e){if(!this.isHistoryThrottleError(e))throw e;console.error(e.message)}})}doReplaceState(e,t){return this.withThrottleProtection(()=>{window.history.replaceState({...e,scrollRegions:e.scrollRegions??window.history.state?.scrollRegions,documentScrollPosition:e.documentScrollPosition??window.history.state?.documentScrollPosition},``,t)})}doPushState(e,t){return this.withThrottleProtection(()=>{try{window.history.pushState(e,``,t)}catch(e){if(!this.isQuotaExceededError(e))throw e;to.fireInternalEvent(`historyQuotaExceeded`,t)}})}getState(e,t){return this.current?.[e]??t}deleteState(e){this.current[e]!==void 0&&(delete this.current[e],this.replaceState(this.current))}clearInitialState(e){this.initialState&&this.initialState[e]!==void 0&&delete this.initialState[e]}browserHasHistoryEntry(){return!Za&&!!window.history.state?.page}clear(){ea.remove(na.key),ea.remove(na.iv)}setCurrent(e){this.current=e}isValidState(e){return!!e.page}getAllState(){return this.current}};typeof window<`u`&&window.history.scrollRestoration&&(window.history.scrollRestoration=`manual`);var U=new eo,to=new class{internalListeners=[];init(){typeof window<`u`&&(window.addEventListener(`popstate`,this.handlePopstateEvent.bind(this)),window.addEventListener(`pageshow`,this.handlePageshowEvent.bind(this)),window.addEventListener(`scroll`,Li(wa.onWindowScroll.bind(wa),100),!0)),typeof document<`u`&&document.addEventListener(`scroll`,Li(wa.onScroll.bind(wa),100),!0)}onGlobalEvent(e,t){return this.registerListener(`inertia:${e}`,(e=>{let n=t(e);e.cancelable&&!e.defaultPrevented&&n===!1&&e.preventDefault()}))}on(e,t){return this.internalListeners.push({event:e,listener:t}),()=>{this.internalListeners=this.internalListeners.filter(e=>e.listener!==t)}}onMissingHistoryItem(){H.clear(),this.fireInternalEvent(`missingHistoryItem`)}fireInternalEvent(e,...t){this.internalListeners.filter(t=>t.event===e).forEach(e=>e.listener(...t))}registerListener(e,t){return document.addEventListener(e,t),()=>document.removeEventListener(e,t)}handlePageshowEvent(e){e.persisted&&U.decrypt().catch(()=>this.onMissingHistoryItem())}handlePopstateEvent(e){let t=e.state||null;if(t===null){let e=za(H.get().url);e.hash=window.location.hash,U.replaceState({...H.getWithoutFlashData(),url:e.href}),wa.reset();return}if(!U.isValidState(t))return this.onMissingHistoryItem();U.decrypt(t.page).then(e=>{if(H.get().version!==e.version){this.onMissingHistoryItem();return}G.cancelAll({prefetch:!1}),H.setQuietly(e,{preserveState:!1}).then(()=>{wa.restore(U.getScrollRegions()),Gi(H.get());let t={},n=H.get().props;for(let[r,i]of Object.entries(e.initialDeferredProps??e.deferredProps??{})){let e=i.filter(e=>Dr(n,e)===void 0);e.length>0&&(t[r]=e)}Object.keys(t).length>0&&this.fireInternalEvent(`loadDeferredProps`,t)})}).catch(()=>{this.onMissingHistoryItem()})}},no=new class{type;constructor(){this.type=this.resolveType()}resolveType(){return typeof window>`u`?`navigate`:window.performance?.getEntriesByType(`navigation`)[0]?.type??`navigate`}get(){return this.type}isBackForward(){return this.type===`back_forward`}isReload(){return this.type===`reload`}};function ro(){let e=typeof window<`u`?window.crypto:void 0;if(e?.randomUUID)return e.randomUUID();let t=()=>e?.getRandomValues?e.getRandomValues(new Uint8Array(1))[0]:Math.floor(Math.random()*256);return`10000000-1000-4000-8000-100000000000`.replace(/[018]/g,e=>(e^t()&15>>e/4).toString(16))}var io=class{static handle(){this.clearRememberedStateOnReload(),[this.handleBackForward,this.handleLocation,this.handleDefault].find(e=>e.bind(this)())}static clearRememberedStateOnReload(){no.isReload()&&(U.deleteState(U.rememberedState),U.clearInitialState(U.rememberedState))}static handleBackForward(){if(!no.isBackForward()||!U.browserHasHistoryEntry())return!1;let e=U.getScrollRegions();return U.decrypt().then(t=>{let n=ro();H.set(t,{preserveScroll:!0,preserveState:!0,visitId:n}).then(()=>{wa.restore(e),Gi(H.get(),{visitId:n})})}).catch(()=>{to.onMissingHistoryItem()}),!0}static handleLocation(){if(!ea.exists(ea.locationVisitKey))return!1;let e=ea.get(ea.locationVisitKey)||{};return ea.remove(ea.locationVisitKey),typeof window<`u`&&H.setUrlHash(window.location.hash),U.decrypt(H.get()).then(()=>{let t=ro(),n=U.getState(U.rememberedState,{}),r=U.getScrollRegions();H.remember(n),H.set(H.get(),{preserveScroll:e.preserveScroll,preserveState:!0,visitId:t}).then(()=>{e.preserveScroll&&wa.restore(r),this.fireInitialEvents(t)})}).catch(()=>{to.onMissingHistoryItem()}),!0}static handleDefault(){typeof window<`u`&&H.setUrlHash(window.location.hash);let e=ro();H.set(H.get(),{preserveScroll:!0,preserveState:!0,visitId:e}).then(()=>{no.isReload()?wa.restore(U.getScrollRegions()):wa.scrollToAnchor(),this.fireInitialEvents(e)})}static fireInitialEvents(e){let t=H.get();Gi(t,{visitId:e}),Object.keys(t.flash).length>0&&queueMicrotask(()=>Qi(t.flash))}},ao=class{intervalId=null;timeoutId=null;throttle=!1;keepAlive=!1;cb;interval;cbCount=0;mode;inFlight=!1;currentCancel=null;stopped=!0;instanceId=0;constructor(e,t,n){this.keepAlive=n.keepAlive??!1,this.mode=n.mode??`overlap`,this.cb=t,this.interval=e,(n.autoStart??!0)&&this.start()}stop(){this.stopped=!0,this.instanceId++,this.inFlight=!1,this.currentCancel=null,this.intervalId&&=(clearInterval(this.intervalId),null),this.timeoutId&&=(clearTimeout(this.timeoutId),null)}start(){if(!(typeof window>`u`)){if(this.stop(),this.stopped=!1,this.mode===`rest`){this.scheduleNext();return}this.intervalId=window.setInterval(()=>this.tick(),this.interval)}}isInBackground(e){this.throttle=!this.keepAlive&&e,this.throttle&&(this.cbCount=0)}scheduleNext(){this.stopped||(this.timeoutId=window.setTimeout(()=>{this.timeoutId=null,this.tick()},this.interval))}tick(){!this.throttle||this.cbCount%10==0?this.fire():this.mode===`rest`&&this.scheduleNext(),this.throttle&&this.cbCount++}fire(){this.inFlight&&this.mode===`cancel`&&this.currentCancel?.();let e=this.instanceId;this.cb({onStart:t=>{e===this.instanceId&&(this.inFlight=!0,this.currentCancel=t)},onFinish:()=>{e===this.instanceId&&(this.inFlight=!1,this.currentCancel=null,this.mode===`rest`&&this.scheduleNext())}})}},oo=new class{polls=[];constructor(){this.setupVisibilityListener()}get count(){return this.polls.length}add(e,t,n){let r=new ao(e,t,n);return this.polls.push(r),{stop:()=>r.stop(),start:()=>r.start(),destroy:()=>{r.stop(),this.polls=this.polls.filter(e=>e!==r)}}}clear(){this.polls.forEach(e=>e.stop()),this.polls=[]}setupVisibilityListener(){typeof document>`u`||document.addEventListener(`visibilitychange`,()=>{this.polls.forEach(e=>e.isInBackground(document.hidden))},!1)}},so=new class{requestHandlers=[];responseHandlers=[];errorHandlers=[];onRequest(e){return this.requestHandlers.push(e),()=>{this.requestHandlers=this.requestHandlers.filter(t=>t!==e)}}onResponse(e){return this.responseHandlers.push(e),()=>{this.responseHandlers=this.responseHandlers.filter(t=>t!==e)}}onError(e){return this.errorHandlers.push(e),()=>{this.errorHandlers=this.errorHandlers.filter(t=>t!==e)}}async processRequest(e){let t=e;for(let e of this.requestHandlers)t=await e(t);return t}async processResponse(e){let t=e;for(let e of this.responseHandlers)t=await e(t);return t}async processError(e){for(let t of this.errorHandlers)await t(e)}},W=class extends Error{code;url;constructor(e,t,n){super(n?`${e} (${n})`:e),this.name=`HttpError`,this.code=t,this.url=n}},co=class extends W{response;constructor(e,t,n){super(e,`ERR_HTTP_RESPONSE`,n),this.name=`HttpResponseError`,this.response=t}},lo=class extends W{constructor(e=`Request was cancelled`,t){super(e,`ERR_CANCELLED`,t),this.name=`HttpCancelledError`}},uo=class extends W{cause;constructor(e,t,n){super(e,`ERR_NETWORK`,t),this.name=`HttpNetworkError`,this.cause=n}};function fo(e){let t=document.cookie.match(RegExp(`(^|;\\s*)(`+e+`)=([^;]*)`));return t?decodeURIComponent(t[3]):null}function po(e){let t={};return e.getAllResponseHeaders().split(`\r
3
- `).forEach(e=>{let n=e.indexOf(`:`);n>0&&(t[e.slice(0,n).toLowerCase().trim()]=e.slice(n+1).trim())}),t}function mo(e){return typeof FormData<`u`&&e instanceof FormData}function ho(e){return typeof e==`string`||mo(e)||typeof Blob<`u`&&e instanceof Blob||typeof ArrayBuffer<`u`&&e instanceof ArrayBuffer||typeof ArrayBuffer<`u`&&ArrayBuffer.isView(e)||typeof URLSearchParams<`u`&&e instanceof URLSearchParams}function go(e,t){if(!t.headers)return;let n=mo(t.data);Object.entries(t.headers).forEach(([t,r])=>{(t.toLowerCase()!==`content-type`||!n)&&e.setRequestHeader(t,String(r))})}function _o(e,t){if(!t||Object.keys(t).length===0)return e;let[n]=Va(`get`,e,t);return n}var vo=class{xsrfCookieName;xsrfHeaderName;constructor(e={}){this.xsrfCookieName=e.xsrfCookieName??`XSRF-TOKEN`,this.xsrfHeaderName=e.xsrfHeaderName??`X-XSRF-TOKEN`}async request(e){let t=await so.processRequest(e);try{let e=await this.doRequest(t);return await so.processResponse(e)}catch(e){throw(e instanceof co||e instanceof uo||e instanceof lo)&&await so.processError(e),e}}doRequest(e){return new Promise((t,n)=>{let r=new XMLHttpRequest,i=_o(e.url,e.params);r.open(e.method.toUpperCase(),i,!0);let a=fo(this.xsrfCookieName);a&&r.setRequestHeader(this.xsrfHeaderName,a),Object.keys(e.headers??{}).some(e=>e.toLowerCase()===`x-requested-with`)||r.setRequestHeader(`X-Requested-With`,`XMLHttpRequest`);let o=null;e.data!==null&&e.data!==void 0&&(ho(e.data)?o=e.data:typeof e.data==`object`?(o=JSON.stringify(e.data),!e.headers?.[`Content-Type`]&&!e.headers?.[`content-type`]&&r.setRequestHeader(`Content-Type`,`application/json`)):o=String(e.data)),go(r,e),e.onUploadProgress&&(r.upload.onprogress=t=>{let n=t.lengthComputable?t.loaded/t.total:void 0;e.onUploadProgress({progress:n,percentage:n?Math.round(n*100):0,loaded:t.loaded,total:t.lengthComputable?t.total:void 0})}),e.signal&&e.signal.addEventListener(`abort`,()=>r.abort()),r.onabort=()=>n(new lo(`Request was cancelled`,e.url)),r.onerror=()=>n(new uo(`Network error`,e.url)),r.onload=()=>{let i={status:r.status,data:r.responseText,headers:po(r)};r.status>=400?n(new co(`Request failed with status ${r.status}`,i,e.url)):t(i)},r.send(o)})}},yo=new vo;function bo(e){return!(`request`in e)}var xo={getClient(){return yo},setClient(e){if(!bo(e)){yo=e;return}yo=new vo(e),e.xsrfCookieName&&vi.withXsrfCookieName(e.xsrfCookieName),e.xsrfHeaderName&&vi.withXsrfHeaderName(e.xsrfHeaderName)},onRequest:so.onRequest.bind(so),onResponse:so.onResponse.bind(so),onError:so.onError.bind(so),processRequest:so.processRequest.bind(so),processResponse:so.processResponse.bind(so),processError:so.processError.bind(so)},So=new class{requestHandlers=[];responseHandlers=[];onVisitRequest(e){return this.requestHandlers.push(e),()=>{this.requestHandlers=this.requestHandlers.filter(t=>t!==e)}}onVisitResponse(e){return this.responseHandlers.push(e),()=>{this.responseHandlers=this.responseHandlers.filter(t=>t!==e)}}async processRequest(e,t){let n=t;for(let t of this.requestHandlers)n=await t(e,n);return n}async processResponse(e,t){let n=t;for(let t of this.responseHandlers)n=await t(e,n);return n}};function Co(){typeof window>`u`||(window.__inertia_interceptors__=So)}var wo=class e{callbacks=[];params;constructor(e){if(!e.prefetch)this.params=e;else{let t={onBefore:this.wrapCallback(e,`onBefore`),onBeforeUpdate:this.wrapCallback(e,`onBeforeUpdate`),onStart:this.wrapCallback(e,`onStart`),onProgress:this.wrapCallback(e,`onProgress`),onFinish:this.wrapCallback(e,`onFinish`),onCancel:this.wrapCallback(e,`onCancel`),onSuccess:this.wrapCallback(e,`onSuccess`),onError:this.wrapCallback(e,`onError`),onHttpException:this.wrapCallback(e,`onHttpException`),onNetworkError:this.wrapCallback(e,`onNetworkError`),onFlash:this.wrapCallback(e,`onFlash`),onCancelToken:this.wrapCallback(e,`onCancelToken`),onPrefetched:this.wrapCallback(e,`onPrefetched`),onPrefetching:this.wrapCallback(e,`onPrefetching`)};this.params={...e,...t,onPrefetchResponse:e.onPrefetchResponse||(()=>{}),onPrefetchError:e.onPrefetchError||(()=>{})}}}static create(t){return new e(t)}data(){return this.params.method===`get`?null:this.params.data}queryParams(){return this.params.method===`get`?this.params.data:{}}isPartial(){return this.params.only.length>0||this.params.except.length>0||this.params.reset.length>0}isPrefetch(){return this.params.prefetch===!0}isDeferredPropsRequest(){return this.params.deferredProps===!0}isPollRequest(){return this.params.poll===!0}onCancelToken(e){this.params.onCancelToken({cancel:e})}markAsFinished(){this.params.completed=!0,this.params.cancelled=!1,this.params.interrupted=!1}markAsCancelled({cancelled:e=!0,interrupted:t=!1}){this.params.onCancel(),this.params.completed=!1,this.params.cancelled=e,this.params.interrupted=t}wasCancelledAtAll(){return this.params.cancelled||this.params.interrupted}onFinish(){this.params.onFinish(this.params)}onStart(){this.params.onStart(this.params)}onPrefetching(){this.params.onPrefetching(this.params)}onPrefetchResponse(e){this.params.onPrefetchResponse&&this.params.onPrefetchResponse(e)}onPrefetchError(e){this.params.onPrefetchError&&this.params.onPrefetchError(e)}all(){return this.params}headers(){let e={...this.params.headers};this.isPartial()&&(e[`X-Inertia-Partial-Component`]=H.get().component);let t=this.params.only.concat(this.params.reset);return t.length>0&&(e[`X-Inertia-Partial-Data`]=t.join(`,`)),this.params.except.length>0&&(e[`X-Inertia-Partial-Except`]=this.params.except.join(`,`)),this.params.reset.length>0&&(e[`X-Inertia-Reset`]=this.params.reset.join(`,`)),this.params.errorBag&&this.params.errorBag.length>0&&(e[`X-Inertia-Error-Bag`]=this.params.errorBag),e}setPreserveOptions(t){this.params.preserveScroll=e.resolvePreserveOption(this.params.preserveScroll,t),this.params.preserveState=e.resolvePreserveOption(this.params.preserveState,t)}runCallbacks(){this.callbacks.forEach(({name:e,args:t})=>{this.params[e](...t)})}merge(e){this.params={...this.params,...e}}wrapCallback(e,t){return(...n)=>{this.recordCallback(t,n),e[t](...n)}}recordCallback(e,t){this.callbacks.push({name:e,args:t})}static resolvePreserveOption(e,t){return typeof e==`function`?e(t):e===`errors`?Object.keys(t.props.errors||{}).length>0:e}},To={createIframeAndPage(e){typeof e==`object`&&(e=`All Inertia requests must receive a valid Inertia response, however a plain JSON response was received.<hr>${JSON.stringify(e)}`);let t=document.createElement(`html`);t.innerHTML=e,t.querySelectorAll(`a`).forEach(e=>e.setAttribute(`target`,`_top`));let n=document.createElement(`iframe`);return n.style.backgroundColor=`white`,n.style.borderRadius=`5px`,n.style.width=`100%`,n.style.height=`100%`,n.setAttribute(`sandbox`,`allow-scripts`),{iframe:n,page:t}},show(e){let{iframe:t,page:n}=this.createIframeAndPage(e);t.style.boxSizing=`border-box`,t.style.display=`block`;let r=document.createElement(`dialog`);r.id=`inertia-error-dialog`,Object.assign(r.style,{width:`calc(100vw - 100px)`,height:`calc(100vh - 100px)`,padding:`0`,margin:`auto`,border:`none`,backgroundColor:`transparent`});let i=document.createElement(`style`);i.textContent=`
4
- dialog#inertia-error-dialog::backdrop {
5
- background-color: rgba(0, 0, 0, 0.6);
6
- }
7
-
8
- dialog#inertia-error-dialog:focus {
9
- outline: none;
10
- }
11
- `;let a=Ii.get(`nonce`);a&&(i.nonce=a),document.head.appendChild(i),r.addEventListener(`click`,e=>{e.target===r&&r.close()}),r.addEventListener(`close`,()=>{i.remove(),r.remove()}),r.appendChild(t),document.body.prepend(r),r.showModal(),r.focus(),t.srcdoc=n.outerHTML}},Eo=(e,t)=>e===t||e.startsWith(`${t}.`),Do=(e,t)=>{let{only:n,except:r}=e;return!(n.length===0&&r.length===0||n.length>0&&!n.some(e=>Eo(t,e))||r.length>0&&r.some(e=>Eo(t,e)))},Oo=new Xa,ko=class e{constructor(e,t,n){this.requestParams=e,this.response=t,this.originatingPage=n}requestParams;response;originatingPage;wasPrefetched=!1;processed=!1;static create(t,n,r){return new e(t,n,r)}isProcessed(){return this.processed}async handlePrefetch(){Wa(this.requestParams.all().url,window.location)&&this.handle()}async handle(){return Oo.add(()=>this.process())}async process(){if(this.requestParams.all().prefetch)return this.wasPrefetched=!0,this.requestParams.all().prefetch=!1,this.requestParams.all().onPrefetched(this.response,this.requestParams.all()),Xi(this.response,this.requestParams.all()),Promise.resolve();if(this.requestParams.runCallbacks(),this.processed=!0,!this.isInertiaResponse())return this.handleNonInertiaResponse();if(this.isHttpException()){let e={...this.response,data:this.getDataFromResponse(this.response.data)};if(this.requestParams.all().onHttpException(e)===!1||!Ui(e))return}await U.processQueue(),U.preserveUrl=this.requestParams.all().preserveUrl,await this.setPage();let{flash:e}=H.get();Object.keys(e).length>0&&!this.requestParams.isDeferredPropsRequest()&&(Qi(e),this.requestParams.all().onFlash(e));let t=H.get().props.errors||{};if(Object.keys(t).length>0){let e=this.getScopedErrors(t);return Bi(e,{page:H.get(),visitId:this.requestParams.all().id}),this.requestParams.all().onError(e)}G.flushByCacheTags(this.requestParams.all().invalidateCacheTags||[]),this.wasPrefetched||G.flush(H.get().url),Yi(H.get(),{visitId:this.requestParams.all().id}),await this.requestParams.all().onSuccess(H.get()),U.preserveUrl=!1}mergeParams(e){this.requestParams.merge(e)}getPageResponse(){let e=this.getDataFromResponse(this.response.data);return typeof e==`object`?this.response.data={...e,flash:e.flash??{},rescuedProps:e.rescuedProps??[]}:this.response.data=e}async handleNonInertiaResponse(){if(this.isInertiaRedirect()){G.visit(this.getHeader(`x-inertia-redirect`),{...this.requestParams.all(),method:`get`,data:{}});return}if(this.isLocationVisit()){let e=za(this.getHeader(`x-inertia-location`));return Ua(this.requestParams.all().url,e),this.locationVisit(e)}let e={...this.response,data:this.getDataFromResponse(this.response.data)};if(this.requestParams.all().onHttpException(e)!==!1&&Ui(e))return To.show(e.data)}isInertiaResponse(){return this.hasHeader(`x-inertia`)}isHttpException(){return this.response.status>=400}hasStatus(e){return this.response.status===e}getHeader(e){return this.response.headers[e]}hasHeader(e){return this.getHeader(e)!==void 0}isInertiaRedirect(){return this.hasStatus(409)&&this.hasHeader(`x-inertia-redirect`)}isLocationVisit(){return this.hasStatus(409)&&this.hasHeader(`x-inertia-location`)}locationVisit(e){try{if(typeof window>`u`)return;let t=this.getHeader(`x-inertia-version`),n=!!t&&t!==H.get().version;if(!$i(e,n)||n&&this.requestParams.all().async)return;ea.set(ea.locationVisitKey,{preserveScroll:this.requestParams.all().preserveScroll===!0}),Wa(window.location,e)?window.location.reload():window.location.href=e.href}catch{return!1}}async setPage(){let e=this.getPageResponse();return this.shouldSetPage(e)?(this.response=await So.processResponse(this.requestParams.all(),this.response),this.mergeProps(e),H.mergeOncePropsIntoResponse(e),this.preserveOptimisticProps(e),this.preserveEqualProps(e),await this.setRememberedState(e),this.requestParams.setPreserveOptions(e),e.url=U.preserveUrl?H.get().url:this.pageUrl(e),this.requestParams.all().onBeforeUpdate(e),Wi(e),H.set(e,{replace:this.requestParams.all().replace,preserveScroll:this.requestParams.all().preserveScroll,preserveState:this.requestParams.all().preserveState,viewTransition:this.requestParams.all().viewTransition,cached:this.requestParams.all().cached,visitId:this.requestParams.all().id})):Promise.resolve()}getDataFromResponse(e){if(typeof e!=`string`)return e;try{return JSON.parse(e)}catch{return e}}shouldSetPage(e){if(!this.requestParams.all().async||this.originatingPage.component!==e.component)return!0;if(this.originatingPage.component!==H.get().component)return!1;let t=za(this.originatingPage.url),n=za(H.get().url);return t.origin===n.origin&&t.pathname===n.pathname}pageUrl(e){let t=za(e.url);return e.preserveFragment?t.hash=this.requestParams.all().url.hash:Ua(this.requestParams.all().url,t),t.pathname+t.search+t.hash}preserveOptimisticProps(e){if(G.hasPendingOptimistic())for(let t of Object.keys(e.props))H.hasBaseline(t)&&(H.updateBaseline(t,e.props[t]),e.props[t]=H.get().props[t])}preserveEqualProps(e){if(e.component!==H.get().component)return;let t=H.get().props;Object.entries(e.props).forEach(([n,r])=>{_r(r,t[n])&&(e.props[n]=t[n])})}mergeProps(e){if(!this.requestParams.isPartial()||e.component!==H.get().component)return;let t=e.mergeProps||[],n=e.prependProps||[],r=e.deepMergeProps||[],i=e.matchPropsOn||[],a=(t,n)=>{let r=Dr(H.get().props,t),a=Dr(e.props,t);if(Array.isArray(a)){let o=this.mergeOrMatchItems(r||[],a,t,i,n);Gr(e.props,t,o)}else if(typeof a==`object`&&a){let n={...r||{},...a};Gr(e.props,t,n)}};t.forEach(e=>a(e,!0)),n.forEach(e=>a(e,!1)),r.forEach(t=>{let n=Dr(H.get().props,t),r=Dr(e.props,t),a=(e,t,n)=>Array.isArray(t)?this.mergeOrMatchItems(e,t,n,i):typeof t==`object`&&t?Object.keys(t).reduce((r,i)=>(r[i]=a(e?e[i]:void 0,t[i],`${n}.${i}`),r),{...e}):t;Gr(e.props,t,a(n,r,t))});let o=new Set([...this.requestParams.all().only,...this.requestParams.all().except].filter(e=>e.includes(`.`)).map(e=>e.split(`.`)[0]));for(let t of o){let n=H.get().props[t];this.isObject(n)&&this.isObject(e.props[t])&&(e.props[t]=this.deepMergeObjects(n,e.props[t]))}e.props={...H.get().props,...e.props},this.shouldPreserveErrors(e)&&(e.props.errors=H.get().props.errors),H.get().scrollProps&&(e.scrollProps={...H.get().scrollProps||{},...e.scrollProps||{}}),H.hasOnceProps()&&(e.onceProps={...H.get().onceProps||{},...e.onceProps||{}}),this.requestParams.isDeferredPropsRequest()&&(e.flash={...H.get().flash});let s=H.get().initialDeferredProps;s&&Object.keys(s).length>0&&(e.initialDeferredProps=s),e.rescuedProps=this.mergeRescuedProps(e)}mergeRescuedProps(e){let t=H.get().rescuedProps??[],n=e.rescuedProps??[],r=new Set(t.filter(e=>!Do(this.requestParams.all(),e)));return n.forEach(e=>r.add(e)),Array.from(r)}shouldPreserveErrors(e){if(!this.requestParams.all().preserveErrors)return!1;let t=H.get().props.errors;if(!t||Object.keys(t).length===0)return!1;let n=e.props.errors;return!(n&&Object.keys(n).length>0)}isObject(e){return e&&typeof e==`object`&&!Array.isArray(e)}deepMergeObjects(e,t){let n={...e};for(let r of Object.keys(t)){let i=e[r],a=t[r];n[r]=this.isObject(i)&&this.isObject(a)?this.deepMergeObjects(i,a):a}return n}mergeOrMatchItems(e,t,n,r,i=!0){let a=Array.isArray(e)?e:[],o=r.find(e=>e.split(`.`).slice(0,-1).join(`.`)===n);if(!o)return i?[...a,...t]:[...t,...a];let s=o.split(`.`).pop()||``,c=new Map;return t.forEach(e=>{this.hasUniqueProperty(e,s)&&c.set(e[s],e)}),i?this.appendWithMatching(a,t,c,s):this.prependWithMatching(a,t,c,s)}appendWithMatching(e,t,n,r){let i=e.map(e=>this.hasUniqueProperty(e,r)&&n.has(e[r])?n.get(e[r]):e),a=t.filter(t=>!this.hasUniqueProperty(t,r)||!e.some(e=>this.hasUniqueProperty(e,r)&&e[r]===t[r]));return[...i,...a]}prependWithMatching(e,t,n,r){let i=e.filter(e=>!this.hasUniqueProperty(e,r)||!n.has(e[r]));return[...t,...i]}hasUniqueProperty(e,t){return e&&typeof e==`object`&&t in e}async setRememberedState(e){let t=await U.getState(U.rememberedState,{});this.requestParams.all().preserveState&&t&&e.component===H.get().component&&(e.rememberedState=t)}getScopedErrors(e){return this.requestParams.all().errorBag?e[this.requestParams.all().errorBag||``]||{}:e}},Ao=class e{constructor(e,t,{optimistic:n=!1}={}){this.page=t,this.requestParams=wo.create(e),this.cancelToken=new AbortController,this.optimistic=n}page;response;cancelToken;requestParams;requestHasFinished=!1;optimistic;static create(t,n,r){return new e(t,n,r)}isPrefetch(){return this.requestParams.isPrefetch()}isOptimistic(){return this.optimistic}isPendingOptimistic(){return this.isOptimistic()&&(!this.response||!this.response.isProcessed())}async send(){this.requestParams.onCancelToken(()=>this.cancel({cancelled:!0})),Ji(this.requestParams.all()),this.requestParams.onStart(),this.requestParams.all().prefetch&&(this.requestParams.onPrefetching(),Zi(this.requestParams.all()));let e=this.requestParams.all().prefetch,t={method:this.requestParams.all().method,url:Ha(this.requestParams.all().url).href,data:this.requestParams.data(),signal:this.cancelToken.signal,headers:this.getHeaders(),onUploadProgress:this.onProgress.bind(this)},n=await So.processRequest(this.requestParams.all(),t);return xo.getClient().request(n).then(e=>(this.response=ko.create(this.requestParams,e,this.page),this.response.handle())).catch(e=>e instanceof co?(this.response=ko.create(this.requestParams,e.response,this.page),this.response.handle()):Promise.reject(e)).catch(t=>{if(!(t instanceof lo)&&this.requestParams.all().onNetworkError(t)!==!1&&Vi(t))return e&&this.requestParams.onPrefetchError(t),Promise.reject(t)}).finally(()=>{this.finish(),e&&this.response&&this.requestParams.onPrefetchResponse(this.response)})}finish(){this.requestParams.wasCancelledAtAll()||(this.requestParams.markAsFinished(),this.fireFinishEvents())}fireFinishEvents(){this.requestHasFinished||(this.requestHasFinished=!0,Hi(this.requestParams.all()),this.requestParams.onFinish())}cancel({cancelled:e=!1,interrupted:t=!1}){this.requestHasFinished||(this.cancelToken.abort(),this.requestParams.markAsCancelled({cancelled:e,interrupted:t}),this.fireFinishEvents())}onProgress(e){this.requestParams.data()instanceof FormData&&(qi(e),this.requestParams.all().onProgress(e))}getHeaders(){let e={...this.requestParams.headers(),Accept:`text/html, application/xhtml+xml`,"X-Requested-With":`XMLHttpRequest`,"X-Inertia":!0},t=H.get();t.version&&(e[`X-Inertia-Version`]=t.version);let n=Object.entries(t.onceProps||{}).filter(([,e])=>Dr(t.props,e.prop)===void 0?!1:!e.expiresAt||e.expiresAt>Date.now()).map(([e])=>e);return n.length>0&&(e[`X-Inertia-Except-Once-Props`]=n.join(`,`)),e}},jo=class{requests=[];maxConcurrent;interruptible;constructor({maxConcurrent:e,interruptible:t}){this.maxConcurrent=e,this.interruptible=t}send(e){this.requests.push(e),e.send().finally(()=>{this.requests=this.requests.filter(t=>t!==e)})}interruptInFlight(){this.cancel({interrupted:!0},!1)}cancelInFlight({prefetch:e=!0,optimistic:t=!0}={}){this.requests.filter(t=>e||!t.isPrefetch()).filter(e=>t||!e.isOptimistic()).forEach(e=>e.cancel({cancelled:!0}))}cancel({cancelled:e=!1,interrupted:t=!1}={},n=!1){!n&&!this.shouldCancel()||this.requests.shift()?.cancel({cancelled:e,interrupted:t})}shouldCancel(){return this.interruptible&&this.requests.length>=this.maxConcurrent}hasPendingOptimistic(){return this.requests.some(e=>e.isPendingOptimistic())}},Mo=()=>{},No=class{syncRequestStream=new jo({maxConcurrent:1,interruptible:!0});asyncRequestStream=new jo({maxConcurrent:1/0,interruptible:!1});clientVisitQueue=new Xa;pendingOptimisticCallback=void 0;init({initialPage:e,resolveComponent:t,swapComponent:n,onFlash:r}){H.init({initialPage:e,resolveComponent:t,swapComponent:n,onFlash:r}),io.handle(),to.init(),to.on(`missingHistoryItem`,()=>{typeof window<`u`&&this.visit(window.location.href,{preserveState:!0,preserveScroll:!0,replace:!0})}),to.on(`loadDeferredProps`,e=>{this.loadDeferredProps(e)}),to.on(`historyQuotaExceeded`,e=>{window.location.href=e})}optimistic(e){return this.pendingOptimisticCallback=e,this}get(e,t={},n={}){return this.visit(e,{...n,method:`get`,data:t})}post(e,t={},n={}){return this.visit(e,{preserveState:!0,...n,method:`post`,data:t})}put(e,t={},n={}){return this.visit(e,{preserveState:!0,...n,method:`put`,data:t})}patch(e,t={},n={}){return this.visit(e,{preserveState:!0,...n,method:`patch`,data:t})}delete(e,t={}){return this.visit(e,{preserveState:!0,...t,method:`delete`})}reload(e={}){return this.doReload(e)}doReload(e={}){if(!(typeof window>`u`))return this.visit(window.location.href,{...e,preserveScroll:!0,preserveState:!0,async:!0,headers:{...e.headers||{},"Cache-Control":`no-cache`}})}remember(e,t=`default`){U.remember(e,t)}restore(e=`default`){return U.restore(e)}on(e,t){return typeof window>`u`?()=>{}:to.onGlobalEvent(e,t)}once(e,t){if(typeof window>`u`)return()=>{};let n=this.on(e,e=>(n(),t(e)));return n}hasPendingOptimistic(){return this.asyncRequestStream.hasPendingOptimistic()}get activePolls(){return oo.count}cancelAll({async:e=!0,prefetch:t=!0,sync:n=!0}={}){e&&this.asyncRequestStream.cancelInFlight({prefetch:t}),n&&this.syncRequestStream.cancelInFlight()}poll(e,t={},n={}){return oo.add(e,({onStart:e,onFinish:n})=>{let r=typeof t==`function`?t():t;this.doReload({poll:!0,preserveErrors:!0,...r,onCancelToken:t=>{e(t.cancel),r.onCancelToken?.(t)},onFinish:e=>{n(),r.onFinish?.(e)}})},{autoStart:n.autoStart??!0,keepAlive:n.keepAlive??!1,mode:n.mode})}visit(e,t={}){t.optimistic=t.optimistic??this.pendingOptimisticCallback,this.pendingOptimisticCallback=void 0,t.optimistic&&(t.async=t.async??!0);let n=this.getPendingVisit(e,{...t,showProgress:t.showProgress??(!t.async||!!t.optimistic)}),r=this.getVisitEvents(t);if(r.onBefore(n)===!1||!zi(n))return;let i=za(H.get().url);(n.only.length>0||n.except.length>0||n.reset.length>0?Ga(n.url,i):Wa(n.url,i))||this.asyncRequestStream.cancelInFlight({prefetch:!1,optimistic:!1}),n.async||this.syncRequestStream.interruptInFlight(),t.optimistic&&this.applyOptimisticUpdate(t.optimistic,r),!H.isCleared()&&!n.preserveUrl&&wa.save();let a={...n,...r},o=()=>{let e=ga.get(a);e?(Bs.reveal(e.inFlight),ga.use(e,a)):(Bs.reveal(!0),(n.async?this.asyncRequestStream:this.syncRequestStream).send(Ao.create(a,H.get(),{optimistic:!!t.optimistic})))};Array.isArray(n.component)&&(console.error(`The "component" prop received an array of components (${n.component.join(`, `)}), but only a single component string is supported for instant visits. Pass an explicit component name instead.`),n.component=null),n.component?U.processQueue().then(()=>{this.performInstantSwap(n).then(()=>{a.preserveScroll=!0,a.preserveState=!0,a.replace=!0,a.viewTransition=!1,o()})}):o()}getCached(e,t={}){return ga.findCached(this.getPrefetchParams(e,t))}flush(e,t={}){ga.remove(this.getPrefetchParams(e,t))}flushAll(){ga.removeAll()}flushByCacheTags(e){ga.removeByTags(Array.isArray(e)?e:[e])}getPrefetching(e,t={}){return ga.findInFlight(this.getPrefetchParams(e,t))}prefetch(e,t={},n={}){if((t.method??(Ka(e)?e.method:`get`))!==`get`)throw Error(`Prefetch requests must use the GET method`);let r=this.getPendingVisit(e,{...t,async:!0,showProgress:!1,prefetch:!0,viewTransition:!1});if(r.url.origin+r.url.pathname+r.url.search===window.location.origin+window.location.pathname+window.location.search)return;let i=this.getVisitEvents(t);if(i.onBefore(r)===!1||!zi(r))return;Bs.hide(),this.asyncRequestStream.interruptInFlight();let a={...r,...i};new Promise(e=>{let t=()=>{H.get()?e():setTimeout(t,50)};t()}).then(()=>{ga.add(a,e=>{this.asyncRequestStream.send(Ao.create(e,H.get()))},{cacheFor:Ii.get(`prefetch.cacheFor`),cacheTags:[],...n})})}clearHistory(){U.clear()}decryptHistory(){return U.decrypt()}resolveComponent(e,t){return H.resolve(e,t)}replace(e){this.clientVisit(e,{replace:!0})}replaceProp(e,t,n){this.replace({preserveScroll:!0,preserveState:!0,props(n){let r=typeof t==`function`?t(Dr(n,e),n):t;return Gr(lr(n),e,r)},...n||{}})}appendToProp(e,t,n){this.replaceProp(e,(e,n)=>{let r=typeof t==`function`?t(e,n):t;return Array.isArray(e)||(e=e===void 0?[]:[e]),[...e,r]},n)}prependToProp(e,t,n){this.replaceProp(e,(e,n)=>{let r=typeof t==`function`?t(e,n):t;return Array.isArray(e)||(e=e===void 0?[]:[e]),[r,...e]},n)}push(e){this.clientVisit(e)}flash(e,t){let n=H.get().flash,r;if(typeof e==`function`)r=e(n);else if(typeof e==`string`)r={...n,[e]:t};else if(e&&Object.keys(e).length)r={...n,...e};else return;H.setFlash(r),Object.keys(r).length&&Qi(r)}clientVisit(e,{replace:t=!1}={}){this.clientVisitQueue.add(()=>this.performClientVisit(e,{replace:t}))}performClientVisit(e,{replace:t=!1}={}){let n=H.get(),r=typeof e.props==`function`?Object.fromEntries(Object.values(n.onceProps??{}).map(e=>[e.prop,Dr(n.props,e.prop)])):{},i=typeof e.props==`function`?e.props(n.props,r):e.props??n.props,a=typeof e.flash==`function`?e.flash(n.flash):e.flash,{viewTransition:o,onError:s,onFinish:c,onFlash:l,onSuccess:u,...d}=e,f={...n,...d,flash:a??{},props:i},p=wo.resolvePreserveOption(e.preserveScroll??!1,f),m=wo.resolvePreserveOption(e.preserveState??!1,f),h=this.createVisitId();return H.set(f,{replace:t,preserveScroll:p,preserveState:m,viewTransition:o,visitId:h}).then(()=>{Ki(H.get(),{replace:t,visitId:h});let n=H.get().flash;Object.keys(n).length>0&&(Qi(n),l?.(n));let r=H.get().props.errors||{};if(Object.keys(r).length===0){u?.(H.get());return}let i=e.errorBag?r[e.errorBag||``]||{}:r;s?.(i)}).finally(()=>c?.(e))}performInstantSwap(e){let t=H.get(),n=Object.fromEntries((t.sharedProps??[]).filter(e=>e in t.props).map(e=>[e,t.props[e]])),r=typeof e.pageProps==`function`?e.pageProps(lr(t.props),lr(n)):e.pageProps,i=r===null?{...n}:{...r},a={component:e.component,url:e.url.pathname+e.url.search+e.url.hash,version:t.version,props:{...i,errors:{}},flash:{},rescuedProps:[],clearHistory:!1,encryptHistory:t.encryptHistory,sharedProps:t.sharedProps,rememberedState:{}};return H.set(a,{replace:e.replace,preserveScroll:wo.resolvePreserveOption(e.preserveScroll,a),preserveState:!1,viewTransition:e.viewTransition,visitId:e.id})}getPrefetchParams(e,t){return{...this.getPendingVisit(e,{...t,async:!0,showProgress:!1,prefetch:!0,viewTransition:!1}),...this.getVisitEvents(t)}}createVisitId(){return ro()}getPendingVisit(e,t){if(Ka(e)){let n=e;e=n.url,t.method=t.method??n.method}let n=Ii.get(`visitOptions`),r=n&&n(e.toString(),lr(t))||{},i={method:`get`,data:{},replace:!1,preserveScroll:!1,preserveState:!1,only:[],except:[],headers:{},errorBag:``,forceFormData:!1,queryStringArrayFormat:`brackets`,async:!1,showProgress:!0,fresh:!1,reset:[],preserveUrl:!1,preserveErrors:!1,prefetch:!1,invalidateCacheTags:[],viewTransition:!1,component:null,pageProps:null,cached:!1,...da(t),...da(r)},[a,o]=Ba(e,i.data,i.method,i.forceFormData,i.queryStringArrayFormat),s={id:this.createVisitId(),cancelled:!1,completed:!1,interrupted:!1,...i,url:a,data:o};return s.prefetch&&(s.headers.Purpose=`prefetch`),s}getVisitEvents(e){return{onCancelToken:e.onCancelToken||Mo,onBefore:e.onBefore||Mo,onBeforeUpdate:e.onBeforeUpdate||Mo,onStart:e.onStart||Mo,onProgress:e.onProgress||Mo,onFinish:e.onFinish||Mo,onCancel:e.onCancel||Mo,onSuccess:e.onSuccess||Mo,onError:e.onError||Mo,onHttpException:e.onHttpException||Mo,onNetworkError:e.onNetworkError||Mo,onFlash:e.onFlash||Mo,onPrefetched:e.onPrefetched||Mo,onPrefetching:e.onPrefetching||Mo}}applyOptimisticUpdate(e,t){let n=H.get().props,r=e(lr(n));if(!r)return;let i=[];for(let e of Object.keys(r))_r(n[e],r[e])||i.push(e);if(i.length===0)return;let a=H.nextOptimisticId(),o=H.get().component;for(let e of i)H.setBaseline(e,lr(n[e]));H.registerOptimistic(a,e),H.setPropsQuietly({...n,...r});let s=!0,c=t.onSuccess;t.onSuccess=e=>(s=!1,c(e));let l=t.onFinish;t.onFinish=e=>{if(H.unregisterOptimistic(a),s&&H.get().component===o){let e=H.replayOptimistics();Object.keys(e).length>0&&H.setPropsQuietly({...H.get().props,...e})}return H.pendingOptimisticCount()===0&&H.clearOptimisticState(),l(e)}}loadDeferredProps(e){e&&Object.values(e).forEach(e=>{this.doReload({only:e,deferredProps:!0,preserveErrors:!0})})}},Po=class{static createWayfinderCallback(...e){return()=>e.length===1?Ka(e[0])?e[0]:e[0]():{method:typeof e[0]==`function`?e[0]():e[0],url:typeof e[1]==`function`?e[1]():e[1]}}static parseUseFormArguments(...e){return e.length===0?{rememberKey:null,data:{},precognitionEndpoint:null}:e.length===1?{rememberKey:null,data:e[0],precognitionEndpoint:null}:e.length===2?typeof e[0]==`string`?{rememberKey:e[0],data:e[1],precognitionEndpoint:null}:{rememberKey:null,data:e[1],precognitionEndpoint:this.createWayfinderCallback(e[0])}:{rememberKey:null,data:e[2],precognitionEndpoint:this.createWayfinderCallback(e[0],e[1])}}static parseSubmitArguments(e,t){return e.length===3||e.length===2&&typeof e[0]==`string`?{method:e[0],url:e[1],options:e[2]??{}}:Ka(e[0])?{...e[0],options:e[1]??{}}:{...t(),options:e[0]??{}}}static mergeHeadersForValidation(e,t,n){let r=e=>(e.headers={...n??{},...e.headers??{}},e);return e&&typeof e==`object`&&!(`target`in e)?e=r(e):t&&typeof t==`object`?t=r(t):typeof e==`string`?t=r(t??{}):e=r(e??{}),[e,t]}};function Fo(e){return e.includes(`.`)?e.replace(/\\\./g,`__ESCAPED_DOT__`).split(/(\[[^\]]*\])/).filter(Boolean).map(e=>e.startsWith(`[`)&&e.endsWith(`]`)?e:e.split(`.`).reduce((e,t,n)=>n===0?t:`${e}[${t}]`)).join(``).replace(/__ESCAPED_DOT__/g,`.`):e}function Io(e){let t=[],n=/([^\[\]]+)|\[(\d*)\]/g,r;for(;(r=n.exec(e))!==null;)r[1]===void 0?r[2]!==void 0&&t.push(r[2]===``?``:Number(r[2])):t.push(r[1]);return t}function Lo(e,t,n){let r=e;for(let e=0;e<t.length-1;e++)t[e]in r||(r[t[e]]={}),r=r[t[e]];r[t[t.length-1]]=n}function Ro(e){let t=Object.keys(e),n=t.filter(e=>/^\d+$/.test(e)).map(Number).sort((e,t)=>e-t);return t.length===n.length&&n.length>0&&n[0]===0&&n.every((e,t)=>e===t)}function zo(e){if(Array.isArray(e))return e.map(zo);if(typeof e!=`object`||!e||Ta(e))return e;if(Ro(e)){let t=[];for(let n=0;n<Object.keys(e).length;n++)t[n]=zo(e[n]);return t}let t={};for(let n in e)t[n]=zo(e[n]);return t}function Bo(e){let t={};for(let[n,r]of e.entries()){if(r instanceof File&&r.size===0&&r.name===``)continue;let e=Io(Fo(n));if(e[e.length-1]===``){let n=e.slice(0,-1),i=Dr(t,n);if(Array.isArray(i))i.push(r);else if(i&&typeof i==`object`&&!Ta(i)){let e=Object.keys(i).filter(e=>/^\d+$/.test(e)).map(Number).sort((e,t)=>e-t);Gr(t,n,e.length>0?[...e.map(e=>i[e]),r]:[r])}else Gr(t,n,[r]);continue}Lo(t,e.map(String),r)}return zo(t)}var Vo=`server`;function Ho(e,t){return e.match(/\sdata-inertia(=|\s|>)/)?e:e.replace(/^<([a-zA-Z][^\s/>]*)/,`<$1 data-inertia="server-head-${t}"`)}function Uo(e,t){if(!t)return[];let n=typeof t==`function`?t(e):e.props[t===!0?`head`:t];return Array.isArray(n)?n.map(e=>typeof e==`string`?e.trim():e).filter(e=>typeof e==`string`&&e.length>0).map(Ho):[]}var Wo={buildDOMElement(e){let t=document.createElement(`template`);t.innerHTML=e;let n=t.content.firstChild;if(!e.startsWith(`<script `))return n;let r=document.createElement(`script`);return r.innerHTML=n.innerHTML,n.getAttributeNames().forEach(e=>{r.setAttribute(e,n.getAttribute(e)||``)}),r},isInertiaManagedElement(e){return e.nodeType===Node.ELEMENT_NODE&&e.getAttribute(`data-inertia`)!==null},findMatchingElementIndex(e,t){let n=e.getAttribute(`data-inertia`);return n===null?-1:t.findIndex(e=>e.getAttribute(`data-inertia`)===n)},update:Li(function(e){let t=e.map(e=>this.buildDOMElement(e)),n=Array.from(document.head.childNodes).filter(e=>this.isInertiaManagedElement(e));t.some(e=>e instanceof HTMLTitleElement)&&document.head.querySelectorAll(`title:not([data-inertia])`).forEach(e=>e.remove()),n.forEach(e=>{let n=this.findMatchingElementIndex(e,t);if(n===-1){e.remove();return}let r=t.splice(n,1)[0];r&&!e.isEqualNode(r)&&e.replaceWith(r)}),t.forEach(e=>{document.head.appendChild(e)})},1)};function Go(e,t,n,r=[]){let i=r.length?{[Vo]:r}:{},a=0;function o(){let e=a+=1;return i[e]=[],e.toString()}function s(e){e!==null&&Object.keys(i).indexOf(e)!==-1&&(delete i[e],f())}function c(e){Object.keys(i).indexOf(e)===-1&&(i[e]=[])}function l(e,t=[]){e!==null&&Object.keys(i).indexOf(e)>-1&&(i[e]=t),f()}function u(e=[]){e.length?i[Vo]=e:delete i[Vo],f()}function d(){let e=t(``),n=i[Vo]||[],r=Object.keys(i).filter(e=>e!==Vo).flatMap(e=>i[e]),a={...e?{title:`<title data-inertia="">${e}</title>`}:{}},o=n.concat(r).reduce((e,n)=>{if(n.indexOf(`<`)===-1)return e;if(n.indexOf(`<title `)===0){let r=n.match(/(<title [^>]+>)(.*?)(<\/title>)/s);return e.title=r?`${r[1]}${t(r[2])}${r[3]}`:n,e}let r=n.match(/ data-inertia=(["'])[^"']+\1/);return r?e[r[0]]=n:e[Object.keys(e).length]=n,e},a);return Object.values(o)}function f(){e?n(d()):Wo.update(d())}return f(),{forceUpdate:f,updateServerHead:u,createProvider:function(){let e=o();return{reconnect:()=>c(e),update:t=>l(e,t),disconnect:()=>s(e)}}}}var Ko=`X-Inertia-Infinite-Scroll-Merge-Intent`,qo=e=>{let t=()=>{let t=H.get().scrollProps?.[e.getPropName()];if(t)return t;throw Error(`The page object does not contain a scroll prop named "${e.getPropName()}".`)},n={component:null,loading:!1,previousPage:null,nextPage:null,lastLoadedPage:null,requestCount:0},r=()=>{let e=t();n.component=H.get().component,n.loading=!1,n.previousPage=e.previousPage,n.nextPage=e.nextPage,n.lastLoadedPage=e.currentPage,n.requestCount=0},i=()=>`inertia:infinite-scroll-data:${e.getPropName()}`;if(typeof window<`u`){r();let e=G.restore(i());e&&typeof e==`object`&&e.lastLoadedPage===t().currentPage&&(n.previousPage=e.previousPage,n.nextPage=e.nextPage,n.lastLoadedPage=e.lastLoadedPage,n.requestCount=e.requestCount||0)}let a=G.on(`success`,i=>{n.component===i.detail.page.component&&t().reset&&(r(),e.onReset?.())}),o=e=>e===`next`?`nextPage`:`previousPage`,s=e=>{let t=o(e);return n[t]},c=e=>{let r=t(),a=o(e);n.lastLoadedPage=r.currentPage,n[a]=r[a],n.requestCount+=1,G.remember({previousPage:n.previousPage,nextPage:n.nextPage,lastLoadedPage:n.lastLoadedPage,requestCount:n.requestCount},i())},l=()=>t().pageName,u=()=>n.requestCount,d=(t,r={})=>{let i=s(t);n.loading||i===null||(n.loading=!0,G.reload({preserveErrors:!0,...r,data:{...r.data||{},[l()]:i},only:[...r.only||[],e.getPropName()],preserveUrl:!0,headers:{[Ko]:t===`previous`?`prepend`:`append`,...r.headers},onBefore:n=>{t===`next`?e.onBeforeNextRequest():e.onBeforePreviousRequest(),r.onBefore?.(n)},onBeforeUpdate:t=>{e.onBeforeUpdate(),r.onBeforeUpdate?.(t)},onSuccess:e=>{c(t),r.onSuccess?.(e)},onFinish:i=>{n.loading=!1;let a=i.completed,o=a?n.lastLoadedPage:null;t===`next`?e.onCompleteNextRequest(o,{page:o,completed:a}):e.onCompletePreviousRequest(o,{page:o,completed:a}),r.onFinish?.(i)}}))};return{getLastLoadedPage:()=>n.lastLoadedPage,getPageName:l,getRequestCount:u,hasPrevious:()=>!!n.previousPage,hasNext:()=>!!n.nextPage,fetchNext:e=>d(`next`,e),fetchPrevious:e=>d(`previous`,e),removeEventListener:a}},Jo=()=>{let e=[];return{new:(t,n={})=>{let r=new IntersectionObserver(e=>{for(let n of e)n.isIntersecting&&t(n)},n);return e.push(r),r},flushAll:()=>{e.forEach(e=>e.disconnect()),e.length=0}}},Yo=`infiniteScrollPage`,Xo=`infiniteScrollIgnore`,Zo=e=>e.dataset[Yo],Qo=e=>{let t=Jo(),n,r,i,a,o=!1,s=()=>{a=new MutationObserver(e=>{e.forEach(e=>{e.addedNodes.forEach(e=>{e.nodeType===Node.ELEMENT_NODE&&f.add(e)})}),b()}),a.observe(e.getItemsElement(),{childList:!0}),n=t.new(t=>e.onItemIntersected(t.target));let o={root:e.getScrollableParent(),rootMargin:`${Math.max(1,e.getTriggerMargin())}px`};r=t.new(e.onPreviousTriggered,o),i=t.new(e.onNextTriggered,o)},c=()=>{o&&l();let t=e.getStartElement(),n=e.getEndElement();t&&e.shouldFetchPrevious()&&r.observe(t),n&&e.shouldFetchNext()&&i.observe(n),o=!0},l=()=>{o&&=(r.disconnect(),i.disconnect(),!1)},u=()=>{o&&c()},d=()=>{l(),t.flushAll(),a?.disconnect()},f=new Set,p=e=>!(Yo in e.dataset)&&!(Xo in e.dataset),m=()=>{Array.from(f).forEach(e=>{p(e)&&(e.dataset[Xo]=`true`),n.observe(e)}),f.clear()},h=e=>Array.from(e.querySelectorAll(`:scope > *:not([data-infinite-scroll-page]):not([data-infinite-scroll-ignore])`)),g=!1,_=t=>{!g&&(g=!0,x())||(h(e.getItemsElement()).forEach(e=>{p(e)&&(e.dataset[Yo]=t?.toString()||`1`),n.observe(e)}),y())},v=()=>`inertia:infinite-scroll-elements:${e.getPropName()}`,y=()=>{let t={},n=e.getItemsElement().childNodes;for(let e=0;e<n.length;e++){let r=n[e];if(r.nodeType!==Node.ELEMENT_NODE)continue;let i=Zo(r);i!==void 0&&(i in t?t[i].to=e:t[i]={from:e,to:e})}G.remember(t,v())},b=Li(y,250),x=()=>{let t=G.restore(v());if(!t||typeof t!=`object`)return!1;let r=e.getItemsElement().childNodes;for(let e=0;e<r.length;e++){let i=r[e];if(i.nodeType!==Node.ELEMENT_NODE)continue;let a=i,o;for(let[n,r]of Object.entries(t))if(e>=r.from&&e<=r.to){o=n;break}if(o)a.dataset[Yo]=o;else if(p(a))a.dataset[Xo]=`true`;else continue;n.observe(a)}return!0};return{setupObservers:s,enableTriggers:c,disableTriggers:l,refreshTriggers:u,flushAll:d,processManuallyAddedElements:m,processServerLoadedElements:_}},$o=new Xa,es,ts,ns=null,rs=e=>{let t=!0,n=n=>{$o.add(()=>new Promise(r=>{if(!t)return es=ts=null,r();if(!es||!ts){let e=H.get().url;es=za(e),ts=za(e),ns=Ja(e)}let i=e.getPageName(),a=ts.searchParams;n===`1`?a.delete(i):a.set(i,n),setTimeout(()=>r())})).finally(()=>{t&&es&&ts&&es.href!==ts.href&&ns!==null&&G.replace({url:Ya(ts,ns),preserveScroll:!0,preserveState:!0}),es=ts=ns=null})};return{onItemIntersected:Li(r=>{let i=e.getItemsElement();if(!t||e.shouldPreserveUrl()||!r||!i)return;let a=new Map;ya([...i.children],r).forEach(e=>{let t=Zo(e)??`1`;a.has(t)?a.set(t,a.get(t)+1):a.set(t,1)});let o=Array.from(a.entries()).sort((e,t)=>t[1]-e[1])[0]?.[0];o!==void 0&&n(o)},250),cancel:()=>t=!1}},is=e=>({createCallbacks:()=>{let t,n=null,r=0;return{captureScrollPosition:()=>{let i=e.getScrollableParent(),a=e.getItemsElement();t=i?.scrollTop||window.scrollY;let o=ya([...a.children]);if(o.length>0){n=o[0];let e=i?.getBoundingClientRect()||{top:0},t=i?e.top:0;r=n.getBoundingClientRect().top-t}},restoreScrollPosition:()=>{if(!n)return;let i=0,a=!1,o=()=>{if(i++,a||i>10)return!1;let s=e.getScrollableParent(),c=s?.getBoundingClientRect()||{top:0},l=s?c.top:0,u=n.getBoundingClientRect().top-l-r;if(u===0){window.requestAnimationFrame(o);return}s?s.scrollTo({top:t+u}):window.scrollTo(0,window.scrollY+u),a=!0};window.requestAnimationFrame(o)}}}});function as(e){let t=rs({...e,getPageName:()=>i.getPageName()}),n=is(e),r=Qo({...e,onItemIntersected:t.onItemIntersected,onPreviousTriggered:()=>i.fetchPrevious(),onNextTriggered:()=>i.fetchNext()}),i=qo({...e,onBeforeUpdate:r.processManuallyAddedElements,onCompletePreviousRequest:(t,n)=>{e.onCompletePreviousRequest(n),n.completed&&ba(()=>r.processServerLoadedElements(n.page),2)},onCompleteNextRequest:(t,n)=>{e.onCompleteNextRequest(n),n.completed&&ba(()=>r.processServerLoadedElements(n.page),2)},onReset:e.onDataReset}),a=e=>{let{captureScrollPosition:t,restoreScrollPosition:r}=n.createCallbacks(),i=e.onBeforeUpdate||(()=>{}),a=e.onSuccess||(()=>{});return e.onBeforeUpdate=e=>{i(e),t()},e.onSuccess=e=>{a(e),r()},e},o=i.fetchNext;i.fetchNext=(t={})=>{t={...e.getReloadOptions?.(),...t},e.inReverseMode()&&(t=a(t)),o(t)};let s=i.fetchPrevious;i.fetchPrevious=(t={})=>{t={...e.getReloadOptions?.(),...t},e.inReverseMode()||(t=a(t)),s(t)};let c=G.on(`success`,()=>ba(r.refreshTriggers,2));return{dataManager:i,elementManager:r,flush:()=>{c(),i.removeEventListener(),r.flushAll(),t.cancel()}}}function os(){let e={},t={},n={shared:e,named:t},r=new Set,i=!1,a=()=>{n={shared:e,named:t}},o=()=>{i||(i=!0,queueMicrotask(()=>{i=!1,r.forEach(e=>e())}))};return{set(t){let n={...e,...t};_r(e,n)||(e=n,a(),o())},setFor(e,n){let r=t[e]||{},i={...r,...n};_r(r,i)||(t={...t,[e]:i},a(),o())},reset(){e={},t={},a(),o()},subscribe(e){return r.add(e),()=>r.delete(e)},get:()=>n}}function ss(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function cs(e){return ss(e)&&`component`in e}function ls(e,t){return`component`in e&&t(e.component)}function us(e,t){return!ss(e)||t(e)||ls(e,t)?!1:Object.values(e).every(e=>t(e)||Array.isArray(e)&&t(e[0])||cs(e)&&t(e.component))}function ds(e,t){return ss(e)&&!t(e)&&!ls(e,t)&&!us(e,t)}function fs(e,t){if(ds(e,t))return!0;if(!ss(e)||t(e)||ls(e,t))return!1;let n=Object.values(e);return n.length>0&&n.every(e=>typeof e==`function`)}function ps(e,t){return Array.isArray(e)&&e.length===2&&t(e[0])&&ss(e[1])&&!t(e[1])}function ms(e,t){if(Array.isArray(e)&&t(e[0]))return{component:e[0],props:e[1]??{}};if(cs(e)&&t(e.component))return{component:e.component,props:e.props??{}};if(t(e))return{component:e,props:{}};throw Error(`Invalid layout definition: received ${typeof e}`)}function hs(e,t,n){return!e||n&&n(e)?[]:us(e,t)?Object.entries(e).map(([e,n])=>({...ms(n,t),name:e})):ps(e,t)?[{component:e[0],props:e[1]??{}}]:Array.isArray(e)?e.map(e=>ms(e,t)):cs(e)&&t(e.component)?[{component:e.component,props:e.props??{}}]:t(e)?[{component:e,props:{}}]:[]}function gs(e){return e.target instanceof HTMLElement&&e.target.isContentEditable||e.defaultPrevented}function _s(e){let t=e.currentTarget.tagName.toLowerCase()===`a`,n=t?e.currentTarget.target:``;return!(gs(e)||t&&e.altKey||t&&e.ctrlKey||t&&e.metaKey||t&&e.shiftKey||t&&n!==``&&n!==`_self`||t&&`button`in e&&e.button!==0)}function vs(e){let t=e.currentTarget.tagName.toLowerCase()===`button`;return!gs(e)&&(e.key===`Enter`||t&&e.key===` `)}var ys=`nprogress`,bs,xs,Ss={minimum:.08,easing:`linear`,speed:200,trickle:!0,trickleSpeed:200,showSpinner:!0,barSelector:`.bar, [role="bar"]`,spinnerSelector:`.spinner, [role="spinner"]`,parent:`body`,color:`#29d`,includeCSS:!0,popover:null,template:[`<div class="bar">`,`<div class="peg"></div>`,`</div>`,`<div class="spinner">`,`<div class="spinner-icon"></div>`,`</div>`].join(``)},Cs=null,ws=!1,Ts=e=>{Object.assign(Ss,e),bs=Ss.popover??`popover`in HTMLElement.prototype,Ss.includeCSS&&Rs(Ss.color),xs=document.createElement(`div`),xs.id=ys,xs.setAttribute(`aria-hidden`,`true`),xs.innerHTML=Ss.template,bs&&(xs.popover=`manual`)},Es=e=>{let t=Ds();e=Fs(e,Ss.minimum,1),Cs=e===1?null:e;let n=js(!t),r=n.querySelector(Ss.barSelector),i=Ss.speed,a=Ss.easing;n.offsetWidth,Ls(t=>{let o={transition:`all ${i}ms ${a}`,transform:`translate3d(${Is(e)}%,0,0)`};for(let e in o)r.style[e]=o[e];if(e!==1)return setTimeout(t,i);n.style.transition=`none`,n.style.opacity=`1`,n.offsetWidth,setTimeout(()=>{n.style.transition=`all ${i}ms linear`,n.style.opacity=`0`,setTimeout(()=>{Ns(),n.style.transition=``,n.style.opacity=``,t()},i)},i)})},Ds=()=>typeof Cs==`number`,Os=()=>{Cs||Es(0);let e=function(){setTimeout(function(){Cs&&(As(),e())},Ss.trickleSpeed)};Ss.trickle&&e()},ks=e=>{!e&&!Cs||(As(.3+.5*Math.random()),Es(1))},As=e=>{let t=Cs;if(t===null)return Os();if(!(t>1))return e=typeof e==`number`?e:(()=>{let e={.1:[0,.2],.04:[.2,.5],.02:[.5,.8],.005:[.8,.99]};for(let n in e)if(t>=e[n][0]&&t<e[n][1])return parseFloat(n);return 0})(),Es(Fs(t+e,0,.994))},js=e=>{if(Ps())return document.getElementById(ys);document.documentElement.classList.add(`${ys}-busy`);let t=xs.querySelector(Ss.barSelector),n=e?`-100`:Is(Cs||0);if(t.style.transition=`all 0 linear`,t.style.transform=`translate3d(${n}%,0,0)`,Ss.showSpinner||xs.querySelector(Ss.spinnerSelector)?.remove(),bs)document.body.appendChild(xs),ws||xs.showPopover();else{let e=Ms();e!==document.body&&e.classList.add(`${ys}-custom-parent`),e.appendChild(xs),ws&&(xs.style.display=`none`)}return xs},Ms=()=>document.querySelector(Ss.parent),Ns=()=>{if(document.documentElement.classList.remove(`${ys}-busy`),bs&&xs?.isConnected)try{xs.hidePopover()}catch{}bs||Ms().classList.remove(`${ys}-custom-parent`),xs?.remove()},Ps=()=>document.getElementById(ys)!==null;function Fs(e,t,n){return e<t?t:e>n?n:e}var Is=e=>(-1+e)*100,Ls=(()=>{let e=[],t=()=>{let n=e.shift();n&&n(t)};return n=>{e.push(n),e.length===1&&t()}})(),Rs=e=>{let t=document.createElement(`style`),n=Ii.get(`nonce`);n&&(t.nonce=n),t.textContent=`
12
- #${ys} {
13
- pointer-events: none;
14
- background: none;
15
- border: none;
16
- margin: 0;
17
- padding: 0;
18
- overflow: visible;
19
- inset: unset;
20
- width: 100%;
21
- height: 0;
22
- position: fixed;
23
- top: 0;
24
- left: 0;
25
- }
26
-
27
- #${ys}::backdrop {
28
- display: none;
29
- }
30
-
31
- #${ys} .bar {
32
- background: ${e};
33
-
34
- position: fixed;
35
- z-index: 1031;
36
- top: 0;
37
- left: 0;
38
-
39
- width: 100%;
40
- height: 2px;
41
- }
42
-
43
- #${ys} .peg {
44
- display: block;
45
- position: absolute;
46
- right: 0px;
47
- width: 100px;
48
- height: 100%;
49
- box-shadow: 0 0 10px ${e}, 0 0 5px ${e};
50
- opacity: 1.0;
51
-
52
- transform: rotate(3deg) translate(0px, -4px);
53
- }
54
-
55
- #${ys} .spinner {
56
- display: block;
57
- position: fixed;
58
- z-index: 1031;
59
- top: 15px;
60
- right: 15px;
61
- }
62
-
63
- #${ys} .spinner-icon {
64
- width: 18px;
65
- height: 18px;
66
- box-sizing: border-box;
67
-
68
- border: solid 2px transparent;
69
- border-top-color: ${e};
70
- border-left-color: ${e};
71
- border-radius: 50%;
72
-
73
- animation: ${ys}-spinner 400ms linear infinite;
74
- }
75
-
76
- .${ys}-custom-parent {
77
- overflow: hidden;
78
- position: relative;
79
- }
80
-
81
- .${ys}-custom-parent #${ys} .spinner,
82
- .${ys}-custom-parent #${ys} .bar {
83
- position: absolute;
84
- }
85
-
86
- @keyframes ${ys}-spinner {
87
- 0% { transform: rotate(0deg); }
88
- 100% { transform: rotate(360deg); }
89
- }
90
- `,document.head.appendChild(t)},zs={configure:Ts,isStarted:Ds,done:ks,set:Es,remove:Ns,start:Os,status:Cs,show:()=>{if(ws=!1,xs?.isConnected)if(bs)try{xs.showPopover()}catch{}else xs.style.display=``},hide:()=>{if(ws=!0,xs?.isConnected)if(bs)try{xs.hidePopover()}catch{}else xs.style.display=`none`}},Bs=new class{hideCount=0;start(){zs.start()}reveal(e=!1){this.hideCount=Math.max(0,this.hideCount-1),(e||this.hideCount===0)&&zs.show()}hide(){this.hideCount++,zs.hide()}set(e){zs.set(Math.max(0,Math.min(1,e)))}finish(){zs.done()}reset(){zs.set(0)}remove(){zs.done(),zs.remove()}isStarted(){return zs.isStarted()}getStatus(){return zs.status}};function Vs(e){document.addEventListener(`inertia:start`,t=>Hs(t,e)),document.addEventListener(`inertia:progress`,Us)}function Hs(e,t){e.detail.visit.showProgress||Bs.hide();let n=setTimeout(()=>Bs.start(),t);document.addEventListener(`inertia:finish`,e=>Ws(e,n),{once:!0})}function Us(e){Bs.isStarted()&&e.detail.progress?.percentage&&Bs.set(Math.max(Bs.getStatus(),e.detail.progress.percentage/100*.9))}function Ws(e,t){clearTimeout(t),Bs.isStarted()&&(e.detail.visit.completed?Bs.finish():e.detail.visit.interrupted?Bs.reset():e.detail.visit.cancelled&&Bs.remove())}function Gs({delay:e=250,color:t=`#29d`,includeCSS:n=!0,showSpinner:r=!1,popover:i=null}={}){Vs(e),zs.configure({showSpinner:r,includeCSS:n,color:t,popover:i})}var Ks=Symbol(`FormComponentReset`);function qs(e){return e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement}function Js(e,t){let n=e.value,r=e.checked;switch(e.type.toLowerCase()){case`checkbox`:e.checked=t.includes(e.value);break;case`radio`:e.checked=t[0]===e.value;break;case`file`:e.value=``;break;case`button`:case`submit`:case`reset`:case`image`:break;default:e.value=t[0]!==null&&t[0]!==void 0?String(t[0]):``}return e.value!==n||e.checked!==r}function Ys(e,t){let n=e.value,r=Array.from(e.selectedOptions).map(e=>e.value);if(e.multiple){let n=t.map(e=>String(e));Array.from(e.options).forEach(e=>{e.selected=n.includes(e.value)})}else e.value=t[0]===void 0?``:String(t[0]);let i=Array.from(e.selectedOptions).map(e=>e.value);return e.multiple?JSON.stringify(r.sort())!==JSON.stringify(i.sort()):e.value!==n}function Xs(e,t){if(e.disabled){if(e instanceof HTMLInputElement){let t=e.value,n=e.checked;switch(e.type.toLowerCase()){case`checkbox`:case`radio`:return e.checked=e.defaultChecked,e.checked!==n;case`file`:return e.value=``,t!==``;case`button`:case`submit`:case`reset`:case`image`:return!1;default:return e.value=e.defaultValue,e.value!==t}}else if(e instanceof HTMLSelectElement){let t=Array.from(e.selectedOptions).map(e=>e.value);Array.from(e.options).forEach(e=>{e.selected=e.defaultSelected});let n=Array.from(e.selectedOptions).map(e=>e.value);return JSON.stringify(t.sort())!==JSON.stringify(n.sort())}else if(e instanceof HTMLTextAreaElement){let t=e.value;return e.value=e.defaultValue,e.value!==t}return!1}if(e instanceof HTMLInputElement)return Js(e,t);if(e instanceof HTMLSelectElement)return Ys(e,t);if(e instanceof HTMLTextAreaElement){let n=e.value;return e.value=t[0]===void 0?``:String(t[0]),e.value!==n}return!1}function Zs(e,t){let n=!1;return e instanceof RadioNodeList||e instanceof HTMLCollection?Array.from(e).forEach((e,r)=>{e instanceof Element&&qs(e)&&(e instanceof HTMLInputElement&&[`checkbox`,`radio`].includes(e.type.toLowerCase())?Xs(e,t)&&(n=!0):Xs(e,t[r]===void 0?[t[0]??null].filter(Boolean):[t[r]])&&(n=!0))}):qs(e)&&(n=Xs(e,t)),n}function Qs(e,t,n){if(!e)return;let r=!n||n.length===0;if(r){let r=new FormData(e),i=Array.from(e.elements).map(e=>qs(e)?e.name:``).filter(Boolean);n=[...new Set([...t.keys(),...r.keys(),...i])]}let i=!1;n.forEach(n=>{let r=e.elements.namedItem(n);r&&Zs(r,t.getAll(n))&&(i=!0)}),i&&r&&e.dispatchEvent(new CustomEvent(`reset`,{bubbles:!0,cancelable:!0,detail:{[Ks]:!0}}))}function $s(e,t,n){return`<script data-page="${e}" type="application/json">${JSON.stringify(t).replace(/\//g,`\\/`)}<\/script><div data-server-rendered="true" id="${e}">${n}</div>`}var G=new No,ec=n((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,O());else{var t=n(l);t!==null&&A(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){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&&E());){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&&A(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var ee=new MessageChannel,k=ee.port2;ee.port1.onmessage=D,O=function(){k.postMessage(null)}}else O=function(){_(D,0)};function A(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,A(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),tc=n(((e,t)=>{t.exports=ec()})),nc=n((e=>{var t=tc(),n=r(),i=o();function a(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 s(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function c(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function l(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 u(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 d(e){if(c(e)!==e)throw Error(a(188))}function f(e){var t=e.alternate;if(!t){if(t=c(e),t===null)throw Error(a(188));return t===e?e:null}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var o=i.alternate;if(o===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return d(i),e;if(o===r)return d(i),t;o=o.sibling}throw Error(a(188))}if(n.return!==r.return)n=i,r=o;else{for(var s=!1,l=i.child;l;){if(l===n){s=!0,n=i,r=o;break}if(l===r){s=!0,r=i,n=o;break}l=l.sibling}if(!s){for(l=o.child;l;){if(l===n){s=!0,n=o,r=i;break}if(l===r){s=!0,r=o,n=i;break}l=l.sibling}if(!s)throw Error(a(189))}}if(n.alternate!==r)throw Error(a(190))}if(n.tag!==3)throw Error(a(188));return n.stateNode.current===n?e:t}function p(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=p(e),t!==null)return t;e=e.sibling}return null}var m=Object.assign,h=Symbol.for(`react.element`),g=Symbol.for(`react.transitional.element`),_=Symbol.for(`react.portal`),v=Symbol.for(`react.fragment`),y=Symbol.for(`react.strict_mode`),b=Symbol.for(`react.profiler`),x=Symbol.for(`react.consumer`),S=Symbol.for(`react.context`),C=Symbol.for(`react.forward_ref`),w=Symbol.for(`react.suspense`),T=Symbol.for(`react.suspense_list`),E=Symbol.for(`react.memo`),D=Symbol.for(`react.lazy`),O=Symbol.for(`react.activity`),ee=Symbol.for(`react.memo_cache_sentinel`),k=Symbol.iterator;function A(e){return typeof e!=`object`||!e?null:(e=k&&e[k]||e[`@@iterator`],typeof e==`function`?e:null)}var j=Symbol.for(`react.client.reference`);function M(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===j?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case v:return`Fragment`;case b:return`Profiler`;case y:return`StrictMode`;case w:return`Suspense`;case T:return`SuspenseList`;case O:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case _:return`Portal`;case S:return e.displayName||`Context`;case x:return(e._context.displayName||`Context`)+`.Consumer`;case C:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case E:return t=e.displayName||null,t===null?M(e.type)||`Memo`:t;case D:t=e._payload,e=e._init;try{return M(e(t))}catch{}}return null}var te=Array.isArray,N=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F={pending:!1,data:null,method:null,action:null},ne=[],re=-1;function ie(e){return{current:e}}function I(e){0>re||(e.current=ne[re],ne[re]=null,re--)}function L(e,t){re++,ne[re]=e.current,e.current=t}var ae=ie(null),oe=ie(null),se=ie(null),ce=ie(null);function R(e,t){switch(L(se,t),L(oe,e),L(ae,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Vd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Vd(t),e=Hd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}I(ae),L(ae,e)}function le(){I(ae),I(oe),I(se)}function ue(e){e.memoizedState!==null&&L(ce,e);var t=ae.current,n=Hd(t,e.type);t!==n&&(L(oe,e),L(ae,n))}function de(e){oe.current===e&&(I(ae),I(oe)),ce.current===e&&(I(ce),Qf._currentValue=F)}var fe,pe;function me(e){if(fe===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);fe=t&&t[1]||``,pe=-1<e.stack.indexOf(`
91
- at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
92
- `+fe+e+pe}var he=!1;function ge(e,t){if(!e||he)return``;he=!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}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
93
- `),l=s.split(`
94
- `);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=`
95
- `+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{he=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?me(n):``}function _e(e,t){switch(e.tag){case 26:case 27:case 5:return me(e.type);case 16:return me(`Lazy`);case 13:return e.child!==t&&t!==null?me(`Suspense Fallback`):me(`Suspense`);case 19:return me(`SuspenseList`);case 0:case 15:return ge(e.type,!1);case 11:return ge(e.type.render,!1);case 1:return ge(e.type,!0);case 31:return me(`Activity`);default:return``}}function ve(e){try{var t=``,n=null;do t+=_e(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
96
- Error generating stack: `+e.message+`
97
- `+e.stack}}var ye=Object.prototype.hasOwnProperty,be=t.unstable_scheduleCallback,xe=t.unstable_cancelCallback,Se=t.unstable_shouldYield,Ce=t.unstable_requestPaint,we=t.unstable_now,Te=t.unstable_getCurrentPriorityLevel,Ee=t.unstable_ImmediatePriority,De=t.unstable_UserBlockingPriority,Oe=t.unstable_NormalPriority,ke=t.unstable_LowPriority,Ae=t.unstable_IdlePriority,je=t.log,Me=t.unstable_setDisableYieldValue,Ne=null,Pe=null;function Fe(e){if(typeof je==`function`&&Me(e),Pe&&typeof Pe.setStrictMode==`function`)try{Pe.setStrictMode(Ne,e)}catch{}}var Ie=Math.clz32?Math.clz32:ze,Le=Math.log,Re=Math.LN2;function ze(e){return e>>>=0,e===0?32:31-(Le(e)/Re|0)|0}var Be=256,Ve=262144,He=4194304;function Ue(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function We(e,t,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=Ue(n))):i=Ue(o):i=Ue(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Ue(n))):i=Ue(o)):i=Ue(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 Ge(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Ke(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 qe(){var e=He;return He<<=1,!(He&62914560)&&(He=4194304),e}function Je(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ye(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Xe(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-Ie(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&&Ze(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function Ze(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Ie(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function Qe(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ie(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function $e(e,t){var n=t&-t;return n=n&42?1:et(n),(n&(e.suspendedLanes|t))===0?n:0}function et(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 tt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function nt(){var e=P.p;return e===0?(e=window.event,e===void 0?32:mp(e.type)):e}function rt(e,t){var n=P.p;try{return P.p=e,t()}finally{P.p=n}}var it=Math.random().toString(36).slice(2),at=`__reactFiber$`+it,ot=`__reactProps$`+it,st=`__reactContainer$`+it,ct=`__reactEvents$`+it,lt=`__reactListeners$`+it,ut=`__reactHandles$`+it,dt=`__reactResources$`+it,ft=`__reactMarker$`+it;function pt(e){delete e[at],delete e[ot],delete e[ct],delete e[lt],delete e[ut]}function mt(e){var t=e[at];if(t)return t;for(var n=e.parentNode;n;){if(t=n[st]||n[at]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=df(e);e!==null;){if(n=e[at])return n;e=df(e)}return t}e=n,n=e.parentNode}return null}function ht(e){if(e=e[at]||e[st]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function gt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(a(33))}function _t(e){var t=e[dt];return t||=e[dt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function vt(e){e[ft]=!0}var yt=new Set,bt={};function xt(e,t){St(e,t),St(e+`Capture`,t)}function St(e,t){for(bt[e]=t,e=0;e<t.length;e++)yt.add(t[e])}var Ct=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]*$`),wt={},Tt={};function Et(e){return ye.call(Tt,e)?!0:ye.call(wt,e)?!1:Ct.test(e)?Tt[e]=!0:(wt[e]=!0,!1)}function Dt(e,t,n){if(Et(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 Ot(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 kt(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 At(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function jt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Mt(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 Nt(e){if(!e._valueTracker){var t=jt(e)?`checked`:`value`;e._valueTracker=Mt(e,t,``+e[t])}}function Pt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=jt(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}function Ft(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var It=/[\n"\\]/g;function Lt(e){return e.replace(It,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Rt(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=``+At(t)):e.value!==``+At(t)&&(e.value=``+At(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Bt(e,o,At(n)):Bt(e,o,At(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=``+At(s):e.removeAttribute(`name`)}function zt(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)){Nt(e);return}n=n==null?``:``+At(n),t=t==null?n:``+At(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),Nt(e)}function Bt(e,t,n){t===`number`&&Ft(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Vt(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=``+At(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 Ht(e,t,n){if(t!=null&&(t=``+At(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+At(n)}function Ut(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(a(92));if(te(r)){if(1<r.length)throw Error(a(93));r=r[0]}n=r}n??=``,t=n}n=At(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Nt(e)}function Wt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Gt=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function Kt(e,t,n){var r=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||Gt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function qt(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(a(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var i in t)r=t[i],t.hasOwnProperty(i)&&n[i]!==r&&Kt(e,i,r)}else for(var o in t)t.hasOwnProperty(o)&&Kt(e,o,t[o])}function Jt(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 Yt=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-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`]]),Xt=/^[\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 Zt(e){return Xt.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function Qt(){}var $t=null;function en(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var tn=null,nn=null;function rn(e){var t=ht(e);if(t&&(e=t.stateNode)){var n=e[ot]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Rt(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="`+Lt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=r[ot]||null;if(!i)throw Error(a(90));Rt(r,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Pt(r)}break a;case`textarea`:Ht(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Vt(e,!!n.multiple,t,!1)}}}var an=!1;function on(e,t,n){if(an)return e(t,n);an=!0;try{return e(t)}finally{if(an=!1,(tn!==null||nn!==null)&&(bu(),tn&&(t=tn,e=nn,nn=tn=null,rn(t),e)))for(t=0;t<e.length;t++)rn(e[t])}}function sn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[ot]||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(a(231,t,typeof n));return n}var cn=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),z=!1;if(cn)try{var ln={};Object.defineProperty(ln,"passive",{get:function(){z=!0}}),window.addEventListener(`test`,ln,ln),window.removeEventListener(`test`,ln,ln)}catch{z=!1}var un=null,dn=null,fn=null;function B(){if(fn)return fn;var e,t=dn,n=t.length,r,i=`value`in un?un.value:un.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 fn=i.slice(e,1<r?1-r:void 0)}function pn(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 mn(){return!0}function hn(){return!1}function gn(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)?mn:hn,this.isPropagationStopped=hn,this}return m(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=mn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=mn)},persist:function(){},isPersistent:mn}),t}var _n={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},vn=gn(_n),yn=m({},_n,{view:0,detail:0}),bn=gn(yn),xn,Sn,Cn,wn=m({},yn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Fn,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!==Cn&&(Cn&&e.type===`mousemove`?(xn=e.screenX-Cn.screenX,Sn=e.screenY-Cn.screenY):Sn=xn=0,Cn=e),xn)},movementY:function(e){return`movementY`in e?e.movementY:Sn}}),Tn=gn(wn),En=gn(m({},wn,{dataTransfer:0})),Dn=gn(m({},yn,{relatedTarget:0})),On=gn(m({},_n,{animationName:0,elapsedTime:0,pseudoElement:0})),kn=gn(m({},_n,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),An=gn(m({},_n,{data:0})),jn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Mn={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`},Nn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Pn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Nn[e])?!!t[e]:!1}function Fn(){return Pn}var In=gn(m({},yn,{key:function(e){if(e.key){var t=jn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=pn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Mn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Fn,charCode:function(e){return e.type===`keypress`?pn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?pn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Ln=gn(m({},wn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Rn=gn(m({},yn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Fn})),zn=gn(m({},_n,{propertyName:0,elapsedTime:0,pseudoElement:0})),Bn=gn(m({},wn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),Vn=gn(m({},_n,{newState:0,oldState:0})),Hn=[9,13,27,32],Un=cn&&`CompositionEvent`in window,Wn=null;cn&&`documentMode`in document&&(Wn=document.documentMode);var Gn=cn&&`TextEvent`in window&&!Wn,Kn=cn&&(!Un||Wn&&8<Wn&&11>=Wn),qn=` `,Jn=!1;function Yn(e,t){switch(e){case`keyup`:return Hn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Xn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Zn=!1;function Qn(e,t){switch(e){case`compositionend`:return Xn(t);case`keypress`:return t.which===32?(Jn=!0,qn):null;case`textInput`:return e=t.data,e===qn&&Jn?null:e;default:return null}}function $n(e,t){if(Zn)return e===`compositionend`||!Un&&Yn(e,t)?(e=B(),fn=dn=un=null,Zn=!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 Kn&&t.locale!==`ko`?null:t.data;default:return null}}var er={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 tr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!er[e.type]:t===`textarea`}function nr(e,t,n,r){tn?nn?nn.push(r):nn=[r]:tn=r,t=Ed(t,`onChange`),0<t.length&&(n=new vn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var rr=null,ir=null;function ar(e){yd(e,0)}function or(e){if(Pt(gt(e)))return e}function sr(e,t){if(e===`change`)return t}var cr=!1;if(cn){var lr;if(cn){var ur=`oninput`in document;if(!ur){var dr=document.createElement(`div`);dr.setAttribute(`oninput`,`return;`),ur=typeof dr.oninput==`function`}lr=ur}else lr=!1;cr=lr&&(!document.documentMode||9<document.documentMode)}function fr(){rr&&(rr.detachEvent(`onpropertychange`,pr),ir=rr=null)}function pr(e){if(e.propertyName===`value`&&or(ir)){var t=[];nr(t,ir,e,en(e)),on(ar,t)}}function mr(e,t,n){e===`focusin`?(fr(),rr=t,ir=n,rr.attachEvent(`onpropertychange`,pr)):e===`focusout`&&fr()}function hr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return or(ir)}function gr(e,t){if(e===`click`)return or(t)}function _r(e,t){if(e===`input`||e===`change`)return or(t)}function vr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var yr=typeof Object.is==`function`?Object.is:vr;function br(e,t){if(yr(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(!ye.call(t,i)||!yr(e[i],t[i]))return!1}return!0}function xr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Sr(e,t){var n=xr(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=xr(n)}}function Cr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Cr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function wr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ft(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=Ft(e.document)}return t}function Tr(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 Er=cn&&`documentMode`in document&&11>=document.documentMode,Dr=null,Or=null,kr=null,Ar=!1;function jr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ar||Dr==null||Dr!==Ft(r)||(r=Dr,`selectionStart`in r&&Tr(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}),kr&&br(kr,r)||(kr=r,r=Ed(Or,`onSelect`),0<r.length&&(t=new vn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Dr)))}function Mr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Nr={animationend:Mr(`Animation`,`AnimationEnd`),animationiteration:Mr(`Animation`,`AnimationIteration`),animationstart:Mr(`Animation`,`AnimationStart`),transitionrun:Mr(`Transition`,`TransitionRun`),transitionstart:Mr(`Transition`,`TransitionStart`),transitioncancel:Mr(`Transition`,`TransitionCancel`),transitionend:Mr(`Transition`,`TransitionEnd`)},Pr={},Fr={};cn&&(Fr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Nr.animationend.animation,delete Nr.animationiteration.animation,delete Nr.animationstart.animation),`TransitionEvent`in window||delete Nr.transitionend.transition);function Ir(e){if(Pr[e])return Pr[e];if(!Nr[e])return e;var t=Nr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Fr)return Pr[e]=t[n];return e}var Lr=Ir(`animationend`),Rr=Ir(`animationiteration`),zr=Ir(`animationstart`),Br=Ir(`transitionrun`),Vr=Ir(`transitionstart`),Hr=Ir(`transitioncancel`),Ur=Ir(`transitionend`),Wr=new Map,Gr=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);Gr.push(`scrollEnd`);function Kr(e,t){Wr.set(e,t),xt(t,[e])}var qr=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)},Jr=[],Yr=0,Xr=0;function Zr(){for(var e=Yr,t=Xr=Yr=0;t<e;){var n=Jr[t];Jr[t++]=null;var r=Jr[t];Jr[t++]=null;var i=Jr[t];Jr[t++]=null;var a=Jr[t];if(Jr[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&&ti(n,i,a)}}function Qr(e,t,n,r){Jr[Yr++]=e,Jr[Yr++]=t,Jr[Yr++]=n,Jr[Yr++]=r,Xr|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function $r(e,t,n,r){return Qr(e,t,n,r),ni(e)}function ei(e,t){return Qr(e,null,null,t),ni(e)}function ti(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-Ie(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function ni(e){if(50<du)throw du=0,fu=null,Error(a(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ri={};function ii(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 ai(e,t,n,r){return new ii(e,t,n,r)}function oi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function si(e,t){var n=e.alternate;return n===null?(n=ai(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function ci(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function li(e,t,n,r,i,o){var s=0;if(r=e,typeof e==`function`)oi(e)&&(s=1);else if(typeof e==`string`)s=Uf(e,n,ae.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case O:return e=ai(31,n,t,i),e.elementType=O,e.lanes=o,e;case v:return ui(n.children,i,o,t);case y:s=8,i|=24;break;case b:return e=ai(12,n,t,i|2),e.elementType=b,e.lanes=o,e;case w:return e=ai(13,n,t,i),e.elementType=w,e.lanes=o,e;case T:return e=ai(19,n,t,i),e.elementType=T,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case S:s=10;break a;case x:s=9;break a;case C:s=11;break a;case E:s=14;break a;case D:s=16,r=null;break a}s=29,n=Error(a(130,e===null?`null`:typeof e,``)),r=null}return t=ai(s,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function ui(e,t,n,r){return e=ai(7,e,r,t),e.lanes=n,e}function di(e,t,n){return e=ai(6,e,null,t),e.lanes=n,e}function fi(e){var t=ai(18,null,null,0);return t.stateNode=e,t}function pi(e,t,n){return t=ai(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var mi=new WeakMap;function hi(e,t){if(typeof e==`object`&&e){var n=mi.get(e);return n===void 0?(t={value:e,source:t,stack:ve(t)},mi.set(e,t),t):n}return{value:e,source:t,stack:ve(t)}}var gi=[],_i=0,vi=null,yi=0,bi=[],xi=0,Si=null,Ci=1,wi=``;function Ti(e,t){gi[_i++]=yi,gi[_i++]=vi,vi=e,yi=t}function Ei(e,t,n){bi[xi++]=Ci,bi[xi++]=wi,bi[xi++]=Si,Si=e;var r=Ci;e=wi;var i=32-Ie(r)-1;r&=~(1<<i),n+=1;var a=32-Ie(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Ci=1<<32-Ie(t)+i|n<<i|r,wi=a+e}else Ci=1<<a|n<<i|r,wi=e}function Di(e){e.return!==null&&(Ti(e,1),Ei(e,1,0))}function Oi(e){for(;e===vi;)vi=gi[--_i],gi[_i]=null,yi=gi[--_i],gi[_i]=null;for(;e===Si;)Si=bi[--xi],bi[xi]=null,wi=bi[--xi],bi[xi]=null,Ci=bi[--xi],bi[xi]=null}function ki(e,t){bi[xi++]=Ci,bi[xi++]=wi,bi[xi++]=Si,Ci=t.id,wi=t.overflow,Si=e}var Ai=null,ji=null,V=!1,Mi=null,Ni=!1,Pi=Error(a(519));function Fi(e){throw Vi(hi(Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Pi}function Ii(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[at]=e,t[ot]=r,n){case`dialog`:Q(`cancel`,t),Q(`close`,t);break;case`iframe`:case`object`:case`embed`:Q(`load`,t);break;case`video`:case`audio`:for(n=0;n<_d.length;n++)Q(_d[n],t);break;case`source`:Q(`error`,t);break;case`img`:case`image`:case`link`:Q(`error`,t),Q(`load`,t);break;case`details`:Q(`toggle`,t);break;case`input`:Q(`invalid`,t),zt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Q(`invalid`,t);break;case`textarea`:Q(`invalid`,t),Ut(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||Md(t.textContent,n)?(r.popover!=null&&(Q(`beforetoggle`,t),Q(`toggle`,t)),r.onScroll!=null&&Q(`scroll`,t),r.onScrollEnd!=null&&Q(`scrollend`,t),r.onClick!=null&&(t.onclick=Qt),t=!0):t=!1,t||Fi(e,!0)}function Li(e){for(Ai=e.return;Ai;)switch(Ai.tag){case 5:case 31:case 13:Ni=!1;return;case 27:case 3:Ni=!0;return;default:Ai=Ai.return}}function Ri(e){if(e!==Ai)return!1;if(!V)return Li(e),V=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||Ud(e.type,e.memoizedProps)),n=!n),n&&ji&&Fi(e),Li(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(317));ji=uf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(317));ji=uf(e)}else t===27?(t=ji,Zd(e.type)?(e=lf,lf=null,ji=e):ji=t):ji=Ai?cf(e.stateNode.nextSibling):null;return!0}function zi(){ji=Ai=null,V=!1}function Bi(){var e=Mi;return e!==null&&(X===null?X=e:X.push.apply(X,e),Mi=null),e}function Vi(e){Mi===null?Mi=[e]:Mi.push(e)}var Hi=ie(null),Ui=null,Wi=null;function Gi(e,t,n){L(Hi,t._currentValue),t._currentValue=n}function Ki(e){e._currentValue=Hi.current,I(Hi)}function qi(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 Ji(e,t,n,r){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var o=i.dependencies;if(o!==null){var s=i.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=i;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),qi(o.return,n,e),r||(s=null);break a}o=c.next}}else if(i.tag===18){if(s=i.return,s===null)throw Error(a(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),qi(s,n,e),s=null}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===e){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}}function Yi(e,t,n,r){e=null;for(var i=t,o=!1;i!==null;){if(!o){if(i.flags&524288)o=!0;else if(i.flags&262144)break}if(i.tag===10){var s=i.alternate;if(s===null)throw Error(a(387));if(s=s.memoizedProps,s!==null){var c=i.type;yr(i.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(i===ce.current){if(s=i.alternate,s===null)throw Error(a(387));s.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e===null?e=[Qf]:e.push(Qf))}i=i.return}e!==null&&Ji(t,e,n,r),t.flags|=262144}function Xi(e){for(e=e.firstContext;e!==null;){if(!yr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Zi(e){Ui=e,Wi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Qi(e){return ea(Ui,e)}function $i(e,t){return Ui===null&&Zi(e),ea(e,t)}function ea(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Wi===null){if(e===null)throw Error(a(308));Wi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Wi=Wi.next=t;return n}var ta=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()})}},na=t.unstable_scheduleCallback,ra=t.unstable_NormalPriority,ia={$$typeof:S,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function aa(){return{controller:new ta,data:new Map,refCount:0}}function oa(e){e.refCount--,e.refCount===0&&na(ra,function(){e.controller.abort()})}var sa=null,ca=0,la=0,ua=null;function da(e,t){if(sa===null){var n=sa=[];ca=0,la=dd(),ua={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return ca++,t.then(fa,fa),t}function fa(){if(--ca===0&&sa!==null){ua!==null&&(ua.status=`fulfilled`);var e=sa;sa=null,la=0,ua=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function pa(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 ma=N.S;N.S=function(e,t){eu=we(),typeof t==`object`&&t&&typeof t.then==`function`&&da(e,t),ma!==null&&ma(e,t)};var ha=ie(null);function ga(){var e=ha.current;return e===null?Rl.pooledCache:e}function _a(e,t){t===null?L(ha,ha.current):L(ha,t.pool)}function va(){var e=ga();return e===null?null:{parent:ia._currentValue,pool:e}}var ya=Error(a(460)),ba=Error(a(474)),xa=Error(a(542)),Sa={then:function(){}};function Ca(e){return e=e.status,e===`fulfilled`||e===`rejected`}function wa(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Qt,Qt),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Oa(e),e;default:if(typeof t.status==`string`)t.then(Qt,Qt);else{if(e=Rl,e!==null&&100<e.shellSuspendCounter)throw Error(a(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,Oa(e),e}throw Ea=t,ya}}function Ta(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Ea=e,ya):e}}var Ea=null;function Da(){if(Ea===null)throw Error(a(459));var e=Ea;return Ea=null,e}function Oa(e){if(e===ya||e===xa)throw Error(a(483))}var ka=null,Aa=0;function ja(e){var t=Aa;return Aa+=1,ka===null&&(ka=[]),wa(ka,e,t)}function Ma(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Na(e,t){throw t.$$typeof===h?Error(a(525)):(e=Object.prototype.toString.call(t),Error(a(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Pa(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 i(e,t){return e=si(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=di(n,e.mode,r),t.return=e,t):(t=i(t,n),t.return=e,t)}function l(e,t,n,r){var a=n.type;return a===v?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===a||typeof a==`object`&&a&&a.$$typeof===D&&Ta(a)===t.type)?(t=i(t,n.props),Ma(t,n),t.return=e,t):(t=li(n.type,n.key,n.props,null,e.mode,r),Ma(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=pi(n,e.mode,r),t.return=e,t):(t=i(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,a){return t===null||t.tag!==7?(t=ui(n,e.mode,r,a),t.return=e,t):(t=i(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=di(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case g:return n=li(t.type,t.key,t.props,null,e.mode,n),Ma(n,t),n.return=e,n;case _:return t=pi(t,e.mode,n),t.return=e,t;case D:return t=Ta(t),f(e,t,n)}if(te(t)||A(t))return t=ui(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,ja(t),n);if(t.$$typeof===S)return f(e,$i(e,t),n);Na(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 g:return n.key===i?l(e,t,n,r):null;case _:return n.key===i?u(e,t,n,r):null;case D:return n=Ta(n),p(e,t,n,r)}if(te(n)||A(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,ja(n),r);if(n.$$typeof===S)return p(e,t,$i(e,n),r);Na(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 g:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case _:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case D:return r=Ta(r),m(e,t,n,r,i)}if(te(r)||A(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,ja(r),i);if(r.$$typeof===S)return m(e,t,n,$i(t,r),i);Na(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),V&&Ti(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 V&&Ti(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),V&&Ti(i,h),l}function y(i,s,c,l){if(c==null)throw Error(a(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(i,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(i,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(i,h),V&&Ti(i,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(i,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return V&&Ti(i,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,i,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(i,e)}),V&&Ti(i,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===v&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case g:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===v){if(r.tag===7){n(e,r.sibling),c=i(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===D&&Ta(l)===r.type){n(e,r.sibling),c=i(r,o.props),Ma(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===v?(c=ui(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=li(o.type,o.key,o.props,null,e.mode,c),Ma(c,o),c.return=e,e=c)}return s(e);case _: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=i(r,o.children||[]),c.return=e,e=c;break a}else{n(e,r);break}t(e,r),r=r.sibling}c=pi(o,e.mode,c),c.return=e,e=c}return s(e);case D:return o=Ta(o),b(e,r,o,c)}if(te(o))return h(e,r,o,c);if(A(o)){if(l=A(o),typeof l!=`function`)throw Error(a(150));return o=l.call(o),y(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,ja(o),c);if(o.$$typeof===S)return b(e,r,$i(e,o),c);Na(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=i(r,o),c.return=e,e=c):(n(e,r),c=di(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Aa=0;var i=b(e,t,n,r);return ka=null,i}catch(t){if(t===ya||t===xa)throw t;var a=ai(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Fa=Pa(!0),Ia=Pa(!1),La=!1;function Ra(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function za(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 Ba(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Va(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Ll&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ni(e),ti(e,null,n),t}return Qr(e,r,t,n),ni(e)}function Ha(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,Qe(e,n)}}function Ua(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Wa=!1;function Ga(){if(Wa){var e=ua;if(e!==null)throw e}}function Ka(e,t,n,r){Wa=!1;var i=e.updateQueue;La=!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&&(Wa=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,f);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,f=typeof h==`function`?h.call(_,d,f):h,f==null)break a;d=m({},d,f);break a;case 2:La=!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),Kl|=o,e.lanes=o,e.memoizedState=d}}function qa(e,t){if(typeof e!=`function`)throw Error(a(191,e));e.call(t)}function Ja(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)qa(n[e],t)}var Ya=ie(null),H=ie(0);function Xa(e,t){e=Wl,L(H,e),L(Ya,t),Wl=e|t.baseLanes}function Za(){L(H,Wl),L(Ya,Ya.current)}function Qa(){Wl=H.current,I(Ya),I(H)}var $a=ie(null),eo=null;function U(e){var t=e.alternate;L(ao,ao.current&1),L($a,e),eo===null&&(t===null||Ya.current!==null||t.memoizedState!==null)&&(eo=e)}function to(e){L(ao,ao.current),L($a,e),eo===null&&(eo=e)}function no(e){e.tag===22?(L(ao,ao.current),L($a,e),eo===null&&(eo=e)):ro(e)}function ro(){L(ao,ao.current),L($a,$a.current)}function io(e){I($a),eo===e&&(eo=null),I(ao)}var ao=ie(0);function oo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||af(n)||of(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var so=0,W=null,co=null,lo=null,uo=!1,fo=!1,po=!1,mo=0,ho=0,go=null,_o=0;function vo(){throw Error(a(321))}function yo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!yr(e[n],t[n]))return!1;return!0}function bo(e,t,n,r,i,a){return so=a,W=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,N.H=e===null||e.memoizedState===null?Ls:Rs,po=!1,a=n(r,i),po=!1,fo&&(a=So(t,n,r,i)),xo(e),a}function xo(e){N.H=Is;var t=co!==null&&co.next!==null;if(so=0,lo=co=W=null,uo=!1,ho=0,go=null,t)throw Error(a(300));e===null||ec||(e=e.dependencies,e!==null&&Xi(e)&&(ec=!0))}function So(e,t,n,r){W=e;var i=0;do{if(fo&&(go=null),ho=0,fo=!1,25<=i)throw Error(a(301));if(i+=1,lo=co=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=zs,o=t(n,r)}while(fo);return o}function Co(){var e=N.H,t=e.useState()[0];return t=typeof t.then==`function`?Ao(t):t,e=e.useState()[0],(co===null?null:co.memoizedState)!==e&&(W.flags|=1024),t}function wo(){var e=mo!==0;return mo=0,e}function To(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Eo(e){if(uo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}uo=!1}so=0,lo=co=W=null,fo=!1,ho=mo=0,go=null}function Do(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return lo===null?W.memoizedState=lo=e:lo=lo.next=e,lo}function Oo(){if(co===null){var e=W.alternate;e=e===null?null:e.memoizedState}else e=co.next;var t=lo===null?W.memoizedState:lo.next;if(t!==null)lo=t,co=e;else{if(e===null)throw W.alternate===null?Error(a(467)):Error(a(310));co=e,e={memoizedState:co.memoizedState,baseState:co.baseState,baseQueue:co.baseQueue,queue:co.queue,next:null},lo===null?W.memoizedState=lo=e:lo=lo.next=e}return lo}function ko(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ao(e){var t=ho;return ho+=1,go===null&&(go=[]),e=wa(go,e,t),t=W,(lo===null?t.memoizedState:lo.next)===null&&(t=t.alternate,N.H=t===null||t.memoizedState===null?Ls:Rs),e}function jo(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Ao(e);if(e.$$typeof===S)return Qi(e)}throw Error(a(438,String(e)))}function Mo(e){var t=null,n=W.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=W.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=ko(),W.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]=ee;return t.index++,n}function No(e,t){return typeof t==`function`?t(e):t}function Po(e){return Fo(Oo(),co,e)}function Fo(e,t,n){var r=e.queue;if(r===null)throw Error(a(311));r.lastRenderedReducer=n;var i=e.baseQueue,o=r.pending;if(o!==null){if(i!==null){var s=i.next;i.next=o.next,o.next=s}t.baseQueue=i=o,r.pending=null}if(o=e.baseState,i===null)e.memoizedState=o;else{t=i.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(so&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((so&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,W.lanes|=p,Kl|=p;f=u.action,po&&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,W.lanes|=f,Kl|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!yr(o,e.memoizedState)&&(ec=!0,d&&(n=ua,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return i===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Io(e){var t=Oo(),n=t.queue;if(n===null)throw Error(a(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,o=t.memoizedState;if(i!==null){n.pending=null;var s=i=i.next;do o=e(o,s.action),s=s.next;while(s!==i);yr(o,t.memoizedState)||(ec=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Lo(e,t,n){var r=W,i=Oo(),o=V;if(o){if(n===void 0)throw Error(a(407));n=n()}else n=t();var s=!yr((co||i).memoizedState,n);if(s&&(i.memoizedState=n,ec=!0),i=i.queue,cs(Bo.bind(null,r,i,e),[e]),i.getSnapshot!==t||s||lo!==null&&lo.memoizedState.tag&1){if(r.flags|=2048,rs(9,{destroy:void 0},zo.bind(null,r,i,n,t),null),Rl===null)throw Error(a(349));o||so&127||Ro(r,t,n)}return n}function Ro(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=W.updateQueue,t===null?(t=ko(),W.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function zo(e,t,n,r){t.value=n,t.getSnapshot=r,Vo(t)&&Ho(e)}function Bo(e,t,n){return n(function(){Vo(t)&&Ho(e)})}function Vo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!yr(e,n)}catch{return!0}}function Ho(e){var t=ei(e,2);t!==null&&hu(t,e,2)}function Uo(e){var t=Do();if(typeof e==`function`){var n=e;if(e=n(),po){Fe(!0);try{n()}finally{Fe(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:No,lastRenderedState:e},t}function Wo(e,t,n,r){return e.baseState=n,Fo(e,co,typeof r==`function`?r:No)}function Go(e,t,n,r,i){if(Ns(e))throw Error(a(485));if(e=t.action,e!==null){var o={payload:i,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,Ko(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Ko(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=N.T,o={};N.T=o;try{var s=n(i,r),c=N.S;c!==null&&c(o,s),qo(e,t,s)}catch(n){Yo(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),N.T=a}}else try{a=n(i,r),qo(e,t,a)}catch(n){Yo(e,t,n)}}function qo(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Jo(e,t,n)},function(n){return Yo(e,t,n)}):Jo(e,t,n)}function Jo(e,t,n){t.status=`fulfilled`,t.value=n,Xo(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Ko(e,n)))}function Yo(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Xo(t),t=t.next;while(t!==r)}e.action=null}function Xo(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Zo(e,t){return t}function Qo(e,t){if(V){var n=Rl.formState;if(n!==null){a:{var r=W;if(V){if(ji){b:{for(var i=ji,a=Ni;i.nodeType!==8;){if(!a){i=null;break b}if(i=cf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){ji=cf(i.nextSibling),r=i.data===`F!`;break a}}Fi(r)}r=!1}r&&(t=n[0])}}return n=Do(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Zo,lastRenderedState:t},n.queue=r,n=As.bind(null,W,r),r.dispatch=n,r=Uo(!1),a=Ms.bind(null,W,!1,r.queue),r=Do(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Go.bind(null,W,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function $o(e){return es(Oo(),co,e)}function es(e,t,n){if(t=Fo(e,t,Zo)[0],e=Po(No)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=Ao(t)}catch(e){throw e===ya?xa:e}else r=t;t=Oo();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(W.flags|=2048,rs(9,{destroy:void 0},ts.bind(null,i,n),null)),[r,a,e]}function ts(e,t){e.action=t}function ns(e){var t=Oo(),n=co;if(n!==null)return es(t,n,e);Oo(),t=t.memoizedState,n=Oo();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function rs(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=W.updateQueue,t===null&&(t=ko(),W.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 is(){return Oo().memoizedState}function as(e,t,n,r){var i=Do();W.flags|=e,i.memoizedState=rs(1|t,{destroy:void 0},n,r===void 0?null:r)}function os(e,t,n,r){var i=Oo();r=r===void 0?null:r;var a=i.memoizedState.inst;co!==null&&r!==null&&yo(r,co.memoizedState.deps)?i.memoizedState=rs(t,a,n,r):(W.flags|=e,i.memoizedState=rs(1|t,a,n,r))}function ss(e,t){as(8390656,8,e,t)}function cs(e,t){os(2048,8,e,t)}function ls(e){W.flags|=4;var t=W.updateQueue;if(t===null)t=ko(),W.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function us(e){var t=Oo().memoizedState;return ls({ref:t,nextImpl:e}),function(){if(Ll&2)throw Error(a(440));return t.impl.apply(void 0,arguments)}}function ds(e,t){return os(4,2,e,t)}function fs(e,t){return os(4,4,e,t)}function ps(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 ms(e,t,n){n=n==null?null:n.concat([e]),os(4,4,ps.bind(null,t,e),n)}function hs(){}function gs(e,t){var n=Oo();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 _s(e,t){var n=Oo();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&yo(t,r[1]))return r[0];if(r=e(),po){Fe(!0);try{e()}finally{Fe(!1)}}return n.memoizedState=[r,t],r}function vs(e,t,n){return n===void 0||so&1073741824&&!(Y&261930)?e.memoizedState=t:(e.memoizedState=n,e=mu(),W.lanes|=e,Kl|=e,n)}function ys(e,t,n,r){return yr(n,t)?n:Ya.current===null?!(so&42)||so&1073741824&&!(Y&261930)?(ec=!0,e.memoizedState=n):(e=mu(),W.lanes|=e,Kl|=e,t):(e=vs(e,n,r),yr(e,t)||(ec=!0),e)}function bs(e,t,n,r,i){var a=P.p;P.p=a!==0&&8>a?a:8;var o=N.T,s={};N.T=s,Ms(e,!1,t,n);try{var c=i(),l=N.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?js(e,t,pa(c,r),pu(e)):js(e,t,r,pu(e))}catch(n){js(e,t,{then:function(){},status:`rejected`,reason:n},pu())}finally{P.p=a,o!==null&&s.types!==null&&(o.types=s.types),N.T=o}}function xs(){}function Ss(e,t,n,r){if(e.tag!==5)throw Error(a(476));var i=Cs(e).queue;bs(e,i,t,F,n===null?xs:function(){return ws(e),n(r)})}function Cs(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:F,baseState:F,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:No,lastRenderedState:F},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:No,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function ws(e){var t=Cs(e);t.next===null&&(t=e.alternate.memoizedState),js(e,t.next.queue,{},pu())}function Ts(){return Qi(Qf)}function Es(){return Oo().memoizedState}function Ds(){return Oo().memoizedState}function Os(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=pu();e=Ba(n);var r=Va(t,e,n);r!==null&&(hu(r,t,n),Ha(r,t,n)),t={cache:aa()},e.payload=t;return}t=t.return}}function ks(e,t,n){var r=pu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Ns(e)?Ps(t,n):(n=$r(e,t,n,r),n!==null&&(hu(n,e,r),Fs(n,t,r)))}function As(e,t,n){js(e,t,n,pu())}function js(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ns(e))Ps(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,yr(s,o))return Qr(e,t,i,0),Rl===null&&Zr(),!1}catch{}if(n=$r(e,t,i,r),n!==null)return hu(n,e,r),Fs(n,t,r),!0}return!1}function Ms(e,t,n,r){if(r={lane:2,revertLane:dd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Ns(e)){if(t)throw Error(a(479))}else t=$r(e,n,r,2),t!==null&&hu(t,e,2)}function Ns(e){var t=e.alternate;return e===W||t!==null&&t===W}function Ps(e,t){fo=uo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Fs(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Qe(e,n)}}var Is={readContext:Qi,use:jo,useCallback:vo,useContext:vo,useEffect:vo,useImperativeHandle:vo,useLayoutEffect:vo,useInsertionEffect:vo,useMemo:vo,useReducer:vo,useRef:vo,useState:vo,useDebugValue:vo,useDeferredValue:vo,useTransition:vo,useSyncExternalStore:vo,useId:vo,useHostTransitionStatus:vo,useFormState:vo,useActionState:vo,useOptimistic:vo,useMemoCache:vo,useCacheRefresh:vo};Is.useEffectEvent=vo;var Ls={readContext:Qi,use:jo,useCallback:function(e,t){return Do().memoizedState=[e,t===void 0?null:t],e},useContext:Qi,useEffect:ss,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),as(4194308,4,ps.bind(null,t,e),n)},useLayoutEffect:function(e,t){return as(4194308,4,e,t)},useInsertionEffect:function(e,t){as(4,2,e,t)},useMemo:function(e,t){var n=Do();t=t===void 0?null:t;var r=e();if(po){Fe(!0);try{e()}finally{Fe(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Do();if(n!==void 0){var i=n(t);if(po){Fe(!0);try{n(t)}finally{Fe(!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=ks.bind(null,W,e),[r.memoizedState,e]},useRef:function(e){var t=Do();return e={current:e},t.memoizedState=e},useState:function(e){e=Uo(e);var t=e.queue,n=As.bind(null,W,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:hs,useDeferredValue:function(e,t){return vs(Do(),e,t)},useTransition:function(){var e=Uo(!1);return e=bs.bind(null,W,e.queue,!0,!1),Do().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=W,i=Do();if(V){if(n===void 0)throw Error(a(407));n=n()}else{if(n=t(),Rl===null)throw Error(a(349));Y&127||Ro(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,ss(Bo.bind(null,r,o,e),[e]),r.flags|=2048,rs(9,{destroy:void 0},zo.bind(null,r,o,n,t),null),n},useId:function(){var e=Do(),t=Rl.identifierPrefix;if(V){var n=wi,r=Ci;n=(r&~(1<<32-Ie(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=mo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=_o++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Ts,useFormState:Qo,useActionState:Qo,useOptimistic:function(e){var t=Do();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Ms.bind(null,W,!0,n),n.dispatch=t,[e,t]},useMemoCache:Mo,useCacheRefresh:function(){return Do().memoizedState=Os.bind(null,W)},useEffectEvent:function(e){var t=Do(),n={impl:e};return t.memoizedState=n,function(){if(Ll&2)throw Error(a(440));return n.impl.apply(void 0,arguments)}}},Rs={readContext:Qi,use:jo,useCallback:gs,useContext:Qi,useEffect:cs,useImperativeHandle:ms,useInsertionEffect:ds,useLayoutEffect:fs,useMemo:_s,useReducer:Po,useRef:is,useState:function(){return Po(No)},useDebugValue:hs,useDeferredValue:function(e,t){return ys(Oo(),co.memoizedState,e,t)},useTransition:function(){var e=Po(No)[0],t=Oo().memoizedState;return[typeof e==`boolean`?e:Ao(e),t]},useSyncExternalStore:Lo,useId:Es,useHostTransitionStatus:Ts,useFormState:$o,useActionState:$o,useOptimistic:function(e,t){return Wo(Oo(),co,e,t)},useMemoCache:Mo,useCacheRefresh:Ds};Rs.useEffectEvent=us;var zs={readContext:Qi,use:jo,useCallback:gs,useContext:Qi,useEffect:cs,useImperativeHandle:ms,useInsertionEffect:ds,useLayoutEffect:fs,useMemo:_s,useReducer:Io,useRef:is,useState:function(){return Io(No)},useDebugValue:hs,useDeferredValue:function(e,t){var n=Oo();return co===null?vs(n,e,t):ys(n,co.memoizedState,e,t)},useTransition:function(){var e=Io(No)[0],t=Oo().memoizedState;return[typeof e==`boolean`?e:Ao(e),t]},useSyncExternalStore:Lo,useId:Es,useHostTransitionStatus:Ts,useFormState:ns,useActionState:ns,useOptimistic:function(e,t){var n=Oo();return co===null?(n.baseState=e,[e,n.queue.dispatch]):Wo(n,co,e,t)},useMemoCache:Mo,useCacheRefresh:Ds};zs.useEffectEvent=us;function Bs(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:m({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Vs={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=pu(),i=Ba(r);i.payload=t,n!=null&&(i.callback=n),t=Va(e,i,r),t!==null&&(hu(t,e,r),Ha(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=pu(),i=Ba(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Va(e,i,r),t!==null&&(hu(t,e,r),Ha(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=pu(),r=Ba(n);r.tag=2,t!=null&&(r.callback=t),t=Va(e,r,n),t!==null&&(hu(t,e,n),Ha(t,e,n))}};function Hs(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?!br(n,r)||!br(i,a):!0}function Us(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&&Vs.enqueueReplaceState(t,t.state,null)}function Ws(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=m({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Gs(e){qr(e)}function Ks(e){console.error(e)}function qs(e){qr(e)}function Js(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Ys(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 Xs(e,t,n){return n=Ba(n),n.tag=3,n.payload={element:null},n.callback=function(){Js(e,t)},n}function Zs(e){return e=Ba(e),e.tag=3,e}function Qs(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(){Ys(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Ys(t,n,r),typeof i!=`function`&&(ru===null?ru=new Set([this]):ru.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function $s(e,t,n,r,i){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Yi(t,n,i,!0),n=$a.current,n!==null){switch(n.tag){case 31:case 13:return eo===null?Du():n.alternate===null&&Gl===0&&(Gl=3),n.flags&=-257,n.flags|=65536,n.lanes=i,r===Sa?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Gu(e,r,i)),!1;case 22:return n.flags|=65536,r===Sa?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)),Gu(e,r,i)),!1}throw Error(a(435,n.tag))}return Gu(e,r,i),Du(),!1}if(V)return t=$a.current,t===null?(r!==Pi&&(t=Error(a(423),{cause:r}),Vi(hi(t,n))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,r=hi(r,n),i=Xs(e.stateNode,r,i),Ua(e,i),Gl!==4&&(Gl=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=i,r!==Pi&&(e=Error(a(422),{cause:r}),Vi(hi(e,n)))),!1;var o=Error(a(520),{cause:r});if(o=hi(o,n),Zl===null?Zl=[o]:Zl.push(o),Gl!==4&&(Gl=2),t===null)return!0;r=hi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=i&-i,n.lanes|=e,e=Xs(n.stateNode,r,e),Ua(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`&&(ru===null||!ru.has(o))))return n.flags|=65536,i&=-i,n.lanes|=i,i=Zs(i),Qs(i,e,n,r),Ua(n,i),!1}n=n.return}while(n!==null);return!1}var G=Error(a(461)),ec=!1;function nc(e,t,n,r){t.child=e===null?Ia(t,null,n,r):Fa(t,e.child,n,r)}function rc(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 Zi(t),r=bo(e,t,n,o,a,i),s=wo(),e!==null&&!ec?(To(e,t,i),Dc(e,t,i)):(V&&s&&Di(t),t.flags|=1,nc(e,t,r,i),t.child)}function ic(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!oi(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,ac(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,!Oc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?br:n,n(o,r)&&e.ref===t.ref)return Dc(e,t,i)}return t.flags|=1,e=si(a,r),e.ref=t.ref,e.return=t,t.child=e}function ac(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(br(a,r)&&e.ref===t.ref)if(ec=!1,t.pendingProps=r=a,Oc(e,i))e.flags&131072&&(ec=!0);else return t.lanes=e.lanes,Dc(e,t,i)}return pc(e,t,n,r,i)}function oc(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 cc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&_a(t,a===null?null:a.cachePool),a===null?Za():Xa(t,a),no(t);else return r=t.lanes=536870912,cc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&_a(t,null),Za(),ro(t)):(_a(t,a.cachePool),Xa(t,a),ro(t),t.memoizedState=null);return nc(e,t,i,n),t.child}function sc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function cc(e,t,n,r,i){var a=ga();return a=a===null?null:{parent:ia._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&_a(t,null),Za(),no(t),e!==null&&Yi(e,t,r,!0),t.childLanes=i,null}function lc(e,t){return t=Sc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function uc(e,t,n){return Fa(t,e.child,null,n),e=lc(t,t.pendingProps),e.flags|=2,io(t),t.memoizedState=null,e}function dc(e,t,n){var r=t.pendingProps,i=!!(t.flags&128);if(t.flags&=-129,e===null){if(V){if(r.mode===`hidden`)return e=lc(t,r),t.lanes=536870912,sc(null,e);if(to(t),(e=ji)?(e=rf(e,Ni),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Si===null?null:{id:Ci,overflow:wi},retryLane:536870912,hydrationErrors:null},n=fi(e),n.return=t,t.child=n,Ai=t,ji=null)):e=null,e===null)throw Fi(t);return t.lanes=536870912,null}return lc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(to(t),i)if(t.flags&256)t.flags&=-257,t=uc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(a(558));else if(ec||Yi(e,t,n,!1),i=(n&e.childLanes)!==0,ec||i){if(r=Rl,r!==null&&(s=$e(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,ei(e,s),hu(r,e,s),G;Du(),t=uc(e,t,n)}else e=o.treeContext,ji=cf(s.nextSibling),Ai=t,V=!0,Mi=null,Ni=!1,e!==null&&ki(t,e),t=lc(t,r),t.flags|=4096;return t}return e=si(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function fc(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(a(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function pc(e,t,n,r,i){return Zi(t),n=bo(e,t,n,r,void 0,i),r=wo(),e!==null&&!ec?(To(e,t,i),Dc(e,t,i)):(V&&r&&Di(t),t.flags|=1,nc(e,t,n,i),t.child)}function mc(e,t,n,r,i,a){return Zi(t),t.updateQueue=null,n=So(t,r,n,i),xo(e),r=wo(),e!==null&&!ec?(To(e,t,a),Dc(e,t,a)):(V&&r&&Di(t),t.flags|=1,nc(e,t,n,a),t.child)}function hc(e,t,n,r,i){if(Zi(t),t.stateNode===null){var a=ri,o=n.contextType;typeof o==`object`&&o&&(a=Qi(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Vs,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Ra(t),o=n.contextType,a.context=typeof o==`object`&&o?Qi(o):ri,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Bs(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&&Vs.enqueueReplaceState(a,a.state,null),Ka(t,r,a,i),Ga(),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=Ws(n,s);a.props=c;var l=a.context,u=n.contextType;o=ri,typeof u==`object`&&u&&(o=Qi(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)&&Us(t,a,r,o),La=!1;var f=t.memoizedState;a.state=f,Ka(t,r,a,i),Ga(),l=t.memoizedState,s||f!==l||La?(typeof d==`function`&&(Bs(t,n,d,r),l=t.memoizedState),(c=La||Hs(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,za(e,t),o=t.memoizedProps,u=Ws(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=ri,typeof l==`object`&&l&&(c=Qi(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)&&Us(t,a,r,c),La=!1,f=t.memoizedState,a.state=f,Ka(t,r,a,i),Ga();var p=t.memoizedState;o!==d||f!==p||La||e!==null&&e.dependencies!==null&&Xi(e.dependencies)?(typeof s==`function`&&(Bs(t,n,s,r),p=t.memoizedState),(u=La||Hs(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Xi(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,fc(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=Fa(t,e.child,null,i),t.child=Fa(t,null,n,i)):nc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Dc(e,t,i),e}function gc(e,t,n,r){return zi(),t.flags|=256,nc(e,t,n,r),t.child}var _c={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function vc(e){return{baseLanes:e,cachePool:va()}}function yc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=Yl),e}function bc(e,t,n){var r=t.pendingProps,i=!1,o=!!(t.flags&128),s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:!!(ao.current&2)),s&&(i=!0,t.flags&=-129),s=!!(t.flags&32),t.flags&=-33,e===null){if(V){if(i?U(t):ro(t),(e=ji)?(e=rf(e,Ni),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Si===null?null:{id:Ci,overflow:wi},retryLane:536870912,hydrationErrors:null},n=fi(e),n.return=t,t.child=n,Ai=t,ji=null)):e=null,e===null)throw Fi(t);return of(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,i?(ro(t),i=t.mode,c=Sc({mode:`hidden`,children:c},i),r=ui(r,i,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=vc(n),r.childLanes=yc(e,s,n),t.memoizedState=_c,sc(null,r)):(U(t),xc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(U(t),t.flags&=-257,t=Cc(e,t,n)):t.memoizedState===null?(ro(t),c=r.fallback,i=t.mode,r=Sc({mode:`visible`,children:r.children},i),c=ui(c,i,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Fa(t,e.child,null,n),r=t.child,r.memoizedState=vc(n),r.childLanes=yc(e,s,n),t.memoizedState=_c,t=sc(null,r)):(ro(t),t.child=e.child,t.flags|=128,t=null);else if(U(t),of(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(a(419)),r.stack=``,r.digest=s,Vi({value:r,source:null,stack:null}),t=Cc(e,t,n)}else if(ec||Yi(e,t,n,!1),s=(n&e.childLanes)!==0,ec||s){if(s=Rl,s!==null&&(r=$e(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,ei(e,r),hu(s,e,r),G;af(c)||Du(),t=Cc(e,t,n)}else af(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,ji=cf(c.nextSibling),Ai=t,V=!0,Mi=null,Ni=!1,e!==null&&ki(t,e),t=xc(t,r.children),t.flags|=4096);return t}return i?(ro(t),c=r.fallback,i=t.mode,l=e.child,u=l.sibling,r=si(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=ui(c,i,n,null),c.flags|=2):c=si(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,sc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=vc(n):(i=c.cachePool,i===null?i=va():(l=ia._currentValue,i=i.parent===l?i:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:i}),r.memoizedState=c,r.childLanes=yc(e,s,n),t.memoizedState=_c,sc(e.child,r)):(U(t),n=e.child,e=n.sibling,n=si(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function xc(e,t){return t=Sc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Sc(e,t){return e=ai(22,e,null,t),e.lanes=0,e}function Cc(e,t,n){return Fa(t,e.child,null,n),e=xc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function wc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),qi(e.return,t,n)}function Tc(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 Ec(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=ao.current,s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,L(ao,o),nc(e,t,r,n),r=V?yi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&wc(e,n,t);else if(e.tag===19)wc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&oo(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Tc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&oo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Tc(t,!0,n,null,a,r);break;case`together`:Tc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Dc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Kl|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Yi(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(a(153));if(t.child!==null){for(e=t.child,n=si(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=si(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Oc(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&Xi(e)))}function kc(e,t,n){switch(t.tag){case 3:R(t,t.stateNode.containerInfo),Gi(t,ia,e.memoizedState.cache),zi();break;case 27:case 5:ue(t);break;case 4:R(t,t.stateNode.containerInfo);break;case 10:Gi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,to(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(U(t),e=Dc(e,t,n),e===null?null:e.sibling):bc(e,t,n):(U(t),t.flags|=128,null);U(t);break;case 19:var i=!!(e.flags&128);if(r=(n&t.childLanes)!==0,r||=(Yi(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Ec(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),L(ao,ao.current),r)break;return null;case 22:return t.lanes=0,oc(e,t,n,t.pendingProps);case 24:Gi(t,ia,e.memoizedState.cache)}return Dc(e,t,n)}function Ac(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)ec=!0;else{if(!Oc(e,n)&&!(t.flags&128))return ec=!1,kc(e,t,n);ec=!!(e.flags&131072)}else ec=!1,V&&t.flags&1048576&&Ei(t,yi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Ta(t.elementType),t.type=e,typeof e==`function`)oi(e)?(r=Ws(e,r),t.tag=1,t=hc(null,t,e,r,n)):(t.tag=0,t=pc(null,t,e,r,n));else{if(e!=null){var i=e.$$typeof;if(i===C){t.tag=11,t=rc(null,t,e,r,n);break a}if(i===E){t.tag=14,t=ic(null,t,e,r,n);break a}}throw t=M(e)||e,Error(a(306,t,``))}}return t;case 0:return pc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,i=Ws(r,t.pendingProps),hc(e,t,r,i,n);case 3:a:{if(R(t,t.stateNode.containerInfo),e===null)throw Error(a(387));r=t.pendingProps;var o=t.memoizedState;i=o.element,za(e,t),Ka(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Gi(t,ia,r),r!==o.cache&&Ji(t,[ia],n,!0),Ga(),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}else if(r!==i){i=hi(Error(a(424)),t),Vi(i),t=gc(e,t,r,n);break a}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(ji=cf(e.firstChild),Ai=t,V=!0,Mi=null,Ni=!0,n=Ia(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(zi(),r===i){t=Dc(e,t,n);break a}nc(e,t,r,n)}t=t.child}return t;case 26:return fc(e,t),e===null?(n=kf(t.type,null,t.pendingProps,null))?t.memoizedState=n:V||(n=t.type,e=t.pendingProps,r=Bd(se.current).createElement(n),r[at]=t,r[ot]=e,Pd(r,n,e),vt(r),t.stateNode=r):t.memoizedState=kf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ue(t),e===null&&V&&(r=t.stateNode=ff(t.type,t.pendingProps,se.current),Ai=t,Ni=!0,i=ji,Zd(t.type)?(lf=i,ji=cf(r.firstChild)):ji=i),nc(e,t,t.pendingProps.children,n),fc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&V&&((i=r=ji)&&(r=tf(r,t.type,t.pendingProps,Ni),r===null?i=!1:(t.stateNode=r,Ai=t,ji=cf(r.firstChild),Ni=!1,i=!0)),i||Fi(t)),ue(t),i=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Ud(i,o)?r=null:s!==null&&Ud(i,s)&&(t.flags|=32),t.memoizedState!==null&&(i=bo(e,t,Co,null,null,n),Qf._currentValue=i),fc(e,t),nc(e,t,r,n),t.child;case 6:return e===null&&V&&((e=n=ji)&&(n=nf(n,t.pendingProps,Ni),n===null?e=!1:(t.stateNode=n,Ai=t,ji=null,e=!0)),e||Fi(t)),null;case 13:return bc(e,t,n);case 4:return R(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Fa(t,null,r,n):nc(e,t,r,n),t.child;case 11:return rc(e,t,t.type,t.pendingProps,n);case 7:return nc(e,t,t.pendingProps,n),t.child;case 8:return nc(e,t,t.pendingProps.children,n),t.child;case 12:return nc(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Gi(t,t.type,r.value),nc(e,t,r.children,n),t.child;case 9:return i=t.type._context,r=t.pendingProps.children,Zi(t),i=Qi(i),r=r(i),t.flags|=1,nc(e,t,r,n),t.child;case 14:return ic(e,t,t.type,t.pendingProps,n);case 15:return ac(e,t,t.type,t.pendingProps,n);case 19:return Ec(e,t,n);case 31:return dc(e,t,n);case 22:return oc(e,t,n,t.pendingProps);case 24:return Zi(t),r=Qi(ia),e===null?(i=ga(),i===null&&(i=Rl,o=aa(),i.pooledCache=o,o.refCount++,o!==null&&(i.pooledCacheLanes|=n),i=o),t.memoizedState={parent:r,cache:i},Ra(t),Gi(t,ia,i)):((e.lanes&n)!==0&&(za(e,t),Ka(t,null,null,n),Ga()),i=e.memoizedState,o=t.memoizedState,i.parent===r?(r=o.cache,Gi(t,ia,r),r!==i.cache&&Ji(t,[ia],n,!0)):(i={parent:r,cache:r},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),Gi(t,ia,r))),nc(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(a(156,t.tag))}function jc(e){e.flags|=4}function Mc(e,t,n,r,i){if((t=!!(e.mode&32))&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(wu())e.flags|=8192;else throw Ea=Sa,ba}else e.flags&=-16777217}function Nc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Wf(t))if(wu())e.flags|=8192;else throw Ea=Sa,ba}function Pc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:qe(),e.lanes|=t,Xl|=t)}function Fc(e,t){if(!V)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Ic(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Lc(e,t,n){var r=t.pendingProps;switch(Oi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ic(t),null;case 1:return Ic(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Ki(ia),le(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Ri(t)?jc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Bi())),Ic(t),null;case 26:var i=t.type,o=t.memoizedState;return e===null?(jc(t),o===null?(Ic(t),Mc(t,i,null,r,n)):(Ic(t),Nc(t,o))):o?o===e.memoizedState?(Ic(t),t.flags&=-16777217):(jc(t),Ic(t),Nc(t,o)):(e=e.memoizedProps,e!==r&&jc(t),Ic(t),Mc(t,i,e,r,n)),null;case 27:if(de(t),n=se.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&jc(t);else{if(!r){if(t.stateNode===null)throw Error(a(166));return Ic(t),null}e=ae.current,Ri(t)?Ii(t,e):(e=ff(i,r,n),t.stateNode=e,jc(t))}return Ic(t),null;case 5:if(de(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&jc(t);else{if(!r){if(t.stateNode===null)throw Error(a(166));return Ic(t),null}if(o=ae.current,Ri(t))Ii(t,o);else{var s=Bd(se.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,i);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,i);break;default:switch(i){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,i);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,i);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(i,{is:r.is}):s.createElement(i)}}o[at]=t,o[ot]=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(Pd(o,i,r),i){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&jc(t)}}return Ic(t),Mc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&jc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(a(166));if(e=se.current,Ri(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,i=Ai,i!==null)switch(i.tag){case 27:case 5:r=i.memoizedProps}e[at]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Md(e.nodeValue,n)),e||Fi(t,!0)}else e=Bd(e).createTextNode(r),e[at]=t,t.stateNode=e}return Ic(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Ri(t),n!==null){if(e===null){if(!r)throw Error(a(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(557));e[at]=t}else zi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ic(t),e=!1}else n=Bi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(io(t),t):(io(t),null);if(t.flags&128)throw Error(a(558))}return Ic(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=Ri(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(a(318));if(i=t.memoizedState,i=i===null?null:i.dehydrated,!i)throw Error(a(317));i[at]=t}else zi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ic(t),i=!1}else i=Bi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(io(t),t):(io(t),null)}return io(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,i=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(i=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==i&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Pc(t,t.updateQueue),Ic(t),null);case 4:return le(),e===null&&Sd(t.stateNode.containerInfo),Ic(t),null;case 10:return Ki(t.type),Ic(t),null;case 19:if(I(ao),r=t.memoizedState,r===null)return Ic(t),null;if(i=!!(t.flags&128),o=r.rendering,o===null)if(i)Fc(r,!1);else{if(Gl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=oo(e),o!==null){for(t.flags|=128,Fc(r,!1),e=o.updateQueue,t.updateQueue=e,Pc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ci(n,e),n=n.sibling;return L(ao,ao.current&1|2),V&&Ti(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&we()>tu&&(t.flags|=128,i=!0,Fc(r,!1),t.lanes=4194304)}else{if(!i)if(e=oo(o),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,Pc(t,e),Fc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!V)return Ic(t),null}else 2*we()-r.renderingStartTime>tu&&n!==536870912&&(t.flags|=128,i=!0,Fc(r,!1),t.lanes=4194304);r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Ic(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=we(),e.sibling=null,n=ao.current,L(ao,i?n&1|2:n&1),V&&Ti(t,r.treeForkCount),e);case 22:case 23:return io(t),Qa(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Ic(t),t.subtreeFlags&6&&(t.flags|=8192)):Ic(t),n=t.updateQueue,n!==null&&Pc(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&&I(ha),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Ki(ia),Ic(t),null;case 25:return null;case 30:return null}throw Error(a(156,t.tag))}function K(e,t){switch(Oi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ki(ia),le(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return de(t),null;case 31:if(t.memoizedState!==null){if(io(t),t.alternate===null)throw Error(a(340));zi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(io(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(a(340));zi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return I(ao),null;case 4:return le(),null;case 10:return Ki(t.type),null;case 22:case 23:return io(t),Qa(),e!==null&&I(ha),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ki(ia),null;case 25:return null;default:return null}}function Rc(e,t){switch(Oi(t),t.tag){case 3:Ki(ia),le();break;case 26:case 27:case 5:de(t);break;case 4:le();break;case 31:t.memoizedState!==null&&io(t);break;case 13:io(t);break;case 19:I(ao);break;case 10:Ki(t.type);break;case 22:case 23:io(t),Qa(),e!==null&&I(ha);break;case 24:Ki(ia)}}function zc(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){Z(t,t.return,e)}}function Bc(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){Z(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Z(t,t.return,e)}}function Vc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Ja(t,n)}catch(t){Z(e,e.return,t)}}}function Hc(e,t,n){n.props=Ws(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Z(e,t,n)}}function Uc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Z(e,t,n)}}function Wc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){Z(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){Z(e,t,n)}else n.current=null}function Gc(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){Z(e,e.return,t)}}function Kc(e,t,n){try{var r=e.stateNode;Fd(r,e.type,n,t),r[ot]=t}catch(t){Z(e,e.return,t)}}function qc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Zd(e.type)||e.tag===4}function Jc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||qc(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&&Zd(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 Yc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Qt));else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Yc(e,t,n),e=e.sibling;e!==null;)Yc(e,t,n),e=e.sibling}function Xc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Xc(e,t,n),e=e.sibling;e!==null;)Xc(e,t,n),e=e.sibling}function Zc(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Pd(t,r,n),t[at]=e,t[ot]=n}catch(t){Z(e,e.return,t)}}var Qc=!1,$c=!1,el=!1,tl=typeof WeakSet==`function`?WeakSet:Set,nl=null;function rl(e,t){if(e=e.containerInfo,Rd=sp,e=wr(e),Tr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||i!==0&&f.nodeType!==3||(c=s+i),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===i&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(zd={focusedElem:e,selectionRange:n},sp=!1,nl=t;nl!==null;)if(t=nl,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,nl=e;else for(;nl!==null;){switch(t=nl,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)i=e[n],i.ref.impl=i.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,i=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=Ws(n.type,i);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Z(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)ef(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:ef(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(a(163))}if(e=t.sibling,e!==null){e.return=t.return,nl=e;break}nl=t.return}}function il(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:vl(e,n),r&4&&zc(5,n);break;case 1:if(vl(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Z(n,n.return,e)}else{var i=Ws(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Z(n,n.return,e)}}r&64&&Vc(n),r&512&&Uc(n,n.return);break;case 3:if(vl(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{Ja(e,t)}catch(e){Z(n,n.return,e)}}break;case 27:t===null&&r&4&&Zc(n);case 26:case 5:vl(e,n),t===null&&r&4&&Gc(n),r&512&&Uc(n,n.return);break;case 12:vl(e,n);break;case 31:vl(e,n),r&4&&ll(e,n);break;case 13:vl(e,n),r&4&&ul(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Ju.bind(null,n),sf(e,n))));break;case 22:if(r=n.memoizedState!==null||Qc,!r){t=t!==null&&t.memoizedState!==null||$c,i=Qc;var a=$c;Qc=r,($c=t)&&!a?bl(e,n,!!(n.subtreeFlags&8772)):vl(e,n),Qc=i,$c=a}break;case 30:break;default:vl(e,n)}}function al(e){var t=e.alternate;t!==null&&(e.alternate=null,al(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&pt(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 q=null,ol=!1;function sl(e,t,n){for(n=n.child;n!==null;)cl(e,t,n),n=n.sibling}function cl(e,t,n){if(Pe&&typeof Pe.onCommitFiberUnmount==`function`)try{Pe.onCommitFiberUnmount(Ne,n)}catch{}switch(n.tag){case 26:$c||Wc(n,t),sl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:$c||Wc(n,t);var r=q,i=ol;Zd(n.type)&&(q=n.stateNode,ol=!1),sl(e,t,n),pf(n.stateNode),q=r,ol=i;break;case 5:$c||Wc(n,t);case 6:if(r=q,i=ol,q=null,sl(e,t,n),q=r,ol=i,q!==null)if(ol)try{(q.nodeType===9?q.body:q.nodeName===`HTML`?q.ownerDocument.body:q).removeChild(n.stateNode)}catch(e){Z(n,t,e)}else try{q.removeChild(n.stateNode)}catch(e){Z(n,t,e)}break;case 18:q!==null&&(ol?(e=q,Qd(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Np(e)):Qd(q,n.stateNode));break;case 4:r=q,i=ol,q=n.stateNode.containerInfo,ol=!0,sl(e,t,n),q=r,ol=i;break;case 0:case 11:case 14:case 15:Bc(2,n,t),$c||Bc(4,n,t),sl(e,t,n);break;case 1:$c||(Wc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Hc(n,t,r)),sl(e,t,n);break;case 21:sl(e,t,n);break;case 22:$c=(r=$c)||n.memoizedState!==null,sl(e,t,n),$c=r;break;default:sl(e,t,n)}}function ll(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Np(e)}catch(e){Z(t,t.return,e)}}}function ul(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Np(e)}catch(e){Z(t,t.return,e)}}function dl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new tl),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new tl),t;default:throw Error(a(435,e.tag))}}function fl(e,t){var n=dl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Yu.bind(null,e,t);t.then(r,r)}})}function pl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(Zd(c.type)){q=c.stateNode,ol=!1;break a}break;case 5:q=c.stateNode,ol=!1;break a;case 3:case 4:q=c.stateNode.containerInfo,ol=!0;break a}c=c.return}if(q===null)throw Error(a(160));cl(o,s,i),q=null,ol=!1,o=i.alternate,o!==null&&(o.return=null),i.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)hl(t,e),t=t.sibling}var ml=null;function hl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:pl(t,e),gl(e),r&4&&(Bc(3,e,e.return),zc(3,e),Bc(5,e,e.return));break;case 1:pl(t,e),gl(e),r&512&&($c||n===null||Wc(n,n.return)),r&64&&Qc&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var i=ml;if(pl(t,e),gl(e),r&512&&($c||n===null||Wc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,i=i.ownerDocument||i;b:switch(r){case`title`:o=i.getElementsByTagName(`title`)[0],(!o||o[ft]||o[at]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=i.createElement(r),i.head.insertBefore(o,i.querySelector(`head > title`))),Pd(o,r,n),o[at]=e,vt(o),r=o;break a;case`link`:var s=Vf(`link`,`href`,i).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=i.createElement(r),Pd(o,r,n),i.head.appendChild(o);break;case`meta`:if(s=Vf(`meta`,`content`,i).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=i.createElement(r),Pd(o,r,n),i.head.appendChild(o);break;default:throw Error(a(468,r))}o[at]=e,vt(o),r=o}e.stateNode=r}else Hf(i,e.type,e.stateNode);else e.stateNode=If(i,r,e.memoizedProps);else o===r?r===null&&e.stateNode!==null&&Kc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Hf(i,e.type,e.stateNode):If(i,r,e.memoizedProps))}break;case 27:pl(t,e),gl(e),r&512&&($c||n===null||Wc(n,n.return)),n!==null&&r&4&&Kc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(pl(t,e),gl(e),r&512&&($c||n===null||Wc(n,n.return)),e.flags&32){i=e.stateNode;try{Wt(i,``)}catch(t){Z(e,e.return,t)}}r&4&&e.stateNode!=null&&(i=e.memoizedProps,Kc(e,i,n===null?i:n.memoizedProps)),r&1024&&(el=!0);break;case 6:if(pl(t,e),gl(e),r&4){if(e.stateNode===null)throw Error(a(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Z(e,e.return,t)}}break;case 3:if(Bf=null,i=ml,ml=gf(t.containerInfo),pl(t,e),ml=i,gl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Np(t.containerInfo)}catch(t){Z(e,e.return,t)}el&&(el=!1,_l(e));break;case 4:r=ml,ml=gf(e.stateNode.containerInfo),pl(t,e),gl(e),ml=r;break;case 12:pl(t,e),gl(e);break;case 31:pl(t,e),gl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,fl(e,r)));break;case 13:pl(t,e),gl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&($l=we()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,fl(e,r)));break;case 22:i=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=Qc,d=$c;if(Qc=u||i,$c=d||l,pl(t,e),$c=d,Qc=u,gl(e),r&8192)a:for(t=e.stateNode,t._visibility=i?t._visibility&-2:t._visibility|1,i&&(n===null||l||Qc||$c||yl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,i)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){Z(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=i?``:l.memoizedProps}catch(e){Z(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;i?$d(m,!0):$d(l.stateNode,!1)}catch(e){Z(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,fl(e,n))));break;case 19:pl(t,e),gl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,fl(e,r)));break;case 30:break;case 21:break;default:pl(t,e),gl(e)}}function gl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(qc(r)){n=r;break}r=r.return}if(n==null)throw Error(a(160));switch(n.tag){case 27:var i=n.stateNode;Xc(e,Jc(e),i);break;case 5:var o=n.stateNode;n.flags&32&&(Wt(o,``),n.flags&=-33),Xc(e,Jc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;Yc(e,Jc(e),s);break;default:throw Error(a(161))}}catch(t){Z(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function _l(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;_l(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function vl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)il(e,t.alternate,t),t=t.sibling}function yl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Bc(4,t,t.return),yl(t);break;case 1:Wc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Hc(t,t.return,n),yl(t);break;case 27:pf(t.stateNode);case 26:case 5:Wc(t,t.return),yl(t);break;case 22:t.memoizedState===null&&yl(t);break;case 30:yl(t);break;default:yl(t)}e=e.sibling}}function bl(e,t,n){for(n&&=!!(t.subtreeFlags&8772),t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:bl(i,a,n),zc(4,a);break;case 1:if(bl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Z(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)qa(c[i],s)}catch(e){Z(r,r.return,e)}}n&&o&64&&Vc(a),Uc(a,a.return);break;case 27:Zc(a);case 26:case 5:bl(i,a,n),n&&r===null&&o&4&&Gc(a),Uc(a,a.return);break;case 12:bl(i,a,n);break;case 31:bl(i,a,n),n&&o&4&&ll(i,a);break;case 13:bl(i,a,n),n&&o&4&&ul(i,a);break;case 22:a.memoizedState===null&&bl(i,a,n),Uc(a,a.return);break;case 30:break;default:bl(i,a,n)}t=t.sibling}}function xl(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&&oa(n))}function Sl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&oa(e))}function Cl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)wl(e,t,n,r),t=t.sibling}function wl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Cl(e,t,n,r),i&2048&&zc(9,t);break;case 1:Cl(e,t,n,r);break;case 3:Cl(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&oa(e)));break;case 12:if(i&2048){Cl(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){Z(t,t.return,e)}}else Cl(e,t,n,r);break;case 31:Cl(e,t,n,r);break;case 13:Cl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?Cl(e,t,n,r):(a._visibility|=2,Tl(e,t,n,r,!!(t.subtreeFlags&10256)||!1)):a._visibility&2?Cl(e,t,n,r):El(e,t),i&2048&&xl(o,t);break;case 24:Cl(e,t,n,r),i&2048&&Sl(t.alternate,t);break;default:Cl(e,t,n,r)}}function Tl(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:Tl(a,o,s,c,i),zc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Tl(a,o,s,c,i)):u._visibility&2?Tl(a,o,s,c,i):El(a,o),i&&l&2048&&xl(o.alternate,o);break;case 24:Tl(a,o,s,c,i),i&&l&2048&&Sl(o.alternate,o);break;default:Tl(a,o,s,c,i)}t=t.sibling}}function El(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:El(n,r),i&2048&&xl(r.alternate,r);break;case 24:El(n,r),i&2048&&Sl(r.alternate,r);break;default:El(n,r)}t=t.sibling}}var Dl=8192;function Ol(e,t,n){if(e.subtreeFlags&Dl)for(e=e.child;e!==null;)kl(e,t,n),e=e.sibling}function kl(e,t,n){switch(e.tag){case 26:Ol(e,t,n),e.flags&Dl&&e.memoizedState!==null&&Gf(n,ml,e.memoizedState,e.memoizedProps);break;case 5:Ol(e,t,n);break;case 3:case 4:var r=ml;ml=gf(e.stateNode.containerInfo),Ol(e,t,n),ml=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Dl,Dl=16777216,Ol(e,t,n),Dl=r):Ol(e,t,n));break;default:Ol(e,t,n)}}function Al(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 jl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];nl=r,Pl(r,e)}Al(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Ml(e),e=e.sibling}function Ml(e){switch(e.tag){case 0:case 11:case 15:jl(e),e.flags&2048&&Bc(9,e,e.return);break;case 3:jl(e);break;case 12:jl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Nl(e)):jl(e);break;default:jl(e)}}function Nl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];nl=r,Pl(r,e)}Al(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Bc(8,t,t.return),Nl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Nl(t));break;default:Nl(t)}e=e.sibling}}function Pl(e,t){for(;nl!==null;){var n=nl;switch(n.tag){case 0:case 11:case 15:Bc(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:oa(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,nl=r;else a:for(n=e;nl!==null;){r=nl;var i=r.sibling,a=r.return;if(al(r),r===n){nl=null;break a}if(i!==null){i.return=a,nl=i;break a}nl=a}}}var Fl={getCacheForType:function(e){var t=Qi(ia),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Qi(ia).controller.signal}},Il=typeof WeakMap==`function`?WeakMap:Map,Ll=0,Rl=null,J=null,Y=0,zl=0,Bl=null,Vl=!1,Hl=!1,Ul=!1,Wl=0,Gl=0,Kl=0,ql=0,Jl=0,Yl=0,Xl=0,Zl=null,X=null,Ql=!1,$l=0,eu=0,tu=1/0,nu=null,ru=null,iu=0,au=null,ou=null,su=0,cu=0,lu=null,uu=null,du=0,fu=null;function pu(){return Ll&2&&Y!==0?Y&-Y:N.T===null?nt():dd()}function mu(){if(Yl===0)if(!(Y&536870912)||V){var e=Ve;Ve<<=1,!(Ve&3932160)&&(Ve=262144),Yl=e}else Yl=536870912;return e=$a.current,e!==null&&(e.flags|=32),Yl}function hu(e,t,n){(e===Rl&&(zl===2||zl===9)||e.cancelPendingCommit!==null)&&(Su(e,0),yu(e,Y,Yl,!1)),Ye(e,n),(!(Ll&2)||e!==Rl)&&(e===Rl&&(!(Ll&2)&&(ql|=n),Gl===4&&yu(e,Y,Yl,!1)),rd(e))}function gu(e,t,n){if(Ll&6)throw Error(a(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||Ge(e,t),i=r?Au(e,t):Ou(e,t,!0),o=r;do{if(i===0){Hl&&!r&&yu(e,t,0,!1);break}if(n=e.current.alternate,o&&!vu(n)){i=Ou(e,t,!1),o=!1;continue}if(i===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;i=Zl;var l=c.current.memoizedState.isDehydrated;if(l&&(Su(c,s).flags|=256),s=Ou(c,s,!1),s!==2){if(Ul&&!l){c.errorRecoveryDisabledLanes|=o,ql|=o,i=4;break a}o=X,X=i,o!==null&&(X===null?X=o:X.push.apply(X,o))}i=s}if(o=!1,i!==2)continue}}if(i===1){Su(e,0),yu(e,t,0,!0);break}a:{switch(r=e,o=i,o){case 0:case 1:throw Error(a(345));case 4:if((t&4194048)!==t)break;case 6:yu(r,t,Yl,!Vl);break a;case 2:X=null;break;case 3:case 5:break;default:throw Error(a(329))}if((t&62914560)===t&&(i=$l+300-we(),10<i)){if(yu(r,t,Yl,!Vl),We(r,0,!0)!==0)break a;su=t,r.timeoutHandle=Kd(_u.bind(null,r,n,X,nu,Ql,t,Yl,ql,Xl,Vl,o,`Throttled`,-0,0),i);break a}_u(r,n,X,nu,Ql,t,Yl,ql,Xl,Vl,o,null,-0,0)}break}while(1);rd(e)}function _u(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Qt},kl(t,a,d);var m=(a&62914560)===a?$l-we():(a&4194048)===a?eu-we():0;if(m=qf(d,m),m!==null){su=a,e.cancelPendingCommit=m(Lu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),yu(e,a,o,!l);return}}Lu(e,t,a,n,r,i,o,s,c)}function vu(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(!yr(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 yu(e,t,n,r){t&=~Jl,t&=~ql,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Ie(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&Ze(e,n,t)}function bu(){return Ll&6?!0:(id(0,!1),!1)}function xu(){if(J!==null){if(zl===0)var e=J.return;else e=J,Wi=Ui=null,Eo(e),ka=null,Aa=0,e=J;for(;e!==null;)Rc(e.alternate,e),e=e.return;J=null}}function Su(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,qd(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),su=0,xu(),Rl=e,J=n=si(e.current,null),Y=t,zl=0,Bl=null,Vl=!1,Hl=Ge(e,t),Ul=!1,Xl=Yl=Jl=ql=Kl=Gl=0,X=Zl=null,Ql=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Ie(r),a=1<<i;t|=e[i],r&=~a}return Wl=t,Zr(),n}function Cu(e,t){W=null,N.H=Is,t===ya||t===xa?(t=Da(),zl=3):t===ba?(t=Da(),zl=4):zl=t===G?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Bl=t,J===null&&(Gl=1,Js(e,hi(t,e.current)))}function wu(){var e=$a.current;return e===null?!0:(Y&4194048)===Y?eo===null:(Y&62914560)===Y||Y&536870912?e===eo:!1}function Tu(){var e=N.H;return N.H=Is,e===null?Is:e}function Eu(){var e=N.A;return N.A=Fl,e}function Du(){Gl=4,Vl||(Y&4194048)!==Y&&$a.current!==null||(Hl=!0),!(Kl&134217727)&&!(ql&134217727)||Rl===null||yu(Rl,Y,Yl,!1)}function Ou(e,t,n){var r=Ll;Ll|=2;var i=Tu(),a=Eu();(Rl!==e||Y!==t)&&(nu=null,Su(e,t)),t=!1;var o=Gl;a:do try{if(zl!==0&&J!==null){var s=J,c=Bl;switch(zl){case 8:xu(),o=6;break a;case 3:case 2:case 9:case 6:$a.current===null&&(t=!0);var l=zl;if(zl=0,Bl=null,Pu(e,s,c,l),n&&Hl){o=0;break a}break;default:l=zl,zl=0,Bl=null,Pu(e,s,c,l)}}ku(),o=Gl;break}catch(t){Cu(e,t)}while(1);return t&&e.shellSuspendCounter++,Wi=Ui=null,Ll=r,N.H=i,N.A=a,J===null&&(Rl=null,Y=0,Zr()),o}function ku(){for(;J!==null;)Mu(J)}function Au(e,t){var n=Ll;Ll|=2;var r=Tu(),i=Eu();Rl!==e||Y!==t?(nu=null,tu=we()+500,Su(e,t)):Hl=Ge(e,t);a:do try{if(zl!==0&&J!==null){t=J;var o=Bl;b:switch(zl){case 1:zl=0,Bl=null,Pu(e,t,o,1);break;case 2:case 9:if(Ca(o)){zl=0,Bl=null,Nu(t);break}t=function(){zl!==2&&zl!==9||Rl!==e||(zl=7),rd(e)},o.then(t,t);break a;case 3:zl=7;break a;case 4:zl=5;break a;case 7:Ca(o)?(zl=0,Bl=null,Nu(t)):(zl=0,Bl=null,Pu(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?Wf(s):c.stateNode.complete){zl=0,Bl=null;var l=c.sibling;if(l!==null)J=l;else{var u=c.return;u===null?J=null:(J=u,Fu(u))}break b}}zl=0,Bl=null,Pu(e,t,o,5);break;case 6:zl=0,Bl=null,Pu(e,t,o,6);break;case 8:xu(),Gl=6;break a;default:throw Error(a(462))}}ju();break}catch(t){Cu(e,t)}while(1);return Wi=Ui=null,N.H=r,N.A=i,Ll=n,J===null?(Rl=null,Y=0,Zr(),Gl):0}function ju(){for(;J!==null&&!Se();)Mu(J)}function Mu(e){var t=Ac(e.alternate,e,Wl);e.memoizedProps=e.pendingProps,t===null?Fu(e):J=t}function Nu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=mc(n,t,t.pendingProps,t.type,void 0,Y);break;case 11:t=mc(n,t,t.pendingProps,t.type.render,t.ref,Y);break;case 5:Eo(t);default:Rc(n,t),t=J=ci(t,Wl),t=Ac(n,t,Wl)}e.memoizedProps=e.pendingProps,t===null?Fu(e):J=t}function Pu(e,t,n,r){Wi=Ui=null,Eo(t),ka=null,Aa=0;var i=t.return;try{if($s(e,i,t,n,Y)){Gl=1,Js(e,hi(n,e.current)),J=null;return}}catch(t){if(i!==null)throw J=i,t;Gl=1,Js(e,hi(n,e.current)),J=null;return}t.flags&32768?(V||r===1?e=!0:Hl||Y&536870912?e=!1:(Vl=e=!0,(r===2||r===9||r===3||r===6)&&(r=$a.current,r!==null&&r.tag===13&&(r.flags|=16384))),Iu(t,e)):Fu(t)}function Fu(e){var t=e;do{if(t.flags&32768){Iu(t,Vl);return}e=t.return;var n=Lc(t.alternate,t,Wl);if(n!==null){J=n;return}if(t=t.sibling,t!==null){J=t;return}J=t=e}while(t!==null);Gl===0&&(Gl=5)}function Iu(e,t){do{var n=K(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);Gl=6,J=null}function Lu(e,t,n,r,i,o,s,c,l){e.cancelPendingCommit=null;do Hu();while(iu!==0);if(Ll&6)throw Error(a(327));if(t!==null){if(t===e.current)throw Error(a(177));if(o=t.lanes|t.childLanes,o|=Xr,Xe(e,n,o,s,c,l),e===Rl&&(J=Rl=null,Y=0),ou=t,au=e,su=n,cu=o,lu=i,uu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,Xu(Oe,function(){return Uu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=N.T,N.T=null,i=P.p,P.p=2,s=Ll,Ll|=4;try{rl(e,t,n)}finally{Ll=s,P.p=i,N.T=r}}iu=1,Ru(),zu(),Bu()}}function Ru(){if(iu===1){iu=0;var e=au,t=ou,n=!!(t.flags&13878);if(t.subtreeFlags&13878||n){n=N.T,N.T=null;var r=P.p;P.p=2;var i=Ll;Ll|=4;try{hl(t,e);var a=zd,o=wr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&Cr(s.ownerDocument.documentElement,s)){if(c!==null&&Tr(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 _=Sr(s,h),v=Sr(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}}sp=!!Rd,zd=Rd=null}finally{Ll=i,P.p=r,N.T=n}}e.current=t,iu=2}}function zu(){if(iu===2){iu=0;var e=au,t=ou,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=N.T,N.T=null;var r=P.p;P.p=2;var i=Ll;Ll|=4;try{il(e,t.alternate,t)}finally{Ll=i,P.p=r,N.T=n}}iu=3}}function Bu(){if(iu===4||iu===3){iu=0,Ce();var e=au,t=ou,n=su,r=uu;t.subtreeFlags&10256||t.flags&10256?iu=5:(iu=0,ou=au=null,Vu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(ru=null),tt(n),t=t.stateNode,Pe&&typeof Pe.onCommitFiberRoot==`function`)try{Pe.onCommitFiberRoot(Ne,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=N.T,i=P.p,P.p=2,N.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{N.T=t,P.p=i}}su&3&&Hu(),rd(e),i=e.pendingLanes,n&261930&&i&42?e===fu?du++:(du=0,fu=e):du=0,id(0,!1)}}function Vu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,oa(t)))}function Hu(){return Ru(),zu(),Bu(),Uu()}function Uu(){if(iu!==5)return!1;var e=au,t=cu;cu=0;var n=tt(su),r=N.T,i=P.p;try{P.p=32>n?32:n,N.T=null,n=lu,lu=null;var o=au,s=su;if(iu=0,ou=au=null,su=0,Ll&6)throw Error(a(331));var c=Ll;if(Ll|=4,Ml(o.current),wl(o,o.current,s,n),Ll=c,id(0,!1),Pe&&typeof Pe.onPostCommitFiberRoot==`function`)try{Pe.onPostCommitFiberRoot(Ne,o)}catch{}return!0}finally{P.p=i,N.T=r,Vu(e,t)}}function Wu(e,t,n){t=hi(n,t),t=Xs(e.stateNode,t,2),e=Va(e,t,2),e!==null&&(Ye(e,2),rd(e))}function Z(e,t,n){if(e.tag===3)Wu(e,e,n);else for(;t!==null;){if(t.tag===3){Wu(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(ru===null||!ru.has(r))){e=hi(n,e),n=Zs(2),r=Va(t,n,2),r!==null&&(Qs(n,r,t,e),Ye(r,2),rd(r));break}}t=t.return}}function Gu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Il;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)||(Ul=!0,i.add(n),e=Ku.bind(null,e,t,n),t.then(e,e))}function Ku(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Rl===e&&(Y&n)===n&&(Gl===4||Gl===3&&(Y&62914560)===Y&&300>we()-$l?!(Ll&2)&&Su(e,0):Jl|=n,Xl===Y&&(Xl=0)),rd(e)}function qu(e,t){t===0&&(t=qe()),e=ei(e,t),e!==null&&(Ye(e,t),rd(e))}function Ju(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),qu(e,n)}function Yu(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(a(314))}r!==null&&r.delete(t),qu(e,n)}function Xu(e,t){return be(e,t)}var Zu=null,Qu=null,$u=!1,ed=!1,td=!1,nd=0;function rd(e){e!==Qu&&e.next===null&&(Qu===null?Zu=Qu=e:Qu=Qu.next=e),ed=!0,$u||($u=!0,ud())}function id(e,t){if(!td&&ed){td=!0;do for(var n=!1,r=Zu;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-Ie(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,ld(r,a))}else a=Y,a=We(r,r===Rl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Ge(r,a)||(n=!0,ld(r,a));r=r.next}while(n);td=!1}}function ad(){od()}function od(){ed=$u=!1;var e=0;nd!==0&&Gd()&&(e=nd);for(var t=we(),n=null,r=Zu;r!==null;){var i=r.next,a=sd(r,t);a===0?(r.next=null,n===null?Zu=i:n.next=i,i===null&&(Qu=n)):(n=r,(e!==0||a&3)&&(ed=!0)),r=i}iu!==0&&iu!==5||id(e,!1),nd!==0&&(nd=0)}function sd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Ie(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=Ke(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Rl,n=Y,n=We(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(zl===2||zl===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&xe(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Ge(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&xe(r),tt(n)){case 2:case 8:n=De;break;case 32:n=Oe;break;case 268435456:n=Ae;break;default:n=Oe}return r=cd.bind(null,e),n=be(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&xe(r),e.callbackPriority=2,e.callbackNode=null,2}function cd(e,t){if(iu!==0&&iu!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Hu()&&e.callbackNode!==n)return null;var r=Y;return r=We(e,e===Rl?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(gu(e,r,t),sd(e,we()),e.callbackNode!=null&&e.callbackNode===n?cd.bind(null,e):null)}function ld(e,t){if(Hu())return null;gu(e,t,!0)}function ud(){Yd(function(){Ll&6?be(Ee,ad):od()})}function dd(){if(nd===0){var e=la;e===0&&(e=Be,Be<<=1,!(Be&261888)&&(Be=256)),nd=e}return nd}function fd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:Zt(``+e)}function pd(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function md(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=fd((i[ot]||null).action),o=r.submitter;o&&(t=(t=o[ot]||null)?fd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new vn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(nd!==0){var e=o?pd(i,o):new FormData(i);Ss(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?pd(i,o):new FormData(i),Ss(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var hd=0;hd<Gr.length;hd++){var gd=Gr[hd];Kr(gd.toLowerCase(),`on`+(gd[0].toUpperCase()+gd.slice(1)))}Kr(Lr,`onAnimationEnd`),Kr(Rr,`onAnimationIteration`),Kr(zr,`onAnimationStart`),Kr(`dblclick`,`onDoubleClick`),Kr(`focusin`,`onFocus`),Kr(`focusout`,`onBlur`),Kr(Br,`onTransitionRun`),Kr(Vr,`onTransitionStart`),Kr(Hr,`onTransitionCancel`),Kr(Ur,`onTransitionEnd`),St(`onMouseEnter`,[`mouseout`,`mouseover`]),St(`onMouseLeave`,[`mouseout`,`mouseover`]),St(`onPointerEnter`,[`pointerout`,`pointerover`]),St(`onPointerLeave`,[`pointerout`,`pointerover`]),xt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),xt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),xt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),xt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),xt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),xt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var _d=`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(` `),vd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(_d));function yd(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){qr(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){qr(e)}i.currentTarget=null,a=c}}}}function Q(e,t){var n=t[ct];n===void 0&&(n=t[ct]=new Set);var r=e+`__bubble`;n.has(r)||(Cd(t,e,2,!1),n.add(r))}function bd(e,t,n){var r=0;t&&(r|=4),Cd(n,e,r,t)}var xd=`_reactListening`+Math.random().toString(36).slice(2);function Sd(e){if(!e[xd]){e[xd]=!0,yt.forEach(function(t){t!==`selectionchange`&&(vd.has(t)||bd(t,!1,e),bd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[xd]||(t[xd]=!0,bd(`selectionchange`,!1,t))}}function Cd(e,t,n,r){switch(mp(t)){case 2:var i=cp;break;case 8:i=lp;break;default:i=up}n=i.bind(null,t,n,e),i=void 0,!z||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 wd(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var s=r.stateNode.containerInfo;if(s===i)break;if(o===4)for(o=r.return;o!==null;){var l=o.tag;if((l===3||l===4)&&o.stateNode.containerInfo===i)return;o=o.return}for(;s!==null;){if(o=mt(s),o===null)return;if(l=o.tag,l===5||l===6||l===26||l===27){r=a=o;continue a}s=s.parentNode}}r=r.return}on(function(){var r=a,i=en(n),o=[];a:{var s=Wr.get(e);if(s!==void 0){var l=vn,u=e;switch(e){case`keypress`:if(pn(n)===0)break a;case`keydown`:case`keyup`:l=In;break;case`focusin`:u=`focus`,l=Dn;break;case`focusout`:u=`blur`,l=Dn;break;case`beforeblur`:case`afterblur`:l=Dn;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=Tn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=En;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Rn;break;case Lr:case Rr:case zr:l=On;break;case Ur:l=zn;break;case`scroll`:case`scrollend`:l=bn;break;case`wheel`:l=Bn;break;case`copy`:case`cut`:case`paste`:l=kn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Ln;break;case`toggle`:case`beforetoggle`:l=Vn}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?s===null?null:s+`Capture`:s;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=sn(m,p),g!=null&&d.push(Td(m,g,h))),f)break;m=m.return}0<d.length&&(s=new l(s,u,null,n,i),o.push({event:s,listeners:d}))}}if(!(t&7)){a:{if(s=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,s&&n!==$t&&(u=n.relatedTarget||n.fromElement)&&(mt(u)||u[st]))break a;if((l||s)&&(s=i.window===i?i:(s=i.ownerDocument)?s.defaultView||s.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?mt(u):null,u!==null&&(f=c(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=Tn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Ln,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?s:gt(l),h=u==null?s:gt(u),s=new d(g,m+`leave`,l,n,i),s.target=f,s.relatedTarget=h,g=null,mt(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=Dd,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&Od(o,s,l,d,!1),u!==null&&f!==null&&Od(o,f,u,d,!0)}}a:{if(s=r?gt(r):window,l=s.nodeName&&s.nodeName.toLowerCase(),l===`select`||l===`input`&&s.type===`file`)var v=sr;else if(tr(s))if(cr)v=_r;else{v=hr;var y=mr}else l=s.nodeName,!l||l.toLowerCase()!==`input`||s.type!==`checkbox`&&s.type!==`radio`?r&&Jt(r.elementType)&&(v=sr):v=gr;if(v&&=v(e,r)){nr(o,v,n,i);break a}y&&y(e,s,r),e===`focusout`&&r&&s.type===`number`&&r.memoizedProps.value!=null&&Bt(s,`number`,s.value)}switch(y=r?gt(r):window,e){case`focusin`:(tr(y)||y.contentEditable===`true`)&&(Dr=y,Or=r,kr=null);break;case`focusout`:kr=Or=Dr=null;break;case`mousedown`:Ar=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Ar=!1,jr(o,n,i);break;case`selectionchange`:if(Er)break;case`keydown`:case`keyup`:jr(o,n,i)}var b;if(Un)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else Zn?Yn(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Kn&&n.locale!==`ko`&&(Zn||x!==`onCompositionStart`?x===`onCompositionEnd`&&Zn&&(b=B()):(un=i,dn=`value`in un?un.value:un.textContent,Zn=!0)),y=Ed(r,x),0<y.length&&(x=new An(x,e,null,n,i),o.push({event:x,listeners:y}),b?x.data=b:(b=Xn(n),b!==null&&(x.data=b)))),(b=Gn?Qn(e,n):$n(e,n))&&(x=Ed(r,`onBeforeInput`),0<x.length&&(y=new An(`onBeforeInput`,`beforeinput`,null,n,i),o.push({event:y,listeners:x}),y.data=b)),md(o,e,r,n,i)}yd(o,t)})}function Td(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ed(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=sn(e,n),i!=null&&r.unshift(Td(e,i,a)),i=sn(e,t),i!=null&&r.push(Td(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Dd(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Od(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=sn(n,a),l!=null&&o.unshift(Td(n,l,c))):i||(l=sn(n,a),l!=null&&o.push(Td(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var kd=/\r\n?/g,Ad=/\u0000|\uFFFD/g;function jd(e){return(typeof e==`string`?e:``+e).replace(kd,`
98
- `).replace(Ad,``)}function Md(e,t){return t=jd(t),jd(e)===t}function $(e,t,n,r,i,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Wt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Wt(e,``+r);break;case`className`:Ot(e,`class`,r);break;case`tabIndex`:Ot(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Ot(e,n,r);break;case`style`:qt(e,r,o);break;case`data`:if(t!==`object`){Ot(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Zt(``+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`&&$(e,t,`name`,i.name,i,null),$(e,t,`formEncType`,i.formEncType,i,null),$(e,t,`formMethod`,i.formMethod,i,null),$(e,t,`formTarget`,i.formTarget,i,null)):($(e,t,`encType`,i.encType,i,null),$(e,t,`method`,i.method,i,null),$(e,t,`target`,i.target,i,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Zt(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=Qt);break;case`onScroll`:r!=null&&Q(`scroll`,e);break;case`onScrollEnd`:r!=null&&Q(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(a(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(a(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=Zt(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Q(`beforetoggle`,e),Q(`toggle`,e),Dt(e,`popover`,r);break;case`xlinkActuate`:kt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:kt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:kt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:kt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:kt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:kt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:kt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:kt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:kt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Dt(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=Yt.get(n)||n,Dt(e,n,r))}}function Nd(e,t,n,r,i,o){switch(n){case`style`:qt(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(a(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(a(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Wt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Wt(e,``+r);break;case`onScroll`:r!=null&&Q(`scroll`,e);break;case`onScrollEnd`:r!=null&&Q(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=Qt);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!bt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(i=n.endsWith(`Capture`),t=n.slice(2,i?n.length-7:void 0),o=e[ot]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,i),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,i);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):Dt(e,n,r)}}}function Pd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Q(`error`,e),Q(`load`,e);var r=!1,i=!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`:i=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(a(137,t));default:$(e,t,o,s,n,null)}}i&&$(e,t,`srcSet`,n.srcSet,n,null),r&&$(e,t,`src`,n.src,n,null);return;case`input`:Q(`invalid`,e);var c=o=s=i=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:i=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(a(137,t));break;default:$(e,t,r,d,n,null)}}zt(e,o,c,l,u,s,i,!1);return;case`select`:for(i in Q(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(i)&&(c=n[i],c!=null))switch(i){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:$(e,t,i,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Vt(e,!!r,n,!0):Vt(e,!!r,t,!1);return;case`textarea`:for(s in Q(`invalid`,e),o=i=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:i=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(a(91));break;default:$(e,t,s,c,n,null)}Ut(e,r,i,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:$(e,t,l,r,n,null)}return;case`dialog`:Q(`beforetoggle`,e),Q(`toggle`,e),Q(`cancel`,e),Q(`close`,e);break;case`iframe`:case`object`:Q(`load`,e);break;case`video`:case`audio`:for(r=0;r<_d.length;r++)Q(_d[r],e);break;case`image`:Q(`error`,e),Q(`load`,e);break;case`details`:Q(`toggle`,e);break;case`embed`:case`source`:case`link`:Q(`error`,e),Q(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(a(137,t));default:$(e,t,u,r,n,null)}return;default:if(Jt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Nd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&$(e,t,c,r,n,null))}function Fd(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 i=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)||$(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:i=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(a(137,t));break;default:m!==f&&$(e,t,p,m,r,f)}}Rt(e,s,c,l,u,d,o,i);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)||$(e,t,o,null,r,l)}for(i in r)if(o=r[i],l=n[i],r.hasOwnProperty(i)&&(o!=null||l!=null))switch(i){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&$(e,t,i,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Vt(e,!!n,n?[]:``,!1):Vt(e,!!n,t,!0)):Vt(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(i=n[c],n.hasOwnProperty(c)&&i!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:$(e,t,c,null,r,i)}for(s in r)if(i=r[s],o=n[s],r.hasOwnProperty(s)&&(i!=null||o!=null))switch(s){case`value`:p=i;break;case`defaultValue`:m=i;break;case`children`:break;case`dangerouslySetInnerHTML`:if(i!=null)throw Error(a(91));break;default:i!==o&&$(e,t,s,i,r,o)}Ht(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:$(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:$(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)&&$(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(a(137,t));break;default:$(e,t,u,p,r,m)}return;default:if(Jt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Nd(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||Nd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&$(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||$(e,t,f,p,r,m)}function Id(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Ld(){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&&Id(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&&Id(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 Rd=null,zd=null;function Bd(e){return e.nodeType===9?e:e.ownerDocument}function Vd(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 Hd(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 Ud(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 Wd=null;function Gd(){var e=window.event;return e&&e.type===`popstate`?e!==Wd&&(Wd=e,!0):(Wd=null,!1)}var Kd=typeof setTimeout==`function`?setTimeout:void 0,qd=typeof clearTimeout==`function`?clearTimeout:void 0,Jd=typeof Promise==`function`?Promise:void 0,Yd=typeof queueMicrotask==`function`?queueMicrotask:Jd===void 0?Kd:function(e){return Jd.resolve(null).then(e).catch(Xd)};function Xd(e){setTimeout(function(){throw e})}function Zd(e){return e===`head`}function Qd(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),Np(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)pf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,pf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[ft]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&pf(e.ownerDocument.body);n=i}while(n);Np(t)}function $d(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 ef(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`:ef(n),pt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function tf(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[ft])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=cf(e.nextSibling),e===null)break}return null}function nf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=cf(e.nextSibling),e===null))return null;return e}function rf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=cf(e.nextSibling),e===null))return null;return e}function af(e){return e.data===`$?`||e.data===`$~`}function of(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function sf(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 cf(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 lf=null;function uf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return cf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function df(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 ff(e,t,n){switch(t=Bd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(a(452));return e;case`head`:if(e=t.head,!e)throw Error(a(453));return e;case`body`:if(e=t.body,!e)throw Error(a(454));return e;default:throw Error(a(451))}}function pf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);pt(e)}var mf=new Map,hf=new Set;function gf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var _f=P.d;P.d={f:vf,r:yf,D:Sf,C:Cf,L:wf,m:Tf,X:Df,S:Ef,M:Of};function vf(){var e=_f.f(),t=bu();return e||t}function yf(e){var t=ht(e);t!==null&&t.tag===5&&t.type===`form`?ws(t):_f.r(e)}var bf=typeof document>`u`?null:document;function xf(e,t,n){var r=bf;if(r&&typeof t==`string`&&t){var i=Lt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),hf.has(i)||(hf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Pd(t,`link`,e),vt(t),r.head.appendChild(t)))}}function Sf(e){_f.D(e),xf(`dns-prefetch`,e,null)}function Cf(e,t){_f.C(e,t),xf(`preconnect`,e,t)}function wf(e,t,n){_f.L(e,t,n);var r=bf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Lt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Lt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Lt(n.imageSizes)+`"]`)):i+=`[href="`+Lt(e)+`"]`;var a=i;switch(t){case`style`:a=Af(e);break;case`script`:a=Pf(e)}mf.has(a)||(e=m({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),mf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(jf(a))||t===`script`&&r.querySelector(Ff(a))||(t=r.createElement(`link`),Pd(t,`link`,e),vt(t),r.head.appendChild(t)))}}function Tf(e,t){_f.m(e,t);var n=bf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Lt(r)+`"][href="`+Lt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Pf(e)}if(!mf.has(a)&&(e=m({rel:`modulepreload`,href:e},t),mf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Ff(a)))return}r=n.createElement(`link`),Pd(r,`link`,e),vt(r),n.head.appendChild(r)}}}function Ef(e,t,n){_f.S(e,t,n);var r=bf;if(r&&e){var i=_t(r).hoistableStyles,a=Af(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(jf(a)))s.loading=5;else{e=m({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=mf.get(a))&&Rf(e,n);var c=o=r.createElement(`link`);vt(c),Pd(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,Lf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Df(e,t){_f.X(e,t);var n=bf;if(n&&e){var r=_t(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=m({src:e,async:!0},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),vt(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Of(e,t){_f.M(e,t);var n=bf;if(n&&e){var r=_t(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=m({src:e,async:!0,type:`module`},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),vt(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function kf(e,t,n,r){var i=(i=se.current)?gf(i):null;if(!i)throw Error(a(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Af(n.href),n=_t(i).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Af(n.href);var o=_t(i).hoistableStyles,s=o.get(e);if(s||(i=i.ownerDocument||i,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=i.querySelector(jf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),mf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},mf.set(e,n),o||Nf(i,e,n,s.state))),t&&r===null)throw Error(a(528,``));return s}if(t&&r!==null)throw Error(a(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Pf(n),n=_t(i).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(a(444,e))}}function Af(e){return`href="`+Lt(e)+`"`}function jf(e){return`link[rel="stylesheet"][`+e+`]`}function Mf(e){return m({},e,{"data-precedence":e.precedence,precedence:null})}function Nf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Pd(t,`link`,n),vt(t),e.head.appendChild(t))}function Pf(e){return`[src="`+Lt(e)+`"]`}function Ff(e){return`script[async]`+e}function If(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Lt(n.href)+`"]`);if(r)return t.instance=r,vt(r),r;var i=m({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),vt(r),Pd(r,`style`,i),Lf(r,n.precedence,e),t.instance=r;case`stylesheet`:i=Af(n.href);var o=e.querySelector(jf(i));if(o)return t.state.loading|=4,t.instance=o,vt(o),o;r=Mf(n),(i=mf.get(i))&&Rf(r,i),o=(e.ownerDocument||e).createElement(`link`),vt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Pd(o,`link`,r),t.state.loading|=4,Lf(o,n.precedence,e),t.instance=o;case`script`:return o=Pf(n.src),(i=e.querySelector(Ff(o)))?(t.instance=i,vt(i),i):(r=n,(i=mf.get(o))&&(r=m({},n),zf(r,i)),e=e.ownerDocument||e,i=e.createElement(`script`),vt(i),Pd(i,`link`,r),e.head.appendChild(i),t.instance=i);case`void`:return null;default:throw Error(a(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Lf(r,n.precedence,e));return t.instance}function Lf(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 Rf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function zf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Bf=null;function Vf(e,t,n){if(Bf===null){var r=new Map,i=Bf=new Map;i.set(n,r)}else i=Bf,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[ft]||a[at]||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 Hf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Uf(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 Wf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Gf(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=Af(r.href),a=t.querySelector(jf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Jf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,vt(a);return}a=t.ownerDocument||t,r=Mf(r),(i=mf.get(i))&&Rf(r,i),a=a.createElement(`link`),vt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Pd(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=Jf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Kf=0;function qf(e,t){return e.stylesheets&&e.count===0&&Xf(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Xf(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Kf===0&&(Kf=62500*Ld());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Xf(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Kf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Jf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Xf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Yf=null;function Xf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Yf=new Map,t.forEach(Zf,e),Yf=null,Jf.call(e))}function Zf(e,t){if(!(t.state.loading&4)){var n=Yf.get(e);if(n)var r=n.get(null);else{n=new Map,Yf.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=Jf.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 Qf={$$typeof:S,Provider:null,Consumer:null,_currentValue:F,_currentValue2:F,_threadCount:0};function $f(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=Je(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Je(0),this.hiddenUpdates=Je(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function ep(e,t,n,r,i,a,o,s,c,l,u,d){return e=new $f(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=ai(3,null,null,t),e.current=a,a.stateNode=e,t=aa(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Ra(a),e}function tp(e){return e?(e=ri,e):ri}function np(e,t,n,r,i,a){i=tp(i),r.context===null?r.context=i:r.pendingContext=i,r=Ba(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Va(e,r,t),n!==null&&(hu(n,e,t),Ha(n,e,t))}function rp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ip(e,t){rp(e,t),(e=e.alternate)&&rp(e,t)}function ap(e){if(e.tag===13||e.tag===31){var t=ei(e,67108864);t!==null&&hu(t,e,67108864),ip(e,67108864)}}function op(e){if(e.tag===13||e.tag===31){var t=pu();t=et(t);var n=ei(e,t);n!==null&&hu(n,e,t),ip(e,t)}}var sp=!0;function cp(e,t,n,r){var i=N.T;N.T=null;var a=P.p;try{P.p=2,up(e,t,n,r)}finally{P.p=a,N.T=i}}function lp(e,t,n,r){var i=N.T;N.T=null;var a=P.p;try{P.p=8,up(e,t,n,r)}finally{P.p=a,N.T=i}}function up(e,t,n,r){if(sp){var i=dp(r);if(i===null)wd(e,t,r,fp,n),Cp(e,r);else if(Tp(i,e,t,n,r))r.stopPropagation();else if(Cp(e,r),t&4&&-1<Sp.indexOf(e)){for(;i!==null;){var a=ht(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Ue(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Ie(o);s.entanglements[1]|=c,o&=~c}rd(a),!(Ll&6)&&(tu=we()+500,id(0,!1))}}break;case 31:case 13:s=ei(a,2),s!==null&&hu(s,a,2),bu(),ip(a,2)}if(a=dp(r),a===null&&wd(e,t,r,fp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else wd(e,t,r,null,n)}}function dp(e){return e=en(e),pp(e)}var fp=null;function pp(e){if(fp=null,e=mt(e),e!==null){var t=c(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=l(t),e!==null)return e;e=null}else if(n===31){if(e=u(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 fp=e,null}function mp(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Te()){case Ee:return 2;case De:return 8;case Oe:case ke:return 32;case Ae:return 268435456;default:return 32}default:return 32}}var hp=!1,gp=null,_p=null,vp=null,yp=new Map,bp=new Map,xp=[],Sp=`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 Cp(e,t){switch(e){case`focusin`:case`focusout`:gp=null;break;case`dragenter`:case`dragleave`:_p=null;break;case`mouseover`:case`mouseout`:vp=null;break;case`pointerover`:case`pointerout`:yp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:bp.delete(t.pointerId)}}function wp(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=ht(t),t!==null&&ap(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Tp(e,t,n,r,i){switch(t){case`focusin`:return gp=wp(gp,e,t,n,r,i),!0;case`dragenter`:return _p=wp(_p,e,t,n,r,i),!0;case`mouseover`:return vp=wp(vp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return yp.set(a,wp(yp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,bp.set(a,wp(bp.get(a)||null,e,t,n,r,i)),!0}return!1}function Ep(e){var t=mt(e.target);if(t!==null){var n=c(t);if(n!==null){if(t=n.tag,t===13){if(t=l(n),t!==null){e.blockedOn=t,rt(e.priority,function(){op(n)});return}}else if(t===31){if(t=u(n),t!==null){e.blockedOn=t,rt(e.priority,function(){op(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 Dp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=dp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);$t=r,n.target.dispatchEvent(r),$t=null}else return t=ht(n),t!==null&&ap(t),e.blockedOn=n,!1;t.shift()}return!0}function Op(e,t,n){Dp(e)&&n.delete(t)}function kp(){hp=!1,gp!==null&&Dp(gp)&&(gp=null),_p!==null&&Dp(_p)&&(_p=null),vp!==null&&Dp(vp)&&(vp=null),yp.forEach(Op),bp.forEach(Op)}function Ap(e,n){e.blockedOn===n&&(e.blockedOn=null,hp||(hp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,kp)))}var jp=null;function Mp(e){jp!==e&&(jp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){jp===e&&(jp=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(pp(r||n)===null)continue;break}var a=ht(n);a!==null&&(e.splice(t,3),t-=3,Ss(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Np(e){function t(t){return Ap(t,e)}gp!==null&&Ap(gp,e),_p!==null&&Ap(_p,e),vp!==null&&Ap(vp,e),yp.forEach(t),bp.forEach(t);for(var n=0;n<xp.length;n++){var r=xp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<xp.length&&(n=xp[0],n.blockedOn===null);)Ep(n),n.blockedOn===null&&xp.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[ot]||null;if(typeof a==`function`)o||Mp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[ot]||null)s=o.formAction;else if(pp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Mp(n)}}}function Pp(){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 Fp(e){this._internalRoot=e}Ip.prototype.render=Fp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(a(409));var n=t.current;np(n,pu(),e,t,null,null)},Ip.prototype.unmount=Fp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;np(e.current,2,null,e,null,null),bu(),t[st]=null}};function Ip(e){this._internalRoot=e}Ip.prototype.unstable_scheduleHydration=function(e){if(e){var t=nt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<xp.length&&t!==0&&t<xp[n].priority;n++);xp.splice(n,0,e),n===0&&Ep(e)}};var Lp=n.version;if(Lp!==`19.2.8`)throw Error(a(527,Lp,`19.2.8`));P.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(a(188)):(e=Object.keys(e).join(`,`),Error(a(268,e)));return e=f(t),e=e===null?null:p(e),e=e===null?null:e.stateNode,e};var Rp={bundleType:0,version:`19.2.8`,rendererPackageName:`react-dom`,currentDispatcherRef:N,reconcilerVersion:`19.2.8`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var zp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!zp.isDisabled&&zp.supportsFiber)try{Ne=zp.inject(Rp),Pe=zp}catch{}}e.createRoot=function(e,t){if(!s(e))throw Error(a(299));var n=!1,r=``,i=Gs,o=Ks,c=qs;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(o=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=ep(e,1,!1,null,null,n,r,null,i,o,c,Pp),e[st]=t.current,Sd(e),new Fp(t)},e.hydrateRoot=function(e,t,n){if(!s(e))throw Error(a(299));var r=!1,i=``,o=Gs,c=Ks,l=qs,u=null;return n!=null&&(!0===n.unstable_strictMode&&(r=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onUncaughtError!==void 0&&(o=n.onUncaughtError),n.onCaughtError!==void 0&&(c=n.onCaughtError),n.onRecoverableError!==void 0&&(l=n.onRecoverableError),n.formState!==void 0&&(u=n.formState)),t=ep(e,1,!0,t,n??null,r,i,u,o,c,l,Pp),t.context=tp(null),n=t.current,r=pu(),r=et(r),i=Ba(r),i.callback=null,Va(n,i,r),n=r,t.current.lanes=n,Ye(t,n),rd(t),e[st]=t.current,Sd(e),new Ip(t)}})),rc=n(((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=nc()})),ic=t(o(),1),ac=rc(),oc=(0,z.createContext)(null);oc.displayName=`InertiaHeadContext`;var sc=oc,cc=os();function lc(){cc.reset()}var uc=(0,z.createContext)(null);uc.displayName=`InertiaPageContext`;var dc=uc;function fc(e){return typeof e==`function`||typeof e==`object`&&!!e&&`$$typeof`in e}function pc(e){if(typeof e!=`function`)return!1;let t=e;return t.length===1&&t.prototype===void 0}function mc(e){return typeof e==`function`&&e.length<=1&&e.prototype===void 0}var hc=!0,gc=!1,_c=async()=>{hc=!1},vc={shared:{},named:{}};function yc({children:e,initialPage:t,initialComponent:n,resolveComponent:r,titleCallback:i,onHeadUpdate:a,defaultLayout:o,serverHead:s}){let[c,l]=(0,z.useState)({component:n||null,page:{...t,flash:t.flash??{}},key:null}),u=(0,z.useRef)(c.page);u.current=c.page;let d=(0,z.useMemo)(()=>Go(typeof window>`u`,e=>i?i(e,u.current):e,a||(()=>{}),Uo(t,s)),[]),f=(0,z.useSyncExternalStore)(cc.subscribe,cc.get,()=>vc);if(gc||=(G.init({initialPage:t,resolveComponent:r,swapComponent:async e=>_c(e),onFlash:e=>{l(t=>({...t,page:{...t.page,flash:e}}))}}),!0),(0,z.useEffect)(()=>{_c=async({component:e,page:t,preserveState:n})=>{if(hc){hc=!1;return}n||lc(),(0,ic.flushSync)(()=>l(r=>({component:e,page:t,key:n?r.key:Date.now()})))};let e=e=>{d.updateServerHead(Uo(e.detail.page,s))},t=G.on(`navigate`,e),n=G.on(`clientVisit`,e);return()=>{t(),n()}},[]),!c.component)return(0,z.createElement)(sc.Provider,{value:d},(0,z.createElement)(dc.Provider,{value:c.page},null));let p=e||(({Component:e,props:t,key:n})=>{let r=(0,z.createElement)(e,{key:n,...t}),i,a=null,s=e.layout;if(mc(s)){let e=s(t);if((0,z.isValidElement)(e))return s(r);fs(e,fc)?(i=o?.(c.page.component,c.page),a=e):i=e}else ds(s,fc)?(i=o?.(c.page.component,c.page),a=s):i=s??o?.(c.page.component,c.page);let l=hs(i,fc,s&&!a?pc:void 0);return a&&(l=l.map(e=>({...e,props:{...e.props,...a}}))),l.length>0?l.reduceRight((e,n)=>(0,z.createElement)(n.component,{...t,...n.props,...f.shared,...n.name&&f.named[n.name]||{}},e),r):r});return(0,z.createElement)(sc.Provider,{value:d},(0,z.createElement)(dc.Provider,{value:c.page},p({Component:c.component,key:c.key,props:c.page.props})))}yc.displayName=`Inertia`;async function bc({id:e=`app`,resolve:t,setup:n,title:r,progress:i={},page:a,render:o,defaults:s={},nonce:c,http:l,layout:u,serverHead:d,strictMode:f=!1,withApp:p,dev:m=!1}={}){Lc.replace(s),c&&Lc.set(`nonce`,c),l&&xo.setClient(l),m&&Co();let h=typeof window>`u`,g=e=>f?(0,z.createElement)(z.StrictMode,null,e):e,_=(e,n)=>Promise.resolve(t(e,n)).then(e=>e.default||e);if(h&&!a&&!o)return async(t,i)=>{let a=[],o={initialPage:t,initialComponent:await _(t.component,t),resolveComponent:_,titleCallback:r,onHeadUpdate:e=>a=e,defaultLayout:u,serverHead:d},s;n?s=n({el:null,App:yc,props:o}):(s=g((0,z.createElement)(yc,o)),p&&(s=p(s,{ssr:!0,page:t})));let c=$s(e,t,i(s));return{head:a,body:c}};let v=a||xa(e),y=[],b=await Promise.all([_(v.component,v),G.decryptHistory().catch(()=>{})]).then(([t])=>{let i={initialPage:v,initialComponent:t,resolveComponent:_,titleCallback:r,onHeadUpdate:h?e=>y=e:void 0,defaultLayout:u,serverHead:d};if(h)return n({el:null,App:yc,props:i});let a=document.getElementById(e);if(n)return n({el:a,App:yc,props:i});let o=g((0,z.createElement)(yc,i));p&&(o=p(o,{ssr:!1,page:v})),a.hasAttribute(`data-server-rendered`)?(0,ac.hydrateRoot)(a,o):(0,ac.createRoot)(a).render(o)});if(!h&&i&&Gs(i),h&&o&&b){let t=$s(e,v,o(b));return{head:y,body:t}}}function xc(){let e=(0,z.use)(dc);if(!e)throw Error(`usePage must be used within the Inertia component`);return e}function Sc(e){let{data:t,useDataState:n,useErrorsState:r}=e,i=typeof t==`function`,a=()=>i?t():t,o=lr(a()),s=(0,z.useRef)(!1),c=(0,z.useRef)(e.precognitionEndpoint??null),[l,u]=(0,z.useState)(lr(o)),[d,f]=n?n():(0,z.useState)(lr(o)),[p,m]=r?r():(0,z.useState)({}),[h,g]=(0,z.useState)(!1),[_,v]=(0,z.useState)(null),[y,b]=(0,z.useState)(!1),[x,S]=(0,z.useState)(!1),C=(0,z.useRef)(void 0),w=(0,z.useRef)(e=>e),T=(0,z.useRef)(!1),E=(0,z.useRef)(null),[D,O]=(0,z.useState)(!1),[ee,k]=(0,z.useState)([]),[A,j]=(0,z.useState)([]),M=(0,z.useRef)(null),te=()=>M.current??Lc.get(`form.withAllErrors`),N=(0,z.useRef)(d);(0,z.useEffect)(()=>{N.current=d}),(0,z.useEffect)(()=>(s.current=!0,()=>{s.current=!1}),[]);let P=(0,z.useCallback)(e=>{N.current=e,f(e)},[f]),F=(0,z.useCallback)((e,t)=>{P(typeof e==`string`?Gr(lr(N.current),e,t):typeof e==`function`?e(N.current):e)},[P]),ne=(0,z.useCallback)((e,t)=>{if(i)throw Error("You cannot call `defaults()` when using a function to define your form data.");T.current=!0;let n={};e===void 0?(n={...N.current},u(N.current)):u(r=>(n=typeof e==`string`?Gr(lr(r),e,t):Object.assign(lr(r),e),n)),E.current?.defaults(n)},[u]),re=(0,z.useCallback)((...e)=>{let t=lr(i?lr(a()):l);if(e.length===0)i&&u(t),P(t);else{i&&u(n=>{let r=lr(n);return e.filter(e=>Fr(t,e)).forEach(e=>{Gr(r,e,Dr(t,e))}),r});let n=e.filter(e=>Fr(t,e)).reduce((e,n)=>Gr(e,n,Dr(t,n)),{...N.current});P(n)}E.current?.reset(...e)},[P,l]),ie=(0,z.useCallback)((e,t)=>{m(n=>{let r={...n,...typeof e==`string`?{[e]:t}:e};return E.current?.setErrors(r),r})},[m]),I=(0,z.useCallback)((...e)=>{m(t=>{let n=Object.keys(t).reduce((n,r)=>({...n,...e.length>0&&!e.includes(r)?{[r]:t[r]}:{}}),{});return E.current&&(e.length===0?E.current.setErrors({}):e.forEach(E.current.forgetError)),n})},[m]),L=(0,z.useCallback)((...e)=>{re(...e),I(...e)},[re,I]),ae=(0,z.useCallback)(()=>{I(),b(!0),S(!0),C.current=window.setTimeout(()=>{s.current&&S(!1)},Lc.get(`form.recentlySuccessfulDuration`))},[I,b,S]),oe=(0,z.useCallback)(()=>{b(!1),S(!1),clearTimeout(C.current)},[b,S]),se=(0,z.useCallback)(()=>{g(!1),v(null)},[g,v]),ce=(0,z.useCallback)(e=>{w.current=e},[]),R=(e,t)=>(t(e),e),le=(0,z.useCallback)(e=>A.includes(e),[A]),ue=(0,z.useCallback)(e=>e in p,[p]),de=(0,z.useCallback)(e=>typeof e==`string`?ee.includes(e):ee.length>0,[ee]),fe={data:d,isDirty:!_r(d,l),errors:p,hasErrors:Object.keys(p).length>0,processing:h,progress:_,wasSuccessful:y,recentlySuccessful:x,setData:F,transform:ce,setDefaults:ne,reset:re,setError:ie,clearErrors:I,resetAndClearErrors:L},pe=(e,t)=>{if(typeof e==`object`&&!(`target`in e)&&(t=e,e=void 0),e===void 0)E.current.validate(t);else{let n=Pi(e),r=w.current(N.current);E.current.validate(n,Dr(r,n),t)}return fe};return fe.withPrecognition=(...e)=>{if(c.current=Po.createWayfinderCallback(...e),!E.current){let e=V(e=>{let{method:t,url:n}=c.current(),r=N.current,i=w.current(r);return e[t](n,i)},lr(l));E.current=e,e.on(`validatingChanged`,()=>{O(e.validating())}).on(`validatedChanged`,()=>{j(e.valid())}).on(`touchedChanged`,()=>{k(e.touched())}).on(`errorsChanged`,()=>{let t=te()?e.errors():Mi(e.errors());m(t),j(e.valid())})}let t=Object.assign(fe,{validating:D,validator:()=>E.current,valid:le,invalid:ue,touched:de,withoutFileValidation:()=>R(t,()=>E.current?.withoutFileValidation()),touch:(e,...n)=>(Array.isArray(e)?E.current?.touch(e):typeof e==`string`?E.current?.touch([e,...n]):E.current?.touch(e),t),withAllErrors:()=>R(t,()=>M.current=!0),setValidationTimeout:e=>R(t,()=>E.current?.setTimeout(e)),validateFiles:()=>R(t,()=>E.current?.validateFiles()),validate:pe,setErrors:e=>R(t,()=>fe.setError(e)),forgetError:e=>R(t,()=>fe.clearErrors(Pi(e)))});return t},c.current&&fe.withPrecognition(c.current),{form:fe,setDefaultsState:u,transformRef:w,precognitionEndpointRef:c,dataRef:N,isMounted:s,setProcessing:g,setProgress:v,markAsSuccessful:ae,clearErrors:I,setError:ie,defaultsCalledInOnSuccessRef:T,resetBeforeSubmit:oe,finishProcessing:se,withAllErrors:{enabled:te,enable:()=>{M.current=!0}}}}function Cc(e,t,n){let[r,i]=(0,z.useState)(()=>{let n=G.restore(t);return n===void 0?e:n});return(0,z.useEffect)(()=>{let e=n?.current;if(e&&e.length>0&&typeof r==`object`&&r){let n={...r};e.forEach(e=>delete n[e]),G.remember(n,t)}else G.remember(r,t)},[r,t]),[r,i]}function wc(...e){let{rememberKey:t,data:n,precognitionEndpoint:r}=Po.parseUseFormArguments(...e),i=lr(typeof n==`function`?n():n),a=(0,z.useRef)(null),o=(0,z.useRef)([]),s=(0,z.useRef)(null),{form:c,setDefaultsState:l,transformRef:u,precognitionEndpointRef:d,dataRef:f,isMounted:p,setProcessing:m,setProgress:h,markAsSuccessful:g,clearErrors:_,setError:v,defaultsCalledInOnSuccessRef:y,resetBeforeSubmit:b,finishProcessing:x}=Sc({data:n,precognitionEndpoint:r,useDataState:t?()=>Cc(i,`${t}:data`,o):void 0,useErrorsState:t?()=>Cc({},`${t}:errors`):void 0}),S=(0,z.useCallback)((...e)=>{let{method:t,url:n,options:r}=Po.parseSubmitArguments(e,d.current);y.current=!1;let i={...r,onCancelToken:e=>(a.current=e,r.onCancelToken?.(e)),onBefore:e=>(b(),r.onBefore?.(e)),onStart:e=>(m(!0),r.onStart?.(e)),onProgress:e=>(h(e||null),r.onProgress?.(e)),onSuccess:async e=>{p.current&&g();let t=r.onSuccess?await r.onSuccess(e):null;return p.current&&!y.current&&c.setData(e=>(l(lr(e)),e)),t},onError:e=>(p.current&&(_(),v(e)),r.onError?.(e)),onCancel:()=>r.onCancel?.(),onFinish:e=>(p.current&&x(),a.current=null,r.onFinish?.(e))};i.optimistic=i.optimistic??s.current??void 0,s.current=null;let o=u.current(f.current);t===`delete`?G.delete(n,{...i,data:o}):G[t](n,o,i)},[_,v,u]),C=(0,z.useCallback)(()=>{a.current&&a.current.cancel()},[]),w=(0,z.useMemo)(()=>({get:(e,t={})=>S(`get`,e,t),post:(e,t={})=>S(`post`,e,t),put:(e,t={})=>S(`put`,e,t),patch:(e,t={})=>S(`patch`,e,t),delete:(e,t={})=>S(`delete`,e,t)}),[S]);Object.assign(c,{submit:S,...w,cancel:C,dontRemember:(...e)=>(o.current=e,T),optimistic:e=>(s.current=e,T)});let T=c,E=c.withPrecognition;return T.withPrecognition=(...e)=>(E(...e),T),d.current,T}var Tc=e=>{typeof z.startTransition==`function`?z.startTransition(e):setTimeout(e,0)},Ec=()=>void 0,Dc=(0,z.createContext)(void 0),Oc=(0,z.forwardRef)(({action:e=``,method:t=`get`,headers:n={},queryStringArrayFormat:r=`brackets`,errorBag:i=null,showProgress:a=!0,transform:o=e=>e,optimistic:s,options:c={},onStart:l=Ec,onProgress:u=Ec,onFinish:d=Ec,onBefore:f=Ec,onCancel:p=Ec,onSuccess:m=Ec,onError:h=Ec,onCancelToken:g=Ec,onSubmitComplete:_=Ec,disableWhileProcessing:v=!1,resetOnError:y=!1,resetOnSuccess:b=!1,setDefaultsOnSuccess:x=!1,invalidateCacheTags:S=[],validateFiles:C=!1,validationTimeout:w=1500,withAllErrors:T=null,component:E=null,instant:D=!1,children:O,...ee},k)=>{let A=()=>{let[e,t]=I();return o(t)},j=wc({}).withPrecognition(()=>te,()=>I()[0]).setValidationTimeout(w);C&&j.validateFiles(),(T??Ii.get(`form.withAllErrors`))&&j.withAllErrors(),j.transform(A);let M=(0,z.useRef)(void 0),te=(0,z.useMemo)(()=>Ka(e)?e.method:t.toLowerCase(),[e,t]),N=(0,z.useMemo)(()=>E||(D&&Ka(e)?qa(e):null),[E,D,e]),[P,F]=(0,z.useState)(!1),ne=(0,z.useRef)(new FormData),re=e=>new FormData(M.current,e),ie=e=>Bo(re(e)),I=t=>Va(te,Ka(e)?e.url:e,ie(t),r),L=e=>{e.type===`reset`&&e.detail?.[Ks]&&e.preventDefault(),Tc(()=>F(e.type!==`reset`&&!_r(ie(),Bo(ne.current))))},ae=(...e)=>(j.clearErrors(...e),j);(0,z.useEffect)(()=>{ne.current=re(),j.setDefaults(ie());let e=[`input`,`change`,`reset`];return e.forEach(e=>M.current.addEventListener(e,L)),()=>{e.forEach(e=>M.current?.removeEventListener(e,L))}},[]),(0,z.useEffect)(()=>{j.setValidationTimeout(w)},[w]),(0,z.useEffect)(()=>{C?j.validateFiles():j.withoutFileValidation()},[C]);let oe=(...e)=>{M.current&&Qs(M.current,ne.current,e),j.reset(...e)},se=(...e)=>{ae(...e),oe(...e)},ce=e=>{e&&(e===!0?oe():e.length>0&&oe(...e))},R=e=>{let[t,v]=I(e);if(e?.getAttribute(`formtarget`)===`_blank`&&te===`get`){window.open(t,`_blank`);return}let C={headers:n,queryStringArrayFormat:r,errorBag:i,showProgress:a,invalidateCacheTags:S,component:N,optimistic:s?e=>s(e,v):void 0,onCancelToken:g,onBefore:f,onStart:l,onProgress:u,onFinish:d,onCancel:p,onSuccess:async(...e)=>{let t=await m(...e);return _({reset:oe,defaults:le}),ce(b),x===!0&&le(),t},onError(...e){h(...e),ce(y)},...c};j.transform(()=>o(v)),j.submit(te,t,C),j.transform(A)},le=()=>{ne.current=re(),F(!1)},ue={errors:j.errors,hasErrors:j.hasErrors,processing:j.processing,progress:j.progress,wasSuccessful:j.wasSuccessful,recentlySuccessful:j.recentlySuccessful,isDirty:P,clearErrors:ae,resetAndClearErrors:se,setError:j.setError,reset:oe,submit:R,defaults:le,getData:ie,getFormData:re,validator:()=>j.validator(),validating:j.validating,valid:j.valid,invalid:j.invalid,validate:(e,t)=>j.validate(...Po.mergeHeadersForValidation(e,t,n)),touch:j.touch,touched:j.touched};(0,z.useImperativeHandle)(k,()=>ue,[j,P,R]);let de=(0,z.createElement)(`form`,{...ee,ref:M,action:Ka(e)?e.url:e,method:te,onSubmit:e=>{e.preventDefault(),R(e.nativeEvent.submitter)},inert:v&&j.processing},typeof O==`function`?O(ue):O);return(0,z.createElement)(Dc.Provider,{value:ue},de)});Oc.displayName=`InertiaForm`;var kc=Oc,Ac=function({children:e,title:t}){let n=(0,z.use)(sc),r=(0,z.useMemo)(()=>n.createProvider(),[n]),i=typeof window>`u`;(0,z.useEffect)(()=>(r.reconnect(),r.update(d(e)),()=>{r.disconnect()}),[r,e,t]);function a(e){return typeof e.type==`string`&&[`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`].indexOf(e.type)>-1}function o(e){let t=Object.keys(e.props).reduce((t,n)=>{if([`head-key`,`children`,`dangerouslySetInnerHTML`].includes(n))return t;let r=String(e.props[n]);return r===``?t+` ${n}`:t+` ${n}="${Xr(r)}"`},``);return`<${String(e.type)}${t}>`}function s(e){let{children:t}=e.props;return typeof t==`string`?t:Array.isArray(t)?t.reduce((e,t)=>e+c(t),``):``}function c(e){let t=o(e);return e.props.children&&(t+=s(e)),e.props.dangerouslySetInnerHTML&&(t+=e.props.dangerouslySetInnerHTML.__html),a(e)||(t+=`</${String(e.type)}>`),t}function l(e){return z.cloneElement(e,{"data-inertia":e.props[`head-key`]===void 0?``:e.props[`head-key`]})}function u(e){return c(l(e))}function d(e){let n=z.Children.toArray(e).filter(e=>e).map(e=>u(e));return t&&!n.find(e=>e.startsWith(`<title`))&&n.push(`<title data-inertia="">${Xr(t)}</title>`),n}return i&&r.update(d(e)),null},jc=(e,t)=>e?e&&typeof e==`object`&&`current`in e?e.current:typeof e==`string`?document.querySelector(e):t:t,Mc=(e,t,n=null)=>e?typeof e==`function`?e(t):e:n,Nc=(0,z.forwardRef)(({data:e,buffer:t=0,as:n=`div`,manual:r=!1,manualAfter:i=0,preserveUrl:a=!1,reverse:o=!1,autoScroll:s,children:c,startElement:l,endElement:u,itemsElement:d,previous:f,next:p,loading:m,params:h={},onlyNext:g=!1,onlyPrevious:_=!1,...v},y)=>{let[b,x]=(0,z.useState)(null),S=(0,z.useCallback)(e=>x(e),[]),[C,w]=(0,z.useState)(null),T=(0,z.useCallback)(e=>w(e),[]),[E,D]=(0,z.useState)(null),O=(0,z.useCallback)(e=>D(e),[]),ee=xc().scrollProps?.[e],[k,A]=(0,z.useState)(!1),[j,M]=(0,z.useState)(!1),[te,N]=(0,z.useState)(0),[P,F]=(0,z.useState)(!!ee?.previousPage),[ne,re]=(0,z.useState)(!!ee?.nextPage),[ie,I]=(0,z.useState)(null),[L,ae]=(0,z.useState)(null),[oe,se]=(0,z.useState)(null);(0,z.useEffect)(()=>{let e=l?jc(l,b):b;I(e)},[l,b]),(0,z.useEffect)(()=>{let e=u?jc(u,C):C;ae(e)},[u,C]),(0,z.useEffect)(()=>{let e=d?jc(d,E):E;se(e)},[d,E]);let ce=(0,z.useMemo)(()=>va(oe),[oe]),R=(0,z.useRef)({buffer:t,onlyNext:g,onlyPrevious:_,reverse:o,preserveUrl:a,params:h});R.current={buffer:t,onlyNext:g,onlyPrevious:_,reverse:o,preserveUrl:a,params:h};let[le,ue]=(0,z.useState)(null),de=(0,z.useMemo)(()=>le?.dataManager,[le]),fe=(0,z.useMemo)(()=>le?.elementManager,[le]),pe=(0,z.useCallback)(()=>{ce?ce.scrollTo({top:ce.scrollHeight,behavior:`instant`}):window.scrollTo({top:document.body.scrollHeight,behavior:`instant`})},[ce]);(0,z.useEffect)(()=>{if(!oe)return;function t(){N(n.dataManager.getRequestCount()),F(n.dataManager.hasPrevious()),re(n.dataManager.hasNext())}let n=as({getPropName:()=>e,inReverseMode:()=>R.current.reverse,shouldFetchNext:()=>!R.current.onlyPrevious,shouldFetchPrevious:()=>!R.current.onlyNext,shouldPreserveUrl:()=>R.current.preserveUrl,getReloadOptions:()=>R.current.params,getTriggerMargin:()=>R.current.buffer,getStartElement:()=>ie,getEndElement:()=>L,getItemsElement:()=>oe,getScrollableParent:()=>ce,onBeforePreviousRequest:()=>A(!0),onBeforeNextRequest:()=>M(!0),onCompletePreviousRequest:({completed:e})=>{A(!1),e&&t()},onCompleteNextRequest:({completed:e})=>{M(!1),e&&t()},onDataReset:t});ue(n);let{dataManager:r,elementManager:i}=n;return t(),i.setupObservers(),i.processServerLoadedElements(r.getLastLoadedPage()),he&&i.enableTriggers(),()=>{n.flush(),ue(null)}},[e,oe,ie,L,ce]);let me=(0,z.useMemo)(()=>r||i>0&&te>=i,[r,i,te]),he=(0,z.useMemo)(()=>!me,[me]);(0,z.useEffect)(()=>{he?fe?.enableTriggers():fe?.disableTriggers()},[he,g,_,ie,L]),(0,z.useEffect)(()=>{(s===void 0?o:s)&&pe()},[ce]),(0,z.useImperativeHandle)(y,()=>({fetchNext:de?.fetchNext||(()=>{}),fetchPrevious:de?.fetchPrevious||(()=>{}),hasPrevious:de?.hasPrevious||(()=>!1),hasNext:de?.hasNext||(()=>!1)}),[de]);let ge=he&&!g,_e=he&&!_,ve={loadingPrevious:k,loadingNext:j,hasPrevious:P,hasNext:ne},ye={loading:k,fetch:de?.fetchPrevious??(()=>{}),autoMode:ge,manualMode:!ge,hasMore:P,...ve},be={loading:j,fetch:de?.fetchNext??(()=>{}),autoMode:_e,manualMode:!_e,hasMore:ne,...ve},xe={loading:k||j,loadingPrevious:k,loadingNext:j},Se=[];return l||Se.push((0,z.createElement)(`div`,{ref:S},Mc(f,ye,k?Mc(m,ye):null))),Se.push((0,z.createElement)(n,{...v,ref:O},typeof c==`function`?c(xe):c)),u||Se.push((0,z.createElement)(`div`,{ref:T},Mc(p,be,j?Mc(m,be):null))),(0,z.createElement)(z.Fragment,{},...o?[...Se].reverse():Se)});Nc.displayName=`InertiaInfiniteScroll`;var Pc=()=>void 0,Fc=(0,z.forwardRef)(({children:e,as:t=`a`,data:n={},href:r=``,method:i=`get`,preserveScroll:a=!1,preserveState:o=null,preserveUrl:s=!1,replace:c=!1,only:l=[],except:u=[],headers:d={},queryStringArrayFormat:f=`brackets`,async:p=!1,onClick:m=Pc,onCancelToken:h=Pc,onBefore:g=Pc,onStart:_=Pc,onProgress:v=Pc,onFinish:y=Pc,onCancel:b=Pc,onSuccess:x=Pc,onError:S=Pc,onPrefetching:C=Pc,onPrefetched:w=Pc,prefetch:T=!1,cacheFor:E=0,cacheTags:D=[],viewTransition:O=!1,component:ee=null,instant:k=!1,pageProps:A=null,...j},M)=>{let[te,N]=(0,z.useState)(0),P=(0,z.useRef)(void 0),F=(0,z.useMemo)(()=>Ka(r)?r.method:i.toLowerCase(),[r,i]),ne=(0,z.useMemo)(()=>ee||(k&&Ka(r)?qa(r):null),[ee,k,r]),re=(0,z.useMemo)(()=>typeof t!=`string`||t.toLowerCase()!==`a`?t:F===`get`?t.toLowerCase():`button`,[t,F]),ie=(0,z.useMemo)(()=>Va(F,Ka(r)?r.url:r,n,f),[r,F,n,f]),I=(0,z.useMemo)(()=>ie[0],[ie]),L=(0,z.useMemo)(()=>ie[1],[ie]),ae=(0,z.useMemo)(()=>({data:L,method:F,preserveScroll:a,preserveState:o??F!==`get`,preserveUrl:s,replace:c,only:l,except:u,headers:d,async:p,component:ne,pageProps:A}),[L,F,a,o,s,c,l,u,d,p,ne,A]),oe=(0,z.useMemo)(()=>({...ae,viewTransition:O,onCancelToken:h,onBefore:g,onStart(e){N(e=>e+1),_(e)},onProgress:v,onFinish(e){N(e=>e-1),y(e)},onCancel:b,onSuccess:x,onError:S}),[ae,O,h,g,_,v,y,b,x,S]),se=(0,z.useMemo)(()=>T===!0?[`hover`]:T===!1?[]:Array.isArray(T)?T:[T],Array.isArray(T)?T:[T]),ce=(0,z.useMemo)(()=>E===0?se.length===1&&se[0]===`click`?0:Lc.get(`prefetch.cacheFor`):E,[E,se]),R=(0,z.useMemo)(()=>()=>{G.prefetch(I,{...ae,onPrefetching:C,onPrefetched:w},{cacheFor:ce,cacheTags:D})},[I,ae,C,w,ce,D]);(0,z.useEffect)(()=>()=>{clearTimeout(P.current)},[]),(0,z.useEffect)(()=>{se.includes(`mount`)&&setTimeout(()=>R())},se);let le={onClick:e=>{m(e),_s(e)&&(e.preventDefault(),G.visit(I,oe))}},ue={onMouseEnter:()=>{P.current=window.setTimeout(()=>{R()},Lc.get(`prefetch.hoverDelay`))},onMouseLeave:()=>{clearTimeout(P.current)},onClick:le.onClick},de={onMouseDown:e=>{_s(e)&&(e.preventDefault(),R())},onKeyDown:e=>{vs(e)&&(e.preventDefault(),R())},onMouseUp:e=>{_s(e)&&(e.preventDefault(),G.visit(I,oe))},onKeyUp:e=>{vs(e)&&(e.preventDefault(),G.visit(I,oe))},onClick:e=>{m(e),_s(e)&&e.preventDefault()}},fe=(0,z.useMemo)(()=>re===`button`?{type:`button`}:re===`a`||typeof re!=`string`?{href:I}:{},[re,I]);return(0,z.createElement)(re,{...j,...fe,ref:M,...se.includes(`hover`)?ue:se.includes(`click`)?de:le,"data-loading":te>0?``:void 0},e)});Fc.displayName=`InertiaLink`;var Ic=Fc,Lc=Ii.extend(),K=t(f(),1),Rc=`effects`;function zc(){return p(Rc)}function Bc(e,t){return t}function Vc(e){let t=document.createElement(`a`);t.href=e,t.rel=`noopener`,document.body.appendChild(t),t.click(),t.remove()}function Hc(e){return t=>window.dispatchEvent(new CustomEvent(e,{detail:t.props}))}var Uc={"reload-page":()=>window.location.reload(),redirect:e=>window.location.assign(e.props.url),download:e=>Vc(e.props.url),"locale-change":e=>u(e.props.locale),toast:Hc(d.toast),callout:Hc(d.callout),"retract-callout":Hc(d.retractCallout),"reload-component":Hc(d.reloadComponent),"open-modal":Hc(d.openModal),"close-modal":Hc(d.closeModal),"reset-form":Hc(d.resetForm),"toggle-sidebar":Hc(d.toggleSidebar)};function Wc(...e){return Object.assign({},...e)}function Gc({href:e,method:t=`get`,children:n,...r}){return(0,K.jsx)(Ic,{href:e,method:t,...r,children:n})}function Kc(e){return G.on(`navigate`,e)}var qc={Link:Gc,visit:(e,t)=>G.visit(e,t),reload:()=>G.reload(),onNavigate:Kc};function Jc(e){return e.split(/[?#]/,1)[0]??e}function Yc(e){return e===void 0?typeof window>`u`?void 0:window.location.pathname:Jc(e)}function Xc(e){let[t,n]=(0,z.useState)(()=>Yc(e));return(0,z.useEffect)(()=>G.on(`navigate`,e=>n(Jc(e.detail.page.url))),[]),(0,z.useMemo)(()=>({...qc,currentUrl:t}),[t])}function Zc(){window.dispatchEvent(new CustomEvent(d.closeModal,{detail:{modal:null}}))}function Qc(){(0,z.useEffect)(()=>G.on(`navigate`,Zc),[])}var $c={name:`lattice/navigation`,extensions:{effects:{redirect:Bc(`redirect`,e=>G.visit(e.props.url)),"reload-page":Bc(`reload-page`,e=>e.props.full?window.location.reload():G.reload())}}},el=(0,z.createContext)([]);function tl({children:e,renderer:t}){let n=(0,z.useContext)(el),r=(0,z.useMemo)(()=>[t,...n],[n,t]);return(0,K.jsx)(el.Provider,{value:r,children:e})}function nl({className:e,icon:t}){let n=(0,z.useContext)(el),{ids:r}=w();for(let r of n){let n=r({className:e,icon:t});if(n!=null&&n!==!1)return n}return r&&!r.includes(t)?(0,K.jsx)(rl,{className:e}):(0,K.jsx)(y,{className:e,name:t})}function rl({className:e}){return(0,K.jsxs)(`svg`,{"aria-hidden":`true`,className:x(`size-lt-icon-md text-lt-muted-fg`,e),"data-lattice-missing-icon":``,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`2`,viewBox:`0 0 24 24`,children:[(0,K.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,K.jsx)(`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`}),(0,K.jsx)(`path`,{d:`M12 17h.01`})]})}var il=b(`inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-lt-sm text-base font-medium transition-[color,box-shadow] disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-lt-icon-md [&_svg]:shrink-0 outline-none focus-visible:border-lt-ring focus-visible:ring-lt-ring/50 focus-visible:ring-[length:var(--lt-ring-width)] aria-invalid:ring-lt-danger/20 dark:aria-invalid:ring-lt-danger/40 aria-invalid:border-lt-danger`,{variants:{emphasis:{solid:`shadow-lt-xs disabled:bg-lt-disabled disabled:text-lt-disabled-fg disabled:shadow-none`,outline:`border border-lt-input bg-lt-bg shadow-lt-xs hover:bg-lt-accent hover:text-lt-accent-fg disabled:bg-lt-disabled disabled:text-lt-disabled-fg disabled:border-transparent disabled:shadow-none`,ghost:`hover:bg-lt-accent hover:text-lt-accent-fg disabled:text-lt-disabled-fg`,link:`underline-offset-4 hover:underline disabled:text-lt-disabled-fg disabled:no-underline`},variant:{primary:``,secondary:``,success:``,info:``,warning:``,danger:``},size:{md:`h-lt-control-md px-4 py-2 has-[>svg]:px-3`,sm:`h-lt-control-sm rounded-lt-sm px-3 has-[>svg]:px-2.5`,lg:`h-lt-control-lg rounded-lt-sm px-6 has-[>svg]:px-4`,icon:`size-lt-control-md`}},compoundVariants:[{emphasis:`solid`,variant:`primary`,class:`bg-lt-primary text-lt-primary-fg hover:bg-lt-primary-hover active:bg-lt-primary-active`},{emphasis:`solid`,variant:`secondary`,class:`bg-lt-secondary text-lt-secondary-fg hover:bg-lt-secondary-hover active:bg-lt-secondary-active`},{emphasis:`solid`,variant:`success`,class:`bg-lt-success text-lt-success-fg hover:bg-lt-success-hover active:bg-lt-success-active`},{emphasis:`solid`,variant:`info`,class:`bg-lt-info text-lt-info-fg hover:bg-lt-info-hover active:bg-lt-info-active`},{emphasis:`solid`,variant:`warning`,class:`bg-lt-warning text-lt-warning-fg hover:bg-lt-warning-hover active:bg-lt-warning-active`},{emphasis:`solid`,variant:`danger`,class:`bg-lt-danger text-lt-danger-fg hover:bg-lt-danger-hover active:bg-lt-danger-active focus-visible:ring-lt-danger/20 dark:focus-visible:ring-lt-danger/40`},{emphasis:`outline`,variant:`primary`,class:`border-lt-primary/40 text-lt-primary hover:bg-lt-primary/10 hover:text-lt-primary`},{emphasis:`outline`,variant:`secondary`,class:`border-lt-secondary text-lt-secondary-fg hover:bg-lt-secondary hover:text-lt-secondary-fg`},{emphasis:`outline`,variant:`success`,class:`border-lt-success/40 text-lt-success hover:bg-lt-success/10 hover:text-lt-success`},{emphasis:`outline`,variant:`info`,class:`border-lt-info/40 text-lt-info hover:bg-lt-info/10 hover:text-lt-info`},{emphasis:`outline`,variant:`warning`,class:`border-lt-warning/40 text-lt-warning hover:bg-lt-warning/10 hover:text-lt-warning`},{emphasis:`outline`,variant:`danger`,class:`border-lt-danger/40 text-lt-danger hover:bg-lt-danger/10 hover:text-lt-danger`},{emphasis:`ghost`,variant:`primary`,class:`text-lt-primary hover:bg-lt-primary/10 hover:text-lt-primary`},{emphasis:`ghost`,variant:`secondary`,class:`text-lt-secondary-fg hover:bg-lt-secondary hover:text-lt-secondary-fg`},{emphasis:`ghost`,variant:`success`,class:`text-lt-success hover:bg-lt-success/10 hover:text-lt-success`},{emphasis:`ghost`,variant:`info`,class:`text-lt-info hover:bg-lt-info/10 hover:text-lt-info`},{emphasis:`ghost`,variant:`warning`,class:`text-lt-warning hover:bg-lt-warning/10 hover:text-lt-warning`},{emphasis:`ghost`,variant:`danger`,class:`text-lt-danger hover:bg-lt-danger/10 hover:text-lt-danger`},{emphasis:`link`,variant:`primary`,class:`text-lt-primary`},{emphasis:`link`,variant:`secondary`,class:`text-lt-secondary-fg`},{emphasis:`link`,variant:`success`,class:`text-lt-success`},{emphasis:`link`,variant:`info`,class:`text-lt-info`},{emphasis:`link`,variant:`warning`,class:`text-lt-warning`},{emphasis:`link`,variant:`danger`,class:`text-lt-danger`}],defaultVariants:{emphasis:`solid`,size:`md`}});function al(e,t){return t||((e??`solid`)===`solid`||e===`link`?`primary`:void 0)}function q({className:e,variant:t,emphasis:n,size:r,asChild:i=!1,icon:a,children:o,...s}){let c=i?g:`button`,l=a&&!i?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(y,{name:a,"aria-hidden":`true`}),o]}):o;return(0,K.jsx)(c,{"data-slot":`button`,className:x(il({emphasis:n,variant:al(n,t),size:r,className:e})),...s,children:l})}var ol=[];ol.forEach,ol.slice;var sl=[`__proto__`,`constructor`,`prototype`];function cl(e){return!(typeof e!=`string`||e.length===0||e.length>128||sl.indexOf(e)>-1||e.indexOf(`..`)>-1||e.indexOf(`\\`)>-1||/[?#%\s]/.test(e)||/[\x00-\x1F\x7F]/.test(e))}function ll(e){return!(!cl(e)||e.indexOf(`/`)>-1||e.indexOf(`@`)>-1)}function ul(e){return cl(e)}var dl={lng:ll,ns:ul};function fl(e){return typeof e==`string`?e.replace(/[\r\n\x00-\x1F\x7F]/g,` `):e}function pl(e){if(typeof e!=`string`||e.length===0)return e;try{let t=new URL(e);return t.username||t.password?(t.username=``,t.password=``,t.toString()):e}catch{return e.replace(/(\/\/)[^/@\s]+@/g,`$1`)}}function ml(){return typeof XMLHttpRequest==`function`||typeof XMLHttpRequest==`object`}function hl(e){return!!e&&typeof e.then==`function`}function gl(e){return hl(e)?e:Promise.resolve(e)}var _l=/\{\{(.+?)\}\}/g;function vl(e,t){let n=!1,r=e.replace(_l,(e,r)=>{let i=r.trim();if(sl.indexOf(i)>-1)return e;let a=t[i];if(a==null)return e;let o=dl[i]||ll,s=String(a).split(`+`);for(let t of s)if(!o(t))return n=!0,e;return s.join(`+`)});return n?null:r}var yl=typeof globalThis<`u`?globalThis:typeof global<`u`?global:typeof window<`u`?window:void 0,bl;typeof fetch==`function`?bl=fetch:yl&&typeof yl.fetch==`function`&&(bl=yl.fetch);var xl=ml()&&yl?yl.XMLHttpRequest:void 0,Sl=typeof ActiveXObject==`function`&&yl?yl.ActiveXObject:void 0,Cl=[`__proto__`,`constructor`,`prototype`],wl=(e,t)=>{if(t&&typeof t==`object`){let n=``;for(let e of Object.keys(t))Cl.indexOf(e)>-1||(n+=`&`+encodeURIComponent(e)+`=`+encodeURIComponent(t[e]));if(!n)return e;e=e+(e.indexOf(`?`)===-1?`?`:`&`)+n.slice(1)}return e},Tl=(e,t,n,r)=>{let i=e=>{if(!e.ok)return n(e.statusText||`Error`,{status:e.status});e.text().then(t=>{n(null,{status:e.status,data:t})}).catch(n)};if(r){let a=r(e,t);if(a instanceof Promise){a.then(i).catch(n);return}}typeof fetch==`function`?fetch(e,t).then(i).catch(n):bl(e,t).then(i).catch(n)},El=(e,t,n,r)=>{e.queryStringParams&&(t=wl(t,e.queryStringParams));let i={...typeof e.customHeaders==`function`?e.customHeaders():e.customHeaders};typeof window>`u`&&typeof global<`u`&&global.process!==void 0&&global.process.versions&&global.process.versions.node&&(i[`User-Agent`]=`i18next-http-backend (node/${global.process.version}; ${global.process.platform} ${global.process.arch})`),n&&(i[`Content-Type`]=`application/json`);let a=typeof e.requestOptions==`function`?e.requestOptions(n):e.requestOptions,o={method:n?`POST`:`GET`,body:n?e.stringify(n):void 0,headers:i,...e._omitFetchOptions?{}:a},s=typeof e.alternateFetch==`function`&&e.alternateFetch.length>=1?e.alternateFetch:void 0;try{Tl(t,o,r,s)}catch(n){if(!a||Object.keys(a).length===0||!n.message||n.message.indexOf(`not implemented`)<0)return r(n);try{Object.keys(a).forEach(e=>{delete o[e]}),Tl(t,o,r,s),e._omitFetchOptions=!0}catch(e){r(e)}}},Dl=(e,t,n,r)=>{n&&typeof n==`object`&&(n=wl(``,n).slice(1)),e.queryStringParams&&(t=wl(t,e.queryStringParams));try{let i=xl?new xl:new Sl(`MSXML2.XMLHTTP.3.0`);i.open(n?`POST`:`GET`,t,1),e.crossDomain||i.setRequestHeader(`X-Requested-With`,`XMLHttpRequest`),i.withCredentials=!!e.withCredentials,n&&i.setRequestHeader(`Content-Type`,`application/x-www-form-urlencoded`),i.overrideMimeType&&i.overrideMimeType(`application/json`);let a=e.customHeaders;if(a=typeof a==`function`?a():a,a)for(let e of Object.keys(a))Cl.indexOf(e)>-1||i.setRequestHeader(e,a[e]);i.onreadystatechange=()=>{i.readyState>3&&r(i.status>=400?i.statusText:null,{status:i.status,data:i.responseText})},i.send(n)}catch(e){console&&console.log(e)}},Ol=(e,t,n,r)=>{if(typeof n==`function`&&(r=n,n=void 0),r||=(()=>{}),bl&&t.indexOf(`file:`)!==0)return El(e,t,n,r);if(ml()||typeof ActiveXObject==`function`)return Dl(e,t,n,r);r(Error(`No fetch and no xhr implementation found!`))},kl=()=>({loadPath:`/locales/{{lng}}/{{ns}}.json`,addPath:`/locales/add/{{lng}}/{{ns}}`,parse:e=>JSON.parse(e),stringify:JSON.stringify,parsePayload:(e,t,n)=>({[t]:n||``}),parseLoadPayload:(e,t)=>void 0,request:Ol,reloadInterval:typeof window<`u`?!1:36e5,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:`cors`,credentials:`same-origin`,cache:`default`}}),Al=class{constructor(e,t={},n={}){this.services=e,this.options=t,this.allOptions=n,this.type=`backend`,this.init(e,t,n)}init(e,t={},n={}){if(this.services=e,this.options={...kl(),...this.options||{},...t},this.allOptions=n,this.services&&this.options.reloadInterval){let e=setInterval(()=>this.reload(),this.options.reloadInterval);typeof e==`object`&&typeof e.unref==`function`&&e.unref()}}readMulti(e,t,n){this._readAny(e,e,t,t,n)}read(e,t,n){this._readAny([e],e,[t],t,n)}_readAny(e,t,n,r,i){let a=this.options.loadPath;typeof this.options.loadPath==`function`&&(a=this.options.loadPath(e,n)),a=gl(a),a.then(a=>{if(!a)return i(null,{});let o=vl(a,{lng:e.join(`+`),ns:n.join(`+`)});if(o==null){let t=e.map(fl).join(`, `),r=n.map(fl).join(`, `);return i(Error(`i18next-http-backend: unsafe lng/ns value — refusing to build request URL for languages=[`+t+`] namespaces=[`+r+`]`),!1)}this.loadUrl(o,i,t,r)})}loadUrl(e,t,n,r){let i=typeof n==`string`?[n]:n,a=typeof r==`string`?[r]:r,o=this.options.parseLoadPayload(i,a),s=fl(pl(e));this.options.request(this.options,e,o,(e,i)=>{if(i&&(i.status>=500&&i.status<600||!i.status))return t(`failed loading `+s+`; status code: `+i.status,!0);if(i&&i.status>=400&&i.status<500)return t(`failed loading `+s+`; status code: `+i.status,!1);if(!i&&e&&e.message){let n=e.message.toLowerCase();if([`failed`,`fetch`,`network`,`load`].find(e=>n.indexOf(e)>-1))return t(`failed loading `+s+`: `+fl(e.message),!0)}if(e)return t(e,!1);let a,o;try{a=typeof i.data==`string`?this.options.parse(i.data,n,r):i.data}catch{o=`failed parsing `+s+` to json`}if(o)return t(o,!1);t(null,a)})}create(e,t,n,r,i){if(!this.options.addPath)return;typeof e==`string`&&(e=[e]);let a=this.options.parsePayload(t,n,r),o=0,s=[],c=[];e.forEach(n=>{let r=this.options.addPath;typeof this.options.addPath==`function`&&(r=this.options.addPath(n,t));let l=vl(r,{lng:n,ns:t});if(l==null){o+=1,i&&o===e.length&&i(s,c);return}this.options.request(this.options,l,a,(t,n)=>{o+=1,s.push(t),c.push(n),o===e.length&&typeof i==`function`&&i(s,c)})})}reload(){let{backendConnector:e,languageUtils:t,logger:n}=this.services,r=e.language;if(r&&r.toLowerCase()===`cimode`)return;let i=[],a=e=>{t.toResolveHierarchy(e).forEach(e=>{i.indexOf(e)<0&&i.push(e)})};a(r),this.allOptions.preload&&this.allOptions.preload.forEach(e=>a(e)),i.forEach(t=>{this.allOptions.ns.forEach(r=>{e.read(t,r,`read`,null,null,(i,a)=>{i&&n.warn(`loading namespace ${r} for language ${t} failed`,i),!i&&a&&n.log(`loaded namespace ${r} for language ${t}`,a),e.loaded(`${t}|${r}`,i,a)})})})}};Al.type=`backend`;var jl=`/locales/{{lng}}/{{ns}}.json`,Ml=`/locales/add/{{lng}}/{{ns}}`;async function Nl(e,t={}){if(se(e),!e?.enabled){await re(e=>({...e,ns:t.namespaces??e.ns}));return}await Pl({saveMissing:e.saveMissing,namespaces:t.namespaces}),ne(e.preloadLocales)}async function Pl(e={}){let{namespaces:t,loadPath:n=jl,addPath:r=Ml,saveMissing:i=!1,customHeaders:a}=e,o=()=>({...c(),...a?.()});te.use(Al),await re(e=>({...e,ns:t??e.ns,partialBundledLanguages:!0,saveMissing:i,backend:{loadPath:n,addPath:r,customHeaders:o,withCredentials:!0}}))}function Fl(e,t,n={}){let{enabled:r=!0}=n,i=(0,z.useRef)(t);i.current=t,(0,z.useEffect)(()=>{if(!r||typeof window>`u`)return;let t=e=>i.current(e);return window.addEventListener(e,t),()=>window.removeEventListener(e,t)},[e,r])}function Il({href:e,method:t,...n}){return(0,K.jsx)(`a`,{href:e,...n})}function Ll(){return typeof window>`u`?void 0:window.location.pathname}function Rl(){return()=>void 0}var J={Link:Il,visit:e=>window.location.assign(e),reload:()=>window.location.reload()},Y=(0,z.createContext)(J);function zl({adapter:e,children:t}){return(0,K.jsx)(Y.Provider,{value:e,children:t})}function Bl(){let e=(0,z.useContext)(Y);return{Link:e.Link,visit:e.visit,reload:e.reload,currentUrl:e.currentUrl??Ll(),onNavigate:e.onNavigate??Rl}}function Vl({preserveScroll:e=!0,preserveState:t=!0}){let{visit:n}=Bl();return Fl(d.localeChange,r=>{let i=r.detail?.locale;typeof i==`string`&&i!==``&&n(window.location.href,{preserveScroll:e,preserveState:t})}),null}function Hl({namespace:e=`lattice`,label:t}={}){let{t:n,locale:r,locales:i,setLocale:a}=N(e),o=i.length>0?i:[r],s=t??(e=>n(`language.${e}`,e));return{locale:r,locales:o,options:o.map(e=>({value:e,label:s(e),active:e===r})),setLocale:a}}function Ul(e){return Array.isArray(e)&&e.every(e=>typeof e==`string`)}function Wl(e){return a(e)&&typeof e.enabled==`boolean`&&typeof e.saveMissing==`boolean`&&Ul(e.locales)&&Ul(e.preloadLocales)&&(e.timezone===void 0||e.timezone===null||typeof e.timezone==`string`)}function Gl(e){if(!a(e))return;let t=e.lattice,n=a(t)?t.i18n:void 0;return Wl(n)?n:void 0}var Kl=e({configureI18nFromPageProps:()=>ql,i18nConfigFromPageProps:()=>Gl});function ql(e,t={}){return Nl(Gl(e),t)}function Jl({value:e,dateStyle:t=`medium`,timeStyle:n=`short`}){let{locale:r}=s(),{timezone:i}=oe();if(e==null||e===``)return null;let a={locale:r,timeZone:i},o=L(e,{dateStyle:t,timeStyle:n},a),c=Yl(e),l=I(e,a);return(0,K.jsx)(`time`,{dateTime:c??void 0,title:l||void 0,children:o})}function Yl(e){return ae(e)?.toISOString()??null}function Xl({className:e,...t}){let{t:n}=N(F);return(0,K.jsx)(y,{name:`loader-2`,role:`status`,"aria-label":n(`common.loading`,`Loading`),"aria-hidden":!1,className:x(`animate-spin`,e),...t})}function Zl(e){return e==null||e===``?void 0:e}function X(e){return Zl(e.key)??Zl(e.id)}function Ql(e){return Zl(e)?.split(`.`).at(-1)}function $l(e,t){let n=Ql(t);return n?`${e}-${n}`:void 0}function eu(e,t){return $l(e,X(t))}var tu=(0,z.createContext)(!1),nu=`flex h-lt-control-sm w-full items-center justify-start gap-2 rounded-lt-sm px-2.5 text-left text-sm font-normal text-lt-popover-fg no-underline decoration-transparent shadow-none transition-colors hover:bg-lt-accent/70 hover:text-lt-popover-fg focus-visible:bg-lt-accent/70 focus-visible:text-lt-popover-fg focus-visible:ring-0 focus-visible:outline-none disabled:pointer-events-none disabled:text-lt-disabled-fg [&_svg]:size-lt-icon-sm [&_svg]:text-lt-muted-fg`;function ru({children:e}){return(0,K.jsx)(tu.Provider,{value:!0,children:e})}function iu(){return(0,z.useContext)(tu)}function au(e,t=Uc){if(!(typeof window>`u`))for(let n of e){let e=t[n.type];if(e===void 0){console.warn(`[lattice] No handler registered for effect type "${n.type}".`);continue}e(n)}}function ou(e){typeof window>`u`||window.dispatchEvent(new CustomEvent(d.actionError,{detail:{error:e}}))}function su(e){return Array.isArray(e)?e.filter(cu):[]}function cu(e){return typeof e==`object`&&!!e&&`type`in e&&typeof e.type==`string`}function lu(){let e=zc(),t=(0,z.useMemo)(()=>Wc(Uc,e),[e]);return(0,z.useCallback)(e=>au(e,t),[t])}var uu=`Embedded modals require a ModalProvider.`,du=(0,z.createContext)(null);function fu(){return(0,z.useContext)(du)}var pu=(0,z.createContext)(null);function mu(){return(0,z.useContext)(pu)}function hu(){let e=mu();if(!e)throw Error(uu);return e}function gu({children:e}){let[t,n]=(0,z.useState)([]),r=(0,z.useRef)(t),i=(0,z.useRef)(0),a=(0,z.useRef)(new Map),o=(0,z.useCallback)(e=>{let t=e(r.current);return r.current=t,n(t),t},[]),s=(0,z.useCallback)(e=>{o(t=>{let n=t.findIndex(t=>t.key===e);if(n===-1||!t[n].open)return t;let r=[...t];return r[n]={...r[n],open:!1},r})},[o]),c=(0,z.useCallback)(e=>{let t=(0,z.isValidElement)(e)?null:e.id??null,n=document.activeElement instanceof HTMLElement?document.activeElement:null,r=-1;return o(a=>{if(t!==null){let n=a.findIndex(e=>e.nodeId===t&&e.open);if(n!==-1){r=a[n].key;let t=[...a];return t[n]={...t[n],content:e},t}}return r=i.current++,[...a,{key:r,content:e,nodeId:t,open:!0,opener:n}]}),{close:()=>s(r)}},[s,o]);(0,z.useEffect)(()=>{function e(e){let t=e.detail?.node;t&&c(t)}function t(e){let t=e.detail?.modal;o(e=>{if(t==null)return e.map(e=>e.open?{...e,open:!1}:e);let n=e.findIndex(e=>e.nodeId===t);if(n===-1)return e;let r=[...e];return r[n]={...r[n],open:!1},r})}return window.addEventListener(d.openModal,e),window.addEventListener(d.closeModal,t),()=>{window.removeEventListener(d.openModal,e),window.removeEventListener(d.closeModal,t)}},[c,o]);let l=(0,z.useCallback)(e=>{let t=a.current.get(e);return t||(t={onOpenChange:t=>{t||s(e)},onExited:t=>{o(n=>{let r=n.find(t=>t.key===e)?.opener??null;return r?.isConnected&&(t.preventDefault(),requestAnimationFrame(()=>r.focus())),n.filter(t=>t.key!==e)}),a.current.delete(e)}},a.current.set(e,t),t)},[s,o]),u=(0,z.useMemo)(()=>({open:c}),[c]);return(0,K.jsxs)(pu.Provider,{value:u,children:[e,t.map(e=>{let t={open:e.open,...l(e.key)};return(0,K.jsx)(du.Provider,{value:t,children:(0,z.isValidElement)(e.content)?e.content:(0,K.jsx)(Zt,{node:e.content})},e.key)})]})}var _u=(0,z.createContext)(null);function vu(e){return e.type===`action`||e.type===`action.bulk`}function yu({children:e,render:t}){return(0,K.jsx)(_u.Provider,{value:t,children:e})}function bu(){return(0,z.useContext)(_u)}function xu({action:e,children:t,options:n}){let r=bu();if(!r)throw Error(`Action triggers require an ActionTriggerProvider.`);return(0,K.jsx)(K.Fragment,{children:r({action:e,children:t,options:n})})}var Su=(0,z.createContext)(null);function Cu(e){return(0,z.useContext)(Su)?.(e)}function wu(e){let t=lu(),n=mu(),r=e.action??null,i=e.effects??[],a=e.modal??null;if(a)return{kind:`modal`,onClick:()=>{if(!n)throw Error(uu);n.open(a)}};if(r){if(!vu(r))throw Error(`Clickable action nodes must have type [action] or [action.bulk].`);return{kind:`action`,action:r}}return i.length>0?{kind:`effects`,onClick:()=>t(su(i))}:e.href!=null&&e.href!==``?{kind:`navigate`,href:e.href,method:e.method??`get`}:{kind:`none`}}var Tu=`X-Lattice-Ref`,Eu=new Map;function Du(e){return Eu.get(e)??e}function Ou(e,t){Eu.set(e,t)}function ku(e){let t=Du(e);return t?{[Tu]:t}:{}}var Au=()=>({});function ju(e){Au=e}function Mu(e={}){return{...Au(),...e}}function Nu(e=``,t={}){return{...Mu(),...ku(e),...t}}var Pu=class extends Error{response;constructor(e){super(`HTTP ${e.status}`),this.response=e}};function Fu(){let e=document.cookie.match(/XSRF-TOKEN=([^;]+)/);return e?decodeURIComponent(e[1]):``}var Iu=1e4,Lu=new Map,Ru=new Map;function zu(e){return e===void 0||e===`GET`||e===`HEAD`?{Accept:`application/json`}:{Accept:`application/json`,"Content-Type":`application/json`,"X-Requested-With":`XMLHttpRequest`,"X-XSRF-TOKEN":Fu()}}var Bu=`/lattice/refs/refresh`;function Vu(e){Bu=e}var Hu=new Map;async function Uu(e){let t=Hu.get(e);if(t)return t;let n=Z(Bu,{method:`POST`,body:JSON.stringify({ref:Du(e)})}).then(t=>(Ou(e,t.ref),t.ref)).catch(()=>null).finally(()=>{Hu.delete(e)});return Hu.set(e,n),n}async function Wu(e,t={}){let{ref:n=``,headers:r,throwOnError:i=!0,method:a,...o}=t,s=a?.toUpperCase(),c=()=>fetch(e,{credentials:`same-origin`,...o,method:s,headers:Nu(n,{...zu(s),...r})}),l=await c();if(n!==``&&l.status===403&&await Uu(n)!==null&&(l=await c()),i&&!l.ok)throw new Pu(l);return l}async function Z(e,t){return(await Wu(e,t)).json()}function Gu(e){return[e.source,e.audience,[...e.scopes].sort().join(` `)].join(``)}function Ku(e){Lu.delete(Gu(e))}async function qu(e){let t=Gu(e),n=Lu.get(t);if(n&&n.expiresAt>Date.now()+Iu)return n.token;let r=Ru.get(t);if(r)return r;let i=Z(e.tokenEndpoint,{method:`POST`,ref:e.ref,body:JSON.stringify({nodeId:e.nodeId,nodeType:e.nodeType,audience:e.audience,scopes:e.scopes})}).then(e=>(Lu.set(t,{token:e,expiresAt:Date.now()+Math.max(0,e.expiresIn)*1e3}),e)).finally(()=>{Ru.delete(t)});return Ru.set(t,i),i}function Ju(e){return e.status===401||e.status===403}async function Yu(e,t,n){let{headers:r,...i}=t;return fetch(e,{...i,credentials:`omit`,headers:Mu({Accept:`application/json`,...r,Authorization:`${n.tokenType} ${n.accessToken}`})})}async function Xu(e,t){let{remote:n,throwOnError:r=!0,...i}=t,a=await qu(n),o=await Yu(e,i,a);if(Ju(o)&&(Ku(n),a=await qu(n),o=await Yu(e,i,a)),r&&!o.ok)throw new Pu(o);return o}async function Zu(e,t){return(await Xu(e,t)).json()}async function Qu(e,t){try{let n=await e();return t(su((await n.json().catch(()=>({}))).effects)),n.ok}catch(e){return ou(e),!1}}var $u=Object.defineProperty,ed=(e,t)=>$u(e,`name`,{value:t,configurable:!0}),td=`Dialog`,[nd,rd]=Ye(td),[id,ad]=nd(td),od=ed(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=z.useRef(null),c=z.useRef(null),[l,u]=Dt({prop:r,defaultProp:i??!1,onChange:a,caller:td}),[d,f]=z.useState(0),[p,m]=z.useState(0);return(0,K.jsx)(id,{scope:t,triggerRef:s,contentRef:c,contentId:mt(),titleId:mt(),descriptionId:mt(),titlePresent:d>0,descriptionPresent:p>0,setTitleCount:f,setDescriptionCount:m,open:l,onOpenChange:u,onOpenToggle:z.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})},`Dialog`),sd=`DialogTrigger`,cd=z.forwardRef(ed(function(e,t){let{__scopeDialog:n,...r}=e,i=ad(sd,n),a=M(t,i.triggerRef);return(0,K.jsx)(ct.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":Dd(i.open),...r,ref:a,onClick:Wt(e.onClick,i.onOpenToggle)})},`DialogTrigger`)),ld=`DialogPortal`,[ud,dd]=nd(ld,{forceMount:void 0}),fd=ed(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=ad(ld,t);return(0,K.jsx)(ud,{scope:t,forceMount:n,children:z.Children.map(r,e=>(0,K.jsx)(_t,{present:n||a.open,children:(0,K.jsx)(Ze,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),pd=`DialogOverlay`,md=z.forwardRef(ed(function(e,t){let n=dd(pd,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=ad(pd,e.__scopeDialog);return a.modal?(0,K.jsx)(_t,{present:r||a.open,children:(0,K.jsx)(gd,{...i,ref:t})}):null},`DialogOverlay`)),hd=j(`DialogOverlay.RemoveScroll`),gd=z.forwardRef(ed(function(e,t){let{__scopeDialog:n,...r}=e,i=ad(pd,n),a=Ht(),o=M(t,a);return(0,K.jsx)(kt,{as:hd,allowPinchZoom:!0,shards:[i.contentRef],children:(0,K.jsx)(ct.div,{"data-state":Dd(i.open),...r,ref:o,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),_d=`DialogContent`,vd=z.forwardRef(ed(function(e,t){let n=dd(_d,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=ad(_d,e.__scopeDialog);return(0,K.jsx)(_t,{present:r||a.open,children:a.modal?(0,K.jsx)(yd,{...i,ref:t}):(0,K.jsx)(Q,{...i,ref:t})})},`DialogContent`)),yd=z.forwardRef(ed(function(e,t){let n=ad(_d,e.__scopeDialog),r=z.useRef(null),i=M(t,n.contentRef,r);return z.useEffect(()=>{let e=r.current;if(e)return Bt(e)},[]),(0,K.jsx)(bd,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:Wt(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:Wt(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:Wt(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),Q=z.forwardRef(ed(function(e,t){let n=ad(_d,e.__scopeDialog),r=z.useRef(!1),i=z.useRef(!1);return(0,K.jsx)(bd,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`DialogContentNonModal`)),bd=z.forwardRef(ed(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=ad(_d,n);return Lt(),(0,K.jsx)(K.Fragment,{children:(0,K.jsx)(Mt,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,K.jsx)(tt,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionPresent?s.descriptionId:void 0,"aria-labelledby":s.titlePresent?s.titleId:void 0,"data-state":Dd(s.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>s.onOpenChange(!1)})})})},`DialogContentImpl`)),xd=`DialogTitle`,Sd=z.forwardRef(ed(function(e,t){let{__scopeDialog:n,...r}=e,i=ad(xd,n),{setTitleCount:a}=i;return dt(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,K.jsx)(ct.h2,{id:i.titleId,...r,ref:t})},`DialogTitle`)),Cd=`DialogDescription`,wd=z.forwardRef(ed(function(e,t){let{__scopeDialog:n,...r}=e,i=ad(Cd,n),{setDescriptionCount:a}=i;return dt(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,K.jsx)(ct.p,{id:i.descriptionId,...r,ref:t})},`DialogDescription`)),Td=`DialogClose`,Ed=z.forwardRef(ed(function(e,t){let{__scopeDialog:n,...r}=e,i=ad(Td,n);return(0,K.jsx)(ct.button,{type:`button`,...r,ref:t,onClick:Wt(e.onClick,()=>i.onOpenChange(!1))})},`DialogClose`));function Dd(e){return e?`open`:`closed`}ed(Dd,`getState`);var Od=`fixed inset-0 z-lt-overlay bg-lt-overlay data-[state=open]:animate-lt-fade-in data-[state=closed]:animate-lt-fade-out`,kd=b(`z-lt-modal w-full bg-lt-bg p-6 shadow-lt-lg`,{variants:{placement:{center:`relative rounded-lt border border-lt-border data-[state=open]:animate-lt-dialog-in data-[state=closed]:animate-lt-dialog-out`,start:`fixed inset-y-0 start-0 overflow-y-auto border-e border-lt-border data-[state=open]:animate-lt-sheet-in-start data-[state=closed]:animate-lt-sheet-out-start`,end:`fixed inset-y-0 end-0 overflow-y-auto border-s border-lt-border data-[state=open]:animate-lt-sheet-in-end data-[state=closed]:animate-lt-sheet-out-end`},width:{sm:`max-w-sm`,md:`max-w-md`,lg:`max-w-lg`,xl:`max-w-xl`,"2xl":`max-w-2xl`,"3xl":`max-w-3xl`,"4xl":`max-w-4xl`,"5xl":`max-w-5xl`,"6xl":`max-w-6xl`,"7xl":`max-w-7xl`,max:`max-w-[calc(100vw-2rem)]`},height:{sm:``,md:``,lg:``,xl:``,"2xl":``,"3xl":``,"4xl":``,"5xl":``,max:``}},compoundVariants:[{placement:`center`,height:`sm`,class:`max-h-[min(480px,calc(100vh-2rem))] overflow-y-auto`},{placement:`center`,height:`md`,class:`max-h-[min(600px,calc(100vh-2rem))] overflow-y-auto`},{placement:`center`,height:`lg`,class:`max-h-[min(680px,calc(100vh-2rem))] overflow-y-auto`},{placement:`center`,height:`xl`,class:`max-h-[min(820px,calc(100vh-2rem))] overflow-y-auto`},{placement:`center`,height:`2xl`,class:`max-h-[min(920px,calc(100vh-2rem))] overflow-y-auto`},{placement:`center`,height:`3xl`,class:`max-h-[min(1040px,calc(100vh-2rem))] overflow-y-auto`},{placement:`center`,height:`4xl`,class:`max-h-[min(1160px,calc(100vh-2rem))] overflow-y-auto`},{placement:`center`,height:`5xl`,class:`max-h-[min(1280px,calc(100vh-2rem))] overflow-y-auto`},{placement:`center`,height:`max`,class:`h-[calc(100vh-2rem)] max-h-[calc(100vh-2rem)] overflow-y-auto`}],defaultVariants:{placement:`center`,width:`lg`}});function Ad(e){return(0,K.jsx)(od,{"data-slot":`dialog`,...e})}function jd(e){return(0,K.jsx)(Ed,{"data-slot":`dialog-close`,...e})}function Md(e){return(0,K.jsx)(cd,{"data-slot":`dialog-trigger`,...e})}function $({className:e,...t}){return(0,K.jsx)(Sd,{className:x(`text-lg font-semibold leading-none tracking-tight`,e),"data-slot":`dialog-title`,...t})}function Nd({className:e,...t}){return(0,K.jsx)(wd,{className:x(`text-sm text-lt-muted-fg`,e),"data-slot":`dialog-description`,...t})}function Pd({children:e,className:t,placement:n=`center`,width:r=`lg`,height:i,...a}){let o=(0,K.jsx)(vd,{className:x(kd({placement:n,width:r,height:i}),t),"data-slot":`dialog-content`,...a,children:e});return n===`center`?(0,K.jsx)(fd,{children:(0,K.jsx)(md,{className:x(Od,`overflow-y-auto`),"data-slot":`dialog-overlay`,children:(0,K.jsx)(`div`,{className:`grid min-h-full place-items-center p-4`,children:o})})}):(0,K.jsxs)(fd,{children:[(0,K.jsx)(md,{className:Od,"data-slot":`dialog-overlay`}),o]})}function Fd({closeLabel:e,description:t,title:n}){return(0,K.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,K.jsxs)(`div`,{className:`grid gap-2`,children:[(0,K.jsx)($,{children:n}),t?(0,K.jsx)(Nd,{children:t}):null]}),(0,K.jsx)(jd,{asChild:!0,children:(0,K.jsx)(q,{"aria-label":e,"data-test":`dialog-close`,size:`icon`,emphasis:`ghost`,children:(0,K.jsx)(y,{name:`x`,"aria-hidden":`true`,className:`size-lt-icon-md`})})})]})}function Id({open:e,title:t,description:n,confirmLabel:r,cancelLabel:i=`Cancel`,confirmVariant:a=null,confirmEmphasis:o=null,processing:s=!1,confirmDisabled:c=!1,onConfirm:l,onCancel:u,onExited:d}){let f=e=>{s&&e.preventDefault()};return(0,K.jsx)(Ad,{open:e,onOpenChange:e=>{e||u()},children:(0,K.jsxs)(Pd,{...n?{}:{"aria-describedby":void 0},width:`md`,onCloseAutoFocus:d,onEscapeKeyDown:f,onInteractOutside:f,children:[(0,K.jsxs)(`div`,{className:`grid gap-2`,children:[(0,K.jsx)($,{children:t}),n&&(0,K.jsx)(Nd,{children:n})]}),(0,K.jsxs)(`div`,{className:`mt-6 flex justify-end gap-2`,children:[(0,K.jsx)(q,{type:`button`,emphasis:`outline`,"data-test":`confirm-cancel`,disabled:s,onClick:u,children:i}),(0,K.jsxs)(q,{type:`button`,emphasis:o,variant:a,"data-test":`confirm-accept`,disabled:s||c,onClick:l,children:[s&&(0,K.jsx)(Xl,{}),r]})]})]})})}function Ld(e){return e.props.label??ie(`lattice`,`common.action.run`,`Run action`)}function Rd(e){let t=Ld(e),n=e.props.confirmation;return{title:n?.title??t,description:n?.description??void 0,confirmLabel:n?.confirmLabel??t,cancelLabel:n?.cancelLabel??ie(`lattice`,`common.cancel`,`Cancel`)}}function zd({node:e,extraData:t,onBefore:n,onError:r,onSuccess:i}){let a=fu();if(!a)throw Error(uu);let o=e.props.endpoint??``,s=e.props.ref??``,c=e.props.method??`post`,{variant:l,emphasis:u}=e.props,d=Rd(e),[f,p]=(0,z.useState)(!1),m=lu(),h=async()=>{if(!o)return;if(c===`get`){G.visit(o,{headers:Nu(s)}),a.onOpenChange(!1);return}n?.(),p(!0);let e=await Qu(()=>Wu(o,{method:c,ref:s,body:t?JSON.stringify(t):void 0,throwOnError:!1}),m);p(!1),e?(a.onOpenChange(!1),i?.()):r?.()};return(0,K.jsx)(Id,{open:a.open,onExited:a.onExited,title:d.title,description:d.description,confirmLabel:d.confirmLabel,cancelLabel:d.cancelLabel,confirmVariant:l,confirmEmphasis:u,processing:f,confirmDisabled:!o,onConfirm:()=>void h(),onCancel:()=>a.onOpenChange(!1)})}function Bd({className:e,...t}){return(0,K.jsx)(`div`,{"aria-hidden":`true`,className:x(`animate-pulse rounded-lt-sm bg-lt-muted`,e),"data-slot":`skeleton`,...t})}var Vd=(0,z.createContext)({});function Hd({nodes:e,children:t}){return(0,K.jsx)(Vd.Provider,{value:e,children:t})}function Ud(e){let t=(0,z.useContext)(Vd),n=Ce(e).name??``,r=De(),i=n&&r?r.errorKey(n):n;return i&&t[i]||n&&t[n]||e}var Wd=typeof window>`u`?z.useEffect:z.useLayoutEffect;function Gd(e,t,n,r){return Wu(e,{method:`POST`,ref:t,signal:r,body:JSON.stringify(n),throwOnError:!1}).then(e=>e.ok?e.json():null)}function Kd(e){let t=e.props.templates;return t?.length?t:void 0}function qd(e,t){let n=Kd(e);return n?n.find(e=>e.type===t.type)?.schema??[]:e.schema??[]}function Jd(e,t){return e.startsWith(`@`)?e.slice(1):t===null?e:Ve(t,e)}function Yd(e,t,n,r=0,i={}){let a=Ce(e);if(!a.editablePrefill||!a.name)return null;let o=ve(i);return{path:t===null?a.name:Ve(t,a.name),overrideKey:n===null?a.name:ke(n,o,r,a.name),resetOn:(a.prefillResetOn??[]).map(e=>Jd(e,t)),refreshOn:(a.prefillRefreshOn??[]).map(e=>Jd(e,t))}}function Xd(e,t){let n=[];function r(e,a=null,o=null,s=null,c=0,l={}){for(let u of e??[]){if(Ge(u)){let e=Ce(u).name;e&&i(u,Ve(a,e),Ve(o,e),ye(t,Ve(a,e)));continue}let e=Yd(u,a,s,c,l);e&&n.push(e),r(u.schema,a,o,s,c,l)}}function i(e,t,n,a){let o=Array.isArray(a)?a:[],s=Ue(e);o.forEach((a,o)=>{let c=Ve(t,o),l=Ve(n,ve(a)??o);r(qd(e,a),c,l,n,o,a),s&&i(e,Ve(c,s),Ve(l,s),a[s])})}return r(e),n}function Zd(e,t){let n=new Map(e.targets.map(e=>[e.overrideKey,e]));return t.targets.filter(r=>{let i=n.get(r.overrideKey);return r.resetOn.some((n,r)=>{let a=i?.resetOn[r]??n;return!Object.is(ye(e.values,a),ye(t.values,n))})}).map(e=>e.overrideKey)}function Qd(e,t){return e.filter(e=>{let n=ye(t,e.path);return n!=null&&n!==``}).map(e=>e.overrideKey)}function $d(e,t){let n=new Set(t.map(e=>e.overrideKey));return new Set([...e].filter(e=>n.has(e)))}function ef(e,t,n){let r=St(),i=bt(),[a,o]=(0,z.useState)({}),s=(0,z.useMemo)(()=>Xd(n,r),[n,r]),c=(0,z.useRef)(new Set),l=(0,z.useRef)(new Set),u=(0,z.useRef)(r),d=(0,z.useRef)(s),f=(0,z.useRef)(s);f.current=s,Wd(()=>{let e=new Set(s.map(e=>e.overrideKey));l.current=new Set([...l.current].filter(t=>e.has(t)));let t=s.filter(e=>!l.current.has(e.overrideKey));for(let e of Qd(t,r))c.current.add(e);for(let e of t)l.current.add(e.overrideKey)},[s,r]);let p=(0,z.useCallback)(e=>{c.current.add(e)},[]),m=(0,z.useMemo)(()=>{let e=new Set,t=!1;return qe(n,n=>{if(Array.isArray(n.dependsOnKeys))for(let t of n.dependsOnKeys)e.add(String(t));n.dependsOnAny&&(t=!0)}),{keys:[...e],any:t}},[n]),h=(0,z.useMemo)(()=>{let e=new Set(m.keys);for(let t of s){for(let n of t.resetOn)e.add(n);for(let n of t.refreshOn)e.add(n)}return[...e]},[m.keys,s]),g=m.any?r:JSON.stringify(h.map(e=>ye(r,e)));return(0,z.useEffect)(()=>{if(h.length===0&&!m.any)return;let n=u.current;u.current=r;for(let e of Zd({targets:d.current,values:n},{targets:f.current,values:r}))c.current.delete(e);d.current=f.current,c.current=$d(c.current,f.current);let a=new AbortController,s=window.setTimeout(()=>{Gd(e,t,{_sub:`resolve`,...r},a.signal).then(e=>{if(!e)return;for(let[t,n]of Object.entries(e.values??{}))i(t,n);let t=new Map(f.current.map(e=>[e.path,e]));for(let[n,r]of Object.entries(e.prefill??{})){let e=t.get(n);e&&!c.current.has(e.overrideKey)&&i(n,r)}e.fields&&o(e.fields)}).catch(()=>{})},250);return()=>{window.clearTimeout(s),a.abort()}},[g,e,t,m.any,i]),{nodes:a,markUserEdit:p}}function tf(e){let t={labels:{},values:{}};return qe(e,e=>{e.name&&(e.label&&(t.labels[e.name]=e.label),e.value!==void 0&&(t.values[e.name]=e.value))}),t}function nf(e,t){return e===t||e.startsWith(`${t}.`)}function rf(e){let t={};for(let[n,r]of Object.entries(e??{}))t[n]=Array.isArray(r)?r[0]:r;return t}function af(e,t){let n=(0,z.useRef)(e);n.current=e;let r=(0,z.useRef)(null),i=(0,z.useCallback)(()=>{r.current!==null&&(clearTimeout(r.current),r.current=null)},[]);return(0,z.useEffect)(()=>i,[i]),(0,z.useMemo)(()=>{let e=(...e)=>{i(),r.current=setTimeout(()=>{r.current=null,n.current(...e)},t)};return e.cancel=i,e},[i,t])}function of({componentRef:e,endpoint:t,extraData:n,method:r,onBefore:i,onError:a,onSuccess:o,precognitive:s,validationDebounceMs:c=250}){let l=St(),u=(0,z.useRef)(l);u.current=l;let d=(0,z.useRef)(n);d.current=n;let f=lu(),[p,m]=(0,z.useState)({}),[h,g]=(0,z.useState)(!1),[_,v]=(0,z.useState)(!1),y=(0,z.useCallback)(n=>Wu(t,{body:JSON.stringify({...u.current,...d.current}),method:r,ref:e,headers:n,throwOnError:!1}),[e,t,r]),b=(0,z.useCallback)(e=>{m(t=>t[e]===void 0?t:{...t,[e]:void 0})},[]),x=af(e=>{y({Precognition:`true`,"Precognition-Validate-Only":e}).then(async t=>{if(t.status===422){let e=await t.json();m(t=>({...t,...rf(e.errors)}));return}b(e)}).catch(()=>{})},c),S=(0,z.useCallback)(e=>{s&&x(e)},[s,x]),C=(0,z.useCallback)(()=>{},[]),w=(0,z.useCallback)((e,t)=>{v(!0),y({Precognition:`true`,"Precognition-Validate-Only":e.join(`,`)}).then(async n=>{if(n.status===422){let e=await n.json();m(t=>({...t,...rf(e.errors)})),t?.onValidationError?.();return}if(!n.ok){t?.onValidationError?.();return}let r=e.filter(e=>!e.includes(`*`));m(e=>Object.fromEntries(Object.entries(e).filter(([e])=>!r.some(t=>nf(e,t))))),t?.onSuccess?.()}).catch(()=>t?.onValidationError?.()).finally(()=>v(!1))},[y]);return{clearErrors:b,errors:p,processing:h,submit:(0,z.useCallback)(()=>{g(!0),i?.(),y().then(async e=>{let t=await e.json().catch(()=>({}));if(f(su(t.effects)),e.status===422&&t.errors){m(rf(t.errors)),a?.();return}if(!e.ok){a?.();return}m({}),o(t)}).catch(e=>{ou(e),a?.()}).finally(()=>g(!1))},[f,i,a,o,y]),touch:C,validate:S,validateFields:w,validating:_}}function sf(e,t,n,r){let[i,a]=(0,z.useState)(null);return(0,z.useEffect)(()=>{if(!n){a(null);return}let i=new AbortController;return Wu(e,{body:JSON.stringify({_sub:`schema`,...r}),ref:t,method:`POST`,signal:i.signal,throwOnError:!1}).then(e=>e.ok?e.json():null).then(e=>a(e)).catch(()=>{}),()=>i.abort()},[n,e,t]),i}function cf(){return(0,K.jsxs)(`div`,{className:`space-y-4`,"data-lattice-action-form-loading":!0,children:[(0,K.jsx)(Bd,{className:`h-4 w-24`}),(0,K.jsx)(Bd,{className:`h-10 w-full`}),(0,K.jsx)(Bd,{className:`h-10 w-full`})]})}function lf({cancelLabel:e,componentRef:t,endpoint:n,extraData:r,fieldLabels:i,formNode:a,method:o,onBefore:s,onClose:c,onError:l,onSuccess:u,precognitive:d,submitLabel:f}){let{nodes:p,markUserEdit:m}=ef(n,t,a.schema),{clearErrors:h,errors:g,processing:_,submit:v,touch:y,validate:b,validateFields:x,validating:S}=of({componentRef:t,endpoint:n,extraData:r,method:o,onBefore:s,onError:l,onSuccess:u,precognitive:d}),C=(0,z.useMemo)(()=>({action:n,clearErrors:h,componentRef:t,errors:g,fieldLabels:i,precognitive:d,processing:_,touch:y,validate:b,validateFields:x,validating:S}),[h,t,n,g,i,d,_,y,b,x,S]);return(0,K.jsx)(R,{value:C,children:(0,K.jsxs)(`form`,{className:`flex flex-col gap-6`,onSubmit:e=>{e.preventDefault(),v()},children:[(0,K.jsx)(je,{value:{markUserEdit:m},children:(0,K.jsx)(Hd,{nodes:p,children:(0,K.jsx)($e,{nodes:a.schema??[]})})}),(0,K.jsxs)(`div`,{className:`flex justify-end gap-3`,children:[(0,K.jsx)(q,{"data-test":`action-form-cancel`,disabled:_,onClick:c,type:`button`,emphasis:`ghost`,children:e}),a.props?.submitButton!==!1&&(0,K.jsxs)(q,{"data-test":`action-form-submit`,disabled:_,type:`submit`,children:[_&&(0,K.jsx)(Xl,{}),f]})]})]})})}function uf({formNode:e,...t}){let n=!!e.props?.precognitive,{labels:r,values:i}=(0,z.useMemo)(()=>{let{labels:t,values:n}=tf(e.schema);return{labels:t,values:{...n,...e.props?.state}}},[e]);return(0,K.jsx)(ge,{initial:i,children:(0,K.jsx)(lf,{fieldLabels:r,formNode:e,precognitive:n,...t})})}function df({description:e,formNode:t,onClose:n,onExited:r,open:i,placement:a,title:o,width:s,...c}){let{t:l}=N(`lattice`);return(0,K.jsx)(Ad,{open:i,onOpenChange:e=>{e||n()},children:(0,K.jsxs)(Pd,{...e?{}:{"aria-describedby":void 0},onCloseAutoFocus:r,placement:a,width:s,children:[(0,K.jsx)(Fd,{closeLabel:l(`common.close`,`Close`),description:e,title:o}),(0,K.jsx)(`div`,{className:`mt-6`,children:t?(0,K.jsx)(uf,{formNode:t,onClose:n,...c}):(0,K.jsx)(cf,{})})]})})}function ff({node:e,extraData:t,onBefore:n,onError:r,onSuccess:i}){let a=fu();if(!a)throw Error(uu);let o=e.props.endpoint??``,s=e.props.ref??``,c=e.props.method??`post`,l=e.props.lazyForm===!0,u=sf(o,s,l,t),d=l?u:e.props.form,f=Rd(e);return(0,K.jsx)(df,{open:a.open,onExited:a.onExited,cancelLabel:f.cancelLabel,componentRef:s,description:f.description,endpoint:o,extraData:t,formNode:d,method:c,onBefore:n,onClose:()=>a.onOpenChange(!1),onError:r,onSuccess:()=>{a.onOpenChange(!1),i?.()},placement:e.props.modalSide??`center`,submitLabel:f.confirmLabel,title:f.title,width:e.props.modalWidth??void 0})}function pf(e,t){let n=e.props.endpoint??``,r=e.props.ref??``,i=e.props.method??`post`,a=e.props.confirmation,o=e.props.form,s=e.props.lazyForm===!0,c=!!o||s,[l,u]=(0,z.useState)(!1),d=lu(),f=mu(),p=async()=>{if(!n)return;let e=t?.extraData?.();if(i===`get`){G.visit(n,{headers:Nu(r)});return}t?.onBefore?.(),u(!0);let a=await Qu(()=>Wu(n,{method:i,ref:r,body:e?JSON.stringify(e):void 0,throwOnError:!1}),d);u(!1),a?t?.onSuccess?.():t?.onError?.()};return{processing:l,requestSubmit:()=>{if(c){if(!f)throw Error(uu);f.open((0,K.jsx)(ff,{node:e,extraData:t?.extraData?.(),onBefore:t?.onBefore,onError:t?.onError,onSuccess:t?.onSuccess}));return}if(a){if(!f)throw Error(uu);f.open((0,K.jsx)(zd,{node:e,extraData:t?.extraData?.(),onBefore:t?.onBefore,onError:t?.onError,onSuccess:t?.onSuccess}));return}p()}}}var mf=({node:e})=>{let t=e.props.endpoint??``,n=e.props.icon,r=Ld(e),i=iu(),{variant:a,emphasis:o}=e.props,{processing:s,requestSubmit:c}=pf(e,Cu(e)),l=e.key??$l(`action`,e.id);return(0,K.jsxs)(q,{className:i?nu:void 0,"data-test":l,disabled:s||!t,onClick:c,type:`button`,emphasis:i?`ghost`:o,variant:i?null:a,children:[s?(0,K.jsx)(Xl,{className:i?`size-lt-icon-sm`:void 0}):n&&(0,K.jsx)(nl,{className:i?`size-lt-icon-sm`:`size-lt-icon-md`,icon:n}),r]})};function hf({children:e,className:t,"data-test":n,label:r,sideOffset:i=8}){return(0,K.jsx)(`div`,{className:t??`inline-flex`,children:(0,K.jsxs)(Ot,{children:[(0,K.jsx)(Xe,{asChild:!0,children:(0,K.jsx)(q,{"aria-label":r,className:`size-lt-control-sm text-lt-muted-fg shadow-none hover:text-lt-fg`,"data-test":n,size:`icon`,type:`button`,emphasis:`ghost`,children:(0,K.jsx)(y,{"aria-hidden":`true`,className:`size-lt-icon-md`,name:`more-horizontal`})})}),(0,K.jsx)(ht,{align:`end`,"aria-label":r,className:`min-w-44 gap-0.5 p-1.5`,sideOffset:i,children:(0,K.jsx)(ru,{children:e})})]})})}var gf={components:{action:B(mf),"action.group":B(({children:e,node:t})=>{let{t:n}=N(`lattice`),r=t.props.label??n(`common.action-group.label`,`Actions`),i=t.props.orientation;return i?(0,K.jsx)(`div`,{"aria-label":r,className:x(`inline-flex max-w-full gap-1`,i===`vertical`?`flex-col items-stretch`:`flex-row flex-wrap items-center`),"data-test":X(t),role:`group`,children:e}):(0,K.jsx)(hf,{"data-test":X(t),label:r,children:e})})},name:`lattice/action`},_f=Object.defineProperty,vf=(e,t)=>_f(e,`name`,{value:t,configurable:!0}),yf=`Checkbox`,[bf,xf]=Ye(yf),[Sf,Cf]=bf(yf);function wf(e){let{__scopeCheckbox:t,checked:n,children:r,defaultChecked:i,disabled:a,form:o,name:s,onCheckedChange:c,required:l,value:u=`on`,internal_do_not_use_render:d}=e,[f,p]=Dt({prop:n,defaultProp:i??!1,onChange:c,caller:yf}),[m,h]=z.useState(null),[g,_]=z.useState(null),v=z.useRef(!1),[y,b]=z.useReducer(e=>e+1,0),x=!m||!!o||!!m.closest(`form`),S={checked:f,disabled:a,setChecked:p,control:m,setControl:h,name:s,form:o,value:u,hasConsumerStoppedPropagationRef:v,userInteractionCount:y,onUserInteraction:b,required:l,defaultChecked:!Nf(i)&&i,isFormControl:x,bubbleInput:g,setBubbleInput:_};return(0,K.jsx)(Sf,{scope:t,...S,children:Mf(d)?d(S):r})}vf(wf,`CheckboxProvider`);var Tf=`CheckboxTrigger`,Ef=z.forwardRef(vf(function({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},i){let{control:a,value:o,disabled:s,checked:c,required:l,setControl:u,setChecked:d,hasConsumerStoppedPropagationRef:f,onUserInteraction:p,isFormControl:m,bubbleInput:h}=Cf(Tf,e),g=M(i,u),_=z.useRef(c);return z.useEffect(()=>{let e=a?.form;if(e){let t=vf(()=>d(_.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[a,d]),(0,K.jsx)(ct.button,{type:`button`,role:`checkbox`,"aria-checked":Nf(c)?`mixed`:c,"aria-required":l,"data-state":Pf(c),"data-disabled":s?``:void 0,disabled:s,value:o,...r,ref:g,onKeyDown:Wt(t,e=>{e.key===`Enter`&&e.preventDefault()}),onClick:Wt(n,e=>{p(),d(e=>Nf(e)?!0:!e),h&&m&&(f.current=e.isPropagationStopped(),f.current||e.stopPropagation())})})},`CheckboxTrigger`)),Df=z.forwardRef(vf(function(e,t){let{__scopeCheckbox:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,K.jsx)(wf,{__scopeCheckbox:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(Ef,{...d,ref:t,__scopeCheckbox:n}),e&&(0,K.jsx)(jf,{__scopeCheckbox:n})]})})},`Checkbox`)),Of=`CheckboxIndicator`,kf=z.forwardRef(vf(function(e,t){let{__scopeCheckbox:n,forceMount:r,...i}=e,a=Cf(Of,n);return(0,K.jsx)(_t,{present:r||Nf(a.checked)||a.checked===!0,children:(0,K.jsx)(ct.span,{"data-state":Pf(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:t,style:{pointerEvents:`none`,...e.style}})})},`CheckboxIndicator`)),Af=`CheckboxBubbleInput`,jf=z.forwardRef(vf(function({__scopeCheckbox:e,onClick:t,...n},r){let{control:i,hasConsumerStoppedPropagationRef:a,userInteractionCount:o,checked:s,defaultChecked:c,required:l,disabled:u,name:d,value:f,form:p,bubbleInput:m,setBubbleInput:h}=Cf(Af,e),g=M(r,h),_=he(i),v=z.useRef(!1),y=z.useRef(s),b=z.useRef(o);z.useEffect(()=>{let e=m;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=o!==b.current;b.current=o;let i=y.current!==s;y.current=s;let c=!(r&&a.current);if(i&&n){v.current=!r;let t=new Event(`click`,{bubbles:c});e.indeterminate=Nf(s),n.call(e,!Nf(s)&&s),e.dispatchEvent(t),v.current=!1}},[m,s,a,o]);let x=z.useRef(!Nf(s)&&s);return(0,K.jsx)(ct.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:c??x.current,required:l,disabled:u,name:d,value:f,form:p,...n,tabIndex:-1,ref:g,onClick:Wt(t,e=>{v.current&&e.stopPropagation()}),style:{...n.style,..._,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`CheckboxBubbleInput`));function Mf(e){return typeof e==`function`}vf(Mf,`isFunction`);function Nf(e){return e===`indeterminate`}vf(Nf,`isIndeterminate`);function Pf(e){return Nf(e)?`indeterminate`:e?`checked`:`unchecked`}vf(Pf,`getState`);function Ff({className:e,...t}){return(0,K.jsx)(Df,{"data-slot":`checkbox`,className:x(`peer border-lt-input data-[state=checked]:bg-lt-primary data-[state=checked]:text-lt-primary-fg data-[state=checked]:border-lt-primary focus-visible:border-lt-ring focus-visible:ring-lt-ring/50 aria-invalid:ring-lt-danger/20 dark:aria-invalid:ring-lt-danger/40 aria-invalid:border-lt-danger size-4 shrink-0 rounded-lt-xs border shadow-lt-xs transition-shadow outline-none focus-visible:ring-[length:var(--lt-ring-width)] aria-readonly:cursor-default aria-readonly:data-[state=unchecked]:bg-lt-muted disabled:cursor-not-allowed disabled:bg-lt-disabled disabled:text-lt-disabled-fg disabled:data-[state=checked]:bg-lt-disabled disabled:data-[state=checked]:text-lt-disabled-fg disabled:data-[state=checked]:border-lt-disabled`,e),...t,children:(0,K.jsx)(kf,{"data-slot":`checkbox-indicator`,className:`flex items-center justify-center text-current transition-none`,children:(0,K.jsx)(y,{name:`check`,className:`size-lt-icon-sm`})})})}var If=b(x(`relative inline-flex shrink-0 items-center justify-center rounded-lt-sm transition-colors`,`outline-none focus-visible:ring-[length:var(--lt-ring-width)] focus-visible:ring-lt-ring/50`,`disabled:pointer-events-none disabled:bg-lt-disabled disabled:text-lt-disabled-fg`),{variants:{emphasis:{ghost:x(`text-lt-muted-fg hover:bg-lt-accent hover:text-lt-accent-fg`,`data-[state=open]:bg-lt-accent data-[state=open]:text-lt-accent-fg`,`aria-pressed:bg-lt-accent aria-pressed:text-lt-accent-fg`),segmented:x(`-ml-px rounded-l-none border border-lt-input text-lt-muted-fg hover:bg-lt-accent hover:text-lt-accent-fg`,`data-[state=open]:z-10 data-[state=open]:border-lt-primary data-[state=open]:text-lt-fg`)},size:{xs:`size-5 [&_svg]:size-lt-icon-sm`,sm:`size-7 [&_svg]:size-lt-icon-md`,md:`size-lt-control-md [&_svg]:size-lt-icon-md`}},defaultVariants:{emphasis:`ghost`,size:`sm`}});function Lf({icon:e,label:t,active:n,size:r,emphasis:i,className:a,children:o,ref:s,...c}){return(0,K.jsxs)(`button`,{ref:s,type:`button`,"aria-label":t,"aria-pressed":n,className:x(If({emphasis:i,size:r}),a),...c,children:[e?(0,K.jsx)(y,{name:e,"aria-hidden":`true`}):null,o]})}function Rf({disabled:e=!1,hiddenInputs:t,image:n=!1,inputProps:r,inputRef:i,items:a,onFilesAdded:o,onRemove:s,resetOnSelect:c=!1,testId:l}){let{t:u}=N(`lattice`);return(0,K.jsxs)(`div`,{className:`flex flex-col gap-3 rounded-lt-sm border border-dashed border-lt-border bg-lt-surface px-4 py-6`,"data-test":l,onDragOver:e=>e.preventDefault(),onDrop:e=>{e.preventDefault(),o(e.dataTransfer.files)},children:[(0,K.jsx)(`button`,{className:`text-sm text-lt-muted-fg`,disabled:e,onClick:()=>i.current?.click(),type:`button`,children:u(`form.file-upload.dropzone`,`Drop files here or click to browse`)}),(0,K.jsx)(`ul`,{className:n?`grid grid-cols-1 gap-3 sm:grid-cols-2`:`flex flex-col gap-2`,children:a.map(t=>(0,K.jsxs)(`li`,{className:n?`flex min-w-0 items-center gap-3 rounded-lt-sm border border-lt-border bg-lt-bg p-2 text-sm`:`flex items-center justify-between gap-3 text-sm`,children:[n&&t.url?(0,K.jsx)(`img`,{alt:t.name,className:`size-16 shrink-0 rounded-lt-sm border border-lt-border object-cover`,"data-test":t.previewTestId,src:t.url}):null,(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsx)(`span`,{className:`block truncate`,"data-test":t.itemTestId,children:t.name}),t.status===`uploading`&&(0,K.jsxs)(`span`,{className:`text-xs text-lt-muted-fg`,children:[t.progress,`%`]}),t.status===`error`&&(0,K.jsx)(`span`,{className:`text-xs text-lt-danger`,children:u(`form.file-upload.failed`,`Failed`)})]}),t.removable&&(0,K.jsx)(Lf,{size:`sm`,icon:`x`,label:u(`form.file-upload.remove`,`Remove {{name}}`,{name:t.name}),"data-test":t.removeTestId,disabled:e,onClick:()=>s(t.id)})]},t.id))}),t,(0,K.jsx)(`input`,{...r,className:`sr-only`,onChange:e=>{o(e.target.files),c&&(e.target.value=``)},ref:i,type:`file`})]})}function zf(){return(zf=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Bf(e,t){if(e==null)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)t.indexOf(n=a[r])>=0||(i[n]=e[n]);return i}function Vf(e){var t=(0,z.useRef)(e),n=(0,z.useRef)(function(e){t.current&&t.current(e)});return t.current=e,n.current}var Hf=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e<t?t:e},Uf=function(e){return`touches`in e},Wf=function(e){return e&&e.ownerDocument.defaultView||self},Gf=function(e,t,n){var r=e.getBoundingClientRect(),i=Uf(t)?function(e,t){for(var n=0;n<e.length;n++)if(e[n].identifier===t)return e[n];return e[0]}(t.touches,n):t;return{left:Hf((i.pageX-(r.left+Wf(e).pageXOffset))/r.width),top:Hf((i.pageY-(r.top+Wf(e).pageYOffset))/r.height)}},Kf=function(e){!Uf(e)&&e.preventDefault()},qf=z.memo(function(e){var t=e.onMove,n=e.onKey,r=e.onEnd,i=Bf(e,[`onMove`,`onKey`,`onEnd`]),a=(0,z.useRef)(null),o=Vf(t),s=Vf(n),c=Vf(r),l=(0,z.useRef)(null),u=(0,z.useRef)(!1),d=(0,z.useMemo)(function(){var e=function(e){Kf(e),(Uf(e)?e.touches.length>0:e.buttons>0)&&a.current?o(Gf(a.current,e,l.current)):(n(!1),c())},t=function(){n(!1),c()};function n(n){var r=u.current,i=Wf(a.current),o=n?i.addEventListener:i.removeEventListener;o(r?`touchmove`:`mousemove`,e),o(r?`touchend`:`mouseup`,t)}return[function(e){var t=e.nativeEvent,r=a.current;if(r&&(Kf(t),!function(e,t){return t&&!Uf(e)}(t,u.current)&&r)){if(Uf(t)){u.current=!0;var i=t.changedTouches||[];i.length&&(l.current=i[0].identifier)}r.focus(),o(Gf(r,t,l.current)),n(!0)}},function(e){var t=e.which||e.keyCode;t<37||t>40||(e.preventDefault(),s({left:t===39?.05:t===37?-.05:0,top:t===40?.05:t===38?-.05:0}))},function(e){var t=e.which||e.keyCode;t>=37&&t<=40&&c()},n]},[s,o,c]),f=d[0],p=d[1],m=d[2],h=d[3];return(0,z.useEffect)(function(){return h},[h]),z.createElement(`div`,zf({},i,{onTouchStart:f,onMouseDown:f,className:`react-colorful__interactive`,ref:a,onKeyDown:p,onKeyUp:m,tabIndex:0,role:`slider`}))}),Jf=function(e){return e.filter(Boolean).join(` `)},Yf=function(e){var t=e.color,n=e.left,r=e.top,i=r===void 0?.5:r,a=Jf([`react-colorful__pointer`,e.className]);return z.createElement(`div`,{className:a,style:{top:100*i+`%`,left:100*n+`%`}},z.createElement(`div`,{className:`react-colorful__pointer-fill`,style:{backgroundColor:t}}))},Xf=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=10**t),Math.round(n*e)/n};360/(2*Math.PI);var Zf=function(e){return ap(Qf(e))},Qf=function(e){return e[0]===`#`&&(e=e.substring(1)),e.length<6?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:e.length===4?Xf(parseInt(e[3]+e[3],16)/255,2):1}:{r:parseInt(e.substring(0,2),16),g:parseInt(e.substring(2,4),16),b:parseInt(e.substring(4,6),16),a:e.length===8?Xf(parseInt(e.substring(6,8),16)/255,2):1}},$f=function(e){return ip(np(e))},ep=function(e){var t=e.s,n=e.v,r=e.a,i=(200-t)*n/100;return{h:Xf(e.h),s:Xf(i>0&&i<200?t*n/100/(i<=100?i:200-i)*100:0),l:Xf(i/2),a:Xf(r,2)}},tp=function(e){var t=ep(e);return`hsl(`+t.h+`, `+t.s+`%, `+t.l+`%)`},np=function(e){var t=e.h,n=e.s,r=e.v,i=e.a;t=t/360*6,n/=100,r/=100;var a=Math.floor(t),o=r*(1-n),s=r*(1-(t-a)*n),c=r*(1-(1-t+a)*n),l=a%6;return{r:Xf(255*[r,s,o,o,c,r][l]),g:Xf(255*[c,r,r,s,o,o][l]),b:Xf(255*[o,o,c,r,r,s][l]),a:Xf(i,2)}},rp=function(e){var t=e.toString(16);return t.length<2?`0`+t:t},ip=function(e){var t=e.r,n=e.g,r=e.b,i=e.a,a=i<1?rp(Xf(255*i)):``;return`#`+rp(t)+rp(n)+rp(r)+a},ap=function(e){var t=e.r,n=e.g,r=e.b,i=e.a,a=Math.max(t,n,r),o=a-Math.min(t,n,r),s=o?a===t?(n-r)/o:a===n?2+(r-t)/o:4+(t-n)/o:0;return{h:Xf(60*(s<0?s+6:s)),s:Xf(a?o/a*100:0),v:Xf(a/255*100),a:i}},op=z.memo(function(e){var t=e.hue,n=e.onChange,r=e.onChangeEnd,i=Jf([`react-colorful__hue`,e.className]);return z.createElement(`div`,{className:i},z.createElement(qf,{onMove:function(e){n({h:360*e.left})},onKey:function(e){n({h:Hf(t+360*e.left,0,360)})},onEnd:r,"aria-label":`Hue`,"aria-valuenow":Xf(t),"aria-valuemax":`360`,"aria-valuemin":`0`},z.createElement(Yf,{className:`react-colorful__hue-pointer`,left:t/360,color:tp({h:t,s:100,v:100,a:1})})))}),sp=z.memo(function(e){var t=e.hsva,n=e.onChange,r=e.onChangeEnd,i={backgroundColor:tp({h:t.h,s:100,v:100,a:1})};return z.createElement(`div`,{className:`react-colorful__saturation`,style:i},z.createElement(qf,{onMove:function(e){n({s:100*e.left,v:100-100*e.top})},onKey:function(e){n({s:Hf(t.s+100*e.left,0,100),v:Hf(t.v-100*e.top,0,100)})},onEnd:r,"aria-label":`Color`,"aria-valuetext":`Saturation `+Xf(t.s)+`%, Brightness `+Xf(t.v)+`%`},z.createElement(Yf,{className:`react-colorful__saturation-pointer`,top:1-t.v/100,left:t.s/100,color:tp(t)})))}),cp=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0},lp=function(e,t){return e.toLowerCase()===t.toLowerCase()||cp(Qf(e),Qf(t))};function up(e,t,n,r){var i=Vf(n),a=Vf(r),o=(0,z.useState)(function(){return e.toHsva(t)}),s=o[0],c=o[1],l=(0,z.useRef)({color:t,hsva:s}),u=(0,z.useRef)(!1);return(0,z.useEffect)(function(){if(!e.equal(t,l.current.color)){var n=e.toHsva(t);l.current={hsva:n,color:t},c(n),u.current=!1}},[t,e]),(0,z.useEffect)(function(){var t;cp(s,l.current.hsva)||e.equal(t=e.fromHsva(s),l.current.color)||(l.current={hsva:s,color:t},i(t),u.current=!0)},[s,e,i]),[s,(0,z.useCallback)(function(e){c(function(t){return Object.assign({},t,e)})},[]),(0,z.useCallback)(function(){u.current&&(u.current=!1,a(l.current.color))},[a])]}var dp,fp=typeof window<`u`?z.useLayoutEffect:z.useEffect,pp=function(){return dp||(typeof __webpack_nonce__<`u`?__webpack_nonce__:void 0)},mp=new WeakMap,hp=function(e){fp(function(){var t=e.current;if(typeof document<`u`&&t){var n=t.getRootNode?t.getRootNode():t.ownerDocument,r=n&&(`head`in n||`host`in n)?n:t.ownerDocument;if(!mp.has(r)){var i=`head`in r?r.head:r,a=(i.ownerDocument||document).createElement(`style`);a.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><path d="M8 0h8v8H8zM0 8h8v8H0z"/></svg>')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`;var o=pp();o&&a.setAttribute(`nonce`,o),mp.set(r,a),i.appendChild(a)}}},[])},gp=function(e){var t=e.className,n=e.colorModel,r=e.color,i=r===void 0?n.defaultColor:r,a=e.onChange,o=e.onChangeEnd,s=Bf(e,[`className`,`colorModel`,`color`,`onChange`,`onChangeEnd`]),c=(0,z.useRef)(null);hp(c);var l=up(n,i,a,o),u=l[0],d=l[1],f=l[2],p=Jf([`react-colorful`,t]);return z.createElement(`div`,zf({},s,{ref:c,className:p}),z.createElement(sp,{hsva:u,onChange:d,onChangeEnd:f}),z.createElement(op,{hue:u.h,onChange:d,onChangeEnd:f,className:`react-colorful__last-control`}))},_p={defaultColor:`000`,toHsva:Zf,fromHsva:function(e){return $f({h:e.h,s:e.s,v:e.v,a:1})},equal:lp},vp=function(e){return z.createElement(gp,zf({},e,{colorModel:_p}))};function yp(e){let t=e.trim().replace(/^#/,``).toLowerCase();return/^[0-9a-f]{6}$/.test(t)?`#${t}`:/^[0-9a-f]{3}$/.test(t)?`#${t[0]}${t[0]}${t[1]}${t[1]}${t[2]}${t[2]}`:null}function bp({value:e,onChange:t,palette:n,hexLabel:r=`Hex color`,paletteLabel:i=`Color palette`}){let[a,o]=(0,z.useState)(null),s=yp(e)??`#6b7280`;return(0,K.jsxs)(`div`,{className:`flex w-56 flex-col gap-3`,"data-slot":`color-picker`,children:[(0,K.jsx)(vp,{className:`!w-full`,color:s,onChange:t}),n.length>0&&(0,K.jsx)(`div`,{"aria-label":i,className:`flex flex-wrap gap-1.5`,role:`listbox`,children:n.map(e=>{let n=yp(e)??e;return(0,K.jsx)(`button`,{"aria-label":n,"aria-selected":n===s,className:x(`size-6 shrink-0 rounded-full border border-lt-border`,n===s&&`ring-2 ring-lt-ring ring-offset-1`),onClick:()=>t(n),role:`option`,style:{background:e},type:`button`},e)})}),(0,K.jsx)(rn,{"aria-label":r,onBlur:()=>o(null),onChange:e=>{let n=e.target.value,r=yp(n);o(n),r!==null&&t(r)},value:a??s})]})}function xp({addLabel:e,options:t,onSelect:n,icon:r,testId:i=`builder-add`}){return(0,K.jsxs)(Ot,{children:[(0,K.jsx)(Xe,{asChild:!0,children:r?(0,K.jsx)(`button`,{type:`button`,"aria-label":e,title:e,"data-test":i,className:`text-lt-muted-fg hover:text-lt-fg [&_svg]:size-lt-icon-sm`,children:(0,K.jsx)(y,{name:r})}):(0,K.jsxs)(`button`,{type:`button`,"data-test":i,className:`inline-flex items-center gap-1.5 self-start rounded-lt-sm border border-lt-border px-3 py-1.5 text-sm hover:bg-lt-accent [&_svg]:size-lt-icon-sm`,children:[(0,K.jsx)(y,{name:`plus`}),e]})}),(0,K.jsx)(ht,{align:`start`,className:`min-w-[12rem]`,children:t.map(e=>(0,K.jsx)(ft,{"data-test":`${i}-${e.type}`,onClick:()=>n(e.type),children:e.label},e.type))})]})}var Sp={duplicate:{key:`table.row-actions.duplicate`,fallback:`Duplicate`,icon:`copy`},remove:{key:`table.row-actions.remove`,fallback:`Remove`,icon:`trash-2`}};function Cp(e,t){return(e??wp(t.removable)).map(e=>Tp(e,t)).filter(e=>e!==null)}function wp(e){return e?[{type:`remove`,key:`remove`,label:null,icon:null,danger:!0}]:[]}function Tp(e,t){if(e.type===`duplicate`){let n=Sp.duplicate;return{key:e.key,label:e.label??t.t(n.key,n.fallback),icon:e.icon??n.icon,danger:e.danger,onClick:()=>t.onDuplicate(t.index)}}if(e.type===`remove`){if(!t.removable)return null;let n=Sp.remove;return{key:e.key,label:e.label??t.t(n.key,n.fallback),icon:e.icon??n.icon,danger:e.danger,onClick:()=>t.onRemove(t.index)}}return null}function Ep(e){return e?`text-lt-danger hover:text-lt-danger [&_svg]:size-lt-icon-sm`:`text-lt-muted-fg hover:text-lt-fg [&_svg]:size-lt-icon-sm`}function Dp({actions:e}){let{t}=N(`lattice`);if(e.length===0)return null;if(e.length===1){let t=e[0];return(0,K.jsx)(`button`,{type:`button`,"aria-label":t.label,"data-test":`row-action-${t.key}`,className:Ep(t.danger),onClick:t.onClick,children:(0,K.jsx)(y,{name:t.icon})})}return(0,K.jsxs)(Ot,{children:[(0,K.jsx)(Xe,{asChild:!0,children:(0,K.jsx)(`button`,{type:`button`,"aria-label":t(`common.action-group.label`,`Actions`),"data-test":`row-actions-menu`,className:`text-lt-muted-fg hover:text-lt-fg [&_svg]:size-lt-icon-sm`,children:(0,K.jsx)(y,{name:`more-horizontal`})})}),(0,K.jsx)(ht,{align:`end`,className:`min-w-[10rem]`,children:e.map(e=>(0,K.jsx)(ft,{"data-test":`row-action-${e.key}`,danger:e.danger,icon:e.icon,onClick:e.onClick,children:e.label},e.key))})]})}function Op({path:e,rows:t,rowKey:n}){return(0,K.jsx)(K.Fragment,{children:t.map((t,r)=>(0,K.jsx)(`input`,{type:`hidden`,name:It(Ve(e,r,n)),value:String(t[n]??``)},String(t.rowId??r)))})}function kp({label:e,testId:t,onClick:n,children:r}){return(0,K.jsx)(`button`,{type:`button`,"aria-label":e,"data-test":t,className:`text-lt-muted-fg hover:text-lt-fg`,onClick:n,children:r})}var Ap=(0,z.memo)(function({base:e,index:t,row:n,template:r,heading:i,reorderable:a,isFirst:o,isLast:s,removable:c,rowActions:l,onField:u,onRemove:d,onMove:f,onDuplicate:p}){let{t:m}=N(`lattice`);return(0,K.jsxs)(`div`,{"data-test":`repeater-${e}-row-${t}`,className:`rounded-lt border border-lt-border bg-lt-surface p-4`,children:[(0,K.jsxs)(`div`,{className:`mb-2 flex items-center justify-between`,children:[(0,K.jsx)(`span`,{className:`text-sm font-medium text-lt-muted-fg`,children:i}),(0,K.jsxs)(`div`,{className:`flex items-center gap-1 [&_svg]:size-lt-icon-sm`,children:[a&&!o&&(0,K.jsx)(kp,{label:`Move up`,testId:`repeater-${e}-up-${t}`,onClick:()=>f(t,-1),children:(0,K.jsx)(y,{name:`arrow-up`})}),a&&!s&&(0,K.jsx)(kp,{label:`Move down`,testId:`repeater-${e}-down-${t}`,onClick:()=>f(t,1),children:(0,K.jsx)(y,{name:`arrow-down`})}),(0,K.jsx)(Dp,{actions:Cp(l,{index:t,removable:c,onRemove:d,onDuplicate:p,t:m})})]})]}),(0,K.jsx)(Ee,{base:e,index:t,row:n,onChange:(e,n)=>u(t,e,n),children:(0,K.jsx)(`div`,{className:`flex flex-col gap-4`,children:r.map((e,t)=>(0,K.jsx)(Zt,{node:e},me(e,t)))})})]})}),jp={xs:{track:`minmax(4rem, 0.35fr)`,minPx:64,defaultPx:96},sm:{track:`minmax(6rem, 0.5fr)`,minPx:96,defaultPx:128},md:{track:`minmax(8rem, 1fr)`,minPx:128,defaultPx:176},lg:{track:`minmax(12rem, 1.5fr)`,minPx:192,defaultPx:240},xl:{track:`minmax(16rem, 2fr)`,minPx:256,defaultPx:320}},Mp=1024;function Np(e){return jp[e].track}function Pp(e){return jp[e.width].minPx}function Fp(e){return jp[e.width].defaultPx}function Ip(e,t){return Math.min(Mp,Math.max(Pp(e),t))}function Lp({columns:e,leadingTracks:t=[],trailingTracks:n=[],overrides:r={}}){return e.some(e=>e.pin!=null)?Rp({columns:e,leadingTracks:t,trailingTracks:n,overrides:r}):[...t,...e.map(e=>{let t=r[e.key];return t===void 0?Np(e.width):`${Ip(e,t)}px`}),...n].join(` `)}function Rp({columns:e,leadingTracks:t,trailingTracks:n,overrides:r}){let i=e.map(e=>`${Ip(e,r[e.key]??Fp(e))}px`),a=e.findIndex(e=>e.pin===`end`);return i.splice(a===-1?i.length:a,0,`minmax(0, 1fr)`),[...t,...i,...n].join(` `)}function zp({columns:e,leadingTracks:t=[],trailingTracks:n=[],overrides:r={},hasExpander:i=!1,hasSelection:a=!1,hasActions:o=!1}){if(!e.some(e=>e.pin!=null))return{};let s=e=>Ip(e,r[e.key]??Fp(e)),c=Bp(t),l=Bp(n),u={},d=0;e.forEach((e,t)=>{e.pin===`start`&&(u[`--lt-pin-offset-${t}`]=Hp(c,d),d+=s(e))});let f=0;for(let t=e.length-1;t>=0;--t){let n=e[t];n.pin===`end`&&(u[`--lt-pin-offset-${t}`]=Hp(l,f),f+=s(n))}return i&&(u[`--lt-pin-offset-expander`]=`0px`),a&&(u[`--lt-pin-offset-selection`]=i?Hp(Bp(t.slice(0,1)),0):`0px`),o&&(u[`--lt-pin-offset-actions`]=`0px`),u}function Bp(e){return e.reduce((e,t)=>e+Vp(t),0)}function Vp(e){let t=e.trim().match(/^([0-9.]+)rem$/);return t?Number.parseFloat(t[1]):0}function Hp(e,t){return e===0&&t===0?`0px`:e===0?`${t}px`:t===0?`${e}rem`:`calc(${e}rem + ${t}px)`}function Up(e,t,n={}){let{enabled:r=!0,parse:i,serialize:a}=n,o=()=>typeof t==`function`?t():t,[s,c]=(0,z.useState)(()=>{if(!r||typeof window>`u`)return o();let t;try{t=window.localStorage.getItem(e)}catch{return o()}if(t===null)return o();try{return i?i(t):JSON.parse(t)}catch{try{window.localStorage.removeItem(e)}catch{return o()}return o()}}),l=(0,z.useRef)(s);l.current=s;let u=(0,z.useRef)({enabled:r,key:e,serialize:a});return u.current={enabled:r,key:e,serialize:a},[s,(0,z.useCallback)(e=>{let t=typeof e==`function`?e(l.current):e;l.current=t,c(t);let{enabled:n,key:r,serialize:i}=u.current;if(!(!n||typeof window>`u`))try{let e=i?i(t):JSON.stringify(t);e===null?window.localStorage.removeItem(r):window.localStorage.setItem(r,e)}catch{return}},[])]}var Wp=[];function Gp({columnGapPx:e=0,columns:t,enabled:n,hasActions:r=!1,hasExpander:i=!1,hasSelection:a=!1,leadingTracks:o=Wp,showIndicator:s=!1,storageKey:c,trailingTracks:l=Wp}){let u=(0,z.useMemo)(()=>t.map(e=>e.key),[t]),[d,f]=Up(c??``,{},{enabled:!!c,parse:e=>qp(e,t),serialize:e=>Jp(e,u)}),p=(0,z.useRef)(d),m=(0,z.useRef)(null),h=(0,z.useRef)(null),g=(0,z.useCallback)(e=>Lp({columns:t,leadingTracks:o,trailingTracks:l,overrides:n?e:{}}),[t,n,o,l]),_=(0,z.useCallback)(e=>zp({columns:t,hasActions:r,hasExpander:i,hasSelection:a,leadingTracks:o,overrides:n?e:{},trailingTracks:l}),[t,n,r,i,a,o,l]),v=(0,z.useMemo)(()=>g(d),[d,g]),y=(0,z.useMemo)(()=>_(d),[d,_]),b=(0,z.useRef)([]),x=(0,z.useCallback)((e,t)=>{let n=h.current;if(n){n.style.gridTemplateColumns=e,n.style.setProperty(`--lattice-table-columns`,e);for(let e of b.current)e in t||n.style.removeProperty(e);for(let[e,r]of Object.entries(t))n.style.setProperty(e,r);b.current=Object.keys(t)}},[]),S=(0,z.useCallback)(e=>{x(g(e),_(e))},[x,_,g]),C=(0,z.useCallback)(e=>{p.current=e,f(e),S(e)},[S,f]),w=(0,z.useCallback)((e,t,n,r)=>({...e,[t.key]:Math.min(r??1024,Math.max(Pp(t),n))}),[]),T=(0,z.useCallback)((e,t,n)=>{C(w(p.current,e,t,n))},[C,w]),E=(0,z.useCallback)(e=>{let t={...p.current};delete t[e.key],C(t)},[C]),D=(0,z.useCallback)(()=>{C({})},[C]),O=n&&Object.values(d).some(e=>typeof e==`number`),ee=(0,z.useCallback)(e=>p.current[e.key]??Fp(e),[]);return{getResizeHandleProps:(0,z.useCallback)(r=>{let i=Mp,a=Pp(r),c=ee(r),u=r.label??r.key,d=s?`after:bg-lt-border`:`after:bg-transparent`,f=n=>Kp({column:r,columnGapPx:e,columns:t,grid:h.current??n.parentElement?.parentElement,leadingTracks:o,trailingTracks:l}),g=(e,t)=>T(r,c+t,f(e)),_=(e,t)=>{let n=m.current;n?.key===r.key&&(m.current=null,n.overrides!==null&&C(n.overrides),t&&e.currentTarget.releasePointerCapture?.(e.pointerId))};return{"aria-label":`Resize ${u}`,"aria-orientation":`vertical`,"aria-valuemax":i,"aria-valuemin":a,"aria-valuenow":c,className:`absolute inset-y-0 right-0 hidden w-2 cursor-col-resize touch-none items-stretch justify-center md:flex after:my-1 after:w-px ${d} hover:after:bg-lt-border focus-visible:outline-none focus-visible:after:bg-lt-ring`,onDoubleClick:()=>E(r),onKeyDown:e=>{if(!n)return;let t=e.shiftKey?32:8;if(e.key===`ArrowLeft`&&(e.preventDefault(),g(e.currentTarget,-t)),e.key===`ArrowRight`&&(e.preventDefault(),g(e.currentTarget,t)),e.key===`Home`&&(e.preventDefault(),T(r,a)),e.key===`End`){e.preventDefault();let t=f(e.currentTarget);T(r,t,t)}(e.key===`Enter`||e.key===`Escape`)&&(e.preventDefault(),E(r))},onPointerDown:e=>{if(!n)return;let t=e.currentTarget.parentElement?.getBoundingClientRect().width??0;m.current={key:r.key,maxWidth:f(e.currentTarget),overrides:null,startWidth:t>0?t:c,startX:e.clientX},e.currentTarget.setPointerCapture?.(e.pointerId),e.preventDefault()},onPointerMove:e=>{let t=m.current;if(!n||t?.key!==r.key)return;let i=w(p.current,r,t.startWidth+e.clientX-t.startX,t.maxWidth);t.overrides=i,p.current=i,S(i)},onPointerUp:e=>{_(e,!0)},onPointerCancel:e=>{_(e,!0)},onLostPointerCapture:e=>{_(e,!1)},role:`separator`,tabIndex:0}},[e,t,ee,n,o,S,C,w,E,T,s,l]),gridTemplateColumns:v,hasOverrides:O,pinOffsetVars:y,resizeRootRef:h,resetColumns:D,resetColumnWidth:E}}function Kp({column:e,columnGapPx:t,columns:n,grid:r,leadingTracks:i,trailingTracks:a}){let o=r?.getBoundingClientRect().width??0;if(o<=0)return Mp;let s=[...i,...a].reduce((e,t)=>e+Xp(t),0),c=n.reduce((t,n)=>n.key===e.key?t:t+Pp(n),0),l=n.length+i.length+a.length,u=Math.max(0,l-1)*t,d=o-s-c-u;return Math.min(Mp,Math.max(Pp(e),d))}function qp(e,t){let n=JSON.parse(e)?.overrides;if(typeof n!=`object`||!n||Array.isArray(n))throw Error(`unexpected stored column widths shape`);let r=Yp(n,t);if(Object.keys(r).length===0)throw Error(`stored column widths hold no usable overrides`);return r}function Jp(e,t){let n={},r=new Set(t);for(let[t,i]of Object.entries(e))r.has(t)&&typeof i==`number`&&Number.isFinite(i)&&(n[t]=i);return Object.keys(n).length===0?null:JSON.stringify({overrides:n})}function Yp(e,t){let n={};for(let r of t){let t=e[r.key];typeof t!=`number`||!Number.isFinite(t)||(n[r.key]=Math.min(Mp,Math.max(Pp(r),t)))}return n}function Xp(e){let t=e.trim(),n=t.match(/^([0-9.]+)px$/);if(n)return Number.parseFloat(n[1]);let r=t.match(/^([0-9.]+)rem$/);return r?Number.parseFloat(r[1])*Zp():0}function Zp(){if(typeof window>`u`)return 16;let e=Number.parseFloat(window.getComputedStyle(document.documentElement).fontSize);return Number.isFinite(e)&&e>0?e:16}function Qp(e,t){return typeof window>`u`||typeof window.matchMedia!=`function`?t:window.matchMedia(e).matches}function $p(e,t=!1){let[n,r]=(0,z.useState)(()=>Qp(e,t));return(0,z.useEffect)(()=>{if(typeof window>`u`||typeof window.matchMedia!=`function`)return;let t=window.matchMedia(e),n=()=>r(t.matches);return n(),t.addEventListener(`change`,n),()=>t.removeEventListener(`change`,n)},[e]),n}var em=`3rem`,tm=`3rem`,nm=[em],rm=[tm],im=`(min-width: 768px)`;function am(){return $p(im,!0)}function om(e){return e.map(e=>{let t=e.props;return{name:String(t.name),label:String(t.label??t.name),columnWidth:t.columnWidth??`md`}})}var sm=(0,z.memo)(function({base:e,index:t,row:n,template:r,span:i,isFirst:a,isLast:o,columnCount:s,flipKey:c,reorderable:l,removable:u,rowActions:d,onField:f,onMove:p,onRemove:m,onDuplicate:h,registerRow:g}){let{t:_}=N(`lattice`);return(0,K.jsxs)(`div`,{ref:e=>g?.(c,e),"data-flip-key":c,"data-test":`table-row-${e}-${t}`,className:`grid grid-cols-[var(--lattice-table-columns)] items-start gap-x-3`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-1 [&_svg]:size-lt-icon-sm`,children:[l&&!a&&(0,K.jsx)(kp,{label:`Move up`,testId:`table-${e}-up-${t}`,onClick:()=>p(t,-1),children:(0,K.jsx)(y,{name:`arrow-up`})}),l&&!o&&(0,K.jsx)(kp,{label:`Move down`,testId:`table-${e}-down-${t}`,onClick:()=>p(t,1),children:(0,K.jsx)(y,{name:`arrow-down`})})]}),(0,K.jsx)(Ee,{base:e,index:t,row:n,onChange:(e,n)=>f(t,e,n),children:(0,K.jsx)(qt,{children:i?(0,K.jsx)(`div`,{"data-test":`table-row-${e}-${t}-span`,className:`flex flex-col gap-2`,style:{gridColumn:`span ${s}`},children:r.map((e,t)=>(0,K.jsx)(Zt,{node:e},me(e,t)))}):r.map((e,t)=>(0,K.jsx)(`div`,{children:(0,K.jsx)(Zt,{node:e})},me(e,t)))})}),(0,K.jsx)(`div`,{className:`flex items-center`,children:(0,K.jsx)(Dp,{actions:Cp(d,{index:t,removable:u,onRemove:m,onDuplicate:h,t:_})})})]})});function cm({base:e,columns:t,rows:n,reorderable:r,removable:i,rowActions:a,onField:o,onMove:s,onRemove:c,onDuplicate:l,registerRow:u,resizableColumns:d=!1,resizeIndicator:f=!1}){let{t:p}=N(`lattice`),m=am(),h=(0,z.useMemo)(()=>t.map(e=>({key:e.name,label:e.label,width:e.columnWidth})),[t]),{getResizeHandleProps:g,gridTemplateColumns:_,hasOverrides:v,resizeRootRef:b,resetColumns:x}=Gp({columns:h,enabled:d,columnGapPx:12,leadingTracks:nm,showIndicator:f,storageKey:d?`lattice:table-columns:form:${e}`:void 0,trailingTracks:rm});return m?(0,K.jsxs)(`div`,{className:`relative`,children:[v&&(0,K.jsx)(`button`,{"aria-label":p(`table.reset-column-widths`,`Reset column widths`),className:`absolute right-1 top-1 z-10 hidden rounded-lt-sm p-1 text-lt-muted-fg hover:text-lt-fg md:inline-flex`,"data-test":`table-reset-columns`,onClick:x,title:p(`table.reset-column-widths`,`Reset column widths`),type:`button`,children:(0,K.jsx)(y,{name:`rotate-ccw`,className:`size-lt-icon-sm`})}),(0,K.jsx)(`div`,{className:`overflow-x-auto`,children:(0,K.jsxs)(`div`,{ref:b,className:`flex min-w-max flex-col gap-2`,style:{"--lattice-table-columns":_},children:[(0,K.jsxs)(`div`,{className:`grid grid-cols-[var(--lattice-table-columns)] items-center gap-x-3`,children:[(0,K.jsx)(`div`,{}),t.map((e,t)=>(0,K.jsxs)(`div`,{className:`relative min-w-0 pr-3 text-xs font-medium text-lt-muted-fg`,children:[e.label,d&&(0,K.jsx)(`div`,{...g(h[t])})]},e.name)),(0,K.jsx)(`div`,{})]}),n.map(d=>(0,K.jsx)(sm,{base:e,index:d.index,row:d.row,template:d.template,span:d.span,isFirst:d.index===0,isLast:d.index===n.length-1,columnCount:t.length,flipKey:d.key,reorderable:r,removable:i(d.index),rowActions:a,onField:o,onMove:s,onRemove:c,onDuplicate:l,registerRow:u},d.key))]})})]}):(0,K.jsx)(`div`,{className:`flex flex-col gap-3`,children:n.map(t=>(0,K.jsx)(`div`,{ref:e=>u?.(t.key,e),"data-flip-key":t.key,children:(0,K.jsx)(Ap,{base:e,index:t.index,row:t.row,template:t.template,heading:t.heading??`#${t.index+1}`,reorderable:r,isFirst:t.index===0,isLast:t.index===n.length-1,removable:i(t.index),rowActions:a,onField:o,onRemove:c,onMove:s,onDuplicate:l})},t.key))})}var lm=180;function um(){return typeof matchMedia==`function`&&matchMedia(`(prefers-reduced-motion: reduce)`).matches}function dm(e){let t=(0,z.useRef)(new Map),n=(0,z.useRef)(new Map),r=(0,z.useCallback)((e,n)=>{n?t.current.set(e,n):t.current.delete(e)},[]);return Wd(()=>{let e=[],r=new Map;return t.current.forEach((e,t)=>{e.style.transition=``,e.style.transform=``,r.set(t,e.getBoundingClientRect())}),um()||t.current.forEach((t,i)=>{let a=n.current.get(i),o=r.get(i);if(a&&o){let n=a.top-o.top;n&&(t.style.transform=`translateY(${n}px)`,e.push(requestAnimationFrame(()=>{t.style.transition=`transform ${lm}ms ease-out`,t.style.transform=``})))}}),n.current=r,()=>{for(let t of e)cancelAnimationFrame(t)}},[e]),r}function fm(e,t){let n=De(),r=n?n.errorKey(e):e,i=bt(),a=Oe(r),o=Array.isArray(a)?a:be(a,t),s=en(o);Wd(()=>{s!==o&&i(r,s)},[o,s,i,r]);let c=(0,z.useCallback)(e=>{i(r,n=>e(Array.isArray(n)?n:be(n,t)))},[i,r,t]);return{path:r,rows:s,onField:(0,z.useCallback)((e,t,n)=>c(r=>r.map((r,i)=>i===e?{...r,[t]:n}:r)),[c]),onRemove:(0,z.useCallback)(e=>c(t=>ze(t,e)),[c]),onMove:(0,z.useCallback)((e,t)=>c(n=>fe(n,e,e+t)),[c]),onDuplicate:(0,z.useCallback)(e=>c(t=>Ne(t,e)),[c]),append:(0,z.useCallback)(e=>c(t=>[...t,Le(e)]),[c]),insert:(0,z.useCallback)((e,t)=>c(n=>[...n.slice(0,e),Le(t),...n.slice(e)]),[c])}}var pm=[],mm=({node:e})=>{let t=e.props,n=t.name,r=t.templates,{errors:i}=ot(),{hidden:a,required:o}=nt(e),{path:s,rows:c,onField:l,onRemove:u,onMove:d,onDuplicate:f,append:p}=fm(n,t.defaultItems??0),{t:m}=N(`lattice`),h=dm(c.map(e=>String(e.rowId??``)).join(`,`)),g=t.maxItems!=null&&c.length>=t.maxItems,_=t.minItems!=null&&c.length<=t.minItems,v=t.layout===`table`,y=e=>r.find(t=>t.type===e),b=r.map(e=>({type:e.type,label:e.label}));if(a)return null;let x=r[0],S=c.map((e,t)=>{let n=y(e.type),r=!!n&&!!x&&n.type===x.type;return{key:String(e.rowId??t),index:t,row:e,template:n?.schema??pm,span:!r,heading:n?.label??`Unknown block: ${String(e.type)}`}});return(0,K.jsx)(at,{error:i[s],helperText:t.helperText??void 0,tooltip:t.tooltip??void 0,labelAction:Ut(t.labelAction),label:t.label??``,id:s,required:o,children:e=>(0,K.jsxs)(`div`,{...e,className:`flex flex-col gap-3`,role:`group`,children:[(0,K.jsx)(Op,{path:s,rows:c,rowKey:xe}),(0,K.jsx)(Op,{path:s,rows:c,rowKey:`type`}),v?(0,K.jsx)(K.Fragment,{children:(0,K.jsx)(cm,{base:s,columns:om(x?.schema??[]),rows:S,reorderable:t.reorderable??!1,removable:()=>!_,rowActions:t.rowActions,onField:l,onMove:d,onRemove:u,onDuplicate:f,registerRow:h,resizableColumns:t.resizableColumns===!0,resizeIndicator:t.resizeIndicator===!0})}):c.map((e,r)=>{let i=y(e.type),a=String(e.rowId??r);return(0,K.jsx)(`div`,{ref:e=>h(a,e),"data-flip-key":a,children:i?(0,K.jsx)(Ap,{base:s,index:r,row:e,template:i.schema??pm,heading:i.label,reorderable:t.reorderable??!1,isFirst:r===0,isLast:r===c.length-1,removable:!_,rowActions:t.rowActions,onField:l,onRemove:u,onMove:d,onDuplicate:f}):(0,K.jsxs)(`div`,{"data-test":`repeater-${n}-row-${r}`,className:`flex items-center justify-between rounded-lt border border-dashed border-lt-border p-4 text-sm text-lt-muted-fg`,children:[(0,K.jsxs)(`span`,{children:[`Unknown block: `,String(e.type)]}),(0,K.jsx)(Dp,{actions:Cp(t.rowActions,{index:r,removable:!_,onRemove:u,onDuplicate:f,t:m})})]})},a)}),!g&&(0,K.jsx)(xp,{addLabel:t.addLabel??`Add`,options:b,onSelect:e=>p({type:e})})]})})};function hm(e,t){if(!t)return e;let n=e.replace(/[^A-Za-z0-9_-]+/g,`-`).replace(/^-+|-+$/g,``);return n?`${t}-${n}`:t}function gm(e){let{errors:t,fieldIdPrefix:n}=ot(),r=De(),i=nt(e),a=Ce(e),o=a.name??``,s=Oe(o),c=r?r.getValue(o):s,l=c===void 0?a.value:c,u=typeof l==`string`||typeof l==`number`?String(l):``,d=hm(r?r.scopedName(o):o,n),f=r?r.errorKey(o):o,{commit:p,change:m,blur:h}=_e(),g=e=>p(o,e),_=e=>m(o,e),v=()=>h(o);return{...i,localName:o,name:d,testId:Zl(o),rawValue:l,value:u,error:t[f],commit:g,change:_,blur:v}}function _m(e,t){let n=De(),r=Oe(e),i=n?n.getValue(e):r,a=bt();(0,z.useEffect)(()=>{i==null&&t!==void 0&&(n?n.setValue(e,t):a(e,t))},[e,t,i,a,n])}var vm=({node:e})=>{let t=gm(e),n=Tt(t.rawValue);return _m(t.localName,Tt(e.props.value)),t.hidden?null:(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`div`,{className:`flex items-center space-x-3`,children:[(0,K.jsx)(Ff,{"aria-readonly":t.readOnly&&!t.disabled?!0:void 0,autoFocus:e.props.autoFocus??void 0,checked:n,"data-test":t.testId,disabled:t.disabled,id:t.name,name:t.name,onCheckedChange:e=>{t.readOnly||t.commit(e===!0)},tabIndex:e.props.tabIndex??void 0}),(0,K.jsx)(lt,{htmlFor:t.name,children:e.props.label})]}),e.props.helperText&&(0,K.jsx)(`p`,{className:`mt-1 pl-7 text-sm text-lt-muted-fg`,children:e.props.helperText})]})},ym=new Set([`ArrowUp`,`ArrowLeft`]),bm=new Set([`ArrowDown`,`ArrowRight`]);function xm({ariaLabel:e,autoFocus:t=!1,className:n,disabled:r=!1,name:a,onSelect:o,optionSchema:s,options:c,tabIndex:l,value:u,...d}){let f=(0,z.useRef)(null),p=c.some(e=>e.value===u);(0,z.useEffect)(()=>{if(!t)return;let e=f.current;(e?.querySelector(`button[aria-checked="true"]`)??e?.querySelector(`button`))?.focus()},[t]);let m=e=>{if(r||c.length===0)return;let t=bm.has(e.key)?1:ym.has(e.key)?-1:0;if(t===0)return;e.preventDefault();let n=c[(c.findIndex(e=>e.value===u)+t+c.length)%c.length];n&&(o(n.value),f.current?.querySelector(`[data-test="${a}-${n.value}"]`)?.focus())};return(0,K.jsx)(`div`,{...d,"aria-label":e,className:x(`grid w-full gap-2`,n),onKeyDown:m,ref:f,role:`radiogroup`,children:c.map((e,t)=>{let n=u===e.value,c=n||!p&&t===0;return(0,K.jsx)(`button`,{"aria-checked":n,className:x(`rounded-lt border p-4 text-left transition-colors`,n?`border-lt-primary bg-lt-accent text-lt-accent-fg`:`border-lt-border hover:border-lt-input`,r&&`cursor-not-allowed opacity-60`),"data-test":`${a}-${e.value}`,disabled:r,onClick:()=>o(e.value),role:`radio`,tabIndex:c?l??0:-1,type:`button`,children:(0,K.jsx)($e,{nodes:i(s,{...e.data,label:e.label,value:e.value})})},e.value)})})}function Sm(e){return x(`whitespace-nowrap rounded-lt-sm px-3 py-1.5 text-sm font-medium transition-colors`,e?`bg-lt-bg text-lt-fg shadow-lt-xs`:`text-lt-muted-fg hover:bg-lt-bg/60 hover:text-lt-fg`)}function Cm({"aria-label":e,autoFocus:t=!1,className:n,defaultValue:r,disabled:i=!1,name:a,onValueChange:o,options:s,tabIndex:c,value:l,...u}){let d=(0,z.useRef)(null),[f,p]=(0,z.useState)(r??s[0]?.value??``),m=l??f;if((0,z.useEffect)(()=>{if(!t)return;let e=d.current;(e?.querySelector(`button[aria-checked="true"]`)??e?.querySelector(`button`))?.focus()},[t]),s.length===0)return null;function h(e){l===void 0&&p(e),o?.(e)}return(0,K.jsx)(`div`,{...u,"aria-label":e,className:x(`inline-flex w-fit max-w-full gap-1 overflow-x-auto rounded-lt bg-lt-muted p-1`,n),ref:d,role:`radiogroup`,children:s.map(e=>{let t=m===e.value;return(0,K.jsx)(`button`,{"aria-checked":t,"data-test":a?`${a}-${e.value}`:void 0,className:x(Sm(t),i&&`cursor-not-allowed opacity-60`),disabled:i,onClick:()=>h(e.value),role:`radio`,tabIndex:c,type:`button`,children:e.label},e.value)})})}var wm=({node:e})=>{let t=Ud(e),{localName:n,name:r,testId:i,value:a,error:o,hidden:s,required:c,readOnly:l,disabled:u,commit:d}=gm(e),f=(0,z.useMemo)(()=>t.props.options??[],[t.props]),p=t.props.optionSchema,m=f[0]?.value??``,h=a||m;return _m(n,h||void 0),s||f.length===0?null:(0,K.jsx)(at,{error:o,helperText:e.props.helperText??void 0,tooltip:e.props.tooltip??void 0,labelAction:Ut(e.props.labelAction),label:e.props.label??``,id:r,required:c,children:t=>(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`input`,{name:r,type:`hidden`,value:h}),p?.length?(0,K.jsx)(xm,{...t,ariaLabel:e.props.label??void 0,autoFocus:e.props.autoFocus??void 0,disabled:l||u,name:i??`choice`,onSelect:d,optionSchema:p,options:f,tabIndex:e.props.tabIndex??void 0,value:h}):(0,K.jsx)(Cm,{...t,"aria-label":e.props.label??void 0,autoFocus:e.props.autoFocus??void 0,disabled:l||u,name:i??`segment`,onValueChange:d,options:f,tabIndex:e.props.tabIndex??void 0,value:h})]})})};function Tm({node:e,label:t,children:n}){let r=gm(e);return r.hidden?null:(0,K.jsx)(at,{error:r.error,helperText:Ce(e).helperText??void 0,tooltip:Ce(e).tooltip??void 0,labelAction:Ut(Ce(e).labelAction),label:t,id:r.name,required:r.required,children:e=>n(r,e)})}var Em=({node:e})=>{let t=e.props;return(0,K.jsx)(Tm,{node:e,label:t.label??``,children:({name:e,value:n,readOnly:r,disabled:i,commit:a},o)=>{let s=yp(n);return(0,K.jsxs)(Qt,{children:[(0,K.jsx)(`input`,{name:e,type:`hidden`,value:s??``}),(0,K.jsx)(Fe,{asChild:!0,children:(0,K.jsx)(`button`,{...o,"aria-readonly":r&&!i?!0:void 0,className:x(nn(),`flex items-center gap-2 text-left`),"data-test":`color-picker-${e}`,disabled:i,onClick:r?e=>e.preventDefault():void 0,type:`button`,children:s?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`span`,{"aria-hidden":`true`,className:`size-4 shrink-0 rounded-full border border-lt-border`,style:{background:s}}),(0,K.jsx)(`span`,{className:`tabular-nums`,children:s})]}):(0,K.jsx)(`span`,{className:`text-lt-muted-fg`,children:t.placeholder??``})})}),(0,K.jsx)(Yt,{className:`p-3`,children:(0,K.jsx)(bp,{onChange:e=>a(e),palette:t.palette,value:s??`#6b7280`})})]})}})},Dm=(0,z.lazy)(async()=>{let{DatePickerField:e}=await fn(async()=>{let{DatePickerField:e}=await import(`./date-picker-view-CyYnhUeK.js`);return{DatePickerField:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8]),import.meta.url);return{default:e}});function Om(e){return(0,K.jsx)(z.Suspense,{fallback:null,children:(0,K.jsx)(Dm,{...e})})}var km=({node:e})=>{let t=e.props;return(0,K.jsx)(Tm,{node:e,label:t.label??``,children:({name:e,testId:n,value:r,readOnly:i,disabled:a,change:o,blur:s},c)=>(0,K.jsx)(Om,{controlProps:c,autoFocus:t.autoFocus??!1,disabled:a,label:t.label??t.name,max:t.max||void 0,min:t.min||void 0,mode:`date`,name:e,onBlur:s,onChange:o,readOnly:i,tabIndex:t.tabIndex??void 0,testId:n??t.name,value:r})})},Am=({node:e})=>{let t=e.props,{timezone:n}=oe();return(0,K.jsx)(Tm,{node:e,label:t.label??``,children:({name:e,testId:r,value:i,readOnly:a,disabled:o,change:s,blur:c},l)=>(0,K.jsx)(Om,{controlProps:l,autoFocus:t.autoFocus??!1,disabled:o,label:t.label??t.name,max:t.max,min:t.min,mode:`date-time`,name:e,onBlur:c,onChange:s,readOnly:a,step:t.step,tabIndex:t.tabIndex??void 0,testId:r??t.name,timezone:n,value:i})})};function jm({url:e,method:t,body:n,headers:r,onProgress:i}){return new Promise((a,o)=>{let s=new XMLHttpRequest;s.open(t,e,!0),Object.entries(r).forEach(([e,t])=>s.setRequestHeader(e,String(t))),s.upload.onprogress=e=>{e.lengthComputable&&i?.(Math.round(e.loaded/e.total*100))},s.onload=()=>{try{a(new Response(s.responseText||null,{status:s.status||500}))}catch{o(Error(`Upload to ${e} returned an unusable response`))}},s.onerror=()=>o(Error(`Upload to ${e} failed`)),s.send(n)})}function Mm(e,{ref:t,target:n,filename:r,contentType:i,values:a}){return Wu(e,{method:`POST`,ref:t,body:JSON.stringify({...a,_sub:`upload`,_target:n,filename:r,contentType:i}),throwOnError:!1})}function Nm(e,t){return Array.isArray(t)?Array.isArray(e)&&e.length===t.length&&e.every((e,n)=>e===t[n]):e===t}var Pm=({node:e})=>{let t=e.props,{hidden:n,required:r,readOnly:i,disabled:a}=nt(e),{action:o,componentRef:s,errors:c}=ot(),l=t.name,u=De(),d=u?u.scopedName(l):l,f=u?u.errorKey(l):l,p=f,m=St(),h=bt(),g=(0,z.useId)(),_=(0,z.useRef)(null),v=(0,z.useRef)(new Set),y=i||a,b=t.signed,x=t.multiple,S=x?`${d}[]`:d,C=(0,z.useMemo)(()=>(t.files??[]).map(e=>({id:crypto.randomUUID(),name:e.name,size:e.size,status:`ready`,progress:100,key:e.key,url:e.url,token:e.token,existing:!0})),[t.files]),[w,T]=(0,z.useState)(C),[E,D]=(0,z.useState)([]);(0,z.useEffect)(()=>{if(!b)return;let e=w.filter(e=>!e.existing&&e.key&&e.status===`ready`).map(e=>e.key),t=x?e:e[0]??``;if(u){Nm(u.getValue(l),t)||u.setValue(l,t);return}h(l,t)},[w,x,l,u,h,b]),(0,z.useEffect)(()=>{!b||u||h(`${l}__removed`,E)},[l,E,u,h,b]),(0,z.useEffect)(()=>()=>{v.current.forEach(e=>URL.revokeObjectURL(e)),v.current.clear()},[]);let O=(0,z.useMemo)(()=>w.filter(e=>e.file&&!e.existing).map(e=>e.file),[w]);(0,z.useEffect)(()=>{if(b||!_.current)return;let e=new DataTransfer;O.forEach(t=>e.items.add(t)),_.current.files=e.files},[O,b]);function ee(e){if(!t.image)return;let n=URL.createObjectURL(e);return v.current.add(n),n}function k(e){!e.url||!v.current.has(e.url)||(URL.revokeObjectURL(e.url),v.current.delete(e.url))}async function A(e,t){let n=()=>{T(t=>t.map(t=>t.id===e.id?{...t,status:`error`}:t))},r=await Mm(o,{ref:s,target:p,filename:t.name,contentType:t.type,values:m});if(!r.ok){n();return}let i=await r.json();try{let n=await jm({url:i.url,method:i.method.toUpperCase(),body:t,headers:i.headers,onProgress:t=>T(n=>n.map(n=>n.id===e.id?{...n,progress:t}:n))});T(t=>t.map(t=>t.id===e.id?{...t,status:n.ok?`ready`:`error`,key:i.key,progress:100}:t))}catch{n()}}function j(e){if(!e||y)return;let t=Array.from(e),n=t.map(e=>({id:crypto.randomUUID(),name:e.name,size:e.size,status:b?`uploading`:`ready`,progress:0,file:e,url:ee(e),existing:!1}));if(!x&&(w.forEach(k),!u)){let e=w.filter(e=>e.existing&&e.token).map(e=>e.token);e.length>0&&D(t=>[...t,...e])}T(e=>x?[...e,...n]:n),b&&n.forEach((e,n)=>void A(e,t[n]))}function M(e){let t=w.find(t=>t.id===e);t&&k(t),t?.existing&&t.token&&!u&&D(e=>[...e,t.token]),T(t=>t.filter(t=>t.id!==e))}if(n)return null;let te=w.filter(e=>b&&!e.existing&&e.key&&e.status===`ready`);return(0,K.jsx)(at,{error:c[f],helperText:t.helperText??void 0,tooltip:t.tooltip??void 0,labelAction:Ut(t.labelAction),label:t.label??``,id:g,required:r,children:e=>(0,K.jsx)(Rf,{disabled:y,hiddenInputs:(0,K.jsxs)(K.Fragment,{children:[te.map(e=>(0,K.jsx)(`input`,{"data-test":Zl(`${l}-uploaded`),name:S,type:`hidden`,value:e.key},e.id)),!u&&E.map(e=>(0,K.jsx)(`input`,{name:`${l}__removed[]`,type:`hidden`,value:e},e))]}),image:t.image,inputProps:{...e,accept:t.accept??void 0,"aria-label":t.label??l,"data-test":Zl(`${l}-input`),multiple:x,name:b?void 0:S},inputRef:_,items:w.map(e=>({id:e.id,itemTestId:Zl(`${l}-item`),name:e.name,previewTestId:Zl(`${l}-preview`),progress:e.progress,removable:!e.existing||!u,removeTestId:Zl(e.existing?`${l}-remove-existing`:`${l}-remove`),status:e.status,url:e.url})),onFilesAdded:j,onRemove:M,resetOnSelect:!!b,testId:Zl(l)})})},Fm={start:`justify-start`,center:`justify-center`,end:`justify-end`,between:`justify-between`,around:`justify-around`,evenly:`justify-evenly`};function Im({label:e,summaryLabel:t,variant:n,emphasis:r}){let{componentId:i,errors:a,fieldLabels:o,processing:s}=ot(),c=Object.entries(a).filter(([,e])=>!!e).map(([e,t])=>({label:o[e]??e,message:t})),l=c.length>0;return(0,K.jsxs)(`span`,{className:`group relative inline-flex flex-col`,children:[(0,K.jsxs)(q,{"data-lattice-form":i,"data-test":`form-submit`,disabled:s||l,emphasis:r,type:`submit`,variant:n,children:[s&&(0,K.jsx)(Xl,{}),e]}),l&&(0,K.jsxs)(`div`,{className:`pointer-events-none absolute bottom-full left-1/2 z-lt-popover mb-2 w-max max-w-xs -translate-x-1/2 rounded-lt border border-lt-border bg-lt-surface p-3 text-left text-sm opacity-0 shadow-lt-md transition-opacity group-hover:opacity-100`,role:`tooltip`,children:[(0,K.jsx)(`p`,{className:`mb-1 font-medium text-lt-fg`,children:t}),(0,K.jsx)(`ul`,{className:`space-y-1`,children:c.map(e=>(0,K.jsxs)(`li`,{className:`text-lt-muted-fg`,children:[(0,K.jsx)(`span`,{className:`font-medium text-lt-fg`,children:e.label}),` — `,e.message]},e.label))})]})]})}function Lm({componentId:e,reset:t}){let n=ue();return Fl(d.resetForm,r=>{let i=r.detail;(!i?.form||i.form===e)&&(t(),n())}),null}function Rm({action:e,children:t,componentRef:n,nodes:r,shouldRenderSubmitButton:i,submitButtons:a,submitEmphasis:o,submitJustify:s,submitLabel:c,submitVariant:l,summaryLabel:u}){let{nodes:d,markUserEdit:f}=ef(e,n,r),p=(0,z.useMemo)(()=>({markUserEdit:f}),[f]);return(0,K.jsx)(je,{value:p,children:(0,K.jsx)(Hd,{nodes:d,children:(0,K.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[t,i&&(0,K.jsx)(`div`,{className:`flex gap-3 ${Fm[s??`end`]}`,children:a?.length?a.map((e,t)=>e.props.buttonType===`submit`?(0,K.jsx)(Im,{emphasis:e.props.emphasis??o,label:e.props.label??c,summaryLabel:u,variant:e.props.variant??l},me(e,t)):(0,K.jsx)(Zt,{node:e},me(e,t))):(0,K.jsx)(Im,{emphasis:o,label:c,summaryLabel:u,variant:l})})]})})})}function zm(e){return!e||Array.isArray(e)&&e.length===0?!1:Array.isArray(e)?e:void 0}var Bm=({children:e,node:t})=>{let n=(0,z.useMemo)(()=>({...tf(t.schema).values,...t.props.state}),[t.schema,t.props.state]),r=t.props.async?Vm:Hm;return(0,K.jsx)(ge,{initial:n,children:(0,K.jsx)(r,{node:t,children:e})})};function Vm({children:e,node:t}){let{t:n}=N(`lattice`),r=t.props,i=r.action??`#`,a=r.ref??``,o=r.method??`post`,s=r.precognitive,c=r.resetOnError??!1,l=r.resetOnSuccess??[],u=(0,z.useMemo)(()=>tf(t.schema).labels,[t.schema]),d=r.submitButtons??void 0,f=r.submitLabel??n(`form.submit`,`Submit`),p=ue(),m=e=>{let t=zm(e);t!==!1&&p(t)},{clearErrors:h,errors:g,processing:_,submit:v,touch:y,validate:b,validateFields:x,validating:S}=of({componentRef:a,endpoint:i,method:o,onError:()=>m(c),onSuccess:()=>m(l),precognitive:s,validationDebounceMs:r.validationTimeout??void 0}),C=(0,z.useMemo)(()=>({action:i,clearErrors:h,componentId:t.id,componentRef:a,errors:g,fieldLabels:u,precognitive:s,processing:_,touch:y,validate:b,validateFields:x,validating:S}),[i,h,a,g,u,t.id,s,_,y,b,x,S]);return(0,K.jsx)(`form`,{"data-slot":`form`,"data-test":t.id,className:`flex w-full flex-col gap-6`,onSubmit:e=>{e.preventDefault(),v()},children:(0,K.jsxs)(R,{value:C,children:[(0,K.jsx)(Lm,{componentId:t.id,reset:()=>{}}),r.status&&(0,K.jsx)(`div`,{className:`text-center text-sm font-medium text-lt-success`,children:r.status}),(0,K.jsx)(Rm,{action:i,componentRef:a,nodes:t.schema,shouldRenderSubmitButton:r.submitButton,submitButtons:d,submitEmphasis:r.submitEmphasis??void 0,submitJustify:r.submitJustify??void 0,submitLabel:f,submitVariant:r.submitVariant??void 0,summaryLabel:r.validationSummaryLabel,children:e})]})})}function Hm({children:e,node:t}){let{t:n}=N(`lattice`),r=t.props,i=r.action??`#`,a=r.errorBag,o=r.ref??``,s=r.method??`post`,c=r.precognitive,l=r.resetOnError??!1,u=r.resetOnSuccess??[],d=(0,z.useMemo)(()=>tf(t.schema).labels,[t.schema]),f=r.submitButton,p=r.submitButtons??void 0,m=r.submitJustify??void 0,h=r.submitLabel??n(`form.submit`,`Submit`),g=r.submitVariant??void 0,_=r.submitEmphasis??void 0,v=r.validationSummaryLabel,y=r.validationTimeout??void 0,b=ue(),x=e=>{let t=zm(e);t!==!1&&b(t)},S=(0,z.useRef)(null),C=(0,z.useRef)(`idle`),[w,T]=(0,z.useState)(0);return(0,z.useEffect)(()=>{w>0&&C.current===`renewing`&&S.current?.submit()},[w]),(0,K.jsx)(kc,{ref:S,action:i,"data-slot":`form`,"data-test":t.id,errorBag:a,method:s,options:{preserveScroll:!0},resetOnError:l,resetOnSuccess:u,validationTimeout:c?y:void 0,headers:Nu(o),className:`flex w-full flex-col gap-6`,onStart:()=>{C.current=C.current===`renewing`?`retried`:`idle`},onSuccess:()=>x(u),onError:()=>x(l),onHttpException:e=>{if(e.status===403&&o!==``&&C.current!==`retried`)return C.current=`renewing`,Uu(o).finally(()=>T(e=>e+1)),!1},children:({clearErrors:n,errors:a,processing:s,reset:l,touch:u,validate:y,validating:b})=>(0,K.jsxs)(R,{value:{action:i,clearErrors:e=>n(e),componentId:t.id,componentRef:o,errors:a,fieldLabels:d,precognitive:c,processing:s,touch:e=>u(...e),validate:e=>y(e),validateFields:(e,t)=>y({only:e,...t}),validating:b},children:[(0,K.jsx)(Lm,{componentId:t.id,reset:l}),r.status&&(0,K.jsx)(`div`,{className:`text-center text-sm font-medium text-lt-success`,children:r.status}),(0,K.jsx)(Rm,{action:i,componentRef:o,nodes:t.schema,shouldRenderSubmitButton:f,submitButtons:p,submitEmphasis:_,submitJustify:m,submitLabel:h,submitVariant:g,summaryLabel:v,children:e})]})})}var Um=({node:e})=>{let t=De(),n=e.props.name,r=t?t.getValue(n):e.props.value;return(0,K.jsx)(`input`,{defaultValue:typeof r==`string`?r:``,name:t?t.scopedName(n):n,type:`hidden`})};function Wm({affix:e,side:t,squared:n=!1}){return(0,K.jsx)(`span`,{"data-slot":`affix-${t}`,className:x(`inline-flex h-lt-control-md shrink-0 items-center border border-lt-input bg-lt-muted px-3 text-base whitespace-nowrap text-lt-muted-fg`,`group-has-[:focus-visible]:border-lt-ring`,t===`start`?`rounded-l-lt-sm border-r-0`:`rounded-r-lt-sm border-l-0`,n&&`rounded-r-none border-r-0`),children:e.icon?(0,K.jsx)(nl,{className:`size-lt-icon-md`,icon:e.icon}):e.text})}function Gm({prefix:e,suffix:t,start:n,end:r,children:i}){return!e&&!t&&!n&&!r?i(``):(0,K.jsxs)(`div`,{className:`group flex w-full rounded-lt-sm transition-[color,box-shadow] has-[:focus-visible]:ring-[length:var(--lt-ring-width)] has-[:focus-visible]:ring-lt-ring/50`,"data-slot":`affix-group`,children:[n,e?(0,K.jsx)(Wm,{affix:e,side:`start`}):null,(0,K.jsx)(`div`,{className:`min-w-0 flex-1`,children:i(x(`focus-visible:ring-0`,(e||n)&&`rounded-l-none`,(t||r)&&`rounded-r-none`))}),t?(0,K.jsx)(Wm,{affix:t,side:`end`,squared:!!r}):null,r]})}var Km=250;function qm({contentClassName:e,creatable:t=!1,emptyLabel:n,loading:r=!1,multiple:i=!1,onCommit:a,onCreate:o,onSearch:s,onSelect:c,open:l,onOpenChange:u,options:d,renderOption:f,searchLabel:p,searchPlaceholder:m,selected:h,showSearch:g=!0,testId:_,trigger:v,triggerClassName:b,triggerProps:S}){let{t:C}=N(`lattice`),[w,T]=(0,z.useState)(``),E=(0,z.useRef)(null),[D,O]=(0,z.useState)(!1);(0,z.useLayoutEffect)(()=>{O(!!E.current?.closest(`[role="dialog"]`))},[]);function ee(e){let t=e.split(`,`).map(e=>e.trim()).filter(Boolean);for(let e of t){let t=d.find(t=>t.label.toLowerCase()===e.toLowerCase());t?(a??c)(t.value):o?.(e)}i?T(``):M()}let k=d.some(e=>e.label.toLowerCase()===w.trim().toLowerCase()),A=af(e=>s?.(e),Km);(0,z.useEffect)(()=>{if(!(!s||!l))return A(w),()=>A.cancel()},[w,s,l,A]);let j=s?d:d.filter(e=>e.label.toLowerCase().includes(w.toLowerCase()));function M(){T(``),u(!1)}function te(e){c(e),i||M()}return(0,K.jsxs)(Qt,{modal:D,open:l,onOpenChange:e=>e?u(!0):M(),children:[(0,K.jsx)(Fe,{asChild:!0,children:(0,K.jsx)(`button`,{type:`button`,className:b,ref:E,...S,children:v})}),(0,K.jsxs)(Yt,{align:`start`,className:x(`w-[var(--radix-popover-trigger-width)] overflow-hidden p-0`,e),children:[g&&(0,K.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-lt-border px-3 py-2`,children:[(0,K.jsx)(`input`,{"aria-label":p??C(`form.search-options`,`Search options`),"data-slot":`combobox-search`,"data-test":_?`${_}-search`:void 0,className:`w-full bg-transparent text-sm outline-none placeholder:text-lt-muted-fg`,onChange:e=>{let n=e.target.value;if(t&&n.includes(`,`)){ee(n);return}T(n)},onKeyDown:e=>{t&&e.key===`Enter`&&w.trim()!==``&&(e.preventDefault(),ee(w))},placeholder:m,value:w}),r&&(0,K.jsx)(y,{name:`loader-2`,"aria-hidden":`true`,className:`size-lt-icon-md shrink-0 animate-spin text-lt-muted-fg`})]}),(0,K.jsxs)(`div`,{className:`max-h-60 overflow-y-auto p-1`,role:`listbox`,children:[t&&w.trim()!==``&&!k&&(0,K.jsxs)(`button`,{className:`flex w-full items-center gap-2 rounded-lt-sm px-3 py-1.5 text-left text-sm transition-colors hover:bg-lt-accent hover:text-lt-accent-fg`,"data-test":_?`${_}-create`:void 0,onClick:()=>ee(w),type:`button`,children:[(0,K.jsx)(y,{name:`plus`,"aria-hidden":`true`,className:`size-lt-icon-md shrink-0`}),C(`form.create-option`,`Create "{{label}}"`,{label:w.trim()})]}),j.length===0&&!(t&&w.trim()!==``&&!k)?(0,K.jsx)(`p`,{className:`px-3 py-2 text-sm text-lt-muted-fg`,children:n}):j.map(e=>{let t=h.includes(e.value);return(0,K.jsxs)(`button`,{"aria-label":f?e.label:void 0,"aria-selected":t,className:x(`flex w-full items-center justify-between gap-2 rounded-lt-sm px-3 py-1.5 text-left text-sm transition-colors hover:bg-lt-accent hover:text-lt-accent-fg`,t&&`bg-lt-accent/60`),"data-slot":`combobox-option`,"data-test":_?`${_}-option-${e.value}`:void 0,"data-value":e.value,onClick:()=>te(e.value),role:`option`,type:`button`,children:[f?(0,K.jsx)(`span`,{className:`flex min-w-0 flex-1 items-center gap-2`,children:f(e)}):e.label,t&&(0,K.jsx)(y,{name:`check`,"aria-hidden":`true`,className:`size-lt-icon-md shrink-0`})]},e.value)})]})]})]})}function Jm({creatable:e=!1,emptyLabel:t,loading:n=!1,locked:r=!1,multiple:i=!1,onCreate:a,onOpenChange:o,onRemove:s,onSearch:c,onSelect:l,options:u,placeholder:d,renderOption:f,searchPlaceholder:p,selectedItems:m,showSearch:h=!1,testId:g,triggerClassName:_,triggerProps:v}){let{t:b}=N(`lattice`),[S,C]=(0,z.useState)(!1);return(0,K.jsxs)(`div`,{children:[i&&m.length>0&&(0,K.jsx)(`div`,{className:`mb-1.5 flex flex-wrap gap-1`,children:m.map(e=>(0,K.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-lt-sm bg-lt-muted px-2 py-0.5 text-xs`,children:[e.color&&(0,K.jsx)(`span`,{"aria-hidden":`true`,className:`size-2 shrink-0 rounded-full`,style:{background:on(e.color)}}),e.label,!r&&(0,K.jsx)(`button`,{"aria-label":b(`form.remove-option`,`Remove {{label}}`,{label:e.label}),"data-test":g?`${g}-remove-${e.value}`:void 0,className:`text-lt-muted-fg hover:text-lt-fg [&_svg]:size-lt-icon-xs`,onClick:()=>s?.(e.value),type:`button`,children:(0,K.jsx)(y,{name:`x`})})]},e.value))}),(0,K.jsx)(qm,{creatable:e,emptyLabel:t,loading:n,multiple:i,onCommit:e=>a?.(e),onCreate:e=>a?.(e),onSearch:c,onSelect:l,open:S&&!r,onOpenChange:e=>{C(e),o?.(e)},options:u,renderOption:f,searchPlaceholder:p,showSearch:h,selected:m.map(e=>e.value),testId:g,trigger:(0,K.jsxs)(K.Fragment,{children:[!i&&m.length>0?(0,K.jsx)(`span`,{children:m[0]?.label}):(0,K.jsx)(`span`,{className:`text-lt-muted-fg`,children:d}),(0,K.jsx)(y,{name:`chevrons-up-down`,className:`size-lt-icon-md shrink-0 text-lt-muted-fg`})]}),triggerClassName:_?x(_,`text-left aria-readonly:cursor-default disabled:cursor-not-allowed disabled:opacity-60`):x(nn(),`flex items-center justify-between gap-2 text-left`),triggerProps:v})]})}function Ym(e,t){let n=e??t;return Array.isArray(n)?n.map(String):n==null||n===``?[]:[String(n)]}function Xm({node:e,controlProps:t,triggerClassName:n}){let r=e.props,{action:a,componentRef:o,searchOptions:s}=ot(),{hidden:c,readOnly:l,disabled:u}=nt(e),{change:d,blur:f}=_e(),p=Ud(e),m=r.name,h=De(),g=h?h.errorKey(m):m,_=r.placeholder||`Select…`,v=r.multiple,y=r.searchable,b=r.creatable,x=(0,z.useMemo)(()=>p.props.options,[p.props]),S=p.props.optionSchema,C=Oe(m),w=St(),T=(0,z.useRef)(w);T.current=w;let E=h?h.getValue(m):C,D=(0,z.useMemo)(()=>Ym(E,r.value),[E,r.value]),O=(0,z.useRef)(D);O.current=D;let[ee,k]=(0,z.useState)(null),[A,j]=(0,z.useState)(!1),M=(0,z.useRef)(null),te=(0,z.useMemo)(()=>{let e=new Map;for(let t of[...x,...ee??[]])e.set(t.value,t);return e},[x,ee]),N=e=>te.get(e)?.label??e,P=e=>cn(te.get(e)?.data?.color),F=l||u,ne=(0,z.useCallback)(e=>{if(M.current?.abort(),e.trim()===``){k(null),j(!1);return}let t=new AbortController;if(M.current=t,j(!0),s){s(g,e,T.current,t.signal).then(e=>{k(e),j(!1)}).catch(()=>{});return}Gd(a,o,{...T.current,_sub:`search`,_target:g,_q:e},t.signal).then(e=>{k(e?.options??[]),j(!1)}).catch(()=>{})},[a,o,g,s]);function re(e){d(m,v?e:e[0]??``)}function ie(e){if(v){let t=O.current.includes(e)?O.current.filter(t=>t!==e):[...O.current,e];O.current=t,re(t);return}O.current=[e],re([e])}function I(e){re(D.filter(t=>t!==e))}function L(e){if(!v){O.current=[e],re([e]);return}if(!O.current.includes(e)){let t=[...O.current,e];O.current=t,re(t)}}if(c)return null;let ae=y?ee??x:x,oe=S?.length?e=>(0,K.jsx)($e,{nodes:i(S,{...e.data,label:e.label,value:e.value})}):void 0;return(0,K.jsxs)(K.Fragment,{children:[v?D.map(e=>(0,K.jsx)(`input`,{name:`${t.id}[]`,type:`hidden`,value:e},e)):(0,K.jsx)(`input`,{name:t.id,type:`hidden`,value:D[0]??``}),(0,K.jsx)(Jm,{creatable:b,emptyLabel:r.emptyLabel??void 0,loading:A,locked:F,multiple:v,onCreate:L,onOpenChange:e=>{e||f(m)},onRemove:I,onSearch:y?ne:void 0,onSelect:ie,options:ae,placeholder:_,renderOption:oe,searchPlaceholder:r.searchPlaceholder??void 0,selectedItems:D.map(e=>({color:P(e),label:N(e),value:e})),showSearch:!!(y||b),testId:`select-${m}`,triggerClassName:n,triggerProps:{...t,"aria-haspopup":`listbox`,"aria-readonly":l&&!u?!0:void 0,autoFocus:r.autoFocus??void 0,"data-test":`select-${m}`,disabled:u,tabIndex:r.tabIndex??void 0}})]})}function Zm(e){let{fieldIdPrefix:t}=ot(),n=De();return hm(n?n.scopedName(e):e,t)}function Qm(e,t){return t?e.schema?.find(e=>e.type===`field.select`&&e.props.name===t)??null:null}function $m({node:e,side:t,last:n=!0}){let{errors:r}=ot(),i=De(),a=e.props.name,o=Zm(a),s=r[i?i.errorKey(a):a];return(0,K.jsx)(Xm,{node:e,controlProps:{id:o,"aria-invalid":s?!0:void 0,"aria-label":e.props.label??a},triggerClassName:x(`flex h-lt-control-md shrink-0 items-center gap-1.5 border border-lt-input bg-lt-muted px-3 text-base whitespace-nowrap outline-none group-has-[:focus-visible]:border-lt-ring`,t===`start`&&`rounded-l-lt-sm rounded-r-none border-r-0`,t===`end`&&(n?`rounded-l-none rounded-r-lt-sm border-l-0`:`rounded-none border-l-0`),s&&`border-lt-danger`)})}var eh=({node:e})=>{let t=e.props,n=Qm(e,t.prefixFieldName),r=Qm(e,t.suffixFieldName);return(0,K.jsx)(Tm,{node:e,label:t.label??``,children:({name:e,testId:i,value:a,readOnly:o,disabled:s,commit:c},l)=>{let u=e=>c(e.target.value);return t.slider?(0,K.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,K.jsx)(`input`,{...l,"aria-label":t.label??``,className:`h-2 w-full cursor-pointer appearance-none rounded-lt-sm bg-lt-muted accent-lt-primary disabled:cursor-not-allowed disabled:accent-lt-disabled`,"data-test":i,disabled:s||o,max:t.max??void 0,min:t.min??void 0,name:e,onChange:u,step:t.step??void 0,tabIndex:t.tabIndex??void 0,type:`range`,value:a}),(0,K.jsx)(`output`,{className:`w-10 shrink-0 text-right text-sm tabular-nums text-lt-fg`,children:a})]}):(0,K.jsx)(Gm,{prefix:n?null:t.prefix,suffix:r?null:t.suffix,start:n?(0,K.jsx)($m,{node:n,side:`start`}):void 0,end:r?(0,K.jsx)($m,{node:r,side:`end`}):void 0,children:n=>(0,K.jsx)(rn,{...l,autoFocus:t.autoFocus??!1,className:n,"data-test":i,disabled:s,max:t.max??void 0,min:t.min??void 0,name:e,onChange:u,placeholder:t.placeholder??``,readOnly:o,step:t.step??void 0,tabIndex:t.tabIndex??void 0,type:`number`,value:a})})}})},th=Object.defineProperty,nh=Object.defineProperties,rh=Object.getOwnPropertyDescriptors,ih=Object.getOwnPropertySymbols,ah=Object.prototype.hasOwnProperty,oh=Object.prototype.propertyIsEnumerable,sh=(e,t,n)=>t in e?th(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ch=(e,t)=>{for(var n in t||={})ah.call(t,n)&&sh(e,n,t[n]);if(ih)for(var n of ih(t))oh.call(t,n)&&sh(e,n,t[n]);return e},lh=(e,t)=>nh(e,rh(t)),uh=(e,t)=>{var n={};for(var r in e)ah.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&ih)for(var r of ih(e))t.indexOf(r)<0&&oh.call(e,r)&&(n[r]=e[r]);return n};function dh(e){return[setTimeout(e,0),setTimeout(e,10),setTimeout(e,50)]}function fh(e){let t=z.useRef();return z.useEffect(()=>{t.current=e}),t.current}var ph=18,mh=40,hh=`${mh}px`,gh=[`[data-lastpass-icon-root]`,`com-1password-button`,`[data-dashlanecreated]`,`[style$="2147483647 !important;"]`].join(`,`);function _h({containerRef:e,inputRef:t,pushPasswordManagerStrategy:n,isFocused:r}){let[i,a]=z.useState(!1),[o,s]=z.useState(!1),[c,l]=z.useState(!1),u=z.useMemo(()=>n!==`none`&&(n===`increase-width`||n===`experimental-no-flickering`)&&i&&o,[i,o,n]),d=z.useCallback(()=>{let r=e.current,i=t.current;if(!r||!i||c||n===`none`)return;let o=r,s=o.getBoundingClientRect().left+o.offsetWidth,u=o.getBoundingClientRect().top+o.offsetHeight/2,d=s-ph,f=u;document.querySelectorAll(gh).length===0&&document.elementFromPoint(d,f)===r||(a(!0),l(!0))},[e,t,c,n]);return z.useEffect(()=>{let t=e.current;if(!t||n===`none`)return;function r(){let e=window.innerWidth-t.getBoundingClientRect().right;s(e>=mh)}r();let i=setInterval(r,1e3);return()=>{clearInterval(i)}},[e,n]),z.useEffect(()=>{let e=r||document.activeElement===t.current;if(n===`none`||!e)return;let i=setTimeout(d,0),a=setTimeout(d,2e3),o=setTimeout(d,5e3),s=setTimeout(()=>{l(!0)},6e3);return()=>{clearTimeout(i),clearTimeout(a),clearTimeout(o),clearTimeout(s)}},[t,r,n,d]),{hasPWMBadge:i,willPushPWMBadge:u,PWM_BADGE_SPACE_WIDTH:hh}}var vh=z.createContext({}),yh=z.forwardRef((e,t)=>{var n=e,{value:r,onChange:i,maxLength:a,textAlign:o=`left`,pattern:s,placeholder:c,inputMode:l=`numeric`,onComplete:u,pushPasswordManagerStrategy:d=`increase-width`,pasteTransformer:f,containerClassName:p,noScriptCSSFallback:m=xh,render:h,children:g}=n,_=uh(n,[`value`,`onChange`,`maxLength`,`textAlign`,`pattern`,`placeholder`,`inputMode`,`onComplete`,`pushPasswordManagerStrategy`,`pasteTransformer`,`containerClassName`,`noScriptCSSFallback`,`render`,`children`]),v;let[y,b]=z.useState(typeof _.defaultValue==`string`?_.defaultValue:``),x=r??y,S=fh(x),C=z.useCallback(e=>{i?.(e),b(e)},[i]),w=z.useMemo(()=>s?typeof s==`string`?new RegExp(s):s:null,[s]),T=z.useRef(null),E=z.useRef(null),D=z.useRef({value:x,onChange:C,isIOS:typeof window<`u`&&((v=window==null?void 0:window.CSS)?.supports)?.call(v,`-webkit-touch-callout`,`none`)}),O=z.useRef({prev:[T.current?.selectionStart,T.current?.selectionEnd,T.current?.selectionDirection]});z.useImperativeHandle(t,()=>T.current,[]),z.useEffect(()=>{let e=T.current,t=E.current;if(!e||!t)return;D.current.value!==e.value&&D.current.onChange(e.value),O.current.prev=[e.selectionStart,e.selectionEnd,e.selectionDirection];function n(){if(document.activeElement!==e){te(null),P(null);return}let t=e.selectionStart,n=e.selectionEnd,r=e.selectionDirection,i=e.maxLength,a=e.value,o=O.current.prev,s=-1,c=-1,l;if(a.length!==0&&t!==null&&n!==null){let e=t===n,r=t===a.length&&a.length<i;if(e&&!r){let e=t;if(e===0)s=0,c=1,l=`forward`;else if(e===i)s=e-1,c=e,l=`backward`;else if(i>1&&a.length>1){let t=0;if(o[0]!==null&&o[1]!==null){l=e<o[1]?`backward`:`forward`;let n=o[0]===o[1]&&o[0]<i;l===`backward`&&!n&&(t=-1)}s=t+e,c=t+e+1}}s!==-1&&c!==-1&&s!==c&&T.current.setSelectionRange(s,c,l)}let u=s===-1?t:s,d=c===-1?n:c,f=l??r;te(u),P(d),O.current.prev=[u,d,f]}if(document.addEventListener(`selectionchange`,n,{capture:!0}),n(),document.activeElement===e&&j(!0),!document.getElementById(`input-otp-style`)){let e=document.createElement(`style`);if(e.id=`input-otp-style`,document.head.appendChild(e),e.sheet){let t=`background: transparent !important; color: transparent !important; border-color: transparent !important; opacity: 0 !important; box-shadow: none !important; -webkit-box-shadow: none !important; -webkit-text-fill-color: transparent !important;`;bh(e.sheet,`[data-input-otp]::selection { background: transparent !important; color: transparent !important; }`),bh(e.sheet,`[data-input-otp]:autofill { ${t} }`),bh(e.sheet,`[data-input-otp]:-webkit-autofill { ${t} }`),bh(e.sheet,`@supports (-webkit-touch-callout: none) { [data-input-otp] { letter-spacing: -.6em !important; font-weight: 100 !important; font-stretch: ultra-condensed; font-optical-sizing: none !important; left: -1px !important; right: 1px !important; } }`),bh(e.sheet,`[data-input-otp] + * { pointer-events: all !important; }`)}}let r=()=>{t&&t.style.setProperty(`--root-height`,`${e.clientHeight}px`)};r();let i=new ResizeObserver(r);return i.observe(e),()=>{document.removeEventListener(`selectionchange`,n,{capture:!0}),i.disconnect()}},[]);let[ee,k]=z.useState(!1),[A,j]=z.useState(!1),[M,te]=z.useState(null),[N,P]=z.useState(null);z.useEffect(()=>{dh(()=>{var e;(e=T.current)==null||e.dispatchEvent(new Event(`input`));let t=T.current?.selectionStart,n=T.current?.selectionEnd,r=T.current?.selectionDirection;t!==null&&n!==null&&(te(t),P(n),O.current.prev=[t,n,r])})},[x,A]),z.useEffect(()=>{S!==void 0&&x!==S&&S.length<a&&x.length===a&&u?.(x)},[a,u,S,x]);let F=_h({containerRef:E,inputRef:T,pushPasswordManagerStrategy:d,isFocused:A}),ne=z.useCallback(e=>{let t=e.currentTarget.value.slice(0,a);if(t.length>0&&w&&!w.test(t)){e.preventDefault();return}typeof S==`string`&&t.length<S.length&&document.dispatchEvent(new Event(`selectionchange`)),C(t)},[a,C,S,w]),re=z.useCallback(()=>{var e;if(T.current){let t=Math.min(T.current.value.length,a-1),n=T.current.value.length;(e=T.current)==null||e.setSelectionRange(t,n),te(t),P(n)}j(!0)},[a]),ie=z.useCallback(e=>{let t=T.current;if(!f&&(!D.current.isIOS||!e.clipboardData||!t))return;let n=e.clipboardData.getData(`text/plain`),r=f?f(n):n;e.preventDefault();let i=T.current?.selectionStart,o=T.current?.selectionEnd,s=(i===o?x.slice(0,i)+r+x.slice(i):x.slice(0,i)+r+x.slice(o)).slice(0,a);if(s.length>0&&w&&!w.test(s))return;t.value=s,C(s);let c=Math.min(s.length,a-1),l=s.length;t.setSelectionRange(c,l),te(c),P(l)},[a,C,w,x]),I=z.useMemo(()=>({position:`relative`,cursor:_.disabled?`default`:`text`,userSelect:`none`,WebkitUserSelect:`none`,pointerEvents:`none`}),[_.disabled]),L=z.useMemo(()=>({position:`absolute`,inset:0,width:F.willPushPWMBadge?`calc(100% + ${F.PWM_BADGE_SPACE_WIDTH})`:`100%`,clipPath:F.willPushPWMBadge?`inset(0 ${F.PWM_BADGE_SPACE_WIDTH} 0 0)`:void 0,height:`100%`,display:`flex`,textAlign:o,opacity:`1`,color:`transparent`,pointerEvents:`all`,background:`transparent`,caretColor:`transparent`,border:`0 solid transparent`,outline:`0 solid transparent`,boxShadow:`none`,lineHeight:`1`,letterSpacing:`-.5em`,fontSize:`var(--root-height)`,fontFamily:`monospace`,fontVariantNumeric:`tabular-nums`}),[F.PWM_BADGE_SPACE_WIDTH,F.willPushPWMBadge,o]),ae=z.useMemo(()=>z.createElement(`input`,lh(ch({autoComplete:_.autoComplete||`one-time-code`},_),{"data-input-otp":!0,"data-input-otp-placeholder-shown":x.length===0||void 0,"data-input-otp-mss":M,"data-input-otp-mse":N,inputMode:l,pattern:w?.source,"aria-placeholder":c,style:L,maxLength:a,value:x,ref:T,onPaste:e=>{var t;ie(e),(t=_.onPaste)==null||t.call(_,e)},onChange:ne,onMouseOver:e=>{var t;k(!0),(t=_.onMouseOver)==null||t.call(_,e)},onMouseLeave:e=>{var t;k(!1),(t=_.onMouseLeave)==null||t.call(_,e)},onFocus:e=>{var t;re(),(t=_.onFocus)==null||t.call(_,e)},onBlur:e=>{var t;j(!1),(t=_.onBlur)==null||t.call(_,e)}})),[ne,re,ie,l,L,a,N,M,_,w?.source,x]),oe=z.useMemo(()=>({slots:Array.from({length:a}).map((e,t)=>{let n=A&&M!==null&&N!==null&&(M===N&&t===M||t>=M&&t<N),r=x[t]===void 0?null:x[t];return{char:r,placeholderChar:x[0]===void 0?c?.[t]??null:null,isActive:n,hasFakeCaret:n&&r===null}}),isFocused:A,isHovering:!_.disabled&&ee}),[A,ee,a,N,M,_.disabled,x]),se=z.useMemo(()=>h?h(oe):z.createElement(vh.Provider,{value:oe},g),[g,oe,h]);return z.createElement(z.Fragment,null,m!==null&&z.createElement(`noscript`,null,z.createElement(`style`,null,m)),z.createElement(`div`,{ref:E,"data-input-otp-container":!0,style:I,className:p},se,z.createElement(`div`,{style:{position:`absolute`,inset:0,pointerEvents:`none`}},ae)))});yh.displayName=`Input`;function bh(e,t){try{e.insertRule(t)}catch{console.error(`input-otp could not insert CSS rule:`,t)}}var xh=`
99
- [data-input-otp] {
100
- --nojs-bg: white !important;
101
- --nojs-fg: black !important;
102
-
103
- background-color: var(--nojs-bg) !important;
104
- color: var(--nojs-fg) !important;
105
- caret-color: var(--nojs-fg) !important;
106
- letter-spacing: .25em !important;
107
- text-align: center !important;
108
- border: 1px solid var(--nojs-fg) !important;
109
- border-radius: 4px !important;
110
- width: 100% !important;
111
- }
112
- @media (prefers-color-scheme: dark) {
113
- [data-input-otp] {
114
- --nojs-bg: black !important;
115
- --nojs-fg: white !important;
116
- }
117
- }`,Sh=`^\\d+$`;function Ch({char:e,hasFakeCaret:t,isActive:n}){return(0,K.jsxs)(`div`,{className:x(`relative flex h-lt-control-md w-10 items-center justify-center border-y border-r border-lt-input text-base shadow-lt-xs transition-all first:rounded-l-lt-sm first:border-l last:rounded-r-lt-sm`,n&&`z-10 border-lt-ring ring-lt-ring/50 ring-[length:var(--lt-ring-width)]`),children:[e,t?(0,K.jsx)(`div`,{className:`pointer-events-none absolute inset-0 flex items-center justify-center`,children:(0,K.jsx)(`div`,{className:`bg-lt-fg h-5 w-px animate-pulse`})}):null]})}function wh({length:e,containerClassName:t,pattern:n=Sh,...r}){return(0,K.jsx)(yh,{maxLength:e,pattern:n,containerClassName:x(`flex items-center gap-2 has-[:disabled]:opacity-50`,t),render:({slots:e})=>(0,K.jsx)(`div`,{className:`flex items-center`,children:e.map((e,t)=>(0,K.jsx)(Ch,{...e},t))}),...r})}var Th=({node:e})=>{let t=e.props;return(0,K.jsx)(Tm,{node:e,label:t.label??``,children:({name:e,testId:n,value:r,readOnly:i,disabled:a,commit:o},s)=>(0,K.jsx)(wh,{...s,autoFocus:t.autoFocus??!1,"data-test":n,disabled:a||i,length:t.length,name:e,onChange:e=>o(e),value:r})})};function Eh({className:e,ref:t,...n}){let[r,i]=(0,z.useState)(!1);return(0,K.jsxs)(`div`,{className:`relative`,children:[(0,K.jsx)(rn,{type:r?`text`:`password`,className:x(`pr-10`,e),ref:t,...n}),(0,K.jsx)(`button`,{type:`button`,"data-test":typeof n.name==`string`?`${n.name}-visibility`:`password-visibility`,onClick:()=>i(e=>!e),className:`absolute inset-y-0 right-0 flex items-center rounded-r-lt-sm px-3 text-lt-muted-fg hover:text-lt-fg focus-visible:ring-[length:var(--lt-ring-width)] focus-visible:ring-lt-ring/50 focus-visible:outline-none`,"aria-label":r?`Hide password`:`Show password`,tabIndex:-1,children:r?(0,K.jsx)(y,{name:`eye-off`,className:`size-lt-icon-md`}):(0,K.jsx)(y,{name:`eye`,className:`size-lt-icon-md`})})]})}var Dh=({node:e})=>{let t=e.props,{errors:n}=ot(),r=gm(e),{commit:i}=_e(),a=De(),o=t.confirmation,s=o?.name??`${r.localName}_confirmation`,c=a?a.scopedName(s):s,l=a?a.errorKey(s):s,u=(t.passwordRules??``)||void 0;return r.hidden?null:(0,K.jsxs)(`div`,{className:`grid gap-6`,children:[(0,K.jsx)(at,{error:r.error,helperText:t.helperText??void 0,tooltip:t.tooltip??void 0,label:t.label??``,labelAction:Ut(t.labelAction),id:r.name,required:r.required,children:e=>(0,K.jsx)(Gm,{prefix:t.prefix,suffix:t.suffix,children:n=>(0,K.jsx)(Eh,{...e,autoComplete:t.autoComplete??``,autoFocus:t.autoFocus??!1,className:n,"data-test":r.testId,disabled:r.disabled,name:r.name,onChange:e=>{r.commit(e.target.value)},placeholder:t.placeholder??``,passwordrules:u,readOnly:r.readOnly,tabIndex:t.tabIndex??void 0,value:r.value})})}),o&&(0,K.jsx)(at,{error:n[l],label:o.label??`Confirm password`,id:c,required:r.required,children:e=>(0,K.jsx)(Eh,{...e,autoComplete:`new-password`,"data-test":Zl(s),disabled:r.disabled,name:c,onChange:e=>{i(s,e.target.value)},placeholder:o.placeholder??o.label??`Confirm password`,passwordrules:u,readOnly:r.readOnly,tabIndex:t.tabIndex??void 0})})]})},Oh=[],kh=({node:e})=>{let t=e.props,n=t.name,{errors:r}=ot(),{hidden:i,required:a}=nt(e),{path:o,rows:s,onField:c,onRemove:l,onMove:u,onDuplicate:d,append:f}=fm(n,t.defaultItems??1),p=e.schema??Oh,m=dm(s.map(e=>String(e.rowId??``)).join(`,`)),h=t.maxItems!=null&&s.length>=t.maxItems,g=t.minItems!=null&&s.length<=t.minItems,_=t.layout===`table`,v=t.layout===`grid`,b=t.itemLabels,x=e=>{let n=b?.[e];return typeof n==`string`&&n!==``?n:t.itemLabel?`${t.itemLabel} ${e+1}`:`#${e+1}`};if(i)return null;let S=s.map((e,t)=>({key:String(e.rowId??t),index:t,row:e,template:p,span:!1,heading:x(t)}));return(0,K.jsx)(at,{error:r[o],helperText:t.helperText??void 0,tooltip:t.tooltip??void 0,labelAction:Ut(t.labelAction),label:t.label??``,id:o,required:a,children:e=>(0,K.jsxs)(`div`,{...e,className:`flex flex-col gap-3`,role:`group`,children:[(0,K.jsx)(Op,{path:o,rows:s,rowKey:xe}),_?(0,K.jsx)(cm,{base:o,columns:om(p),rows:S,reorderable:t.reorderable??!1,removable:()=>!g,rowActions:t.rowActions,onField:c,onMove:u,onRemove:l,onDuplicate:d,registerRow:m,resizableColumns:t.resizableColumns===!0,resizeIndicator:t.resizeIndicator===!0}):(0,K.jsx)(`div`,{className:v?`grid gap-3`:`flex flex-col gap-3`,"data-test":v?`repeater-${n}-grid`:void 0,style:v?{gridTemplateColumns:`repeat(${t.gridColumns??2}, minmax(0, 1fr))`}:void 0,children:s.map((e,n)=>{let r=String(e.rowId??n);return(0,K.jsx)(`div`,{ref:e=>m(r,e),"data-flip-key":r,children:(0,K.jsx)(Ap,{base:o,index:n,row:e,template:p,heading:x(n),reorderable:t.reorderable??!1,isFirst:n===0,isLast:n===s.length-1,removable:!g,rowActions:t.rowActions,onField:c,onRemove:l,onMove:u,onDuplicate:d})},r)})}),!h&&(0,K.jsxs)(`button`,{type:`button`,"data-test":`repeater-${n}-add`,className:`inline-flex items-center gap-1.5 self-start rounded-lt-sm border border-lt-border px-3 py-1.5 text-sm hover:bg-lt-accent [&_svg]:size-lt-icon-sm`,onClick:()=>f({}),children:[(0,K.jsx)(y,{name:`plus`}),t.addLabel??`Add`]})]})})},Ah=({node:e})=>{let t=e.props,{errors:n}=ot(),{hidden:r,required:i}=nt(e),a=De(),o=Zm(t.name),s=a?a.errorKey(t.name):t.name;return r?null:(0,K.jsx)(at,{error:n[s],helperText:t.helperText??void 0,tooltip:t.tooltip??void 0,labelAction:Ut(t.labelAction),label:t.label??``,id:o,required:i,children:t=>(0,K.jsx)(Xm,{controlProps:t,node:e})})};function jh({className:e,...t}){return(0,K.jsx)(`textarea`,{"data-slot":`textarea`,"aria-readonly":t.readOnly&&!t.disabled?!0:void 0,className:x(`border-lt-input placeholder:text-lt-muted-fg flex field-sizing-content min-h-16 w-full rounded-lt-sm border bg-transparent px-3 py-2 text-base shadow-lt-xs transition-[color,box-shadow] outline-none aria-readonly:cursor-default aria-readonly:bg-lt-muted disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-lt-disabled disabled:text-lt-disabled-fg`,tn,`aria-invalid:ring-lt-danger/20 dark:aria-invalid:ring-lt-danger/40 aria-invalid:border-lt-danger`,e),...t})}var Mh=({node:e})=>{let t=e.props;return(0,K.jsx)(Tm,{node:e,label:t.label??``,children:({name:e,testId:n,value:r,readOnly:i,disabled:a,commit:o},s)=>(0,K.jsx)(jh,{...s,autoFocus:t.autoFocus??!1,"data-test":n,disabled:a,name:e,onChange:e=>o(e.target.value),placeholder:t.placeholder??``,readOnly:i,rows:t.rows??void 0,tabIndex:t.tabIndex??void 0,value:r})})};async function Nh(e){if(!navigator?.clipboard)return!1;try{return await navigator.clipboard.writeText(e),!0}catch{return!1}}function Ph({value:e,label:t,testId:n,className:r,iconOnly:i=!1,children:a}){let{t:o}=N(F),[s,c]=(0,z.useState)(!1);(0,z.useEffect)(()=>{if(!s)return;let e=window.setTimeout(()=>c(!1),1500);return()=>window.clearTimeout(e)},[s]);async function l(){await Nh(e)&&c(!0)}let u=s?o(`common.copied-value`,`Copied {{label}}`,{label:t}):o(`common.copy-value`,`Copy {{label}}`,{label:t});return i?(0,K.jsx)(Lf,{icon:s?`check`:`copy`,label:u,"data-test":n,className:r,onClick:()=>void l()}):(0,K.jsx)(q,{type:`button`,size:`sm`,emphasis:`outline`,icon:s?`check`:`copy`,"data-test":n,className:r,"aria-label":u,onClick:()=>void l(),children:s?o(`common.copied`,`Copied`):a??o(`common.copy`,`Copy`)})}function Fh({value:e,label:t,testId:n,children:r}){return(0,K.jsxs)(`div`,{className:`inline-flex items-center gap-2`,children:[r??e,(0,K.jsx)(Ph,{value:e,label:t,testId:n})]})}var Ih=({node:e})=>{let t=e.props,n=Qm(e,t.prefixFieldName),r=Qm(e,t.suffixFieldName);return(0,K.jsx)(Tm,{node:e,label:t.label??``,children:({name:e,testId:i,value:a,readOnly:o,disabled:s,commit:c},l)=>(0,K.jsx)(Gm,{prefix:n?null:t.prefix,suffix:r?null:t.suffix,start:n?(0,K.jsx)($m,{node:n,side:`start`}):void 0,end:r||t.copyable?(0,K.jsxs)(K.Fragment,{children:[r?(0,K.jsx)($m,{node:r,side:`end`,last:!t.copyable}):null,t.copyable?(0,K.jsx)(Ph,{className:`h-lt-control-md gap-1.5 rounded-l-none rounded-r-lt-sm border-l-0 border-lt-input px-3 group-has-[:focus-visible]:border-lt-ring`,label:t.label??e,testId:`${i}-copy`,value:a}):null]}):null,children:n=>(0,K.jsx)(rn,{...l,autoComplete:t.autoComplete??``,autoFocus:t.autoFocus??!1,className:n,"data-test":i,disabled:s,name:e,onChange:e=>c(e.target.value),placeholder:t.placeholder??``,readOnly:o,tabIndex:t.tabIndex??void 0,type:t.type??`text`,value:a})})})},Lh=/^(\d{1,2}):(\d{2})(?::(\d{2}))?$/;function Rh(e){if(typeof e!=`string`)return null;let t=Lh.exec(e.trim());if(!t)return null;let n=Number(t[1]),r=Number(t[2]),i=t[3]?Number(t[3]):0;return n>23||r>59||i>59?null:{hour:n,minute:r,second:i}}function zh(e,t){let n=[Kh(e.hour),Kh(e.minute)];return t&&n.push(Kh(e.second)),n.join(`:`)}function Bh(e){return e!=null&&e<60}function Vh(e,t={}){let{min:n,max:r,current:i}=t,a=Uh(n),o=Uh(r),s=e==null||e<60?1:e%60==0?e/60:1;return{hours:Gh(0,23,1).map(e=>({value:e,label:Kh(e),disabled:a!=null&&e<a.hour||o!=null&&e>o.hour})),minutes:Wh(Gh(0,59,s),i?.minute).map(e=>({value:e,label:Kh(e),disabled:Hh(e,i,a,o)})),seconds:Bh(e)?Gh(0,59,1).map(e=>({value:e,label:Kh(e),disabled:!1})):null}}function Hh(e,t,n,r){return t?n!=null&&t.hour===n.hour&&e<n.minute||r!=null&&t.hour===r.hour&&e>r.minute:!1}function Uh(e){let t=Rh(e);return t?{hour:t.hour,minute:t.minute}:null}function Wh(e,t){return t==null||e.includes(t)?e:[...e,t].sort((e,t)=>e-t)}function Gh(e,t,n){let r=[];for(let i=e;i<=t;i+=n)r.push(i);return r}function Kh(e){return String(e).padStart(2,`0`)}function qh({value:e,onChange:t,step:n,min:r,max:i,disabled:a=!1,readOnly:o=!1,labels:s,testId:c}){let l=(0,z.useRef)(null),u=Vh(n,{min:r,max:i,current:e}),d=e??{hour:0,minute:0,second:0},f=!a&&!o,p=[{key:`hour`,label:s?.hour??`Hour`,options:u.hours,selected:d.hour},{key:`minute`,label:s?.minute??`Minute`,options:u.minutes,selected:d.minute},...u.seconds?[{key:`second`,label:s?.second??`Second`,options:u.seconds,selected:d.second}]:[]];function m(e){let t=l.current?.querySelectorAll(`[role="listbox"]`)?.[e];t&&(t.querySelector(`[data-active="true"]`)??t.querySelector(`[role="option"]`))?.focus()}return(0,K.jsx)(`div`,{ref:l,className:`flex gap-1`,"data-test":c,children:p.map((n,r)=>(0,K.jsx)(Jh,{label:n.label,options:n.options,selected:e?n.selected:null,disabled:!f,onSelect:e=>f&&t({...d,[n.key]:e}),onHorizontal:e=>m(r+e)},n.key))})}function Jh({label:e,options:t,selected:n,disabled:r,onSelect:i,onHorizontal:a}){let o=(0,z.useRef)(null),s=t.filter(e=>!e.disabled).map(e=>e.value),c=n??s[0]??t[0]?.value??0;(0,z.useEffect)(()=>{(o.current?.querySelector(`[data-active="true"]`))?.scrollIntoView?.({block:`nearest`})},[n]);function l(e){e!=null&&(o.current?.querySelector(`[data-value="${e}"]`)?.focus(),i(e))}function u(e){if(r)return;let t=s.indexOf(c);switch(e.key){case`ArrowDown`:e.preventDefault(),l(s[Math.min(t+1,s.length-1)]);break;case`ArrowUp`:e.preventDefault(),l(s[Math.max(t-1,0)]);break;case`Home`:e.preventDefault(),l(s[0]);break;case`End`:e.preventDefault(),l(s[s.length-1]);break;case`ArrowRight`:e.preventDefault(),a(1);break;case`ArrowLeft`:e.preventDefault(),a(-1)}}return(0,K.jsx)(`div`,{ref:o,role:`listbox`,"aria-label":e,"aria-orientation":`vertical`,tabIndex:-1,className:`flex max-h-40 w-14 flex-col overflow-y-auto`,onKeyDown:u,children:t.map(t=>{let a=n===t.value;return(0,K.jsx)(`button`,{type:`button`,role:`option`,"aria-selected":a,"aria-label":`${e} ${t.label}`,"data-value":t.value,"data-active":c===t.value,disabled:r||t.disabled,tabIndex:c===t.value?0:-1,onClick:()=>i(t.value),className:x(`shrink-0 rounded-lt-sm px-2 py-1 text-sm text-lt-fg hover:bg-lt-muted`,a&&`bg-lt-primary text-lt-primary-fg`,(r||t.disabled)&&`cursor-not-allowed opacity-40`),children:t.label},t.value)})})}var Yh=({node:e})=>{let t=e.props,n=Bh(t.step),r=t.label??t.name;return(0,K.jsx)(Tm,{node:e,label:t.label??``,children:({name:e,testId:i,value:a,readOnly:o,disabled:s,commit:c,blur:l},u)=>(0,K.jsxs)(`div`,{className:`flex gap-2`,children:[(0,K.jsx)(rn,{...u,"aria-label":r,autoFocus:t.autoFocus??!1,"data-test":i,disabled:s,name:e,onBlur:()=>{let e=Rh(a);e&&c(zh(e,n)),l()},onChange:e=>c(e.target.value),readOnly:o,tabIndex:t.tabIndex??void 0,type:`text`,value:a}),(0,K.jsxs)(Qt,{children:[(0,K.jsx)(Fe,{asChild:!0,children:(0,K.jsx)(q,{"aria-label":`Open ${r} time picker`,disabled:s||o,size:`icon`,type:`button`,variant:`secondary`,children:(0,K.jsx)(y,{name:`clock`,className:`size-lt-icon-md`,"aria-hidden":`true`})})}),(0,K.jsx)(Yt,{className:`p-2`,children:(0,K.jsx)(qh,{value:Rh(a),onChange:e=>c(zh(e,n)),step:t.step,min:t.min,max:t.max,disabled:s,readOnly:o,testId:`${i}-picker`})})]})]})})};function Xh({checked:e,className:t,onCheckedChange:n,...r}){return(0,K.jsx)(`button`,{...r,"aria-checked":e,className:x(`inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border border-transparent bg-lt-muted p-0.5 shadow-lt-xs transition-colors outline-none focus-visible:border-lt-ring focus-visible:ring-[length:var(--lt-ring-width)] focus-visible:ring-lt-ring/50 aria-readonly:cursor-default disabled:cursor-not-allowed disabled:bg-lt-disabled data-[state=checked]:bg-lt-primary disabled:data-[state=checked]:bg-lt-disabled`,t),"data-state":e?`checked`:`unchecked`,onClick:()=>n?.(!e),role:`switch`,type:`button`,children:(0,K.jsx)(`span`,{className:`size-5 rounded-full bg-lt-bg shadow-lt-sm transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0`,"data-state":e?`checked`:`unchecked`})})}var Zh=({node:e})=>{let t=e.props;return _m(t.name,Tt(t.value)),(0,K.jsx)(Tm,{node:e,label:t.label??``,children:({name:e,testId:n,rawValue:r,readOnly:i,disabled:a,commit:o},s)=>{let c=Tt(r);return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`input`,{disabled:i||a,name:e,type:`hidden`,value:c?`1`:`0`}),(0,K.jsx)(Xh,{...s,"aria-label":t.label??t.name,"aria-readonly":i&&!a?!0:void 0,autoFocus:t.autoFocus??!1,checked:c,"data-test":n,disabled:a,name:e,onCheckedChange:e=>{i||o(e)},tabIndex:t.tabIndex??void 0})]})}})};function Qh(e){let t=[],n=e=>{let r=Ce(e).name;if(r&&t.push(r),!(r&&Ge(e)))for(let t of e.schema??[])n(t)};for(let t of e.schema??[])n(t);return t}function $h(e){let t=[],n=e=>{let r=Ce(e).name;if(r&&t.push(r,`${r}.*`),r&&Ge(e)){for(let n of Qh(e))t.push(`${r}.*.${n}`);return}for(let t of e.schema??[])n(t)};for(let t of e.schema??[])n(t);return t}function eg(e,t){let n=Object.keys(t).filter(e=>!!t[e]),r=new Set;return e.forEach((e,t)=>{n.some(t=>e.some(e=>nf(t,e)))&&r.add(t)}),r}function tg(e,t){let n=eg(e,t);return n.size>0?Math.min(...n):null}var ng={center:`justify-center`,end:`justify-end`,start:`justify-start`,stretch:`justify-stretch`},rg=(0,z.createContext)({activeName:``});function ig(e){let t=(e.schema??[]).filter(e=>e.type===`wizard-step`);return{items:t.map(e=>e.props),nodes:t}}var ag=({children:e,node:t})=>{let{t:n}=N(`lattice`),{errors:r,processing:i,touch:a,validateFields:o,validating:s}=ot(),{items:c,nodes:l}=(0,z.useMemo)(()=>ig(t),[t]),u=(0,z.useMemo)(()=>l.map(e=>Qh(e)),[l]),d=t.props.orientation===`vertical`,[f,p]=(0,z.useState)(0),[m,h]=(0,z.useState)(()=>new Set([0])),[g,_]=(0,z.useState)(()=>new Set),v=(0,z.useMemo)(()=>eg(u,r),[u,r]),b=f===c.length-1,S=e=>{p(e),h(t=>new Set(t).add(e))},C=()=>{_(e=>new Set(e).add(f)),b||S(f+1)},w=()=>{let e=l[f],t=e?$h(e):[];if(t.length===0){C();return}a(t),o(t,{onSuccess:C})},T=(0,z.useRef)(!1);(0,z.useEffect)(()=>{if(T.current&&!i){let e=tg(u,r);e!==null&&e!==f&&S(e)}T.current=i},[i,r,u,f]);let E=(0,z.useMemo)(()=>({activeName:c[f]?.name??``}),[c,f]);return(0,K.jsx)(rg.Provider,{value:E,children:(0,K.jsxs)(`div`,{className:x(`gap-6`,d?`flex`:`grid`),"data-slot":`wizard`,children:[(0,K.jsx)(`ol`,{"aria-label":n(`form.wizard.steps`,`Steps`),className:x(`gap-1`,d?`flex w-56 shrink-0 flex-col`:`flex flex-wrap`,!d&&ng[t.props.align??`start`]),children:c.map((e,t)=>{let n=t===f,r=g.has(t),i=v.has(t);return(0,K.jsx)(`li`,{children:(0,K.jsxs)(`button`,{"aria-current":n?`step`:void 0,className:x(`flex w-full items-center gap-2 rounded-lt px-3 py-2 text-left text-sm`,n?`bg-lt-muted font-medium text-lt-fg`:`text-lt-muted-fg`,!m.has(t)&&`cursor-not-allowed opacity-60`),"data-error":i||void 0,"data-test":`wizard-rail-${e.name}`,disabled:!m.has(t),id:`wizard-step-${e.name}-trigger`,onClick:()=>S(t),type:`button`,children:[(0,K.jsx)(`span`,{className:x(`flex size-5 shrink-0 items-center justify-center rounded-full border text-xs`,i?`border-lt-danger text-lt-danger`:r?`border-lt-primary bg-lt-primary text-lt-primary-fg`:`border-lt-border`),children:r&&!i?(0,K.jsx)(y,{className:`size-lt-icon-sm`,name:`check`}):t+1}),(0,K.jsxs)(`span`,{className:`min-w-0`,children:[(0,K.jsx)(`span`,{className:`block truncate`,children:e.label}),d&&e.description&&(0,K.jsx)(`span`,{className:`block truncate text-xs text-lt-muted-fg`,children:e.description})]})]})},e.name)})}),(0,K.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-6`,children:[e,(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,K.jsx)(q,{"data-test":`wizard-back`,disabled:f===0||i,onClick:()=>S(f-1),type:`button`,emphasis:`outline`,children:n(`form.wizard.back`,`Back`)}),b?(0,K.jsxs)(q,{"data-test":`wizard-finish`,disabled:i,type:`submit`,children:[i&&(0,K.jsx)(Xl,{}),n(`form.wizard.finish`,`Finish`)]}):(0,K.jsxs)(q,{"data-test":`wizard-next`,disabled:i||s,onClick:w,type:`button`,children:[s&&(0,K.jsx)(Xl,{}),n(`form.wizard.next`,`Next`)]})]})]})]})})},og=({children:e,node:t})=>{let{activeName:n}=(0,z.useContext)(rg),r=t.props.name,i=n===r,[a,o]=(0,z.useState)(i);return(0,z.useEffect)(()=>{i&&o(!0)},[i]),(0,K.jsx)(`section`,{"aria-labelledby":`wizard-step-${r}-trigger`,className:x(`space-y-8`,!i&&`hidden`),hidden:!i,id:`wizard-step-${r}-panel`,children:a?e:null})},sg=(0,z.lazy)(()=>fn(()=>import(`./pattern-input-view-dTVbJbc_.js`),__vite__mapDeps([9,1,2,5,6,7,10,4,11,12,3,13,14,15,8,16]),import.meta.url)),cg=({children:e,node:t})=>(0,K.jsx)(z.Suspense,{fallback:null,children:(0,K.jsx)(sg,{node:t,children:e})}),lg=(0,z.lazy)(()=>fn(()=>import(`./rich-editor-view-CVY3bSw7.js`),__vite__mapDeps([17,1,2,5,13,6,7,10,4,11,12,3,14,15,16]),import.meta.url)),ug={components:{form:B(Bm),"field.builder":B(mm),"field.checkbox":B(vm),"field.choice":B(wm),"field.color-picker":B(Em),"field.date-input":B(km),"field.date-time-input":B(Am),"field.file-upload":B(Pm),"field.hidden-input":B(Um),"field.number-input":B(eh),"field.otp":B(Th),"field.password-input":B(Dh),"field.pattern-input":B(cg),"field.repeater":B(kh),"field.rich-editor":B(({children:e,node:t})=>(0,K.jsx)(z.Suspense,{fallback:null,children:(0,K.jsx)(lg,{node:t,children:e})})),"field.select":B(Ah),"field.textarea":B(Mh),"field.text-input":B(Ih),"field.time-input":B(Yh),"field.toggle":B(Zh),wizard:B(ag),"wizard-step":B(og)},name:`lattice/form`},dg={lg:320,md:64,sm:40,xl:384,xs:32,"2xl":448,"3xl":512,"4xl":576},fg={components:{fragment:B(({node:e})=>{let t=e.props.endpoint??``,n=e.props.lazy===!0,r=e.props.ref??``,i=dg[e.props.size],[a,o]=(0,z.useState)(()=>e.schema??[]),[s,c]=(0,z.useState)(!n),[l,u]=(0,z.useState)(n&&t!==``),f=(0,z.useCallback)(async()=>{if(t){u(!0);try{let e=await Z(t,{ref:r});o(Kt(e.schema)),c(!0)}finally{u(!1)}}},[t,r]);return(0,z.useEffect)(()=>{!n||s||f()},[s,n,f]),(0,z.useEffect)(()=>{function t(t){t.detail?.component===e.id&&f()}return window.addEventListener(d.reloadComponent,t),()=>window.removeEventListener(d.reloadComponent,t)},[f,e.id]),(0,z.useEffect)(()=>{function e(){s&&f()}return window.addEventListener(d.localeChange,e),()=>window.removeEventListener(d.localeChange,e)},[s,f]),(0,K.jsx)(`div`,{"data-lattice-fragment":e.id,style:l&&a.length===0?{minHeight:i}:void 0,children:l&&a.length===0?(0,K.jsx)(Bd,{className:`w-full`,style:{height:i}}):(0,K.jsx)($e,{nodes:a})})})},name:`lattice/fragments`},pg=(0,z.createContext)(null);function mg({outlet:e,children:t}){return(0,K.jsx)(pg.Provider,{value:e,children:t})}function hg(){return(0,z.useContext)(pg)}var gg={components:{outlet:B(()=>(0,K.jsx)(K.Fragment,{children:hg()}))},name:`lattice/layout`};function _g(e,t=1){return Z(`${e}?page=${t}`)}function vg(e,t){return Z(`${e}/${t}/read`,{method:`PATCH`})}function yg(e){return Z(`${e}/read-all`,{method:`POST`})}function bg(e,t){return Z(`${e}/${t}`,{method:`DELETE`})}function xg(e){return Z(e,{method:`DELETE`})}function Sg(e,t){return e.some(e=>e.id===t.id)?e:[t,...e]}function Cg(e,t){return e.map(e=>e.id===t?{...e,isRead:!0}:e)}function wg(e,t){return e.filter(e=>e.id!==t)}function Tg({endpoint:e,pollingInterval:t}){let[n,r]=(0,z.useState)([]),[i,a]=(0,z.useState)(0),[o,s]=(0,z.useState)(`loading`),[c,l]=(0,z.useState)(!1),[u,d]=(0,z.useState)(!1),f=(0,z.useRef)(1),p=(0,z.useRef)(c);p.current=c;let m=(0,z.useRef)(!1),h=(0,z.useCallback)(async()=>{try{let t=await _g(e,1);f.current=1,r(t.notifications),a(t.unreadCount),l(t.hasMore),s(`idle`)}catch{s(`error`)}},[e]);return(0,z.useEffect)(()=>{h()},[h]),(0,z.useEffect)(()=>{if(!t||t<=0)return;let e=setInterval(()=>void h(),t*1e3);return()=>clearInterval(e)},[h,t]),{notifications:n,unreadCount:i,status:o,hasMore:c,open:u,setOpen:d,loadMore:(0,z.useCallback)(()=>{if(m.current||!p.current)return;m.current=!0;let t=f.current+1;_g(e,t).then(e=>{f.current=t,r(t=>[...t,...e.notifications]),l(e.hasMore)}).catch(()=>void h()).finally(()=>{m.current=!1})},[e,h]),markRead:(0,z.useCallback)(t=>{r(e=>Cg(e,t)),a(e=>Math.max(0,e-1)),vg(e,t).then(e=>a(e.unreadCount)).catch(()=>void h())},[e,h]),markAllRead:(0,z.useCallback)(()=>{r(e=>e.map(e=>({...e,isRead:!0}))),a(0),yg(e).then(e=>a(e.unreadCount)).catch(()=>void h())},[e,h]),dismiss:(0,z.useCallback)(t=>{r(e=>wg(e,t)),bg(e,t).then(e=>a(e.unreadCount)).catch(()=>void h())},[e,h]),clearAll:(0,z.useCallback)(()=>{r([]),a(0),xg(e).then(e=>a(e.unreadCount)).catch(()=>void h())},[e,h]),receive:(0,z.useCallback)(e=>{r(t=>{let n=Sg(t,e);return n!==t&&a(e=>e+1),n})},[])}}function Eg(e){let t=e,n=new Set;return{publish(e){t=e,n.forEach(e=>e())},subscribe(e){return n.add(e),()=>n.delete(e)},getSnapshot:()=>t}}var Dg=(0,z.createContext)(null),Og=Dg.Provider;function kg(){let e=(0,z.useContext)(Dg);if(!e)throw Error(`useLiveNotifications must be used within a NotificationsBridgeProvider.`);return(0,z.useSyncExternalStore)(e.subscribe,e.getSnapshot)}function Ag(){let{t:e}=N(`lattice`);return(0,K.jsxs)(`div`,{className:`flex flex-col items-center gap-2 px-4 py-10 text-lt-muted-fg`,children:[(0,K.jsx)(y,{name:`bell`,className:`size-lt-icon-lg`}),(0,K.jsx)(`p`,{className:`text-sm`,children:e(`notifications.empty`,`No notifications yet`)})]})}function jg(e){return typeof e==`object`&&!!e&&typeof e.key==`string`}function Mg(e,t){return t.split(`.`).reduce((e,t)=>{if(typeof e==`object`&&e)return e[t]},e)}function Ng(e,t){return jg(e)?Pg(e,{},t):e}function Pg(e,t,n){let r={};for(let[n,i]of Object.entries(e.payload)){let e=Mg(t,i);r[n]=e===void 0?``:e}return n(e.key,e.key,{...e.replacements,...r})}var Fg={primary:`text-lt-primary`,secondary:`text-lt-muted-fg`,success:`text-lt-success`,info:`text-lt-info`,warning:`text-lt-warning`,danger:`text-lt-danger`};function Ig({notification:e,onMarkRead:t,onDismiss:n}){let{t:r}=N(`lattice`),i=Ng(e.title,r),a=Ng(e.body,r),o=(0,K.jsxs)(K.Fragment,{children:[i?(0,K.jsx)(`p`,{className:`truncate text-sm font-medium text-lt-fg`,children:i}):null,a?(0,K.jsx)(`p`,{className:`text-sm text-lt-muted-fg`,children:a}):null]});return(0,K.jsxs)(`li`,{className:x(`flex gap-3 px-3 py-3`,!e.isRead&&`bg-lt-muted/40`),"data-test":`notification`,children:[e.icon?(0,K.jsx)(nl,{icon:e.icon,className:x(`mt-0.5 size-lt-icon-md`,e.variant?Fg[e.variant]:void 0)}):null,(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[e.href?(0,K.jsx)(Ic,{href:e.href,className:`block`,"data-test":`notification-link`,onClick:()=>t(e.id),children:o}):o,e.actions.length>0?(0,K.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-2`,children:e.actions.map((e,t)=>(0,K.jsx)(Zt,{node:e},e.key??e.id??`action-${t}`))}):null]}),(0,K.jsxs)(`div`,{className:`flex shrink-0 flex-col gap-1`,children:[e.isRead?null:(0,K.jsx)(`button`,{type:`button`,className:`text-xs text-lt-muted-fg hover:text-lt-fg`,onClick:()=>t(e.id),children:r(`notifications.mark-read`,`Mark read`)}),(0,K.jsx)(`button`,{type:`button`,"aria-label":r(`notifications.dismiss`,`Dismiss`),className:`text-xs text-lt-muted-fg hover:text-lt-fg`,onClick:()=>n(e.id),children:r(`notifications.dismiss`,`Dismiss`)})]})]})}function Lg({notifications:e,status:t,hasMore:n,onMarkRead:r,onDismiss:i,onLoadMore:a}){let{t:o}=N(`lattice`);return t===`loading`&&e.length===0?(0,K.jsxs)(`div`,{className:`space-y-2 p-3`,children:[(0,K.jsx)(Bd,{className:`h-12 w-full`}),(0,K.jsx)(Bd,{className:`h-12 w-full`}),(0,K.jsx)(Bd,{className:`h-12 w-full`})]}):e.length===0?(0,K.jsx)(Ag,{}):(0,K.jsxs)(`div`,{className:`max-h-96 overflow-y-auto`,children:[(0,K.jsx)(`ul`,{className:`divide-y divide-lt-border`,children:e.map(e=>(0,K.jsx)(Ig,{notification:e,onMarkRead:r,onDismiss:i},e.id))}),n?(0,K.jsx)(`button`,{type:`button`,className:`w-full py-2 text-sm text-lt-muted-fg hover:text-lt-fg`,onClick:a,children:o(`notifications.load-more`,`Load more`)}):null]})}function Rg({onClosed:e}){let t=fu();if(!t)throw Error(uu);let n=kg(),{t:r}=N(`lattice`),i=r(`notifications.label`,`Notifications`),a=r(`notifications.heading`,`Notifications`);return(0,K.jsx)(Ad,{open:t.open,onOpenChange:t.onOpenChange,children:(0,K.jsxs)(Pd,{"aria-describedby":void 0,className:`p-0`,onCloseAutoFocus:n=>{t.onExited(n),e()},placement:`end`,width:`sm`,children:[(0,K.jsx)($,{className:`sr-only`,children:i}),(0,K.jsxs)(`div`,{className:`w-full`,"data-test":`notifications-panel`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between border-b border-lt-border px-3 py-2`,children:[(0,K.jsx)(`span`,{className:`text-sm font-medium`,children:a}),n.unreadCount>0?(0,K.jsx)(`button`,{type:`button`,className:`text-xs text-lt-muted-fg hover:text-lt-fg`,onClick:n.markAllRead,children:r(`notifications.mark-all-read`,`Mark all read`)}):null]}),(0,K.jsx)(Lg,{notifications:n.notifications,status:n.status,hasMore:n.hasMore,onMarkRead:n.markRead,onDismiss:n.dismiss,onLoadMore:n.loadMore})]})]})})}var zg=(0,z.lazy)(()=>fn(()=>import(`./notifications-echo-BLO9_g1w.js`).then(e=>({default:e.NotificationsEcho})),__vite__mapDeps([18,19,1,2]),import.meta.url)),Bg=class extends z.Component{state={failed:!1};static getDerivedStateFromError(){return{failed:!0}}componentDidCatch(){console.warn(`[lattice] The notifications bell declares a realtime channel but Echo is unavailable. Install @laravel/echo-react and call configureEcho().`)}render(){return this.state.failed?null:this.props.children}},Vg={name:`lattice/notifications`,components:{notifications:B(({node:e})=>{let{t}=N(`lattice`),n=Tg({endpoint:e.props.endpoint,pollingInterval:e.props.pollingInterval}),r=hu(),i=(0,z.useRef)(null),[a]=(0,z.useState)(()=>Eg(n));(0,z.useEffect)(()=>{a.publish(n)},[a,n]);let o=t(`notifications.label`,`Notifications`),s=(0,z.useCallback)(()=>{i.current||=r.open((0,K.jsx)(Og,{value:a,children:(0,K.jsx)(Rg,{onClosed:()=>{i.current=null}})}))},[a,r]),c=(0,K.jsxs)(`span`,{className:`relative inline-flex items-center justify-center rounded-lt-sm p-2 hover:bg-lt-muted`,children:[(0,K.jsx)(y,{name:`bell`,className:`size-lt-icon-md`}),n.unreadCount>0?(0,K.jsx)(`span`,{"data-test":`notifications-badge`,className:`absolute -right-0.5 -top-0.5 inline-flex min-w-4 items-center justify-center rounded-lt-full bg-lt-danger px-1 py-0 text-[10px] font-medium text-lt-danger-fg`,children:n.unreadCount}):null]}),l=(0,K.jsxs)(`div`,{className:`w-80`,"data-test":`notifications-panel`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between border-b border-lt-border px-3 py-2`,children:[(0,K.jsx)(`span`,{className:`text-sm font-medium`,children:t(`notifications.heading`,`Notifications`)}),n.unreadCount>0?(0,K.jsx)(`button`,{type:`button`,className:`text-xs text-lt-muted-fg hover:text-lt-fg`,onClick:n.markAllRead,children:t(`notifications.mark-all-read`,`Mark all read`)}):null]}),(0,K.jsx)(Lg,{notifications:n.notifications,status:n.status,hasMore:n.hasMore,onMarkRead:n.markRead,onDismiss:n.dismiss,onLoadMore:n.loadMore})]});return(0,K.jsxs)(K.Fragment,{children:[e.props.channel?(0,K.jsx)(Bg,{children:(0,K.jsx)(z.Suspense,{fallback:null,children:(0,K.jsx)(zg,{channel:e.props.channel,onReceive:e=>n.receive(e)})})}):null,e.props.slideOut?(0,K.jsx)(`button`,{type:`button`,"aria-label":o,"data-test":`notifications-trigger`,onClick:s,children:c}):(0,K.jsxs)(Qt,{open:n.open,onOpenChange:n.setOpen,children:[(0,K.jsx)(Fe,{asChild:!0,children:(0,K.jsx)(`button`,{type:`button`,"aria-label":o,"data-test":`notifications-trigger`,children:c})}),(0,K.jsx)(Yt,{align:`end`,className:`p-0`,children:l})]})]})})}};function Hg(e){return e==null?``:String(e)}function Ug({props:e}){let{t}=N(`lattice`),[n,r]=(0,z.useState)([]),[a,o]=(0,z.useState)(null),[s,c]=(0,z.useState)(!1);return(0,z.useEffect)(()=>{if(!e.remote||!e.dataEndpoint){r([]),c(!1);return}let t=!1;return o(null),c(!0),Zu(e.dataEndpoint,{remote:e.remote}).then(e=>{t||r(e.data??[])}).catch(e=>{t||o(e instanceof Error?e.message:String(e))}).finally(()=>{t||c(!1)}),()=>{t=!0}},[e.dataEndpoint,e.remote]),a?(0,K.jsx)(`div`,{className:`rounded-lt border border-lt-danger/40 p-3 text-sm`,children:a}):s||!e.remote?(0,K.jsx)(`div`,{className:`rounded-lt border border-lt-border p-3 text-sm`,children:t(`common.remote.data-list.loading`,`Loading...`)}):(0,K.jsxs)(`div`,{className:`rounded-lt border border-lt-border bg-lt-bg`,children:[(0,K.jsx)(`div`,{className:`border-b border-lt-border px-3 py-2 text-sm font-medium`,children:t(`common.remote.data-list.title`,`Remote data`)}),(0,K.jsxs)(`div`,{className:`divide-y divide-lt-border`,children:[n.map((t,n)=>(0,K.jsx)(`div`,{className:`px-3 py-2`,children:(0,K.jsx)($e,{nodes:i(e.schema,t)})},Hg(t.id)||n)),n.length===0?(0,K.jsx)(`div`,{className:`px-3 py-2 text-sm text-lt-muted-fg`,children:e.emptyLabel??t(`common.remote.data-list.empty`,`No data`)}):null]})]})}var Wg={components:{"remote.data-list":B(({node:e})=>(0,K.jsx)(Ug,{props:{...e.props,schema:e.schema}}))},name:`lattice/remote`};function Gg(e){return e==null||e===``}function Kg(e){return Gg(e)?!0:Array.isArray(e)?e.every(Kg):typeof e==`object`&&e?Object.values(e).every(Kg):!1}function qg(e){return!Kg(e)}function Jg(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Yg(e){return Jg(e)?e:{}}function Xg(e){return Array.isArray(e)?e.filter(e=>typeof e==`object`&&!!e&&typeof e.field==`string`&&typeof e.operator==`string`&&typeof e.value==`string`):[]}function Zg(e){return Array.isArray(e)?e.filter(e=>typeof e==`object`&&!!e&&`key`in e&&`props`in e&&typeof e.key==`string`&&typeof e.props==`object`&&e.props!==null&&typeof e.props.label==`string`):[]}function Qg(e){return Array.isArray(e)?e.filter(e=>typeof e==`object`&&!!e&&!Array.isArray(e)):[]}var $g={mode:`none`,currentPage:null,lastPage:null,perPage:null,total:null,from:null,to:null,hasMore:!1,nextPage:null};function e_(e){return typeof e!=`object`||!e||Array.isArray(e)?$g:e}function t_(e){if(typeof e!=`object`||!e||Array.isArray(e))return{filters:[],sorts:[],page:1,perPage:25,tableFilters:{},tableFilterIndicators:[],search:``,mode:null};let t=e;return{filters:Xg(t.filters),sorts:Array.isArray(t.sorts)?t.sorts:[],page:typeof t.page==`number`?t.page:1,perPage:typeof t.perPage==`number`?t.perPage:25,tableFilters:a_(t.tableFilters),tableFilterIndicators:o_(t.tableFilterIndicators),search:typeof t.search==`string`?t.search:``,mode:r_(t.mode)}}var n_=new Set([`none`,`simple`,`table`,`infinite`]);function r_(e){return typeof e==`string`&&n_.has(e)?e:null}function i_(e){return Array.isArray(e)?e.filter(e=>typeof e==`number`||e===`infinite`):[]}function a_(e){return typeof e!=`object`||!e||Array.isArray(e)?{}:Object.fromEntries(Object.entries(e).filter(e=>typeof e[1]==`object`&&e[1]!==null&&!Array.isArray(e[1])))}function o_(e){return Array.isArray(e)?e.filter(e=>typeof e==`object`&&!!e&&typeof e.filter==`string`&&typeof e.label==`string`&&typeof e.value==`string`):[]}function s_(e,t){let n=e.id??e.uuid??e.key??t;return String(n)}function c_(e){return Array.isArray(e.actions)?e.actions:[]}function l_(e){let t=e.detail;return typeof t==`object`&&t&&!Array.isArray(t)?t:null}function u_(e){return typeof e.rowUrl==`string`?e.rowUrl:null}function d_(e,t){let n=e.popovers;if(typeof n!=`object`||!n||Array.isArray(n))return null;let r=n[t];return typeof r==`object`&&r&&!Array.isArray(r)?r:null}function f_(e,t){let n=e.links;if(typeof n!=`object`||!n||Array.isArray(n))return;let r=n;if(!(t in r))return;let i=r[t];return typeof i==`string`?i:null}function p_(e,t){return e.sorts.find(e=>e.key===t.key)}function m_(e,t){let n=new URL(e,window.location.origin);return t.filters.length>0&&n.searchParams.set(`filter`,C_(t)),t.sorts.length>0&&n.searchParams.set(`sort`,w_(t)),t.search!==``&&n.searchParams.set(`q`,t.search),h_(n,t.tableFilters),n.searchParams.set(`page`,String(t.page)),n.searchParams.set(`per_page`,String(t.perPage)),t.mode!=null&&n.searchParams.set(`mode`,t.mode),`${n.pathname}${n.search}`}function h_(e,t){for(let[n,r]of Object.entries(g_(t)))y_(e,`tf[${n}]`,r)}function g_(e){let t={};for(let[n,r]of Object.entries(e)){let e=__(r);e!==void 0&&(t[n]=e)}return t}function __(e){if(Gg(e)||Array.isArray(e)||typeof e!=`object`)return;let t=Object.entries(e).map(([e,t])=>[e,v_(t)]).filter(e=>e[1]!==void 0);return t.length>0?Object.fromEntries(t):void 0}function v_(e){if(!Gg(e)){if(Array.isArray(e)){let t=e.map(v_).filter(e=>e!==void 0);return t.length>0?t:void 0}if(typeof e==`object`){if(e===null)return;let t=Object.entries(e).map(([e,t])=>[e,v_(t)]).filter(e=>e[1]!==void 0);return t.length>0?Object.fromEntries(t):void 0}return String(e)}}function y_(e,t,n){if(Array.isArray(n)){for(let r of n)y_(e,`${t}[]`,r);return}if(typeof n==`object`&&n){for(let[r,i]of Object.entries(n))y_(e,`${t}[${r}]`,i);return}e.searchParams.append(t,String(n))}async function b_(e,t,n,r,i){if(!e)return[];let a=new URL(e,window.location.origin);a.searchParams.set(`_sub`,`search`),a.searchParams.set(`_target`,n),a.searchParams.set(`_q`,r);let o=await Wu(`${a.pathname}${a.search}`,{ref:t,signal:i,throwOnError:!1});return o.ok?(await o.json()).options??[]:[]}function x_(e){let t={};e.filters.length>0&&(t.filter=C_(e)),e.sorts.length>0&&(t.sort=w_(e));let n=g_(e.tableFilters);return Object.keys(n).length>0&&(t.tf=n),e.search!==``&&(t.q=e.search),t}function S_(e,t){let n=x_(e);return e.page>1&&(n.page=e.page),e.perPage!==t&&(n.per_page=e.perPage),n}function C_(e){return e.filters.map(e=>`${e.field}:${e.operator}:${encodeURIComponent(e.value)}`).join(`,`)}function w_(e){return e.sorts.map(e=>e.direction===`desc`?`-${e.key}`:e.key).join(`,`)}var T_={contains:`contains`,starts_with:`starts with`,ends_with:`ends with`,eq:`equals`,neq:`not equals`,gt:`>`,gte:`≥`,lt:`<`,lte:`≤`,in:`in`,not_in:`not in`,before:`before`,after:`after`,empty:`is empty`,filled:`is not empty`},E_=new Set([`empty`,`filled`]);function D_(e){return ie(`lattice`,`table.operators.${e}`,T_[e]??e)}function O_(e){return e===`desc`?`descending`:`ascending`}function k_(e,t){if(!t.props.sortable)return e;let n=e.find(e=>e.key===t.key),r=e.filter(e=>e.key!==t.key);return n?n.direction===`asc`?[...r,{key:t.key,direction:`desc`}]:r:[...e,{key:t.key,direction:`asc`}]}function A_(e,t){if(t<=5)return Array.from({length:t},(e,t)=>t+1);let n=Math.max(1,Math.min(e-2,t-4));return Array.from({length:5},(e,t)=>n+t)}function j_(e,t){let n=[],r=[],i=[];for(let a of e){let e=t(a);e===`start`?n.push(a):e===`end`?i.push(a):r.push(a)}return[...n,...r,...i]}function M_(e,t){return e.map(e=>({key:e.key,label:e.props.label,pin:t?.(e)??void 0,width:N_(e)}))}function N_(e){return e.props.width??`md`}var P_=[`filter`,`sort`,`q`,`page`,`per_page`,`tf`],F_=[`q`,`tf`];function I_(e,t){if(typeof window>`u`)return;let n=new URL(window.location.href);for(let e of Array.from(n.searchParams.keys()))L_(e,t)&&n.searchParams.delete(e);for(let[r,i]of Object.entries(e))y_(n,t.key===null?r:`${t.key}[${r}]`,i);n.search!==window.location.search&&window.history.replaceState(window.history.state,``,`${n.pathname}${n.search}${n.hash}`)}function L_(e,t){return t.key===null?t.ownedKeys.some(t=>e===t||e.startsWith(`${t}[`)):e===t.key||e.startsWith(`${t.key}[`)}var R_=new Map;function z_(e,t){let n=e.key??``,r=R_.get(n)??new Set;return r.add(t),R_.set(n,r),()=>{r.delete(t),r.size===0&&R_.delete(n)}}function B_(e){let t=(0,z.useMemo)(()=>Zg(e.props?.columns),[e.props?.columns]),n=typeof e.props?.endpoint==`string`?e.props.endpoint:null,r=typeof e.props?.ref==`string`?e.props.ref:``,i=e.props?.lazy===!0,a=(0,z.useMemo)(()=>t_(e.props?.query),[e.props?.query]),o=(0,z.useMemo)(()=>Qg(e.props?.data),[e.props?.data]),s=(0,z.useMemo)(()=>e_(e.props?.pagination),[e.props?.pagination]),[c,l]=(0,z.useState)(o),[u,f]=(0,z.useState)(s),[p,m]=(0,z.useState)(a),[h,g]=(0,z.useState)(i),[_,v]=(0,z.useState)(!i),y=(0,z.useRef)(null),b=u.currentPage??p.page,x=(u.mode??`table`)===`infinite`,S=(0,z.useCallback)(async(e,t=!1)=>{if(n){g(!0);try{let i=await Z(m_(n,e),{ref:r}),a=t_(i.query),o=Qg(i.data);l(e=>t?[...e,...o]:o),f(e_(i.pagination)),m(a),v(!0)}finally{g(!1)}}},[n,r]);function C(e){S({...p,page:1,sorts:k_(p.sorts,e)})}function w(e){let t={...p,page:1,sorts:e};m(t),S(t)}function T(e){S({...p,page:1,sorts:p.sorts.filter(t=>t.key!==e.key)})}function E(e){let t={...p,filters:e,page:1};m(t),S(t)}function D(e){E([...p.filters,e])}function O(e,t){E(p.filters.map((n,r)=>r===e?t:n))}function ee(e){E(p.filters.filter((t,n)=>n!==e))}function k(e,t){E([...p.filters.filter(t=>t.field!==e),...t])}function A(e,t){let n={...p.tableFilters};Kg(t)||!Jg(t)?delete n[e]:n[e]=t;let r={...p,tableFilters:n,tableFilterIndicators:p.tableFilterIndicators.filter(t=>t.filter!==e),page:1};m(r),S(r)}function j(){let e={...p,filters:[],tableFilters:{},tableFilterIndicators:[],search:``,page:1};m(e),S(e)}function M(e){let t={...p,search:e,page:1};m(t),S(t)}let te=(0,z.useCallback)((e,t,i)=>b_(n,r,e,t,i),[n,r]);function N(e){S({...p,page:e})}function P(e){let t=s.mode??`table`,n={...p,perPage:e===`infinite`?p.perPage:e,mode:e===`infinite`?`infinite`:t===`infinite`?`table`:null,page:1};m(n),S(n)}let F=(0,z.useCallback)(()=>{h||!u.hasMore||S({...p,page:u.nextPage??b+1},!0)},[b,S,u.hasMore,u.nextPage,h,p]);(0,z.useEffect)(()=>{l(o),f(s),m(a),g(i),v(!i)},[o,s,a,i]),(0,z.useEffect)(()=>{!i||_||S(p)},[_,i,S,p]),Fl(d.reloadComponent,t=>{t.detail?.component===e.id&&S(p)});let ne=e.props?.syncQuery===!0,re=e.props?.queryKey??null;return(0,z.useEffect)(()=>{if(ne)return z_({key:re,ownedKeys:P_},r)},[r,re,ne]),(0,z.useEffect)(()=>{ne&&I_(S_(p,e.props?.defaultPerPage??25),{key:re,ownedKeys:P_})},[e.props?.defaultPerPage,p,re,ne]),(0,z.useEffect)(()=>{if(!x||!u.hasMore||h||!y.current||typeof IntersectionObserver>`u`)return;let e=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&F()},{rootMargin:`240px`});return e.observe(y.current),()=>e.disconnect()},[x,F,u.hasMore,h]),{columns:t,rows:c,pagination:u,query:p,filters:p.filters,tableFilters:p.tableFilters,search:p.search,addFilter:D,updateFilter:O,removeFilter:ee,replaceColumnFilters:k,setTableFilter:A,resetFilters:j,setSearch:M,searchFilterOptions:te,processing:h,hasLoaded:_,infiniteLoaderRef:y,sort:C,setSorts:w,clearSort:T,goToPage:N,setPerPage:P,loadMore:F}}function V_(e){let[t,n]=(0,z.useState)(()=>new Set),[r,i]=(0,z.useState)(!1),a=e.join(` `);(0,z.useEffect)(()=>{n(new Set),i(!1)},[a]);let o=(0,z.useCallback)(e=>{i(!1),n(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),s=(0,z.useCallback)(()=>{i(!1),n(t=>t.size===e.length?new Set:new Set(e))},[e]),c=(0,z.useCallback)(()=>i(!0),[]),l=(0,z.useCallback)(()=>{i(!1),n(new Set)},[]),u=e.filter(e=>t.has(e)),d=e.length>0&&u.length===e.length;return{selectedKeys:u,allMatching:r,allVisibleSelected:d,allSelected:r||d,active:r||u.length>0,isSelected:e=>r||t.has(e),toggle:o,toggleAll:s,selectAllMatching:c,clear:l}}function H_({columns:e,storageKey:t}){let n=(0,z.useMemo)(()=>e.map(e=>e.key),[e]),r=(0,z.useMemo)(()=>new Map(e.map(e=>[e.key,e])),[e]),[i,a]=Up(t??``,{},{enabled:!!t,parse:e=>G_(e,n),serialize:e=>K_(e,n)}),o=(0,z.useCallback)(e=>e.props.pinned??null,[]),s=(0,z.useCallback)(e=>{let t=i[e.key];return t===void 0?o(e):t===!1?null:t},[i,o]),c=(0,z.useCallback)((e,t)=>{a(n=>{let i=r.get(e),a=i?o(i):null,s={...n};return t===a?delete s[e]:s[e]=t!==null&&t,s})},[r,o,a]),l=(0,z.useCallback)(()=>a({}),[a]);return{hasPinOverrides:Object.keys(i).length>0,pinFor:s,resetPins:l,setColumnPin:c}}function U_(e){return e===`start`||e===`end`||e===!1}function W_(e,t){let n=new Set(t),r={};for(let[t,i]of Object.entries(e))n.has(t)&&U_(i)&&(r[t]=i);return r}function G_(e,t){let n=JSON.parse(e)?.overrides;if(typeof n!=`object`||!n||Array.isArray(n))throw Error(`unexpected stored column pins shape`);return W_(n,t)}function K_(e,t){let n=W_(e,t);return Object.keys(n).length===0?null:JSON.stringify({overrides:n})}function q_({columns:e,storageKey:t}){let n=(0,z.useMemo)(()=>e.filter(e=>e.props.toggleable),[e]),r=(0,z.useMemo)(()=>n.map(e=>e.key),[n]),[i,a]=Up(t??``,{},{enabled:!!t,parse:e=>Y_(e,r),serialize:e=>X_(e,r)}),o=(0,z.useCallback)(e=>e.props.toggleable?i[e.key]??!e.props.hiddenByDefault:!0,[i]),s=(0,z.useMemo)(()=>e.filter(e=>o(e)),[e,o]),c=(0,z.useCallback)((e,t)=>{a(n=>({...n,[e]:t}))},[a]),l=(0,z.useCallback)(()=>a({}),[a]),u=n.length>0;return{hasHidden:n.some(e=>!o(e)),hasToggleableColumns:u,isVisible:o,resetVisibility:l,setColumnVisible:c,toggleableColumns:n,visibleColumns:s}}function J_(e,t){let n=new Set(t),r={};for(let[t,i]of Object.entries(e))n.has(t)&&typeof i==`boolean`&&(r[t]=i);return r}function Y_(e,t){let n=JSON.parse(e)?.overrides;if(typeof n!=`object`||!n||Array.isArray(n))throw Error(`unexpected stored column visibility shape`);return J_(n,t)}function X_(e,t){let n=J_(e,t);return Object.keys(n).length===0?null:JSON.stringify({overrides:n})}function Z_(){let[e,t]=(0,z.useState)(()=>new Set);return{isExpanded:(0,z.useCallback)(t=>e.has(t),[e]),toggle:(0,z.useCallback)(e=>{t(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[])}}var Q_={start:`text-start`,center:`text-center`,end:`text-end`},$_={start:`justify-start`,center:`justify-center`,end:`justify-end`},ev={start:`justify-items-start`,center:`justify-items-center`,end:`justify-items-end`},tv=`2.5rem`,nv=`3rem`,rv=`10rem`;function iv({actions:e=!1,expander:t=!1,selection:n=!1}){return{leadingTracks:[...t?[tv]:[],...n?[nv]:[]],trailingTracks:e?[rv]:[]}}function av(e){if(e===`end`)return`md:border-e md:border-lt-border`;if(e===`start`)return`md:border-s md:border-lt-border`}function ov(e,{pinIndex:t,pinned:n}){if(!n||e===`filler`)return;let r=`var(--lt-pin-offset-${e===`column`?t:e})`;return n===`start`?{insetInlineStart:r}:{insetInlineEnd:r}}function sv(e,{pinBoundary:t,pinned:n}){if(e!==`filler`)return x(n&&`md:sticky z-[1]`,av(t))}function cv(e){return e?`bg-[var(--lt-table-pinned-muted-bg)]`:`bg-lt-muted/50`}function lv(e,t,n){if(e)return x(`bg-[var(--lt-table-pinned-bg)]`,t&&`group-odd/row:bg-[var(--lt-table-pinned-stripe-bg)]`,n&&`group-hover/row:bg-[var(--lt-table-pinned-hover-bg)]`)}function uv({children:e,className:t,...n}){return(0,K.jsx)(`div`,{"data-slot":`table`,...n,className:x(`relative min-w-0`,t),children:(0,K.jsx)(`div`,{"data-slot":`table-scroll`,className:`rounded-lt-sm border border-lt-border`,children:e})})}function dv({className:e,end:t,start:n,...r}){return(0,K.jsxs)(`div`,{"data-slot":`table-toolbar`,...r,className:x(`flex items-center gap-2 border-b border-lt-border px-4 py-2`,e),children:[n,(0,K.jsx)(`div`,{className:`ms-auto flex items-center gap-1`,children:t})]})}function fv({className:e,clearButtonProps:t,clearLabel:n,onClear:r,onValueChange:i,placeholder:a,value:o,...s}){return(0,K.jsxs)(`div`,{className:`relative w-full max-w-xs`,children:[(0,K.jsx)(y,{name:`search`,"aria-hidden":`true`,className:`pointer-events-none absolute left-2.5 top-1/2 size-lt-icon-sm -translate-y-1/2 text-lt-muted-fg`}),(0,K.jsx)(rn,{type:`search`,"aria-label":a,...s,value:o,placeholder:a,onChange:e=>i(e.target.value),className:x(`px-8`,`[&::-webkit-search-cancel-button]:hidden`,e)}),o!==``&&(0,K.jsx)(Lf,{size:`xs`,icon:`x`,label:n,...t,className:x(`absolute right-1.5 top-1/2 -translate-y-1/2`,t?.className),onClick:r})]})}function pv({children:e,className:t,...n}){return(0,K.jsx)(`div`,{...n,className:x(`border-b border-lt-border px-4 py-3`,t),children:(0,K.jsx)(`div`,{className:`flex flex-wrap items-center gap-2 text-sm`,children:e})})}function mv({className:e,...t}){return(0,K.jsx)(`span`,{...t,className:x(`inline-flex items-center gap-1.5 rounded-lt-sm bg-lt-muted px-2 py-1`,e)})}function hv({className:e,...t}){return(0,K.jsx)(`div`,{...t,className:x(`flex flex-wrap items-center gap-4 border-b border-lt-border px-4 py-2.5 text-sm`,e)})}function gv({action:e,children:t,className:n,summary:r,...i}){return(0,K.jsxs)(`div`,{...i,className:x(`flex flex-wrap items-center gap-3 border-b border-lt-border bg-lt-muted/50 p-4 text-sm`,n),children:[(0,K.jsx)(`span`,{className:`font-medium`,children:r}),e,(0,K.jsx)(`div`,{className:`flex flex-wrap items-center gap-2`,children:t})]})}function _v({children:e,className:t,columns:n,pinned:r=!1,style:i,...a}){return(0,K.jsx)(`div`,{"data-slot":`table-grid-scroll`,className:`relative overflow-x-auto`,children:(0,K.jsx)(`div`,{role:`table`,...a,className:x(r?`min-w-max`:`min-w-full`,`text-base`,t),style:{"--lattice-table-columns":n,...i},children:e})})}function vv(e){return(0,K.jsx)(`div`,{"data-slot":`table-header`,role:`rowgroup`,...e})}function yv({className:e,...t}){return(0,K.jsx)(`div`,{role:`row`,...t,className:x(`hidden min-w-full md:grid md:grid-cols-[var(--lattice-table-columns)]`,e)})}var bv={column:`relative min-w-0 px-lt-cell-x py-lt-cell-y pr-5 align-middle font-semibold text-lt-fg`,expander:`px-2 py-lt-cell-y`,selection:`flex items-center px-lt-cell-x py-lt-cell-y`,actions:`flex items-center justify-end gap-2 px-lt-cell-x py-2 align-middle font-semibold text-lt-fg`,filler:``};function xv(e){if(e===`asc`)return`ascending`;if(e===`desc`)return`descending`}function Sv({align:e=`start`,bottomBordered:t=!1,className:n,kind:r=`column`,pinBoundary:i,pinIndex:a,pinned:o,sortDirection:s,style:c,...l}){let u={pinBoundary:i,pinIndex:a,pinned:o};return(0,K.jsx)(`div`,{"aria-hidden":r===`filler`||r===`expander`?`true`:void 0,"aria-sort":r===`column`?xv(s):void 0,role:r===`filler`?void 0:`columnheader`,...l,className:x(bv[r],cv(r!==`filler`&&o!=null),sv(r,u),t&&`border-b border-lt-border`,r===`column`&&Q_[e],n),"data-pin-boundary":i,"data-pinned":r===`filler`?void 0:o,style:{...ov(r,u),...c}})}function Cv({direction:e}){return e===`asc`?(0,K.jsx)(y,{name:`arrow-up`,"aria-hidden":`true`,className:`size-lt-icon-sm shrink-0`}):e===`desc`?(0,K.jsx)(y,{name:`arrow-down`,"aria-hidden":`true`,className:`size-lt-icon-sm shrink-0`}):(0,K.jsx)(y,{name:`chevrons-up-down`,"aria-hidden":`true`,className:`size-lt-icon-sm shrink-0 opacity-50`})}function wv({align:e=`start`,children:t,className:n,direction:r,...i}){return(0,K.jsxs)(`button`,{type:`button`,...i,className:x(`flex w-full items-center gap-1.5 font-semibold`,$_[e],n),children:[(0,K.jsx)(`span`,{className:x(`min-w-0 flex-1 truncate`,Q_[e]),children:t}),(0,K.jsx)(Cv,{direction:r})]})}function Tv({align:e=`start`,className:t,...n}){return(0,K.jsx)(`span`,{...n,className:x(`block truncate`,Q_[e],t)})}var Ev={column:`min-w-0 border-t border-b border-lt-border px-2 py-2`,expander:`border-t border-b border-lt-border px-2 py-2`,selection:`border-t border-b border-lt-border px-lt-cell-x py-2`,actions:`border-t border-b border-lt-border px-lt-cell-x py-2`,filler:`border-t border-b border-lt-border`};function Dv({className:e,kind:t=`column`,pinBoundary:n,pinIndex:r,pinned:i,style:a,...o}){let s={pinBoundary:n,pinIndex:r,pinned:i};return(0,K.jsx)(`div`,{"aria-hidden":t===`filler`?`true`:void 0,role:t===`filler`?void 0:`cell`,...o,className:x(Ev[t],cv(t!==`filler`&&i!=null),sv(t,s),e),"data-pin-boundary":n,"data-pinned":t===`filler`?void 0:i,style:{...ov(t,s),...a}})}function Ov(e){return(0,K.jsx)(`div`,{role:`rowgroup`,...e})}var kv=(0,z.createContext)({clickable:!1,striped:!1});function Av({children:e,className:t,clickable:n=!1,striped:r=!1,...i}){return(0,K.jsx)(kv.Provider,{value:{clickable:n,striped:r},children:(0,K.jsx)(`div`,{"data-slot":`table-row`,role:`row`,...i,className:x(`group/row grid grid-cols-1 border-b border-lt-border last:border-b-0 md:grid-cols-[var(--lattice-table-columns)]`,r&&`odd:bg-lt-muted/30`,n&&`cursor-pointer hover:bg-lt-muted/50`,t),children:e})})}var jv={column:`grid min-w-0 content-center gap-1 overflow-hidden px-lt-cell-x py-lt-cell-y`,expander:`flex items-center px-2 py-lt-cell-y`,selection:`flex items-center px-lt-cell-x py-lt-cell-y`,actions:`items-center justify-start gap-2 px-lt-cell-x py-lt-cell-y md:justify-end`,filler:``};function Mv({align:e=`start`,children:t,className:n,kind:r=`column`,label:i,pinBoundary:a,pinIndex:o,pinned:s,style:c,...l}){let{clickable:u,striped:d}=(0,z.useContext)(kv),f={pinBoundary:a,pinIndex:o,pinned:s};return r===`filler`?(0,K.jsx)(`div`,{"aria-hidden":`true`,...l,className:n,style:c}):(0,K.jsx)(`div`,{role:`cell`,...l,"data-slot":r===`column`?`table-cell`:void 0,className:x(jv[r],r===`actions`&&(z.Children.count(t)>0?`flex`:`hidden md:flex`),r===`column`&&Q_[e],r===`column`&&ev[e],lv(s!=null,d,u),sv(r,f),n),"data-pin-boundary":a,"data-pinned":s,style:{...ov(r,f),...c},children:r===`column`?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`span`,{"aria-hidden":`true`,className:`text-xs font-medium text-lt-muted-fg md:hidden`,children:i}),(0,K.jsx)(`div`,{"data-slot":`table-cell-content`,className:`min-w-0 max-w-full overflow-hidden truncate`,children:t})]}):t})}function Nv({className:e,expanded:t,...n}){return(0,K.jsx)(`button`,{type:`button`,"aria-expanded":t,...n,className:x(`inline-flex size-6 items-center justify-center rounded-lt-sm text-lt-muted-fg hover:bg-lt-muted hover:text-lt-fg`,e),children:(0,K.jsx)(y,{name:`chevron-down`,"aria-hidden":`true`,className:x(`size-lt-icon-md transition-transform`,!t&&`-rotate-90`)})})}function Pv({className:e,...t}){return(0,K.jsx)(`div`,{role:`region`,"data-slot":`table-row-detail`,...t,className:x(`border-b border-lt-border bg-lt-muted/20 px-lt-cell-x py-lt-cell-y`,e)})}function Fv({children:e,className:t,...n}){return(0,K.jsx)(`div`,{"data-slot":`table-empty`,role:`row`,...n,className:x(`p-8 text-center text-lt-muted-fg`,t),children:(0,K.jsx)(`div`,{role:`cell`,children:e})})}function Iv({children:e,className:t,...n}){return(0,K.jsx)(`div`,{role:`row`,...n,className:x(`p-4 text-lt-muted-fg`,t),children:(0,K.jsx)(`div`,{role:`cell`,children:e})})}function Lv({className:e,...t}){return(0,K.jsx)(`div`,{"data-slot":`table-pagination`,...t,className:x(`flex items-center justify-between gap-3 border-t border-lt-border p-4 text-sm`,e)})}function Rv({disabled:e=!1,hasNextPage:t,labels:n,onPageChange:r,page:i,pages:a}){return(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(q,{emphasis:`outline`,"data-test":`pagination-previous`,disabled:e||i<=1,onClick:()=>r(i-1),children:n.previous}),a?.map(t=>(0,K.jsx)(q,{emphasis:`outline`,size:`icon`,"data-test":`pagination-page-${t}`,disabled:e||t===i,"aria-current":t===i?`page`:void 0,"aria-label":n.page(t),onClick:()=>r(t),children:t},t)),(0,K.jsx)(q,{emphasis:`outline`,"data-test":`pagination-next`,disabled:e||!t,onClick:()=>r(i+1),children:n.next})]})}function zv(e){return Array.isArray(e)?e.flatMap(e=>{if(e.type!==`action`&&e.type!==`action.bulk`)return[];let t=e;return t.props.endpoint?[t]:[]}):[]}function Bv({actions:e,selectedKeys:t,allMatching:n,total:r,query:i,canSelectAllMatching:a,onSelectAllMatching:o,onCompleted:s}){let{t:c}=N(`lattice`),l=()=>n?{allMatching:!0,...i}:{selected:t},u=n?r??t.length:t.length;return(0,K.jsx)(gv,{summary:n?c(`table.bulk.all-selected`,`All {{count}} selected`,{count:u}):c(`table.bulk.selected`,`{{count}} selected`,{count:u}),action:a&&(0,K.jsx)(`button`,{type:`button`,"data-test":`bulk-select-all-matching`,className:`font-medium text-lt-primary underline underline-offset-2`,onClick:o,children:c(`table.bulk.select-all-matching`,`Select all {{total}} matching`,{total:r})}),children:e.map((e,t)=>(0,K.jsx)(xu,{action:e,options:{extraData:l,onSuccess:s},children:({onClick:t,processing:n})=>(0,K.jsxs)(q,{type:`button`,"data-test":$l(`bulk-action`,e.id),variant:e.props.variant,emphasis:e.props.emphasis,disabled:n,onClick:t,children:[n&&(0,K.jsx)(Xl,{}),e.props.label]})},e.key??e.id??t))})}function Vv({className:e,density:t,children:n,ref:r,...i}){return(0,K.jsxs)(`span`,{className:x(`relative inline-flex w-full min-w-0`,e),children:[(0,K.jsx)(`select`,{ref:r,"data-slot":`native-select`,className:x(nn({density:t}),`cursor-pointer appearance-none pr-8`),...i,children:n}),(0,K.jsx)(y,{name:`chevron-down`,"aria-hidden":`true`,className:`pointer-events-none absolute right-2.5 top-1/2 size-lt-icon-md -translate-y-1/2 text-lt-muted-fg`})]})}function Hv(e){return e===!0||e===1||e===`1`||e===`true`}function Uv({filter:e,value:t,processing:n,bare:r=!1,onChange:i,onSearch:a}){let{t:o}=N(`lattice`),s=e.schema??[];return s.length===0?(0,K.jsx)(Kv,{filter:e,value:t,processing:n,onChange:i}):(0,K.jsxs)(`div`,{className:`flex items-end gap-2`,children:[(0,K.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,K.jsx)(Wv,{filter:e,schema:s,value:t,processing:n,bare:r,onChange:i,onSearch:a})}),qg(t)&&(0,K.jsx)(Lf,{size:`md`,icon:`x`,label:o(`table.filter.clear`,`Clear {{label}} filter`,{label:e.props.label}),disabled:n,onClick:()=>i(void 0)})]})}function Wv({filter:e,schema:t,value:n,processing:r,bare:i,onChange:a,onSearch:o}){let s=(0,z.useMemo)(()=>Yg(n),[n]),c=(0,z.useMemo)(()=>({action:`#`,clearErrors:()=>{},componentId:`table-filter-${e.key}`,componentRef:``,errors:{},fieldIdPrefix:`table-filter-${e.key}`,fieldLabels:{},precognitive:!1,processing:r,searchOptions:(e,t,n,r)=>o?o(e,t,r):Promise.resolve([]),touch:()=>{},validate:()=>{},validateFields:()=>{},validating:!1}),[e.key,o,r]),l=(0,K.jsx)(`div`,{"aria-disabled":r,className:x(`grid gap-3`,r&&`pointer-events-none opacity-60`),children:(0,K.jsx)($e,{nodes:t})});return(0,K.jsx)(R,{value:c,children:(0,K.jsx)(je,{value:{markUserEdit:()=>{}},children:(0,K.jsx)(Hd,{nodes:{},children:(0,K.jsx)(ge,{initial:s,children:(0,K.jsx)(Gv,{onChange:a,children:i?(0,K.jsx)(qt,{children:l}):l})})})})})}function Gv({children:e,onChange:t}){let n=St(),r=bt(),i=(0,z.useRef)(n);i.current=n;let a=(0,z.useCallback)((e,n)=>{let a=typeof n==`function`?n(ye(i.current,e)):n,o=we(i.current,e,a);i.current=o,r(e,a),t(o)},[t,r]),o=(0,z.useMemo)(()=>({blur:()=>{},change:a,commit:a}),[a]);return(0,K.jsx)(Ie,{value:o,children:e})}function Kv({filter:e,value:t,processing:n,onChange:r}){let i=Hv(Yg(t).value);return(0,K.jsxs)(`label`,{className:`flex h-lt-control-md cursor-pointer items-center gap-2 text-sm`,children:[(0,K.jsx)(Ff,{"aria-label":e.props.label,"data-test":`table-filter-${e.key}`,checked:i,disabled:n,onCheckedChange:e=>r(e===!0?{value:`1`}:void 0)}),(0,K.jsx)(`span`,{children:e.props.label})]})}function qv({type:e,label:t,value:n,processing:r,withSearchIcon:i=!1,grouped:a=!1,ariaLabel:o,testId:s,onCommit:c,onClear:l}){let{t:u}=N(`lattice`),[d,f]=(0,z.useState)(n),p=o??u(`table.filter.filter-by`,`Filter {{label}}`,{label:t}),m=a?`rounded-r-none`:``;return(0,z.useEffect)(()=>{f(n)},[n]),e===`boolean`?(0,K.jsxs)(Vv,{density:`compact`,"aria-label":p,"data-test":s,className:m,disabled:r,value:n,onChange:e=>c(e.target.value),children:[(0,K.jsx)(`option`,{value:``,children:u(`table.filter.all`,`All`)}),(0,K.jsx)(`option`,{value:`true`,children:u(`table.filter.true`,`True`)}),(0,K.jsx)(`option`,{value:`false`,children:u(`table.filter.false`,`False`)})]}):e===`date`?(0,K.jsx)(rn,{type:`date`,density:`compact`,"aria-label":p,"data-test":s,className:m,disabled:r,value:d,onChange:e=>{f(e.target.value),c(e.target.value)}}):(0,K.jsxs)(`div`,{className:`relative flex w-full min-w-0 items-center`,children:[i&&(0,K.jsx)(y,{name:`search`,"aria-hidden":`true`,className:`pointer-events-none absolute left-2 size-lt-icon-md text-lt-muted-fg`}),(0,K.jsx)(rn,{type:e===`number`?`number`:`text`,density:`compact`,"aria-label":p,"data-test":s,className:x(m,i&&`pl-8`,l&&`pr-8`),disabled:r,value:d,onChange:e=>f(e.target.value),onKeyDown:e=>{e.key===`Enter`&&c(d)},onBlur:()=>{d!==n&&c(d)}}),l&&d!==``&&(0,K.jsx)(Lf,{size:`xs`,icon:`x`,label:u(`table.filter.clear`,`Clear {{label}} filter`,{label:t}),"data-test":s?`${s}-clear`:void 0,className:`absolute right-1 size-6`,disabled:r,onClick:l})]})}function Jv({column:e,clauses:t,processing:n,onAdd:r,onUpdate:i,onRemove:a,onReplace:o,onSearch:s}){let{t:c}=N(`lattice`),{filter:l,label:u}=e.props,d=u??e.key;if(!l)return null;if(l.control===`filter.select`)return(0,K.jsx)(Xv,{column:e,clauses:t,processing:n,onReplace:o,onSearch:s});let f=l.type??`text`,p=l.operators??[],m=l.defaultOperator??p[0]??`eq`,h=t.find(e=>e.clause.operator===m)??t[0];function g(t){if(t===``){h&&a(h.index);return}h?i(h.index,{...h.clause,value:t}):r({field:e.key,operator:m,value:t})}return(0,K.jsxs)(`div`,{className:`flex min-w-0 max-w-80 items-stretch`,children:[(0,K.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,K.jsx)(qv,{type:f,label:d,value:h?.clause.value??``,processing:n,withSearchIcon:f===`text`||f===`number`,grouped:!0,testId:`filter-${e.key}-value`,onCommit:g,onClear:h?()=>a(h.index):void 0})}),(0,K.jsxs)(Qt,{children:[(0,K.jsx)(Fe,{asChild:!0,children:(0,K.jsx)(Lf,{emphasis:`segmented`,size:`md`,icon:`filter`,label:c(`table.filter.column-filters`,`{{label}} filters`,{label:d}),"data-test":`filter-${e.key}`,disabled:n,children:t.length>0&&(0,K.jsx)(`span`,{className:`absolute -right-1.5 -top-1.5 inline-flex size-4 items-center justify-center rounded-full bg-lt-primary text-xs font-medium text-lt-primary-fg`,children:t.length})})}),(0,K.jsx)(Yt,{align:`start`,className:`w-80 p-4`,children:(0,K.jsx)(ey,{column:e,clauses:t,operators:p,defaultOperator:m,processing:n,onAdd:r,onUpdate:i,onRemove:a})})]})]})}function Yv(e){return Array.isArray(e)?e.join(`,`):typeof e==`string`?e:``}function Xv({column:e,clauses:t,processing:n,onReplace:r,onSearch:i}){let{filter:a,label:o}=e.props,s=o??e.key;if(!a)return null;let c=a.multiple,l=a.defaultOperator,u=a.clauseOptions??[],d=Qv(t.map(e=>e.clause),u),f=t.find(e=>e.clause.operator===l)??t[0],p=d?d.value:c?f?.clause.value?f.clause.value.split(`,`):[]:f?.clause.value??``,m={key:e.key,type:`filter.select`,props:{label:s,options:a.options,multiple:c,searchable:a.searchable,placeholder:null},schema:[{type:`field.select`,key:e.key,props:{name:`value`,label:s,options:a.options,multiple:c,searchable:a.searchable,placeholder:null}}]};function h(t){let n=Yv(Yg(t).value);if(n===``){r(e.key,[]);return}let i=u.find(e=>e.value===n);if(i){r(e.key,Zv(e.key,i));return}r(e.key,[{field:e.key,operator:l,value:n}])}return(0,K.jsx)(Uv,{filter:m,value:{value:p},processing:n,bare:!0,onChange:h,onSearch:i?(e,t,n)=>i(t,n):void 0})}function Zv(e,t){return t.clauses.map(t=>({field:e,operator:t.operator,value:t.value}))}function Qv(e,t){return t.find(t=>$v(e,Zv(``,t)))}function $v(e,t){return e.length===t.length&&t.every(t=>e.some(e=>e.operator===t.operator&&e.value===t.value))}function ey({column:e,clauses:t,operators:n,defaultOperator:r,processing:i,onAdd:a,onUpdate:o,onRemove:s}){let{t:c}=N(`lattice`),l=e.props.filter?.type??`text`,[u,d]=(0,z.useState)(r),[f,p]=(0,z.useState)(t.length===0);return(0,K.jsxs)(`div`,{className:`grid gap-3`,children:[t.map(t=>(0,K.jsx)(ty,{column:e,type:l,operators:n,clause:t.clause,processing:i,onOperator:e=>o(t.index,{...t.clause,operator:e}),onValue:e=>e===``?s(t.index):o(t.index,{...t.clause,value:e}),onRemove:()=>s(t.index)},t.index)),f&&(0,K.jsx)(ty,{column:e,type:l,operators:n,clause:{field:e.key,operator:u,value:``},processing:i,onOperator:t=>{if(E_.has(t)){a({field:e.key,operator:t,value:``}),d(r),p(!1);return}d(t)},onValue:t=>{t!==``&&(a({field:e.key,operator:u,value:t}),d(r),p(!1))},onRemove:()=>p(!1)}),(0,K.jsx)(`div`,{className:`border-t border-lt-border pt-3`,children:(0,K.jsx)(q,{variant:`secondary`,icon:`plus`,"data-test":`filter-${e.key}-add`,className:`w-full`,disabled:i,onClick:()=>p(!0),children:c(`table.filter.add`,`Add filter`)})})]})}function ty({column:e,type:t,operators:n,clause:r,processing:i,onOperator:a,onValue:o,onRemove:s}){let{t:c}=N(`lattice`),l=e.props.label??e.key,u=E_.has(r.operator);return(0,K.jsxs)(`div`,{className:`grid gap-2`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[n.length>1?(0,K.jsx)(Vv,{density:`compact`,"aria-label":c(`table.filter.operator`,`{{label}} operator`,{label:l}),"data-test":`filter-${e.key}-operator`,className:`flex-1`,disabled:i,value:r.operator,onChange:e=>a(e.target.value),children:n.map(e=>(0,K.jsx)(`option`,{value:e,children:D_(e)},e))}):(0,K.jsx)(`span`,{className:`flex-1 text-sm font-medium`,children:D_(r.operator)}),(0,K.jsx)(q,{emphasis:`outline`,size:`icon`,icon:`trash-2`,"aria-label":c(`table.filter.remove`,`Remove {{label}} filter`,{label:l}),"data-test":`filter-${e.key}-remove`,disabled:i,onClick:s})]}),!u&&(0,K.jsx)(qv,{type:t,label:l,ariaLabel:c(`table.filter.value`,`{{label}} filter value`,{label:l}),value:r.value,processing:i,onCommit:o,onClear:()=>o(``)})]})}function ny({bottomBordered:e,column:t,pinBoundary:n,pinIndex:r,pinned:i,processing:a,resizeHandleProps:o,sort:s,query:c}){let l=p_(c,t),{t:u}=N(`lattice`),{align:d,label:f,sortable:p}=t.props;return(0,K.jsxs)(Sv,{align:d,bottomBordered:e,pinBoundary:n,pinIndex:r,pinned:i,sortDirection:l?.direction,children:[p?(0,K.jsx)(wv,{align:d,"aria-label":u(`table.sort.column`,`Sort {{label}}`,{label:f}),"data-test":`sort-${t.key}`,direction:l?.direction,disabled:a,onClick:()=>s(t),children:f}):(0,K.jsx)(Tv,{align:d,children:f}),o&&(0,K.jsx)(`div`,{...o})]})}function ry({columns:e,hasHidden:t,hasPinOverrides:n=!1,isVisible:r,onReset:i,onSetPin:a,onToggle:o,pinFor:s,pinningEnabled:c=!1,processing:l,visibleColumnCount:u}){let{t:d}=N(`lattice`),f=d(`table.columns.label`,`Columns`),p=d(`table.columns.pin-left`,`Pin left`),m=d(`table.columns.pin-right`,`Pin right`),h=d(`table.columns.unpin`,`Unpin`);return(0,K.jsxs)(Qt,{children:[(0,K.jsx)(Fe,{asChild:!0,children:(0,K.jsx)(Lf,{size:`sm`,icon:`columns-3`,label:f,"data-test":`table-columns-menu`,disabled:l})}),(0,K.jsx)(Yt,{align:`end`,className:`w-72 p-4`,children:(0,K.jsxs)(`div`,{className:`grid gap-3`,children:[e.map(e=>{let t=e.props.toggleable===!0,n=r(e),i=t&&n&&u<=1,l=c?s?.(e)??null:null;return(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-base text-lt-fg`,children:[t?(0,K.jsxs)(`label`,{className:`flex flex-1 items-center gap-2`,children:[(0,K.jsx)(Ff,{"data-test":`table-column-toggle-${e.key}`,checked:n,disabled:i,onCheckedChange:t=>o(e.key,t===!0)}),(0,K.jsx)(`span`,{children:e.props.label??e.key})]}):(0,K.jsx)(`span`,{className:`flex-1`,children:e.props.label??e.key}),c&&(0,K.jsxs)(`div`,{className:`flex items-center gap-0.5`,children:[(0,K.jsx)(Lf,{icon:`arrow-left-to-line`,label:l===`start`?h:p,active:l===`start`,"data-test":`table-column-pin-left-${e.key}`,size:`xs`,onClick:()=>a?.(e.key,l===`start`?null:`start`)}),(0,K.jsx)(Lf,{icon:`arrow-right-to-line`,label:l===`end`?h:m,active:l===`end`,"data-test":`table-column-pin-right-${e.key}`,size:`xs`,onClick:()=>a?.(e.key,l===`end`?null:`end`)})]})]},e.key)}),(t||n)&&(0,K.jsx)(`button`,{type:`button`,"data-test":`table-columns-reset`,className:`mt-1 justify-self-start text-sm text-lt-muted-fg hover:text-lt-fg`,onClick:i,children:d(`table.columns.reset`,`Reset`)})]})})]})}function iy({clauses:e,columnsByKey:t,indicators:n,processing:r,onRemoveClause:i,onChange:a,onReset:o}){let{t:s}=N(`lattice`);return e.length===0&&n.length===0?null:(0,K.jsxs)(pv,{children:[e.map((e,n)=>{let a=t.get(e.field)?.props.label??e.field,o=E_.has(e.operator);return(0,K.jsx)(ay,{label:`${a} ${D_(e.operator)}`,value:o?``:e.value,removeTestId:`filter-chip-${e.field}-remove`,removeLabel:s(`table.filter.remove`,`Remove {{label}} filter`,{label:a}),processing:r,onRemove:()=>i(n)},`${e.field}-${e.operator}-${n}`)}),n.map(e=>(0,K.jsx)(ay,{label:e.label,value:e.value,removeTestId:`table-filter-chip-${e.filter}-remove`,removeLabel:s(`table.filter.remove`,`Remove {{label}} filter`,{label:e.label}),processing:r,onRemove:()=>a(e.filter,void 0)},`${e.filter}:${e.label}:${e.value}`)),(0,K.jsx)(`button`,{type:`button`,"data-test":`table-filters-reset`,className:`text-lt-muted-fg underline-offset-2 hover:underline disabled:text-lt-disabled-fg`,disabled:r,onClick:o,children:s(`table.filter.reset-all`,`Reset all`)})]})}function ay({label:e,value:t,removeTestId:n,removeLabel:r,processing:i,onRemove:a}){return(0,K.jsxs)(mv,{children:[(0,K.jsx)(`span`,{children:t===``?(0,K.jsx)(`span`,{className:`font-semibold`,children:e}):(0,K.jsxs)(K.Fragment,{children:[`${e}: `,(0,K.jsx)(`span`,{className:`font-semibold`,children:t})]})}),(0,K.jsx)(Lf,{size:`xs`,icon:`x`,label:r,"data-test":n,disabled:i,onClick:a})]})}function oy({filters:e,values:t,processing:n,onChange:r,onSearch:i}){let{t:a}=N(`lattice`),o=e.filter(e=>qg(t[e.key])),s=a(`table.filter.filters`,`Filters`);return(0,K.jsxs)(Qt,{children:[(0,K.jsx)(Fe,{asChild:!0,children:(0,K.jsx)(Lf,{size:`sm`,icon:`filter`,label:s,"data-test":`table-filters-menu`,disabled:n,children:o.length>0&&(0,K.jsx)(`span`,{className:`absolute -right-1 -top-1 inline-flex size-3.5 items-center justify-center rounded-full bg-lt-primary text-[10px] font-medium leading-none text-lt-primary-fg`,children:o.length})})}),(0,K.jsx)(Yt,{align:`end`,className:`w-80 p-4`,children:(0,K.jsx)(`div`,{className:`grid gap-3`,children:e.map(e=>(0,K.jsx)(`div`,{className:`grid gap-1`,children:(0,K.jsx)(Uv,{filter:e,value:t[e.key],processing:n,onChange:t=>r(e.key,t),onSearch:i?(t,n,r)=>i(`filter:${e.key}.${t}`,n,r):void 0})},e.key))})})]})}function sy({pagination:e,currentPage:t,processing:n,mode:r,hasNextPage:i,visiblePages:a,infiniteLoaderRef:o,perPageOptions:s,perPageValue:c,onPerPage:l,onPage:u,onLoadMore:d}){let{t:f}=N(`lattice`);return(0,K.jsxs)(Lv,{children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,K.jsx)(`span`,{children:e.total==null?f(`table.pagination.page`,`Page {{page}}`,{page:t}):f(`table.pagination.showing`,`Showing {{from}}-{{to}} of {{total}}`,{from:e.from??0,to:e.to??0,total:e.total})}),s.length>0&&r!==`none`&&(0,K.jsx)(Vv,{"aria-label":f(`table.pagination.per-page`,`Rows per page`),className:`w-fit`,"data-test":`pagination-per-page`,disabled:n,value:String(c),onChange:e=>l(e.target.value===`infinite`?`infinite`:Number(e.target.value)),children:s.map(e=>(0,K.jsx)(`option`,{value:String(e),children:e===`infinite`?f(`table.pagination.infinite`,`Infinite`):e},String(e)))})]}),r===`infinite`?(0,K.jsx)(`div`,{ref:o,className:`flex items-center gap-2`,children:e.hasMore?(0,K.jsx)(q,{emphasis:`outline`,"data-test":`pagination-load-more`,disabled:n,onClick:d,children:n?f(`table.pagination.loading`,`Loading...`):f(`table.pagination.load-more`,`Load more`)}):(0,K.jsx)(`span`,{className:`text-lt-muted-fg`,children:f(`table.pagination.all-loaded`,`All rows loaded`)})}):r===`simple`||r===`table`?(0,K.jsx)(Rv,{disabled:n,hasNextPage:i,labels:{next:f(`table.pagination.next`,`Next`),page:e=>f(`table.pagination.page`,`Page {{page}}`,{page:e}),previous:f(`table.pagination.previous`,`Previous`)},onPageChange:u,page:t,pages:r===`table`?a:void 0}):null]})}function cy({columnsByKey:e,query:t,processing:n,onClear:r}){let{t:i}=N(`lattice`);return(0,K.jsx)(hv,{children:t.sorts.map((t,a)=>{let o=e.get(t.key)?.props.label??t.key,s=t.direction===`desc`?`arrow-down`:`arrow-up`;return(0,K.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,K.jsx)(`span`,{className:`font-medium`,children:`${a+1}. ${o}`}),(0,K.jsx)(y,{name:s,role:`img`,"aria-hidden":!1,"aria-label":O_(t.direction),className:`size-lt-icon-sm text-lt-muted-fg`}),(0,K.jsx)(Lf,{size:`xs`,icon:`x`,label:i(`table.sort.clear`,`Clear {{label}} sort`,{label:o}),"data-test":`clear-${t.key}-sort`,disabled:n,onClick:()=>r(t)})]},t.key)})})}var ly=300;function uy({value:e,onSearch:t}){let{t:n}=N(`lattice`),[r,i]=(0,z.useState)(e),a=(0,z.useRef)(e);(0,z.useEffect)(()=>{e!==a.current&&(a.current=e,i(e))},[e]);function o(e){a.current=e,t(e)}let s=af(o,ly);function c(e){i(e),s(e)}function l(){s.cancel(),i(``),o(``)}return(0,K.jsx)(fv,{clearButtonProps:{"data-test":`table-search-clear`},clearLabel:n(`table.search.clear`,`Clear search`),"data-test":`table-search`,onClear:l,onValueChange:c,placeholder:n(`table.search.placeholder`,`Search`),value:r})}var dy=`table.columns`;function fy(){return p(dy)}function py(e){return e}function my({color:e,className:t,style:n,...r}){let i=an(cn(e??void 0)??sn(`gray`));return(0,K.jsx)(`span`,{"data-slot":`badge`,className:x(`lt-badge`,i.className,t),style:{...i.style,...n},...r})}function hy(e,t,n){if(e==null)return``;let r=t?.props?.date;if(r)return L(e,r,n);let i=(t?.props)?.options?.find(t=>t.value===String(e))?.label;return i===void 0?typeof e==`string`||typeof e==`number`||typeof e==`boolean`?String(e):JSON.stringify(e):i}function gy(e,t,n){let r=e.props.link;if(!r)return null;let i=f_(t,e.key);if(i!==void 0)return i;let a=r.href??String(n??``);if(a===``)return null;let o=!1,s=a.replace(/\{([^}]+)\}/g,(e,r)=>{let i=r===`value`?n:t[r];return i==null||i===``?(o=!0,``):encodeURIComponent(String(i))});return o?null:s}var _y=({column:e,props:t,value:n})=>{let r=hy(n,e);return r===``?null:(0,K.jsx)(my,{color:t.colors?.[String(n)],children:r})},vy=({value:e})=>{let{t}=N(`lattice`),n=Hv(e);return(0,K.jsx)(`span`,{"aria-label":n?t(`common.yes`,`Yes`):t(`common.no`,`No`),role:`img`,children:(0,K.jsx)(y,{name:n?`check`:`x`,className:x(`size-lt-icon-md`,n?`text-lt-success`:`text-lt-muted-fg`)})})},yy=({props:e,value:t})=>{let n=e.icons?.[String(t)]??e.icon??void 0;if(!n)return null;let r=cn(e.colors?.[String(t)]),i=r?an(r):void 0;return(0,K.jsx)(`span`,{"aria-label":String(t),className:x(`lt-cell-icon`,i?.className),style:i?.style,children:(0,K.jsx)(nl,{className:`size-lt-icon-md`,icon:n})})};function by({src:e,alt:t,defaultOpen:n=!1,onOpenChange:r,open:i,previewable:a,previewSrc:o,width:s,height:c,className:l,style:u,testId:d,...f}){let{t:p}=N(F),[m,h]=(0,z.useState)(n),g=i??m,_=e=>{h(e),r?.(e)},v=(0,K.jsx)(`img`,{...f,alt:t,src:e,width:s,height:c,className:l,style:s?{...u,width:s,height:c}:u});if(!a)return v;let y=p(`common.image.open-preview`,`View image`);return(0,K.jsxs)(Ad,{open:g,onOpenChange:_,children:[(0,K.jsx)(Md,{asChild:!0,children:(0,K.jsx)(`button`,{type:`button`,"data-test":d,className:`cursor-zoom-in`,"aria-label":y,children:v})}),(0,K.jsxs)(Pd,{"aria-describedby":void 0,className:`max-h-[90vh] w-auto max-w-[90vw] border-none bg-transparent p-0 shadow-none`,children:[(0,K.jsx)($,{className:`sr-only`,children:t||y}),(0,K.jsx)(`img`,{alt:t,src:o??e,"data-slot":`image-lightbox`,className:`max-h-[90vh] max-w-[90vw] rounded-lt object-contain`}),(0,K.jsx)(jd,{asChild:!0,children:(0,K.jsx)(q,{icon:`x`,"aria-label":p(`common.close`,`Close`),"data-test":`lightbox-close`,size:`icon`,emphasis:`ghost`,className:`absolute top-2 right-2 bg-lt-bg/80 hover:bg-lt-bg`})})]})]})}var xy=({column:e,props:t,value:n})=>{let r=typeof n==`string`?n:``;if(r===``)return null;let i=t.size??32;return(0,K.jsx)(by,{alt:e.props.label??``,className:x(`object-cover`,t.circular?`rounded-full`:`rounded-lt-sm`),height:i,previewable:t.previewable,src:r,testId:`preview-${e.key}`,width:i})};function Sy(e){let t=typeof e==`number`?e:Number(e);return e!=null&&e!==``&&!Number.isNaN(t)?t:null}function Cy(e,t,n){let r=Sy(e);if(r===null)return String(e??``);let i={notation:t.notation,minimumFractionDigits:t.minimumFractionDigits??void 0,maximumFractionDigits:t.maximumFractionDigits??void 0};return t.currency?(i.style=`currency`,i.currency=t.currency):t.unit&&(i.style=`unit`,i.unit=t.unit),new Intl.NumberFormat(n,i).format(r)}function wy({children:e,column:t,copyable:n,value:r}){return n?(0,K.jsx)(Fh,{value:r,label:t.props.label??t.key,testId:`copy-${t.key}`,children:e}):e}function Ty({column:e,copyable:t,format:n,value:r}){let{locale:i}=s();return Sy(r)===null?(0,K.jsx)(`span`,{children:hy(r,e)}):(0,K.jsx)(wy,{column:e,copyable:t,value:String(r),children:(0,K.jsx)(`span`,{className:`tabular-nums`,children:Cy(r,n,i)})})}var Ey=({column:e,props:t,row:n,value:r})=>{let i=t.currencyField?n[t.currencyField]:void 0,a=t.currency??(typeof i==`string`?i:null);return(0,K.jsx)(Ty,{column:e,copyable:t.copyable,value:r,format:{kind:`number`,notation:`standard`,minimumFractionDigits:t.minimumFractionDigits,maximumFractionDigits:t.maximumFractionDigits,currency:a,unit:null}})},Dy=({column:e,props:t,value:n})=>(0,K.jsx)(Ty,{column:e,copyable:t.copyable,value:n,format:{kind:`number`,notation:t.compact?`compact`:`standard`,minimumFractionDigits:t.minimumFractionDigits,maximumFractionDigits:t.maximumFractionDigits,currency:null,unit:t.unit}}),Oy=({column:e,row:t})=>(0,K.jsx)(`div`,{className:`grid gap-1`,children:(0,K.jsx)($e,{nodes:i(e.schema,t)})}),ky=e=>e.props.multiple?(0,K.jsx)(jy,{...e}):e.props.badge?(0,K.jsx)(My,{...e}):(0,K.jsx)(Ny,{...e});function Ay({label:e,color:t}){return e===``?null:(0,K.jsx)(my,{color:t,children:e})}function jy({column:e,props:t,value:n}){let r=Array.isArray(n)?n:[];return r.length===0?null:t.badge?(0,K.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:r.map((t,n)=>{let r=t;return(0,K.jsx)(Ay,{label:hy(r.value,e),color:r.color},n)})}):(0,K.jsx)(`span`,{children:r.map(t=>hy(t,e)).join(`, `)})}function My({column:e,props:t,row:n,value:r}){let i=t.badge.colorKey;return(0,K.jsx)(Ay,{label:hy(r,e),color:String(n[i]??``)})}function Ny({column:e,props:t,row:n,value:r}){let i=e.props.date,a=d_(n,e.key),o=a?null:gy(e,n,r),s=hy(r,e),c=a?(0,K.jsxs)(Qt,{children:[(0,K.jsx)(Fe,{asChild:!0,children:(0,K.jsx)(`button`,{type:`button`,className:`cursor-pointer underline underline-offset-2`,children:s})}),(0,K.jsx)(Yt,{className:`p-3`,children:(0,K.jsx)($e,{nodes:[a]})})]}):o?(0,K.jsx)(`a`,{className:`underline underline-offset-2`,href:o,rel:t.link?.external?`noreferrer`:void 0,target:t.link?.external?`_blank`:void 0,children:s}):s;return i&&!o&&!a&&!t.copyable&&r!=null?(0,K.jsx)(Jl,{value:r,dateStyle:i.dateStyle,timeStyle:i.timeStyle}):(0,K.jsx)(wy,{column:e,copyable:t.copyable,value:s,children:c})}var Py={"column.badge":py(_y),"column.boolean":py(vy),"column.icon":py(yy),"column.image":py(xy),"column.money":py(Ey),"column.number":py(Dy),"column.stack":py(Oy),"column.text":py(ky)};function Fy({column:e,row:t}){let n=fy()[e.type]??Py[e.type]??Py[`column.text`];return(0,K.jsx)(n,{column:e,props:e.props,row:t,value:t[e.key]})}function Iy(e,t,n,r){if(e===`start`&&t===n)return`end`;if(e===`end`&&t===r)return`start`}var Ly=`a, button, input, label, select, textarea, [role=menuitem], [role=checkbox]`;function Ry(e){return e instanceof Element&&e.closest(Ly)!=null}function zy(e,t,n){if(!(!t||Ry(e.target))){if(e.metaKey||e.ctrlKey){window.open(t,`_blank`);return}n(t)}}function By(e,t){!t||e.button!==1||Ry(e.target)||window.open(t,`_blank`)}var Vy={components:{table:B(({node:e})=>{let{t}=N(`lattice`),{columns:n,rows:r,pagination:i,query:a,filters:o,tableFilters:s,search:c,addFilter:l,updateFilter:u,removeFilter:d,replaceColumnFilters:f,setTableFilter:p,resetFilters:m,setSearch:h,searchFilterOptions:g,processing:_,hasLoaded:v,infiniteLoaderRef:b,sort:x,clearSort:S,goToPage:C,setPerPage:w,loadMore:T}=B_(e),E=(0,z.useMemo)(()=>zv(e.props?.bulkActions),[e.props?.bulkActions]),D=E.length>0,O=(0,z.useMemo)(()=>r.map((e,t)=>({row:e,actions:c_(e),detail:l_(e),key:s_(e,t),url:u_(e)})),[r]),{visit:ee}=Bl(),k=V_(O.map(e=>e.key)),{isExpanded:A,toggle:j}=Z_(),M=O.some(e=>e.detail!=null),te=(0,z.useMemo)(()=>new Map(n.map(e=>[e.key,e])),[n]),P=X(e),{hasToggleableColumns:F,hasHidden:ne,isVisible:re,resetVisibility:ie,setColumnVisible:I,toggleableColumns:L,visibleColumns:ae}=q_({columns:n,storageKey:P?`lattice:table-column-visibility:${P}`:void 0}),oe=e.props?.pinnableColumns===!0,se=X(e),{hasPinOverrides:ce,pinFor:R,resetPins:le,setColumnPin:ue}=H_({columns:n,storageKey:oe&&se?`lattice:table-pins:${se}`:void 0}),de=(0,z.useMemo)(()=>j_(ae,R),[ae,R]),fe=de.some(e=>R(e)!=null),pe=de.findIndex(e=>R(e)===`end`),me=(0,z.useMemo)(()=>{if(!oe)return L;let e=new Map(ae.map(e=>[e.key,e]));for(let t of L)e.has(t.key)||e.set(t.key,t);return[...e.values()]},[oe,L,ae]),he=()=>{ie(),le()},ge=i.currentPage??a.page,_e=i.lastPage??ge,ve=i.mode??`table`,ye=(0,z.useMemo)(()=>i_(e.props?.perPageOptions),[e.props?.perPageOptions]),be=A_(ge,_e),xe=i.hasMore??ge<_e,Se=O.some(e=>e.actions.length>0),Ce=e.props?.striped===!0,we=ae.some(e=>e.props.filter!=null),Te=o.map((e,t)=>({clause:e,index:t})),Ee=(0,z.useMemo)(()=>Array.isArray(e.props?.filters)?e.props.filters:[],[e.props?.filters]),De=Ee.length>0,Oe=Se,ke=fe?de.reduce((e,t,n)=>R(t)===`start`?n:e,-1):-1,Ae=fe?ke===-1?D?`selection`:M?`expander`:null:`column`:null,je=fe?pe===-1?Oe?`actions`:null:`column`:null,Me=Ae===`expander`?`end`:void 0,Ne=Ae===`selection`?`end`:void 0,Pe=je===`actions`?`start`:void 0,Fe=(0,z.useMemo)(()=>Array.isArray(e.props?.toolbar)?e.props.toolbar:[],[e.props?.toolbar]),Ie=(0,z.useMemo)(()=>M_(de,R),[de,R]),Le=(0,z.useMemo)(()=>iv({actions:Oe,expander:M,selection:D}),[Oe,D,M]),Re=e.props?.resizableColumns===!0,ze=X(e),{getResizeHandleProps:Be,gridTemplateColumns:Ve,hasOverrides:He,pinOffsetVars:Ue,resizeRootRef:We,resetColumns:Ge}=Gp({columns:Ie,enabled:Re,hasActions:Oe,hasExpander:M,hasSelection:D,leadingTracks:Le.leadingTracks,showIndicator:e.props?.resizeIndicator===!0,storageKey:Re&&ze?`lattice:table-columns:${ze}`:void 0,trailingTracks:Le.trailingTracks}),Ke=e.props?.searchable===!0||Fe.length>0||De||F||He||oe,qe=fe?{start:`start`,end:`end`}:null;return(0,K.jsxs)(uv,{"data-test":e.id,children:[Ke&&(0,K.jsx)(dv,{start:e.props?.searchable&&(0,K.jsx)(uy,{value:c,onSearch:h}),end:(0,K.jsxs)(K.Fragment,{children:[De&&(0,K.jsx)(oy,{filters:Ee,values:s,processing:_,onChange:p,onSearch:g}),(F||oe)&&(0,K.jsx)(ry,{columns:me,isVisible:re,visibleColumnCount:ae.length,hasHidden:ne,hasPinOverrides:ce,onToggle:I,onReset:he,onSetPin:ue,pinFor:R,pinningEnabled:oe,processing:_}),He&&(0,K.jsx)(`button`,{"aria-label":t(`table.reset-column-widths`,`Reset column widths`),className:`hidden rounded-lt-sm p-1 text-lt-muted-fg hover:text-lt-fg md:inline-flex`,"data-test":`table-reset-columns`,onClick:Ge,title:t(`table.reset-column-widths`,`Reset column widths`),type:`button`,children:(0,K.jsx)(y,{name:`rotate-ccw`,className:`size-lt-icon-sm`})}),Fe.map((e,t)=>(0,K.jsx)(Zt,{node:e},e.key??e.id??t))]})}),(0,K.jsx)(iy,{clauses:o,columnsByKey:te,indicators:a.tableFilterIndicators,processing:_,onRemoveClause:d,onChange:p,onReset:m}),D&&k.active&&(0,K.jsx)(Bv,{actions:E,selectedKeys:k.selectedKeys,allMatching:k.allMatching,total:i.total??void 0,query:x_(a),canSelectAllMatching:k.allVisibleSelected&&!k.allMatching&&i.total!=null&&i.total>k.selectedKeys.length,onSelectAllMatching:k.selectAllMatching,onCompleted:k.clear}),a.sorts.length>0&&(0,K.jsx)(cy,{columnsByKey:te,query:a,processing:_,onClear:S}),(0,K.jsxs)(_v,{ref:We,columns:Ve,pinned:fe,style:Ue,children:[(0,K.jsxs)(vv,{children:[(0,K.jsxs)(yv,{children:[M&&(0,K.jsx)(Sv,{kind:`expander`,bottomBordered:!we,pinBoundary:Me,pinned:qe?.start}),D&&(0,K.jsx)(Sv,{kind:`selection`,bottomBordered:!we,pinBoundary:Ne,pinned:qe?.start,children:(0,K.jsx)(Ff,{"aria-label":t(`table.select-all-rows`,`Select all rows`),"data-test":`select-all`,checked:k.allSelected,onCheckedChange:()=>k.toggleAll()})}),de.map((e,t)=>{let n=fe?R(e):null;return(0,K.jsxs)(z.Fragment,{children:[fe&&t===pe&&(0,K.jsx)(Sv,{kind:`filler`,bottomBordered:!we}),(0,K.jsx)(ny,{column:e,processing:_,pinBoundary:Iy(n,t,ke,pe),pinIndex:t,pinned:n??void 0,resizeHandleProps:Re?Be(Ie[t]):void 0,sort:x,query:a,bottomBordered:!we})]},e.key)}),fe&&pe===-1&&(0,K.jsx)(Sv,{kind:`filler`,bottomBordered:!we}),Oe&&(0,K.jsx)(Sv,{kind:`actions`,bottomBordered:!we,pinBoundary:Pe,pinned:qe?.end,children:(0,K.jsx)(`span`,{className:`sr-only`,children:e.props?.actionsLabel??t(`table.actions`,`Actions`)})})]}),we&&(0,K.jsxs)(yv,{children:[M&&(0,K.jsx)(Dv,{kind:`expander`,pinBoundary:Me,pinned:qe?.start}),D&&(0,K.jsx)(Dv,{kind:`selection`,pinBoundary:Ne,pinned:qe?.start}),de.map((e,t)=>{let n=fe?R(e):null;return(0,K.jsxs)(z.Fragment,{children:[fe&&t===pe&&(0,K.jsx)(Dv,{kind:`filler`}),(0,K.jsx)(Dv,{pinBoundary:Iy(n,t,ke,pe),pinIndex:t,pinned:n??void 0,children:e.props.filter!=null&&(0,K.jsx)(Jv,{column:e,clauses:Te.filter(t=>t.clause.field===e.key),processing:_,onAdd:l,onUpdate:u,onRemove:d,onReplace:f,onSearch:(t,n)=>g(`column:${e.key}`,t,n)})})]},e.key)}),fe&&pe===-1&&(0,K.jsx)(Dv,{kind:`filler`}),Oe&&(0,K.jsx)(Dv,{kind:`actions`,pinBoundary:Pe,pinned:qe?.end})]})]}),(0,K.jsx)(Ov,{children:v?O.length===0?(0,K.jsx)(Fv,{children:e.props?.emptyLabel??t(`table.empty`,`No results`)}):O.map(({row:n,actions:r,detail:i,key:a,url:o})=>{let s=i!=null&&A(a),c=`${X(e)??`table`}-row-detail-${a}`;return(0,K.jsxs)(z.Fragment,{children:[(0,K.jsxs)(Av,{clickable:o!=null,"data-row-link":o??void 0,striped:Ce,onClick:e=>zy(e,o,ee),onAuxClick:e=>By(e,o),children:[M&&(0,K.jsx)(Mv,{kind:`expander`,pinBoundary:Me,pinned:qe?.start,children:i&&(0,K.jsx)(Nv,{"data-test":`row-expand-${a}`,expanded:s,"aria-controls":c,"aria-label":t(`table.row-detail.toggle`,`Toggle detail`),onClick:()=>j(a)})}),D&&(0,K.jsx)(Mv,{kind:`selection`,pinBoundary:Ne,pinned:qe?.start,children:(0,K.jsx)(Ff,{"aria-label":t(`table.select-row`,`Select row {{key}}`,{key:a}),"data-test":`select-row-${a}`,checked:k.isSelected(a),onCheckedChange:()=>k.toggle(a)})}),de.map((e,t)=>{let r=fe?R(e):null;return(0,K.jsxs)(z.Fragment,{children:[fe&&t===pe&&(0,K.jsx)(Mv,{kind:`filler`}),(0,K.jsx)(Mv,{align:e.props.align,label:e.props.label,pinBoundary:Iy(r,t,ke,pe),pinIndex:t,pinned:r??void 0,children:(0,K.jsx)(Fy,{column:e,row:n})})]},e.key)}),fe&&pe===-1&&(0,K.jsx)(Mv,{kind:`filler`}),Oe&&(0,K.jsx)(Mv,{kind:`actions`,pinBoundary:Pe,pinned:qe?.end,children:r.map((e,t)=>(0,K.jsx)(Zt,{node:e},e.key??e.id??t))})]}),s&&i&&(0,K.jsx)(Pv,{id:c,children:(0,K.jsx)($e,{nodes:[i]})})]},a)}):(0,K.jsx)(Iv,{children:t(`table.loading`,`Loading rows...`)})})]}),v&&(0,K.jsx)(sy,{pagination:i,currentPage:ge,processing:_,mode:ve,hasNextPage:xe,visiblePages:be,infiniteLoaderRef:b,perPageOptions:ye,perPageValue:ve===`infinite`?`infinite`:a.perPage,onPerPage:w,onPage:C,onLoadMore:T})]})})},name:`lattice/table`},Hy=`--lt-sticky-offset`,Uy=`--lt-sticky-own-top`;function Wy(e){let t=(0,z.useRef)(null);return Wd(()=>{let n=t.current,r=n?.parentElement;if(!e||!n||!r||typeof ResizeObserver>`u`)return;let i=Gy(r.parentElement);n.style.setProperty(Uy,i);let a=()=>{r.style.setProperty(Hy,`calc(${i} + ${n.offsetHeight}px)`)};a();let o=new ResizeObserver(a);return o.observe(n),()=>{o.disconnect(),r.style.removeProperty(Hy),n.style.removeProperty(Uy)}},[e]),t}function Gy(e){return e&&getComputedStyle(e).getPropertyValue(`--lt-sticky-offset`).trim()||`0px`}var Ky={center:`justify-items-center text-center`,end:`justify-items-end text-end`,start:`justify-items-start text-start`,stretch:`justify-items-stretch`},qy={center:`items-center text-center`,end:`items-end text-end`,start:`items-start text-start`,stretch:`items-stretch justify-stretch`},Jy={none:`gap-0`,xs:`gap-1`,sm:`gap-2`,md:`gap-4`,lg:`gap-6`,xl:`gap-8`},Yy={full:`w-full`,auto:`w-auto`,sm:`mx-auto w-full max-w-md`,md:`mx-auto w-full max-w-2xl`,lg:`mx-auto w-full max-w-4xl`,xl:`mx-auto w-full max-w-6xl`,fill:`min-w-0 flex-1`},Xy={full:`h-full`,screen:`min-h-screen`},Zy={start:`mr-auto`,end:`ml-auto`},Qy=`sticky top-[var(--lt-sticky-own-top,var(--lt-sticky-offset))] z-lt-sticky -my-4 bg-lt-bg py-4`;function $y({align:e=`stretch`,className:t,direction:n=`vertical`,float:r,gap:i=`md`,height:a,justify:o,sticky:s=!1,width:c=`full`,...l}){let u=n===`horizontal`||o!==void 0,d=Wy(s);return(0,K.jsx)(`div`,{"data-slot":`stack`,"data-sticky":s||void 0,ref:d,className:x(u?x(`flex`,n===`horizontal`?`flex-wrap`:`flex-col`):`grid content-start`,u?qy[e]:Ky[e],Jy[i],Yy[c],o?Fm[o]:null,a?Xy[a]:null,r?Zy[r]:null,s&&Qy,t),...l})}var eb=(0,z.createContext)(null);function tb({children:e,className:t,defaultOpen:n=null,gap:r,items:i,...a}){let[o,s]=(0,z.useState)(n),[c,l]=(0,z.useState)(n);n!==c&&(l(n),s(n));let u=(0,z.useMemo)(()=>({items:i,openItem:o,setOpenItem:s}),[i,o]);return(0,K.jsx)(`div`,{"data-slot":`accordion`,className:x(`flex flex-col`,r?Jy[r]:null,t),...a,children:(0,K.jsx)(eb.Provider,{value:u,children:e})})}function nb(e){let t=(0,z.useContext)(eb);return t===null||e===void 0||!t.items.includes(e)?null:{open:t.openItem===e,setOpen:n=>t.setOpenItem(n?e:null)}}var rb={xs:`size-6 text-[0.5rem]`,sm:`size-8 text-xs`,md:`size-10 text-sm`,lg:`size-12 text-base`,xl:`size-16 text-lg`,"2xl":`size-20 text-xl`,"3xl":`size-24 text-2xl`,"4xl":`size-32 text-3xl`};function ib({className:e,name:t,shape:n=`circle`,size:r=`md`,src:i,...a}){let o=t??void 0;return(0,K.jsx)(`span`,{"data-slot":`avatar`,role:i?void 0:`img`,"aria-label":i?void 0:o,className:x(`inline-flex shrink-0 items-center justify-center overflow-hidden bg-lt-muted font-medium text-lt-muted-fg select-none`,n===`rounded`?`rounded-lt`:`rounded-full`,rb[r],e),...a,children:i?(0,K.jsx)(`img`,{src:i,alt:o??``,className:`size-full object-cover`}):t?ab(t):(0,K.jsx)(ob,{})})}function ab(e){return e.trim().split(/\s+/).slice(0,2).map(e=>e.charAt(0).toUpperCase()).join(``)}function ob(){return(0,K.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,className:`size-[60%]`,children:[(0,K.jsx)(`path`,{d:`M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2`}),(0,K.jsx)(`circle`,{cx:`12`,cy:`7`,r:`4`})]})}function sb({"aria-label":e=`Breadcrumb`,className:t,items:n,separator:r=`/`,...i}){let{Link:a}=Bl();return n.length===0?null:(0,K.jsx)(`nav`,{...i,"aria-label":e,className:x(`min-w-0 flex-1`,t),children:(0,K.jsx)(`ol`,{className:`flex items-center gap-2 text-sm text-lt-muted-fg`,children:n.map((e,t)=>{let i=t===n.length-1;return(0,K.jsxs)(z.Fragment,{children:[(0,K.jsx)(`li`,{className:`min-w-0`,children:i||!e.href?(0,K.jsx)(`span`,{"aria-current":i?`page`:void 0,className:x(`block truncate`,i&&`text-lt-fg`),children:e.label}):(0,K.jsx)(a,{className:`block truncate hover:text-lt-fg`,href:e.href,children:e.label})}),i?null:(0,K.jsx)(`li`,{"aria-hidden":`true`,children:r})]},e.href??t)})})})}var cb={primary:{accent:`border-l-lt-primary`,icon:(0,K.jsx)(y,{name:`info`,className:`size-lt-icon-lg shrink-0 text-lt-primary`})},secondary:{accent:`border-l-lt-secondary`,icon:(0,K.jsx)(y,{name:`info`,className:`size-lt-icon-lg shrink-0 text-lt-muted-fg`})},success:{accent:`border-l-lt-success`,icon:(0,K.jsx)(y,{name:`circle-check`,className:`size-lt-icon-lg shrink-0 text-lt-success`})},info:{accent:`border-l-lt-info`,icon:(0,K.jsx)(y,{name:`info`,className:`size-lt-icon-lg shrink-0 text-lt-info`})},warning:{accent:`border-l-lt-warning`,icon:(0,K.jsx)(y,{name:`circle-alert`,className:`size-lt-icon-lg shrink-0 text-lt-warning`})},danger:{accent:`border-l-lt-danger`,icon:(0,K.jsx)(y,{name:`circle-x`,className:`size-lt-icon-lg shrink-0 text-lt-danger`})}};function lb({variant:e,message:t,title:n,action:r,dismissible:i=!0,dismissLabel:a=`Dismiss`,onDismiss:o,className:s,...c}){return(0,K.jsxs)(`div`,{role:`status`,"data-test":`callout-${e}`,className:x(`flex items-start gap-3 rounded-lt border border-l-4 border-lt-border bg-lt-popover p-4 text-lt-popover-fg`,cb[e].accent,s),...c,children:[cb[e].icon,(0,K.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-2`,children:[n?(0,K.jsx)(`p`,{className:`text-sm font-medium text-lt-fg`,children:n}):null,(0,K.jsx)(`p`,{className:`text-sm text-lt-fg`,children:t}),r?(0,K.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:r}):null]}),i?(0,K.jsx)(`button`,{type:`button`,"aria-label":a,"data-test":`callout-dismiss`,className:`shrink-0 rounded-lt-sm p-1 text-lt-muted-fg transition-colors hover:bg-lt-muted hover:text-lt-fg`,onClick:o,children:(0,K.jsx)(y,{name:`x`,className:`size-lt-icon-md`})}):null]})}function ub({"aria-label":e,className:t,content:n,defaultOpen:r,onOpenChange:i,open:a,trigger:o,triggerProps:s}){let{t:c}=N(F);if(!db(n))return null;let l=db(o);return(0,K.jsxs)(Qt,{defaultOpen:r,onOpenChange:i,open:a,children:[(0,K.jsx)(Fe,{...s,type:`button`,"aria-label":e??(l?void 0:c(`common.more-info`,`More information`)),className:l?`inline-flex items-center rounded-lt-sm outline-none focus-visible:ring-lt-ring/50 focus-visible:ring-[length:var(--lt-ring-width)]`:`ml-1 inline-flex rounded-lt-sm text-lt-muted-fg outline-none hover:text-lt-fg focus-visible:text-lt-fg focus-visible:ring-lt-ring/50 focus-visible:ring-[length:var(--lt-ring-width)]`,children:l?o:(0,K.jsx)(y,{name:`info`,className:`size-lt-icon-sm`})}),(0,K.jsx)(Yt,{align:`start`,className:x(`max-w-xs p-3 text-sm [&_a]:underline`,t),children:n})]})}function db(e){return e!=null&&e!==!1&&e!==``}function fb({children:e,className:t,description:n,headerActions:r,title:i,tooltip:a,...o}){let s=_b(i),c=_b(n),l=_b(r),u=s||c||l;return(0,K.jsxs)(`article`,{...o,"data-slot":`card`,className:x(`flex flex-col gap-6 rounded-lt border border-lt-border bg-lt-surface py-lt-gutter text-lt-surface-fg shadow-lt-sm`,t),children:[u?(0,K.jsxs)(pb,{children:[s||l?(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,K.jsxs)(`div`,{className:`flex items-center`,children:[s?(0,K.jsx)(mb,{children:i}):null,s?(0,K.jsx)(ub,{content:a}):null]}),l?(0,K.jsx)(`div`,{className:`flex items-center gap-2`,children:r}):null]}):null,c?(0,K.jsxs)(`div`,{className:`flex items-center`,children:[(0,K.jsx)(hb,{children:n}),s?null:(0,K.jsx)(ub,{content:a})]}):null]}):null,_b(e)?(0,K.jsx)(gb,{className:`flex flex-col gap-6`,children:e}):null]})}function pb({className:e,...t}){return(0,K.jsx)(`div`,{"data-slot":`card-header`,className:x(`flex flex-col gap-1.5 px-lt-gutter`,e),...t})}function mb({className:e,...t}){return(0,K.jsx)(`div`,{"data-slot":`card-title`,className:x(`font-semibold leading-none`,e),...t})}function hb({className:e,...t}){return(0,K.jsx)(`div`,{"data-slot":`card-description`,className:x(`text-sm text-lt-muted-fg`,e),...t})}function gb({className:e,...t}){return(0,K.jsx)(`div`,{"data-slot":`card-content`,className:x(`px-lt-gutter`,e),...t})}function _b(e){return e!=null&&e!==!1&&e!==``}var vb=(0,z.lazy)(()=>fn(()=>import(`./chart-view-ZlKGh0mY.js`),__vite__mapDeps([20,1,2,21,3,5,7,22,15]),import.meta.url));function yb({categoryFormat:e=null,categoryKey:t=null,className:n,data:r,description:i=null,grid:a=!0,height:o=320,legend:s=!0,series:c,title:l=null,tooltip:u=!0,valueFormat:d=null,xAxis:f=!0,yAxis:p=!0,...m}){let h=l!==null||i!==null;return(0,K.jsxs)(`div`,{...m,className:x(`flex flex-col gap-3 rounded-lt border border-lt-border bg-lt-surface p-4 text-lt-surface-fg shadow-lt-sm`,n),children:[h&&(0,K.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1.5`,children:[l!==null&&(0,K.jsx)(`div`,{className:`text-sm font-semibold leading-tight`,children:l}),i!==null&&(0,K.jsx)(`div`,{className:`text-xs leading-5 text-lt-muted-fg`,children:i})]}),(0,K.jsx)(`div`,{className:`min-h-0 w-full`,children:(0,K.jsx)(z.Suspense,{fallback:(0,K.jsx)(`div`,{style:{height:o}}),children:(0,K.jsx)(vb,{categoryFormat:e,categoryKey:t,data:r,grid:a,height:o,legend:s,series:c,tooltip:u,valueFormat:d,xAxis:f,yAxis:p})})})]})}var bb=(0,z.lazy)(()=>fn(()=>import(`./code-block-view-4IbUdTmO.js`),__vite__mapDeps([23,1,2,5,14]),import.meta.url));function xb({"aria-label":e,children:t,className:n,copyable:r=!1,language:i=`text`,lineNumbers:a=!1,maxHeight:o=null,role:s=e?`region`:void 0,wrap:c=!1,...l}){let u=(0,K.jsx)(`pre`,{className:x(`max-w-full overflow-auto p-3 font-lt-mono text-xs`,c&&`whitespace-pre-wrap wrap-anywhere`),style:{maxHeight:o??void 0},children:a?(0,K.jsx)(`code`,{className:`grid grid-cols-[auto_1fr]`,children:t.split(`
118
- `).map((e,t)=>(0,K.jsxs)(z.Fragment,{children:[(0,K.jsx)(`span`,{"aria-hidden":`true`,className:`mr-3 border-r border-lt-border pr-3 text-right text-lt-muted-fg select-none`,children:t+1}),(0,K.jsx)(`span`,{children:e||`​`})]},t))}):t});return(0,K.jsxs)(`div`,{"data-slot":`code-block`,"aria-label":e,role:s,...l,className:x(`relative max-w-full overflow-hidden rounded-lt-sm bg-lt-muted text-lt-fg`,n),children:[r?(0,K.jsx)(Ph,{value:t,label:e??`code`,iconOnly:!0,className:`absolute top-3 right-6 z-10 bg-lt-bg/80 hover:bg-lt-bg`}):null,(0,K.jsx)(z.Suspense,{fallback:u,children:(0,K.jsx)(bb,{language:i,lineNumbers:a,maxHeight:o,wrap:c,children:t})})]})}function Sb(e,t,n){let[r,i]=Up(e,t,{enabled:n,parse:e=>e===`true`,serialize:String});return[r,(0,z.useCallback)(()=>i(e=>!e),[i])]}function Cb({children:e,className:t,defaultOpen:n,onOpenChange:r,open:i,storageKey:a,tooltip:o,trigger:s,triggerProps:c,...l}){let u=(0,z.useId)(),[d,f]=Sb(a??``,n??!1,i===void 0&&a!==void 0),p=i??d,{className:m,onClick:h,onKeyDown:g,..._}=c??{};function v(e){i===void 0&&e!==d&&f(),r?.(e)}function b(e){h?.(e),!(e.defaultPrevented||wb(e.target,e.currentTarget))&&v(!p)}function S(e){g?.(e),!(e.defaultPrevented||e.target!==e.currentTarget)&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),v(!p))}return(0,K.jsxs)(`div`,{"data-slot":`collapsible`,"data-state":p?`open`:`closed`,className:t,...l,children:[(0,K.jsxs)(`div`,{..._,"aria-controls":u,"aria-expanded":p,"data-slot":`collapsible-trigger`,className:x(`flex min-h-11 w-full cursor-pointer items-center justify-between gap-4 rounded-lt-sm py-2 text-left text-lt-fg transition-colors select-none hover:bg-lt-muted focus-visible:ring-[length:var(--lt-ring-width)] focus-visible:ring-lt-ring/50 focus-visible:outline-none`,m),onClick:b,onKeyDown:S,role:`button`,tabIndex:0,children:[(0,K.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-2`,children:[s,o?(0,K.jsx)(Ft,{content:o}):null]}),(0,K.jsx)(y,{name:`chevron-down`,className:x(`size-lt-icon-md shrink-0 text-lt-muted-fg transition-transform motion-reduce:transition-none`,!p&&`-rotate-90`)})]}),p&&e!=null?(0,K.jsx)(`div`,{id:u,"data-slot":`collapsible-content`,className:`flex flex-col gap-4 pt-2`,children:e}):null]})}function wb(e,t){if(!(e instanceof Element))return!1;let n=e.closest(`a[href], button, input, select, textarea, [contenteditable="true"], [role="button"]`);return n!==null&&n!==t}var Tb=(0,z.createContext)(`description-list`);function Eb({children:e,value:t}){return(0,K.jsx)(Tb.Provider,{value:t,children:e})}function Db(){return(0,z.useContext)(Tb)}function Ob({bleed:e=!1,children:t,className:n,divided:r=!1,emptyLabel:i,semantic:a=`description-list`,...o}){let s=a===`description-list`,c=x(`w-full`,r&&`divide-y divide-lt-border`,e&&`-mx-lt-gutter w-auto`,n),l=t??(i?(0,K.jsx)(`p`,{className:`px-lt-gutter py-3 text-sm text-lt-muted-fg`,children:i}):null);return(0,K.jsx)(Eb,{value:a,children:s?(0,K.jsx)(`dl`,{...o,className:c,"data-slot":`description-list`,children:l}):(0,K.jsx)(`div`,{...o,className:c,"data-slot":`description-list`,role:`list`,children:l})})}function kb({align:e=`start`,children:t,className:n,contentClassName:r,placement:i=`bottom`,trigger:a,...o}){let[s,c]=(0,z.useState)(!1),{onNavigate:l}=Bl();return(0,z.useEffect)(()=>l(()=>c(!1)),[l]),(0,K.jsxs)(Qt,{open:s,onOpenChange:c,children:[(0,K.jsx)(Fe,{asChild:!0,children:(0,K.jsx)(`button`,{...o,className:x(`w-full`,n),type:`button`,children:a})}),(0,K.jsx)(Yt,{align:e,className:x(`min-w-56 p-1`,r),role:`menu`,side:i,children:(0,K.jsx)(Jt,{collapsed:!1,children:t})})]})}function Ab({"aria-label":e,children:t,className:n,defaultOpen:r=!1,offset:i=16,onOpenChange:a,open:o,placement:s=`bottom-end`,role:c,style:l,trigger:u,triggerProps:d,...f}){let[p,m]=(0,z.useState)(r),h=o??p,{className:g,onClick:_,...v}=d??{},y=jb(s,Math.max(0,i));if(u==null)return(0,K.jsx)(`div`,{"aria-label":e,className:x(`fixed z-lt-popover max-w-[calc(100vw-2rem)] rounded-lt border border-lt-border bg-lt-popover p-1 text-lt-popover-fg shadow-lt-md`,n),role:e?c??`group`:c,...f,style:{...y,...l},children:t});let b=s===`bottom-start`||s===`bottom-end`,S=s===`top-start`||s===`bottom-start`;function C(e){if(_?.(e),e.defaultPrevented)return;let t=!h;o===void 0&&m(t),a?.(t)}return(0,K.jsx)(`div`,{"aria-label":e,className:x(`fixed z-lt-popover max-w-[calc(100vw-2rem)]`,n),role:e?c??`group`:c,...f,style:{...y,...l},children:(0,K.jsxs)(`div`,{className:x(`flex w-fit gap-2`,b?`flex-col-reverse`:`flex-col`),children:[(0,K.jsx)(`button`,{...v,"aria-expanded":h,className:x(`inline-flex items-center gap-2 rounded-lt border border-lt-border bg-lt-popover px-3 py-1.5 text-sm font-medium text-lt-popover-fg shadow-lt-md hover:bg-lt-muted`,S?`self-start`:`self-end`,g),onClick:C,type:`button`,children:u}),(0,K.jsx)(`div`,{className:h?`block`:`hidden`,children:t})]})})}function jb(e,t){return e===`top-start`?{left:t,top:t}:e===`top-end`?{right:t,top:t}:e===`bottom-start`?{bottom:t,left:t}:{bottom:t,right:t}}function Mb(e,t,n){let r=Object.entries(e??{});if(r.length!==0)return Object.fromEntries(r.map(([e,r])=>[`${t}-${e}`,n(r)]))}var Nb=e=>typeof e==`number`?`repeat(${e}, minmax(0, 1fr))`:e,Pb=e=>e===`full`?`1 / -1`:`span ${e} / span ${e}`;function Fb({className:e,columns:t,style:n,...r}){return(0,K.jsx)(`div`,{"data-slot":`grid`,className:x(`lt-grid grid gap-x-4 gap-y-6`,e),style:{...n,...Mb(t,`--lt-grid-cols`,Nb)},...r})}function Ib({className:e,columnSpan:t,style:n,...r}){return(0,K.jsx)(`div`,{"data-slot":`grid-item`,className:e,style:{...n,...Mb(t,`--lt-col-span`,Pb)},...r})}function Lb({children:e,className:t,copyable:n=!1,copyLabel:r,copyValue:i,level:a=1,tooltip:o,...s}){let c=Math.min(Math.max(a,1),6),l=Rb(c),u=(0,K.jsxs)(l,{"data-slot":`heading`,className:x(`font-semibold tracking-normal text-balance text-lt-fg`,c===1&&`text-2xl font-bold leading-tight`,c===2&&`text-xl`,c>2&&`text-base`,t),...s,children:[e,(0,K.jsx)(Ft,{content:o})]}),d=i??(typeof e==`string`?e:void 0);return!n||d===void 0?u:(0,K.jsx)(Fh,{value:d,label:r??d,children:u})}function Rb(e){switch(e){case 1:return`h1`;case 2:return`h2`;case 3:return`h3`;case 4:return`h4`;case 5:return`h5`;default:return`h6`}}function zb({alt:e,circular:t=!1,className:n,height:r,previewable:i=!1,size:a,width:o,...s}){return(0,K.jsx)(by,{...s,alt:e??``,className:x(`object-cover`,t?`rounded-full`:`rounded-lt-sm`,n),height:a??r,previewable:i,width:a??o})}function Bb({children:e,listClassName:t,...n}){return(0,K.jsx)(`nav`,{...n,children:(0,K.jsx)(`ul`,{className:x(`flex flex-col gap-1`,t),children:e})})}var Vb=`flex items-center gap-2 rounded-lt-sm px-3 py-2 text-base font-medium text-lt-fg transition-colors hover:bg-lt-muted`;function Hb(e){return typeof e==`string`?e:void 0}function Ub({active:e=!1,children:t,className:n,defaultOpen:r=!1,disabled:i=!1,href:a,icon:o,label:s,method:c,onClick:l,onOpenChange:u,open:d,prefix:f,suffix:p,...m}){let h=Pe(),{Link:g}=Bl(),_=o!=null,v=Hb(s),y=_?o:(0,K.jsxs)(K.Fragment,{children:[f,h?(0,K.jsx)(`span`,{className:`pointer-events-none absolute top-1/2 left-full z-lt-popover ml-2 hidden -translate-y-1/2 rounded-lt-sm border border-lt-border bg-lt-popover px-2 py-1 text-sm whitespace-nowrap text-lt-popover-fg shadow-lt-md group-hover:block`,role:`tooltip`,children:s}):(0,K.jsx)(`span`,{children:s}),p?(0,K.jsx)(`span`,{className:`ml-auto flex shrink-0 items-center`,children:p}):null]}),b=x(Vb,`w-full`,h&&`group relative justify-center`,_&&`justify-center`),S=h||_?v:void 0;return t?h?(0,K.jsx)(`li`,{className:n,children:(0,K.jsx)(kb,{...m,"aria-label":v,className:x(Vb,`justify-center`),contentClassName:`min-w-48`,placement:`right`,title:v,trigger:o??f??(0,K.jsx)(`span`,{children:s}),children:(0,K.jsxs)(`ul`,{className:`flex flex-col gap-1`,children:[(0,K.jsx)(`li`,{className:`px-3 py-1.5 text-xs font-semibold tracking-wide text-lt-muted-fg uppercase`,children:s}),t]})})}):(0,K.jsx)(Wb,{...m,className:n,content:y,defaultOpen:r,onOpenChange:u,open:d,children:t}):a===void 0?l?(0,K.jsx)(`li`,{className:n,children:(0,K.jsx)(`button`,{...m,"aria-label":S,className:b,disabled:i,onClick:l,type:`button`,children:y})}):h?null:(0,K.jsx)(`li`,{className:n,children:(0,K.jsx)(`span`,{...m,className:`flex items-center gap-2 px-3 py-2 text-xs font-semibold tracking-wide text-lt-muted-fg uppercase`,children:y})}):(0,K.jsx)(`li`,{className:n,children:(0,K.jsx)(g,{...m,"aria-current":e?`page`:void 0,"aria-label":S,className:x(b,e&&`bg-lt-muted font-medium`),href:a,method:c,children:y})})}function Wb({children:e,className:t,content:n,defaultOpen:r,onOpenChange:i,open:a,...o}){let[s,c]=(0,z.useState)(r),l=a??s;function u(){a===void 0&&c(!l),i?.(!l)}return(0,K.jsxs)(`li`,{className:t,children:[(0,K.jsxs)(`button`,{...o,"aria-expanded":l,className:x(Vb,`w-full`),onClick:u,type:`button`,children:[n,(0,K.jsx)(y,{name:`chevron-right`,className:x(`ml-auto size-lt-icon-md shrink-0 transition-transform`,l&&`rotate-90`)})]}),l?(0,K.jsx)(`ul`,{className:`mt-1 flex flex-col gap-1 pl-3`,children:e}):null]})}var Gb={xs:`h-1`,sm:`h-1.5`,md:`h-2.5`,lg:`h-3`,xl:`h-4`,"2xl":`h-5`,"3xl":`h-6`,"4xl":`h-8`},Kb={xs:24,sm:32,md:40,lg:48,xl:64,"2xl":80,"3xl":96,"4xl":128},qb={xs:`text-[0.5rem]`,sm:`text-[0.625rem]`,md:`text-xs`,lg:`text-sm`,xl:`text-base`,"2xl":`text-lg`,"3xl":`text-xl`,"4xl":`text-2xl`};function Jb({"aria-label":e,className:t,color:n,locale:r,max:i=100,shape:a=`bar`,showValue:o=!1,size:c=`md`,value:l,...u}){let{locale:d}=s(),f=on(cn(n)??sn(`primary`)),p=i>0?Math.min(Math.max(l,0),i):0,m=i>0?p/i:0,h=new Intl.NumberFormat(r??d,{maximumFractionDigits:0,style:`percent`}).format(m),g={"aria-label":e,"aria-valuemax":i,"aria-valuemin":0,"aria-valuenow":p,"aria-valuetext":h,role:`progressbar`};if(a===`circle`){let e=Kb[c],n=Math.max(3,e/10),r=(e-n)/2,i=2*Math.PI*r;return(0,K.jsxs)(`div`,{...u,...g,className:x(`relative inline-flex`,t),"data-lattice-progress":`circle`,children:[(0,K.jsxs)(`svg`,{className:`-rotate-90`,height:e,width:e,children:[(0,K.jsx)(`circle`,{className:`text-lt-muted`,cx:e/2,cy:e/2,fill:`none`,r,stroke:`currentColor`,strokeWidth:n}),(0,K.jsx)(`circle`,{cx:e/2,cy:e/2,fill:`none`,r,stroke:`currentColor`,strokeDasharray:i,strokeDashoffset:i*(1-m),strokeLinecap:`round`,strokeWidth:n,style:{color:f}})]}),o?(0,K.jsx)(`span`,{className:x(`absolute inset-0 flex items-center justify-center font-medium text-lt-fg tabular-nums`,qb[c]),children:h}):null]})}return(0,K.jsxs)(`div`,{...u,className:x(`flex w-full items-center gap-2`,t),"data-lattice-progress":`bar`,children:[(0,K.jsx)(`div`,{...g,className:x(`w-full overflow-hidden rounded-full bg-lt-muted`,Gb[c]),children:(0,K.jsx)(`div`,{className:`h-full rounded-full`,style:{background:f,width:`${m*100}%`}})}),o?(0,K.jsx)(`span`,{className:`shrink-0 text-lt-muted-fg text-sm tabular-nums`,children:h}):null]})}function Yb({children:e,className:t,collapsed:n,collapsible:r=!1,collapseLabel:i=`Collapse section`,defaultCollapsed:a=!1,description:o,expandLabel:s=`Expand section`,headerActions:c,onCollapsedChange:l,storageKey:u,title:d,toggleProps:f,tooltip:p,...m}){let[h,g]=Sb(u??``,a,r&&n===void 0&&u!==void 0),_=r&&(n??h),v=Xb(d),b=Xb(o),S=Xb(c),C=v||b||S||r,{className:w,onClick:T,...E}=f??{};function D(e){if(T?.(e),e.defaultPrevented)return;let t=!_;n===void 0&&g(),l?.(t)}return(0,K.jsxs)(`section`,{...m,"data-slot":`section`,className:x(`flex flex-col gap-6 rounded-lt border border-lt-border bg-lt-surface py-lt-gutter text-lt-surface-fg shadow-lt-sm`,t),children:[C?(0,K.jsxs)(`div`,{className:`flex items-start justify-between gap-4 px-lt-gutter`,children:[(0,K.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2`,children:[r?(0,K.jsx)(`button`,{...E,"aria-expanded":!_,"aria-label":_?s:i,className:x(`mt-0.5 inline-flex shrink-0 items-center rounded-lt-sm p-0.5 text-lt-muted-fg transition-colors hover:bg-lt-muted hover:text-lt-fg`,w),onClick:D,type:`button`,children:(0,K.jsx)(y,{name:`chevron-down`,className:x(`size-lt-icon-md transition-transform`,_&&`-rotate-90`)})}):null,(0,K.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1.5`,children:[v?(0,K.jsxs)(`div`,{className:`flex items-center`,children:[(0,K.jsx)(`div`,{className:`font-semibold leading-none`,children:d}),(0,K.jsx)(Ft,{content:p})]}):null,b?(0,K.jsxs)(`div`,{className:`flex items-center`,children:[(0,K.jsx)(`div`,{className:`text-sm text-lt-muted-fg`,children:o}),v?null:(0,K.jsx)(Ft,{content:p})]}):null]})]}),S?(0,K.jsx)(`div`,{className:`flex shrink-0 items-center gap-2`,children:c}):null]}):null,!_&&Xb(e)?(0,K.jsx)(`div`,{className:`flex flex-col gap-6 px-lt-gutter`,children:e}):null]})}function Xb(e){return e!=null&&e!==!1&&e!==``}function Zb({bleed:e=!1,className:t,orientation:n=`horizontal`,...r}){let i=n===`horizontal`;return(0,K.jsx)(`div`,{...r,role:`separator`,"aria-orientation":n,"data-bleed":e?``:void 0,"data-slot":`separator`,className:x(`shrink-0 bg-lt-border`,i?`h-px w-full`:`h-full w-px self-stretch`,e&&(i?`-mx-lt-gutter w-auto`:`-my-lt-gutter h-auto`),t)})}var Qb=`(min-width: 768px)`;function $b({backdropProps:e,children:t,className:n,collapsed:r=!1,defaultOpen:i=!1,onOpenChange:a,open:o,...s}){let c=$p(Qb,!0),[l,u]=(0,z.useState)(i),d=o??l,f=r&&c;function p(){o===void 0&&u(!1),a?.(!1)}return Fl(`keydown`,e=>{e.key===`Escape`&&p()},{enabled:d}),(0,K.jsxs)(Jt,{collapsed:f,children:[d?(0,K.jsx)(`div`,{...e,"aria-hidden":`true`,className:x(`fixed inset-0 z-lt-overlay bg-lt-overlay md:hidden`,e?.className),onClick:p}):null,(0,K.jsx)(`aside`,{...s,className:x(`fixed inset-y-0 left-0 z-lt-modal flex h-svh w-72 max-w-[80vw] shrink-0 flex-col gap-4 border-r border-lt-border bg-lt-bg p-4 transition-transform`,`md:sticky md:top-0 md:z-auto md:max-w-none md:translate-x-0 md:transition-[width]`,d?`translate-x-0`:`-translate-x-full`,f?`md:w-16 md:overflow-visible`:`md:w-64 md:overflow-x-hidden md:overflow-y-auto`,n),"data-collapsed":f?`true`:`false`,children:t})]})}function ex({className:e,...t}){return(0,K.jsx)(`div`,{...t,className:x(`mt-auto flex flex-col gap-4`,e)})}var tx=(0,z.createContext)(null),nx=`sticky top-[calc(var(--lt-sticky-offset)+--spacing(6))]`,rx=3;function ix(){return(0,z.useContext)(tx)??{activeValue:``,hasTablist:!0}}function ax({"aria-label":e=`Tabs`,alignment:t=`stretch`,children:n,className:r,defaultValue:i,items:a,onValueChange:o,orientation:s=`horizontal`,sticky:c=!1,value:l,...u}){let d=sx(n),f=a??d.map(({props:e})=>e),p=f[0]?.value??``,[m,h]=(0,z.useState)(()=>i||p),g=l??m,_=(0,z.useRef)(null),v=s===`vertical`,y=!v&&t===`stretch`,b=!$p(`(min-width: 768px)`,!0)&&(v||f.length>rx),S=(0,z.useMemo)(()=>({activeValue:g,hasTablist:!b}),[g,b]);function C(e){f.some(t=>t.value===e)&&(l===void 0&&h(e),o?.(e))}function w(e){let t=v?`ArrowDown`:`ArrowRight`,n=v?`ArrowUp`:`ArrowLeft`;if(e.key!==t&&e.key!==n&&e.key!==`Home`&&e.key!==`End`)return;let r=Array.from(_.current?.querySelectorAll(`[role="tab"]`)??[]);if(r.length===0)return;e.preventDefault();let i=r.indexOf(document.activeElement),a;if(e.key===`Home`)a=0;else if(e.key===`End`)a=r.length-1;else{let n=e.key===t?1:-1;a=((i<0?0:i)+n+r.length)%r.length}r[a]?.focus()}return(0,K.jsx)(tx.Provider,{value:S,children:(0,K.jsxs)(`div`,{...u,className:x(`min-w-0 gap-6`,v&&!b?x(`flex`,t===`end`&&`flex-row-reverse`):`grid`,r),children:[b?(0,K.jsx)(Vv,{"aria-label":e,"data-test":`tabs-select`,onChange:e=>C(e.target.value),value:g,children:f.map(e=>(0,K.jsx)(`option`,{value:e.value,children:e.selectLabel??cx(e.label,e.value)},e.value))}):(0,K.jsx)(`div`,{"aria-label":e,"aria-orientation":s,className:x(`gap-1`,v?`flex w-44 shrink-0 flex-col self-start`:`rounded-lt bg-lt-muted p-1`,v&&c&&nx,y&&`flex w-full`,!v&&!y&&x(`inline-flex w-fit max-w-full overflow-x-auto`,{"justify-self-center":t===`center`,"justify-self-end":t===`end`})),ref:_,role:`tablist`,children:f.map(e=>{let t=g===e.value;return(0,K.jsx)(`button`,{"aria-controls":`${e.value}-panel`,"aria-selected":t,"data-test":`tab-${e.value}`,className:x(v?lx(t):Sm(t),y&&`flex-1`),id:`${e.value}-tab`,onClick:()=>C(e.value),onKeyDown:w,role:`tab`,tabIndex:t?0:-1,type:`button`,children:e.label},e.value)})}),(0,K.jsx)(`div`,{className:x(`min-w-0`,v&&!b&&`flex-1`),children:n})]})})}function ox({"aria-label":e,children:t,className:n,label:r,selectLabel:i,value:a,...o}){let{activeValue:s,hasTablist:c}=ix(),l=s===a,[u,d]=(0,z.useState)(l);return(0,z.useEffect)(()=>{l&&d(!0)},[l]),(0,K.jsx)(`section`,{...o,"aria-label":c?void 0:e??i??cx(r,a),"aria-labelledby":c?`${a}-tab`:void 0,className:x(`space-y-8`,!l&&`hidden`,n),hidden:!l,id:`${a}-panel`,role:`tabpanel`,tabIndex:0,children:u?t:null})}function sx(e){let t=[];return z.Children.forEach(e,e=>{if((0,z.isValidElement)(e)){if(e.type===ox){t.push(e);return}e.type===z.Fragment&&t.push(...sx(e.props.children))}}),t}function cx(e,t){return typeof e==`string`||typeof e==`number`||typeof e==`bigint`?String(e):(0,z.isValidElement)(e)?cx(e.props.children,t):Array.isArray(e)&&e.map(e=>cx(e,``)).join(``)||t}function lx(e){return x(`relative rounded-lt-sm px-3 py-2.5 text-left text-sm font-medium transition-colors`,e?`bg-lt-muted text-lt-fg before:absolute before:inset-y-2 before:left-0 before:w-1 before:rounded-full before:bg-lt-primary`:`text-lt-muted-fg hover:bg-lt-muted/60 hover:text-lt-fg`)}var ux={center:`text-center`,start:`text-start`},dx={xs:`text-xs leading-5`,sm:`text-sm leading-6`,md:`text-base leading-7`,lg:`text-lg leading-8`,xl:`text-xl leading-8`,"2xl":`text-2xl leading-9`,"3xl":`text-3xl leading-10`,"4xl":`text-4xl leading-none`};function fx({align:e=`start`,children:t,className:n,color:r,copyable:i=!1,copyLabel:a,copyValue:o,size:s=`md`,style:c,...l}){let u=on(cn(r)??sn(`muted`)),d=(0,K.jsx)(`p`,{"data-slot":`text`,className:x(`m-0`,ux[e],dx[s],n),style:{color:u,...c},...l,children:t}),f=o??(typeof t==`string`?t:void 0);return!i||f===void 0?d:(0,K.jsx)(Fh,{value:f,label:a??f,children:d})}function px({className:e,sticky:t=!1,...n}){return(0,K.jsx)(`header`,{...n,className:x(`flex h-(--lt-topbar-h) w-full items-center gap-2 border-b border-lt-border bg-lt-bg px-4 text-lt-fg`,t&&`sticky top-0 z-lt-sticky`,e),"data-lattice-topbar":``,"data-sticky":t||void 0})}function mx(){let{locale:e}=s(),{timezone:t}=oe();return(0,z.useMemo)(()=>({locale:e,timezone:t}),[e,t])}function hx(e){return e.kind===`date`}function gx(e,t,n){return t===null?String(e??``):hx(t)?L(e,t,{locale:n.locale,timeZone:n.timezone}):Cy(e,t,n.locale)}var _x=({children:e,node:t})=>{let n=(t.schema??[]).map(X).filter(e=>e!==void 0);return(0,K.jsx)(tb,{className:t.props.class??void 0,"data-test":X(t),defaultOpen:t.props.defaultOpen,gap:t.props.gap??void 0,items:n,children:e})},vx=({node:e})=>(0,K.jsx)(ib,{className:e.props.class??void 0,"data-test":X(e),name:e.props.name,shape:e.props.shape,size:e.props.size,src:e.props.src}),yx=({node:e})=>(0,K.jsx)(my,{className:e.props.class??void 0,color:e.props.color,"data-test":X(e),children:e.props.label}),bx=({node:e})=>{let{t}=N(F);return(0,K.jsx)(sb,{"aria-label":t(`common.breadcrumb`,`Breadcrumb`),className:e.props.class??void 0,"data-test":X(e),items:e.props.items.map(e=>({href:e.href,label:e.title}))})},xx=({node:e})=>{let{label:t,icon:n,class:r}=e.props,i=e.props.variant??null,a=e.props.emphasis??`solid`,o=X(e),s=wu(e.props),{Link:c}=Bl(),l=n?`icon`:`md`,u=n?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(nl,{className:`size-lt-icon-md`,icon:n}),t?(0,K.jsx)(`span`,{className:`sr-only`,children:t}):null]}):t,d=({onClick:e,processing:t})=>(0,K.jsx)(q,{className:r??void 0,"data-test":o,disabled:t,emphasis:a,onClick:e,size:l,variant:i,children:u});return s.kind===`navigate`?(0,K.jsx)(q,{asChild:!0,className:r??void 0,"data-test":o,emphasis:a,variant:i,size:l,children:(0,K.jsx)(c,{href:s.href,method:s.method??void 0,children:u})}):s.kind===`action`?(0,K.jsx)(xu,{action:s.action,children:d}):s.kind===`effects`||s.kind===`modal`?d({onClick:s.onClick,processing:!1}):(0,K.jsx)(q,{className:r??void 0,"data-test":o,emphasis:a,size:l,type:e.props.buttonType,variant:i,children:u})},Sx=[`primary`,`secondary`,`success`,`info`,`warning`,`danger`];function Cx(e){return Sx.some(t=>t===e)}function wx(e){let t=typeof e==`string`||jg(e)?e:null;return t===``?null:t}function Tx(e,t,n){let r=e=>{let r=t(e.detail);r!==null&&n(r)};return window.addEventListener(e,r),()=>window.removeEventListener(e,r)}function Ex(e){if(typeof e!=`object`||!e)return null;let t=e,n=wx(t.message);return n===null?null:{action:t.action??null,dismissible:t.dismissible!==!1,duration:typeof t.duration==`number`?t.duration:null,message:n,persistent:t.persistent===!0,variant:Cx(t.variant)?t.variant:`success`}}function Dx(e){return Tx(d.toast,Ex,e)}function Ox(e){if(typeof e!=`object`||!e)return null;let t=e,n=wx(t.message);return n===null?null:{action:t.action??null,dismissible:t.dismissible!==!1,message:n,title:typeof t.title==`string`||jg(t.title)?t.title:null,unique:typeof t.unique==`string`?t.unique:null,variant:Cx(t.variant)?t.variant:`info`}}function kx(e){return Tx(d.callout,Ox,e)}function Ax(e){return Tx(d.retractCallout,e=>{let t=e?.unique;return typeof t==`string`?t:null},e)}var jx=0,Mx=({node:e})=>{let{t}=N(F),{onNavigate:n}=Bl(),[r,i]=(0,z.useState)([]);(0,z.useEffect)(()=>kx(e=>{i(t=>[...e.unique?t.filter(t=>t.unique!==e.unique):t,{...e,id:jx++}])}),[]),(0,z.useEffect)(()=>n(()=>{i(e=>e.filter(e=>!e.unique))}),[n]),(0,z.useEffect)(()=>Ax(e=>{i(t=>t.filter(t=>t.unique!==e))}),[]);function a(e){i(t=>t.filter(t=>t.id!==e))}return r.length===0?null:(0,K.jsx)(`div`,{className:`flex w-full flex-col gap-2`,"data-test":X(e),children:r.map(e=>(0,K.jsx)(lb,{action:e.action?(0,K.jsx)(Zt,{node:e.action}):void 0,dismissLabel:t(`common.dismiss`,`Dismiss`),dismissible:e.dismissible,message:Ng(e.message,t),onDismiss:()=>a(e.id),title:e.title?Ng(e.title,t):void 0,variant:e.variant},e.id))})},Nx=({children:e,node:t})=>{let n=Kt(t.props.headerActions),r=t.props.tooltip;return(0,K.jsx)(fb,{className:t.props.class??void 0,"data-test":X(t),description:t.props.description,headerActions:n.length>0?(0,K.jsx)($e,{nodes:n}):null,title:t.props.title,tooltip:r?(0,K.jsx)(`div`,{dangerouslySetInnerHTML:{__html:r}}):null,children:e})},Px=({node:e})=>(0,K.jsx)(yb,{categoryFormat:e.props.categoryFormat,categoryKey:e.props.categoryKey,className:e.props.class??void 0,data:e.props.data,"data-test":X(e),description:e.props.description,grid:e.props.grid,height:e.props.height,legend:e.props.legend,series:e.props.series,title:e.props.title,tooltip:e.props.tooltip,valueFormat:e.props.valueFormat,xAxis:e.props.xAxis,yAxis:e.props.yAxis}),Fx=({node:e})=>(0,K.jsx)(xb,{className:e.props.class??void 0,copyable:e.props.copyable,"data-test":X(e),language:e.props.language,lineNumbers:e.props.lineNumbers,maxHeight:e.props.maxHeight,wrap:e.props.wrap,children:e.props.code}),Ix=({children:e,node:t})=>{let n=t.props.rememberState!==!1,r=Kt(t.props.trigger),i=X(t),a=nb(i);return(0,K.jsx)(Cb,{...a?{onOpenChange:a.setOpen,open:a.open}:n?{storageKey:`lattice:collapsible:${i??`default`}`}:{},className:t.props.class??void 0,"data-test":i,defaultOpen:t.props.collapsed===!1,tooltip:t.props.tooltip,trigger:(0,K.jsx)($e,{nodes:r}),triggerProps:{"data-test":$l(`collapsible-toggle`,i)??`collapsible-toggle-default`},children:e})},Lx=({children:e,node:t})=>(0,K.jsx)(Ob,{bleed:t.props.bleed,className:t.props.class??void 0,"data-test":X(t),divided:t.props.divided,emptyLabel:t.props.emptyLabel,semantic:t.props.semantic,children:e}),Rx=({children:e,node:t})=>{let n=X(t)??`dropdown`;return(0,K.jsx)(kb,{className:x(`w-auto`,t.props.class),"data-test":n,placement:t.props.placement,trigger:(0,K.jsx)(`span`,{className:`flex min-w-0 items-center rounded-lt-sm px-2 py-1.5 text-sm hover:bg-lt-muted`,children:(0,K.jsx)($e,{nodes:Kt(t.props.trigger)})}),children:(0,K.jsx)(`ul`,{className:`flex flex-col gap-1`,children:e})})},zx=({children:e,node:t})=>{let n=Kt(t.props.trigger),r=X(t);return(0,K.jsx)(Ab,{"aria-label":t.props.label??void 0,className:t.props.class??void 0,"data-test":r,offset:t.props.offset??16,placement:t.props.placement??`bottom-end`,trigger:n.length>0?(0,K.jsx)($e,{nodes:n}):void 0,triggerProps:{"data-test":r?`${r}-trigger`:void 0},children:e})},Bx=({node:e})=>(0,K.jsx)(Fb,{className:e.props.class??void 0,columns:e.props.columns??void 0,"data-test":X(e),children:(e.schema??[]).map((e,t)=>(0,K.jsx)(Ib,{columnSpan:e.props?.columnSpan,children:(0,K.jsx)(Zt,{node:e})},me(e,t)))}),Vx=({node:e})=>(0,K.jsx)(Lb,{className:e.props.class??void 0,copyable:e.props.copyable,copyLabel:e.props.text,copyValue:e.props.text,"data-test":X(e),level:e.props.level,tooltip:e.props.tooltip,children:e.props.text}),Hx={xs:`size-lt-icon-xs`,sm:`size-lt-icon-sm`,md:`size-lt-icon-md`,lg:`size-lt-icon-lg`,xl:`size-lt-icon-xl`,"2xl":`size-lt-icon-2xl`,"3xl":`size-lt-icon-3xl`,"4xl":`size-lt-icon-4xl`},Ux=({node:e})=>{let{name:t,size:n,color:r,class:i}=e.props,a=cn(r);return(0,K.jsx)(`span`,{className:`contents`,"data-test":X(e),style:a?{color:on(a)}:void 0,children:(0,K.jsx)(nl,{icon:t,className:x(Hx[n],i)})})},Wx=({node:e})=>(0,K.jsx)(zb,{alt:e.props.alt,circular:e.props.circular,className:e.props.class??void 0,"data-test":X(e),previewable:e.props.previewable,previewSrc:e.props.previewSrc,size:e.props.size,src:e.props.src,testId:X(e)});function Gx({className:e=``,children:t,unstyled:n=!1,...r}){let{Link:i}=Bl();return(0,K.jsx)(i,{className:x(n?void 0:`text-lt-fg underline decoration-lt-border underline-offset-4 transition-colors duration-300 ease-out hover:decoration-current! dark:decoration-lt-border`,e),...r,children:t})}var Kx=`text-lt-fg underline decoration-lt-border underline-offset-4 transition-colors duration-300 ease-out hover:decoration-current! dark:decoration-lt-border`;function qx({affix:e,className:t}){return e.icon?(0,K.jsx)(nl,{className:x(`size-lt-icon-md shrink-0`,t),icon:e.icon}):(0,K.jsx)(`span`,{className:x(`shrink-0 text-sm text-lt-muted-fg`,t),children:e.text})}function Jx({icon:e,isMenuItem:t,label:n,prefix:r,suffix:i}){return e?(0,K.jsx)(nl,{className:`size-lt-icon-md shrink-0`,icon:e}):t?(0,K.jsxs)(K.Fragment,{children:[r?(0,K.jsx)(qx,{affix:r}):null,(0,K.jsx)(`span`,{children:n}),i?(0,K.jsx)(qx,{affix:i,className:`ml-auto`}):null]}):r||i?(0,K.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 align-baseline`,children:[r?(0,K.jsx)(qx,{affix:r}):null,(0,K.jsx)(`span`,{children:n}),i?(0,K.jsx)(qx,{affix:i}):null]}):n}function Yx(e,t,n){if(!(!t?.text&&!n?.text))return[t?.text,e,n?.text].filter(e=>!!e).join(` `)}var Xx=({node:e})=>{let t=iu(),{class:n,icon:r,label:i,prefix:a,suffix:o,unstyled:s}=e.props,c=i??``,l=wu(e.props),u=t?nu:void 0,d=X(e),f=(0,K.jsx)(Jx,{icon:r,isMenuItem:t,label:c,prefix:a,suffix:o}),p=r?c:Yx(c,a,o),m=({onClick:e,processing:t})=>(0,K.jsx)(`button`,{"aria-label":p,className:x(s?void 0:Kx,u,n),"data-test":d,disabled:t,onClick:e,type:`button`,children:f});return l.kind===`action`?(0,K.jsx)(xu,{action:l.action,children:m}):l.kind===`effects`||l.kind===`modal`?m({onClick:l.onClick,processing:!1}):(0,K.jsx)(Gx,{"aria-label":p,className:x(u,n),unstyled:s??!1,"data-test":d,href:l.kind===`navigate`?l.href:`#`,method:l.kind===`navigate`?l.method:`get`,tabIndex:e.props.tabIndex??void 0,children:f})},Zx=({children:e,node:t})=>(0,K.jsx)(Bb,{className:t.props?.class??void 0,"data-test":X(t),children:e});function Qx({affix:e,className:t}){return e.icon?(0,K.jsx)(nl,{className:x(`size-lt-icon-md shrink-0`,t),icon:e.icon}):(0,K.jsx)(`span`,{className:x(`shrink-0 text-sm text-lt-muted-fg`,t),children:e.text})}function $x(e,t){return(e??[]).some(e=>e.props?.href===t||$x(e.schema,t))}var eS=({children:e,node:t})=>{let{icon:n,label:r,prefix:i,suffix:a}=t.props,o=r??``,{currentUrl:s}=Bl(),c=wu(t.props),l=eu(`menu`,t),u={className:t.props.class??void 0,"data-test":l,icon:n?(0,K.jsx)(nl,{className:`size-lt-icon-md shrink-0`,icon:n}):void 0,label:o,prefix:i?(0,K.jsx)(Qx,{affix:i}):void 0,suffix:a?(0,K.jsx)(Qx,{affix:a}):void 0};return c.kind===`action`?(0,K.jsx)(xu,{action:c.action,children:({onClick:e,processing:t})=>(0,K.jsx)(Ub,{...u,disabled:t,onClick:e})}):c.kind===`effects`||c.kind===`modal`?(0,K.jsx)(Ub,{...u,onClick:c.onClick}):c.kind===`navigate`?(0,K.jsx)(Ub,{...u,active:s===c.href,href:c.href,method:c.method}):(0,K.jsx)(Ub,{...u,defaultOpen:$x(t.schema,s),children:e})},tS=({children:e,node:t})=>{let{t:n}=N(F),r=fu();if(!r)return null;let i=t.props.title??n(`common.dialog`,`Dialog`),a=t.props.description,o=t.props.closeLabel;return(0,K.jsx)(Ad,{open:r.open,onOpenChange:r.onOpenChange,children:(0,K.jsxs)(Pd,{...a?{}:{"aria-describedby":void 0},className:t.props.class??void 0,"data-test":X(t),onCloseAutoFocus:r.onExited,placement:t.props.side??`center`,width:t.props.width,height:t.props.height??void 0,children:[(0,K.jsx)(Fd,{closeLabel:o,description:a,title:i}),(0,K.jsx)(`div`,{className:`mt-6 space-y-6`,children:e})]})})},nS=({children:e,node:t})=>{let n=Kt(t.props.trigger),r=X(t);return(0,K.jsxs)(Qt,{children:[(0,K.jsx)(Fe,{"aria-label":t.props.label??void 0,"data-test":r?`${r}-trigger`:void 0,type:`button`,children:(0,K.jsx)($e,{nodes:n})}),(0,K.jsx)(Yt,{align:t.props.align,className:t.props.class??void 0,side:t.props.side,children:e})]})},rS=({node:e})=>(0,K.jsx)(Jb,{className:e.props.class??void 0,color:e.props.color,"data-test":X(e),max:e.props.max,shape:e.props.shape,showValue:e.props.showValue,size:e.props.size,value:e.props.value}),iS=({node:e})=>(0,K.jsx)(`span`,{className:e.props.class??void 0,"data-test":X(e),style:{display:`contents`},dangerouslySetInnerHTML:{__html:e.props.html}}),aS=({children:e,node:t})=>{let n=t.props.collapsible===!0,r=Kt(t.props.headerActions),i=X(t),a=t.props.rememberState!==!1,o=nb(i);return(0,K.jsx)(Yb,{...n&&o?{collapsed:!o.open,onCollapsedChange:e=>o.setOpen(!e)}:n&&a?{storageKey:`lattice:section:${i??`default`}`}:{},className:t.props.class??void 0,collapsible:n,"data-test":i,defaultCollapsed:t.props.collapsed===!0,description:t.props.description,headerActions:r.length>0?(0,K.jsx)($e,{nodes:r}):null,title:t.props.title,toggleProps:{"data-test":$l(`section-toggle`,i)??`section-toggle-default`},tooltip:t.props.tooltip,children:e})},oS=({node:e})=>{let{emits:t,name:n,options:r}=e.props;function i(e){t&&window.dispatchEvent(new CustomEvent(t,{detail:{name:n,value:e}}))}return(0,K.jsx)(Cm,{"aria-label":e.props.label??void 0,className:e.props.class??void 0,"data-test":X(e),defaultValue:e.props.value||void 0,name:n,onValueChange:i,options:r})},sS=({node:e})=>(0,K.jsx)(Zb,{bleed:e.props.bleed,className:e.props.class??void 0,"data-test":X(e),orientation:e.props.orientation});function cS(e,t){let n=e.detail?.target;return n==null||n===t}var lS=({children:e,node:t})=>{let n=t.props.collapsible,r=t.props.rememberState,i=X(t),a=`lattice:sidebar:${i??`default`}`,{onNavigate:o}=Bl(),[s,c]=Sb(a,!1,n&&r),[l,u]=(0,z.useState)(!1);return Fl(d.toggleSidebar,e=>{cS(e,i)&&(window.matchMedia?.(`(min-width: 768px)`).matches??!0?n&&c():u(e=>!e))}),(0,z.useEffect)(()=>o(()=>u(!1)),[o]),(0,K.jsx)($b,{backdropProps:{"data-test":`sidebar-backdrop`},className:t.props.class??void 0,collapsed:n&&s,"data-test":`sidebar`,onOpenChange:u,open:l,children:e})},uS=({children:e,node:t})=>(0,K.jsx)(ex,{className:t.props?.class??void 0,"data-test":X(t),children:e}),dS=({children:e,node:t})=>(0,K.jsx)($y,{align:t.props.align??void 0,className:t.props.class??void 0,"data-test":X(t),direction:t.props.direction??void 0,float:t.props.float??void 0,gap:t.props.gap??void 0,height:t.props.height??void 0,justify:t.props.justify??void 0,sticky:t.props.sticky,width:t.props.width??void 0,children:e}),fS=({children:e,node:t})=>{let{t:n}=N(F),r=(0,z.useMemo)(()=>mS(t),[t]),i=r[0]?.value??``,a=t.props.queryKey,{visit:o}=Bl(),s=t.props.activeValue,c=t.props.defaultValue??i,[l,u]=(0,z.useState)(()=>s||(hS(a,r)??c)||i),d=(0,z.useCallback)(e=>{let t=r.find(t=>t.value===e);if(t){if(t.confirm?.required){o(_S(a,e),{preserveScroll:!0});return}u(e),gS(a,e)}},[a,r,o]);return(0,K.jsx)(ax,{"aria-label":n(`common.tabs`,`Tabs`),alignment:t.props.alignment,className:t.props.class??void 0,"data-test":X(t),items:r.map(e=>({label:e.label,value:e.value})),onValueChange:d,orientation:t.props.orientation,sticky:t.props.sticky,value:l,children:e})},pS=({children:e,node:t})=>(0,K.jsx)(ox,{label:t.props.label,value:t.props.value,children:e});function mS(e){return(e.schema??[]).filter(e=>e.type===`tab`).map(e=>e.props).filter(e=>e.value!==``)}function hS(e,t){if(typeof window>`u`)return null;let n=new URLSearchParams(window.location.search).get(e);return!n||!t.some(e=>e.value===n)?null:n}function gS(e,t){if(typeof window>`u`)return;let n=new URL(window.location.href);n.searchParams.set(e,t),window.history.replaceState(window.history.state,``,`${n.pathname}${n.search}${n.hash}`)}function _S(e,t){if(typeof window>`u`)return``;let n=new URL(window.location.href);return n.searchParams.set(e,t),`${n.pathname}${n.search}${n.hash}`}var vS=({node:e})=>(0,K.jsx)(fx,{align:e.props.align??void 0,className:e.props.class??void 0,color:e.props.color,copyable:e.props.copyable,copyLabel:e.props.text,copyValue:e.props.text,"data-test":X(e),size:e.props.size,children:e.props.text}),yS=({node:e})=>{let t=e.props.content,n=Kt(e.props.trigger),r=X(e);return(0,K.jsx)(ub,{className:e.props.class??void 0,content:t?(0,K.jsx)(`div`,{dangerouslySetInnerHTML:{__html:t}}):null,trigger:n.length>0?(0,K.jsx)($e,{nodes:n}):null,triggerProps:{"data-test":r?`${r}-trigger`:void 0}})},bS=({children:e,node:t})=>(0,K.jsx)(px,{className:t.props.class??void 0,"data-test":X(t),sticky:t.props.sticky,children:e}),xS=`flex flex-wrap items-center justify-between gap-x-4 gap-y-1 px-lt-gutter py-3`,SS=`text-sm text-lt-muted-fg`,CS=`min-w-0 text-lt-fg`;function wS({children:e,description:t,disclosure:n,identity:r,label:i}){let a=Db(),o=`${r??`entry`}-panel`,[s,c]=Sb(`lattice:entry:${r??`default`}`,!1,!1),l=(0,K.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,K.jsx)(`span`,{children:i}),t&&(0,K.jsx)(`span`,{className:`text-xs text-lt-muted-fg`,children:t})]});return n?(0,K.jsxs)(`div`,{"data-test":r,role:`listitem`,children:[(0,K.jsxs)(`button`,{"aria-controls":o,"aria-expanded":s,className:x(xS,`w-full cursor-pointer text-left transition-colors hover:bg-lt-muted`),onClick:c,type:`button`,children:[(0,K.jsx)(`span`,{className:SS,children:l}),(0,K.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,K.jsx)(`span`,{className:CS,children:e}),(0,K.jsx)(y,{name:`chevron-down`,className:x(`size-lt-icon-md shrink-0 text-lt-muted-fg transition-transform`,!s&&`-rotate-90`)})]})]}),s&&(0,K.jsx)(`div`,{className:`px-lt-gutter pt-2 pb-4`,id:o,children:n})]}):a===`list`?(0,K.jsxs)(`div`,{className:xS,"data-test":r,role:`listitem`,children:[(0,K.jsx)(`span`,{className:SS,children:l}),(0,K.jsx)(`span`,{className:CS,children:e})]}):(0,K.jsxs)(`div`,{className:xS,"data-test":r,children:[(0,K.jsx)(`dt`,{className:SS,children:l}),(0,K.jsx)(`dd`,{className:CS,children:e})]})}function TS(e,t){return(t.schema??[]).length>0?e:void 0}var ES={components:{accordion:B(_x),avatar:B(vx),badge:B(yx),breadcrumbs:B(bx),button:B(xx),callouts:B(Mx),card:B(Nx),chart:B(Px),"code-block":B(Fx),collapsible:B(Ix),"description-list":B(Lx),dropdown:B(Rx),"entry.badge":B(({children:e,node:t})=>{let{value:n,color:r,label:i,description:a}=t.props,o=n==null||n===``?null:String(n);return(0,K.jsx)(wS,{description:a,disclosure:TS(e,t),identity:X(t),label:i,children:o===null?(0,K.jsx)(`span`,{className:`text-lt-muted-fg`,children:`—`}):(0,K.jsx)(my,{color:r,children:o})})}),"entry.boolean":B(({children:e,node:t})=>{let{value:n,trueIcon:r,falseIcon:i,label:a,description:o}=t.props,{t:s}=N(`lattice`),c=Hv(n);return(0,K.jsx)(wS,{description:o,disclosure:TS(e,t),identity:X(t),label:a,children:(0,K.jsx)(`span`,{"aria-label":c?s(`common.yes`,`Yes`):s(`common.no`,`No`),role:`img`,children:(0,K.jsx)(y,{name:c?r:i,className:x(`size-lt-icon-md`,c?`text-lt-success`:`text-lt-muted-fg`)})})})}),"entry.component":B(({children:e,node:t})=>(0,K.jsx)(wS,{description:t.props.description,disclosure:TS(e,t),identity:X(t),label:t.props.label,children:(0,K.jsx)($e,{nodes:Kt(t.props.value)})})),"entry.date":B(({children:e,node:t})=>{let{value:n,format:r,label:i,description:a}=t.props,o=mx();return(0,K.jsx)(wS,{description:a,disclosure:TS(e,t),identity:X(t),label:i,children:(0,K.jsx)(`span`,{children:n==null?`—`:gx(n,r,o)})})}),"entry.text":B(({children:e,node:t})=>{let{value:n,placeholder:r,copyable:i,label:a,description:o}=t.props,s=n==null||n===``?null:String(n);return(0,K.jsx)(wS,{description:o,disclosure:TS(e,t),identity:X(t),label:a,children:s===null?(0,K.jsx)(`span`,{className:`text-lt-muted-fg`,children:r??`—`}):i?(0,K.jsx)(Fh,{label:s,value:s,children:(0,K.jsx)(`span`,{children:s})}):(0,K.jsx)(`span`,{children:s})})}),"floating-panel":B(zx),grid:B(Bx),heading:B(Vx),icon:B(Ux),image:B(Wx),link:B(Xx),menu:B(Zx),"menu-item":B(eS),modal:B(tS),popover:B(nS),progress:B(rS),"raw-block":B(iS),section:B(aS),"segmented-control":B(oS),separator:B(sS),sidebar:B(lS),"sidebar.footer":B(uS),stack:B(dS),tab:B(pS),tabs:B(fS),text:B(vS),tooltip:B(yS),topbar:B(bS)},i18n:{namespace:F},name:`lattice/ui`},DS=Object.defineProperty,OS=(e,t)=>DS(e,`name`,{value:t,configurable:!0});function kS(e){let t=e+`CollectionProvider`,[n,r]=Ye(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=OS(e=>{let{scope:t,children:n}=e,r=z.useRef(null),a=z.useRef(new Map).current;return(0,K.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})},`CollectionProvider`);o.displayName=t;let s=e+`CollectionSlot`,c=j(s),l=z.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=a(s,n),o=M(t,i.collectionRef);return(0,K.jsx)(c,{ref:o,children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=j(u),p=z.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=z.useRef(null),s=M(t,o),c=a(u,n);return z.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,K.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return z.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return OS(m,`useCollection`),[{Provider:o,Slot:l,ItemSlot:p},m,r]}OS(kS,`createCollection`);var AS=new WeakMap,jS=class e extends Map{static{OS(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],AS.set(this,!0)}set(e,t){return AS.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,n){let r=this.has(t),i=this.#e.length,a=PS(e),o=a>=0?a:i+a,s=o<0||o>=i?-1:o;if(s===this.size||r&&s===this.size-1||s===-1)return this.set(t,n),this;let c=this.size+ +!r;a<0&&o++;let l=[...this.#e],u,d=!1;for(let e=o;e<c;e++)if(o===e){let i=l[e];l[e]===t&&(i=l[e+1]),r&&this.delete(t),u=this.get(i),this.set(t,n)}else{!d&&l[e-1]===t&&(d=!0);let n=l[d?e:e-1],r=u;u=this.get(n),this.delete(n),this.set(n,r)}return this}with(t,n,r){let i=new e(this);return i.insert(t,n,r),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r,t,n)}after(e){let t=this.#e.indexOf(e);if(t=t===-1||t===this.size-1?-1:t+1,t!==-1)return this.entryAt(t)}setAfter(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r+1,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return t!==void 0&&this.delete(t)}at(e){let t=MS(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=MS(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return MS(this.#e,e)}from(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return-1}filter(t,n){let r=[],i=0;for(let e of this)Reflect.apply(t,n,[e,i,this])&&r.push(e),i++;return new e(r)}map(t,n){let r=[],i=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,i,this])]),i++;return new e(r)}reduce(...e){let[t,n]=e,r=0,i=n??this.at(0);for(let n of this)i=r===0&&e.length===1?n:Reflect.apply(t,this,[i,n,r,this]),r++;return i}reduceRight(...e){let[t,n]=e,r=n??this.at(-1);for(let n=this.size-1;n>=0;n--){let i=this.at(n);r=n===this.size-1&&e.length===1?i:Reflect.apply(t,this,[r,i,n,this])}return r}toSorted(t){let n=[...this.entries()].sort(t);return new e(n)}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e,i=this.size-1;if(t===void 0)return r;t<0&&(t+=this.size),n!==void 0&&n>0&&(i=n-1);for(let e=t;e<=i;e++){let t=this.keyAt(e),n=this.get(t);r.set(t,n)}return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function MS(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=NS(e,t);return n===-1?void 0:e[n]}OS(MS,`at`);function NS(e,t){let n=e.length,r=PS(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}OS(NS,`toSafeIndex`);function PS(e){return e!==e||e===0?0:Math.trunc(e)}OS(PS,`toSafeInteger`);function FS(e){let t=e+`CollectionProvider`,[n,r]=Ye(t),[i,a]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new jS,setItemMap:OS(()=>void 0,`setItemMap`)}),o=OS(({state:e,...t})=>e?(0,K.jsx)(c,{...t,state:e}):(0,K.jsx)(s,{...t}),`CollectionProvider`);o.displayName=t;let s=OS(e=>{let t=h();return(0,K.jsx)(c,{...e,state:t})},`CollectionInit`);s.displayName=t+`Init`;let c=OS(e=>{let{scope:t,children:n,state:r}=e,a=z.useRef(null),[o,s]=z.useState(null),c=M(a,s),[l,u]=r;return z.useEffect(()=>{if(!o)return;let e=zS(()=>{});return e.observe(o,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[o]),(0,K.jsx)(i,{scope:t,itemMap:l,setItemMap:u,collectionRef:c,collectionRefObject:a,collectionElement:o,children:n})},`CollectionProviderImpl`);c.displayName=t+`Impl`;let l=e+`CollectionSlot`,u=j(l),d=z.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=a(l,n),o=M(t,i.collectionRef);return(0,K.jsx)(u,{ref:o,children:r})});d.displayName=l;let f=e+`CollectionItemSlot`,p=j(f),m=z.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=z.useRef(null),[s,c]=z.useState(null),l=M(t,o,c),{setItemMap:u}=a(f,n),d=z.useRef(i);IS(d.current,i)||(d.current=i);let m=d.current;return z.useEffect(()=>{let e=m;return u(t=>s?t.has(s)?t.set(s,{...e,element:s}).toSorted(RS):(t.set(s,{...e,element:s}),t.toSorted(RS)):t),()=>{u(e=>!s||!e.has(s)?e:(e.delete(s),new jS(e)))}},[s,m,u]),(0,K.jsx)(p,{"data-radix-collection-item":``,ref:l,children:r})});m.displayName=f;function h(){return z.useState(new jS)}OS(h,`useInitCollection`);function g(t){let{itemMap:n}=a(e+`CollectionConsumer`,t);return n}return OS(g,`useCollection`),[{Provider:o,Slot:d,ItemSlot:m},{createCollectionScope:r,useCollection:g,useInitCollection:h}]}OS(FS,`createCollection`);function IS(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}OS(IS,`shallowEqual`);function LS(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}OS(LS,`isElementPreceding`);function RS(e,t){return!e[1].element||!t[1].element?0:LS(e[1].element,t[1].element)?-1:1}OS(RS,`sortByDocumentPosition`);function zS(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}OS(zS,`getChildListObserver`);var BS=Object.defineProperty,VS=(e,t)=>BS(e,`name`,{value:t,configurable:!0}),HS=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),US=z.forwardRef(VS(function(e,t){return(0,K.jsx)(ct.span,{...e,ref:t,style:{...HS,...e.style}})},`VisuallyHidden`)),WS=Object.defineProperty,GS=(e,t)=>WS(e,`name`,{value:t,configurable:!0}),KS=`ToastProvider`,[qS,JS,YS]=kS(`Toast`),[XS,ZS]=Ye(`Toast`,[YS]),[QS,$S]=XS(KS),eC=GS(e=>{let{__scopeToast:t,label:n=`Notification`,duration:r=5e3,swipeDirection:i=`right`,swipeThreshold:a=50,announcerContainer:o,children:s}=e,[c,l]=z.useState(null),[u,d]=z.useState(0),f=z.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${KS}\`. Expected non-empty \`string\`.`),(0,K.jsx)(qS.Provider,{scope:t,children:(0,K.jsx)(QS,{scope:t,label:n,duration:r,swipeDirection:i,swipeThreshold:a,toastCount:u,viewport:c,onViewportChange:l,onToastAdd:z.useCallback(()=>d(e=>e+1),[]),onToastRemove:z.useCallback(()=>d(e=>e-1),[]),isClosePausedRef:f,announcerContainer:o,children:s})})},`ToastProvider`),tC=`ToastViewport`,nC=[`F8`],rC=`toast.viewportPause`,iC=`toast.viewportResume`,aC=z.forwardRef(GS(function(e,t){let{__scopeToast:n,hotkey:r=nC,label:i=`Notifications ({hotkey})`,...a}=e,o=$S(tC,n),s=JS(n),c=z.useRef(null),l=z.useRef(null),u=z.useRef(null),d=z.useRef(null),f=M(t,d,o.onViewportChange),p=r.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),m=o.toastCount>0;z.useEffect(()=>{let e=GS(e=>{r.length!==0&&r.every(t=>e[t]||e.code===t)&&d.current?.focus()},`handleKeyDown`);return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[r]),z.useEffect(()=>{let e=c.current,t=d.current;if(m&&e&&t){let n=GS(()=>{if(!o.isClosePausedRef.current){let e=new CustomEvent(rC);t.dispatchEvent(e),o.isClosePausedRef.current=!0}},`handlePause`),r=GS(()=>{if(o.isClosePausedRef.current){let e=new CustomEvent(iC);t.dispatchEvent(e),o.isClosePausedRef.current=!1}},`handleResume`),i=GS(t=>{e.contains(t.relatedTarget)||r()},`handleFocusOutResume`),a=GS(()=>{e.contains(document.activeElement)||r()},`handlePointerLeaveResume`);return e.addEventListener(`focusin`,n),e.addEventListener(`focusout`,i),e.addEventListener(`pointermove`,n),e.addEventListener(`pointerleave`,a),window.addEventListener(`blur`,n),window.addEventListener(`focus`,r),()=>{e.removeEventListener(`focusin`,n),e.removeEventListener(`focusout`,i),e.removeEventListener(`pointermove`,n),e.removeEventListener(`pointerleave`,a),window.removeEventListener(`blur`,n),window.removeEventListener(`focus`,r)}}},[m,o.isClosePausedRef]);let h=z.useCallback(({tabbingDirection:e})=>{let t=s().map(t=>{let n=t.ref.current,r=[n,...DC(n)];return e===`forwards`?r:r.reverse()});return(e===`forwards`?t.reverse():t).flat()},[s]);return z.useEffect(()=>{let e=d.current;if(e){let t=GS(t=>{let n=t.altKey||t.ctrlKey||t.metaKey;if(t.key===`Tab`&&!n){let n=document.activeElement,r=t.shiftKey;if(t.target===e&&r){l.current?.focus();return}let i=h({tabbingDirection:r?`backwards`:`forwards`}),a=i.findIndex(e=>e===n);OC(i.slice(a+1))?t.preventDefault():r?l.current?.focus():u.current?.focus()}},`handleKeyDown`);return e.addEventListener(`keydown`,t),()=>e.removeEventListener(`keydown`,t)}},[s,h]),(0,K.jsxs)(Rt,{ref:c,role:`region`,"aria-label":i.replace(`{hotkey}`,p),tabIndex:-1,style:{pointerEvents:m?void 0:`none`},children:[m&&(0,K.jsx)(sC,{ref:l,onFocusFromOutsideViewport:()=>{OC(h({tabbingDirection:`forwards`}))}}),(0,K.jsx)(qS.Slot,{scope:n,children:(0,K.jsx)(ct.ol,{tabIndex:-1,...a,ref:f})}),m&&(0,K.jsx)(sC,{ref:u,onFocusFromOutsideViewport:()=>{OC(h({tabbingDirection:`backwards`}))}})]})},`ToastViewport`)),oC=`ToastFocusProxy`,sC=z.forwardRef(GS(function(e,t){let{__scopeToast:n,onFocusFromOutsideViewport:r,...i}=e,a=$S(oC,n);return(0,K.jsx)(US,{tabIndex:0,...i,ref:t,style:{position:`fixed`},onFocus:e=>{let t=e.relatedTarget;a.viewport?.contains(t)||r()}})},`ToastFocusProxy`)),cC=`Toast`,lC=`toast.swipeStart`,uC=`toast.swipeMove`,dC=`toast.swipeCancel`,fC=`toast.swipeEnd`,pC=z.forwardRef(GS(function(e,t){let{forceMount:n,open:r,defaultOpen:i,onOpenChange:a,...o}=e,[s,c]=Dt({prop:r,defaultProp:i??!0,onChange:a,caller:cC});return(0,K.jsx)(_t,{present:n||s,children:(0,K.jsx)(gC,{open:s,...o,ref:t,onClose:()=>c(!1),onPause:it(e.onPause),onResume:it(e.onResume),onSwipeStart:Wt(e.onSwipeStart,e=>{e.currentTarget.setAttribute(`data-swipe`,`start`)}),onSwipeMove:Wt(e.onSwipeMove,e=>{let{x:t,y:n}=e.detail.delta;e.currentTarget.setAttribute(`data-swipe`,`move`),e.currentTarget.style.setProperty(`--radix-toast-swipe-move-x`,`${t}px`),e.currentTarget.style.setProperty(`--radix-toast-swipe-move-y`,`${n}px`)}),onSwipeCancel:Wt(e.onSwipeCancel,e=>{e.currentTarget.setAttribute(`data-swipe`,`cancel`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-y`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-end-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-end-y`)}),onSwipeEnd:Wt(e.onSwipeEnd,e=>{let{x:t,y:n}=e.detail.delta;e.currentTarget.setAttribute(`data-swipe`,`end`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-y`),e.currentTarget.style.setProperty(`--radix-toast-swipe-end-x`,`${t}px`),e.currentTarget.style.setProperty(`--radix-toast-swipe-end-y`,`${n}px`),c(!1)})})})},`Toast`)),[mC,hC]=XS(cC,{onClose(){}}),gC=z.forwardRef(GS(function(e,t){let{__scopeToast:n,type:r=`foreground`,duration:i,open:a,onClose:o,onEscapeKeyDown:s,onPause:c,onResume:l,onSwipeStart:u,onSwipeMove:d,onSwipeCancel:f,onSwipeEnd:p,...m}=e,h=$S(cC,n),g=JS(n),[_,v]=z.useState(null),y=M(t,v),b=z.useRef(null),x=z.useRef(null),S=i||h.duration,C=z.useRef(0),w=z.useRef(S),T=z.useRef(0),{onToastAdd:E,onToastRemove:D}=h,O=it(()=>{_?.contains(document.activeElement)&&h.viewport?.focus(),o()}),ee=z.useCallback(e=>{!e||e===1/0||(window.clearTimeout(T.current),C.current=new Date().getTime(),T.current=window.setTimeout(O,e))},[O]);z.useEffect(()=>{let e=h.viewport;if(e){let t=GS(()=>{ee(w.current),l?.()},`handleResume`),n=GS(()=>{let e=new Date().getTime()-C.current;w.current-=e,window.clearTimeout(T.current),c?.()},`handlePause`);return e.addEventListener(rC,n),e.addEventListener(iC,t),()=>{e.removeEventListener(rC,n),e.removeEventListener(iC,t)}}},[h.viewport,S,c,l,ee]),z.useEffect(()=>{a&&!h.isClosePausedRef.current&&ee(S)},[a,S,h.isClosePausedRef,ee]),z.useEffect(()=>()=>{window.clearTimeout(T.current)},[]),z.useEffect(()=>(E(),()=>D()),[E,D]);let k=z.useMemo(()=>_?SC(_):null,[_]);return h.viewport?(0,K.jsxs)(K.Fragment,{children:[k&&(0,K.jsx)(_C,{__scopeToast:n,role:`status`,"aria-live":r===`foreground`?`assertive`:`polite`,children:k}),(0,K.jsx)(mC,{scope:n,onClose:O,children:ic.createPortal((0,K.jsx)(qS.ItemSlot,{scope:n,children:(0,K.jsx)(wt,{asChild:!0,onEscapeKeyDown:Wt(s,e=>{g().some(t=>t.ref.current?.contains(e.target))||O()}),children:(0,K.jsx)(ct.li,{tabIndex:0,"data-state":a?`open`:`closed`,"data-swipe-direction":h.swipeDirection,...m,ref:y,style:{userSelect:`none`,touchAction:`none`,...e.style},onKeyDown:Wt(e.onKeyDown,e=>{e.key===`Escape`&&(s?.(e.nativeEvent),e.nativeEvent.defaultPrevented||O())}),onPointerDown:Wt(e.onPointerDown,e=>{e.button===0&&(b.current={x:e.clientX,y:e.clientY})}),onPointerMove:Wt(e.onPointerMove,e=>{if(!b.current)return;let t=e.clientX-b.current.x,n=e.clientY-b.current.y,r=!!x.current,i=[`left`,`right`].includes(h.swipeDirection),a=[`left`,`up`].includes(h.swipeDirection)?Math.min:Math.max,o=i?a(0,t):0,s=i?0:a(0,n),c=e.pointerType===`touch`?10:2,l={x:o,y:s},f={originalEvent:e,delta:l};r?(x.current=l,CC(uC,d,f,{discrete:!1})):wC(l,h.swipeDirection,c)?(x.current=l,CC(lC,u,f,{discrete:!1}),e.target.setPointerCapture(e.pointerId)):(Math.abs(t)>c||Math.abs(n)>c)&&(b.current=null)}),onPointerUp:Wt(e.onPointerUp,e=>{let t=x.current,n=e.target;if(n.hasPointerCapture(e.pointerId)&&n.releasePointerCapture(e.pointerId),x.current=null,b.current=null,t){let n=e.currentTarget,r={originalEvent:e,delta:t};wC(t,h.swipeDirection,h.swipeThreshold)?CC(fC,p,r,{discrete:!0}):CC(dC,f,r,{discrete:!0}),n.addEventListener(`click`,e=>e.preventDefault(),{once:!0})}})})})}),h.viewport)})]}):null},`ToastImpl`)),_C=GS(e=>{let{__scopeToast:t,children:n,...r}=e,i=$S(cC,t),[a,o]=z.useState(!1),[s,c]=z.useState(!1);return TC(()=>o(!0)),z.useEffect(()=>{let e=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(e)},[]),s?null:(0,K.jsx)(Ze,{asChild:!0,container:i.announcerContainer||void 0,children:(0,K.jsx)(US,{...r,children:a&&(0,K.jsxs)(K.Fragment,{children:[i.label,` `,n]})})})},`ToastAnnounce`),vC=z.forwardRef(GS(function(e,t){let{__scopeToast:n,...r}=e;return(0,K.jsx)(ct.div,{...r,ref:t})},`ToastTitle`)),yC=`ToastClose`,bC=z.forwardRef(GS(function(e,t){let{__scopeToast:n,...r}=e,i=hC(yC,n);return(0,K.jsx)(xC,{asChild:!0,children:(0,K.jsx)(ct.button,{type:`button`,...r,ref:t,onClick:Wt(e.onClick,i.onClose)})})},`ToastClose`)),xC=z.forwardRef(GS(function(e,t){let{__scopeToast:n,altText:r,...i}=e;return(0,K.jsx)(ct.div,{"data-radix-toast-announce-exclude":``,"data-radix-toast-announce-alt":r||void 0,...i,ref:t})},`ToastAnnounceExclude`));function SC(e){let t=[];return Array.from(e.childNodes).forEach(e=>{if(e.nodeType===e.TEXT_NODE&&e.textContent&&t.push(e.textContent),EC(e)){let n=e.ariaHidden||e.hidden||e.style.display===`none`,r=e.dataset.radixToastAnnounceExclude===``;if(!n)if(r){let n=e.dataset.radixToastAnnounceAlt;n&&t.push(n)}else t.push(...SC(e))}}),t}GS(SC,`getAnnounceTextContent`);function CC(e,t,n,{discrete:r}){let i=n.originalEvent.currentTarget,a=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Pt(i,a):i.dispatchEvent(a)}GS(CC,`handleAndDispatchCustomEvent`);var wC=GS((e,t,n=0)=>{let r=Math.abs(e.x),i=Math.abs(e.y),a=r>i;return t===`left`||t===`right`?a&&r>n:!a&&i>n},`isDeltaInDirection`);function TC(e=()=>{}){let t=it(e);dt(()=>{let e=0,n=0;return e=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(e),window.cancelAnimationFrame(n)}},[t])}GS(TC,`useNextFrame`);function EC(e){return e.nodeType===e.ELEMENT_NODE}GS(EC,`isHTMLElement`);function DC(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:GS(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}GS(DC,`getTabbableCandidates`);function OC(e){let t=document.activeElement;return e.some(e=>e===t||(e.focus(),document.activeElement!==t))}GS(OC,`focusFirst`);var kC=eC,AC=aC,jC=pC,MC=vC,NC=bC,PC=`flex min-w-0 flex-1 flex-col gap-2`,FC=`text-sm text-lt-fg`,IC=`flex flex-wrap gap-2`,LC=`shrink-0 rounded-lt-sm p-1 text-lt-muted-fg transition-colors hover:bg-lt-muted hover:text-lt-fg`;function RC(e,t){return x(`flex items-start gap-3 rounded-lt border border-l-4 border-lt-border bg-lt-popover p-4 text-lt-popover-fg shadow-lt-lg`,cb[e].accent,t)}function zC({variant:e,message:t,action:n,dismissible:r=!0,dismissLabel:i=`Dismiss`,persistent:a=!1,duration:o,className:s,...c}){return(0,K.jsxs)(jC,{className:x(RC(e),`data-[state=open]:animate-lt-toast-in data-[state=closed]:animate-lt-toast-out`,`data-[swipe=move]:translate-y-[var(--radix-toast-swipe-move-y)] data-[swipe=cancel]:translate-y-0 data-[swipe=cancel]:transition-transform`,s),"data-test":`toast-${e}`,duration:a?1/0:o,...c,children:[cb[e].icon,(0,K.jsxs)(`div`,{className:PC,children:[(0,K.jsx)(MC,{className:FC,children:t}),n?(0,K.jsx)(`div`,{className:IC,children:n}):null]}),r?(0,K.jsx)(NC,{"aria-label":i,className:LC,"data-test":`toast-dismiss`,children:(0,K.jsx)(y,{name:`x`,className:`size-lt-icon-md`})}):null]})}var BC=0;function VC({duration:e=4e3}){let{t}=N(F),[n,r]=(0,z.useState)([]);function i(e){r(t=>t.filter(t=>t.id!==e))}return(0,z.useEffect)(()=>Dx(e=>{r(t=>[...t,{...e,id:BC++}])}),[]),(0,K.jsxs)(kC,{duration:e,swipeDirection:`down`,children:[n.map(n=>(0,K.jsx)(zC,{action:n.action?(0,K.jsx)(Zt,{node:n.action}):void 0,dismissLabel:t(`common.dismiss`,`Dismiss`),dismissible:n.dismissible,duration:n.duration??e,message:Ng(n.message,t),onOpenChange:e=>{e||i(n.id)},persistent:n.persistent,variant:n.variant},n.id)),(0,K.jsx)(AC,{className:`fixed inset-x-0 bottom-0 z-lt-toast mx-auto flex w-full max-w-sm flex-col gap-2 p-4 outline-none`})]})}var HC=Sn(ES,fg,gf,ug,gg,Vy,Vg,Wg,$c),UC=[`light`,`dark`,`system`],{subscribe:WC,notify:GC}=l(),KC=`system`,qC=`system`;function JC(e){YC(e)&&(qC=e)}function YC(e){return UC.some(t=>t===e)}var XC=()=>typeof window>`u`?!1:window.matchMedia(`(prefers-color-scheme: dark)`).matches,ZC=(e,t,n=365)=>{if(typeof document>`u`)return;let r=n*24*60*60;document.cookie=`${e}=${t};path=/;max-age=${r};SameSite=Lax`},QC=()=>{if(typeof window>`u`)return`system`;let e=localStorage.getItem(`appearance`);return YC(e)?e:`system`},$C=e=>e===`dark`||e===`system`&&XC(),ew=()=>XC()?`dark`:`light`,tw=e=>{if(typeof document>`u`)return;let t=$C(e);document.documentElement.classList.toggle(`dark`,t),document.documentElement.style.colorScheme=t?`dark`:`light`},nw=()=>typeof window>`u`?null:window.matchMedia(`(prefers-color-scheme: dark)`),rw=()=>{tw(KC),GC()};function iw(e){KC=e,localStorage.setItem(`appearance`,e),ZC(`appearance`,e),tw(e),GC()}function aw(){typeof window>`u`||(localStorage.getItem(`appearance`)||(localStorage.setItem(`appearance`,`system`),ZC(`appearance`,`system`)),KC=QC(),tw(KC),nw()?.addEventListener(`change`,rw))}function ow(){let e=(0,z.useSyncExternalStore)(WC,()=>KC,()=>qC),t=(0,z.useSyncExternalStore)(WC,ew,()=>`light`);return{appearance:e,resolvedAppearance:e===`system`?t:e,updateAppearance:iw}}function sw({children:e}){let t=xc().props.lattice.layout;return t?(0,K.jsx)(mg,{outlet:e,children:(0,K.jsx)($e,{nodes:t.schema})}):(0,K.jsx)(K.Fragment,{children:e})}var cw=(0,z.lazy)(()=>fn(()=>import(`./subscriptions-DBWo_xL2.js`),__vite__mapDeps([24,1,2,5,10,4,11,19]),import.meta.url)),lw=class extends z.Component{state={failed:!1};static getDerivedStateFromError(){return{failed:!0}}componentDidCatch(){console.warn(`[lattice] Real-time listeners are declared but Echo is unavailable. Install @laravel/echo-react and call configureEcho().`)}render(){return this.state.failed?null:this.props.children}};function uw({listeners:e}){return e.length===0?null:(0,K.jsx)(lw,{children:(0,K.jsx)(z.Suspense,{fallback:null,children:(0,K.jsx)(cw,{listeners:e})})})}var dw={full:`max-w-none`,xl:`max-w-6xl`,lg:`max-w-4xl`,md:`max-w-2xl`,sm:`max-w-md`};function fw({lattice:e}){return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(Ac,{title:e.title??void 0}),(0,K.jsx)(uw,{listeners:e.listeners}),(0,K.jsx)(`div`,{"data-test":`lattice-page-container`,"data-page-width":e.width,className:x(`mx-auto w-full px-4 py-6 sm:px-6 lg:px-8`,dw[e.width]),children:(0,K.jsx)($e,{nodes:e.schema})})]})}var pw=`lattice/page`;function mw(e){return t=>{if(t===`lattice/page`)return{default:fw};let n=e[`./Pages/${t}.tsx`]??e[`./pages/${t}.tsx`];if(n)return n();throw Error(`Page not found: ${t}`)}}function hw({defaultLayout:e}={}){return(t,n)=>t===`lattice/page`?n.props.lattice?.layout?sw:null:e?.(t,n)??null}function gw(e,t){return{...t,headers:Nu(``,t.headers)}}var _w=!1;function vw(){_w||(_w=!0,xo.onRequest(e=>{let t=e.headers?.[Tu];return e.headers&&typeof t==`string`&&t!==``&&(e.headers[Tu]=Du(t)),e}))}function yw({action:e,children:t,options:n}){let{processing:r,requestSubmit:i}=pf(e,n);return t({onClick:i,processing:r})}function bw({children:e}){return(0,K.jsx)(yu,{render:e=>(0,K.jsx)(yw,{action:e.action,options:e.options,children:e.children}),children:e})}function xw(){let e=lu();(0,z.useEffect)(()=>G.on(`flash`,t=>{let n=su(t.detail?.flash?.latticeEffects);n.length>0&&e(n)}),[e])}function Sw({onAppearanceChange:e}){return Fl(d.appearanceChange,t=>{let n=t.detail?.value;YC(n)&&e?.(n)},{enabled:!!e}),null}var Cw={href:``};function ww({children:e,initialUrl:t,registry:n,sprite:r=Cw,toaster:i=!0}){xw(),Qc();let a=Xc(t);return(0,K.jsx)(h,{registry:n,children:(0,K.jsx)(zl,{adapter:a,children:(0,K.jsx)(bw,{children:(0,K.jsx)(D,{sprite:r,children:(0,K.jsxs)(gu,{children:[e,(0,K.jsx)(Sw,{onAppearanceChange:iw}),i?(0,K.jsx)(VC,{}):null]})})})})})}function Tw(e,t){let n=new Set([...e.namespaces??[`lattice`,`lattice-ui`],...t.map(e=>e.namespace)]);return{...e,namespaces:[...n]}}function Ew({ready:e,children:t}){let[n,r]=(0,z.useState)(!1);return(0,z.useEffect)(()=>{let t=!0,n=()=>{t&&r(!0)};return e.then(n,n),()=>{t=!1}},[e]),n?t:null}function Dw({registry:e,plugins:t,sprite:n,pages:r={},defaultLayout:i,strictMode:o=!0,i18n:s,boot:l,wrap:u,...d}={}){let f=e??HC,p=t&&t.length>0?Cn(f,...t):f;m(p),ju(c),vw();let h=s!==!1,g=t?.flatMap(e=>e.i18n?[e.i18n]:[])??[],_=h?Tw(s??{},g):{},v=d.defaults?.visitOptions,y=h?{...d.defaults,visitOptions:(e,t)=>gw(e,v?.(e,t)??t)}:d.defaults,b=bc({...d,defaults:y,strictMode:o,resolve:mw(r),layout:hw({defaultLayout:i}),withApp:(e,{ssr:t,page:r})=>{let i=[],o=r.props.lattice,s=!1;if(a(o)&&JC(o.appearance),!t){s=document.getElementById(d.id??`app`)?.hasAttribute(`data-server-rendered`)===!0,a(o)&&a(o.urls)&&typeof o.urls.refreshRef==`string`&&Vu(o.urls.refreshRef),h&&Gl(r.props)!==void 0&&i.push(fn(()=>Promise.resolve().then(()=>Kl).then(e=>e.configureI18nFromPageProps(r.props,_)),void 0,import.meta.url));let e=l?.({page:r});e&&i.push(e)}let c=(0,K.jsxs)(K.Fragment,{children:[e,h?(0,K.jsx)(Vl,{}):null]}),f=(0,K.jsx)(ww,{initialUrl:r.url,registry:p,sprite:n,children:u?u(c):c});return i.length===0?f:s?(P(Promise.all(i)),f):(0,K.jsx)(Ew,{ready:Promise.all(i),children:f})}});return aw(),b}m(HC);function Ow({registry:e=HC,...t}){return(0,K.jsx)(ww,{...t,registry:e})}function kw(e){if(typeof e!=`object`||!e)return{};let{data:t}=e;return typeof t==`object`&&t&&!Array.isArray(t)?t:{}}async function Aw(e,t,n){let r=e.props.endpoint,i={data:{},ok:!0,status:0};return r&&(i.ok=await Qu(async()=>{let n=await Wu(r,{body:JSON.stringify(t),method:e.props.method??`post`,ref:e.props.ref??``,throwOnError:!1});return i.status=n.status,i.data=kw(await n.clone().json().catch(()=>({}))),n},n)),i}function jw(){let e=lu();return(0,z.useCallback)((t,n)=>Aw(t,n,e),[e])}var Mw=`form.rich-editor`;function Nw(e,t){let n=[];for(let r of e){let e=t[r.type];e&&n.push({type:r.type,props:r.props,definition:e,group:e.group??r.type})}return n}var Pw={blockquote:!1,bold:!1,bulletList:!1,code:!1,codeBlock:!1,heading:!1,horizontalRule:!1,italic:!1,link:!1,listItem:!1,orderedList:!1,strike:!1,underline:!1};function Fw(e){return e.reduce((e,t)=>({...e,...t.definition.starterKit?.(t.props)}),{...Pw})}function Iw(e){return e.flatMap(e=>e.definition.extensions?.(e.props)??[])}function Lw(e){return e.flatMap(e=>(e.definition.commands?.(e.props)??[]).map(t=>({...t,group:e.group})))}function Rw(e){let t=[],n=null;for(let r of e){let e=r.definition.toolbar?.(r.props)??[];e.length!==0&&(n!==null&&n!==r.group&&t.push(`separator`),t.push(...e),n=r.group)}return t}function zw({active:e=!1,icon:t,label:n,testId:r,...i}){return(0,K.jsx)(Lf,{size:`sm`,icon:t,label:n,title:n,active:e,"data-test":r,...i,onMouseDown:e=>{e.preventDefault(),i.onMouseDown?.(e)}})}var Bw=class e extends st{constructor(e){super(e,e)}map(t,n){let r=t.resolve(n.map(this.head));return e.valid(r)?new e(r):st.near(r)}content(){return zt.empty}eq(t){return t instanceof e&&t.head==this.head}toJSON(){return{type:`gapcursor`,pos:this.head}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for GapCursor.fromJSON`);return new e(t.resolve(n.pos))}getBookmark(){return new Vw(this.anchor)}static valid(e){let t=e.parent;if(t.inlineContent||!Uw(e)||!Ww(e))return!1;let n=t.type.spec.allowGapCursor;if(n!=null)return n;let r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(t,n,r=!1){search:for(;;){if(!r&&e.valid(t))return t;let i=t.pos,a=null;for(let r=t.depth;;r--){let o=t.node(r);if(n>0?t.indexAfter(r)<o.childCount:t.index(r)>0){a=o.child(n>0?t.indexAfter(r):t.index(r)-1);break}if(r==0)return null;i+=n;let s=t.doc.resolve(i);if(e.valid(s))return s}for(;;){let o=n>0?a.firstChild:a.lastChild;if(!o){if(a.isAtom&&!a.isText&&!Ke.isSelectable(a)){t=t.doc.resolve(i+a.nodeSize*n),r=!1;continue search}break}a=o,i+=n;let s=t.doc.resolve(i);if(e.valid(s))return s}return null}}};Bw.prototype.visible=!1,Bw.findFrom=Bw.findGapCursorFrom,st.jsonID(`gapcursor`,Bw);var Vw=class e{constructor(e){this.pos=e}map(t){return new e(t.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return Bw.valid(t)?new Bw(t):st.near(t)}};function Hw(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}function Uw(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n-1);;e=e.lastChild){if(e.childCount==0&&!e.inlineContent||Hw(e.type))return!0;if(e.inlineContent)return!1}}return!0}function Ww(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n);;e=e.firstChild){if(e.childCount==0&&!e.inlineContent||Hw(e.type))return!0;if(e.inlineContent)return!1}}return!0}function Gw(){return new Ae({props:{decorations:Xw,createSelectionBetween(e,t,n){return t.pos==n.pos&&Bw.valid(n)?new Bw(n):null},handleClick:Jw,handleKeyDown:Kw,handleDOMEvents:{beforeinput:Yw}}})}var Kw=Se({ArrowLeft:qw(`horiz`,-1),ArrowRight:qw(`horiz`,1),ArrowUp:qw(`vert`,-1),ArrowDown:qw(`vert`,1)});function qw(e,t){let n=e==`vert`?t>0?`down`:`up`:t>0?`right`:`left`;return function(e,r,i){let a=e.selection,o=t>0?a.$to:a.$from,s=a.empty;if(a instanceof At){if(!i.endOfTextblock(n)||o.depth==0)return!1;s=!1,o=e.doc.resolve(t>0?o.after():o.before())}let c=Bw.findGapCursorFrom(o,t,s);return c?(r&&r(e.tr.setSelection(new Bw(c))),!0):!1}}function Jw(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!Bw.valid(r))return!1;let i=e.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&Ke.isSelectable(e.state.doc.nodeAt(i.inside))?!1:(e.dispatch(e.state.tr.setSelection(new Bw(r))),!0)}function Yw(e,t){if(t.inputType!=`insertCompositionText`||!(e.state.selection instanceof Bw))return!1;let{$from:n}=e.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;let i=Nt.empty;for(let e=r.length-1;e>=0;e--)i=Nt.from(r[e].createAndFill(null,i));let a=e.state.tr.replace(n.pos,n.pos,new zt(i,0,0));return a.setSelection(At.near(a.doc.resolve(n.pos+1))),e.dispatch(a),!1}function Xw(e){if(!(e.selection instanceof Bw))return null;let t=document.createElement(`div`);return t.className=`ProseMirror-gapcursor`,He.create(e.doc,[We.widget(e.selection.head,t,{key:`gapcursor`})])}var Zw=(e,t)=>{let n=t.view.domAtPos(e).node,r=n.nodeType===Node.ELEMENT_NODE?n:n.parentElement;return r?r.offsetParent!==null:!1},Qw=(e,t,n)=>{for(let r=e.depth;r>0;--r){let i=e.node(r),a=t(i),o=Zw(e.start(r),n);if(a&&o)return{pos:r>0?e.before(r):0,start:e.start(r),depth:r,node:i}}},$w=(e,t)=>{let{state:n,view:r,extensionManager:i}=e,{schema:a,selection:o}=n,{empty:s,$anchor:c}=o,l=!!i.extensions.find(e=>e.name===`gapCursor`);if(!s||c.parent.type!==a.nodes.detailsSummary||!l||t===`right`&&c.parentOffset!==c.parent.nodeSize-2)return!1;let u=Xt(e=>e.type===a.nodes.details)(o);if(!u)return!1;let d=Je(u.node,e=>e.type===a.nodes.detailsContent);if(!d.length||Zw(u.start+d[0].pos+1,e))return!1;let f=n.doc.resolve(u.pos+u.node.nodeSize),p=Bw.findFrom(f,1,!1);if(!p)return!1;let{tr:m}=n,h=new Bw(p);return m.setSelection(h),m.scrollIntoView(),r.dispatch(m),!0},eT=Ct.create({name:`details`,content:`detailsSummary detailsContent`,group:`block`,defining:!0,isolating:!0,allowGapCursor:!1,addOptions(){return{persist:!1,openClassName:`is-open`,HTMLAttributes:{},renderToggleButton:({element:e,isOpen:t})=>{e.setAttribute(`aria-label`,t?`Collapse details content`:`Expand details content`)}}},addAttributes(){return this.options.persist?{open:{default:!1,parseHTML:e=>e.hasAttribute(`open`),renderHTML:({open:e})=>e?{open:``}:{}}}:[]},parseHTML(){return[{tag:`details`}]},renderHTML({HTMLAttributes:e}){return[`details`,Re(this.options.HTMLAttributes,e),0]},...Et({nodeName:`details`,content:`block`}),addNodeView(){return({editor:e,getPos:t,node:n,HTMLAttributes:r})=>{let i=document.createElement(`div`),a=Re(this.options.HTMLAttributes,r,{"data-type":this.name});Object.entries(a).forEach(([e,t])=>i.setAttribute(e,t));let o=document.createElement(`button`);o.type=`button`;let s=e=>{this.options.renderToggleButton({element:o,...e})};i.append(o);let c=document.createElement(`div`);i.append(c);let l=e=>{let{setToValue:t,node:r=n}=e||{};if(t!==void 0)if(t){if(i.classList.contains(this.options.openClassName))return;i.classList.add(this.options.openClassName)}else{if(!i.classList.contains(this.options.openClassName))return;i.classList.remove(this.options.openClassName)}else i.classList.toggle(this.options.openClassName);let a=i.classList.contains(this.options.openClassName);s({isOpen:a,node:r});let o=new Event(`toggleDetailsContent`);c.querySelector(`:scope > div[data-type="detailsContent"]`)?.dispatchEvent(o)};return s({isOpen:!!n.attrs.open,node:n}),n.attrs.open&&setTimeout(()=>l()),o.addEventListener(`click`,()=>{if(l(),!this.options.persist){e.commands.focus(void 0,{scrollIntoView:!1});return}if(e.isEditable&&typeof t==`function`){let{from:n,to:r}=e.state.selection;e.chain().command(({tr:e})=>{let n=t();if(typeof n!=`number`)return!1;let r=e.doc.nodeAt(n);return r?.type===this.type&&(e.setNodeMarkup(n,void 0,{open:!r.attrs.open}),!0)}).setTextSelection({from:n,to:r}).focus(void 0,{scrollIntoView:!1}).run()}}),{dom:i,contentDOM:c,ignoreMutation(e){if(e.type===`selection`)return!1;let t=e.target,n=i.contains(t);return o.contains(t)||!n||i===t},update:e=>e.type===this.type&&(e.attrs.open===void 0?s({isOpen:i.classList.contains(this.options.openClassName),node:e}):l({setToValue:e.attrs.open,node:e}),!0)}}},addCommands(){return{setDetails:()=>({state:e,chain:t})=>{let{schema:n,selection:r}=e,{$from:i,$to:a}=r,o=i.blockRange(a);if(!o)return!1;let s=e.doc.slice(o.start,o.end);if(!n.nodes.detailsContent.contentMatch.matchFragment(s.content))return!1;let c=s.toJSON()?.content||[];return t().insertContentAt({from:o.start,to:o.end},{type:this.name,content:[{type:`detailsSummary`},{type:`detailsContent`,content:c}]}).setTextSelection(o.start+2).run()},unsetDetails:()=>({state:e,chain:t})=>{let{selection:n,schema:r}=e,i=Xt(e=>e.type===this.type)(n);if(!i)return!1;let a=Je(i.node,e=>e.type===r.nodes.detailsSummary),o=Je(i.node,e=>e.type===r.nodes.detailsContent);if(!a.length||!o.length)return!1;let s=a[0],c=o[0],l=i.pos,u=e.doc.resolve(l),d={from:l,to:l+i.node.nodeSize},f=c.node.content.toJSON()||[],p=[u.parent.type.contentMatch.defaultType?.create(null,s.node.content).toJSON(),...f];return t().insertContentAt(d,p).setTextSelection(l+1).run()}}},addKeyboardShortcuts(){return{Backspace:()=>{let{schema:e,selection:t}=this.editor.state,{empty:n,$anchor:r}=t;return!n||r.parent.type!==e.nodes.detailsSummary?!1:r.parentOffset===0?this.editor.commands.unsetDetails():this.editor.commands.command(({tr:e})=>{let t=r.pos-1,n=r.pos;return e.delete(t,n),!0})},Enter:({editor:e})=>{let{state:t,view:n}=e,{schema:r,selection:i}=t,{$head:a}=i;if(a.parent.type!==r.nodes.detailsSummary)return!1;let o=Zw(a.after()+1,e),s=o?t.doc.nodeAt(a.after()):a.node(-2);if(!s)return!1;let c=o?0:a.indexAfter(-1),l=pt(s.contentMatchAt(c));if(!l||!s.canReplaceWith(c,c,l))return!1;let u=l.createAndFill();if(!u)return!1;let d=o?a.after()+1:a.after(-1),f=t.tr.replaceWith(d,d,u),p=f.doc.resolve(d),m=st.near(p,1);return f.setSelection(m),f.scrollIntoView(),n.dispatch(f),!0},ArrowRight:({editor:e})=>$w(e,`right`),ArrowDown:({editor:e})=>$w(e,`down`)}},addProseMirrorPlugins(){return[new Ae({key:new ce(`detailsSelection`),appendTransaction:(e,t,n)=>{let{editor:r,type:i}=this;if(r.view.composing||!e.some(e=>e.selectionSet)||!t.selection.empty||!n.selection.empty||!Te(n,i.name))return;let{$from:a}=n.selection;if(Zw(a.pos,r))return;let o=Qw(a,e=>e.type===i,r);if(!o)return;let s=Je(o.node,e=>e.type===n.schema.nodes.detailsSummary);if(!s.length)return;let c=s[0],l=(t.selection.from<n.selection.from?`forward`:`backward`)==`forward`?o.start+c.pos:o.pos+c.pos+c.node.nodeSize,u=At.create(n.doc,l);return n.tr.setSelection(u)}})]}}),tT=Ct.create({name:`detailsContent`,content:`block+`,defining:!0,selectable:!1,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`div[data-type="${this.name}"]`}]},renderHTML({HTMLAttributes:e}){return[`div`,Re(this.options.HTMLAttributes,e,{"data-type":this.name}),0]},addNodeView(){return({HTMLAttributes:e})=>{let t=document.createElement(`div`),n=Re(this.options.HTMLAttributes,e,{"data-type":this.name,hidden:`hidden`});return Object.entries(n).forEach(([e,n])=>t.setAttribute(e,n)),t.addEventListener(`toggleDetailsContent`,()=>{t.toggleAttribute(`hidden`)}),{dom:t,contentDOM:t,ignoreMutation(e){return e.type===`selection`?!1:!t.contains(e.target)||t===e.target},update:e=>e.type===this.type}}},addKeyboardShortcuts(){return{Enter:({editor:e})=>{let{state:t,view:n}=e,{selection:r}=t,{$from:i,empty:a}=r,o=Xt(e=>e.type===this.type)(r);if(!a||!o||!o.node.childCount)return!1;let s=i.index(o.depth),{childCount:c}=o.node;if(c!==s+1)return!1;let l=o.node.type.contentMatch.defaultType?.createAndFill();if(!l)return!1;let u=t.doc.resolve(o.pos+1),d=c-1,f=o.node.child(d),p=u.posAtIndex(d,o.depth);if(!f.eq(l))return!1;let m=i.node(-3);if(!m)return!1;let h=i.indexAfter(-3),g=pt(m.contentMatchAt(h));if(!g||!m.canReplaceWith(h,h,g))return!1;let _=g.createAndFill();if(!_)return!1;let{tr:v}=t,y=i.after(-2);v.replaceWith(y,y,_);let b=v.doc.resolve(y),x=st.near(b,1);v.setSelection(x);let S=p,C=p+f.nodeSize;return v.delete(S,C),v.scrollIntoView(),n.dispatch(v),!0}}},...Et({nodeName:`detailsContent`})}),nT=Ct.create({name:`detailsSummary`,content:`text*`,defining:!0,selectable:!1,isolating:!0,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`summary`}]},renderHTML({HTMLAttributes:e}){return[`summary`,Re(this.options.HTMLAttributes,e),0]},...Et({nodeName:`detailsSummary`,content:`inline`})}),rT=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,iT=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,aT=et.create({name:`highlight`,addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:e=>e.getAttribute(`data-color`)||xt(e,`background-color`)||e.style.backgroundColor,renderHTML:e=>e.color?{"data-color":e.color,style:`background-color: ${e.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:`mark`}]},renderHTML({HTMLAttributes:e}){return[`mark`,Re(this.options.HTMLAttributes,e),0]},renderMarkdown:(e,t)=>`==${t.renderChildren(e)}==`,parseMarkdown:(e,t)=>t.applyMark(`highlight`,t.parseInline(e.tokens||[])),markdownTokenizer:{name:`highlight`,level:`inline`,start:e=>e.indexOf(`==`),tokenize(e,t,n){let r=/^(==)([^=]+)(==)/.exec(e);if(r){let e=r[2].trim(),t=n.inlineTokens(e);return{type:`highlight`,raw:r[0],text:e,tokens:t}}}},addCommands(){return{setHighlight:e=>({commands:t})=>t.setMark(this.name,e),toggleHighlight:e=>({commands:t})=>t.toggleMark(this.name,e),unsetHighlight:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[$t({find:rT,type:this.type})]},addPasteRules(){return[de({find:iT,type:this.type})]}}),oT,sT;if(typeof WeakMap<`u`){let e=new WeakMap;oT=t=>e.get(t),sT=(t,n)=>(e.set(t,n),n)}else{let e=[],t=0;oT=t=>{for(let n=0;n<e.length;n+=2)if(e[n]==t)return e[n+1]},sT=(n,r)=>(t==10&&(t=0),e[t++]=n,e[t++]=r)}var cT=class{constructor(e,t,n,r){this.width=e,this.height=t,this.map=n,this.problems=r}findCell(e){for(let t=0;t<this.map.length;t++){let n=this.map[t];if(n!=e)continue;let r=t%this.width,i=t/this.width|0,a=r+1,o=i+1;for(let e=1;a<this.width&&this.map[t+e]==n;e++)a++;for(let e=1;o<this.height&&this.map[t+this.width*e]==n;e++)o++;return{left:r,top:i,right:a,bottom:o}}throw RangeError(`No cell with offset ${e} found`)}colCount(e){for(let t=0;t<this.map.length;t++)if(this.map[t]==e)return t%this.width;throw RangeError(`No cell with offset ${e} found`)}nextCell(e,t,n){let{left:r,right:i,top:a,bottom:o}=this.findCell(e);return t==`horiz`?(n<0?r==0:i==this.width)?null:this.map[a*this.width+(n<0?r-1:i)]:(n<0?a==0:o==this.height)?null:this.map[r+this.width*(n<0?a-1:o)]}rectBetween(e,t){let{left:n,right:r,top:i,bottom:a}=this.findCell(e),{left:o,right:s,top:c,bottom:l}=this.findCell(t);return{left:Math.min(n,o),top:Math.min(i,c),right:Math.max(r,s),bottom:Math.max(a,l)}}cellsInRect(e){let t=[],n={};for(let r=e.top;r<e.bottom;r++)for(let i=e.left;i<e.right;i++){let a=r*this.width+i,o=this.map[a];n[o]||(n[o]=!0,!(i==e.left&&i&&this.map[a-1]==o||r==e.top&&r&&this.map[a-this.width]==o)&&t.push(o))}return t}positionAt(e,t,n){for(let r=0,i=0;;r++){let a=i+n.child(r).nodeSize;if(r==e){let n=t+e*this.width,r=(e+1)*this.width;for(;n<r&&this.map[n]<i;)n++;return n==r?a-1:this.map[n]}i=a}}static get(e){return oT(e)||sT(e,lT(e))}};function lT(e){if(e.type.spec.tableRole!=`table`)throw RangeError(`Not a table node: `+e.type.name);let t=uT(e),n=e.childCount,r=[],i=0,a=null,o=[];for(let e=0,i=t*n;e<i;e++)r[e]=0;for(let s=0,c=0;s<n;s++){let l=e.child(s);c++;for(let e=0;;e++){for(;i<r.length&&r[i]!=0;)i++;if(e==l.childCount)break;let u=l.child(e),{colspan:d,rowspan:f,colwidth:p}=u.attrs;for(let e=0;e<f;e++){if(e+s>=n){(a||=[]).push({type:`overlong_rowspan`,pos:c,n:f-e});break}let l=i+e*t;for(let e=0;e<d;e++){r[l+e]==0?r[l+e]=c:(a||=[]).push({type:`collision`,row:s,pos:c,n:d-e});let n=p&&p[e];if(n){let r=(l+e)%t*2,i=o[r];i==null||i!=n&&o[r+1]==1?(o[r]=n,o[r+1]=1):i==n&&o[r+1]++}}}i+=d,c+=u.nodeSize}let u=(s+1)*t,d=0;for(;i<u;)r[i++]==0&&d++;d&&(a||=[]).push({type:`missing`,row:s,n:d}),c++}(t===0||n===0)&&(a||=[]).push({type:`zero_sized`});let s=new cT(t,n,r,a),c=!1;for(let e=0;!c&&e<o.length;e+=2)o[e]!=null&&o[e+1]<n&&(c=!0);return c&&dT(s,o,e),s}function uT(e){let t=-1,n=!1;for(let r=0;r<e.childCount;r++){let i=e.child(r),a=0;if(n)for(let t=0;t<r;t++){let n=e.child(t);for(let e=0;e<n.childCount;e++){let i=n.child(e);t+i.attrs.rowspan>r&&(a+=i.attrs.colspan)}}for(let e=0;e<i.childCount;e++){let t=i.child(e);a+=t.attrs.colspan,t.attrs.rowspan>1&&(n=!0)}t==-1?t=a:t!=a&&(t=Math.max(t,a))}return t}function dT(e,t,n){e.problems||=[];let r={};for(let i=0;i<e.map.length;i++){let a=e.map[i];if(r[a])continue;r[a]=!0;let o=n.nodeAt(a);if(!o)throw RangeError(`No cell with offset ${a} found`);let s=null,c=o.attrs;for(let n=0;n<c.colspan;n++){let r=t[(i+n)%e.width*2];r!=null&&(!c.colwidth||c.colwidth[n]!=r)&&((s||=fT(c))[n]=r)}s&&e.problems.unshift({type:`colwidth mismatch`,pos:a,colwidth:s})}}function fT(e){if(e.colwidth)return e.colwidth.slice();let t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}function pT(e){let t=e.cached.tableNodeTypes;if(!t){t=e.cached.tableNodeTypes={};for(let n in e.nodes){let r=e.nodes[n],i=r.spec.tableRole;i&&(t[i]=r)}}return t}var mT=new ce(`selectingCells`);function hT(e){for(let t=e.depth-1;t>0;t--)if(e.node(t).type.spec.tableRole==`row`)return e.node(0).resolve(e.before(t+1));return null}function gT(e){for(let t=e.depth;t>0;t--){let n=e.node(t).type.spec.tableRole;if(n===`cell`||n===`header_cell`)return e.node(t)}return null}function _T(e){let t=e.selection.$head;for(let e=t.depth;e>0;e--)if(t.node(e).type.spec.tableRole==`row`)return!0;return!1}function vT(e){let t=e.selection;if(`$anchorCell`in t&&t.$anchorCell)return t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell;if(`node`in t&&t.node&&t.node.type.spec.tableRole==`cell`)return t.$anchor;let n=hT(t.$head)||yT(t.$head);if(n)return n;throw RangeError(`No cell found around position ${t.head}`)}function yT(e){for(let t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){let r=t.type.spec.tableRole;if(r==`cell`||r==`header_cell`)return e.doc.resolve(n)}for(let t=e.nodeBefore,n=e.pos;t;t=t.lastChild,n--){let r=t.type.spec.tableRole;if(r==`cell`||r==`header_cell`)return e.doc.resolve(n-t.nodeSize)}}function bT(e){return e.parent.type.spec.tableRole==`row`&&!!e.nodeAfter}function xT(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function ST(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function CT(e,t,n){let r=e.node(-1),i=cT.get(r),a=e.start(-1),o=i.nextCell(e.pos-a,t,n);return o==null?null:e.node(0).resolve(a+o)}function wT(e,t,n=1){let r={...e,colspan:e.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(t,n),r.colwidth.some(e=>e>0)||(r.colwidth=null)),r}function TT(e,t,n=1){let r={...e,colspan:e.colspan+n};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let e=0;e<n;e++)r.colwidth.splice(t,0,0)}return r}function ET(e,t,n){let r=pT(t.type.schema).header_cell;for(let i=0;i<e.height;i++)if(t.nodeAt(e.map[n+i*e.width]).type!=r)return!1;return!0}var DT=class e extends st{constructor(e,t=e){let n=e.node(-1),r=cT.get(n),i=e.start(-1),a=r.rectBetween(e.pos-i,t.pos-i),o=e.node(0),s=r.cellsInRect(a).filter(e=>e!=t.pos-i);s.unshift(t.pos-i);let c=s.map(e=>{let t=n.nodeAt(e);if(!t)throw RangeError(`No cell with offset ${e} found`);let r=i+e+1;return new Vt(o.resolve(r),o.resolve(r+t.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=e,this.$headCell=t}map(t,n){let r=t.resolve(n.map(this.$anchorCell.pos)),i=t.resolve(n.map(this.$headCell.pos));if(bT(r)&&bT(i)&&ST(r,i)){let t=this.$anchorCell.node(-1)!=r.node(-1);return t&&this.isRowSelection()?e.rowSelection(r,i):t&&this.isColSelection()?e.colSelection(r,i):new e(r,i)}return At.between(r,i)}content(){let e=this.$anchorCell.node(-1),t=cT.get(e),n=this.$anchorCell.start(-1),r=t.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),i={},a=[];for(let n=r.top;n<r.bottom;n++){let o=[];for(let a=n*t.width+r.left,s=r.left;s<r.right;s++,a++){let n=t.map[a];if(i[n])continue;i[n]=!0;let s=t.findCell(n),c=e.nodeAt(n);if(!c)throw RangeError(`No cell with offset ${n} found`);let l=r.left-s.left,u=s.right-r.right;if(l>0||u>0){let e=c.attrs;if(l>0&&(e=wT(e,0,l)),u>0&&(e=wT(e,e.colspan-u,u)),s.left<r.left){if(c=c.type.createAndFill(e),!c)throw RangeError(`Could not create cell with attrs ${JSON.stringify(e)}`)}else c=c.type.create(e,c.content)}if(s.top<r.top||s.bottom>r.bottom){let e={...c.attrs,rowspan:Math.min(s.bottom,r.bottom)-Math.max(s.top,r.top)};c=s.top<r.top?c.type.createAndFill(e):c.type.create(e,c.content)}o.push(c)}a.push(e.child(n).copy(Nt.from(o)))}let o=this.isColSelection()&&this.isRowSelection()?e:a;return new zt(Nt.from(o),1,1)}replace(e,t=zt.empty){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:a,$to:o}=r[i],s=e.mapping.slice(n);e.replace(s.map(a.pos),s.map(o.pos),i?zt.empty:t)}let i=st.findFrom(e.doc.resolve(e.mapping.slice(n).map(this.to)),-1);i&&e.setSelection(i)}replaceWith(e,t){this.replace(e,new zt(Nt.from(t),0,0))}forEachCell(e){let t=this.$anchorCell.node(-1),n=cT.get(t),r=this.$anchorCell.start(-1),i=n.cellsInRect(n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r));for(let n=0;n<i.length;n++)e(t.nodeAt(i[n]),r+i[n])}isColSelection(){let e=this.$anchorCell.index(-1),t=this.$headCell.index(-1);if(Math.min(e,t)>0)return!1;let n=e+this.$anchorCell.nodeAfter.attrs.rowspan,r=t+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,r)==this.$headCell.node(-1).childCount}static colSelection(t,n=t){let r=t.node(-1),i=cT.get(r),a=t.start(-1),o=i.findCell(t.pos-a),s=i.findCell(n.pos-a),c=t.node(0);return o.top<=s.top?(o.top>0&&(t=c.resolve(a+i.map[o.left])),s.bottom<i.height&&(n=c.resolve(a+i.map[i.width*(i.height-1)+s.right-1]))):(s.top>0&&(n=c.resolve(a+i.map[s.left])),o.bottom<i.height&&(t=c.resolve(a+i.map[i.width*(i.height-1)+o.right-1]))),new e(t,n)}isRowSelection(){let e=this.$anchorCell.node(-1),t=cT.get(e),n=this.$anchorCell.start(-1),r=t.colCount(this.$anchorCell.pos-n),i=t.colCount(this.$headCell.pos-n);if(Math.min(r,i)>0)return!1;let a=r+this.$anchorCell.nodeAfter.attrs.colspan,o=i+this.$headCell.nodeAfter.attrs.colspan;return Math.max(a,o)==t.width}eq(t){return t instanceof e&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}static rowSelection(t,n=t){let r=t.node(-1),i=cT.get(r),a=t.start(-1),o=i.findCell(t.pos-a),s=i.findCell(n.pos-a),c=t.node(0);return o.left<=s.left?(o.left>0&&(t=c.resolve(a+i.map[o.top*i.width])),s.right<i.width&&(n=c.resolve(a+i.map[i.width*(s.top+1)-1]))):(s.left>0&&(n=c.resolve(a+i.map[s.top*i.width])),o.right<i.width&&(t=c.resolve(a+i.map[i.width*(o.top+1)-1]))),new e(t,n)}toJSON(){return{type:`cell`,anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(t,n){return new e(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,r=n){return new e(t.resolve(n),t.resolve(r))}getBookmark(){return new OT(this.$anchorCell.pos,this.$headCell.pos)}};DT.prototype.visible=!1,st.jsonID(`cell`,DT);var OT=class e{constructor(e,t){this.anchor=e,this.head=t}map(t){return new e(t.map(this.anchor),t.map(this.head))}resolve(e){let t=e.resolve(this.anchor),n=e.resolve(this.head);return t.parent.type.spec.tableRole==`row`&&n.parent.type.spec.tableRole==`row`&&t.index()<t.parent.childCount&&n.index()<n.parent.childCount&&ST(t,n)?new DT(t,n):st.near(n,1)}};function kT(e){if(!(e.selection instanceof DT))return null;let t=[];return e.selection.forEachCell((e,n)=>{t.push(We.node(n,n+e.nodeSize,{class:`selectedCell`}))}),He.create(e.doc,t)}function AT({$from:e,$to:t}){if(e.pos==t.pos||e.pos<t.pos-6)return!1;let n=e.pos,r=t.pos,i=e.depth;for(;i>=0&&!(e.after(i+1)<e.end(i));i--,n++);for(let e=t.depth;e>=0&&!(t.before(e+1)>t.start(e));e--,r--);return n==r&&/row|table/.test(e.node(i).type.spec.tableRole)}function jT({$from:e,$to:t}){let n,r;for(let t=e.depth;t>0;t--){let r=e.node(t);if(r.type.spec.tableRole===`cell`||r.type.spec.tableRole===`header_cell`){n=r;break}}for(let e=t.depth;e>0;e--){let n=t.node(e);if(n.type.spec.tableRole===`cell`||n.type.spec.tableRole===`header_cell`){r=n;break}}return n!==r&&t.parentOffset===0}function MT(e,t,n){let r=(t||e).selection,i=(t||e).doc,a,o;if(r instanceof Ke&&(o=r.node.type.spec.tableRole)){if(o==`cell`||o==`header_cell`)a=DT.create(i,r.from);else if(o==`row`){let e=i.resolve(r.from+1);a=DT.rowSelection(e,e)}else if(!n){let e=cT.get(r.node),t=r.from+1,n=t+e.map[e.width*e.height-1];a=DT.create(i,t+1,n)}}else r instanceof At&&AT(r)?a=At.create(i,r.from):r instanceof At&&jT(r)&&(a=At.create(i,r.$from.start(),r.$from.end()));return a&&(t||=e.tr).setSelection(a),t}var NT=new ce(`fix-tables`);function PT(e,t,n,r){let i=e.childCount,a=t.childCount;outer:for(let o=0,s=0;o<a;o++){let a=t.child(o);for(let t=s,r=Math.min(i,o+3);t<r;t++)if(e.child(t)==a){s=t+1,n+=a.nodeSize;continue outer}r(a,n),s<i&&e.child(s).sameMarkup(a)?PT(e.child(s),a,n+1,r):a.nodesBetween(0,a.content.size,r,n+1),n+=a.nodeSize}}function FT(e,t){let n,r=(t,r)=>{t.type.spec.tableRole==`table`&&(n=IT(e,t,r,n))};return t?t.doc!=e.doc&&PT(t.doc,e.doc,0,r):e.doc.descendants(r),n}function IT(e,t,n,r){let i=cT.get(t);if(!i.problems)return r;r||=e.tr;let a=[];for(let e=0;e<i.height;e++)a.push(0);for(let e=0;e<i.problems.length;e++){let o=i.problems[e];if(o.type==`collision`){let e=t.nodeAt(o.pos);if(!e)continue;let i=e.attrs;for(let e=0;e<i.rowspan;e++)a[o.row+e]+=o.n;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,wT(i,i.colspan-o.n,o.n))}else if(o.type==`missing`)a[o.row]+=o.n;else if(o.type==`overlong_rowspan`){let e=t.nodeAt(o.pos);if(!e)continue;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,{...e.attrs,rowspan:e.attrs.rowspan-o.n})}else if(o.type==`colwidth mismatch`){let e=t.nodeAt(o.pos);if(!e)continue;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,{...e.attrs,colwidth:o.colwidth})}else if(o.type==`zero_sized`){let e=r.mapping.map(n);r.delete(e,e+t.nodeSize)}}let o,s;for(let e=0;e<a.length;e++)a[e]&&(o??=e,s=e);for(let c=0,l=n+1;c<i.height;c++){let n=t.child(c),i=l+n.nodeSize,u=a[c];if(u>0){let t=`cell`;n.firstChild&&(t=n.firstChild.type.spec.tableRole);let a=[];for(let n=0;n<u;n++){let n=pT(e.schema)[t].createAndFill();n&&a.push(n)}let d=(c==0||o==c-1)&&s==c?l+1:i-1;r.insert(r.mapping.map(d),a)}l=i}return r.setMeta(NT,{fixTables:!0})}function LT(e){let t=e.selection,n=vT(e),r=n.node(-1),i=n.start(-1),a=cT.get(r);return{...t instanceof DT?a.rectBetween(t.$anchorCell.pos-i,t.$headCell.pos-i):a.findCell(n.pos-i),tableStart:i,map:a,table:r}}function RT(e,{map:t,tableStart:n,table:r},i){let a=i>0?-1:0;ET(t,r,i+a)&&(a=i==0||i==t.width?null:0);for(let o=0;o<t.height;o++){let s=o*t.width+i;if(i>0&&i<t.width&&t.map[s-1]==t.map[s]){let a=t.map[s],c=r.nodeAt(a);e.setNodeMarkup(e.mapping.map(n+a),null,TT(c.attrs,i-t.colCount(a))),o+=c.attrs.rowspan-1}else{let c=a==null?pT(r.type.schema).cell:r.nodeAt(t.map[s+a]).type,l=t.positionAt(o,i,r);e.insert(e.mapping.map(n+l),c.createAndFill())}}return e}function zT(e,t){if(!_T(e))return!1;if(t){let n=LT(e);t(RT(e.tr,n,n.left))}return!0}function BT(e,t){if(!_T(e))return!1;if(t){let n=LT(e);t(RT(e.tr,n,n.right))}return!0}function VT(e,{map:t,table:n,tableStart:r},i){let a=e.mapping.maps.length;for(let o=0;o<t.height;){let s=o*t.width+i,c=t.map[s],l=n.nodeAt(c),u=l.attrs;if(i>0&&t.map[s-1]==c||i<t.width-1&&t.map[s+1]==c)e.setNodeMarkup(e.mapping.slice(a).map(r+c),null,wT(u,i-t.colCount(c)));else{let t=e.mapping.slice(a).map(r+c);e.delete(t,t+l.nodeSize)}o+=u.rowspan}}function HT(e,t){if(!_T(e))return!1;if(t){let n=LT(e),r=e.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let e=n.right-1;VT(r,n,e),e!=n.left;e--){let e=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!e)throw RangeError(`No table found`);n.table=e,n.map=cT.get(e)}t(r)}return!0}function UT(e,t,n){let r=pT(t.type.schema).header_cell;for(let i=0;i<e.width;i++)if(t.nodeAt(e.map[i+n*e.width])?.type!=r)return!1;return!0}function WT(e,{map:t,tableStart:n,table:r},i){let a=n;for(let e=0;e<i;e++)a+=r.child(e).nodeSize;let o=[],s=i>0?-1:0;UT(t,r,i+s)&&(s=i==0||i==t.height?null:0);for(let a=0,c=t.width*i;a<t.width;a++,c++)if(i>0&&i<t.height&&t.map[c]==t.map[c-t.width]){let i=t.map[c],o=r.nodeAt(i).attrs;e.setNodeMarkup(n+i,null,{...o,rowspan:o.rowspan+1}),a+=o.colspan-1}else{let e=(s==null?pT(r.type.schema).cell:r.nodeAt(t.map[c+s*t.width])?.type)?.createAndFill();e&&o.push(e)}return e.insert(a,pT(r.type.schema).row.create(null,o)),e}function GT(e,t){if(!_T(e))return!1;if(t){let n=LT(e);t(WT(e.tr,n,n.top))}return!0}function KT(e,t){if(!_T(e))return!1;if(t){let n=LT(e);t(WT(e.tr,n,n.bottom))}return!0}function qT(e,{map:t,table:n,tableStart:r},i){let a=0;for(let e=0;e<i;e++)a+=n.child(e).nodeSize;let o=a+n.child(i).nodeSize,s=e.mapping.maps.length;e.delete(a+r,o+r);let c=new Set;for(let a=0,o=i*t.width;a<t.width;a++,o++){let l=t.map[o];if(!c.has(l)){if(c.add(l),i>0&&l==t.map[o-t.width]){let t=n.nodeAt(l).attrs;e.setNodeMarkup(e.mapping.slice(s).map(l+r),null,{...t,rowspan:t.rowspan-1}),a+=t.colspan-1}else if(i<t.height&&l==t.map[o+t.width]){let o=n.nodeAt(l),c=o.attrs,u=o.type.create({...c,rowspan:o.attrs.rowspan-1},o.content),d=t.positionAt(i+1,a,n);e.insert(e.mapping.slice(s).map(r+d),u),a+=c.colspan-1}}}}function JT(e,t){if(!_T(e))return!1;if(t){let n=LT(e),r=e.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let e=n.bottom-1;qT(r,n,e),e!=n.top;e--){let e=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!e)throw RangeError(`No table found`);n.table=e,n.map=cT.get(n.table)}t(r)}return!0}function YT(e){let t=e.content;return t.childCount==1&&t.child(0).isTextblock&&t.child(0).childCount==0}function XT({width:e,height:t,map:n},r){let i=r.top*e+r.left,a=i,o=(r.bottom-1)*e+r.left,s=i+(r.right-r.left-1);for(let t=r.top;t<r.bottom;t++){if(r.left>0&&n[a]==n[a-1]||r.right<e&&n[s]==n[s+1])return!0;a+=e,s+=e}for(let a=r.left;a<r.right;a++){if(r.top>0&&n[i]==n[i-e]||r.bottom<t&&n[o]==n[o+e])return!0;i++,o++}return!1}function ZT(e,t){let n=e.selection;if(!(n instanceof DT)||n.$anchorCell.pos==n.$headCell.pos)return!1;let r=LT(e),{map:i}=r;if(XT(i,r))return!1;if(t){let n=e.tr,a={},o=Nt.empty,s,c;for(let e=r.top;e<r.bottom;e++)for(let t=r.left;t<r.right;t++){let l=i.map[e*i.width+t],u=r.table.nodeAt(l);if(!(a[l]||!u))if(a[l]=!0,s==null)s=l,c=u;else{YT(u)||(o=o.append(u.content));let e=n.mapping.map(l+r.tableStart);n.delete(e,e+u.nodeSize)}}if(s==null||c==null)return!0;if(n.setNodeMarkup(s+r.tableStart,null,{...TT(c.attrs,c.attrs.colspan,r.right-r.left-c.attrs.colspan),rowspan:r.bottom-r.top}),o.size>0){let e=s+1+c.content.size,t=YT(c)?s+1:e;n.replaceWith(t+r.tableStart,e+r.tableStart,o)}n.setSelection(new DT(n.doc.resolve(s+r.tableStart))),t(n)}return!0}function QT(e,t){let n=pT(e.schema);return $T(({node:e})=>n[e.type.spec.tableRole])(e,t)}function $T(e){return(t,n)=>{let r=t.selection,i,a;if(r instanceof DT){if(r.$anchorCell.pos!=r.$headCell.pos)return!1;i=r.$anchorCell.nodeAfter,a=r.$anchorCell.pos}else{if(i=gT(r.$from),!i)return!1;a=hT(r.$from)?.pos}if(i==null||a==null||i.attrs.colspan==1&&i.attrs.rowspan==1)return!1;if(n){let o=i.attrs,s=[],c=o.colwidth;o.rowspan>1&&(o={...o,rowspan:1}),o.colspan>1&&(o={...o,colspan:1});let l=LT(t),u=t.tr;for(let e=0;e<l.right-l.left;e++)s.push(c?{...o,colwidth:c&&c[e]?[c[e]]:null}:o);let d;for(let t=l.top;t<l.bottom;t++){let n=l.map.positionAt(t,l.left,l.table);t==l.top&&(n+=i.nodeSize);for(let r=l.left,a=0;r<l.right;r++,a++)(r!=l.left||t!=l.top)&&u.insert(d=u.mapping.map(n+l.tableStart,1),e({node:i,row:t,col:r}).createAndFill(s[a]))}u.setNodeMarkup(a,e({node:i,row:l.top,col:l.left}),s[0]),r instanceof DT&&u.setSelection(new DT(u.doc.resolve(r.$anchorCell.pos),d?u.doc.resolve(d):void 0)),n(u)}return!0}}function eE(e,t){return function(n,r){if(!_T(n))return!1;let i=vT(n);if(i.nodeAfter.attrs[e]===t)return!1;if(r){let a=n.tr;n.selection instanceof DT?n.selection.forEachCell((n,r)=>{n.attrs[e]!==t&&a.setNodeMarkup(r,null,{...n.attrs,[e]:t})}):a.setNodeMarkup(i.pos,null,{...i.nodeAfter.attrs,[e]:t}),r(a)}return!0}}function tE(e){return function(t,n){if(!_T(t))return!1;if(n){let r=pT(t.schema),i=LT(t),a=t.tr,o=i.map.cellsInRect(e==`column`?{left:i.left,top:0,right:i.right,bottom:i.map.height}:e==`row`?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),s=o.map(e=>i.table.nodeAt(e));for(let e=0;e<o.length;e++)s[e].type==r.header_cell&&a.setNodeMarkup(i.tableStart+o[e],r.cell,s[e].attrs);if(a.steps.length===0)for(let e=0;e<o.length;e++)a.setNodeMarkup(i.tableStart+o[e],r.header_cell,s[e].attrs);n(a)}return!0}}function nE(e,t,n){let r=t.map.cellsInRect({left:0,top:0,right:e==`row`?t.map.width:1,bottom:e==`column`?t.map.height:1});for(let e=0;e<r.length;e++){let i=t.table.nodeAt(r[e]);if(i&&i.type!==n.header_cell)return!1}return!0}function rE(e,t){return t||={useDeprecatedLogic:!1},t.useDeprecatedLogic?tE(e):function(t,n){if(!_T(t))return!1;if(n){let r=pT(t.schema),i=LT(t),a=t.tr,o=nE(`row`,i,r),s=nE(`column`,i,r),c=(e===`column`?o:e===`row`&&s)?1:0,l=e==`column`?{left:0,top:c,right:1,bottom:i.map.height}:e==`row`?{left:c,top:0,right:i.map.width,bottom:1}:i,u=e==`column`?s?r.cell:r.header_cell:e==`row`?o?r.cell:r.header_cell:r.cell;i.map.cellsInRect(l).forEach(e=>{let t=e+i.tableStart,n=a.doc.nodeAt(t);n&&a.setNodeMarkup(t,u,n.attrs)}),n(a)}return!0}}rE(`row`,{useDeprecatedLogic:!0}),rE(`column`,{useDeprecatedLogic:!0});var iE=rE(`cell`,{useDeprecatedLogic:!0});function aE(e,t){if(t<0){let t=e.nodeBefore;if(t)return e.pos-t.nodeSize;for(let t=e.index(-1)-1,n=e.before();t>=0;t--){let r=e.node(-1).child(t),i=r.lastChild;if(i)return n-1-i.nodeSize;n-=r.nodeSize}}else{if(e.index()<e.parent.childCount-1)return e.pos+e.nodeAfter.nodeSize;let t=e.node(-1);for(let n=e.indexAfter(-1),r=e.after();n<t.childCount;n++){let e=t.child(n);if(e.childCount)return r+1;r+=e.nodeSize}}return null}function oE(e){return function(t,n){if(!_T(t))return!1;let r=aE(vT(t),e);if(r==null)return!1;if(n){let e=t.doc.resolve(r);n(t.tr.setSelection(At.between(e,xT(e))).scrollIntoView())}return!0}}function sE(e,t){let n=e.selection.$anchor;for(let r=n.depth;r>0;r--)if(n.node(r).type.spec.tableRole==`table`)return t&&t(e.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0;return!1}function cE(e,t){let n=e.selection;if(!(n instanceof DT))return!1;if(t){let r=e.tr,i=pT(e.schema).cell.createAndFill().content;n.forEachCell((e,t)=>{e.content.eq(i)||r.replace(r.mapping.map(t+1),r.mapping.map(t+e.nodeSize-1),new zt(i,0,0))}),r.docChanged&&t(r)}return!0}function lE(e){if(e.size===0)return null;let{content:t,openStart:n,openEnd:r}=e;for(;t.childCount==1&&(n>0&&r>0||t.child(0).type.spec.tableRole==`table`);)n--,r--,t=t.child(0).content;let i=t.child(0),a=i.type.spec.tableRole,o=i.type.schema,s=[];if(a==`row`)for(let e=0;e<t.childCount;e++){let i=t.child(e).content,a=e?0:Math.max(0,n-1),c=e<t.childCount-1?0:Math.max(0,r-1);(a||c)&&(i=dE(pT(o).row,new zt(i,a,c)).content),s.push(i)}else if(a==`cell`||a==`header_cell`)s.push(n||r?dE(pT(o).row,new zt(t,n,r)).content:t);else return null;return uE(o,s)}function uE(e,t){let n=[];for(let e=0;e<t.length;e++){let r=t[e];for(let t=r.childCount-1;t>=0;t--){let{rowspan:i,colspan:a}=r.child(t).attrs;for(let t=e;t<e+i;t++)n[t]=(n[t]||0)+a}}let r=0;for(let e=0;e<n.length;e++)r=Math.max(r,n[e]);for(let i=0;i<n.length;i++)if(i>=t.length&&t.push(Nt.empty),n[i]<r){let a=pT(e).cell.createAndFill(),o=[];for(let e=n[i];e<r;e++)o.push(a);t[i]=t[i].append(Nt.from(o))}return{height:t.length,width:r,rows:t}}function dE(e,t){let n=e.createAndFill();return new vt(n).replace(0,n.content.size,t).doc}function fE({width:e,height:t,rows:n},r,i){if(e!=r){let t=[],i=[];for(let e=0;e<n.length;e++){let a=n[e],o=[];for(let n=t[e]||0,i=0;n<r;i++){let s=a.child(i%a.childCount);n+s.attrs.colspan>r&&(s=s.type.createChecked(wT(s.attrs,s.attrs.colspan,n+s.attrs.colspan-r),s.content)),o.push(s),n+=s.attrs.colspan;for(let n=1;n<s.attrs.rowspan;n++)t[e+n]=(t[e+n]||0)+s.attrs.colspan}i.push(Nt.from(o))}n=i,e=r}if(t!=i){let e=[];for(let r=0,a=0;r<i;r++,a++){let o=[],s=n[a%t];for(let e=0;e<s.childCount;e++){let t=s.child(e);r+t.attrs.rowspan>i&&(t=t.type.create({...t.attrs,rowspan:Math.max(1,i-t.attrs.rowspan)},t.content)),o.push(t)}e.push(Nt.from(o))}n=e,t=i}return{width:e,height:t,rows:n}}function pE(e,t,n,r,i,a,o){let s=e.doc.type.schema,c=pT(s),l,u;if(i>t.width)for(let a=0,s=0;a<t.height;a++){let d=n.child(a);s+=d.nodeSize;let f=[],p;p=d.lastChild==null||d.lastChild.type==c.cell?l||=c.cell.createAndFill():u||=c.header_cell.createAndFill();for(let e=t.width;e<i;e++)f.push(p);e.insert(e.mapping.slice(o).map(s-1+r),f)}if(a>t.height){let s=[];for(let e=0,r=(t.height-1)*t.width;e<Math.max(t.width,i);e++){let i=e>=t.width?!1:n.nodeAt(t.map[r+e]).type==c.header_cell;s.push(i?u||=c.header_cell.createAndFill():l||=c.cell.createAndFill())}let d=c.row.create(null,Nt.from(s)),f=[];for(let e=t.height;e<a;e++)f.push(d);e.insert(e.mapping.slice(o).map(r+n.nodeSize-2),f)}return!!(l||u)}function mE(e,t,n,r,i,a,o,s){if(o==0||o==t.height)return!1;let c=!1;for(let l=i;l<a;l++){let i=o*t.width+l,a=t.map[i];if(t.map[i-t.width]==a){c=!0;let i=n.nodeAt(a),{top:u,left:d}=t.findCell(a);e.setNodeMarkup(e.mapping.slice(s).map(a+r),null,{...i.attrs,rowspan:o-u}),e.insert(e.mapping.slice(s).map(t.positionAt(o,d,n)),i.type.createAndFill({...i.attrs,rowspan:u+i.attrs.rowspan-o})),l+=i.attrs.colspan-1}}return c}function hE(e,t,n,r,i,a,o,s){if(o==0||o==t.width)return!1;let c=!1;for(let l=i;l<a;l++){let i=l*t.width+o,a=t.map[i];if(t.map[i-1]==a){c=!0;let i=n.nodeAt(a),u=t.colCount(a),d=e.mapping.slice(s).map(a+r);e.setNodeMarkup(d,null,wT(i.attrs,o-u,i.attrs.colspan-(o-u))),e.insert(d+i.nodeSize,i.type.createAndFill(wT(i.attrs,0,o-u))),l+=i.attrs.rowspan-1}}return c}function gE(e,t,n,r,i){let a=n?e.doc.nodeAt(n-1):e.doc;if(!a)throw Error(`No table found`);let o=cT.get(a),{top:s,left:c}=r,l=c+i.width,u=s+i.height,d=e.tr,f=0;function p(){if(a=n?d.doc.nodeAt(n-1):d.doc,!a)throw Error(`No table found`);o=cT.get(a),f=d.mapping.maps.length}pE(d,o,a,n,l,u,f)&&p(),mE(d,o,a,n,c,l,s,f)&&p(),mE(d,o,a,n,c,l,u,f)&&p(),hE(d,o,a,n,s,u,c,f)&&p(),hE(d,o,a,n,s,u,l,f)&&p();for(let e=s;e<u;e++){let t=o.positionAt(e,c,a),r=o.positionAt(e,l,a);d.replace(d.mapping.slice(f).map(t+n),d.mapping.slice(f).map(r+n),new zt(i.rows[e-s],0,0))}p(),d.setSelection(new DT(d.doc.resolve(n+o.positionAt(s,c,a)),d.doc.resolve(n+o.positionAt(u-1,l-1,a)))),t(d)}var _E=Se({ArrowLeft:yE(`horiz`,-1),ArrowRight:yE(`horiz`,1),ArrowUp:yE(`vert`,-1),ArrowDown:yE(`vert`,1),"Shift-ArrowLeft":bE(`horiz`,-1),"Shift-ArrowRight":bE(`horiz`,1),"Shift-ArrowUp":bE(`vert`,-1),"Shift-ArrowDown":bE(`vert`,1),Backspace:cE,"Mod-Backspace":cE,Delete:cE,"Mod-Delete":cE});function vE(e,t,n){return!n.eq(e.selection)&&(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function yE(e,t){return(n,r,i)=>{if(!i)return!1;let a=n.selection;if(a instanceof DT)return vE(n,r,st.near(a.$headCell,t));if(e!=`horiz`&&!a.empty)return!1;let o=wE(i,e,t);if(o==null)return!1;if(e==`horiz`)return vE(n,r,st.near(n.doc.resolve(a.head+t),t));{let i=n.doc.resolve(o),a=CT(i,e,t),s;return s=a?st.near(a,1):t<0?st.near(n.doc.resolve(i.before(-1)),-1):st.near(n.doc.resolve(i.after(-1)),1),vE(n,r,s)}}}function bE(e,t){return(n,r,i)=>{if(!i)return!1;let a=n.selection,o;if(a instanceof DT)o=a;else{let r=wE(i,e,t);if(r==null)return!1;o=new DT(n.doc.resolve(r))}let s=CT(o.$headCell,e,t);return s?vE(n,r,new DT(o.$anchorCell,s)):!1}}function xE(e,t){let n=e.state.doc,r=hT(n.resolve(t));return r?(e.dispatch(e.state.tr.setSelection(new DT(r))),!0):!1}function SE(e,t,n){if(!_T(e.state))return!1;let r=lE(n),i=e.state.selection;if(i instanceof DT){r||={width:1,height:1,rows:[Nt.from(dE(pT(e.state.schema).cell,n))]};let t=i.$anchorCell.node(-1),a=i.$anchorCell.start(-1),o=cT.get(t).rectBetween(i.$anchorCell.pos-a,i.$headCell.pos-a);return r=fE(r,o.right-o.left,o.bottom-o.top),gE(e.state,e.dispatch,a,o,r),!0}if(r){let t=vT(e.state),n=t.start(-1);return gE(e.state,e.dispatch,n,cT.get(t.node(-1)).findCell(t.pos-n),r),!0}return!1}function CE(e,t){if(t.button!=0||t.ctrlKey||t.metaKey)return;let n=TE(e,t.target),r;if(t.shiftKey&&e.state.selection instanceof DT)i(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&n&&(r=hT(e.state.selection.$anchor))!=null&&EE(e,t)?.pos!=r.pos)i(r,t),t.preventDefault();else if(!n)return;function i(t,n){let r=EE(e,n),i=mT.getState(e.state)==null;if(!r||!ST(t,r))if(i)r=t;else return;let a=new DT(t,r);if(i||!e.state.selection.eq(a)){let n=e.state.tr.setSelection(a);i&&n.setMeta(mT,t.pos),e.dispatch(n)}}function a(){e.root.removeEventListener(`mouseup`,a),e.root.removeEventListener(`dragstart`,a),e.root.removeEventListener(`mousemove`,o),mT.getState(e.state)!=null&&e.dispatch(e.state.tr.setMeta(mT,-1))}function o(r){let o=r,s=mT.getState(e.state),c;if(s!=null)c=e.state.doc.resolve(s);else if(TE(e,o.target)!=n&&(c=EE(e,t),!c))return a();c&&i(c,o)}e.root.addEventListener(`mouseup`,a),e.root.addEventListener(`dragstart`,a),e.root.addEventListener(`mousemove`,o)}function wE(e,t,n){if(!(e.state.selection instanceof At))return null;let{$head:r}=e.state.selection;for(let i=r.depth-1;i>=0;i--){let a=r.node(i);if((n<0?r.index(i):r.indexAfter(i))!=(n<0?0:a.childCount))return null;if(a.type.spec.tableRole==`cell`||a.type.spec.tableRole==`header_cell`){let a=r.before(i),o=t==`vert`?n>0?`down`:`up`:n>0?`right`:`left`;return e.endOfTextblock(o)?a:null}}return null}function TE(e,t){for(;t&&t!=e.dom;t=t.parentNode)if(t.nodeName==`TD`||t.nodeName==`TH`)return t;return null}function EE(e,t){let n=e.posAtCoords({left:t.clientX,top:t.clientY});if(!n)return null;let{inside:r,pos:i}=n;return r>=0&&hT(e.state.doc.resolve(r))||hT(e.state.doc.resolve(i))}var DE=class{constructor(e,t){this.node=e,this.defaultCellMinWidth=t,this.dom=document.createElement(`div`),this.dom.className=`tableWrapper`,this.table=this.dom.appendChild(document.createElement(`table`)),this.table.style.setProperty(`--default-cell-min-width`,`${t}px`),this.colgroup=this.table.appendChild(document.createElement(`colgroup`)),OE(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement(`tbody`))}update(e){return e.type==this.node.type&&(this.node=e,OE(e,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(e){return e.type==`attributes`&&(e.target==this.table||this.colgroup.contains(e.target))}};function OE(e,t,n,r,i,a){let o=0,s=!0,c=t.firstChild,l=e.firstChild;if(l){for(let e=0,n=0;e<l.childCount;e++){let{colspan:u,colwidth:d}=l.child(e).attrs;for(let e=0;e<u;e++,n++){let l=i==n?a:d&&d[e],u=l?l+`px`:``;if(o+=l||r,l||(s=!1),c)c.style.width!=u&&(c.style.width=u),c=c.nextSibling;else{let e=document.createElement(`col`);e.style.width=u,t.appendChild(e)}}}for(;c;){var u;let e=c.nextSibling;(u=c.parentNode)==null||u.removeChild(c),c=e}s?(n.style.width=o+`px`,n.style.minWidth=``):(n.style.width=``,n.style.minWidth=o+`px`)}}var kE=new ce(`tableColumnResizing`);function AE({handleWidth:e=5,cellMinWidth:t=25,defaultCellMinWidth:n=100,View:r=DE,lastColumnResizable:i=!0}={}){let a=new Ae({key:kE,state:{init(e,t){var i;let o=(i=a.spec)==null||(i=i.props)==null?void 0:i.nodeViews,s=pT(t.schema).table.name;return r&&o&&(o[s]=(e,t)=>new r(e,n,t)),new jE(-1,!1)},apply(e,t){return t.apply(e)}},props:{attributes:e=>{let t=kE.getState(e);return t&&t.activeHandle>-1?{class:`resize-cursor`}:{}},handleDOMEvents:{mousemove:(t,n)=>{ME(t,n,e,i)},mouseleave:e=>{NE(e)},mousedown:(e,r)=>{PE(e,r,t,n)}},decorations:e=>{let t=kE.getState(e);if(t&&t.activeHandle>-1)return UE(e,t.activeHandle)},nodeViews:{}}});return a}var jE=class e{constructor(e,t){this.activeHandle=e,this.dragging=t}apply(t){let n=this,r=t.getMeta(kE);if(r&&r.setHandle!=null)return new e(r.setHandle,!1);if(r&&r.setDragging!==void 0)return new e(n.activeHandle,r.setDragging);if(n.activeHandle>-1&&t.docChanged){let r=t.mapping.map(n.activeHandle,-1);return bT(t.doc.resolve(r))||(r=-1),new e(r,n.dragging)}return n}};function ME(e,t,n,r){if(!e.editable)return;let i=kE.getState(e.state);if(i&&!i.dragging){let a=IE(t.target),o=-1;if(a){let{left:r,right:i}=a.getBoundingClientRect();t.clientX-r<=n?o=LE(e,t,`left`,n):i-t.clientX<=n&&(o=LE(e,t,`right`,n))}if(o!=i.activeHandle){if(!r&&o!==-1){let t=e.state.doc.resolve(o),n=t.node(-1),r=cT.get(n),i=t.start(-1);if(r.colCount(t.pos-i)+t.nodeAfter.attrs.colspan-1==r.width-1)return}zE(e,o)}}}function NE(e){if(!e.editable)return;let t=kE.getState(e.state);t&&t.activeHandle>-1&&!t.dragging&&zE(e,-1)}function PE(e,t,n,r){if(!e.editable)return!1;let i=e.dom.ownerDocument.defaultView??window,a=kE.getState(e.state);if(!a||a.activeHandle==-1||a.dragging)return!1;let o=e.state.doc.nodeAt(a.activeHandle),s=FE(e,a.activeHandle,o.attrs);e.dispatch(e.state.tr.setMeta(kE,{setDragging:{startX:t.clientX,startWidth:s}}));function c(t){i.removeEventListener(`mouseup`,c),i.removeEventListener(`mousemove`,l);let r=kE.getState(e.state);r?.dragging&&(BE(e,r.activeHandle,RE(r.dragging,t,n)),e.dispatch(e.state.tr.setMeta(kE,{setDragging:null})))}function l(t){if(!t.which)return c(t);let i=kE.getState(e.state);if(i&&i.dragging){let a=RE(i.dragging,t,n);VE(e,i.activeHandle,a,r)}}return VE(e,a.activeHandle,s,r),i.addEventListener(`mouseup`,c),i.addEventListener(`mousemove`,l),t.preventDefault(),!0}function FE(e,t,{colspan:n,colwidth:r}){let i=r&&r[r.length-1];if(i)return i;let a=e.domAtPos(t),o=a.node.childNodes[a.offset].offsetWidth,s=n;if(r)for(let e=0;e<n;e++)r[e]&&(o-=r[e],s--);return o/s}function IE(e){for(;e&&e.nodeName!=`TD`&&e.nodeName!=`TH`;)e=e.classList&&e.classList.contains(`ProseMirror`)?null:e.parentNode;return e}function LE(e,t,n,r){let i=n==`right`?-r:r,a=e.posAtCoords({left:t.clientX+i,top:t.clientY});if(!a)return-1;let{pos:o}=a,s=hT(e.state.doc.resolve(o));if(!s)return-1;if(n==`right`)return s.pos;let c=cT.get(s.node(-1)),l=s.start(-1),u=c.map.indexOf(s.pos-l);return u%c.width==0?-1:l+c.map[u-1]}function RE(e,t,n){let r=t.clientX-e.startX;return Math.max(n,e.startWidth+r)}function zE(e,t){e.dispatch(e.state.tr.setMeta(kE,{setHandle:t}))}function BE(e,t,n){let r=e.state.doc.resolve(t),i=r.node(-1),a=cT.get(i),o=r.start(-1),s=a.colCount(r.pos-o)+r.nodeAfter.attrs.colspan-1,c=e.state.tr;for(let e=0;e<a.height;e++){let t=e*a.width+s;if(e&&a.map[t]==a.map[t-a.width])continue;let r=a.map[t],l=i.nodeAt(r).attrs,u=l.colspan==1?0:s-a.colCount(r);if(l.colwidth&&l.colwidth[u]==n)continue;let d=l.colwidth?l.colwidth.slice():HE(l.colspan);d[u]=n,c.setNodeMarkup(o+r,null,{...l,colwidth:d})}c.docChanged&&e.dispatch(c)}function VE(e,t,n,r){let i=e.state.doc.resolve(t),a=i.node(-1),o=i.start(-1),s=cT.get(a).colCount(i.pos-o)+i.nodeAfter.attrs.colspan-1,c=e.domAtPos(i.start(-1)).node;for(;c&&c.nodeName!=`TABLE`;)c=c.parentNode;c&&OE(a,c.firstChild,c,r,s,n)}function HE(e){return Array(e).fill(0)}function UE(e,t){let n=[],r=e.doc.resolve(t),i=r.node(-1);if(!i)return He.empty;let a=cT.get(i),o=r.start(-1),s=a.colCount(r.pos-o)+r.nodeAfter.attrs.colspan-1;for(let t=0;t<a.height;t++){let r=s+t*a.width;if((s==a.width-1||a.map[r]!=a.map[r+1])&&(t==0||a.map[r]!=a.map[r-a.width])){let t=a.map[r],s=o+t+i.nodeAt(t).nodeSize-1,c=document.createElement(`div`);c.className=`column-resize-handle`,kE.getState(e)?.dragging&&n.push(We.node(o+t,o+t+i.nodeAt(t).nodeSize,{class:`column-resize-dragging`})),n.push(We.widget(s,c))}}return He.create(e.doc,n)}function WE({allowTableNodeSelection:e=!1}={}){return new Ae({key:mT,state:{init(){return null},apply(e,t){let n=e.getMeta(mT);if(n!=null)return n==-1?null:n;if(t==null||!e.docChanged)return t;let{deleted:r,pos:i}=e.mapping.mapResult(t);return r?null:i}},props:{decorations:kT,handleDOMEvents:{mousedown:CE},createSelectionBetween(e){return mT.getState(e.state)==null?null:e.state.selection},handleTripleClick:xE,handleKeyDown:_E,handlePaste:SE},appendTransaction(t,n,r){return MT(r,FT(r,n),e)}})}function GE(e){return e===`left`||e===`right`||e===`center`?e:null}function KE(e){let t=(e.style.textAlign||``).trim().toLowerCase(),n=(e.getAttribute(`align`)||``).trim().toLowerCase();return GE(t||n)}function qE(e){return GE(e?.align)}function JE(){return{default:null,parseHTML:e=>KE(e),renderHTML:e=>e.align?{style:`text-align: ${e.align}`}:{}}}function YE(e){let t=e.parentElement,n=e.closest(`table`);if(!t||!n)return null;let r=Array.from(t.children).indexOf(e),i=n.querySelectorAll(`colgroup > col`)[r]?.getAttribute(`width`);return i?[parseInt(i,10)]:null}function XE(e){let t=e.getAttribute(`colwidth`);return t?t.split(`,`).map(e=>parseInt(e,10)):YE(e)}var ZE=/[ \t\r\n\f]+/g;function QE(e){return e.children.length>0?!1:(e.textContent??``).replace(ZE,``)===``}function $E(e){let t=e.createAndFill();if(!t)throw Error(`[tiptap error]: "${e.name}" has no default content to backfill.`);return t.content}var eD=Ct.create({name:`tableCell`,addOptions(){return{HTMLAttributes:{}}},content:`block+`,addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:XE},align:JE()}},tableRole:`cell`,isolating:!0,parseHTML(){return[{tag:`td`,getAttrs:e=>QE(e)?{}:!1,getContent:(e,t)=>$E(t.nodes[this.name])},{tag:`td`}]},renderHTML({HTMLAttributes:e}){return[`td`,Re(this.options.HTMLAttributes,e),0]}}),tD=Ct.create({name:`tableHeader`,addOptions(){return{HTMLAttributes:{}}},content:`block+`,addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:XE},align:JE()}},tableRole:`header_cell`,isolating:!0,parseHTML(){return[{tag:`th`,getAttrs:e=>QE(e)?{}:!1,getContent:(e,t)=>$E(t.nodes[this.name])},{tag:`th`}]},renderHTML({HTMLAttributes:e}){return[`th`,Re(this.options.HTMLAttributes,e),0]}}),nD=Ct.create({name:`tableRow`,addOptions(){return{HTMLAttributes:{}}},content:`(tableCell | tableHeader)*`,tableRole:`row`,parseHTML(){return[{tag:`tr`}]},renderHTML({HTMLAttributes:e}){return[`tr`,Re(this.options.HTMLAttributes,e),0]}});function rD(e,t){return t?[`width`,`${Math.max(t,e)}px`]:[`min-width`,`${e}px`]}function iD(e,t,n,r,i,a){var o;let s=0,c=!0,l=t.firstChild,u=e.firstChild;if(u!==null)for(let e=0,n=0;e<u.childCount;e+=1){let{colspan:o,colwidth:d}=u.child(e).attrs;for(let e=0;e<o;e+=1,n+=1){let o=i===n?a:d&&d[e],u=o?`${o}px`:``;if(s+=o||r,o||(c=!1),l){if(l.style.width!==u){let[e,t]=rD(r,o);l.style.setProperty(e,t)}l=l.nextSibling}else{let e=document.createElement(`col`),[n,i]=rD(r,o);e.style.setProperty(n,i),t.appendChild(e)}}}for(;l;){let e=l.nextSibling;(o=l.parentNode)==null||o.removeChild(l),l=e}let d=e.attrs.style&&typeof e.attrs.style==`string`&&/\bwidth\s*:/i.test(e.attrs.style);c&&!d?(n.style.width=`${s}px`,n.style.minWidth=``):(n.style.width=``,n.style.minWidth=`${s}px`)}var aD=class{constructor(e,t,n,r={}){this.node=e,this.cellMinWidth=t,this.dom=document.createElement(`div`),this.dom.className=`tableWrapper`,this.table=this.dom.appendChild(document.createElement(`table`));for(let[e,t]of Object.entries(r))t!=null&&(e===`style`?this.table.style.cssText=String(t):this.table.setAttribute(e,String(t)));e.attrs.style&&(this.table.style.cssText=e.attrs.style),this.colgroup=this.table.appendChild(document.createElement(`colgroup`)),iD(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement(`tbody`))}update(e){return e.type===this.node.type&&(this.node=e,iD(e,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(e){let t=e.target,n=this.dom.contains(t),r=this.contentDOM.contains(t);return!!(n&&!r&&(e.type===`attributes`||e.type===`childList`||e.type===`characterData`))}};function oD(e,t,n,r){let i=0,a=!0,o=[],s=e.firstChild;if(!s)return{};for(let e=0,c=0;e<s.childCount;e+=1){let{colspan:l,colwidth:u}=s.child(e).attrs;for(let e=0;e<l;e+=1,c+=1){let s=n===c?r:u&&u[e];i+=s||t,s||(a=!1);let[l,d]=rD(t,s);o.push([`col`,{style:`${l}: ${d}`}])}}let c=a?`${i}px`:``,l=a?``:`${i}px`;return{colgroup:[`colgroup`,{},...o],tableWidth:c,tableMinWidth:l}}function sD(e,t){return t?e.createChecked(null,t):e.createAndFill()}function cD(e){if(e.cached.tableNodeTypes)return e.cached.tableNodeTypes;let t={};return Object.keys(e.nodes).forEach(n=>{let r=e.nodes[n];r.spec.tableRole&&(t[r.spec.tableRole]=r)}),e.cached.tableNodeTypes=t,t}function lD(e,t,n,r,i){let a=cD(e),o=[],s=[];for(let e=0;e<n;e+=1){let e=sD(a.cell,i);if(e&&s.push(e),r){let e=sD(a.header_cell,i);e&&o.push(e)}}let c=[];for(let e=0;e<t;e+=1)c.push(a.row.createChecked(null,r&&e===0?o:s));return a.table.createChecked(null,c)}function uD(e){return e instanceof DT}var dD=({editor:e})=>{let{selection:t}=e.state;if(!uD(t))return!1;let n=0;return Qe(t.ranges[0].$from,e=>e.type.name===`table`)?.node.descendants(e=>{if(e.type.name===`table`)return!1;[`tableCell`,`tableHeader`].includes(e.type.name)&&(n+=1)}),n===t.ranges.length&&(e.commands.deleteTable(),!0)};function fD(e,t){let n=e.mapping.map(t);if(Qe(e.selection.$from,e=>e.type.name===`table`)?.pos===n)return;let r=e.doc.nodeAt(n);if(!r)return;let i=n+r.nodeSize-1;e.setSelection(At.near(e.doc.resolve(i),-1))}function pD(e){let t=``,n=0;for(;n<e.length;){if(e[n]===`\\`&&n+1<e.length){t+=e[n]+e[n+1],n+=2;continue}if(e[n]!=="`"){t+=e[n++];continue}let r=0;for(;n+r<e.length&&e[n+r]==="`";)r+=1;let i=n+r,a=!1;for(;i<e.length;){if(e[i]!=="`"){i+=1;continue}let o=0;for(;i+o<e.length&&e[i+o]==="`";)o+=1;if(o===r){let o=e.slice(n+r,i);t+=e.slice(n,n+r)+o.replace(/(?<!\\)\|/g,`\\|`)+e.slice(i,i+r),n=i+r,a=!0;break}i+=o}a||(t+=e.slice(n,n+r),n+=r)}return t}function mD(e){return e.split(`
119
- `).map(e=>!e.includes(`|`)||!e.includes("`")?e:pD(e)).join(`
120
- `)}function hD(e){return(e||``).replace(/\s+/g,` `).trim()}function gD(e,t,n={}){let r=n.cellLineSeparator??``;if(!e||!e.content||e.content.length===0)return``;let i=[];e.content.forEach(e=>{let n=[];e.content&&e.content.forEach(e=>{let i=``;i=e.content&&Array.isArray(e.content)&&e.content.length>1?e.content.map(e=>t.renderChildren(e)).join(r):e.content?t.renderChildren(e.content):``;let a=hD(i.split(r).join(`
121
- `).replace(/[ \t]*\r?\n[ \t]*/g,`<br>`)),o=e.type===`tableHeader`,s=qE(e.attrs);n.push({text:a,isHeader:o,align:s})}),i.push(n)});let a=i.reduce((e,t)=>Math.max(e,t.length),0);if(a===0)return``;let o=Array.from({length:a}).fill(0);i.forEach(e=>{for(let t=0;t<a;t+=1){let n=(e[t]?.text||``).length;n>o[t]&&(o[t]=n),o[t]<3&&(o[t]=3)}});let s=(e,t)=>e+` `.repeat(Math.max(0,t-e.length)),c=i[0],l=c.some(e=>e.isHeader),u=Array.from({length:a}).fill(null);i.forEach(e=>{for(let t=0;t<a;t+=1)!u[t]&&e[t]?.align&&(u[t]=e[t].align)});let d=`
122
- `,f=Array.from({length:a}).map((e,t)=>l&&c[t]&&c[t].text||``);return d+=`| ${f.map((e,t)=>s(e,o[t])).join(` | `)} |
123
- `,d+=`| ${o.map((e,t)=>{let n=Math.max(3,e),r=u[t];return r===`left`?`:${`-`.repeat(n)}`:r===`right`?`${`-`.repeat(n)}:`:r===`center`?`:${`-`.repeat(n)}:`:`-`.repeat(n)}).join(` | `)} |
124
- `,(l?i.slice(1):i).forEach(e=>{d+=`| ${Array.from({length:a}).fill(0).map((t,n)=>s(e[n]&&e[n].text||``,o[n])).join(` | `)} |
125
- `}),d}var _D=gD,vD=Ct.create({name:`table`,addOptions(){return{HTMLAttributes:{},resizable:!1,renderWrapper:!1,handleWidth:5,cellMinWidth:25,View:aD,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:`tableRow+`,tableRole:`table`,isolating:!0,group:`block`,parseHTML(){return[{tag:`table`}]},renderHTML({node:e,HTMLAttributes:t}){let{colgroup:n,tableWidth:r,tableMinWidth:i}=oD(e,this.options.cellMinWidth),a=t.style;function o(){return a||(r?`width: ${r}`:`min-width: ${i}`)}let s=[`table`,Re(this.options.HTMLAttributes,t,{style:o()}),n,[`tbody`,0]];return this.options.renderWrapper?[`div`,{class:`tableWrapper`},s]:s},parseMarkdown:(e,t)=>{let n=[],r=Array.isArray(e.align)?e.align:[];if(e.header){let i=[];e.header.forEach((e,n)=>{let a=GE(r[n]??e.align),o=a?{align:a}:{};i.push(t.createNode(`tableHeader`,o,[{type:`paragraph`,content:t.parseInline(e.tokens)}]))}),n.push(t.createNode(`tableRow`,{},i))}return e.rows&&e.rows.forEach(e=>{let i=[];e.forEach((e,n)=>{let a=GE(r[n]??e.align),o=a?{align:a}:{};i.push(t.createNode(`tableCell`,o,[{type:`paragraph`,content:t.parseInline(e.tokens)}]))}),n.push(t.createNode(`tableRow`,{},i))}),t.createNode(`table`,void 0,n)},renderMarkdown:(e,t)=>_D(e,t),markdownTokenizer:{name:`table`,level:`block`,start:e=>{let t=e.split(`
126
- `);if(t.length<2)return-1;let n=t[1];return!/^[ \t|:]*-[ \t|:-]*$/.test(n)||!n.includes(`|`)?-1:t[0].includes(`|`)?0:-1},tokenize(e,t,n){let r=e.indexOf(`
127
-
128
- `),i=r>=0?e.slice(0,r):e,a=i.split(`
129
- `);if(a.length<2)return;let o=a[1];if(!/^[ \t|:]*-[ \t|:-]*$/.test(o)||!o.includes(`|`))return;let s=mD(i);if(s===i)return;let c=n.blockTokens(s)[0];if(c?.type!==`table`||!c.raw)return;let l=c.raw.split(`
130
- `).length,u=e.split(`
131
- `).slice(0,l).join(`
132
- `);return{...c,raw:u}}},addCommands(){return{insertTable:({rows:e=3,cols:t=3,withHeaderRow:n=!0}={})=>({tr:r,dispatch:i,editor:a})=>{let o=lD(a.schema,e,t,n);if(i){let e=r.selection.from+1;r.replaceSelectionWith(o).scrollIntoView().setSelection(At.near(r.doc.resolve(e)))}return!0},addColumnBefore:()=>({state:e,dispatch:t})=>zT(e,t),addColumnAfter:()=>({state:e,dispatch:t})=>BT(e,t),deleteColumn:()=>({state:e,dispatch:t})=>{let n=Qe(e.selection.$from,e=>e.type.name===`table`);return HT(e,t&&(e=>{n&&fD(e,n.pos),t(e)}))},addRowBefore:()=>({state:e,dispatch:t})=>GT(e,t),addRowAfter:()=>({state:e,dispatch:t})=>KT(e,t),deleteRow:()=>({state:e,dispatch:t})=>{let n=Qe(e.selection.$from,e=>e.type.name===`table`);return JT(e,t&&(e=>{n&&fD(e,n.pos),t(e)}))},deleteTable:()=>({state:e,dispatch:t})=>sE(e,t),mergeCells:()=>({state:e,dispatch:t})=>ZT(e,t),splitCell:()=>({state:e,dispatch:t})=>QT(e,t),toggleHeaderColumn:()=>({state:e,dispatch:t})=>rE(`column`)(e,t),toggleHeaderRow:()=>({state:e,dispatch:t})=>rE(`row`)(e,t),toggleHeaderCell:()=>({state:e,dispatch:t})=>iE(e,t),mergeOrSplit:()=>({state:e,dispatch:t})=>ZT(e,t)?!0:QT(e,t),setCellAttribute:(e,t)=>({state:n,dispatch:r})=>eE(e,t)(n,r),goToNextCell:()=>({state:e,dispatch:t})=>oE(1)(e,t),goToPreviousCell:()=>({state:e,dispatch:t})=>oE(-1)(e,t),fixTables:()=>({state:e,dispatch:t})=>(t&&FT(e),!0),setCellSelection:e=>({tr:t,dispatch:n})=>{if(n){let n=DT.create(t.doc,e.anchorCell,e.headCell);t.setSelection(n)}return!0}}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.goToNextCell()?!0:this.editor.can().addRowAfter()?this.editor.chain().addRowAfter().goToNextCell().run():!1,"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:dD,"Mod-Backspace":dD,Delete:dD,"Mod-Delete":dD}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[AE({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],WE({allowTableNodeSelection:this.options.allowTableNodeSelection})]},addNodeView(){let e=this.options.resizable&&this.editor.isEditable,t=this.options.View;return e||!t?null:({node:e,view:n,HTMLAttributes:r})=>{let i=Re(this.options.HTMLAttributes,r);return new t(e,this.options.cellMinWidth,n,i)}},extendNodeSchema(e){let t={name:e.name,options:e.options,storage:e.storage};return{tableRole:rt(pe(e,`tableRole`,t))}}}),yD=jt.create({name:`tableKit`,addExtensions(){let e=[];return this.options.table!==!1&&e.push(vD.configure(this.options.table)),this.options.tableCell!==!1&&e.push(eD.configure(this.options.tableCell)),this.options.tableHeader!==!1&&e.push(tD.configure(this.options.tableHeader)),this.options.tableRow!==!1&&e.push(nD.configure(this.options.tableRow)),e}}),bD=jt.create({name:`textAlign`,addOptions(){return{types:[],alignments:[`left`,`center`,`right`,`justify`],defaultAlignment:null}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:e=>{let t=e.style.textAlign;return this.options.alignments.includes(t)?t:this.options.defaultAlignment},renderHTML:e=>e.textAlign?{style:`text-align: ${e.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:e=>({commands:t})=>this.options.alignments.includes(e)?this.options.types.map(n=>t.updateAttributes(n,{textAlign:e})).some(e=>e):!1,unsetTextAlign:()=>({commands:e})=>this.options.types.map(t=>e.resetAttributes(t,`textAlign`)).some(e=>e),toggleTextAlign:e=>({editor:t,commands:n})=>this.options.alignments.includes(e)?t.isActive({textAlign:e})?n.unsetTextAlign():n.setTextAlign(e):!1}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign(`left`),"Mod-Shift-e":()=>this.editor.commands.setTextAlign(`center`),"Mod-Shift-r":()=>this.editor.commands.setTextAlign(`right`),"Mod-Shift-j":()=>this.editor.commands.setTextAlign(`justify`)}}}),xD=[1,2,3,4,5,6],SD=[`left`,`center`,`right`,`justify`],CD={left:{icon:`align-left`,key:`align-left`,label:`Align left`},center:{icon:`align-center`,key:`align-center`,label:`Align center`},right:{icon:`align-right`,key:`align-right`,label:`Align right`},justify:{icon:`align-justify`,key:`justify`,label:`Justify`}},wD=[`😀`,`😅`,`😂`,`🥳`,`😎`,`🤔`,`👍`,`🙏`,`🔥`,`🎉`,`🚀`,`💡`,`✅`,`❌`,`⭐`,`❤️`];function TD(e){let t=(e??xD).filter(e=>e>=1&&e<=6);return t.length>0?t:xD}function ED({editor:e,levels:t}){let{t:n}=N(`lattice`),r=n(`form.editor.heading`,`Heading`);return(0,K.jsxs)(Ot,{children:[(0,K.jsx)(Xe,{asChild:!0,children:(0,K.jsx)(zw,{active:e.isActive(`heading`),icon:`heading`,label:r,testId:`editor-heading`})}),(0,K.jsx)(ht,{className:`min-w-32`,children:t.map(t=>(0,K.jsx)(ft,{className:x(e.isActive(`heading`,{level:t})&&`bg-lt-accent text-lt-accent-fg`),"data-test":`editor-heading-${t}`,onClick:()=>e.chain().focus().toggleHeading({level:t}).run(),children:n(`form.editor.heading-${t}`,`Heading ${t}`)},t))})]})}function DD({editor:e}){let{t}=N(`lattice`),[n,r]=(0,z.useState)(!1),[i,a]=(0,z.useState)(``),o=()=>{i?e.chain().focus().extendMarkRange(`link`).setLink({href:i}).run():e.chain().focus().extendMarkRange(`link`).unsetLink().run(),r(!1)};return(0,K.jsxs)(Qt,{onOpenChange:t=>{t&&a(e.getAttributes(`link`).href??``),r(t)},open:n,children:[(0,K.jsx)(Fe,{asChild:!0,children:(0,K.jsx)(zw,{active:e.isActive(`link`),icon:`link`,label:t(`form.editor.link`,`Link`),testId:`editor-link`})}),(0,K.jsxs)(Yt,{className:`flex w-72 items-center gap-1 p-2`,children:[(0,K.jsx)(`input`,{"aria-label":t(`form.editor.link-url`,`Link URL`),className:`h-7 min-w-0 flex-1 rounded-lt-sm border border-lt-input bg-transparent px-2 text-sm outline-none focus:border-lt-ring`,"data-test":`editor-link-url`,onChange:e=>a(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),o())},placeholder:`https://`,type:`url`,value:i}),(0,K.jsx)(zw,{icon:`check`,label:t(`form.editor.link-apply`,`Apply link`),onClick:o,testId:`editor-link-apply`}),e.isActive(`link`)&&(0,K.jsx)(zw,{icon:`trash-2`,label:t(`form.editor.link-remove`,`Remove link`),onClick:()=>{e.chain().focus().extendMarkRange(`link`).unsetLink().run(),r(!1)},testId:`editor-link-remove`})]})]})}function OD({editor:e,emojis:t}){let{t:n}=N(`lattice`),[r,i]=(0,z.useState)(!1);return(0,K.jsxs)(Qt,{onOpenChange:i,open:r,children:[(0,K.jsx)(Fe,{asChild:!0,children:(0,K.jsx)(zw,{icon:`smile`,label:n(`form.editor.insert-emoji`,`Insert emoji`),testId:`editor-emoji`})}),(0,K.jsx)(Yt,{className:`grid grid-cols-8 gap-0.5 p-1`,children:t.map(t=>(0,K.jsx)(`button`,{className:`inline-flex size-7 items-center justify-center rounded-lt-sm text-base hover:bg-lt-accent`,onClick:()=>{e.chain().focus().insertContent(t).run(),i(!1)},onMouseDown:e=>e.preventDefault(),type:`button`,children:t},t))})]})}function kD(e,t,n,r){return{icon:t,key:e,label:n,isActive:e=>e.isActive(r),run:e=>e.chain().focus().toggleMark(r).run()}}var AD={bold:{group:`marks`,starterKit:()=>({bold:{}}),toolbar:()=>[kD(`bold`,`bold`,`Bold`,`bold`)]},italic:{group:`marks`,starterKit:()=>({italic:{}}),toolbar:()=>[kD(`italic`,`italic`,`Italic`,`italic`)]},strike:{group:`marks`,starterKit:()=>({strike:{}}),toolbar:()=>[kD(`strikethrough`,`strikethrough`,`Strikethrough`,`strike`)]},underline:{group:`marks`,starterKit:()=>({underline:{}}),toolbar:()=>[kD(`underline`,`underline`,`Underline`,`underline`)]},highlight:{group:`marks`,extensions:()=>[aT],toolbar:()=>[kD(`highlight`,`highlighter`,`Highlight`,`highlight`)]},code:{group:`marks`,starterKit:()=>({code:{}}),toolbar:()=>[kD(`code`,`code-xml`,`Code`,`code`)]},heading:{starterKit:e=>({heading:{levels:TD(e.levels)}}),toolbar:e=>{let t=TD(e.levels);return[{key:`heading`,component:({editor:e})=>(0,K.jsx)(ED,{editor:e,levels:t})}]},commands:e=>TD(e.levels).map(e=>({key:`heading-${e}`,icon:`heading-${e}`,label:`Heading ${e}`,keywords:[`h${e}`,`title`],run:t=>t.chain().focus().setHeading({level:e}).run()}))},"bullet-list":{group:`blocks`,starterKit:()=>({bulletList:{},listItem:{}}),toolbar:()=>[{icon:`list`,key:`bullet-list`,label:`Bullet list`,isActive:e=>e.isActive(`bulletList`),run:e=>e.chain().focus().toggleBulletList().run()}],commands:()=>[{icon:`list`,key:`bullet-list`,label:`Bullet list`,keywords:[`ul`,`unordered`],run:e=>e.chain().focus().toggleBulletList().run()}]},"ordered-list":{group:`blocks`,starterKit:()=>({orderedList:{},listItem:{}}),toolbar:()=>[{icon:`list-ordered`,key:`ordered-list`,label:`Ordered list`,isActive:e=>e.isActive(`orderedList`),run:e=>e.chain().focus().toggleOrderedList().run()}],commands:()=>[{icon:`list-ordered`,key:`ordered-list`,label:`Ordered list`,keywords:[`ol`,`numbered`],run:e=>e.chain().focus().toggleOrderedList().run()}]},blockquote:{group:`blocks`,starterKit:()=>({blockquote:{}}),toolbar:()=>[{icon:`quote`,key:`blockquote`,label:`Blockquote`,isActive:e=>e.isActive(`blockquote`),run:e=>e.chain().focus().toggleBlockquote().run()}],commands:()=>[{icon:`quote`,key:`blockquote`,label:`Blockquote`,keywords:[`quote`,`cite`],run:e=>e.chain().focus().toggleBlockquote().run()}]},"code-block":{group:`blocks`,starterKit:()=>({codeBlock:{}}),toolbar:()=>[{icon:`code`,key:`code-block`,label:`Code block`,isActive:e=>e.isActive(`codeBlock`),run:e=>e.chain().focus().toggleCodeBlock().run()}],commands:()=>[{icon:`code`,key:`code-block`,label:`Code block`,keywords:[`codeblock`,`pre`,`fence`],run:e=>e.chain().focus().toggleCodeBlock().run()}]},"horizontal-rule":{group:`blocks`,starterKit:()=>({horizontalRule:{}}),toolbar:()=>[{icon:`minus`,key:`horizontal-rule`,label:`Horizontal rule`,isActive:()=>!1,run:e=>e.chain().focus().setHorizontalRule().run()}],commands:()=>[{icon:`minus`,key:`horizontal-rule`,label:`Horizontal rule`,keywords:[`hr`,`divider`,`rule`],run:e=>e.chain().focus().setHorizontalRule().run()}]},"text-align":{extensions:e=>[bD.configure({alignments:e.alignments??SD,types:[`heading`,`paragraph`]})],toolbar:e=>(e.alignments??SD).filter(e=>e in CD).map(e=>({...CD[e],isActive:t=>t.isActive({textAlign:e}),run:t=>t.chain().focus().setTextAlign(e).run()}))},link:{starterKit:e=>({link:{openOnClick:e.openOnClick??!1,...e.protocols?{protocols:e.protocols}:{}}}),toolbar:()=>[{key:`link`,component:({editor:e})=>(0,K.jsx)(DD,{editor:e})}]},table:{group:`insert`,extensions:()=>[yD.configure({table:{resizable:!1}})],toolbar:e=>[{icon:`table`,key:`insert-table`,label:`Insert table`,isActive:e=>e.isActive(`table`),run:t=>t.chain().focus().insertTable({rows:e.rows??3,cols:e.cols??3,withHeaderRow:e.withHeaderRow??!0}).run()},{icon:`columns-3`,key:`add-column`,label:`Add column`,isActive:()=>!1,isDisabled:e=>!e.can().addColumnAfter(),run:e=>e.chain().focus().addColumnAfter().run()},{icon:`rows-3`,key:`add-row`,label:`Add row`,isActive:()=>!1,isDisabled:e=>!e.can().addRowAfter(),run:e=>e.chain().focus().addRowAfter().run()},{icon:`trash-2`,key:`delete-table`,label:`Delete table`,isActive:()=>!1,isDisabled:e=>!e.can().deleteTable(),run:e=>e.chain().focus().deleteTable().run()}],commands:e=>[{icon:`table`,key:`insert-table`,label:`Insert table`,keywords:[`table`,`grid`],isAvailable:e=>e.can().insertTable(),run:t=>t.chain().focus().insertTable({rows:e.rows??3,cols:e.cols??3,withHeaderRow:e.withHeaderRow??!0}).run()}]},details:{group:`insert`,extensions:()=>[eT,nT,tT],toolbar:()=>[{icon:`chevron-right`,key:`details`,label:`Details`,isActive:e=>e.isActive(`details`),run:e=>{if(e.isActive(`details`)){e.chain().focus().unsetDetails().run();return}e.chain().focus().setDetails().run()}}],commands:()=>[{icon:`chevron-right`,key:`details`,label:`Details`,keywords:[`toggle`,`collapse`,`accordion`],isAvailable:e=>e.can().setDetails(),run:e=>e.chain().focus().setDetails().run()}]},"slash-menu":{},emoji:{toolbar:e=>{let t=e.emojis??wD;return[{key:`insert-emoji`,component:({editor:e})=>(0,K.jsx)(OD,{editor:e,emojis:t})}]}}};function jD(e,t){let n=Math.min(e.top,t.top),r=Math.max(e.bottom,t.bottom),i=Math.min(e.left,t.left),a=Math.max(e.right,t.right)-i,o=r-n;return new DOMRect(i,n,a,o)}var MD=class{constructor({editor:e,element:t,view:n,pluginKey:r=`bubbleMenu`,updateDelay:i=250,resizeDelay:a=60,shouldShow:o,appendTo:s,getReferencedVirtualElement:c,options:l}){this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.floatingUIOptions={strategy:`absolute`,placement:`top`,offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1,onShow:void 0,onHide:void 0,onUpdate:void 0,onDestroy:void 0},this.shouldShow=({view:e,state:t,from:n,to:r})=>{let{doc:i,selection:a}=t,{empty:o}=a,s=!i.textBetween(n,r).length&&Me(t.selection),c=this.element.contains(document.activeElement);return!(!(e.hasFocus()||c)||o||s||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:e})=>{if(this.editor.isDestroyed){this.destroy();return}if(this.preventHide){this.preventHide=!1;return}e?.relatedTarget&&this.element.parentNode?.contains(e.relatedTarget)||e?.relatedTarget!==this.editor.view.dom&&this.hide()},this.handleDebouncedUpdate=(e,t)=>{let n=!t?.selection.eq(e.state.selection),r=!t?.doc.eq(e.state.doc);!n&&!r||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(e,n,r,t)},this.updateDelay))},this.updateHandler=(e,t,n,r)=>{let{composing:i}=e;if(!(i||!t&&!n)){if(!this.getShouldShow(r)){this.hide();return}this.show(),this.updatePosition()}},this.transactionHandler=({transaction:e})=>{let t=e.getMeta(this.pluginKey);t===`updatePosition`?this.updatePosition():t&&typeof t==`object`&&t.type===`updateOptions`?this.updateOptions(t.options):t===`hide`?this.hide():t===`show`&&(this.updatePosition(),this.show())},this.editor=e,this.element=t,this.view=n,this.pluginKey=r,this.updateDelay=i,this.resizeDelay=a,this.appendTo=s,this.scrollTarget=l?.scrollTarget??window,this.getReferencedVirtualElement=c,this.floatingUIOptions={...this.floatingUIOptions,...l},this.element.tabIndex=0,o&&(this.shouldShow=o),this.element.addEventListener(`mousedown`,this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener(`dragstart`,this.dragstartHandler),this.editor.on(`focus`,this.focusHandler),this.editor.on(`blur`,this.blurHandler),this.editor.on(`transaction`,this.transactionHandler),window.addEventListener(`resize`,this.resizeHandler),this.scrollTarget.addEventListener(`scroll`,this.resizeHandler),this.update(n,n.state),this.getShouldShow()&&(this.show(),this.updatePosition())}get middlewares(){let e=[];return this.floatingUIOptions.flip&&e.push(_(typeof this.floatingUIOptions.flip==`boolean`?void 0:this.floatingUIOptions.flip)),this.floatingUIOptions.shift&&e.push(A(typeof this.floatingUIOptions.shift==`boolean`?void 0:this.floatingUIOptions.shift)),this.floatingUIOptions.offset&&e.push(C(typeof this.floatingUIOptions.offset==`boolean`?void 0:this.floatingUIOptions.offset)),this.floatingUIOptions.arrow&&e.push(k(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&e.push(v(typeof this.floatingUIOptions.size==`boolean`?void 0:this.floatingUIOptions.size)),this.floatingUIOptions.autoPlacement&&e.push(T(typeof this.floatingUIOptions.autoPlacement==`boolean`?void 0:this.floatingUIOptions.autoPlacement)),this.floatingUIOptions.hide&&e.push(E(typeof this.floatingUIOptions.hide==`boolean`?void 0:this.floatingUIOptions.hide)),this.floatingUIOptions.inline&&e.push(ee(typeof this.floatingUIOptions.inline==`boolean`?void 0:this.floatingUIOptions.inline)),e}get virtualElement(){let{selection:e}=this.editor.state,t=this.getReferencedVirtualElement?.call(this);if(t)return t;if(!this.view?.dom?.parentNode)return;let n=Be(this.view,e.from,e.to),r={getBoundingClientRect:()=>n,getClientRects:()=>[n]};if(e instanceof Ke){let t=this.view.nodeDOM(e.from),n=t.dataset.nodeViewWrapper?t:t.querySelector(`[data-node-view-wrapper]`);n&&(t=n),t&&(r={getBoundingClientRect:()=>t.getBoundingClientRect(),getClientRects:()=>[t.getBoundingClientRect()]})}if(e instanceof DT){let{$anchorCell:t,$headCell:n}=e,i=t?t.pos:n.pos,a=n?n.pos:t.pos,o=this.view.nodeDOM(i),s=this.view.nodeDOM(a);if(!o||!s)return;let c=o===s?o.getBoundingClientRect():jD(o.getBoundingClientRect(),s.getBoundingClientRect());r={getBoundingClientRect:()=>c,getClientRects:()=>[c]}}return r}updatePosition(){if(!this.isVisible)return;let e=this.virtualElement;e&&S(e,this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:e,y:t,strategy:n,middlewareData:r})=>{if(!(!this.isVisible||this.editor.isDestroyed||!this.element.isConnected)){if(r.hide?.referenceHidden||r.hide?.escaped){this.element.style.visibility=`hidden`;return}this.element.style.visibility=`visible`,this.element.style.width=`max-content`,this.element.style.position=n,this.element.style.left=`${e}px`,this.element.style.top=`${t}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()}})}update(e,t){let{state:n}=e,r=n.selection.from!==n.selection.to;if(this.updateDelay>0&&r){this.handleDebouncedUpdate(e,t);return}let i=!t?.selection.eq(e.state.selection),a=!t?.doc.eq(e.state.doc);this.updateHandler(e,i,a,t)}getShouldShow(e){let{state:t}=this.view,{selection:n}=t,{ranges:r}=n,i=Math.min(...r.map(e=>e.$from.pos)),a=Math.max(...r.map(e=>e.$to.pos));return this.shouldShow?.call(this,{editor:this.editor,element:this.element,view:this.view,state:t,oldState:e,from:i,to:a})||!1}show(){var e;this.isVisible||(this.element.style.visibility=`visible`,this.element.style.opacity=`1`,(e=(typeof this.appendTo==`function`?this.appendTo():this.appendTo)??this.view.dom.parentElement)==null||e.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0)}hide(){this.isVisible&&=(this.element.style.visibility=`hidden`,this.element.style.opacity=`0`,this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),!1)}updateOptions(e){if(e.updateDelay!==void 0&&(this.updateDelay=e.updateDelay),e.resizeDelay!==void 0&&(this.resizeDelay=e.resizeDelay),e.appendTo!==void 0&&(this.appendTo=e.appendTo),e.getReferencedVirtualElement!==void 0&&(this.getReferencedVirtualElement=e.getReferencedVirtualElement),e.shouldShow!==void 0&&e.shouldShow&&(this.shouldShow=e.shouldShow),e.options!==void 0){let t=e.options.scrollTarget??window;t!==this.scrollTarget&&(this.scrollTarget.removeEventListener(`scroll`,this.resizeHandler),this.scrollTarget=t,this.scrollTarget.addEventListener(`scroll`,this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...e.options}}}destroy(){this.hide(),this.element.removeEventListener(`mousedown`,this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener(`dragstart`,this.dragstartHandler),window.removeEventListener(`resize`,this.resizeHandler),this.scrollTarget.removeEventListener(`scroll`,this.resizeHandler),this.editor.off(`focus`,this.focusHandler),this.editor.off(`blur`,this.blurHandler),this.editor.off(`transaction`,this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}},ND=e=>new Ae({key:typeof e.pluginKey==`string`?new ce(e.pluginKey):e.pluginKey,view:t=>new MD({view:t,...e})});jt.create({name:`bubbleMenu`,addOptions(){return{element:null,pluginKey:`bubbleMenu`,updateDelay:void 0,appendTo:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[ND({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,updateDelay:this.options.updateDelay,options:this.options.options,appendTo:this.options.appendTo,getReferencedVirtualElement:this.options.getReferencedVirtualElement,shouldShow:this.options.shouldShow})]:[]}});var PD=class{constructor({editor:e,element:t,view:n,pluginKey:r=`floatingMenu`,updateDelay:i=250,resizeDelay:a=60,options:o,appendTo:s,shouldShow:c}){this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.shouldShow=({view:e,state:t})=>{let{selection:n}=t,{$anchor:r,empty:i}=n,a=r.depth===1,o=r.parent.isTextblock&&!r.parent.type.spec.code&&!r.parent.textContent&&r.parent.childCount===0&&!this.getTextContent(r.parent);return!(!e.hasFocus()||!i||!a||!o||!this.editor.isEditable)},this.floatingUIOptions={strategy:`absolute`,placement:`right`,offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1},this.updateHandler=(e,t,n,r)=>{let{composing:i}=e;if(!(i||!t&&!n)){if(!this.getShouldShow(r)){this.hide();return}this.updatePosition(),this.show()}},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:e})=>{if(this.preventHide){this.preventHide=!1;return}e?.relatedTarget&&this.element.parentNode?.contains(e.relatedTarget)||e?.relatedTarget!==this.editor.view.dom&&this.hide()},this.transactionHandler=({transaction:e})=>{let t=e.getMeta(this.pluginKey);t===`updatePosition`?this.updatePosition():t&&typeof t==`object`&&t.type===`updateOptions`?this.updateOptions(t.options):t===`hide`?this.hide():t===`show`&&(this.updatePosition(),this.show())},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.editor=e,this.element=t,this.view=n,this.pluginKey=r,this.updateDelay=i,this.resizeDelay=a,this.appendTo=s,this.scrollTarget=o?.scrollTarget??window,this.floatingUIOptions={...this.floatingUIOptions,...o},this.element.tabIndex=0,c&&(this.shouldShow=c),this.element.addEventListener(`mousedown`,this.mousedownHandler,{capture:!0}),this.editor.on(`focus`,this.focusHandler),this.editor.on(`blur`,this.blurHandler),this.editor.on(`transaction`,this.transactionHandler),window.addEventListener(`resize`,this.resizeHandler),this.scrollTarget.addEventListener(`scroll`,this.resizeHandler),this.update(n,n.state),this.getShouldShow()&&(this.show(),this.updatePosition())}getTextContent(e){return le(e,{textSerializers:yt(this.editor.schema)})}get middlewares(){let e=[];return this.floatingUIOptions.flip&&e.push(_(typeof this.floatingUIOptions.flip==`boolean`?void 0:this.floatingUIOptions.flip)),this.floatingUIOptions.shift&&e.push(A(typeof this.floatingUIOptions.shift==`boolean`?void 0:this.floatingUIOptions.shift)),this.floatingUIOptions.offset&&e.push(C(typeof this.floatingUIOptions.offset==`boolean`?void 0:this.floatingUIOptions.offset)),this.floatingUIOptions.arrow&&e.push(k(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&e.push(v(typeof this.floatingUIOptions.size==`boolean`?void 0:this.floatingUIOptions.size)),this.floatingUIOptions.autoPlacement&&e.push(T(typeof this.floatingUIOptions.autoPlacement==`boolean`?void 0:this.floatingUIOptions.autoPlacement)),this.floatingUIOptions.hide&&e.push(E(typeof this.floatingUIOptions.hide==`boolean`?void 0:this.floatingUIOptions.hide)),this.floatingUIOptions.inline&&e.push(ee(typeof this.floatingUIOptions.inline==`boolean`?void 0:this.floatingUIOptions.inline)),e}getShouldShow(e){let{state:t}=this.view,{selection:n}=t,{ranges:r}=n,i=Math.min(...r.map(e=>e.$from.pos)),a=Math.max(...r.map(e=>e.$to.pos));return this.shouldShow?.call(this,{editor:this.editor,view:this.view,state:t,oldState:e,from:i,to:a})}updateOptions(e){if(e.updateDelay!==void 0&&(this.updateDelay=e.updateDelay),e.resizeDelay!==void 0&&(this.resizeDelay=e.resizeDelay),e.appendTo!==void 0&&(this.appendTo=e.appendTo),e.shouldShow!==void 0&&e.shouldShow&&(this.shouldShow=e.shouldShow),e.options!==void 0){let t=e.options.scrollTarget??window;t!==this.scrollTarget&&(this.scrollTarget.removeEventListener(`scroll`,this.resizeHandler),this.scrollTarget=t,this.scrollTarget.addEventListener(`scroll`,this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...e.options}}}updatePosition(){if(!this.view?.dom?.parentNode)return;let{selection:e}=this.editor.state,t=Be(this.view,e.from,e.to);S({getBoundingClientRect:()=>t,getClientRects:()=>[t]},this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:e,y:t,strategy:n,middlewareData:r})=>{if(r.hide?.referenceHidden||r.hide?.escaped){this.element.style.visibility=`hidden`;return}this.element.style.visibility=`visible`,this.element.style.width=`max-content`,this.element.style.position=n,this.element.style.left=`${e}px`,this.element.style.top=`${t}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()})}update(e,t){let n=!t?.selection.eq(e.state.selection),r=!t?.doc.eq(e.state.doc);this.updateHandler(e,n,r,t)}show(){var e;this.isVisible||(this.element.style.visibility=`visible`,this.element.style.opacity=`1`,(e=(typeof this.appendTo==`function`?this.appendTo():this.appendTo)??this.view.dom.parentElement)==null||e.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0)}hide(){this.isVisible&&=(this.element.style.visibility=`hidden`,this.element.style.opacity=`0`,this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),!1)}destroy(){this.hide(),this.element.removeEventListener(`mousedown`,this.mousedownHandler,{capture:!0}),window.removeEventListener(`resize`,this.resizeHandler),this.scrollTarget.removeEventListener(`scroll`,this.resizeHandler),this.editor.off(`focus`,this.focusHandler),this.editor.off(`blur`,this.blurHandler),this.editor.off(`transaction`,this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}},FD=e=>new Ae({key:typeof e.pluginKey==`string`?new ce(e.pluginKey):e.pluginKey,view:t=>new PD({view:t,...e})});jt.create({name:`floatingMenu`,addOptions(){return{element:null,options:{},pluginKey:`floatingMenu`,updateDelay:void 0,resizeDelay:void 0,appendTo:void 0,shouldShow:null}},addCommands(){return{updateFloatingMenuPosition:()=>({tr:e,dispatch:t})=>(t&&e.setMeta(this.options.pluginKey,`updatePosition`),!0)}},addProseMirrorPlugins(){return this.options.element?[FD({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,updateDelay:this.options.updateDelay,resizeDelay:this.options.resizeDelay,options:this.options.options,appendTo:this.options.appendTo,shouldShow:this.options.shouldShow})]:[]}});function ID(e,t){return e??new ce(t)}var LD=typeof window<`u`?z.useLayoutEffect:z.useEffect,RD=new Set([`left`,`opacity`,`position`,`top`,`visibility`,`width`]),zD=new Set(`animationIterationCount.aspectRatio.borderImageOutset.borderImageSlice.borderImageWidth.columnCount.columns.fillOpacity.flex.flexGrow.flexShrink.fontWeight.gridArea.gridColumn.gridColumnEnd.gridColumnStart.gridRow.gridRowEnd.gridRowStart.lineClamp.lineHeight.opacity.order.orphans.scale.stopOpacity.strokeDasharray.strokeDashoffset.strokeMiterlimit.strokeOpacity.strokeWidth.tabSize.widows.zIndex.zoom`.split(`.`)),BD=new Set([`children`,`className`,`style`]),VD=new Set([`tabIndex`]),HD=new Set([`accessKey`,`autoCapitalize`,`contentEditable`,`contextMenu`,`dir`,`draggable`,`enterKeyHint`,`hidden`,`id`,`lang`,`nonce`,`role`,`slot`,`spellCheck`,`tabIndex`,`title`,`translate`]),UD={Blur:`focusout`,DoubleClick:`dblclick`,Focus:`focusin`,MouseEnter:`mouseenter`,MouseLeave:`mouseleave`};function WD(e,t){return/^on[A-Z]/.test(e)&&typeof t==`function`}function GD(e){return e.startsWith(`aria-`)||e.startsWith(`data-`),e}function KD(e){return e.startsWith(`aria-`)||e.startsWith(`data-`)||HD.has(e)}function qD(e){return e.startsWith(`--`)?e:e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}function JD(e){let t=e.endsWith(`Capture`),n=(t?e.slice(0,-7):e).slice(2);return{eventName:UD[n]??n.toLowerCase(),options:t?{capture:!0}:void 0}}function YD(e,t){let n=t.defaultPrevented,r=!1,i=Object.create(t);return Object.defineProperties(i,{nativeEvent:{value:t},currentTarget:{value:e},target:{value:t.target},persist:{value:()=>void 0},isDefaultPrevented:{value:()=>n},isPropagationStopped:{value:()=>r},preventDefault:{value:()=>{n=!0,t.preventDefault()}},stopPropagation:{value:()=>{r=!0,t.stopPropagation()}}}),i}function XD(e){return VD.has(e)}function ZD(e,t,n){if(t===`tabIndex`){e.tabIndex=Number(n);return}e[t]=n}function QD(e,t){if(t===`tabIndex`){e.removeAttribute(`tabindex`);return}let n=e[t];if(typeof n==`boolean`){e[t]=!1;return}if(typeof n==`number`){e[t]=0;return}e[t]=``}function $D(e,t){return typeof t!=`number`||t===0||e.startsWith(`--`)||zD.has(e)?String(t):`${t}px`}function eO(e,t){RD.has(t)||e.style.removeProperty(qD(t))}function tO(e,t,n){RD.has(t)||e.style.setProperty(qD(t),$D(t,n))}function nO(e,t,n){new Set([...Object.keys(t),...Object.keys(n)]).forEach(r=>{if(BD.has(r)||!KD(r)||WD(r,t[r])||WD(r,n[r]))return;let i=t[r],a=n[r];if(i===a)return;let o=GD(r);if(a==null||a===!1){XD(r)&&QD(e,r),e.removeAttribute(o);return}if(a===!0){XD(r)&&ZD(e,r,!0),e.setAttribute(o,``);return}if(XD(r)){ZD(e,r,a);return}e.setAttribute(o,String(a))})}function rO(e,t,n){if(t!==n){if(n){e.className=n;return}e.removeAttribute(`class`)}}function iO(e,t,n){let r=t??{},i=n??{};new Set([...Object.keys(r),...Object.keys(i)]).forEach(t=>{let n=r[t],a=i[t];if(n!==a){if(a==null){eO(e,t);return}tO(e,t,a)}})}function aO(e,t,n){t.forEach(({eventName:t,listener:n,options:r})=>{e.removeEventListener(t,n,r)});let r=[];return Object.entries(n).forEach(([t,n])=>{if(!WD(t,n))return;let{eventName:i,options:a}=JD(t),o=t=>{n(YD(e,t))};e.addEventListener(i,o,a),r.push({eventName:i,listener:o,options:a})}),r}function oO(e,t){let n=(0,z.useRef)({}),r=(0,z.useRef)([]);LD(()=>{let i=n.current;return rO(e,i.className,t.className),iO(e,i.style,t.style),nO(e,i,t),r.current=aO(e,r.current,t),n.current=t,()=>{r.current.forEach(({eventName:t,listener:n,options:r})=>{e.removeEventListener(t,n,r)}),r.current=[]}},[e,t])}z.forwardRef(({pluginKey:e,editor:t,updateDelay:n,resizeDelay:r,appendTo:i,shouldShow:a=null,getReferencedVirtualElement:o,options:s,children:c,...l},u)=>{let d=(0,z.useRef)(document.createElement(`div`)),f=(0,z.useRef)(ID(e,`bubbleMenu`)).current;oO(d.current,l),typeof u==`function`?u(d.current):u&&(u.current=d.current);let{editor:p}=gt(),m=t||p,h={updateDelay:n,resizeDelay:r,appendTo:i,pluginKey:f,shouldShow:a,getReferencedVirtualElement:o,options:s},g=(0,z.useRef)(h);g.current=h;let[_,v]=(0,z.useState)(!1),y=(0,z.useRef)(!0);return(0,z.useEffect)(()=>{if(m?.isDestroyed)return;if(!m){console.warn(`BubbleMenu component is not rendered inside of an editor component or does not have editor prop.`);return}let e=d.current;e.style.visibility=`hidden`,e.style.position=`absolute`;let t=ND({...g.current,editor:m,element:e});m.registerPlugin(t);let n=g.current.pluginKey;return y.current=!0,v(!0),()=>{v(!1),m.unregisterPlugin(n),window.requestAnimationFrame(()=>{e.parentNode&&e.parentNode.removeChild(e)})}},[m]),(0,z.useEffect)(()=>{if(!(!_||!m||m.isDestroyed)){if(y.current){y.current=!1;return}m.view.dispatch(m.state.tr.setMeta(f,{type:`updateOptions`,options:g.current}))}},[_,m,n,r,a,s,i,o,f]),(0,ic.createPortal)(c,d.current)});var sO=z.forwardRef(({pluginKey:e,editor:t,updateDelay:n,resizeDelay:r,appendTo:i,shouldShow:a=null,options:o,children:s,...c},l)=>{let u=(0,z.useRef)(document.createElement(`div`)),d=(0,z.useRef)(ID(e,`floatingMenu`)).current;oO(u.current,c),typeof l==`function`?l(u.current):l&&(l.current=u.current);let{editor:f}=gt(),p=t||f,m={updateDelay:n,resizeDelay:r,appendTo:i,pluginKey:d,shouldShow:a,options:o},h=(0,z.useRef)(m);h.current=m;let[g,_]=(0,z.useState)(!1),v=(0,z.useRef)(!0);return(0,z.useEffect)(()=>{if(p?.isDestroyed)return;if(!p){console.warn(`FloatingMenu component is not rendered inside of an editor component or does not have editor prop.`);return}let e=u.current;e.style.visibility=`hidden`,e.style.position=`absolute`;let t=FD({...h.current,editor:p,element:e});p.registerPlugin(t);let n=h.current.pluginKey;return v.current=!0,_(!0),()=>{_(!1),p.unregisterPlugin(n),window.requestAnimationFrame(()=>{e.parentNode&&e.parentNode.removeChild(e)})}},[p]),(0,z.useEffect)(()=>{if(!(!g||!p||p.isDestroyed)){if(v.current){v.current=!1;return}p.view.dispatch(p.state.tr.setMeta(d,{type:`updateOptions`,options:h.current}))}},[g,p,n,r,a,o,i,d]),(0,ic.createPortal)(s,u.current)});function cO(e){let{char:t,allowSpaces:n,allowToIncludeChar:r,allowedPrefixes:i,startOfLine:a,$position:o}=e,s=n&&!r,c=ut(t),l=RegExp(`\\s${c}$`),u=a?`^`:``,d=r?``:c,f=RegExp(s?`${u}${c}.*?(?=\\s${d}|$)`:`${u}(?:^)?${c}[^\\s${d}]*`,`gm`),p=o.nodeBefore?.isText&&o.nodeBefore.text;if(!p)return null;let m=o.pos-p.length,h=Array.from(p.matchAll(f)).pop();if(!h||h.input===void 0||h.index===void 0)return null;let g=h.input.slice(Math.max(0,h.index-1),h.index),_=RegExp(`^[${i?.join(``)}\0]?$`).test(g);if(i!==null&&!_)return null;let v=m+h.index,y=v+h[0].length;return s&&l.test(p.slice(y-1,y+1))&&(h[0]+=` `,y+=1),v<o.pos&&y>=o.pos?{range:{from:v,to:y},query:h[0].slice(t.length),text:h[0]}:null}function lO(e){return e.docChanged?e.steps.some(e=>{let t=e.slice;if(!t?.content)return!1;let n=t.content.textBetween(0,t.content.size,`
133
- `);return/\s/.test(n)}):!1}function uO(e){return()=>{let t=e.state.selection.$anchor.pos,{top:n,right:r,bottom:i,left:a}=e.view.coordsAtPos(t);try{return new DOMRect(a,n,r-a,i-n)}catch{return null}}}function dO(e,t,n,r){return n?()=>{let n=r.getState(e.state)?.decorationId;return t.dom.querySelector(`[data-decoration-id="${n}"]`)?.getBoundingClientRect()||null}:uO(e)}function fO({match:e,dismissedRange:t,state:n,transaction:r,editor:i,shouldResetDismissed:a,effectiveAllowSpaces:o}){return a?.({editor:i,state:n,range:t,match:e,transaction:r,allowSpaces:o})?!1:o?e.range.from===t.from:e.range.from===t.from&&!lO(r)}function pO({view:e,pluginKeyRef:t}){let n=e.state.tr.setMeta(t,{exit:!0});e.dispatch(n)}function mO({pluginKey:e,decorationTag:t,decorationClass:n,decorationContent:r,decorationEmptyClass:i,renderer:a,dispatchExit:o}){return{handleKeyDown(t,n){var r;let i=e.getState(t.state);if(!i.active)return!1;if(n.key===`Escape`||n.key===`Esc`){var s;return a==null||(s=a.onKeyDown)==null||s.call(a,{view:t,event:n,range:i.range}),o(t),!0}return(a==null||(r=a.onKeyDown)==null?void 0:r.call(a,{view:t,event:n,range:i.range}))||!1},decorations(a){let{active:o,range:s,decorationId:c,query:l}=e.getState(a);if(!o)return null;let u=!l?.length,d=[n];return u&&d.push(i),He.create(a.doc,[We.inline(s.from,s.to,{nodeName:t,class:d.join(` `),"data-decoration-id":c||void 0,"data-decoration-content":r})])}}}function hO({editor:e,char:t,effectiveAllowSpaces:n,allowToIncludeChar:r,allowedPrefixes:i,startOfLine:a,findSuggestionMatch:o,allow:s,shouldShow:c,shouldKeepDismissed:l,pluginKey:u}){return{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1,dismissedRange:null}},apply(d,f,p,m){let{isEditable:h}=e,{composing:g}=e.view,{selection:_}=d,{empty:v,from:y}=_,b={...f},x=d.getMeta(u);if(x&&x.exit)return b.active=!1,b.decorationId=null,b.range={from:0,to:0},b.query=null,b.text=null,b.dismissedRange=f.active?{...f.range}:f.dismissedRange,b;if(b.composing=g,d.docChanged&&b.dismissedRange!==null&&(b.dismissedRange={from:d.mapping.map(b.dismissedRange.from),to:d.mapping.map(b.dismissedRange.to)}),h&&(v||e.view.composing)){(y<f.range.from||y>f.range.to)&&!g&&!f.composing&&(b.active=!1);let u=o({char:t,allowSpaces:n,allowToIncludeChar:r,allowedPrefixes:i,startOfLine:a,$position:_.$from}),p=`id_${Math.floor(Math.random()*4294967295)}`;u&&s({editor:e,state:m,range:u.range,isActive:f.active})&&(!c||c({editor:e,range:u.range,query:u.query,text:u.text,transaction:d}))?(b.dismissedRange!==null&&!l({match:u,dismissedRange:b.dismissedRange,state:m,transaction:d})&&(b.dismissedRange=null),b.dismissedRange===null?(b.active=!0,b.decorationId=f.decorationId||p,b.range=u.range,b.query=u.query,b.text=u.text):b.active=!1):(u||(b.dismissedRange=null),b.active=!1)}else b.active=!1;return b.active||(b.decorationId=null,b.range={from:0,to:0},b.query=null,b.text=null),b}}}function gO({editor:e,items:t}){let n=null,r=null,i=null,a=()=>{r!==null&&(clearTimeout(r),r=null),i?.(),i=null},o=e=>new Promise(t=>{i=t,r=setTimeout(()=>{r=null;let e=i;i=null,e?.()},e)}),s=()=>{n?.abort(),a(),n=null};return{abort:s,fetch:async(r,i)=>{s(),n=new AbortController;let a=n;if(i>0&&await o(i),n!==a||a.signal.aborted)return{status:`aborted`};try{let i=await t({editor:e,query:r,signal:a.signal});return n!==a||a.signal.aborted?{status:`aborted`}:{status:`resolved`,items:i}}catch{return n!==a||a.signal.aborted?{status:`aborted`}:{status:`error`}}}}}function _O({placement:e,offset:t,flip:n,floatingUi:r}){var i;let a=[C({mainAxis:t.mainAxis??4,crossAxis:t.crossAxis??0})];return n&&a.push(_()),r!=null&&(i=r.middleware)!=null&&i.length&&a.push(...r.middleware),{placement:e,strategy:r?.strategy??`absolute`,middleware:a}}function vO(e){if(e instanceof HTMLElement)return e;if(typeof e==`string`)try{let t=document.querySelector(e);if(t)return t}catch{return document.body}return document.body}function yO({getReferenceRect:e,contextElement:t,config:n,container:r,dismissOnOutsideClick:i,dismiss:a}){return(o,s={})=>{let c={getBoundingClientRect:()=>e()??new DOMRect,contextElement:t},l=!1,u=!o.isConnected;u&&vO(r).appendChild(o),s.onPosition||(o.style.visibility=`hidden`,o.style.width=`max-content`);let d=O(c,o,()=>{S(c,o,{placement:n.placement,strategy:n.strategy,middleware:n.middleware}).then(({x:e,y:t,placement:n,strategy:r})=>{if(s.onPosition){s.onPosition({x:e,y:t,placement:n,strategy:r});return}Object.assign(o.style,{position:r,left:`${e}px`,top:`${t}px`}),l||(l=!0,o.style.visibility=``)})},s.autoUpdate),f;return i&&(f=e=>{let n=e.target;!(n instanceof Node)||o.contains(n)||t.contains(n)||a()},document.addEventListener(`pointerdown`,f,!0)),()=>{d(),f&&document.removeEventListener(`pointerdown`,f,!0),u&&o.remove()}}}function bO({editor:e,pluginKey:t,items:n,renderer:r,minQueryLength:i,debounce:a,initialItems:o,placement:s,offset:c,container:l,flip:u,floatingUi:d,dismissOnOutsideClick:f,command:p,clientRectFor:m,dispatchExit:h}){let g,_=gO({editor:e,items:n}),v=_O({placement:s,offset:c,flip:u,floatingUi:d});function y(e,t){switch(e){case`started`:var n;r==null||(n=r.onStart)==null||n.call(r,t);break;case`updated`:var i;r==null||(i=r.onUpdate)==null||i.call(r,t);break;case`stopped`:var a;r==null||(a=r.onExit)==null||a.call(r,t)}}return{update:async(n,d)=>{let b=t.getState(d),x=t.getState(n.state);if(!b||!x)return;let S=null,C=b.query!==x.query,w=b.text!==x.text,T=b.range.from!==x.range.from||b.range.to!==x.range.to,E=C||w||T;if(!b.active&&x.active)S=`started`;else if(b.active&&!x.active)S=`stopped`;else if(x.active&&E)S=`updated`;else return;let D=S===`stopped`?b:x,O=n.dom.querySelector(`[data-decoration-id="${D.decorationId}"]`),ee=m(n,O),k=i===0||(D.query?D.query.length>=i:!1),A=(S===`started`||S===`updated`)&&k;if(g={editor:e,range:D.range,query:D.query||``,text:D.text||``,items:o??[],command:t=>p({editor:e,range:D.range,props:t}),decorationNode:O,clientRect:ee,loading:A,placement:s,offset:{mainAxis:c.mainAxis??4,crossAxis:c.crossAxis??0},container:l,flip:u,floatingUi:v,mount:yO({getReferenceRect:ee,contextElement:n.dom,config:v,container:l,dismissOnOutsideClick:f,dismiss:()=>h(e.view)})},S===`started`){var j;r==null||(j=r.onBeforeStart)==null||j.call(r,g)}if(S===`updated`){var M;r==null||(M=r.onBeforeUpdate)==null||M.call(r,g)}if(S===`started`&&y(S,g),S===`started`||S===`updated`)if(!A)_.abort(),g={...g,items:o??[],loading:!1};else{g={...g,items:o??[],loading:!0},S=`updated`,y(S,g);let e=await _.fetch(D.query||``,a);if(e.status===`aborted`)return;if(!t.getState(n.state)?.active){_.abort();return}g=e.status===`resolved`?{...g,items:e.items,loading:!1}:{...g,loading:!1}}if(S===`stopped`){_.abort(),y(S,g),g=void 0;return}S===`updated`&&y(S,g)},destroy:()=>{var e;_.abort(),g&&(r==null||(e=r.onExit)==null||e.call(r,g))}}}var xO=new ce(`suggestion`);function SO({pluginKey:e=xO,editor:t,char:n=`@`,allowSpaces:r=!1,allowToIncludeChar:i=!1,allowedPrefixes:a=[` `],startOfLine:o=!1,decorationTag:s=`span`,decorationClass:c=`suggestion`,decorationContent:l=``,decorationEmptyClass:u=`is-empty`,command:d=()=>null,items:f=()=>[],minQueryLength:p=0,debounce:m=0,initialItems:h,placement:g=`bottom-start`,offset:_={},container:v,flip:y=!0,floatingUi:b,dismissOnOutsideClick:x=!0,render:S=()=>({}),allow:C=()=>!0,findSuggestionMatch:w=cO,shouldShow:T,shouldResetDismissed:E}){let D=S?.(),O=r&&!i,ee=(n,r)=>dO(t,n,r,e);function k(e){return fO({...e,editor:t,shouldResetDismissed:E,effectiveAllowSpaces:O})}let A=t=>pO({view:t,pluginKeyRef:e});return new Ae({key:e,view:()=>bO({editor:t,pluginKey:e,items:f,renderer:D,minQueryLength:p,debounce:m,initialItems:h,placement:g,offset:_,container:v,flip:y,floatingUi:b,dismissOnOutsideClick:x,command:d,clientRectFor:ee,dispatchExit:A}),state:hO({editor:t,char:n,effectiveAllowSpaces:O,allowToIncludeChar:i,allowedPrefixes:a,startOfLine:o,findSuggestionMatch:w,allow:C,shouldShow:T,shouldKeepDismissed:k,pluginKey:e}),props:mO({pluginKey:e,decorationTag:s,decorationClass:c,decorationContent:l,decorationEmptyClass:u,renderer:D,dispatchExit:A})})}function CO(e,t=xO){let n=e.state.tr.setMeta(t,{exit:!0});e.dispatch(n)}function wO(e,t){return`${e}-option-${t}`}function TO({activeIndex:e,id:t,items:n,onHighlight:r,onSelect:i,translate:a}){let{t:o}=N(`lattice`),s=(0,z.useRef)(null),c=a??((e,t)=>o(`form.editor.${e}`,t));return(0,z.useEffect)(()=>{s.current?.querySelector(`[aria-selected="true"]`)?.scrollIntoView({block:`nearest`})},[e,n]),(0,K.jsx)(`div`,{"aria-label":o(`form.editor.block-menu`,`Insert block`),className:x(Gt,`max-h-72 w-56 overflow-y-auto p-1`),"data-test":`editor-block-menu`,id:t,ref:s,role:`listbox`,children:n.length===0?(0,K.jsx)(`div`,{className:`px-2 py-1.5 text-sm text-lt-muted-fg`,children:o(`form.editor.block-menu-empty`,`No results`)}):n.map((a,o)=>(0,K.jsxs)(z.Fragment,{children:[o>0&&n[o-1].group!==a.group&&(0,K.jsx)(`div`,{className:`mx-1 my-1 h-px bg-lt-border`}),(0,K.jsxs)(`button`,{"aria-selected":o===e,className:x(`flex w-full items-center gap-2 rounded-lt-sm px-2 py-1.5 text-left text-sm`,o===e&&`bg-lt-accent text-lt-accent-fg`),"data-test":`editor-block-${a.key}`,id:wO(t,a.key),onClick:()=>i(a),onMouseDown:e=>e.preventDefault(),onMouseMove:()=>r(o),role:`option`,type:`button`,children:[(0,K.jsx)(y,{className:`shrink-0 text-lt-muted-fg`,name:a.icon}),c(a.key,a.label)]})]},a.key))})}var EO=new ce(`latticeSlashMenu`);function DO(e){return jt.create({name:`latticeSlashMenu`,addProseMirrorPlugins(){return[SO({editor:this.editor,pluginKey:EO,char:e.char??`/`,allow:({editor:e})=>!e.isActive(`codeBlock`),items:()=>e.commands(),command:({editor:e,range:t,props:n})=>{e.chain().focus().deleteRange(t).run(),n.run(e)},render:()=>({onStart:t=>e.handle.current?.onStart(t),onUpdate:t=>e.handle.current?.onUpdate(t),onKeyDown:t=>e.handle.current?.onKeyDown(t)??!1,onExit:()=>e.handle.current?.onExit()})})]}})}function OO(e,t,n,r){let i=t.trim().toLowerCase();return e.filter(e=>e.isAvailable&&!e.isAvailable(n)?!1:i===``||[r(e.key,e.label),e.label,e.key,...e.keywords??[]].some(e=>e.toLowerCase().includes(i)))}var kO={placement:`left`,offset:4,flip:!1};function AO({editor:e,handleRef:t,translate:n,plusButton:r=!0}){let{t:i}=N(`lattice`),a=(0,z.useId)(),o=(0,z.useMemo)(()=>n??((e,t)=>i(`form.editor.${e}`,t)),[i,n]),[s,c]=(0,z.useState)(null),[l,u]=(0,z.useState)(0),[d]=(0,z.useState)(()=>{let e=document.createElement(`div`);return e.className=`z-lt-popover`,e}),f=(0,z.useRef)(null),p=(0,z.useMemo)(()=>s?OO(s.items,s.query,e,o):[],[s,e,o]),m=(0,z.useRef)(p),h=(0,z.useRef)(l),g=(0,z.useRef)(s);return(0,z.useEffect)(()=>{m.current=p,h.current=l,g.current=s}),(0,z.useEffect)(()=>(t.current={onStart:e=>{c({items:e.items,query:e.query,command:e.command}),u(0),f.current=e.mount(d)},onUpdate:e=>{e.query!==g.current?.query&&u(0),c({items:e.items,query:e.query,command:e.command})},onKeyDown:({view:e,event:t})=>{if(t.key===`Escape`)return CO(e,EO),!0;let n=m.current;if(n.length===0)return!1;if(t.key===`ArrowDown`)return u(e=>Math.min(n.length-1,e+1)),!0;if(t.key===`ArrowUp`)return u(e=>Math.max(0,e-1)),!0;if(t.key===`Enter`){let e=n[h.current];return e&&g.current?.command(e),!0}return!1},onExit:()=>{f.current?.(),f.current=null,c(null)}},()=>{t.current=null,f.current?.(),f.current=null}),[d,t]),(0,z.useEffect)(()=>{let t=e.view.dom;if(!s){t.removeAttribute(`aria-controls`),t.removeAttribute(`aria-activedescendant`);return}t.setAttribute(`aria-controls`,a);let n=p[l];n?t.setAttribute(`aria-activedescendant`,wO(a,n.key)):t.removeAttribute(`aria-activedescendant`)},[s,p,l,e,a]),(0,K.jsxs)(K.Fragment,{children:[(0,ic.createPortal)(s&&(0,K.jsx)(TO,{activeIndex:l,id:a,items:p,onHighlight:u,onSelect:e=>s.command(e),translate:o}),d),r&&(0,K.jsx)(sO,{editor:e,options:kO,children:(0,K.jsx)(zw,{icon:`plus`,label:i(`form.editor.add-block`,`Add block`),onClick:()=>e.chain().focus().insertContent(`/`).run(),testId:`editor-add-block`})})]})}function jO(e){if(Array.isArray(e))return e}function MO(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 NO(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 PO(e,t){if(e){if(typeof e==`string`)return NO(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)?NO(e,t):void 0}}function FO(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
134
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function IO(e,t){return jO(e)||MO(e,t)||PO(e,t)||FO()}var LO=n((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.bind=void 0;function t(e,t){var n=t.type,r=t.listener,i=t.options;return e.addEventListener(n,r,i),function(){e.removeEventListener(n,r,i)}}e.bind=t})),RO=n((e=>{var t=e&&e.__assign||function(){return t=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},t.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.bindAll=void 0;var n=LO();function r(e){if(e!==void 0)return typeof e==`boolean`?{capture:e}:e}function i(e,n){return n==null?e:t(t({},e),{options:t(t({},r(n)),r(e.options))})}function a(e,t,r){var a=t.map(function(t){var a=i(t,r);return(0,n.bind)(e,a)});return function(){a.forEach(function(e){return e()})}}e.bindAll=a})),zO=n((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.bindAll=e.bind=void 0;var t=LO();Object.defineProperty(e,"bind",{enumerable:!0,get:function(){return t.bind}});var n=RO();Object.defineProperty(e,"bindAll",{enumerable:!0,get:function(){return n.bindAll}})}))(),BO=`data-pdnd-honey-pot`;function VO(e){return e instanceof Element&&e.hasAttribute(`data-pdnd-honey-pot`)}function HO(e){var t=IO(document.elementsFromPoint(e.x,e.y),2),n=t[0],r=t[1];return n?VO(n)?r??null:n:null}function UO(e){"@babel/helpers - typeof";return UO=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},UO(e)}function WO(e,t){if(UO(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(UO(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function GO(e){var t=WO(e,`string`);return UO(t)==`symbol`?t:t+``}function KO(e,t,n){return(t=GO(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var qO=2147483647,JO={inset:`unset`,border:`none`,padding:0,margin:0,overflow:`visible`,color:`inherit`,background:`transparent`,width:`auto`,height:`auto`};function YO(e){var t=null;return function(){if(!t){var n=[...arguments];t={result:e.apply(this,n)}}return t.result}}var XO=YO(function(){return typeof HTMLElement<`u`&&typeof HTMLElement.prototype.showPopover==`function`});function ZO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function QO(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?ZO(Object(n),!0).forEach(function(t){KO(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ZO(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var $O=2,ek=$O/2;function tk(e){return{x:Math.floor(e.x),y:Math.floor(e.y)}}function nk(e){return{x:e.x-ek,y:e.y-ek}}function rk(e){return{x:Math.max(e.x,0),y:Math.max(e.y,0)}}function ik(e){return{x:Math.min(e.x,window.innerWidth-$O),y:Math.min(e.y,window.innerHeight-$O)}}function ak(e){var t=e.client,n=ik(rk(nk(tk(t))));return DOMRect.fromRect({x:n.x,y:n.y,width:$O,height:$O})}function ok(e){var t=e.clientRect;return{left:`${t.left}px`,top:`${t.top}px`,width:`${t.width}px`,height:`${t.height}px`}}function sk(e){var t=e.client,n=e.clientRect;return t.x>=n.x&&t.x<=n.x+n.width&&t.y>=n.y&&t.y<=n.y+n.height}function ck(e){var t=e.initial,n=document.createElement(`div`);n.setAttribute(BO,`true`),XO()&&n.setAttribute(`popover`,`manual`);var r=ak({client:t});Object.assign(n.style,QO(QO({position:`fixed`},XO()?JO:{zIndex:qO}),{},{backgroundColor:`transparent`,padding:0,margin:0,boxSizing:`border-box`,pointerEvents:`auto`},ok({clientRect:r}))),document.body.appendChild(n),XO()&&n.showPopover();var i=(0,zO.bind)(window,{type:`pointermove`,listener:function(e){r=ak({client:{x:e.clientX,y:e.clientY}}),Object.assign(n.style,ok({clientRect:r}))},options:{capture:!0}});return function(e){var t=e.current;if(i(),sk({client:t,clientRect:r})){n.remove();return}function a(){o(),n.remove()}var o=(0,zO.bindAll)(window,[{type:`pointerdown`,listener:a},{type:`pointermove`,listener:a},{type:`focusin`,listener:a},{type:`focusout`,listener:a},{type:`dragstart`,listener:a},{type:`dragenter`,listener:a},{type:`dragover`,listener:a}],{capture:!0})}}function lk(){var e=null;function t(){return e=null,(0,zO.bind)(window,{type:`pointermove`,listener:function(t){e={x:t.clientX,y:t.clientY}},options:{capture:!0}})}function n(){var t=null;return function(n){var r=n.eventName,i=n.payload;if(r===`onDragStart`){var a=i.location.initial.input;t=ck({initial:e??{x:a.clientX,y:a.clientY}})}if(r===`onDrop`){var o,s=i.location.current.input;(o=t)==null||o({current:{x:s.clientX,y:s.clientY}}),t=null,e=null}}}return{bindEvents:t,getOnPostDispatch:n}}function uk(e){if(Array.isArray(e))return NO(e)}function dk(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function fk(){throw TypeError(`Invalid attempt to spread non-iterable instance.
135
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function pk(e){return uk(e)||dk(e)||PO(e)||fk()}var mk=YO(function(){return navigator.userAgent.includes(`Firefox`)}),hk=YO(function(){var e=navigator.userAgent;return e.includes(`AppleWebKit`)&&!e.includes(`Chrome`)}),gk={isLeavingWindow:Symbol(`leaving`),isEnteringWindow:Symbol(`entering`)};function _k(e){var t=e.dragLeave;return hk()?t.hasOwnProperty(gk.isLeavingWindow):!1}(function(){if(typeof window>`u`||!hk())return;function e(){return{enterCount:0,isOverWindow:!1}}var t=e();function n(){t=e()}(0,zO.bindAll)(window,[{type:`dragstart`,listener:function(){t.enterCount=0,t.isOverWindow=!0}},{type:`drop`,listener:n},{type:`dragend`,listener:n},{type:`dragenter`,listener:function(e){!t.isOverWindow&&t.enterCount===0&&(e[gk.isEnteringWindow]=!0),t.isOverWindow=!0,t.enterCount++}},{type:`dragleave`,listener:function(e){t.enterCount--,t.isOverWindow&&t.enterCount===0&&(e[gk.isLeavingWindow]=!0,t.isOverWindow=!1)}}],{capture:!0})})();function vk(e){return`nodeName`in e}function yk(e){return vk(e)&&e.ownerDocument!==document}function bk(e){var t=e.dragLeave,n=t.type,r=t.relatedTarget;return n===`dragleave`?hk()?_k({dragLeave:t}):r==null?!0:mk()?yk(r):r instanceof HTMLIFrameElement:!1}function xk(e){var t=e.onDragEnd;return[{type:`pointermove`,listener:function(){var e=0;return function(){if(e<20){e++;return}t()}}()},{type:`pointerdown`,listener:t}]}function Sk(e){return{altKey:e.altKey,button:e.button,buttons:e.buttons,ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey,clientX:e.clientX,clientY:e.clientY,pageX:e.pageX,pageY:e.pageY}}var Ck=function(e){var t=[],n=null,r=function(){t=[...arguments],!n&&(n=requestAnimationFrame(function(){n=null,e.apply(void 0,t)}))};return r.cancel=function(){n&&=(cancelAnimationFrame(n),null)},r}(function(e){return e()}),wk=function(){var e=null;function t(t){e={frameId:requestAnimationFrame(function(){e=null,t()}),fn:t}}function n(){e&&=(cancelAnimationFrame(e.frameId),e.fn(),null)}return{schedule:t,flush:n}}();function Tk(e){var t=e.source,n=e.initial,r=e.dispatchEvent,i={dropTargets:[]};function a(e){r(e),i={dropTargets:e.payload.location.current.dropTargets}}return{start:function(e){var r=e.nativeSetDragImage,o={current:n,previous:i,initial:n};a({eventName:`onGenerateDragPreview`,payload:{source:t,location:o,nativeSetDragImage:r}}),wk.schedule(function(){a({eventName:`onDragStart`,payload:{source:t,location:o}})})},dragUpdate:function(e){var r=e.current;wk.flush(),Ck.cancel(),a({eventName:`onDropTargetChange`,payload:{source:t,location:{initial:n,previous:i,current:r}}})},drag:function(e){var r=e.current;Ck(function(){wk.flush(),a({eventName:`onDrag`,payload:{source:t,location:{initial:n,previous:i,current:r}}})})},drop:function(e){var r=e.current,o=e.updatedSourcePayload;wk.flush(),Ck.cancel(),a({eventName:`onDrop`,payload:{source:o??t,location:{current:r,previous:i,initial:n}}})}}}var Ek={isActive:!1};function Dk(){return!Ek.isActive}function Ok(e){return e.dataTransfer?e.dataTransfer.setDragImage.bind(e.dataTransfer):null}function kk(e){var t=e.current,n=e.next;if(t.length!==n.length)return!0;for(var r=0;r<t.length;r++)if(t[r].element!==n[r].element)return!0;return!1}function Ak(e){var t=e.event,n=e.dragType,r=e.getDropTargetsOver,i=e.dispatchEvent;if(!Dk())return;var a=Mk({event:t,dragType:n,getDropTargetsOver:r});Ek.isActive=!0;var o={current:a};jk({event:t,current:a.dropTargets});var s=Tk({source:n.payload,dispatchEvent:i,initial:a});function c(e){var t=kk({current:o.current.dropTargets,next:e.dropTargets});o.current=e,t&&s.dragUpdate({current:o.current})}function l(e){var t=Sk(e),i=r({target:VO(e.target)?HO({x:t.clientX,y:t.clientY}):e.target,input:t,source:n.payload,current:o.current.dropTargets});i.length&&(e.preventDefault(),jk({event:e,current:i})),c({dropTargets:i,input:t})}function u(){o.current.dropTargets.length&&c({dropTargets:[],input:o.current.input}),s.drop({current:o.current,updatedSourcePayload:null}),d()}function d(){Ek.isActive=!1,f()}var f=(0,zO.bindAll)(window,[{type:`dragover`,listener:function(e){l(e),s.drag({current:o.current})}},{type:`dragenter`,listener:l},{type:`dragleave`,listener:function(e){bk({dragLeave:e})&&(c({input:o.current.input,dropTargets:[]}),n.startedFrom===`external`&&u())}},{type:`drop`,listener:function(e){if(o.current={dropTargets:o.current.dropTargets,input:Sk(e)},!o.current.dropTargets.length){u();return}e.preventDefault(),jk({event:e,current:o.current.dropTargets}),s.drop({current:o.current,updatedSourcePayload:n.type===`external`?n.getDropPayload(e):null}),d()}},{type:`dragend`,listener:function(e){o.current={dropTargets:o.current.dropTargets,input:Sk(e)},u()}}].concat(pk(xk({onDragEnd:u}))),{capture:!0});s.start({nativeSetDragImage:Ok(t)})}function jk(e){var t=e.event,n=e.current[0]?.dropEffect;n!=null&&t.dataTransfer&&(t.dataTransfer.dropEffect=n)}function Mk(e){var t=e.event,n=e.dragType,r=e.getDropTargetsOver,i=Sk(t);return n.startedFrom===`external`?{input:i,dropTargets:[]}:{input:i,dropTargets:r({input:i,source:n.payload,target:t.target,current:[]})}}var Nk={canStart:Dk,start:Ak},Pk=new Map;function Fk(e){var t=e.typeKey,n=e.mount,r=Pk.get(t);if(r)return r.usageCount++,r;var i={typeKey:t,unmount:n(),usageCount:1};return Pk.set(t,i),i}function Ik(e){var t=Fk(e);return function(){t.usageCount--,!(t.usageCount>0)&&(t.unmount(),Pk.delete(e.typeKey))}}function Lk(){var e=[...arguments];return function(){e.forEach(function(e){return e()})}}function Rk(e,t){var n=t.attribute,r=t.value;return e.setAttribute(n,r),function(){return e.removeAttribute(n)}}function zk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Bk(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?zk(Object(n),!0).forEach(function(t){KO(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zk(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Vk(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(!n){if(Array.isArray(e)||(n=Hk(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
136
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||n.return==null||n.return()}finally{if(s)throw a}}}}function Hk(e,t){if(e){if(typeof e==`string`)return Uk(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)?Uk(e,t):void 0}}function Uk(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 Wk(e){return e.slice(0).reverse()}function Gk(e){var t=e.typeKey,n=e.defaultDropEffect,r=new WeakMap,i=`data-drop-target-for-${t}`,a=`[${i}]`;function o(e){return r.set(e.element,e),function(){return r.delete(e.element)}}function s(e){return YO(Lk(Rk(e.element,{attribute:i,value:`true`}),o(e)))}function c(e){var t=e.source,i=e.target,o=e.input,s=e.result,l=s===void 0?[]:s;if(i==null)return l;if(!(i instanceof Element))return i instanceof Node?c({source:t,target:i.parentElement,input:o,result:l}):l;var u=i.closest(a);if(u==null)return l;var d=r.get(u);if(d==null)return l;var f={input:o,source:t,element:d.element};if(d.canDrop&&!d.canDrop(f))return c({source:t,target:d.element.parentElement,input:o,result:l});var p=d.getData?.call(d,f)??{},m=d.getDropEffect?.call(d,f)??n,h={data:p,element:d.element,dropEffect:m,isActiveDueToStickiness:!1};return c({source:t,target:d.element.parentElement,input:o,result:[].concat(pk(l),[h])})}function l(e){var t=e.eventName,n=e.payload,i=Vk(n.location.current.dropTargets),a;try{for(i.s();!(a=i.n()).done;){var o,s=a.value,c=r.get(s.element),l=Bk(Bk({},n),{},{self:s});c==null||(o=c[t])==null||o.call(c,l)}}catch(e){i.e(e)}finally{i.f()}}var u={onGenerateDragPreview:l,onDrag:l,onDragStart:l,onDrop:l,onDropTargetChange:function(e){var t=e.payload,n=new Set(t.location.current.dropTargets.map(function(e){return e.element})),i=new Set,a=Vk(t.location.previous.dropTargets),o;try{for(a.s();!(o=a.n()).done;){var s,c=o.value;i.add(c.element);var l=r.get(c.element),u=n.has(c.element),d=Bk(Bk({},t),{},{self:c});if(l==null||(s=l.onDropTargetChange)==null||s.call(l,d),!u){var f;l==null||(f=l.onDragLeave)==null||f.call(l,d)}}}catch(e){a.e(e)}finally{a.f()}var p=Vk(t.location.current.dropTargets),m;try{for(p.s();!(m=p.n()).done;){var h,g,_=m.value;if(!i.has(_.element)){var v=Bk(Bk({},t),{},{self:_}),y=r.get(_.element);y==null||(h=y.onDropTargetChange)==null||h.call(y,v),y==null||(g=y.onDragEnter)==null||g.call(y,v)}}}catch(e){p.e(e)}finally{p.f()}}};function d(e){u[e.eventName](e)}function f(e){var t=e.source,n=e.target,i=e.input,a=e.current,o=c({source:t,target:n,input:i});if(o.length>=a.length)return o;for(var s=Wk(a),l=Wk(o),u=[],d=0;d<s.length;d++){var f,p=s[d],m=l[d];if(m!=null){u.push(m);continue}var h=u[d-1],g=s[d-1];if(h?.element!==g?.element)break;var _=r.get(p.element);if(!_)break;var v={input:i,source:t,element:_.element};if(_.canDrop&&!_.canDrop(v)||!((f=_.getIsSticky)!=null&&f.call(_,v)))break;u.push(Bk(Bk({},p),{},{isActiveDueToStickiness:!0}))}return Wk(u)}return{dropTargetForConsumers:s,getIsOver:f,dispatchEvent:d}}function Kk(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(!n){if(Array.isArray(e)||(n=qk(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
137
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||n.return==null||n.return()}finally{if(s)throw a}}}}function qk(e,t){if(e){if(typeof e==`string`)return Jk(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)?Jk(e,t):void 0}}function Jk(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 Yk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Xk(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Yk(Object(n),!0).forEach(function(t){KO(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Yk(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Zk(){var e=new Set,t=null;function n(e){t&&(!e.canMonitor||e.canMonitor(t.canMonitorArgs))&&t.active.add(e)}function r(r){var i=Xk({},r);e.add(i),n(i);function a(){e.delete(i),t&&t.active.delete(i)}return YO(a)}function i(r){var i=r.eventName,a=r.payload;if(i===`onGenerateDragPreview`){t={canMonitorArgs:{initial:a.location.initial,source:a.source},active:new Set};var o=Kk(e),s;try{for(o.s();!(s=o.n()).done;){var c=s.value;n(c)}}catch(e){o.e(e)}finally{o.f()}}if(t){for(var l=Array.from(t.active),u=0,d=l;u<d.length;u++){var f=d[u];if(t.active.has(f)){var p;(p=f[i])==null||p.call(f,a)}}i===`onDrop`&&(t.active.clear(),t=null)}}return{dispatchEvent:i,monitorForConsumers:r}}function Qk(e){var t=e.typeKey,n=e.mount,r=e.dispatchEventToSource,i=e.onPostDispatch,a=e.defaultDropEffect,o=Zk(),s=Gk({typeKey:t,defaultDropEffect:a});function c(e){r?.(e),s.dispatchEvent(e),o.dispatchEvent(e),i?.(e)}function l(e){var t=e.event,n=e.dragType;Nk.start({event:t,dragType:n,getDropTargetsOver:s.getIsOver,dispatchEvent:c})}function u(){function e(){return n({canStart:Nk.canStart,start:l})}return Ik({typeKey:t,mount:e})}return{registerUsage:u,dropTarget:s.dropTargetForConsumers,monitor:o.monitorForConsumers}}var $k=YO(function(){return navigator.userAgent.toLocaleLowerCase().includes(`android`)}),eA=`pdnd:android-fallback`,tA=`text/plain`,nA=`application/vnd.pdnd`,rA=new WeakMap;function iA(e){return rA.set(e.element,e),function(){rA.delete(e.element)}}var aA=lk(),oA=Qk({typeKey:`element`,defaultDropEffect:`move`,mount:function(e){return Lk(aA.bindEvents(),(0,zO.bind)(document,{type:`dragstart`,listener:function(t){if(e.canStart(t)&&!t.defaultPrevented&&t.dataTransfer){var n=t.target;if(n instanceof HTMLElement){var r=rA.get(n);if(r){var i=Sk(t),a={element:r.element,dragHandle:r.dragHandle??null,input:i};if(r.canDrag&&!r.canDrag(a)){t.preventDefault();return}if(r.dragHandle){var o=HO({x:i.clientX,y:i.clientY});if(!r.dragHandle.contains(o)){t.preventDefault();return}}var s=r.getInitialDataForExternal?.call(r,a)??null;if(s)for(var c=0,l=Object.entries(s);c<l.length;c++){var u=IO(l[c],2),d=u[0],f=u[1];t.dataTransfer.setData(d,f??``)}$k()&&!t.dataTransfer.types.includes(`text/plain`)&&!t.dataTransfer.types.includes(`text/uri-list`)&&t.dataTransfer.setData(tA,eA),t.dataTransfer.setData(nA,``);var p={type:`element`,payload:{element:r.element,dragHandle:r.dragHandle??null,data:r.getInitialData?.call(r,a)??{}},startedFrom:`internal`};e.start({event:t,dragType:p})}}}}}))},dispatchEventToSource:function(e){var t,n,r=e.eventName,i=e.payload;(t=rA.get(i.source.element))==null||(n=t[r])==null||n.call(t,i)},onPostDispatch:aA.getOnPostDispatch()}),sA=oA.dropTarget,cA=oA.monitor;function lA(e){return YO(Lk(oA.registerUsage(),iA(e),Rk(e.element,{attribute:`draggable`,value:`true`})))}function uA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function dA(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?uA(Object(n),!0).forEach(function(t){KO(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uA(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function fA(){return{x:0,y:0}}function pA(e){var t=e.render,n=e.nativeSetDragImage,r=e.getOffset,i=r===void 0?fA:r,a=document.createElement(`div`);XO()&&a.setAttribute(`popover`,`manual`),Object.assign(a.style,dA(dA({position:`fixed`},XO()?JO:{zIndex:qO}),{},{top:0,left:0,pointerEvents:`none`})),document.body.append(a),XO()&&a.showPopover();var o=t({container:a});queueMicrotask(function(){var e=i({container:a});if(hk()){var t=a.getBoundingClientRect();if(t.width===0)return;a.style.left=`-${t.width-1e-4}px`}n?.(a,e.x,e.y)});function s(){c(),o?.(),document.body.removeChild(a)}var c=cA({onDragStart:s,onDrop:s})}function mA(e){var t=e.element,n=e.input;return function(e){var r=e.container,i=t.getBoundingClientRect(),a=r.getBoundingClientRect();return{x:Math.min(n.clientX-i.x,a.width),y:Math.min(n.clientY-i.y,a.height)}}}function hA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function gA(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?hA(Object(n),!0).forEach(function(t){KO(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hA(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var _A={top:function(e,t){return Math.abs(t.y-e.top)},right:function(e,t){return Math.abs(e.right-t.x)},bottom:function(e,t){return Math.abs(e.bottom-t.y)},left:function(e,t){return Math.abs(t.x-e.left)}},vA=Symbol(`closestEdge`);function yA(e,t){var n=t.element,r=t.input,i=t.allowedEdges,a={x:r.clientX,y:r.clientY},o=n.getBoundingClientRect(),s=i.map(function(e){return{edge:e,value:_A[e](o,a)}}).sort(function(e,t){return e.value-t.value})[0]?.edge??null;return gA(gA({},e),{},KO({},vA,s))}function bA(e){return e[vA]??null}function xA(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function SA(e,t){if(e==null)return{};var n,r,i=xA(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function CA(e,t){var n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every(function(n){return Object.is(e[n],t[n])})}function wA(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:CA,t=null;return function(n){return t&&e(t.value,n)||(t={value:n}),t.value}}var TA=[`block`];function EA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function DA(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?EA(Object(n),!0).forEach(function(t){KO(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):EA(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var OA=Symbol(`tree-item-instruction`);function kA(e){return{x:(e.right+e.left)/2,y:(e.bottom+e.top)/2}}function AA(e){var t=e.client,n=e.borderBox,r=n.height/4;return t.y<=n.top+r?`reorder-above`:t.y>=n.bottom-r?`reorder-below`:`make-child`}function jA(e){var t=e.element,n=e.input,r=e.currentLevel,i=e.indentPerLevel,a=e.mode,o={x:n.clientX,y:n.clientY},s=t.getBoundingClientRect();if(a===`standard`)return{type:AA({borderBox:s,client:o}),indentPerLevel:i,currentLevel:r};var c=kA(s);if(a===`expanded`){var l=AA({borderBox:s,client:o});return{type:l===`reorder-above`?l:`make-child`,indentPerLevel:i,currentLevel:r}}var u=i*r;if(o.x<s.left+u){if(o.y<c.y)return{type:`reorder-above`,indentPerLevel:i,currentLevel:r};var d=(o.x-s.left)/i;return{type:`reparent`,desiredLevel:Math.max(Math.floor(d),0),indentPerLevel:i,currentLevel:r}}return{type:AA({borderBox:s,client:o}),indentPerLevel:i,currentLevel:r}}function MA(e,t){return e.type===t.type?e.type===`instruction-blocked`&&t.type===`instruction-blocked`?MA(e.desired,t.desired):CA(e,t):!1}var NA=wA(MA);function PA(e){var t=e.desired,n=e.block;return n!=null&&n.includes(t.type)&&t.type!==`instruction-blocked`?{type:`instruction-blocked`,desired:t}:t}function FA(e,t){var n=t.block,r=NA(PA({desired:jA(SA(t,TA)),block:n}));return DA(DA({},e),{},KO({},OA,r))}function IA(e){return e[OA]??null}function LA(e){var t=e.startIndex,n=e.closestEdgeOfTarget,r=e.indexOfTarget,i=e.axis;if(t===-1||r===-1||t===r)return t;if(n==null)return r;var a=i===`vertical`&&n===`bottom`||i===`horizontal`&&n===`right`;return t<r?a?r:r-1:a?r+1:r}var RA=1e3,zA=null,BA=`1px`,VA={width:BA,height:BA,padding:`0`,position:`absolute`,border:`0`,clip:`rect(${BA}, ${BA}, ${BA}, ${BA})`,overflow:`hidden`,whiteSpace:`nowrap`,marginTop:`-${BA}`,pointerEvents:`none`};function HA(){var e=document.createElement(`div`);return e.setAttribute(`role`,`status`),Object.assign(e.style,VA),document.body.append(e),e}function UA(){return zA===null&&(zA=HA()),zA}var WA=null;function GA(){WA!==null&&clearTimeout(WA),WA=null}function KA(e){UA(),GA(),WA=setTimeout(function(){WA=null;var t=UA();t.textContent=e},RA)}var qA=new Map,JA=new Set;function YA(e){XA(e);var t=qA.get(e);if(t)return t;var n={timeOfEngagementStart:Date.now()};return qA.set(e,n),n}function XA(e){JA.add(e)}function ZA(e){JA.clear(),e(),qA.forEach(function(e,t){JA.has(t)||qA.delete(t)}),JA.clear()}function QA(){qA.clear()}var $A=new Map;function ej(e){var t=$A.get(e);if(t)return t;var n=tj(e);return $A.set(e,n),n}function tj(e){var t={type:`idle`},n=[];function r(e){if(t.type===`running`){var i=e-t.timeLastFrameFinished,a=t.latestArgs,o=HO({x:a.location.current.input.clientX,y:a.location.current.input.clientY});ZA(function(){n.forEach(function(e){return e({underUsersPointer:o,latestArgs:a,timeSinceLastFrame:i})})}),t.timeLastFrameFinished=e,t.frameId=requestAnimationFrame(r)}}function i(){t.type!==`idle`&&(cancelAnimationFrame(t.frameId),QA(),t={type:`idle`})}function a(e){t.type===`idle`&&(t={type:`initializing`,latestArgs:e,frameId:requestAnimationFrame(function(e){t.type===`initializing`&&(t={type:`running`,timeLastFrameFinished:e,latestArgs:t.latestArgs,frameId:requestAnimationFrame(r)})})})}function o(e){if(t.type===`idle`){a(e);return}t.latestArgs=e}return e({onDragStart:a,onDropTargetChange:o,onDrag:o,onDrop:i}),{onFrame:function(e){n.push(e)}}}var nj=`data-auto-scrollable`,rj=`[${nj}="true"]`;function ij(e){return e.setAttribute(nj,`true`),function(){return e.removeAttribute(nj)}}function aj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function oj(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?aj(Object(n),!0).forEach(function(t){KO(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):aj(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var sj={startHitboxAtPercentageRemainingOfElement:{top:.25,right:.25,bottom:.25,left:.25},maxScrollAtPercentageRemainingOfHitbox:{top:.5,right:.5,bottom:.5,left:.5},timeDampeningDurationMs:400,maxMainAxisHitboxSize:180},cj={standard:900,fast:1500};function lj(e){return oj(oj({},sj),{},{maxPixelScrollPerSecond:cj[e?.maxScrollSpeed??`standard`]})}var uj={top:function(e){return e.scrollTop>0},right:function(e){return Math.ceil(e.scrollLeft)+e.clientWidth<e.scrollWidth},bottom:function(e){return Math.ceil(e.scrollTop)+e.clientHeight<e.scrollHeight},left:function(e){return e.scrollLeft>0}},dj=[`top`,`right`,`bottom`,`left`],fj={top:`vertical`,right:`horizontal`,bottom:`vertical`,left:`horizontal`},pj={start:`top`,end:`bottom`,point:`y`,size:`height`},mj={start:`left`,end:`right`,point:`x`,size:`width`},hj={vertical:{mainAxis:pj,crossAxis:mj},horizontal:{mainAxis:mj,crossAxis:pj}},gj={top:`start`,right:`end`,bottom:`end`,left:`start`};function _j(e){var t=e.edge,n=e.axis;return function(e){var r=e.clientRect,i=e.config,a=hj[n],o=a.mainAxis,s=a.crossAxis,c=gj[t],l=Math.min(i.startHitboxAtPercentageRemainingOfElement[t]*r[o.size],i.maxMainAxisHitboxSize);return DOMRect.fromRect(KO(KO(KO(KO({},o.point,c===`start`?r[o.point]:r[o.point]+r[o.size]-l),s.point,r[s.point]),o.size,l),s.size,r[s.size]))}}var vj={top:_j({axis:`vertical`,edge:`top`}),right:_j({axis:`horizontal`,edge:`right`}),bottom:_j({axis:`vertical`,edge:`bottom`}),left:_j({axis:`horizontal`,edge:`left`})};function yj(e){var t=e.startOfRange,n=e.endOfRange,r=e.value;if(!(t<n)||r<t)return 0;if(r>n)return 1;var i=n-t;return(r-t)/i}function bj(e){var t=e.timeSinceLastFrame,n=e.config,r=n.maxPixelScrollPerSecond/1e3,i=Math.ceil(r*t),a=n.maxPixelScrollPerSecond/60;return Math.min(i,a)}function xj(e){var t=e.client,n=e.axis,r=e.edge,i=e.hitbox,a=e.config,o=hj[n].mainAxis,s=gj[r],c=i[o.size]*a.maxScrollAtPercentageRemainingOfHitbox[r];return s===`end`?yj({startOfRange:i[o.start],endOfRange:i[o.end]-c,value:t[o.point]}):1-yj({startOfRange:i[o.start]+c,endOfRange:i[o.end],value:t[o.point]})}function Sj(e){var t=e.client,n=e.timeSinceLastFrame,r=e.engagement,i=e.axis,a=e.hitbox,o=e.edge,s=e.isDistanceDampeningEnabled,c=e.config,l=bj({timeSinceLastFrame:n,config:c}),u=(s?xj({client:t,edge:o,hitbox:a,axis:i,config:c}):1)*yj({startOfRange:r.timeOfEngagementStart,endOfRange:r.timeOfEngagementStart+c.timeDampeningDurationMs,value:Date.now()}),d=Math.max(l*u,1);return gj[o]===`end`?d:-1*d}function Cj(e,t){return t===`all`||e===t}function wj(e){var t=e.client,n=e.clientRect;return t.x>=n.x&&t.x<=n.x+n.width&&t.y>=n.y&&t.y<=n.y+n.height}function Tj(e){return e.getBoundingClientRect()}function Ej(e){var t=e.element,n=e.input,r=e.timeSinceLastFrame,i=e.engagement,a=e.config,o=e.allowedAxis,s=e.getRect,c=s===void 0?Tj:s,l={x:n.clientX,y:n.clientY},u=c(t),d=dj.reduce(function(e,n){var r=vj[n]({clientRect:u,config:a}),i=fj[n];return!Cj(i,o)||!wj({client:l,clientRect:r})||!uj[n](t)||e.set(n,{edge:n,hitbox:r}),e},new Map);return{left:function(){var e=`horizontal`,t=d.get(`left`);if(t)return Sj({client:l,edge:t.edge,hitbox:t.hitbox,axis:e,timeSinceLastFrame:r,engagement:i,isDistanceDampeningEnabled:!0,config:a});var n=d.get(`right`);return n?Sj({client:l,edge:n.edge,hitbox:n.hitbox,axis:e,timeSinceLastFrame:r,engagement:i,isDistanceDampeningEnabled:!0,config:a}):0}(),top:function(){var e=`vertical`,t=d.get(`bottom`);if(t)return Sj({client:l,edge:t.edge,hitbox:t.hitbox,axis:e,timeSinceLastFrame:r,engagement:i,isDistanceDampeningEnabled:!0,config:a});var n=d.get(`top`);return n?Sj({client:l,edge:n.edge,hitbox:n.hitbox,axis:e,timeSinceLastFrame:r,engagement:i,isDistanceDampeningEnabled:!0,config:a}):0}()}}function Dj(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(!n){if(Array.isArray(e)||(n=Oj(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
138
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||n.return==null||n.return()}finally{if(s)throw a}}}}function Oj(e,t){if(e){if(typeof e==`string`)return kj(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)?kj(e,t):void 0}}function kj(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 Aj(e){return!!(e.top||e.left)}function jj(e){var t=e.target,n=e.input,r=e.source,i=e.findEntry,a=e.timeSinceLastFrame,o=e.available,s=o===void 0?{top:!0,left:!0}:o;if(!Aj(s)||!t)return s;var c=t.closest(rj);if(!c)return s;var l=i(c);if(!l)return s;function u(){return jj({target:c?.parentElement??null,findEntry:i,source:r,timeSinceLastFrame:a,input:n,available:s})}var d={input:n,source:r,element:c};if(l.canScroll&&!l.canScroll(d))return u();var f=YA(c),p=lj(l.getConfiguration?.call(l,d)),m=Ej({element:c,engagement:f,input:n,timeSinceLastFrame:a,allowedAxis:l.getAllowedAxis?.call(l,d)??`all`,config:p}),h={top:0,left:0};return s.top&&m.top!==0&&(h.top=m.top,s.top=!1),s.left&&m.left!==0&&(h.left=m.left,s.left=!1),(h.top!==0||h.left!==0)&&c.scrollBy(h),u()}function Mj(e){var t=e.input,n=e.timeSinceLastFrame,r=e.available,i=e.source,a=e.entries,o=document.documentElement,s={input:t,source:i,element:o},c=Dj(a),l;try{for(c.s();!(l=c.n()).done;){var u=l.value;if(!(u.canScroll&&!u.canScroll(s))){var d=Ej({element:o,engagement:YA(o),input:t,config:lj(u.getConfiguration?.call(u,s)),allowedAxis:u.getAllowedAxis?.call(u,s)??`all`,getRect:function(e){return DOMRect.fromRect({y:0,x:0,width:e.clientWidth,height:e.clientHeight})},timeSinceLastFrame:n}),f={top:r.top?d.top:0,left:r.left?d.left:0};(f.top!==0||f.left!==0)&&o.scrollBy(f);break}}}catch(e){c.e(e)}finally{c.f()}}function Nj(e){var t=e.input,n=e.findEntry,r=e.timeSinceLastFrame,i=e.source,a=e.getWindowScrollEntries,o=e.underUsersPointer,s=jj({target:o,timeSinceLastFrame:r,input:t,source:i,findEntry:n});Aj(s)&&Mj({input:t,source:i,entries:a(),timeSinceLastFrame:r,available:s})}function Pj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Fj(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Pj(Object(n),!0).forEach(function(t){KO(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Pj(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Ij(e){var t=e.monitor,n=new Map,r=new Set;function i(e){return n.set(e.element,e),YO(Lk(ij(e.element),function(){return n.delete(e.element)}))}function a(){var e=Fj({},arguments.length>0&&arguments[0]!==void 0?arguments[0]:{});r.add(e);function t(){r.delete(e)}return YO(t)}function o(e){return n.get(e)??null}function s(){return Array.from(r)}function c(e){var t=e.latestArgs,n=e.underUsersPointer,r=e.timeSinceLastFrame;Nj({input:t.location.current.input,source:t.source,findEntry:o,underUsersPointer:n,timeSinceLastFrame:r,getWindowScrollEntries:s})}return ej(t).onFrame(c),{autoScroll:i,autoScrollWindow:a}}var Lj=Ij({monitor:cA}),Rj=Lj.autoScroll;Lj.autoScrollWindow;function zj(e,t){let n=n=>{let r=n.target,i=e.ownerDocument.activeElement;(r instanceof Element&&t(r)||i!==null&&e.contains(i)&&t(i))&&n.preventDefault()};return e.addEventListener(`dragstart`,n,!0),()=>e.removeEventListener(`dragstart`,n,!0)}export{fy as $,fn as $n,Fu as $t,Ow as A,Wc as An,Up as At,iw as B,Dr as Bn,Kd as Bt,Lw as C,q as Cn,jh as Ct,Nw as D,$c as Dn,Tm as Dt,Rw as E,qc as En,jm as Et,pw as F,Lr as Fn,hf as Ft,fx as G,pr as Gn,Pd as Gt,HC as H,Cr as Hn,zd as Ht,gw as I,Fr as In,pf as It,xb as J,Sn as Jn,$ as Jt,zb as K,lr as Kn,Nd as Kt,uw as L,Pr as Ln,af as Lt,Sw as M,Kr as Mn,xp as Mt,hw as N,Vr as Nn,Lf as Nt,jw as O,Uc as On,Cm as Ot,mw as P,Rr as Pn,Ff as Pt,py as Q,bn as Qn,Vu as Qt,sw as R,jr as Rn,tf as Rt,Mw as S,Pl as Sn,Nh as St,Iw as T,tl as Tn,Mm as Tt,gx as U,xr as Un,Id as Ut,ow as V,wr as Vn,Hd as Vt,mx as W,_r as Wn,Ad as Wt,by as X,Cn as Xn,Wu as Xt,Sy as Y,B as Yn,Qu as Yt,my as Z,hn as Zn,Z as Zt,EO as _,Vl as _n,mg as _t,FA as a,hu as an,V_ as at,Gw as b,Bl as bn,Rh as bt,bA as c,au as cn,z_ as ct,lA as d,X as dn,b_ as dt,Nu as en,uy as et,sA as f,Xl as fn,S_ as ft,OO as g,Hl as gn,gg as gt,AO as h,Gl as hn,Pg as ht,LA as i,fu as in,zv as it,Dw as j,G as jn,Op as jt,Aw as k,Bc as kn,fm as kt,mA as l,su as ln,I_ as lt,Lk as m,ql as mn,jg as mt,Rj as n,ku as nn,oy as nt,IA as o,lu as on,B_ as ot,cA as p,Jl as pn,qg as pt,Lb as q,Dn as qn,Fd as qt,KA as r,uu as rn,Vv as rt,yA as s,ou as sn,F_ as st,zj as t,Tu as tn,iy as tt,pA as u,cu as un,h_ as ut,DO as v,zl as vn,hg as vt,Fw as w,nl as wn,qm as wt,zw as x,Nl as xn,Ph as xt,AD as y,J as yn,qh as yt,aw as z,kr as zn,qd as zt};