@datnguyennnx/localterm 0.1.2 → 0.1.3
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.
|
@@ -117,5 +117,5 @@ WARNING: This link could potentially be dangerous`)){let e=window.open();if(e){t
|
|
|
117
117
|
`)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},a,o=yp,s=!ip.jitless,c=s&&bp.value,l=t.catchall,u;e._zod.parse=(d,f)=>{u??=r.value;let p=d.value;return o(p)?s&&c&&f?.async===!1&&f.jitless!==!0?(a||=i(t.shape),d=a(d,f),l?Bh([],p,d,f,u,e):d):n(d,f):(d.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),d)}});function Uh(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!Ip(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>zp(e,r,ap())))}),t)}var Wh=Y(`$ZodUnion`,(e,t)=>{nh.init(e,t),pp(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),pp(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),pp(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),pp(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>up(e.source)).join(`|`)})$`)}});let n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(i,a)=>{if(n)return r(i,a);let o=!1,s=[];for(let e of t.options){let t=e._zod.run({value:i.value,issues:[]},a);if(t instanceof Promise)s.push(t),o=!0;else{if(t.issues.length===0)return t;s.push(t)}}return o?Promise.all(s).then(t=>Uh(t,i,e,a)):Uh(s,i,e,a)}}),Gh=Y(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,Wh.init(e,t);let n=e._zod.parse;pp(e._zod,`propValues`,()=>{let e={};for(let n of t.options){let r=n._zod.propValues;if(!r||Object.keys(r).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let[t,n]of Object.entries(r)){e[t]||(e[t]=new Set);for(let r of n)e[t].add(r)}}return e});let r=cp(()=>{let e=t.options,n=new Map;for(let r of e){let e=r._zod.propValues?.[t.discriminator];if(!e||e.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let t of e){if(n.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(i,a)=>{let o=i.value;if(!yp(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=r.value.get(o?.[t.discriminator]);return s?s._zod.run(i,a):t.unionFallback?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,input:o,path:[t.discriminator],inst:e}),i)}}),Kh=Y(`$ZodIntersection`,(e,t)=>{nh.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>Jh(e,t,n)):Jh(e,i,a)}});function qh(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(xp(e)&&xp(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=qh(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=qh(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Jh(e,t,n){let r=new Map,i;for(let n of t.issues)if(n.code===`unrecognized_keys`){i??=n;for(let e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(let t of n.issues)if(t.code===`unrecognized_keys`)for(let e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);let a=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&i&&e.issues.push({...i,keys:a}),Ip(e))return e;let o=qh(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}var Yh=Y(`$ZodRecord`,(e,t)=>{nh.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!xp(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let a=[],o=t.keyType._zod.values;if(o){n.value={};let s=new Set;for(let e of o)if(typeof e==`string`||typeof e==`number`||typeof e==`symbol`){s.add(typeof e==`number`?e.toString():e);let o=t.valueType._zod.run({value:i[e],issues:[]},r);o instanceof Promise?a.push(o.then(t=>{t.issues.length&&n.issues.push(...Lp(e,t.issues)),n.value[e]=t.value})):(o.issues.length&&n.issues.push(...Lp(e,o.issues)),n.value[e]=o.value)}let c;for(let e in i)s.has(e)||(c??=[],c.push(e));c&&c.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:c})}else{n.value={};for(let o of Reflect.ownKeys(i)){if(o===`__proto__`)continue;let s=t.keyType._zod.run({value:o,issues:[]},r);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof o==`string`&&Nm.test(o)&&s.issues.length){let e=t.keyType._zod.run({value:Number(o),issues:[]},r);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(s=e)}if(s.issues.length){t.mode===`loose`?n.value[o]=i[o]:n.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>zp(e,r,ap())),input:o,path:[o],inst:e});continue}let c=t.valueType._zod.run({value:i[o],issues:[]},r);c instanceof Promise?a.push(c.then(e=>{e.issues.length&&n.issues.push(...Lp(o,e.issues)),n.value[s.value]=e.value})):(c.issues.length&&n.issues.push(...Lp(o,c.issues)),n.value[s.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),Xh=Y(`$ZodEnum`,(e,t)=>{nh.init(e,t);let n=op(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>Cp.has(typeof e)).map(e=>typeof e==`string`?wp(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),Zh=Y(`$ZodLiteral`,(e,t)=>{if(nh.init(e,t),t.values.length===0)throw Error(`Cannot create literal schema with no valid values`);let n=new Set(t.values);e._zod.values=n,e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?wp(e):e?wp(e.toString()):String(e)).join(`|`)})$`),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),Qh=Y(`$ZodTransform`,(e,t)=>{nh.init(e,t),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new rp(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new np;return n.value=i,n}});function $h(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}var eg=Y(`$ZodOptional`,(e,t)=>{nh.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,pp(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),pp(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${up(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>$h(t,e.value)):$h(r,e.value)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),tg=Y(`$ZodExactOptional`,(e,t)=>{eg.init(e,t),pp(e._zod,`values`,()=>t.innerType._zod.values),pp(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),ng=Y(`$ZodNullable`,(e,t)=>{nh.init(e,t),pp(e._zod,`optin`,()=>t.innerType._zod.optin),pp(e._zod,`optout`,()=>t.innerType._zod.optout),pp(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${up(e.source)}|null)$`):void 0}),pp(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),rg=Y(`$ZodDefault`,(e,t)=>{nh.init(e,t),e._zod.optin=`optional`,pp(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>ig(e,t)):ig(r,t)}});function ig(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var ag=Y(`$ZodPrefault`,(e,t)=>{nh.init(e,t),e._zod.optin=`optional`,pp(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),og=Y(`$ZodNonOptional`,(e,t)=>{nh.init(e,t),pp(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>sg(t,e)):sg(i,e)}});function sg(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}var cg=Y(`$ZodCatch`,(e,t)=>{nh.init(e,t),pp(e._zod,`optin`,()=>t.innerType._zod.optin),pp(e._zod,`optout`,()=>t.innerType._zod.optout),pp(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>zp(e,n,ap()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>zp(e,n,ap()))},input:e.value}),e.issues=[]),e)}}),lg=Y(`$ZodPipe`,(e,t)=>{nh.init(e,t),pp(e._zod,`values`,()=>t.in._zod.values),pp(e._zod,`optin`,()=>t.in._zod.optin),pp(e._zod,`optout`,()=>t.out._zod.optout),pp(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>ug(e,t.in,n)):ug(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>ug(e,t.out,n)):ug(r,t.out,n)}});function ug(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var dg=Y(`$ZodReadonly`,(e,t)=>{nh.init(e,t),pp(e._zod,`propValues`,()=>t.innerType._zod.propValues),pp(e._zod,`values`,()=>t.innerType._zod.values),pp(e._zod,`optin`,()=>t.innerType?._zod?.optin),pp(e._zod,`optout`,()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(fg):fg(r)}});function fg(e){return e.value=Object.freeze(e.value),e}var pg=Y(`$ZodCustom`,(e,t)=>{Lm.init(e,t),nh.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>mg(t,n,r,e));mg(i,n,r,e)}});function mg(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(Vp(e))}}var hg,gg=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function _g(){return new gg}(hg=globalThis).__zod_globalRegistry??(hg.__zod_globalRegistry=_g());var vg=globalThis.__zod_globalRegistry;function yg(e,t){return new e({type:`string`,...Ep(t)})}function bg(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...Ep(t)})}function xg(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...Ep(t)})}function Sg(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...Ep(t)})}function Cg(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...Ep(t)})}function wg(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...Ep(t)})}function Tg(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...Ep(t)})}function Eg(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...Ep(t)})}function Dg(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...Ep(t)})}function Og(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...Ep(t)})}function kg(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...Ep(t)})}function Ag(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...Ep(t)})}function jg(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...Ep(t)})}function Mg(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...Ep(t)})}function Ng(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...Ep(t)})}function Pg(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...Ep(t)})}function Fg(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...Ep(t)})}function Ig(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...Ep(t)})}function Lg(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...Ep(t)})}function Rg(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...Ep(t)})}function zg(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...Ep(t)})}function Bg(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...Ep(t)})}function Vg(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...Ep(t)})}function Hg(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...Ep(t)})}function Ug(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...Ep(t)})}function Wg(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...Ep(t)})}function Gg(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...Ep(t)})}function Kg(e,t){return new e({type:`number`,checks:[],...Ep(t)})}function qg(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...Ep(t)})}function Jg(e,t){return new e({type:`boolean`,...Ep(t)})}function Yg(e){return new e({type:`unknown`})}function Xg(e,t){return new e({type:`never`,...Ep(t)})}function Zg(e,t){return new zm({check:`less_than`,...Ep(t),value:e,inclusive:!1})}function Qg(e,t){return new zm({check:`less_than`,...Ep(t),value:e,inclusive:!0})}function $g(e,t){return new Bm({check:`greater_than`,...Ep(t),value:e,inclusive:!1})}function e_(e,t){return new Bm({check:`greater_than`,...Ep(t),value:e,inclusive:!0})}function t_(e,t){return new Vm({check:`multiple_of`,...Ep(t),value:e})}function n_(e,t){return new Um({check:`max_length`,...Ep(t),maximum:e})}function r_(e,t){return new Wm({check:`min_length`,...Ep(t),minimum:e})}function i_(e,t){return new Gm({check:`length_equals`,...Ep(t),length:e})}function a_(e,t){return new qm({check:`string_format`,format:`regex`,...Ep(t),pattern:e})}function o_(e){return new Jm({check:`string_format`,format:`lowercase`,...Ep(e)})}function s_(e){return new Ym({check:`string_format`,format:`uppercase`,...Ep(e)})}function c_(e,t){return new Xm({check:`string_format`,format:`includes`,...Ep(t),includes:e})}function l_(e,t){return new Zm({check:`string_format`,format:`starts_with`,...Ep(t),prefix:e})}function u_(e,t){return new Qm({check:`string_format`,format:`ends_with`,...Ep(t),suffix:e})}function d_(e){return new $m({check:`overwrite`,tx:e})}function f_(e){return d_(t=>t.normalize(e))}function p_(){return d_(e=>e.trim())}function m_(){return d_(e=>e.toLowerCase())}function h_(){return d_(e=>e.toUpperCase())}function g_(){return d_(e=>_p(e))}function __(e,t,n){return new e({type:`array`,element:t,...Ep(n)})}function v_(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...Ep(n)})}function y_(e){let t=b_(n=>(n.addIssue=e=>{if(typeof e==`string`)n.issues.push(Vp(e,n.value,t._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=n.value,r.inst??=t,r.continue??=!t._zod.def.abort,n.issues.push(Vp(r))}},e(n.value,n)));return t}function b_(e,t){let n=new Lm({check:`custom`,...Ep(t)});return n._zod.check=e,n}function x_(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??vg,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,external:e?.external??void 0}}function S_(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,S_(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),t.io===`input`&&T_(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&o.schema._prefault&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function C_(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${a}`}}if(t[1]===n)return{ref:`#`};let i=`#/${r}/`,a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+a}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
|
|
118
118
|
|
|
119
119
|
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function w_(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e===`$ref`||e===`allOf`||e in a||delete i[e];if(s.$ref&&n.def)for(let e in i)e===`$ref`||e===`allOf`||e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e===`$ref`||e===`allOf`||e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(a[e.defId]=e.def)}e.external||Object.keys(a).length>0&&(e.target===`draft-2020-12`?i.$defs=a:i.definitions=a);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,`~standard`,{value:{...t[`~standard`],jsonSchema:{input:D_(t,`input`,e.processors),output:D_(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function T_(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return T_(r.element,n);if(r.type===`set`)return T_(r.valueType,n);if(r.type===`lazy`)return T_(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type===`default`||r.type===`prefault`)return T_(r.innerType,n);if(r.type===`intersection`)return T_(r.left,n)||T_(r.right,n);if(r.type===`record`||r.type===`map`)return T_(r.keyType,n)||T_(r.valueType,n);if(r.type===`pipe`)return T_(r.in,n)||T_(r.out,n);if(r.type===`object`){for(let e in r.shape)if(T_(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(T_(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(T_(e,n))return!0;return!!(r.rest&&T_(r.rest,n))}return!1}var E_=(e,t={})=>n=>{let r=x_({...n,processors:t});return S_(e,r),C_(r,e),w_(r,e)},D_=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=x_({...i??{},target:a,io:t,processors:n});return S_(e,o),C_(o,e),w_(o,e)},O_={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},k_=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=O_[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},A_=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;typeof s==`string`&&s.includes(`int`)?i.type=`integer`:i.type=`number`,typeof u==`number`&&(t.target===`draft-04`||t.target===`openapi-3.0`?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u),typeof a==`number`&&(i.minimum=a,typeof u==`number`&&t.target!==`draft-04`&&(u>=a?delete i.minimum:delete i.exclusiveMinimum)),typeof l==`number`&&(t.target===`draft-04`||t.target===`openapi-3.0`?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l),typeof o==`number`&&(i.maximum=o,typeof l==`number`&&t.target!==`draft-04`&&(l<=o?delete i.maximum:delete i.exclusiveMaximum)),typeof c==`number`&&(i.multipleOf=c)},j_=(e,t,n,r)=>{n.type=`boolean`},M_=(e,t,n,r)=>{n.not={}},N_=(e,t,n,r)=>{let i=e._zod.def,a=op(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},P_=(e,t,n,r)=>{let i=e._zod.def,a=[];for(let e of i.values)if(e===void 0){if(t.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(t.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);a.push(Number(e))}else a.push(e);if(a.length!==0)if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a},F_=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},I_=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},L_=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=S_(a.element,t,{...r,path:[...r.path,`items`]})},R_=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=S_(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=S_(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},z_=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>S_(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},B_=(e,t,n,r)=>{let i=e._zod.def,a=S_(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=S_(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},V_=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=o._zod.bag?.patterns;if(a.mode===`loose`&&s&&s.size>0){let e=S_(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)i.patternProperties[t.source]=e}else (t.target===`draft-07`||t.target===`draft-2020-12`)&&(i.propertyNames=S_(a.keyType,t,{...r,path:[...r.path,`propertyNames`]})),i.additionalProperties=S_(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]});let c=o._zod.values;if(c){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e)}},H_=(e,t,n,r)=>{let i=e._zod.def,a=S_(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},U_=(e,t,n,r)=>{let i=e._zod.def;S_(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},W_=(e,t,n,r)=>{let i=e._zod.def;S_(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},G_=(e,t,n,r)=>{let i=e._zod.def;S_(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},K_=(e,t,n,r)=>{let i=e._zod.def;S_(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},q_=(e,t,n,r)=>{let i=e._zod.def,a=t.io===`input`?i.in._zod.def.type===`transform`?i.out:i.in:i.out;S_(a,t,r);let o=t.seen.get(e);o.ref=a},J_=(e,t,n,r)=>{let i=e._zod.def;S_(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Y_=(e,t,n,r)=>{let i=e._zod.def;S_(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},X_=Y(`ZodISODateTime`,(e,t)=>{gh.init(e,t),Sv.init(e,t)});function Z_(e){return Hg(X_,e)}var Q_=Y(`ZodISODate`,(e,t)=>{_h.init(e,t),Sv.init(e,t)});function $_(e){return Ug(Q_,e)}var ev=Y(`ZodISOTime`,(e,t)=>{vh.init(e,t),Sv.init(e,t)});function tv(e){return Wg(ev,e)}var nv=Y(`ZodISODuration`,(e,t)=>{yh.init(e,t),Sv.init(e,t)});function rv(e){return Gg(nv,e)}var iv=(e,t)=>{Up.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>Kp(e,t)},flatten:{value:t=>Gp(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,sp,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,sp,2)}},isEmpty:{get(){return e.issues.length===0}}})};Y(`ZodError`,iv);var av=Y(`ZodError`,iv,{Parent:Error}),ov=qp(av),sv=Jp(av),cv=Yp(av),lv=Zp(av),uv=$p(av),dv=em(av),fv=tm(av),pv=nm(av),mv=rm(av),hv=im(av),gv=am(av),_v=om(av),vv=Y(`ZodType`,(e,t)=>(nh.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:D_(e,`input`),output:D_(e,`output`)}}),e.toJSONSchema=E_(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,`_def`,{value:t}),e.check=(...n)=>e.clone(hp(t,{checks:[...t.checks??[],...n.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0}),e.with=e.check,e.clone=(t,n)=>Tp(e,t,n),e.brand=()=>e,e.register=((t,n)=>(t.add(e,n),e)),e.parse=(t,n)=>ov(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>cv(e,t,n),e.parseAsync=async(t,n)=>sv(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>lv(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>uv(e,t,n),e.decode=(t,n)=>dv(e,t,n),e.encodeAsync=async(t,n)=>fv(e,t,n),e.decodeAsync=async(t,n)=>pv(e,t,n),e.safeEncode=(t,n)=>mv(e,t,n),e.safeDecode=(t,n)=>hv(e,t,n),e.safeEncodeAsync=async(t,n)=>gv(e,t,n),e.safeDecodeAsync=async(t,n)=>_v(e,t,n),e.refine=(t,n)=>e.check(Fy(t,n)),e.superRefine=t=>e.check(Iy(t)),e.overwrite=t=>e.check(d_(t)),e.optional=()=>_y(e),e.exactOptional=()=>yy(e),e.nullable=()=>xy(e),e.nullish=()=>_y(xy(e)),e.nonoptional=t=>Dy(e,t),e.array=()=>$v(e),e.or=t=>ry([e,t]),e.and=t=>sy(e,t),e.transform=t=>jy(e,hy(t)),e.default=t=>Cy(e,t),e.prefault=t=>Ty(e,t),e.catch=t=>ky(e,t),e.pipe=t=>jy(e,t),e.readonly=()=>Ny(e),e.describe=t=>{let n=e.clone();return vg.add(n,{description:t}),n},Object.defineProperty(e,`description`,{get(){return vg.get(e)?.description},configurable:!0}),e.meta=(...t)=>{if(t.length===0)return vg.get(e);let n=e.clone();return vg.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=t=>t(e),e)),yv=Y(`_ZodString`,(e,t)=>{rh.init(e,t),vv.init(e,t),e._zod.processJSONSchema=(t,n,r)=>k_(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(a_(...t)),e.includes=(...t)=>e.check(c_(...t)),e.startsWith=(...t)=>e.check(l_(...t)),e.endsWith=(...t)=>e.check(u_(...t)),e.min=(...t)=>e.check(r_(...t)),e.max=(...t)=>e.check(n_(...t)),e.length=(...t)=>e.check(i_(...t)),e.nonempty=(...t)=>e.check(r_(1,...t)),e.lowercase=t=>e.check(o_(t)),e.uppercase=t=>e.check(s_(t)),e.trim=()=>e.check(p_()),e.normalize=(...t)=>e.check(f_(...t)),e.toLowerCase=()=>e.check(m_()),e.toUpperCase=()=>e.check(h_()),e.slugify=()=>e.check(g_())}),bv=Y(`ZodString`,(e,t)=>{rh.init(e,t),yv.init(e,t),e.email=t=>e.check(bg(Cv,t)),e.url=t=>e.check(Eg(Ev,t)),e.jwt=t=>e.check(Vg(Vv,t)),e.emoji=t=>e.check(Dg(Dv,t)),e.guid=t=>e.check(xg(wv,t)),e.uuid=t=>e.check(Sg(Tv,t)),e.uuidv4=t=>e.check(Cg(Tv,t)),e.uuidv6=t=>e.check(wg(Tv,t)),e.uuidv7=t=>e.check(Tg(Tv,t)),e.nanoid=t=>e.check(Og(Ov,t)),e.guid=t=>e.check(xg(wv,t)),e.cuid=t=>e.check(kg(kv,t)),e.cuid2=t=>e.check(Ag(Av,t)),e.ulid=t=>e.check(jg(jv,t)),e.base64=t=>e.check(Rg(Rv,t)),e.base64url=t=>e.check(zg(zv,t)),e.xid=t=>e.check(Mg(Mv,t)),e.ksuid=t=>e.check(Ng(Nv,t)),e.ipv4=t=>e.check(Pg(Pv,t)),e.ipv6=t=>e.check(Fg(Fv,t)),e.cidrv4=t=>e.check(Ig(Iv,t)),e.cidrv6=t=>e.check(Lg(Lv,t)),e.e164=t=>e.check(Bg(Bv,t)),e.datetime=t=>e.check(Z_(t)),e.date=t=>e.check($_(t)),e.time=t=>e.check(tv(t)),e.duration=t=>e.check(rv(t))});function xv(e){return yg(bv,e)}var Sv=Y(`ZodStringFormat`,(e,t)=>{ih.init(e,t),yv.init(e,t)}),Cv=Y(`ZodEmail`,(e,t)=>{sh.init(e,t),Sv.init(e,t)}),wv=Y(`ZodGUID`,(e,t)=>{ah.init(e,t),Sv.init(e,t)}),Tv=Y(`ZodUUID`,(e,t)=>{oh.init(e,t),Sv.init(e,t)}),Ev=Y(`ZodURL`,(e,t)=>{ch.init(e,t),Sv.init(e,t)}),Dv=Y(`ZodEmoji`,(e,t)=>{lh.init(e,t),Sv.init(e,t)}),Ov=Y(`ZodNanoID`,(e,t)=>{uh.init(e,t),Sv.init(e,t)}),kv=Y(`ZodCUID`,(e,t)=>{dh.init(e,t),Sv.init(e,t)}),Av=Y(`ZodCUID2`,(e,t)=>{fh.init(e,t),Sv.init(e,t)}),jv=Y(`ZodULID`,(e,t)=>{ph.init(e,t),Sv.init(e,t)}),Mv=Y(`ZodXID`,(e,t)=>{mh.init(e,t),Sv.init(e,t)}),Nv=Y(`ZodKSUID`,(e,t)=>{hh.init(e,t),Sv.init(e,t)}),Pv=Y(`ZodIPv4`,(e,t)=>{bh.init(e,t),Sv.init(e,t)}),Fv=Y(`ZodIPv6`,(e,t)=>{xh.init(e,t),Sv.init(e,t)}),Iv=Y(`ZodCIDRv4`,(e,t)=>{Sh.init(e,t),Sv.init(e,t)}),Lv=Y(`ZodCIDRv6`,(e,t)=>{Ch.init(e,t),Sv.init(e,t)}),Rv=Y(`ZodBase64`,(e,t)=>{Th.init(e,t),Sv.init(e,t)}),zv=Y(`ZodBase64URL`,(e,t)=>{Dh.init(e,t),Sv.init(e,t)}),Bv=Y(`ZodE164`,(e,t)=>{Oh.init(e,t),Sv.init(e,t)}),Vv=Y(`ZodJWT`,(e,t)=>{Ah.init(e,t),Sv.init(e,t)}),Hv=Y(`ZodNumber`,(e,t)=>{jh.init(e,t),vv.init(e,t),e._zod.processJSONSchema=(t,n,r)=>A_(e,t,n,r),e.gt=(t,n)=>e.check($g(t,n)),e.gte=(t,n)=>e.check(e_(t,n)),e.min=(t,n)=>e.check(e_(t,n)),e.lt=(t,n)=>e.check(Zg(t,n)),e.lte=(t,n)=>e.check(Qg(t,n)),e.max=(t,n)=>e.check(Qg(t,n)),e.int=t=>e.check(Gv(t)),e.safe=t=>e.check(Gv(t)),e.positive=t=>e.check($g(0,t)),e.nonnegative=t=>e.check(e_(0,t)),e.negative=t=>e.check(Zg(0,t)),e.nonpositive=t=>e.check(Qg(0,t)),e.multipleOf=(t,n)=>e.check(t_(t,n)),e.step=(t,n)=>e.check(t_(t,n)),e.finite=()=>e;let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function Uv(e){return Kg(Hv,e)}var Wv=Y(`ZodNumberFormat`,(e,t)=>{Mh.init(e,t),Hv.init(e,t)});function Gv(e){return qg(Wv,e)}var Kv=Y(`ZodBoolean`,(e,t)=>{Nh.init(e,t),vv.init(e,t),e._zod.processJSONSchema=(t,n,r)=>j_(e,t,n,r)});function qv(e){return Jg(Kv,e)}var Jv=Y(`ZodUnknown`,(e,t)=>{Ph.init(e,t),vv.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Yv(){return Yg(Jv)}var Xv=Y(`ZodNever`,(e,t)=>{Fh.init(e,t),vv.init(e,t),e._zod.processJSONSchema=(t,n,r)=>M_(e,t,n,r)});function Zv(e){return Xg(Xv,e)}var Qv=Y(`ZodArray`,(e,t)=>{Lh.init(e,t),vv.init(e,t),e._zod.processJSONSchema=(t,n,r)=>L_(e,t,n,r),e.element=t.element,e.min=(t,n)=>e.check(r_(t,n)),e.nonempty=t=>e.check(r_(1,t)),e.max=(t,n)=>e.check(n_(t,n)),e.length=(t,n)=>e.check(i_(t,n)),e.unwrap=()=>e.element});function $v(e,t){return __(Qv,e,t)}var ey=Y(`ZodObject`,(e,t)=>{Hh.init(e,t),vv.init(e,t),e._zod.processJSONSchema=(t,n,r)=>R_(e,t,n,r),pp(e,`shape`,()=>t.shape),e.keyof=()=>dy(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Yv()}),e.loose=()=>e.clone({...e._zod.def,catchall:Yv()}),e.strict=()=>e.clone({...e._zod.def,catchall:Zv()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>jp(e,t),e.safeExtend=t=>Mp(e,t),e.merge=t=>Np(e,t),e.pick=t=>kp(e,t),e.omit=t=>Ap(e,t),e.partial=(...t)=>Pp(gy,e,t[0]),e.required=(...t)=>Fp(Ey,e,t[0])});function ty(e,t){return new ey({type:`object`,shape:e??{},...Ep(t)})}var ny=Y(`ZodUnion`,(e,t)=>{Wh.init(e,t),vv.init(e,t),e._zod.processJSONSchema=(t,n,r)=>z_(e,t,n,r),e.options=t.options});function ry(e,t){return new ny({type:`union`,options:e,...Ep(t)})}var iy=Y(`ZodDiscriminatedUnion`,(e,t)=>{ny.init(e,t),Gh.init(e,t)});function ay(e,t,n){return new iy({type:`union`,options:t,discriminator:e,...Ep(n)})}var oy=Y(`ZodIntersection`,(e,t)=>{Kh.init(e,t),vv.init(e,t),e._zod.processJSONSchema=(t,n,r)=>B_(e,t,n,r)});function sy(e,t){return new oy({type:`intersection`,left:e,right:t})}var cy=Y(`ZodRecord`,(e,t)=>{Yh.init(e,t),vv.init(e,t),e._zod.processJSONSchema=(t,n,r)=>V_(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function ly(e,t,n){return new cy({type:`record`,keyType:e,valueType:t,...Ep(n)})}var uy=Y(`ZodEnum`,(e,t)=>{Xh.init(e,t),vv.init(e,t),e._zod.processJSONSchema=(t,n,r)=>N_(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new uy({...t,checks:[],...Ep(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new uy({...t,checks:[],...Ep(r),entries:i})}});function dy(e,t){return new uy({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...Ep(t)})}var fy=Y(`ZodLiteral`,(e,t)=>{Zh.init(e,t),vv.init(e,t),e._zod.processJSONSchema=(t,n,r)=>P_(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,`value`,{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function py(e,t){return new fy({type:`literal`,values:Array.isArray(e)?e:[e],...Ep(t)})}var my=Y(`ZodTransform`,(e,t)=>{Qh.init(e,t),vv.init(e,t),e._zod.processJSONSchema=(t,n,r)=>I_(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new rp(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Vp(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(Vp(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function hy(e){return new my({type:`transform`,transform:e})}var gy=Y(`ZodOptional`,(e,t)=>{eg.init(e,t),vv.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Y_(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function _y(e){return new gy({type:`optional`,innerType:e})}var vy=Y(`ZodExactOptional`,(e,t)=>{tg.init(e,t),vv.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Y_(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function yy(e){return new vy({type:`optional`,innerType:e})}var by=Y(`ZodNullable`,(e,t)=>{ng.init(e,t),vv.init(e,t),e._zod.processJSONSchema=(t,n,r)=>H_(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function xy(e){return new by({type:`nullable`,innerType:e})}var Sy=Y(`ZodDefault`,(e,t)=>{rg.init(e,t),vv.init(e,t),e._zod.processJSONSchema=(t,n,r)=>W_(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Cy(e,t){return new Sy({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():Sp(t)}})}var wy=Y(`ZodPrefault`,(e,t)=>{ag.init(e,t),vv.init(e,t),e._zod.processJSONSchema=(t,n,r)=>G_(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ty(e,t){return new wy({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():Sp(t)}})}var Ey=Y(`ZodNonOptional`,(e,t)=>{og.init(e,t),vv.init(e,t),e._zod.processJSONSchema=(t,n,r)=>U_(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Dy(e,t){return new Ey({type:`nonoptional`,innerType:e,...Ep(t)})}var Oy=Y(`ZodCatch`,(e,t)=>{cg.init(e,t),vv.init(e,t),e._zod.processJSONSchema=(t,n,r)=>K_(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function ky(e,t){return new Oy({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var Ay=Y(`ZodPipe`,(e,t)=>{lg.init(e,t),vv.init(e,t),e._zod.processJSONSchema=(t,n,r)=>q_(e,t,n,r),e.in=t.in,e.out=t.out});function jy(e,t){return new Ay({type:`pipe`,in:e,out:t})}var My=Y(`ZodReadonly`,(e,t)=>{dg.init(e,t),vv.init(e,t),e._zod.processJSONSchema=(t,n,r)=>J_(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ny(e){return new My({type:`readonly`,innerType:e})}var Py=Y(`ZodCustom`,(e,t)=>{pg.init(e,t),vv.init(e,t),e._zod.processJSONSchema=(t,n,r)=>F_(e,t,n,r)});function Fy(e,t={}){return v_(Py,e,t)}function Iy(e){return y_(e)}ty({ok:qv(),sessions:Uv().int().nonnegative()}).strict(),ay(`type`,[ty({type:py(`input`),data:xv().max(Zf)}).strict(),ty({type:py(`resize`),cols:Uv().int().positive().max(ep),rows:Uv().int().positive().max(tp)}).strict(),ty({type:py(`flow-pause`)}).strict(),ty({type:py(`flow-resume`)}).strict(),ty({type:py(`rpc`),id:xv().min(1).max(64),method:dy([`spawn_session`,`list_sessions`,`write_input`,`read_output`,`wait_for_boundary`,`exec`]),params:ly(xv(),Yv()).optional()}).strict()]),ay(`type`,[ty({type:py(`output`),data:xv().max(Qf)}).strict(),ty({type:py(`exit`),code:Uv().int().nullable()}).strict(),ty({type:py(`title`),title:xv().max($f)}).strict(),ty({type:py(`session`),shell:xv().min(1),shellName:xv().min(1),pid:Uv().int().nonnegative(),cwd:xv().min(1)}).strict(),ty({type:py(`cwd`),cwd:xv().min(1)}).strict(),ty({type:py(`agent-output`),text:xv().max(Qf)}).strict(),ty({type:py(`command-boundary`),phase:dy([`prompt-start`,`command-start`,`output-start`,`command-end`]),exitCode:Uv().int().optional()}).strict(),ty({type:py(`rpc-response`),id:xv().min(1).max(64),result:Yv().optional(),error:xv().optional()}).strict()]);var Ly=e=>typeof e==`string`?e.length:e.byteLength,Ry=e=>{let t=new URL(`/ws`,window.location.href);t.protocol=t.protocol===`https:`?`wss:`:`ws:`;let n=e??new URLSearchParams(window.location.search).get(`cwd`);return n&&t.searchParams.set(`cwd`,n),t.toString()},zy=e=>{let t=new URL(window.location.origin);return e&&t.searchParams.set(`cwd`,e),t.toString()},By=e=>{let t=0,n=0,r=!1,i=t=>{if(e.hasScrollRestore()){e.restoreScrollFromResize();return}t.wasAtBottom&&e.restoreScrollAnchor(t)};return{write:a=>{if(e.isExited())return;let o=e.captureScrollAnchor(),s=Ly(a),c=t;t+=s,!r&&n>=4&&(e.sendFlowPause(),r=!0),e.terminalWrite(a,()=>{n=Math.max(0,n-1),r&&n<1&&(e.sendFlowResume(),r=!1),i(o)}),n++,c<131072&&t>=131072&&(t=0)},clear:()=>{t=0,n=0,r=!1}}},Vy=(e,t)=>`\x1b[${e};${t+1}u`,Hy=e=>!!e.shiftKey|(e.altKey?2:0)|(e.ctrlKey?4:0)|(e.metaKey?8:0),Uy=(e,t)=>t.buffer.active.type!==`alternate`||t.modes.mouseTrackingMode!==`none`?!1:e.deltaMode===WheelEvent.DOM_DELTA_PIXEL,Wy=e=>{let t=[0];return e.parser.registerCsiHandler({prefix:`>`,final:`u`},e=>{let n=e[0],r=typeof n==`number`?n:1;return t.push(r),!0}),e.parser.registerCsiHandler({prefix:`<`,final:`u`},e=>{let n=e[0],r=typeof n==`number`&&n>0?n:1;for(let e=0;e<r&&t.length>1;e+=1)t.pop();return!0}),e.parser.registerCsiHandler({prefix:`=`,final:`u`},e=>{let n=e[0],r=e[1];if(typeof n!=`number`)return!0;let i=n,a=typeof r==`number`&&r>0?r:1,o=t.length-1,s=t[o]??0;return a===1?t[o]=i:a===2?t[o]=s|i:a===3&&(t[o]=s&~i),!0}),{getFlags:()=>t[t.length-1]??0}},Gy=(e,t)=>{e.attachCustomKeyEventHandler(e=>{if(e.key===`Tab`&&(e.metaKey||e.ctrlKey))return!1;if(Wd(e,t.isMac))return e.type===`keydown`&&(e.preventDefault(),t.openFindOverlay()),!1;if(e.type===`keydown`&&e.key===`Enter`){let n=Hy(e),r=(t.getKittyFlags()&1)!=0;if(n!==0&&r)return e.preventDefault(),t.sendInput(Vy(13,n)),!1;if(n===1)return e.preventDefault(),t.sendInput(`
|
|
120
|
-
`),!1}return!0})},Ky=e=>{e.attachCustomWheelEventHandler(t=>Uy(t,e)?(t.preventDefault(),!1):!0)},qy=e=>{let t=e.buffer.active,n=Math.max(0,t.baseY-t.viewportY);return{distanceFromBottom:n,wasAtBottom:n===0}},Jy=(e,t)=>{if(t.wasAtBottom){e.scrollToBottom();return}let n=e.buffer.active,r=Math.max(0,n.baseY-t.distanceFromBottom)-n.viewportY;r!==0&&e.scrollLines(r)},Yy=(e,t)=>{let n=e.buffer.active,r=Math.max(0,n.baseY-n.viewportY),i=r===0;try{t.fit()}catch{return!1}try{if(i)return e.scrollToBottom(),!0;let t=e.buffer.active;if(r>t.baseY)return e.scrollToBottom(),!0;let n=Math.max(0,t.baseY-r)-t.viewportY;n!==0&&e.scrollLines(n)}catch{}return!0},Xy=e=>{let t=null,n=null,r=null,i=()=>qy(e.terminal),a=t=>{Jy(e.terminal,t)},o=()=>{r&&window.clearTimeout(r.timer),n!==null&&(window.cancelAnimationFrame(n),n=null),r=null},s=()=>{if(r){if(Date.now()>r.expiresAtMs){o();return}a(r.anchor)}},c=e=>{o();let t=window.setTimeout(()=>{s(),r=null},nd);r={anchor:e,expiresAtMs:Date.now()+nd,timer:t},n=window.requestAnimationFrame(()=>{n=null,s()})},l=()=>{let t=i();Yy(e.terminal,e.fitAddon)&&c(t)};return{captureAnchor:i,restoreAnchor:a,fitToContainer:l,scheduleFit:()=>{t!==null&&window.clearTimeout(t),t=window.setTimeout(()=>{t=null,l()},e.resizeDebounceMs)},beginResizeScrollRestore:c,clearResizeScrollRestore:o,restoreResizeScroll:s,hasResizeRestore:()=>r!==null,cleanupResizeScroll:()=>{t!==null&&window.clearTimeout(t),o()}}},Zy=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),Qy=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),$y=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),eb=e=>{let t=$y(e);return t.charAt(0).toUpperCase()+t.slice(1)},tb={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},nb=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},rb=(0,b.createContext)({}),ib=()=>(0,b.useContext)(rb),ab=(0,b.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=ib()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,b.createElement)(`svg`,{ref:c,...tb,width:t??l??tb.width,height:t??l??tb.height,stroke:e??f,strokeWidth:m,className:Zy(`lucide`,p,i),...!a&&!nb(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,b.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),ob=(e,t)=>{let n=(0,b.forwardRef)(({className:n,...r},i)=>(0,b.createElement)(ab,{ref:i,iconNode:t,className:Zy(`lucide-${Qy(eb(e))}`,`lucide-${e}`,n),...r}));return n.displayName=eb(e),n},sb=ob(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),cb=ob(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),lb=ob(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),ub=ob(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),db=ob(`loader`,[[`path`,{d:`M12 2v4`,key:`3427ic`}],[`path`,{d:`m16.2 7.8 2.9-2.9`,key:`r700ao`}],[`path`,{d:`M18 12h4`,key:`wj9ykh`}],[`path`,{d:`m16.2 16.2 2.9 2.9`,key:`1bxg5t`}],[`path`,{d:`M12 18v4`,key:`jadmvz`}],[`path`,{d:`m4.9 19.1 2.9-2.9`,key:`bwix9q`}],[`path`,{d:`M2 12h4`,key:`j09sii`}],[`path`,{d:`m4.9 4.9 2.9 2.9`,key:`giyufr`}]]),fb=ob(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),pb=ob(`monitor-cog`,[[`path`,{d:`M12 17v4`,key:`1riwvh`}],[`path`,{d:`m14.305 7.53.923-.382`,key:`1mlnsw`}],[`path`,{d:`m15.228 4.852-.923-.383`,key:`82mpwg`}],[`path`,{d:`m16.852 3.228-.383-.924`,key:`ln4sir`}],[`path`,{d:`m16.852 8.772-.383.923`,key:`1dejw0`}],[`path`,{d:`m19.148 3.228.383-.924`,key:`192kgf`}],[`path`,{d:`m19.53 9.696-.382-.924`,key:`fiavlr`}],[`path`,{d:`m20.772 4.852.924-.383`,key:`1j8mgp`}],[`path`,{d:`m20.772 7.148.924.383`,key:`zix9be`}],[`path`,{d:`M22 13v2a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7`,key:`1tnzv8`}],[`path`,{d:`M8 21h8`,key:`1ev6f3`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}]]),mb=ob(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),hb=ob(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),gb=ob(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),_b=ob(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]);function vb(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=vb(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function yb(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=vb(e))&&(r&&(r+=` `),r+=t);return r}var bb=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,xb=yb,Sb=(e,t)=>n=>{if(t?.variants==null)return xb(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=bb(t)||bb(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return xb(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},Cb=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},wb=(e,t)=>({classGroupId:e,validator:t}),Tb=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Eb=`-`,Db=[],Ob=`arbitrary..`,kb=e=>{let t=Mb(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return jb(e);let n=e.split(Eb);return Ab(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?Cb(i,t):t:i||Db}return n[e]||Db}}},Ab=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=Ab(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(Eb):e.slice(t).join(Eb),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},jb=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?Ob+r:void 0})(),Mb=e=>{let{theme:t,classGroups:n}=e;return Nb(n,t)},Nb=(e,t)=>{let n=Tb();for(let r in e){let i=e[r];Pb(i,n,r,t)}return n},Pb=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];Fb(i,t,n,r)}},Fb=(e,t,n,r)=>{if(typeof e==`string`){Ib(e,t,n);return}if(typeof e==`function`){Lb(e,t,n,r);return}Rb(e,t,n,r)},Ib=(e,t,n)=>{let r=e===``?t:zb(t,e);r.classGroupId=n},Lb=(e,t,n,r)=>{if(Bb(e)){Pb(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(wb(n,e))},Rb=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];Pb(o,zb(t,a),n,r)}},zb=(e,t)=>{let n=e,r=t.split(Eb),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=Tb(),n.nextPart.set(t,i)),n=i}return n},Bb=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,Vb=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},Hb=`!`,Ub=`:`,Wb=[],Gb=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),Kb=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===Ub){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(Hb)?(c=s.slice(0,-1),l=!0):s.startsWith(Hb)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return Gb(t,l,c,u)};if(t){let e=t+Ub,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):Gb(Wb,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},qb=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},Jb=e=>({cache:Vb(e.cacheSize),parseClassName:Kb(e),sortModifiers:qb(e),...kb(e)}),Yb=/\s+/,Xb=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a}=t,o=[],s=e.trim().split(Yb),c=``;for(let e=s.length-1;e>=0;--e){let t=s[e],{isExternal:l,modifiers:u,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:p}=n(t);if(l){c=t+(c.length>0?` `+c:c);continue}let m=!!p,h=r(m?f.substring(0,p):f);if(!h){if(!m){c=t+(c.length>0?` `+c:c);continue}if(h=r(f),!h){c=t+(c.length>0?` `+c:c);continue}m=!1}let g=u.length===0?``:u.length===1?u[0]:a(u).join(`:`),_=d?g+Hb:g,v=_+h;if(o.indexOf(v)>-1)continue;o.push(v);let y=i(h,m);for(let e=0;e<y.length;++e){let t=y[e];o.push(_+t)}c=t+(c.length>0?` `+c:c)}return c},Zb=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=Qb(n))&&(i&&(i+=` `),i+=r);return i},Qb=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=Qb(e[r]))&&(n&&(n+=` `),n+=t);return n},$b=(e,...t)=>{let n,r,i,a,o=o=>(n=Jb(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=Xb(e,n);return i(e,a),a};return a=o,(...e)=>a(Zb(...e))},ex=[],tx=e=>{let t=t=>t[e]||ex;return t.isThemeGetter=!0,t},nx=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,rx=/^\((?:(\w[\w-]*):)?(.+)\)$/i,ix=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,ax=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ox=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,sx=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,cx=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,lx=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ux=e=>ix.test(e),dx=e=>!!e&&!Number.isNaN(Number(e)),fx=e=>!!e&&Number.isInteger(Number(e)),px=e=>e.endsWith(`%`)&&dx(e.slice(0,-1)),mx=e=>ax.test(e),hx=()=>!0,gx=e=>ox.test(e)&&!sx.test(e),_x=()=>!1,vx=e=>cx.test(e),yx=e=>lx.test(e),bx=e=>!X(e)&&!Z(e),xx=e=>Ix(e,Bx,_x),X=e=>nx.test(e),Sx=e=>Ix(e,Vx,gx),Cx=e=>Ix(e,Hx,dx),wx=e=>Ix(e,Wx,hx),Tx=e=>Ix(e,Ux,_x),Ex=e=>Ix(e,Rx,_x),Dx=e=>Ix(e,zx,yx),Ox=e=>Ix(e,Gx,vx),Z=e=>rx.test(e),kx=e=>Lx(e,Vx),Ax=e=>Lx(e,Ux),jx=e=>Lx(e,Rx),Mx=e=>Lx(e,Bx),Nx=e=>Lx(e,zx),Px=e=>Lx(e,Gx,!0),Fx=e=>Lx(e,Wx,!0),Ix=(e,t,n)=>{let r=nx.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Lx=(e,t,n=!1)=>{let r=rx.exec(e);return r?r[1]?t(r[1]):n:!1},Rx=e=>e===`position`||e===`percentage`,zx=e=>e===`image`||e===`url`,Bx=e=>e===`length`||e===`size`||e===`bg-size`,Vx=e=>e===`length`,Hx=e=>e===`number`,Ux=e=>e===`family-name`,Wx=e=>e===`number`||e===`weight`,Gx=e=>e===`shadow`,Kx=$b(()=>{let e=tx(`color`),t=tx(`font`),n=tx(`text`),r=tx(`font-weight`),i=tx(`tracking`),a=tx(`leading`),o=tx(`breakpoint`),s=tx(`container`),c=tx(`spacing`),l=tx(`radius`),u=tx(`shadow`),d=tx(`inset-shadow`),f=tx(`text-shadow`),p=tx(`drop-shadow`),m=tx(`blur`),h=tx(`perspective`),g=tx(`aspect`),_=tx(`ease`),v=tx(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),Z,X],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[Z,X,c],T=()=>[ux,`full`,`auto`,...w()],E=()=>[fx,`none`,`subgrid`,Z,X],D=()=>[`auto`,{span:[`full`,fx,Z,X]},fx,Z,X],O=()=>[fx,`auto`,Z,X],k=()=>[`auto`,`min`,`max`,`fr`,Z,X],A=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],j=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],M=()=>[`auto`,...w()],N=()=>[ux,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],P=()=>[ux,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],F=()=>[ux,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],I=()=>[e,Z,X],L=()=>[...b(),jx,Ex,{position:[Z,X]}],R=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],z=()=>[`auto`,`cover`,`contain`,Mx,xx,{size:[Z,X]}],ee=()=>[px,kx,Sx],B=()=>[``,`none`,`full`,l,Z,X],V=()=>[``,dx,kx,Sx],H=()=>[`solid`,`dashed`,`dotted`,`double`],te=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],ne=()=>[dx,px,jx,Ex],U=()=>[``,`none`,m,Z,X],re=()=>[`none`,dx,Z,X],ie=()=>[`none`,dx,Z,X],ae=()=>[dx,Z,X],oe=()=>[ux,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[mx],breakpoint:[mx],color:[hx],container:[mx],"drop-shadow":[mx],ease:[`in`,`out`,`in-out`],font:[bx],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[mx],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[mx],shadow:[mx],spacing:[`px`,dx],text:[mx],"text-shadow":[mx],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,ux,X,Z,g]}],container:[`container`],columns:[{columns:[dx,X,Z,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[fx,`auto`,Z,X]}],basis:[{basis:[ux,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[dx,ux,`auto`,`initial`,`none`,X]}],grow:[{grow:[``,dx,Z,X]}],shrink:[{shrink:[``,dx,Z,X]}],order:[{order:[fx,`first`,`last`,`none`,Z,X]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...A(),`normal`]}],"justify-items":[{"justify-items":[...j(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...j()]}],"align-content":[{content:[`normal`,...A()]}],"align-items":[{items:[...j(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...j(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":A()}],"place-items":[{"place-items":[...j(),`baseline`]}],"place-self":[{"place-self":[`auto`,...j()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mbs:[{mbs:M()}],mbe:[{mbe:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:N()}],"inline-size":[{inline:[`auto`,...P()]}],"min-inline-size":[{"min-inline":[`auto`,...P()]}],"max-inline-size":[{"max-inline":[`none`,...P()]}],"block-size":[{block:[`auto`,...F()]}],"min-block-size":[{"min-block":[`auto`,...F()]}],"max-block-size":[{"max-block":[`none`,...F()]}],w:[{w:[s,`screen`,...N()]}],"min-w":[{"min-w":[s,`screen`,`none`,...N()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...N()]}],h:[{h:[`screen`,`lh`,...N()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...N()]}],"max-h":[{"max-h":[`screen`,`lh`,...N()]}],"font-size":[{text:[`base`,n,kx,Sx]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,Fx,wx]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,px,X]}],"font-family":[{font:[Ax,Tx,t]}],"font-features":[{"font-features":[X]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,Z,X]}],"line-clamp":[{"line-clamp":[dx,`none`,Z,Cx]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,Z,X]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,Z,X]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:I()}],"text-color":[{text:I()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...H(),`wavy`]}],"text-decoration-thickness":[{decoration:[dx,`from-font`,`auto`,Z,Sx]}],"text-decoration-color":[{decoration:I()}],"underline-offset":[{"underline-offset":[dx,`auto`,Z,X]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,Z,X]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,Z,X]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:L()}],"bg-repeat":[{bg:R()}],"bg-size":[{bg:z()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},fx,Z,X],radial:[``,Z,X],conic:[fx,Z,X]},Nx,Dx]}],"bg-color":[{bg:I()}],"gradient-from-pos":[{from:ee()}],"gradient-via-pos":[{via:ee()}],"gradient-to-pos":[{to:ee()}],"gradient-from":[{from:I()}],"gradient-via":[{via:I()}],"gradient-to":[{to:I()}],rounded:[{rounded:B()}],"rounded-s":[{"rounded-s":B()}],"rounded-e":[{"rounded-e":B()}],"rounded-t":[{"rounded-t":B()}],"rounded-r":[{"rounded-r":B()}],"rounded-b":[{"rounded-b":B()}],"rounded-l":[{"rounded-l":B()}],"rounded-ss":[{"rounded-ss":B()}],"rounded-se":[{"rounded-se":B()}],"rounded-ee":[{"rounded-ee":B()}],"rounded-es":[{"rounded-es":B()}],"rounded-tl":[{"rounded-tl":B()}],"rounded-tr":[{"rounded-tr":B()}],"rounded-br":[{"rounded-br":B()}],"rounded-bl":[{"rounded-bl":B()}],"border-w":[{border:V()}],"border-w-x":[{"border-x":V()}],"border-w-y":[{"border-y":V()}],"border-w-s":[{"border-s":V()}],"border-w-e":[{"border-e":V()}],"border-w-bs":[{"border-bs":V()}],"border-w-be":[{"border-be":V()}],"border-w-t":[{"border-t":V()}],"border-w-r":[{"border-r":V()}],"border-w-b":[{"border-b":V()}],"border-w-l":[{"border-l":V()}],"divide-x":[{"divide-x":V()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":V()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...H(),`hidden`,`none`]}],"divide-style":[{divide:[...H(),`hidden`,`none`]}],"border-color":[{border:I()}],"border-color-x":[{"border-x":I()}],"border-color-y":[{"border-y":I()}],"border-color-s":[{"border-s":I()}],"border-color-e":[{"border-e":I()}],"border-color-bs":[{"border-bs":I()}],"border-color-be":[{"border-be":I()}],"border-color-t":[{"border-t":I()}],"border-color-r":[{"border-r":I()}],"border-color-b":[{"border-b":I()}],"border-color-l":[{"border-l":I()}],"divide-color":[{divide:I()}],"outline-style":[{outline:[...H(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[dx,Z,X]}],"outline-w":[{outline:[``,dx,kx,Sx]}],"outline-color":[{outline:I()}],shadow:[{shadow:[``,`none`,u,Px,Ox]}],"shadow-color":[{shadow:I()}],"inset-shadow":[{"inset-shadow":[`none`,d,Px,Ox]}],"inset-shadow-color":[{"inset-shadow":I()}],"ring-w":[{ring:V()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:I()}],"ring-offset-w":[{"ring-offset":[dx,Sx]}],"ring-offset-color":[{"ring-offset":I()}],"inset-ring-w":[{"inset-ring":V()}],"inset-ring-color":[{"inset-ring":I()}],"text-shadow":[{"text-shadow":[`none`,f,Px,Ox]}],"text-shadow-color":[{"text-shadow":I()}],opacity:[{opacity:[dx,Z,X]}],"mix-blend":[{"mix-blend":[...te(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":te()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[dx]}],"mask-image-linear-from-pos":[{"mask-linear-from":ne()}],"mask-image-linear-to-pos":[{"mask-linear-to":ne()}],"mask-image-linear-from-color":[{"mask-linear-from":I()}],"mask-image-linear-to-color":[{"mask-linear-to":I()}],"mask-image-t-from-pos":[{"mask-t-from":ne()}],"mask-image-t-to-pos":[{"mask-t-to":ne()}],"mask-image-t-from-color":[{"mask-t-from":I()}],"mask-image-t-to-color":[{"mask-t-to":I()}],"mask-image-r-from-pos":[{"mask-r-from":ne()}],"mask-image-r-to-pos":[{"mask-r-to":ne()}],"mask-image-r-from-color":[{"mask-r-from":I()}],"mask-image-r-to-color":[{"mask-r-to":I()}],"mask-image-b-from-pos":[{"mask-b-from":ne()}],"mask-image-b-to-pos":[{"mask-b-to":ne()}],"mask-image-b-from-color":[{"mask-b-from":I()}],"mask-image-b-to-color":[{"mask-b-to":I()}],"mask-image-l-from-pos":[{"mask-l-from":ne()}],"mask-image-l-to-pos":[{"mask-l-to":ne()}],"mask-image-l-from-color":[{"mask-l-from":I()}],"mask-image-l-to-color":[{"mask-l-to":I()}],"mask-image-x-from-pos":[{"mask-x-from":ne()}],"mask-image-x-to-pos":[{"mask-x-to":ne()}],"mask-image-x-from-color":[{"mask-x-from":I()}],"mask-image-x-to-color":[{"mask-x-to":I()}],"mask-image-y-from-pos":[{"mask-y-from":ne()}],"mask-image-y-to-pos":[{"mask-y-to":ne()}],"mask-image-y-from-color":[{"mask-y-from":I()}],"mask-image-y-to-color":[{"mask-y-to":I()}],"mask-image-radial":[{"mask-radial":[Z,X]}],"mask-image-radial-from-pos":[{"mask-radial-from":ne()}],"mask-image-radial-to-pos":[{"mask-radial-to":ne()}],"mask-image-radial-from-color":[{"mask-radial-from":I()}],"mask-image-radial-to-color":[{"mask-radial-to":I()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[dx]}],"mask-image-conic-from-pos":[{"mask-conic-from":ne()}],"mask-image-conic-to-pos":[{"mask-conic-to":ne()}],"mask-image-conic-from-color":[{"mask-conic-from":I()}],"mask-image-conic-to-color":[{"mask-conic-to":I()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:L()}],"mask-repeat":[{mask:R()}],"mask-size":[{mask:z()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,Z,X]}],filter:[{filter:[``,`none`,Z,X]}],blur:[{blur:U()}],brightness:[{brightness:[dx,Z,X]}],contrast:[{contrast:[dx,Z,X]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,Px,Ox]}],"drop-shadow-color":[{"drop-shadow":I()}],grayscale:[{grayscale:[``,dx,Z,X]}],"hue-rotate":[{"hue-rotate":[dx,Z,X]}],invert:[{invert:[``,dx,Z,X]}],saturate:[{saturate:[dx,Z,X]}],sepia:[{sepia:[``,dx,Z,X]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,Z,X]}],"backdrop-blur":[{"backdrop-blur":U()}],"backdrop-brightness":[{"backdrop-brightness":[dx,Z,X]}],"backdrop-contrast":[{"backdrop-contrast":[dx,Z,X]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,dx,Z,X]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[dx,Z,X]}],"backdrop-invert":[{"backdrop-invert":[``,dx,Z,X]}],"backdrop-opacity":[{"backdrop-opacity":[dx,Z,X]}],"backdrop-saturate":[{"backdrop-saturate":[dx,Z,X]}],"backdrop-sepia":[{"backdrop-sepia":[``,dx,Z,X]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,Z,X]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[dx,`initial`,Z,X]}],ease:[{ease:[`linear`,`initial`,_,Z,X]}],delay:[{delay:[dx,Z,X]}],animate:[{animate:[`none`,v,Z,X]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,Z,X]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:re()}],"rotate-x":[{"rotate-x":re()}],"rotate-y":[{"rotate-y":re()}],"rotate-z":[{"rotate-z":re()}],scale:[{scale:ie()}],"scale-x":[{"scale-x":ie()}],"scale-y":[{"scale-y":ie()}],"scale-z":[{"scale-z":ie()}],"scale-3d":[`scale-3d`],skew:[{skew:ae()}],"skew-x":[{"skew-x":ae()}],"skew-y":[{"skew-y":ae()}],transform:[{transform:[Z,X,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:oe()}],"translate-x":[{"translate-x":oe()}],"translate-y":[{"translate-y":oe()}],"translate-z":[{"translate-z":oe()}],"translate-none":[`translate-none`],accent:[{accent:I()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:I()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,Z,X]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,Z,X]}],fill:[{fill:[`none`,...I()]}],"stroke-w":[{stroke:[dx,kx,Sx,Cx]}],stroke:[{stroke:[`none`,...I()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function qx(...e){return Kx(yb(e))}function Jx(){return typeof window<`u`}function Yx(e){return Qx(e)?(e.nodeName||``).toLowerCase():`#document`}function Xx(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Zx(e){return((Qx(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Qx(e){return Jx()?e instanceof Node||e instanceof Xx(e).Node:!1}function $x(e){return Jx()?e instanceof Element||e instanceof Xx(e).Element:!1}function eS(e){return Jx()?e instanceof HTMLElement||e instanceof Xx(e).HTMLElement:!1}function tS(e){return!Jx()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Xx(e).ShadowRoot}function nS(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=pS(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function rS(e){return/^(table|td|th)$/.test(Yx(e))}function iS(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var aS=/transform|translate|scale|rotate|perspective|filter/,oS=/paint|layout|strict|content/,sS=e=>!!e&&e!==`none`,cS;function lS(e){let t=$x(e)?pS(e):e;return sS(t.transform)||sS(t.translate)||sS(t.scale)||sS(t.rotate)||sS(t.perspective)||!dS()&&(sS(t.backdropFilter)||sS(t.filter))||aS.test(t.willChange||``)||oS.test(t.contain||``)}function uS(e){let t=hS(e);for(;eS(t)&&!fS(t);){if(lS(t))return t;if(iS(t))return null;t=hS(t)}return null}function dS(){return cS??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),cS}function fS(e){return/^(html|body|#document)$/.test(Yx(e))}function pS(e){return Xx(e).getComputedStyle(e)}function mS(e){return $x(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function hS(e){if(Yx(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||tS(e)&&e.host||Zx(e);return tS(t)?t.host:t}function gS(e){let t=hS(e);return fS(t)?e.ownerDocument?e.ownerDocument.body:e.body:eS(t)&&nS(t)?t:gS(t)}function _S(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=gS(e),i=r===e.ownerDocument?.body,a=Xx(r);if(i){let e=vS(a);return t.concat(a,a.visualViewport||[],nS(r)?r:[],e&&n?_S(e):[])}else return t.concat(r,_S(r,[],n))}function vS(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var yS={};function bS(e,t){let n=b.useRef(yS);return n.current===yS&&(n.current=e(t)),n}var xS=b[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],SS=xS&&xS!==b.useLayoutEffect?xS:e=>e();function CS(e){let t=bS(wS).current;return t.next=e,SS(t.effect),t.trampoline}function wS(){let e={next:void 0,callback:TS,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function TS(){}var ES={...b},Q=typeof document<`u`?b.useLayoutEffect:()=>{};function DS(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}var OS={};function kS(e,t,n,r,i){if(!n&&!r&&!i&&!e)return jS(t);let a=jS(e);return t&&(a=MS(a,t)),n&&(a=MS(a,n)),r&&(a=MS(a,r)),i&&(a=MS(a,i)),a}function AS(e){if(e.length===0)return OS;if(e.length===1)return jS(e[0]);let t=jS(e[0]);for(let n=1;n<e.length;n+=1)t=MS(t,e[n]);return t}function jS(e){return IS(e)?{...LS(e,OS)}:NS(e)}function MS(e,t){return IS(t)?LS(t,e):PS(e,t)}function NS(e){let t={...e};for(let e in t){let n=t[e];FS(e,n)&&(t[e]=zS(n))}return t}function PS(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=DS(e.style,r);break;case`className`:e[n]=VS(e.className,r);break;default:FS(n,r)?e[n]=RS(e[n],r):e[n]=r}}return e}function FS(e,t){let n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof t==`function`||t===void 0)}function IS(e){return typeof e==`function`}function LS(e,t){return IS(e)?e(t):e??OS}function RS(e,t){return t?e?(...n)=>{let r=n[0];if(HS(r)){let i=r;BS(i);let a=t(...n);return i.baseUIHandlerPrevented||e?.(...n),a}let i=t(...n);return e?.(...n),i}:zS(t):e}function zS(e){return e&&((...t)=>{let n=t[0];return HS(n)&&BS(n),e(...t)})}function BS(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function VS(e,t){return t?e?t+` `+e:t:e}function HS(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function US(e,t){return function(n,...r){let i=new URL(e);return i.searchParams.set(`code`,n.toString()),r.forEach(e=>i.searchParams.append(`args[]`,e)),`${t} error #${n}; visit ${i} for the full message.`}}var WS=US(`https://base-ui.com/production-error`,`Base UI`),GS=b.createContext(void 0);function KS(e=!1){let t=b.useContext(GS);if(t===void 0&&!e)throw Error(WS(16));return t}function qS(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=e,o=r&&t!==!1,s=r&&t===!1;return{props:b.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=i,!a&&n&&(e.tabIndex=t?i:-1)),(a&&(t||o)||!a&&n)&&(e[`aria-disabled`]=n),a&&(!t||s)&&(e.disabled=n),e},[r,n,t,o,s,a,i])}}function JS(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:a}=e,o=b.useRef(null),s=KS(!0),c=a??s!==void 0,{props:l}=qS({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:r,isNativeButton:i}),u=b.useCallback(()=>{let e=o.current;YS(e)&&c&&t&&l.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,l.disabled,c]);return Q(u,[u]),{getButtonProps:b.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:s,...u}=e;return kS({type:i?`button`:void 0,onClick(e){if(t){e.preventDefault();return}n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(BS(e),o?.(e),e.baseUIHandlerPrevented))return;let r=e.target===e.currentTarget,a=e.currentTarget,s=YS(a),l=!i&&XS(a),u=r&&(i?s:!l),d=e.key===`Enter`,f=e.key===` `,p=a.getAttribute(`role`),m=p?.startsWith(`menuitem`)||p===`option`||p===`gridcell`;if(r&&c&&f){if(e.defaultPrevented&&m)return;e.preventDefault(),l||i&&s?(a.click(),e.preventBaseUIHandler()):u&&(n?.(e),e.preventBaseUIHandler());return}u&&(!i&&(f||d)&&e.preventDefault(),!i&&d&&n?.(e))},onKeyUp(e){if(!t){if(BS(e),a?.(e),e.target===e.currentTarget&&i&&c&&YS(e.currentTarget)&&e.key===` `){e.preventDefault();return}e.baseUIHandlerPrevented||e.target===e.currentTarget&&!i&&!c&&e.key===` `&&n?.(e)}},onPointerDown(e){if(t){e.preventDefault();return}s?.(e)}},i?void 0:{role:`button`},l,u)},[t,l,c,i]),buttonRef:CS(e=>{o.current=e,u()})}}function YS(e){return eS(e)&&e.tagName===`BUTTON`}function XS(e){return!!(e?.tagName===`A`&&e?.href)}function ZS(e,t,n,r){let i=bS($S).current;return eC(i,e,t,n,r)&&nC(i,[e,t,n,r]),i.callback}function QS(e){let t=bS($S).current;return tC(t,e)&&nC(t,e),t.callback}function $S(){return{callback:null,cleanup:null,refs:[]}}function eC(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function tC(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function nC(e,t){if(e.refs=t,t.every(e=>e==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&=(e.cleanup(),null),n!=null){let r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let i=t[e];if(i!=null)switch(typeof i){case`function`:{let t=i(n);typeof t==`function`&&(r[e]=t);break}case`object`:i.current=n;break;default:}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let n=t[e];if(n!=null)switch(typeof n){case`function`:{let t=r[e];typeof t==`function`?t():n(null);break}case`object`:n.current=null;break;default:}}}}}}var rC=19;function iC(e){return rC>=e}function aC(e){if(!b.isValidElement(e))return null;let t=e,n=t.props;return(iC(19)?n?.ref:t.ref)??null}function oC(){}var sC=Object.freeze([]),cC=Object.freeze({});function lC(e,t){let n={};for(let r in e){let i=e[r];if(t?.hasOwnProperty(r)){let e=t[r](i);e!=null&&Object.assign(n,e);continue}i===!0?n[`data-${r.toLowerCase()}`]=``:i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function uC(e,t){return typeof e==`function`?e(t):e}function dC(e,t){return typeof e==`function`?e(t):e}function fC(e,t,n={}){let r=t.render,i=pC(t,n);return n.enabled===!1?null:gC(e,r,i,n.state??cC)}function pC(e,t={}){let{className:n,style:r,render:i}=e,{state:a=cC,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?uC(n,a):void 0,d=l?dC(r,a):void 0,f=l?lC(a,c):cC,p=l&&s?mC(s):void 0,m=l?DS(f,p)??{}:cC;return typeof document<`u`&&(l?Array.isArray(o)?m.ref=QS([m.ref,aC(i),...o]):m.ref=ZS(m.ref,aC(i),o):ZS(null,null)),l?(u!==void 0&&(m.className=VS(m.className,u)),d!==void 0&&(m.style=DS(m.style,d)),m):cC}function mC(e){return Array.isArray(e)?AS(e):kS(void 0,e)}var hC=Symbol.for(`react.lazy`);function gC(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=kS(n,t.props);e.ref=n.ref;let i=t;return i?.$$typeof===hC&&(i=b.Children.toArray(t)[0]),b.cloneElement(i,e)}if(e&&typeof e==`string`)return _C(e,n);throw Error(WS(8))}function _C(e,t){return e===`button`?(0,b.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,b.createElement)(`img`,{alt:``,...t,key:t.key}):b.createElement(e,t)}var vC=b.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,focusableWhenDisabled:a=!1,nativeButton:o=!0,style:s,...c}=e,{getButtonProps:l,buttonRef:u}=JS({disabled:i,focusableWhenDisabled:a,native:o});return fC(`button`,e,{state:{disabled:i},ref:[t,u],props:[c,l]})}),yC=Sb(`group/button inline-flex shrink-0 items-center justify-center rounded-md border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/80`,outline:`border-border bg-background shadow-xs hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,ghost:`hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50`,destructive:`bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-9 gap-1.5 px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,xs:`h-6 gap-1 rounded-[min(var(--radius-md),8px)] px-2 text-xs in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-8 gap-1 rounded-[min(var(--radius-md),10px)] px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5`,lg:`h-10 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,icon:`size-9`,"icon-xs":`size-6 rounded-[min(var(--radius-md),8px)] in-data-[slot=button-group]:rounded-md [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-8 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-md`,"icon-lg":`size-10`}},defaultVariants:{variant:`default`,size:`default`}});function bC({className:e,variant:t=`default`,size:n=`default`,...r}){return(0,y.jsx)(vC,{"data-slot":`button`,className:qx(yC({variant:t,size:n,className:e})),...r})}var xC=function(e){return e.disabled=`data-disabled`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.filled=`data-filled`,e.focused=`data-focused`,e}({}),SC={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},CC={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},wC={disabled:!1,...CC},TC={valid(e){return e===null?null:e?{[xC.valid]:``}:{[xC.invalid]:``}}},EC=b.createContext({invalid:void 0,name:void 0,validityData:{state:SC,errors:[],error:``,value:``,initialValue:null},setValidityData:oC,disabled:void 0,touched:CC.touched,setTouched:oC,dirty:CC.dirty,setDirty:oC,filled:CC.filled,setFilled:oC,focused:CC.focused,setFocused:oC,validate:()=>null,validationMode:`onSubmit`,validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:wC,markedDirtyRef:{current:!1},registerFieldControl:oC,validation:{getValidationProps:(e=cC)=>e,getInputValidationProps:(e=cC)=>e,inputRef:{current:null},commit:async()=>{}}});function DC(e=!0){let t=b.useContext(EC);if(t.setValidityData===oC&&!e)throw Error(WS(28));return t}var OC=b.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:oC,validationMode:`onSubmit`,submitAttemptedRef:{current:!1}});function kC(){return b.useContext(OC)}var AC=0;function jC(e,t=`mui`){let[n,r]=b.useState(e),i=e||n;return b.useEffect(()=>{n??(AC+=1,r(`${t}-${AC}`))},[n,t]),i}var MC=ES.useId;function NC(e,t){if(MC!==void 0){let n=MC();return e??(t?`${t}-${n}`:n)}return jC(e,t)}function PC(e){return NC(e,`base-ui`)}var FC=b.createContext({controlId:void 0,registerControlId:oC,labelId:void 0,setLabelId:oC,messageIds:[],setMessageIds:oC,getDescriptionProps:e=>e});function IC(){return b.useContext(FC)}function LC(e,t,n,r=!0,i){let[a,o]=b.useState(),s=PC(i?`${i}-label`:void 0),c=e??t??a;return Q(()=>{let i=e||t||!r?void 0:RC(n.current,s);a!==i&&o(i)}),c}function RC(e,t){let n=zC(e);if(n)return!n.id&&t&&(n.id=t),n.id||void 0}function zC(e){if(!e)return;let t=e.parentElement;if(t&&t.tagName===`LABEL`)return t;let n=e.id;if(n){let t=e.nextElementSibling;if(t&&t.htmlFor===n)return t}let r=e.labels;return r&&r[0]}function BC(e={}){let{id:t,implicit:n=!1,controlRef:r}=e,{controlId:i,registerControlId:a}=IC(),o=PC(t),s=n?i:void 0,c=bS(()=>Symbol(`labelable-control`)),l=b.useRef(!1),u=b.useRef(t!=null),d=CS(()=>{!l.current||a===oC||(l.current=!1,a(c.current,void 0))});return Q(()=>{if(a===oC)return;let e;if(n){let n=r?.current;e=$x(n)&&n.closest(`label`)!=null?t??null:s??o}else if(t!=null)u.current=!0,e=t;else if(u.current)e=o;else{d();return}if(e===void 0){d();return}l.current=!0,a(c.current,e)},[t,r,s,a,n,o,c,d]),b.useEffect(()=>d,[d]),i??o}function VC(e){return e?.ownerDocument||document}var HC=typeof navigator<`u`,UC=QC(),WC=ew(),GC=$C(),KC=typeof CSS>`u`||!CSS.supports?!1:CSS.supports(`-webkit-backdrop-filter:none`),qC=UC.platform===`MacIntel`&&UC.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(UC.platform);HC&&/firefox/i.test(GC);var JC=HC&&/apple/i.test(navigator.vendor);HC&&/Edg/i.test(GC);var YC=HC&&/android/i.test(WC)||/android/i.test(GC),XC=HC&&WC.toLowerCase().startsWith(`mac`)&&!navigator.maxTouchPoints,ZC=GC.includes(`jsdom/`);function QC(){if(!HC)return{platform:``,maxTouchPoints:-1};let e=navigator.userAgentData;return e?.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??-1}}function $C(){if(!HC)return``;let e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:e,version:t})=>`${e}/${t}`).join(` `):navigator.userAgent}function ew(){if(!HC)return``;let e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??``}var tw=`data-base-ui-focusable`,nw=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,rw=`ArrowLeft`,iw=`ArrowRight`,aw=`ArrowUp`,ow=`ArrowDown`;function sw(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function cw(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&tS(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function lw(e){return`composedPath`in e?e.composedPath()[0]:e.target}function uw(e,t){if(!$x(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(`data-trigger-disabled`);for(let[,e]of t.entries())if(cw(e,n))return!e.hasAttribute(`data-trigger-disabled`);return!1}function dw(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function fw(e){return e.matches(`html,body`)}function pw(e){return eS(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function mw(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${nw}`)!=null}function hw(e){return e?e.getAttribute(`role`)===`combobox`&&pw(e):!1}function gw(e){if(!e||ZC)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function _w(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function vw(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...vw(e,t.id,n)])}function yw(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function bw(e){e.preventDefault(),e.stopPropagation()}function xw(e){return`nativeEvent`in e}function Sw(e){return e.pointerType===``&&e.isTrusted?!0:YC&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function Cw(e){return ZC?!1:!YC&&e.width===0&&e.height===0||YC&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function ww(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function Tw(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}var Ew=[`top`,`right`,`bottom`,`left`],Dw=Math.min,Ow=Math.max,kw=Math.round,Aw=Math.floor,jw=e=>({x:e,y:e}),Mw={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Nw(e,t,n){return Ow(e,Dw(t,n))}function Pw(e,t){return typeof e==`function`?e(t):e}function Fw(e){return e.split(`-`)[0]}function Iw(e){return e.split(`-`)[1]}function Lw(e){return e===`x`?`y`:`x`}function Rw(e){return e===`y`?`height`:`width`}function zw(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Bw(e){return Lw(zw(e))}function Vw(e,t,n){n===void 0&&(n=!1);let r=Iw(e),i=Bw(e),a=Rw(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Xw(o)),[o,Xw(o)]}function Hw(e){let t=Xw(e);return[Uw(e),t,Uw(t)]}function Uw(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Ww=[`left`,`right`],Gw=[`right`,`left`],Kw=[`top`,`bottom`],qw=[`bottom`,`top`];function Jw(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Gw:Ww:t?Ww:Gw;case`left`:case`right`:return t?Kw:qw;default:return[]}}function Yw(e,t,n,r){let i=Iw(e),a=Jw(Fw(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Uw)))),a}function Xw(e){let t=Fw(e);return Mw[t]+e.slice(t.length)}function Zw(e){return{top:0,right:0,bottom:0,left:0,...e}}function Qw(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Zw(e)}function $w(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function eT(e,t,n){return Math.floor(e/t)!==n}function tT(e,t){return t<0||t>=e.length}function nT(e,t){return iT(e.current,{disabledIndices:t})}function rT(e,t){return iT(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function iT(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.length-1&&lT(e,a,r));return a}function aT(e,{event:t,orientation:n,loopFocus:r,onLoop:i,rtl:a,cols:o,disabledIndices:s,minIndex:c,maxIndex:l,prevIndex:u,stopEvent:d=!1}){let f=u,p;if(t.key===`ArrowUp`?p=`up`:t.key===`ArrowDown`&&(p=`down`),p){let n=[],a=[],m=!1,h=0;{let t=null,r=-1;e.forEach((e,i)=>{if(e==null)return;h+=1;let o=e.closest(`[role="row"]`);o&&(m=!0),(o!==t||r===-1)&&(t=o,r+=1,n[r]=[]),n[r].push(i),a[i]=r})}let g=!1,_=0;if(m)for(let e of n){let t=e.length;t>_&&(_=t),t!==o&&(g=!0)}let v=g&&h<e.length,y=_||o,b=o=>{if(!g||u===-1)return;let c=a[u];if(c==null)return;let l=n[c].indexOf(u),d=o===`up`?-1:1;for(let o=c+d,f=0;f<n.length;f+=1,o+=d){if(o<0||o>=n.length){if(!r||v)return;if(o=o<0?n.length-1:0,i){let e=Math.min(l,n[o].length-1);o=a[i(t,u,n[o][e]??n[o][0])]??o}}let c=n[o];for(let t=Math.min(l,c.length-1);t>=0;--t){let n=c[t];if(!lT(e,n,s))return n}}},x=t=>{if(!v||u===-1)return;let n=u%y,i=t===`up`?-y:y,a=l-l%y,o=Aw(l/y)+1;for(let t=u-n+i,c=0;c<o;c+=1,t+=i){if(t<0||t>l){if(!r)return;t=t<0?a:0}let i=Math.min(t+y-1,l);for(let r=Math.min(t+n,i);r>=t;--r)if(!lT(e,r,s))return r}};d&&bw(t);let S=b(p)??x(p);if(S!==void 0)f=S;else if(u===-1)f=p===`up`?l:c;else if(f=iT(e,{startingIndex:u,amount:y,decrement:p===`up`,disabledIndices:s}),r){if(p===`up`&&(u-y<c||f<0)){let e=u%y,n=l%y,r=l-(n-e);f=n===e?l:n>e?r:r-y,i&&(f=i(t,u,f))}p===`down`&&u+y>l&&(f=iT(e,{startingIndex:u%y-y,amount:y,disabledIndices:s}),i&&(f=i(t,u,f)))}tT(e,f)&&(f=u)}if(n===`both`){let n=Aw(u/o);t.key===(a?`ArrowLeft`:`ArrowRight`)&&(d&&bw(t),u%o===o-1?r&&(f=iT(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f))):(f=iT(e,{startingIndex:u,disabledIndices:s}),r&&eT(f,o,n)&&(f=iT(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f)))),eT(f,o,n)&&(f=u)),t.key===(a?`ArrowRight`:`ArrowLeft`)&&(d&&bw(t),u%o===0?r&&(f=iT(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:s}),i&&(f=i(t,u,f))):(f=iT(e,{startingIndex:u,decrement:!0,disabledIndices:s}),r&&eT(f,o,n)&&(f=iT(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:s}),i&&(f=i(t,u,f)))),eT(f,o,n)&&(f=u));let c=Aw(l/o)===n;tT(e,f)&&(r&&c?(f=t.key===(a?`ArrowRight`:`ArrowLeft`)?l:iT(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f))):f=u)}return f}function oT(e,t,n){let r=[],i=0;return e.forEach(({width:e,height:a},o)=>{let s=!1;for(n&&(i=0);!s;){let n=[];for(let r=0;r<e;r+=1)for(let e=0;e<a;e+=1)n.push(i+r+e*t);i%t+e<=t&&n.every(e=>r[e]==null)?(n.forEach(e=>{r[e]=o}),s=!0):i+=1}}),[...r]}function sT(e,t,n,r,i){if(e===-1)return-1;let a=n.indexOf(e),o=t[e];switch(i){case`tl`:return a;case`tr`:return o?a+o.width-1:a;case`bl`:return o?a+(o.height-1)*r:a;case`br`:return n.lastIndexOf(e);default:return-1}}function cT(e,t){return t.flatMap((t,n)=>e.includes(t)?[n]:[])}function lT(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?dT(r)?!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!0:!1}function uT(e){return e.visibility===`hidden`||e.visibility===`collapse`}function dT(e,t=e?pS(e):null){return!e||!e.isConnected||!t||uT(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var fT=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function pT(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return tS(n)?n.host:null}function mT(e){for(let t of Array.from(e.children))if(Yx(t)===`summary`)return t;return null}function hT(e,t){let n=mT(t);return!!n&&(e===n||cw(n,e))}function gT(e){let t=e?Yx(e):``;return e!=null&&e.matches(fT)&&(t!==`summary`||e.parentElement!=null&&Yx(e.parentElement)===`details`&&mT(e.parentElement)===e)&&(t!==`details`||mT(e)==null)&&(t!==`input`||e.type!==`hidden`)}function _T(e){if(!gT(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=pT(t)){let n=t!==e,r=Yx(t)===`slot`;if(t.hasAttribute(`inert`)||n&&Yx(t)===`details`&&!t.open&&!hT(e,t)||t.hasAttribute(`hidden`)||!r&&!vT(t,n))return!1}return!0}function vT(e,t){let n=pS(e);return t?n.display!==`none`:dT(e,n)}function yT(e){let t=e.tabIndex;if(t<0){let t=Yx(e);if(t===`details`||t===`audio`||t===`video`||eS(e)&&e.isContentEditable)return 0}return t}function bT(e){if(Yx(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function xT(e,t){let n=bT(e);if(!n)return!0;let r=t.find(e=>{let t=bT(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=bT(e);return t?.name===n.name&&t.form===n.form})===n}function ST(e){if(eS(e)&&Yx(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return eS(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function CT(e,t){ST(e).forEach(e=>{gT(e)&&t.push(e),CT(e,t)})}function wT(e,t,n){ST(e).forEach(e=>{eS(e)&&e.matches(t)&&n.push(e),wT(e,t,n)})}function TT(e){return _T(e)&&yT(e)>=0}function ET(e){let t=[];return CT(e,t),t.filter(_T)}function DT(e){let t=ET(e);return t.filter(e=>yT(e)>=0&&xT(e,t))}function OT(e,t){let n=DT(e),r=n.length;if(r===0)return;let i=sw(VC(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function kT(e){return OT(VC(e).body,1)||e}function AT(e){return OT(VC(e).body,-1)||e}function jT(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!cw(n,r)}function MT(e){DT(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function NT(e){let t=[];wT(e,`[data-tabindex]`,t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}var PT=[];function FT(e){b.useEffect(e,PT)}var IT=0,LT=class e{static create(){return new e}currentId=IT;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=IT,t()},e)}isStarted(){return this.currentId!==IT}clear=()=>{this.currentId!==IT&&(clearTimeout(this.currentId),this.currentId=IT)};disposeEffect=()=>this.clear};function RT(){let e=bS(LT.create).current;return FT(e.disposeEffect),e}var zT=null;globalThis.requestAnimationFrame;var BT=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||=(requestAnimationFrame(this.tick),!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||(this.callbacks[t]=null,--this.callbacksCount)}},VT=class e{static create(){return new e}static request(e){return BT.request(e)}static cancel(e){return BT.cancel(e)}currentId=zT;request(e){this.cancel(),this.currentId=BT.request(()=>{this.currentId=zT,e()})}cancel=()=>{this.currentId!==zT&&(BT.cancel(this.currentId),this.currentId=zT)};disposeEffect=()=>this.cancel};function HT(){let e=bS(VT.create).current;return FT(e.disposeEffect),e}function UT(e){return e==null?e:`current`in e?e.current:e}var WT=function(e){return e.startingStyle=`data-starting-style`,e.endingStyle=`data-ending-style`,e}({}),GT={[WT.startingStyle]:``},KT={[WT.endingStyle]:``},qT={transitionStatus(e){return e===`starting`?GT:e===`ending`?KT:null}},JT=c(g());function YT(e,t=!1,n=!0){let r=HT();return CS((i,a=null)=>{r.cancel();let o=UT(e);if(o==null)return;let s=o,c=()=>{JT.flushSync(i)};if(typeof s.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function l(){Promise.all(s.getAnimations().map(e=>e.finished)).then(()=>{a?.aborted||c()}).catch(()=>{if(n){a?.aborted||c();return}let e=s.getAnimations();!a?.aborted&&e.length>0&&e.some(e=>e.pending||e.playState!==`finished`)&&l()})}if(t){let e=WT.startingStyle;if(!s.hasAttribute(e)){r.request(l);return}let t=new MutationObserver(()=>{s.hasAttribute(e)||(t.disconnect(),l())});t.observe(s,{attributes:!0,attributeFilter:[e]}),a?.addEventListener(`abort`,()=>t.disconnect(),{once:!0});return}r.request(l)})}function XT(e){let{enabled:t=!0,open:n,ref:r,onComplete:i}=e,a=CS(i),o=YT(r,n,!1);b.useEffect(()=>{if(!t)return;let e=new AbortController;return o(a,e.signal),()=>{e.abort()}},[t,n,a,o])}function ZT(e,t=!1,n=!1){let[r,i]=b.useState(e&&t?`idle`:void 0),[a,o]=b.useState(e);return e&&!a&&(o(!0),i(`starting`)),!e&&a&&r!==`ending`&&!n&&i(`ending`),!e&&!a&&r===`ending`&&i(void 0),Q(()=>{if(!e&&a&&r!==`ending`&&n){let e=VT.request(()=>{i(`ending`)});return()=>{VT.cancel(e)}}},[e,a,r,n]),Q(()=>{if(!e||t)return;let n=VT.request(()=>{i(void 0)});return()=>{VT.cancel(n)}},[t,e]),Q(()=>{if(!e||!t)return;e&&a&&r!==`idle`&&i(`starting`);let n=VT.request(()=>{i(`idle`)});return()=>{VT.cancel(n)}},[t,e,a,r]),{mounted:a,setMounted:o,transitionStatus:r}}function QT({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=b.useRef(e!==void 0),[a,o]=b.useState(t);return[i?e:a,b.useCallback(e=>{i||o(e)},[])]}function $T(e,t){let{enabled:n=!0,getValue:r,id:i,value:a}=t,{registerFieldControl:o}=DC(),s=b.useRef(null);s.current||=Symbol(),Q(()=>{let t=s.current;if(!(!t||!n))return o(t,{controlRef:e,getValue:r,id:i,value:a}),()=>{o(t,void 0)}},[e,n,r,i,o,a])}var eE=`none`,tE=`trigger-press`,nE=`trigger-hover`,rE=`trigger-focus`,iE=`outside-press`,aE=`item-press`,oE=`close-press`,sE=`focus-out`,cE=`escape-key`,lE=`list-navigation`,uE=`cancel-open`,dE=`disabled`,fE=`imperative-action`,pE=`window-resize`;function mE(e,t,n,r){let i=!1,a=!1,o=r??cC;return{reason:e,event:t??new Event(`base-ui`),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...o}}var hE=b.forwardRef(function(e,t){let{render:n,className:r,id:i,name:a,value:o,disabled:s=!1,onValueChange:c,defaultValue:l,autoFocus:u=!1,style:d,...f}=e,{state:p,name:m,disabled:h,setTouched:g,setDirty:_,validityData:v,setFocused:y,setFilled:x,validationMode:S,validation:C}=DC(),w=h||s,T=m??a,E={...p,disabled:w},{labelId:D}=IC(),O=BC({id:i});Q(()=>{let e=o!=null;C.inputRef.current?.value||e&&o!==``?x(!0):e&&o===``&&x(!1)},[C.inputRef,x,o]);let k=b.useRef(null);Q(()=>{u&&k.current===sw(VC(k.current))&&y(!0)},[u,y]);let[A]=QT({controlled:o,default:l,name:`FieldControl`,state:`value`}),j=o!==void 0,M=j?A:void 0,N=CS(()=>C.inputRef.current?.value);return $T(C.inputRef,{id:O,value:M,getValue:N}),fC(`input`,e,{ref:[t,k],state:E,props:[{id:O,disabled:w,name:T,ref:C.inputRef,"aria-labelledby":D,autoFocus:u,...j?{value:M}:{defaultValue:l},onChange(e){let t=e.currentTarget.value;c?.(t,mE(eE,e.nativeEvent)),_(t!==v.initialValue),x(t!==``)},onFocus(){y(!0)},onBlur(e){g(!0),y(!1),S===`onBlur`&&C.commit(e.currentTarget.value)},onKeyDown(e){e.currentTarget.tagName===`INPUT`&&e.key===`Enter`&&(g(!0),C.commit(e.currentTarget.value))}},C.getInputValidationProps(),f],stateAttributesMapping:TC})}),gE=b.forwardRef(function(e,t){return(0,y.jsx)(hE,{ref:t,...e})});function _E({className:e,type:t,...n}){return(0,y.jsx)(gE,{type:t,"data-slot":`input`,className:qx(`h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-2.5 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,e),...n})}function vE({className:e,...t}){return(0,y.jsx)(`div`,{"data-slot":`input-group`,role:`group`,className:qx(`group/input-group relative flex h-9 w-full min-w-0 items-center rounded-md border border-input shadow-xs transition-[color,box-shadow] outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5`,e),...t})}var yE=Sb(`flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4`,{variants:{align:{"inline-start":`order-first pl-2 has-[>button]:-ml-1 has-[>kbd]:ml-[-0.15rem]`,"inline-end":`order-last pr-2 has-[>button]:-mr-1 has-[>kbd]:mr-[-0.15rem]`,"block-start":`order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2`,"block-end":`order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2`}},defaultVariants:{align:`inline-start`}});function bE({className:e,align:t=`inline-start`,...n}){return(0,y.jsx)(`div`,{role:`group`,"data-slot":`input-group-addon`,"data-align":t,className:qx(yE({align:t}),e),onClick:e=>{e.target.closest(`button`)||e.currentTarget.parentElement?.querySelector(`input`)?.focus()},...n})}var xE=Sb(`flex items-center gap-2 text-sm shadow-none`,{variants:{size:{xs:`h-6 gap-1 rounded-[calc(var(--radius)-5px)] px-1.5 [&>svg:not([class*='size-'])]:size-3.5`,sm:``,"icon-xs":`size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>svg]:p-0`,"icon-sm":`size-8 p-0 has-[>svg]:p-0`}},defaultVariants:{size:`xs`}});function SE({className:e,type:t=`button`,variant:n=`ghost`,size:r=`xs`,...i}){return(0,y.jsx)(bC,{type:t,"data-size":r,variant:n,className:qx(xE({size:r}),e),...i})}function CE({className:e,...t}){return(0,y.jsx)(`span`,{className:qx(`flex items-center gap-2 text-sm text-muted-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4`,e),...t})}function wE({className:e,...t}){return(0,y.jsx)(_E,{"data-slot":`input-group-control`,className:qx(`flex-1 rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 aria-invalid:ring-0 dark:bg-transparent`,e),...t})}var TE=({searchInputRef:e,searchQuery:t,searchResults:n,onSearchChange:r,onKeyDown:i,onFindNext:a,onFindPrevious:o})=>{let s=n.resultCount===0?`0/0`:`${n.resultIndex+1}/${n.resultCount}`;return(0,y.jsxs)(vE,{role:`search`,"aria-label":`find in terminal`,className:`absolute top-2 right-3 z-10 w-[min(20rem,calc(100vw-1.5rem))] border-border/60 bg-background/70 text-muted-foreground shadow-xs backdrop-blur-md dark:bg-background/70`,children:[(0,y.jsx)(wE,{ref:e,type:`search`,value:t,onChange:r,onKeyDown:i,placeholder:`Find`,"aria-label":`find query`,className:`text-xs`}),(0,y.jsxs)(bE,{align:`inline-end`,children:[(0,y.jsx)(CE,{role:`status`,"aria-label":`match count`,className:`text-xs tabular-nums`,children:s}),(0,y.jsx)(SE,{size:`icon-xs`,onClick:o,disabled:n.resultCount===0,"aria-label":`previous match`,children:(0,y.jsx)(lb,{})}),(0,y.jsx)(SE,{size:`icon-xs`,onClick:a,disabled:n.resultCount===0,"aria-label":`next match`,children:(0,y.jsx)(cb,{})})]})]})};function EE(e){let t=b.useRef(!0);t.current&&(t.current=!1,e())}function DE(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}var OE={},kE={},AE=``;function jE(e){if(typeof document>`u`)return!1;let t=VC(e);return Xx(t).innerWidth-t.documentElement.clientWidth>0}function ME(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=VC(e),n=t.documentElement,r=t.body,i=nS(n)?n:r,a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function NE(e){let t=VC(e),n=t.documentElement,r=t.body,i=nS(n)?n:r,a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function PE(e){let t=VC(e),n=t.documentElement,r=t.body,i=Xx(n),a=0,o=0,s=!1,c=VT.create();if(KC&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let t=i.getComputedStyle(n),c=i.getComputedStyle(r),l=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,OE={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},AE=n.style.scrollBehavior,kE={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let u=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,f=t.overflowY===`scroll`||c.overflowY===`scroll`,p=t.overflowX===`scroll`||c.overflowX===`scroll`,m=Math.max(0,i.innerWidth-r.clientWidth),h=Math.max(0,i.innerHeight-r.clientHeight),g=parseFloat(c.marginTop)+parseFloat(c.marginBottom),_=parseFloat(c.marginLeft)+parseFloat(c.marginRight),v=nS(n)?n:r;if(s=ME(e),s){n.style.scrollbarGutter=l,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`;return}Object.assign(n.style,{scrollbarGutter:l,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(n.style.overflowY=`scroll`),(d||p)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:g||h?`calc(100dvh - ${g+h}px)`:`100dvh`,width:_||m?`calc(100vw - ${_+m}px)`:`100vw`,boxSizing:`border-box`,overflow:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`}function u(){Object.assign(n.style,OE),Object.assign(r.style,kE),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=AE)}function d(){u(),c.request(l)}l();let f=DE(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&f()}}var FE=new class{lockCount=0;restore=null;timeoutLock=LT.create();timeoutUnlock=LT.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=VC(e).documentElement,n=Xx(t).getComputedStyle(t).overflowY;if(n===`hidden`||n===`clip`){this.restore=oC;return}let r=qC||!jE(e);this.restore=r?NE(e):PE(e)}};function IE(e=!0,t=null){Q(()=>{if(e)return FE.acquire(t)},[e,t])}function LE(e,t){return t!=null&&!ww(t)?0:typeof e==`function`?e():e}function RE(e,t,n){let r=LE(e,n);return typeof r==`number`?r:r?.[t]}function zE(e){return typeof e==`function`?e():e}function BE(e,t){return t||e===`click`||e===`mousedown`}var VE=b.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new LT,currentIdRef:{current:null},currentContextRef:{current:null}});function HE(e){let{children:t,delay:n,timeoutMs:r=0}=e,i=b.useRef(n),a=b.useRef(n),o=b.useRef(null),s=b.useRef(null),c=RT();return(0,y.jsx)(VE.Provider,{value:b.useMemo(()=>({hasProvider:!0,delayRef:i,initialDelayRef:a,currentIdRef:o,timeoutMs:r,currentContextRef:s,timeout:c}),[r,c]),children:t})}function UE(e,t={open:!1}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`floatingId`),{open:i}=t,{currentIdRef:a,delayRef:o,timeoutMs:s,initialDelayRef:c,currentContextRef:l,hasProvider:u,timeout:d}=b.useContext(VE),[f,p]=b.useState(!1);return Q(()=>{function e(){p(!1),l.current?.setIsInstantPhase(!1),a.current=null,l.current=null,o.current=c.current}if(a.current&&!i&&a.current===r){if(p(!1),s){let t=r;return d.start(s,()=>{n.select(`open`)||a.current&&a.current!==t||e()}),()=>{d.clear()}}e()}},[i,r,a,o,s,c,l,d,n]),Q(()=>{if(!i)return;let e=l.current,t=a.current;d.clear(),l.current={onOpenChange:n.setOpen,setIsInstantPhase:p},a.current=r,o.current={open:0,close:RE(c.current,`close`)},t!==null&&t!==r?(p(!0),e?.setIsInstantPhase(!0),e?.onOpenChange(!1,mE(eE))):(p(!1),e?.setIsInstantPhase(!1))},[i,r,n,a,o,s,c,l,d]),Q(()=>()=>{l.current=null},[l]),b.useMemo(()=>({hasProvider:u,delayRef:o,isInstantPhase:f}),[u,o,f])}function WE(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function GE(e){let t=bS(KE,e).current;return t.next=e,Q(t.effect),t}function KE(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var qE={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},JE={...qE,position:`fixed`,top:0,left:0},YE={...qE,position:`absolute`},XE=b.forwardRef(function(e,t){let[n,r]=b.useState();Q(()=>{JC&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,y.jsx)(`span`,{...e,ref:t,style:JE,"aria-hidden":n?void 0:!0,...i,"data-base-ui-focus-guard":``})});function ZE(e){return`data-base-ui-${e}`}var QE=0;function $E(e,t={}){let{preventScroll:n=!1,cancelPrevious:r=!0,sync:i=!1}=t;r&&cancelAnimationFrame(QE);let a=()=>e?.focus({preventScroll:n});if(i)return a(),oC;let o=requestAnimationFrame(a);return QE=o,()=>{QE===o&&(cancelAnimationFrame(o),QE=0)}}var eD={inert:new WeakMap,"aria-hidden":new WeakMap},tD=`data-base-ui-inert`,nD={inert:new WeakSet,"aria-hidden":new WeakSet},rD=new WeakMap,iD=0;function aD(e){return nD[e]}function oD(e){return e?tS(e)?e.host:oD(e.parentNode):null}var sD=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=oD(t);return e.contains(n)?n:null}).filter(e=>e!=null),cD=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},lD=(e,t,n)=>{let r=[],i=e=>{!e||n.has(e)||Array.from(e.children).forEach(e=>{Yx(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function uD(e,t,n,r,{mark:i=!0,markerIgnoreElements:a=[]}){let o=r?`inert`:n?`aria-hidden`:null,s=null,c=null,l=sD(t,e),u=i?sD(t,a):[],d=new Set(u),f=i?lD(t,cD(l),new Set(l)).filter(e=>!d.has(e)):[],p=[],m=[];if(o){let e=eD[o],n=aD(o);c=n,s=e;let r=sD(t,Array.from(t.querySelectorAll(`[aria-live]`))),i=l.concat(r);lD(t,cD(i),new Set(i)).forEach(t=>{let r=t.getAttribute(o),i=r!==null&&r!==`false`,a=(e.get(t)||0)+1;e.set(t,a),p.push(t),a===1&&i&&n.add(t),i||t.setAttribute(o,o===`inert`?``:`true`)})}return i&&f.forEach(e=>{let t=(rD.get(e)||0)+1;rD.set(e,t),m.push(e),t===1&&e.setAttribute(tD,``)}),iD+=1,()=>{s&&p.forEach(e=>{let t=(s.get(e)||0)-1;s.set(e,t),t||(!c?.has(e)&&o&&e.removeAttribute(o),c?.delete(e))}),i&&m.forEach(e=>{let t=(rD.get(e)||0)-1;rD.set(e,t),t||e.removeAttribute(tD)}),--iD,iD||(eD.inert=new WeakMap,eD[`aria-hidden`]=new WeakMap,nD.inert=new WeakSet,nD[`aria-hidden`]=new WeakSet,rD=new WeakMap)}}function dD(e,t={}){let{ariaHidden:n=!1,inert:r=!1,mark:i=!0,markerIgnoreElements:a=[]}=t,o=VC(e[0]).body;return uD(e,o,n,r,{mark:i,markerIgnoreElements:a})}var fD={style:{transition:`none`}},pD=`data-base-ui-click-trigger`,mD={fallbackAxisSide:`none`},hD={fallbackAxisSide:`end`},gD={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},_D=b.createContext(null),vD=()=>b.useContext(_D),yD=ZE(`portal`);function bD(e={}){let{ref:t,container:n,componentProps:r=cC,elementProps:i}=e,a=NC(),o=vD()?.portalNode,[s,c]=b.useState(null),[l,u]=b.useState(null),d=CS(e=>{e!==null&&u(e)}),f=b.useRef(null);Q(()=>{if(n===null){f.current&&(f.current=null,u(null),c(null));return}if(a==null)return;let e=(n&&(Qx(n)?n:n.current))??o??document.body;if(e==null){f.current&&(f.current=null,u(null),c(null));return}f.current!==e&&(f.current=e,u(null),c(e))},[n,o,a]);let p=fC(`div`,r,{ref:[t,d],props:[{id:a,[yD]:``},i]});return{portalNode:l,portalSubtree:s&&p?JT.createPortal(p,s):null}}var xD=b.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,renderGuards:o,style:s,...c}=e,{portalNode:l,portalSubtree:u}=bD({container:r,ref:t,componentProps:e,elementProps:c}),d=b.useRef(null),f=b.useRef(null),p=b.useRef(null),m=b.useRef(null),[h,g]=b.useState(null),_=b.useRef(!1),v=h?.modal,x=h?.open,S=typeof o==`boolean`?o:!!h&&!h.modal&&h.open&&!!l;b.useEffect(()=>{if(!l||v)return;function e(e){l&&e.relatedTarget&&jT(e)&&(e.type===`focusin`?_.current&&=(NT(l),!1):(MT(l),_.current=!0))}return WE(DE(l,`focusin`,e,!0),DE(l,`focusout`,e,!0))},[l,v]),b.useEffect(()=>{!l||x!==!1||(NT(l),_.current=!1)},[x,l]);let C=b.useMemo(()=>({beforeOutsideRef:d,afterOutsideRef:f,beforeInsideRef:p,afterInsideRef:m,portalNode:l,setFocusManagerState:g}),[l]);return(0,y.jsxs)(b.Fragment,{children:[u,(0,y.jsxs)(_D.Provider,{value:C,children:[S&&l&&(0,y.jsx)(XE,{"data-type":`outside`,ref:d,onFocus:e=>{jT(e,l)?p.current?.focus():AT(h?h.domReference:null)?.focus()}}),S&&l&&(0,y.jsx)(`span`,{"aria-owns":l.id,style:gD}),l&&JT.createPortal(n,l),S&&l&&(0,y.jsx)(XE,{"data-type":`outside`,ref:f,onFocus:e=>{jT(e,l)?m.current?.focus():(kT(h?h.domReference:null)?.focus(),h?.closeOnFocusOut&&h?.onOpenChange(!1,mE(`focus-out`,e.nativeEvent)))}})]})]})});function SD(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var CD=b.createContext(null),wD=b.createContext(null),TD=()=>b.useContext(CD)?.id||null,ED=e=>{let t=b.useContext(wD);return e??t};function DD(e,t){let n=Xx(lw(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||`keyboard`:`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var OD=20,kD=[];function AD(){kD=kD.filter(e=>e.deref()?.isConnected)}function jD(e){AD(),e&&Yx(e)!==`body`&&(kD.push(new WeakRef(e)),kD.length>OD&&(kD=kD.slice(-OD)))}function MD(){return AD(),kD[kD.length-1]?.deref()}function ND(e){return e?TT(e)?e:DT(e)[0]||e:null}function PD(e,t){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!t.current.includes(`floating`)&&!e.getAttribute(`role`)?.includes(`dialog`))return;let n=ET(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return TT(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),r=e.getAttribute(`tabindex`);t.current.includes(`floating`)||n.length===0?r!==`0`&&e.setAttribute(`tabindex`,`0`):(r!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function FD(e){let{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:a=!0,restoreFocus:o=!1,modal:s=!0,closeOnFocusOut:c=!0,openInteractionType:l=``,nextFocusableElement:u,previousFocusableElement:d,beforeContentFocusGuardRef:f,externalTree:p,getInsideElements:m}=e,h=`rootStore`in t?t.rootStore:t,g=h.useState(`open`),_=h.useState(`domReferenceElement`),v=h.useState(`floatingElement`),{events:x,dataRef:S}=h.context,C=CS(()=>S.current.floatingContext?.nodeId),w=i===!1,T=hw(_)&&w,E=b.useRef([`content`]),D=GE(i),O=GE(a),k=GE(l),A=ED(p),j=vD(),M=b.useRef(!1),N=b.useRef(!1),P=b.useRef(!1),F=b.useRef(null),I=b.useRef(``),L=b.useRef(``),R=b.useRef(null),z=b.useRef(null),ee=ZS(R,f,j?.beforeInsideRef),B=ZS(z,j?.afterInsideRef),V=RT(),H=RT(),te=HT(),ne=j!=null,U=_w(v),re=CS((e=U)=>e?DT(e):[]),ie=CS(()=>m?.().filter(e=>e!=null)??[]);b.useEffect(()=>{if(r||!s)return;function e(e){e.key===`Tab`&&cw(U,sw(VC(U)))&&re().length===0&&!T&&bw(e)}return DE(VC(U),`keydown`,e)},[r,_,U,s,E,T,re]),b.useEffect(()=>{if(r||!g)return;let e=VC(U);function t(){P.current=!1}function n(e){let t=lw(e),n=ie();P.current=!(cw(v,t)||cw(_,t)||cw(j?.portalNode,t)||n.some(e=>e===t||cw(e,t))),L.current=e.pointerType||`keyboard`,t?.closest(`[data-base-ui-click-trigger]`)&&(N.current=!0)}function i(){L.current=`keyboard`}return WE(DE(e,`pointerdown`,n,!0),DE(e,`pointerup`,t,!0),DE(e,`pointercancel`,t,!0),DE(e,`keydown`,i,!0))},[r,v,_,U,g,j,ie]),b.useEffect(()=>{if(r||!c)return;let e=VC(U);function t(){N.current=!0,H.start(0,()=>{N.current=!1})}function n(e){let t=lw(e);TT(t)&&(F.current=t)}function i(t){let n=t.relatedTarget,r=t.currentTarget,i=lw(t);queueMicrotask(()=>{let a=C(),c=h.context.triggerElements,l=ie(),f=n?.hasAttribute(ZE(`focus-guard`))&&[R.current,z.current,j?.beforeInsideRef.current,j?.afterInsideRef.current,j?.beforeOutsideRef.current,j?.afterOutsideRef.current,UT(d),UT(u)].includes(n),p=!(cw(_,n)||cw(v,n)||cw(n,v)||cw(j?.portalNode,n)||l.some(e=>e===n||cw(e,n))||n!=null&&c.hasElement(n)||c.hasMatchingElement(e=>cw(e,n))||f||A&&(vw(A.nodesRef.current,a).find(e=>cw(e.context?.elements.floating,n)||cw(e.context?.elements.domReference,n))||yw(A.nodesRef.current,a).find(e=>[e.context?.elements.floating,_w(e.context?.elements.floating)].includes(n)||e.context?.elements.domReference===n)));if(r===_&&U&&PD(U,E),o&&r!==_&&!dT(i)&&sw(e)===e.body){if(eS(U)&&(U.focus(),o===`popup`)){te.request(()=>{U.focus()});return}let e=re(),t=F.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||U;eS(n)&&n.focus()}if(S.current.insideReactTree){S.current.insideReactTree=!1;return}(T||!s)&&n&&p&&!N.current&&(T||n!==MD())&&(M.current=!0,h.setOpen(!1,mE(sE,t)))})}function a(){P.current||(S.current.insideReactTree=!0,V.start(0,()=>{S.current.insideReactTree=!1}))}let l=eS(_)?_:null;if(!(!v&&!l))return WE(l&&DE(l,`focusout`,i),l&&DE(l,`pointerdown`,t),v&&DE(v,`focusin`,n),v&&DE(v,`focusout`,i),v&&j&&DE(v,`focusout`,a,!0))},[r,_,v,U,s,A,j,h,c,o,re,T,C,E,S,V,H,te,u,d,ie]),b.useEffect(()=>{if(r||!v||!g)return;let e=Array.from(j?.portalNode?.querySelectorAll(`[${ZE(`portal`)}]`)||[]),t=(A?yw(A.nodesRef.current,C()):[]).find(e=>hw(e.context?.elements.domReference||null))?.context?.elements.domReference,n=dD([...[v,...e,R.current,z.current,j?.beforeOutsideRef.current,j?.afterOutsideRef.current,...ie()],t,UT(d),UT(u),T?_:null].filter(e=>e!=null),{ariaHidden:s||T,mark:!1}),i=dD([v,...e].filter(e=>e!=null));return()=>{i(),n()}},[g,r,_,v,s,E,j,T,A,C,u,d,ie]),Q(()=>{if(!g||r||!eS(U))return;let e=sw(VC(U));queueMicrotask(()=>{let t=D.current,n=typeof t==`function`?t(k.current||``):t;if(n===void 0||n===!1||cw(U,e))return;let r=null,i=()=>(r??=re(U),r[0]||U),a;a=n===!0||n===null?i():UT(n),a||=i(),$E(a,{preventScroll:a===U})})},[r,g,U,w,re,D,k]),Q(()=>{if(r||!U)return;let e=VC(U);jD(sw(e));function t(e){if(e.open||(I.current=DD(e.nativeEvent,L.current)),e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`&&(M.current=!0),e.reason===`outside-press`)if(e.nested)M.current=!1;else if(Sw(e.nativeEvent)||Cw(e.nativeEvent))M.current=!1;else{let e=!1;VC(U).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?M.current=!1:M.current=!0}}x.on(`openchange`,t);function n(){let e=O.current,t=typeof e==`function`?e(I.current):e;if(t===void 0||t===!1)return null;if(t===null&&(t=!0),typeof t==`boolean`){let e=_||MD();return e&&e.isConnected?e:null}let n=_||MD();return UT(t)||n||null}return()=>{x.off(`openchange`,t);let r=sw(e),i=ie(),a=cw(v,r)||i.some(e=>e===r||cw(e,r))||A&&vw(A.nodesRef.current,C(),!1).some(e=>cw(e.context?.elements.floating,r)),o=O.current,s=n();queueMicrotask(()=>{let t=ND(s),n=typeof o!=`boolean`;o&&!M.current&&eS(t)&&(!(!n&&t!==r&&r!==e.body)||a)&&t.focus({preventScroll:!0}),M.current=!1})}},[r,v,U,O,S,x,A,_,C,ie]),Q(()=>{if(!KC||g||!v)return;let e=sw(VC(v));!eS(e)||!pw(e)||cw(v,e)&&e.blur()},[g,v]),Q(()=>{if(!(r||!j))return j.setFocusManagerState({modal:s,closeOnFocusOut:c,open:g,onOpenChange:h.setOpen,domReference:_}),()=>{j.setFocusManagerState(null)}},[r,j,s,g,h,c,_]),Q(()=>{if(!(r||!U))return PD(U,E),()=>{queueMicrotask(AD)}},[r,U,E]);let ae=!r&&(s?!T:!0)&&(ne||s);return(0,y.jsxs)(b.Fragment,{children:[ae&&(0,y.jsx)(XE,{"data-type":`inside`,ref:ee,onFocus:e=>{if(s){let e=re();$E(e[e.length-1])}else j?.portalNode&&(M.current=!1,jT(e,j.portalNode)?kT(_)?.focus():UT(d??j.beforeOutsideRef)?.focus())}}),n,ae&&(0,y.jsx)(XE,{"data-type":`inside`,ref:B,onFocus:e=>{s?$E(re()[0]):j?.portalNode&&(c&&(M.current=!0),jT(e,j.portalNode)?AT(_)?.focus():UT(u??j.afterOutsideRef)?.focus())}})]})}function ID(e,t={}){let n=`rootStore`in e?e.rootStore:e,r=n.context.dataRef,{enabled:i=!0,event:a=`click`,toggle:o=!0,ignoreMouse:s=!1,stickIfOpen:c=!0,touchOpenDelay:l=0,reason:u=tE}=t,d=b.useRef(void 0),f=HT(),p=RT(),m=b.useMemo(()=>({onPointerDown(e){d.current=e.pointerType},onMouseDown(e){let t=d.current,i=e.nativeEvent,m=n.select(`open`);if(e.button!==0||a===`click`||ww(t,!0)&&s)return;let h=r.current.openEvent,g=h?.type,_=n.select(`domReferenceElement`)!==e.currentTarget,v=m&&_||!(m&&o&&(!(h&&c)||g===`click`||g===`mousedown`)),y=lw(i);if(pw(y)){let e=mE(u,i,y);v&&t===`touch`&&l>0?p.start(l,()=>{n.setOpen(!0,e)}):n.setOpen(v,e);return}let b=e.currentTarget;f.request(()=>{let e=mE(u,i,b);v&&t===`touch`&&l>0?p.start(l,()=>{n.setOpen(!0,e)}):n.setOpen(v,e)})},onClick(e){if(a===`mousedown-only`)return;let t=d.current;if(a===`mousedown`&&t){d.current=void 0;return}if(ww(t,!0)&&s)return;let i=n.select(`open`),f=r.current.openEvent,m=n.select(`domReferenceElement`)!==e.currentTarget,h=i&&m||!(i&&o&&(!(f&&c)||Tw(f))),g=mE(u,e.nativeEvent,e.currentTarget);h&&t===`touch`&&l>0?p.start(l,()=>{n.setOpen(!0,g)}):n.setOpen(h,g)},onKeyDown(){d.current=void 0}}),[r,a,s,n,c,o,f,p,l,u]);return b.useMemo(()=>i?{reference:m}:cC,[i,m])}function LD(e,t){let n=null,r=null,i=!1;return{contextElement:e||void 0,getBoundingClientRect(){let a=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},o=t.axis===`x`||t.axis===`both`,s=t.axis===`y`||t.axis===`both`,c=[`mouseenter`,`mousemove`].includes(t.dataRef.current.openEvent?.type||``)&&t.pointerType!==`touch`,l=a.width,u=a.height,d=a.x,f=a.y;return n==null&&t.x&&o&&(n=a.x-t.x),r==null&&t.y&&s&&(r=a.y-t.y),d-=n||0,f-=r||0,l=0,u=0,!i||c?(l=t.axis===`y`?a.width:0,u=t.axis===`x`?a.height:0,d=o&&t.x!=null?t.x:d,f=s&&t.y!=null?t.y:f):i&&!c&&(u=t.axis===`x`?a.height:u,l=t.axis===`y`?a.width:l),i=!0,{width:l,height:u,x:d,y:f,top:f,right:d+l,bottom:f+u,left:d}}}}function RD(e){return e!=null&&e.clientX!=null}function zD(e,t={}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`open`),i=n.useState(`floatingElement`),a=n.useState(`domReferenceElement`),o=n.context.dataRef,{enabled:s=!0,axis:c=`both`}=t,l=b.useRef(!1),u=b.useRef(null),[d,f]=b.useState(),[p,m]=b.useState([]),h=CS((e,t,r)=>{l.current||o.current.openEvent&&!RD(o.current.openEvent)||n.set(`positionReference`,LD(r??a,{x:e,y:t,axis:c,dataRef:o,pointerType:d}))}),g=CS(e=>{r?u.current||m([]):h(e.clientX,e.clientY,e.currentTarget)}),_=ww(d)?i:r,v=b.useCallback(()=>{if(!_||!s)return;let e=Xx(i);function t(e){cw(i,lw(e))?(u.current?.(),u.current=null):h(e.clientX,e.clientY)}if(!o.current.openEvent||RD(o.current.openEvent))return u.current=DE(e,`mousemove`,t),()=>{u.current?.(),u.current=null};n.set(`positionReference`,a)},[_,s,i,o,a,n,h]);b.useEffect(()=>v(),[v,p]),b.useEffect(()=>{s&&!i&&(l.current=!1)},[s,i]),b.useEffect(()=>{!s&&r&&(l.current=!0)},[s,r]);let y=b.useMemo(()=>{function e(e){f(e.pointerType)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:g,onMouseEnter:g}},[g]);return b.useMemo(()=>s?{reference:y,trigger:y}:{},[s,y])}var BD={intentional:`onClick`,sloppy:`onPointerDown`};function VD(){return!1}function HD(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function UD(e,t={}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`open`),i=n.useState(`floatingElement`),{dataRef:a}=n.context,{enabled:o=!0,escapeKey:s=!0,outsidePress:c=!0,outsidePressEvent:l=`sloppy`,referencePress:u=VD,referencePressEvent:d=`sloppy`,bubbles:f,externalTree:p}=t,m=ED(p),h=CS(typeof c==`function`?c:()=>!1),g=typeof c==`function`?h:c,_=g!==!1,v=CS(()=>l),y=b.useRef(!1),x=b.useRef(!1),S=b.useRef(!1),{escapeKey:C,outsidePress:w}=HD(f),T=b.useRef(null),E=RT(),D=RT(),O=CS(()=>{D.clear(),a.current.insideReactTree=!1}),k=b.useRef(!1),A=b.useRef(``),j=CS(u),M=CS(e=>{if(!r||!o||!s||e.key!==`Escape`||k.current)return;let t=a.current.floatingContext?.nodeId,i=m?vw(m.nodesRef.current,t):[];if(!C&&i.length>0){let e=!0;if(i.forEach(t=>{t.context?.open&&!t.context.dataRef.current.__escapeKeyBubbles&&(e=!1)}),!e)return}let c=mE(cE,xw(e)?e.nativeEvent:e);n.setOpen(!1,c),!C&&!c.isPropagationAllowed&&e.stopPropagation()}),N=CS(()=>{a.current.insideReactTree=!0,D.start(0,O)});b.useEffect(()=>{if(!r||!o)return;a.current.__escapeKeyBubbles=C,a.current.__outsidePressBubbles=w;let e=new LT,t=new LT;function c(){e.clear(),k.current=!0}function l(){e.start(dS()?5:0,()=>{k.current=!1})}function u(){S.current=!0,t.start(0,()=>{S.current=!1})}function d(){y.current=!1,x.current=!1}function f(){let e=A.current,t=e===`pen`||!e?`mouse`:e,n=v(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function p(e){let t=f();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function h(e){let t=a.current.floatingContext?.nodeId,r=m&&vw(m.nodesRef.current,t).some(t=>dw(e,t.context?.elements.floating));return dw(e,n.select(`floatingElement`))||dw(e,n.select(`domReferenceElement`))||r}function b(e){if(p(e)){O();return}if(a.current.insideReactTree){O();return}let r=lw(e),i=`[${ZE(`inert`)}]`,o=$x(r)?r.getRootNode():null,s=Array.from((tS(o)?o:VC(n.select(`floatingElement`))).querySelectorAll(i)),c=n.context.triggerElements;if(r&&(c.hasElement(r)||c.hasMatchingElement(e=>cw(e,r))))return;let l=$x(r)?r:null;for(;l&&!fS(l);){let e=hS(l);if(fS(e)||!$x(e))break;l=e}if(s.length&&$x(r)&&!fw(r)&&!cw(r,n.select(`floatingElement`))&&s.every(e=>!cw(l,e)))return;if(eS(r)&&!(`touches`in e)){let t=fS(r),n=pS(r),i=/auto|scroll/,a=t||i.test(n.overflowX),o=t||i.test(n.overflowY),s=a&&r.clientWidth>0&&r.scrollWidth>r.clientWidth,c=o&&r.clientHeight>0&&r.scrollHeight>r.clientHeight,l=n.direction===`rtl`,u=c&&(l?e.offsetX<=r.offsetWidth-r.clientWidth:e.offsetX>r.clientWidth),d=s&&e.offsetY>r.clientHeight;if(u||d)return}if(h(e))return;if(f()===`intentional`&&S.current){t.clear(),S.current=!1;return}if(typeof g==`function`&&!g(e))return;let u=a.current.floatingContext?.nodeId,d=m?vw(m.nodesRef.current,u):[];if(d.length>0){let e=!0;if(d.forEach(t=>{t.context?.open&&!t.context.dataRef.current.__outsidePressBubbles&&(e=!1)}),!e)return}n.setOpen(!1,mE(iE,e)),O()}function D(e){f()!==`sloppy`||e.pointerType===`touch`||!n.select(`open`)||!o||dw(e,n.select(`floatingElement`))||dw(e,n.select(`domReferenceElement`))||b(e)}function j(e){if(f()!==`sloppy`||!n.select(`open`)||!o||dw(e,n.select(`floatingElement`))||dw(e,n.select(`domReferenceElement`)))return;let t=e.touches[0];t&&(T.current={startTime:Date.now(),startX:t.clientX,startY:t.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},E.start(1e3,()=>{T.current&&(T.current.dismissOnTouchEnd=!1,T.current.dismissOnMouseDown=!1)}))}function N(e,t){let n=lw(e);if(!n)return;let r=DE(n,e.type,()=>{t(e),r()})}function P(e){A.current=`touch`,N(e,j)}function F(e){E.clear(),e.type===`pointerdown`&&(A.current=e.pointerType),!(e.type===`mousedown`&&T.current&&!T.current.dismissOnMouseDown)&&N(e,e=>{e.type===`pointerdown`?D(e):b(e)})}function I(e){if(!y.current)return;let n=x.current;if(d(),f()===`intentional`){if(e.type===`pointercancel`){n&&u();return}if(!h(e)){if(n){u();return}typeof g==`function`&&!g(e)||(t.clear(),S.current=!0,O())}}}function L(e){if(f()!==`sloppy`||!T.current||dw(e,n.select(`floatingElement`))||dw(e,n.select(`domReferenceElement`)))return;let t=e.touches[0];if(!t)return;let r=Math.abs(t.clientX-T.current.startX),i=Math.abs(t.clientY-T.current.startY),a=Math.sqrt(r*r+i*i);a>5&&(T.current.dismissOnTouchEnd=!0),a>10&&(b(e),E.clear(),T.current=null)}function R(e){N(e,L)}function z(e){f()!==`sloppy`||!T.current||dw(e,n.select(`floatingElement`))||dw(e,n.select(`domReferenceElement`))||(T.current.dismissOnTouchEnd&&b(e),E.clear(),T.current=null)}function ee(e){N(e,z)}let B=VC(i),V=WE(s&&WE(DE(B,`keydown`,M),DE(B,`compositionstart`,c),DE(B,`compositionend`,l)),_&&WE(DE(B,`click`,F,!0),DE(B,`pointerdown`,F,!0),DE(B,`pointerup`,I,!0),DE(B,`pointercancel`,I,!0),DE(B,`mousedown`,F,!0),DE(B,`mouseup`,I,!0),DE(B,`touchstart`,P,!0),DE(B,`touchmove`,R,!0),DE(B,`touchend`,ee,!0)));return()=>{V(),e.clear(),t.clear(),d(),S.current=!1}},[a,i,s,_,g,r,o,C,w,M,O,v,m,n,E]),b.useEffect(O,[g,O]);let P=b.useMemo(()=>({onKeyDown:M,[BD[d]]:e=>{j()&&n.setOpen(!1,mE(tE,e.nativeEvent))},...d!==`intentional`&&{onClick(e){j()&&n.setOpen(!1,mE(`trigger-press`,e.nativeEvent))}}}),[M,n,d,j]),F=CS(e=>{if(!r||!o||e.button!==0)return;let t=lw(e.nativeEvent);cw(n.select(`floatingElement`),t)&&(y.current||(y.current=!0,x.current=!1))}),I=CS(e=>{!r||!o||(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&y.current&&(x.current=!0)}),L=b.useMemo(()=>({onKeyDown:M,onPointerDown:I,onMouseDown:I,onClickCapture:N,onMouseDownCapture(e){N(),F(e)},onPointerDownCapture(e){N(),F(e)},onMouseUpCapture:N,onTouchEndCapture:N,onTouchMoveCapture:N}),[M,N,F,I]);return b.useMemo(()=>o?{reference:P,floating:L,trigger:P}:{},[o,P,L])}function WD(e,t,n){let{reference:r,floating:i}=e,a=zw(t),o=Bw(t),s=Rw(o),c=Fw(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(Iw(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function GD(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=Pw(t,e),p=Qw(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=$w(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=$w(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var KD=50,qD=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:GD},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=WD(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<KD&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=WD(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},JD=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=Pw(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Fw(r),_=zw(o),v=Fw(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Xw(o)]:Hw(o)),x=p!==`none`;!d&&x&&b.push(...Yw(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=Vw(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==zw(t))||T.every(e=>zw(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=zw(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function YD(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function XD(e){return Ew.some(t=>e[t]>=0)}var ZD=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=Pw(e,t);switch(i){case`referenceHidden`:{let e=YD(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:XD(e)}}}case`escaped`:{let e=YD(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:XD(e)}}}default:return{}}}}},QD=new Set([`left`,`top`]);async function $D(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Fw(n),s=Iw(n),c=zw(n)===`y`,l=QD.has(o)?-1:1,u=a&&c?-1:1,d=Pw(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var eO=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await $D(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},tO=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Pw(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=zw(Fw(i)),p=Lw(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=Nw(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=Nw(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},nO=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=Pw(e,t),u={x:n,y:r},d=zw(i),f=Lw(d),p=u[f],m=u[d],h=Pw(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=QD.has(Fw(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},rO=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=Pw(e,t),u=await o.detectOverflow(t,l),d=Fw(i),f=Iw(i),p=zw(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=Dw(h-u[g],v),x=Dw(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=Ow(u.left,0),t=Ow(u.right,0),n=Ow(u.top,0),r=Ow(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:Ow(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:Ow(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function iO(e){let t=pS(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=eS(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=kw(n)!==a||kw(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function aO(e){return $x(e)?e:e.contextElement}function oO(e){let t=aO(e);if(!eS(t))return jw(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=iO(t),o=(a?kw(n.width):n.width)/r,s=(a?kw(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var sO=jw(0);function cO(e){let t=Xx(e);return!dS()||!t.visualViewport?sO:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function lO(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Xx(e)?!1:t}function uO(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=aO(e),o=jw(1);t&&(r?$x(r)&&(o=oO(r)):o=oO(e));let s=lO(a,n,r)?cO(a):jw(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=Xx(a),t=r&&$x(r)?Xx(r):r,n=e,i=vS(n);for(;i&&r&&t!==n;){let e=oO(i),t=i.getBoundingClientRect(),r=pS(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=Xx(i),i=vS(n)}}return $w({width:u,height:d,x:c,y:l})}function dO(e,t){let n=mS(e).scrollLeft;return t?t.left+n:uO(Zx(e)).left+n}function fO(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-dO(e,n),y:n.top+t.scrollTop}}function pO(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Zx(r),s=t?iS(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=jw(1),u=jw(0),d=eS(r);if((d||!d&&!a)&&((Yx(r)!==`body`||nS(o))&&(c=mS(r)),d)){let e=uO(r);l=oO(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?fO(o,c):jw(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function mO(e){return Array.from(e.getClientRects())}function hO(e){let t=Zx(e),n=mS(e),r=e.ownerDocument.body,i=Ow(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=Ow(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+dO(e),s=-n.scrollTop;return pS(r).direction===`rtl`&&(o+=Ow(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var gO=25;function _O(e,t){let n=Xx(e),r=Zx(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=dS();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=dO(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=gO&&(a-=o)}else l<=gO&&(a+=l);return{width:a,height:o,x:s,y:c}}function vO(e,t){let n=uO(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=eS(e)?oO(e):jw(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function yO(e,t,n){let r;if(t===`viewport`)r=_O(e,n);else if(t===`document`)r=hO(Zx(e));else if($x(t))r=vO(t,n);else{let n=cO(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return $w(r)}function bO(e,t){let n=hS(e);return n===t||!$x(n)||fS(n)?!1:pS(n).position===`fixed`||bO(n,t)}function xO(e,t){let n=t.get(e);if(n)return n;let r=_S(e,[],!1).filter(e=>$x(e)&&Yx(e)!==`body`),i=null,a=pS(e).position===`fixed`,o=a?hS(e):e;for(;$x(o)&&!fS(o);){let t=pS(o),n=lS(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||nS(o)&&!n&&bO(e,o))?r=r.filter(e=>e!==o):i=t,o=hS(o)}return t.set(e,r),r}function SO(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?iS(t)?[]:xO(t,this._c):[].concat(n),r],o=yO(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=yO(t,a[e],i);s=Ow(n.top,s),c=Dw(n.right,c),l=Dw(n.bottom,l),u=Ow(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function CO(e){let{width:t,height:n}=iO(e);return{width:t,height:n}}function wO(e,t,n){let r=eS(t),i=Zx(t),a=n===`fixed`,o=uO(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=jw(0);function l(){c.x=dO(i)}if(r||!r&&!a)if((Yx(t)!==`body`||nS(i))&&(s=mS(t)),r){let e=uO(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?fO(i,s):jw(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function TO(e){return pS(e).position===`static`}function EO(e,t){if(!eS(e)||pS(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Zx(e)===n&&(n=n.ownerDocument.body),n}function DO(e,t){let n=Xx(e);if(iS(e))return n;if(!eS(e)){let t=hS(e);for(;t&&!fS(t);){if($x(t)&&!TO(t))return t;t=hS(t)}return n}let r=EO(e,t);for(;r&&rS(r)&&TO(r);)r=EO(r,t);return r&&fS(r)&&TO(r)&&!lS(r)?n:r||uS(e)||n}var OO=async function(e){let t=this.getOffsetParent||DO,n=this.getDimensions,r=await n(e.floating);return{reference:wO(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function kO(e){return pS(e).direction===`rtl`}var AO={convertOffsetParentRelativeRectToViewportRelativeRect:pO,getDocumentElement:Zx,getClippingRect:SO,getOffsetParent:DO,getElementRects:OO,getClientRects:mO,getDimensions:CO,getScale:oO,isElement:$x,isRTL:kO};function jO(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function MO(e,t){let n=null,r,i=Zx(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=Aw(d),h=Aw(i.clientWidth-(u+f)),g=Aw(i.clientHeight-(d+p)),_=Aw(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Ow(0,Dw(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!jO(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function NO(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=aO(e),u=i||a?[...l?_S(l):[],...t?_S(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?MO(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?uO(e):null;c&&g();function g(){let t=uO(e);h&&!jO(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var PO=eO,FO=tO,IO=JD,LO=rO,RO=ZD,zO=nO,BO=(e,t,n)=>{let r=new Map,i={platform:AO,...n},a={...i.platform,_c:r};return qD(e,t,{...i,platform:a})},VO=typeof document<`u`?b.useLayoutEffect:function(){};function HO(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!HO(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!HO(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function UO(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function WO(e,t){let n=UO(e);return Math.round(t*n)/n}function GO(e){let t=b.useRef(e);return VO(()=>{t.current=e}),t}function KO(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=b.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=b.useState(r);HO(f,r)||p(r);let[m,h]=b.useState(null),[g,_]=b.useState(null),v=b.useCallback(e=>{e!==C.current&&(C.current=e,h(e))},[]),y=b.useCallback(e=>{e!==w.current&&(w.current=e,_(e))},[]),x=a||m,S=o||g,C=b.useRef(null),w=b.useRef(null),T=b.useRef(u),E=c!=null,D=GO(c),O=GO(i),k=GO(l),A=b.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),BO(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!HO(T.current,t)&&(T.current=t,JT.flushSync(()=>{d(t)}))})},[f,t,n,O,k]);VO(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let j=b.useRef(!1);VO(()=>(j.current=!0,()=>{j.current=!1}),[]),VO(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,A);A()}},[x,S,A,D,E]);let M=b.useMemo(()=>({reference:C,floating:w,setReference:v,setFloating:y}),[v,y]),N=b.useMemo(()=>({reference:x,floating:S}),[x,S]),P=b.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=WO(N.floating,u.x),r=WO(N.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...UO(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,N.floating,u.x,u.y]);return b.useMemo(()=>({...u,update:A,refs:M,elements:N,floatingStyles:P}),[u,A,M,N,P])}var qO=(e,t)=>{let n=PO(e);return{name:n.name,fn:n.fn,options:[e,t]}},JO=(e,t)=>{let n=FO(e);return{name:n.name,fn:n.fn,options:[e,t]}},YO=(e,t)=>({fn:zO(e).fn,options:[e,t]}),XO=(e,t)=>{let n=IO(e);return{name:n.name,fn:n.fn,options:[e,t]}},ZO=(e,t)=>{let n=LO(e);return{name:n.name,fn:n.fn,options:[e,t]}},QO=(e,t)=>{let n=RO(e);return{name:n.name,fn:n.fn,options:[e,t]}},$=(e,t,n,r,i,a,...o)=>{if(o.length>0)throw Error(WS(1));let s;if(e&&t&&n&&r&&i&&a)s=(o,s,c,l)=>a(e(o,s,c,l),t(o,s,c,l),n(o,s,c,l),r(o,s,c,l),i(o,s,c,l),s,c,l);else if(e&&t&&n&&r&&i)s=(a,o,s,c)=>i(e(a,o,s,c),t(a,o,s,c),n(a,o,s,c),r(a,o,s,c),o,s,c);else if(e&&t&&n&&r)s=(i,a,o,s)=>r(e(i,a,o,s),t(i,a,o,s),n(i,a,o,s),a,o,s);else if(e&&t&&n)s=(r,i,a,o)=>n(e(r,i,a,o),t(r,i,a,o),i,a,o);else if(e&&t)s=(n,r,i,a)=>t(e(n,r,i,a),r,i,a);else if(e)s=e;else throw Error(`Missing arguments`);return s},$O=o((e=>{var t=f();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore})),ek=o(((e,t)=>{t.exports=$O()})),tk=o((e=>{var t=f(),n=ek();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),nk=o(((e,t)=>{t.exports=tk()})),rk=[],ik=void 0;function ak(){return ik}function ok(e){rk.push(e)}function sk(e){let t=(t,n)=>{let r=bS(lk).current,i;try{ik=r;for(let e of rk)e.before(r);i=e(t,n);for(let e of rk)e.after(r);r.didInitialize=!0}finally{ik=void 0}return i};return t.displayName=e.displayName||e.name,t}function ck(e){return b.forwardRef(sk(e))}function lk(){return{didInitialize:!1}}var uk=ek(),dk=nk(),fk=iC(19)?hk:gk;function pk(e,t,n,r,i){return fk(e,t,n,r,i)}function mk(e,t,n,r,i){let a=b.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,uk.useSyncExternalStore)(e.subscribe,a,a)}ok({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);(r.didChange||!Object.is(r.value,i))&&(t=!0,r.value=i,r.didChange=!1)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,uk.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function hk(e,t,n,r,i){let a=ak();if(!a)return mk(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],(s.store!==e||s.selector!==t||!Object.is(s.a1,n)||!Object.is(s.a2,r)||!Object.is(s.a3,i))&&(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.didChange=!0)):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i),didChange:!1},a.syncHooks.push(s)),s.value}function gk(e,t,n,r,i){return(0,dk.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var _k=class{constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return pk(this,e,t,n,r)}},vk=class extends _k{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){b.useDebugValue(e),Q(()=>{this.state[e]!==t&&this.set(e,t)},[e,t])}useSyncedValueWithCleanup(e,t){let n=this;Q(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;Q(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){b.useDebugValue(e);let n=t!==void 0;Q(()=>{n&&!Object.is(this.state[e],t)&&super.setState({...this.state,[e]:t})},[e,t,n])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return b.useDebugValue(e),pk(this,this.selectors[e],t,n,r)}useContextCallback(e,t){b.useDebugValue(e);let n=CS(t??oC);this.context[e]=n}useStateSetter(e){let t=b.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}},yk={open:$(e=>e.open),transitionStatus:$(e=>e.transitionStatus),domReferenceElement:$(e=>e.domReferenceElement),referenceElement:$(e=>e.positionReference??e.referenceElement),floatingElement:$(e=>e.floatingElement),floatingId:$(e=>e.floatingId)},bk=class extends vk{constructor(e){let{syncOnly:t,nested:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:SD(),nested:n,triggerElements:i},yk),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&Tw(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)};setOpen=(e,t)=>{if(this.syncOnly){this.context.onOpenChange?.(e,t);return}this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}};function xk(e,t){let n=b.useRef(null),r=b.useRef(null);return b.useCallback(i=>{if(e!==void 0){if(n.current!==null){let e=n.current,i=r.current,a=t.context.triggerElements.getById(e);i&&a===i&&t.context.triggerElements.delete(e),n.current=null,r.current=null}i!==null&&(n.current=e,r.current=i,t.context.triggerElements.add(e,i))}},[t,e])}function Sk(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=xk(e,n),o=CS(t=>{if(a(t),!t||!n.select(`open`))return;let i=n.select(`activeTriggerId`);if(i===e){n.update({activeTriggerElement:t,...r});return}i??n.update({activeTriggerId:e,activeTriggerElement:t,...r})});return Q(()=>{i&&n.update({activeTriggerElement:t.current,...r})},[i,n,t,...Object.values(r)]),{registerTrigger:o,isMountedByThisTrigger:i}}function Ck(e){let t=e.useState(`open`);Q(()=>{if(t&&!e.select(`activeTriggerId`)&&e.context.triggerElements.size===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[n,r]=t.value;e.update({activeTriggerId:n,activeTriggerElement:r})}}},[t,e])}function wk(e,t,n){let{mounted:r,setMounted:i,transitionStatus:a}=ZT(e);t.useSyncedValues({mounted:r,transitionStatus:a});let o=CS(()=>{i(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return XT({enabled:!t.useState(`preventUnmountingOnClose`),open:e,ref:t.context.popupRef,onComplete(){e||o()}}),{forceUnmount:o,transitionStatus:a}}var Tk=class{constructor(){this.elementsSet=new Set,this.idMap=new Map}add(e,t){let n=this.idMap.get(e);n!==t&&(n!==void 0&&this.elementsSet.delete(n),this.elementsSet.add(t),this.idMap.set(e,t))}delete(e){let t=this.idMap.get(e);t&&(this.elementsSet.delete(t),this.idMap.delete(e))}hasElement(e){return this.elementsSet.has(e)}hasMatchingElement(e){for(let t of this.elementsSet)if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.elementsSet.values()}get size(){return this.idMap.size}};function Ek(){return new bk({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new Tk,floatingId:``,syncOnly:!1,nested:!1,onOpenChange:void 0})}function Dk(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:Ek(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:cC,inactiveTriggerProps:cC,popupProps:cC}}var Ok=$(e=>e.triggerIdProp??e.activeTriggerId),kk={open:$(e=>e.openProp??e.open),mounted:$(e=>e.mounted),transitionStatus:$(e=>e.transitionStatus),floatingRootContext:$(e=>e.floatingRootContext),preventUnmountingOnClose:$(e=>e.preventUnmountingOnClose),payload:$(e=>e.payload),activeTriggerId:Ok,activeTriggerElement:$(e=>e.mounted?e.activeTriggerElement:null),isTriggerActive:$((e,t)=>t!==void 0&&Ok(e)===t),isOpenedByTrigger:$((e,t)=>t!==void 0&&Ok(e)===t&&e.open),isMountedByTrigger:$((e,t)=>t!==void 0&&Ok(e)===t&&e.mounted),triggerProps:$((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),popupProps:$(e=>e.popupProps),popupElement:$(e=>e.popupElement),positionerElement:$(e=>e.positionerElement)};function Ak(e){let{open:t=!1,onOpenChange:n,elements:r={}}=e,i=NC(),a=TD()!=null,o=bS(()=>new bk({open:t,transitionStatus:void 0,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new Tk,floatingId:i,syncOnly:!1,nested:a})).current;return Q(()=>{let e={open:t,floatingId:i};r.reference!==void 0&&(e.referenceElement=r.reference,e.domReferenceElement=$x(r.reference)?r.reference:null),r.floating!==void 0&&(e.floatingElement=r.floating),o.update(e)},[t,i,r.reference,r.floating,o]),o.context.onOpenChange=n,o.context.nested=a,o}function jk(e={}){let{nodeId:t,externalTree:n}=e,r=Ak(e),i=e.rootContext||r,a={reference:i.useState(`referenceElement`),floating:i.useState(`floatingElement`),domReference:i.useState(`domReferenceElement`)},[o,s]=b.useState(null),c=b.useRef(null),l=ED(n);Q(()=>{a.domReference&&(c.current=a.domReference)},[a.domReference]);let u=KO({...e,elements:{...a,...o&&{reference:o}}}),d=b.useCallback(e=>{let t=$x(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;s(t),u.refs.setReference(t)},[u.refs]),[f,p]=b.useState(void 0),[m,h]=b.useState(null);i.useSyncedValue(`referenceElement`,f??null);let g=$x(f)?f:null;i.useSyncedValue(`domReferenceElement`,f===void 0?a.domReference:g),i.useSyncedValue(`floatingElement`,m);let _=b.useCallback(e=>{($x(e)||e===null)&&(c.current=e,p(e)),($x(u.refs.reference.current)||u.refs.reference.current===null||e!==null&&!$x(e))&&u.refs.setReference(e)},[u.refs,p]),v=b.useCallback(e=>{h(e),u.refs.setFloating(e)},[u.refs]),y=b.useMemo(()=>({...u.refs,setReference:_,setFloating:v,setPositionReference:d,domReference:c}),[u.refs,_,v,d]),x=b.useMemo(()=>({...u.elements,domReference:a.domReference}),[u.elements,a.domReference]),S=i.useState(`open`),C=i.useState(`floatingId`),w=b.useMemo(()=>({...u,dataRef:i.context.dataRef,open:S,onOpenChange:i.setOpen,events:i.context.events,floatingId:C,refs:y,elements:x,nodeId:t,rootStore:i}),[u,y,x,t,i,S,C]);return Q(()=>{i.context.dataRef.current.floatingContext=w;let e=l?.nodesRef.current.find(e=>e.id===t);e&&(e.context=w)}),b.useMemo(()=>({...u,context:w,refs:y,elements:x,rootStore:i}),[u,y,x,w,i])}function Mk(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,onOpenChange:r}=e,i=NC(),a=TD()!=null,o=t.useState(`open`),s=t.useState(`activeTriggerElement`),c=t.useState(n?`popupElement`:`positionerElement`),l=t.context.triggerElements,u=bS(()=>new bk({open:o,transitionStatus:void 0,referenceElement:s,floatingElement:c,triggerElements:l,onOpenChange:r,floatingId:i,syncOnly:!0,nested:a})).current;return Q(()=>{let e={open:o,floatingId:i,referenceElement:s,floatingElement:c};$x(s)&&(e.domReferenceElement=s),u.state.positionReference===u.state.referenceElement&&(e.positionReference=s),u.update(e)},[o,i,s,c,u]),u.context.onOpenChange=r,u.context.nested=a,u}var Nk=XC&&JC;function Pk(e,t={}){let n=`rootStore`in e?e.rootStore:e,{events:r,dataRef:i}=n.context,{enabled:a=!0,delay:o}=t,s=b.useRef(!1),c=b.useRef(null),l=RT(),u=b.useRef(!0);b.useEffect(()=>{let e=n.select(`domReferenceElement`);if(!a)return;let t=Xx(e);function r(){let e=n.select(`domReferenceElement`);!n.select(`open`)&&eS(e)&&e===sw(VC(e))&&(s.current=!0)}function i(){u.current=!0}function o(){u.current=!1}return WE(DE(t,`blur`,r),Nk&&DE(t,`keydown`,i,!0),Nk&&DE(t,`pointerdown`,o,!0))},[n,a]),b.useEffect(()=>{if(!a)return;function e(e){if(e.reason===`trigger-press`||e.reason===`escape-key`){let e=n.select(`domReferenceElement`);$x(e)&&(c.current=e,s.current=!0)}}return r.on(`openchange`,e),()=>{r.off(`openchange`,e)}},[r,a,n]);let d=b.useMemo(()=>({onMouseLeave(){s.current=!1,c.current=null},onFocus(e){let t=e.currentTarget;if(s.current){if(c.current===t)return;s.current=!1,c.current=null}let r=lw(e.nativeEvent);if($x(r)){if(Nk&&!e.relatedTarget){if(!u.current&&!pw(r))return}else if(!gw(r))return}let i=uw(e.relatedTarget,n.context.triggerElements),{nativeEvent:a,currentTarget:d}=e,f=typeof o==`function`?o():o;if(n.select(`open`)&&i||f===0||f===void 0){n.setOpen(!0,mE(rE,a,d));return}l.start(f,()=>{s.current||n.setOpen(!0,mE(rE,a,d))})},onBlur(e){s.current=!1,c.current=null;let t=e.relatedTarget,r=e.nativeEvent,a=$x(t)&&t.hasAttribute(ZE(`focus-guard`))&&t.getAttribute(`data-type`)===`outside`;l.start(0,()=>{let e=n.select(`domReferenceElement`),o=sw(VC(e));!t&&o===e||cw(i.current.floatingContext?.refs.floating.current,o)||cw(e,o)||a||uw(t??o,n.context.triggerElements)||n.setOpen(!1,mE(rE,r))})}}),[i,n,l,o]);return b.useMemo(()=>a?{reference:d,trigger:d}:{},[a,d])}var Fk=class e{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new LT,this.restTimeout=new LT,this.handleCloseOptions=void 0}static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose},Ik=new WeakMap;function Lk(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;t&&Ik.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty(`pointer-events`),e.pointerEventsReferenceElement?.style.removeProperty(`pointer-events`),e.pointerEventsFloatingElement?.style.removeProperty(`pointer-events`),Ik.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function Rk(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=Ik.get(n);a&&a!==e&&Lk(a),Lk(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,Ik.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function zk(e){let t=bS(Fk.create).current,n=e.context.dataRef.current;return n.hoverInteractionState||=t,FT(n.hoverInteractionState.disposeEffect),n.hoverInteractionState}function Bk(e,t={}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`open`),i=n.useState(`floatingElement`),a=n.useState(`domReferenceElement`),{dataRef:o}=n.context,{enabled:s=!0,closeDelay:c=0,nodeId:l}=t,u=zk(n),d=ED(),f=TD(),p=CS(()=>BE(o.current.openEvent?.type,u.interactedInside)),m=CS(()=>{let e=o.current.openEvent?.type;return e?.includes(`mouse`)&&e!==`mousedown`}),h=CS(e=>uw(e,n.context.triggerElements)),g=b.useCallback(e=>{let t=RE(c,`close`,u.pointerType),r=()=>{n.setOpen(!1,mE(nE,e)),d?.events.emit(`floating.closed`,e)};t?u.openChangeTimeout.start(t,r):(u.openChangeTimeout.clear(),r())},[c,n,u,d]),_=CS(()=>{Lk(u)}),v=CS(e=>{let t=lw(e);if(!mw(t)){u.interactedInside=!1;return}u.interactedInside=t?.closest(`[aria-haspopup]`)!=null});Q(()=>{r||(u.pointerType=void 0,u.restTimeoutPending=!1,u.interactedInside=!1,_())},[r,u,_]),b.useEffect(()=>_,[_]),Q(()=>{if(s&&r&&u.handleCloseOptions?.blockPointerEvents&&m()&&$x(a)&&i){let e=a,t=i,n=VC(i),r=d?.nodesRef.current.find(e=>e.id===f)?.context?.elements.floating;return r&&(r.style.pointerEvents=``),Rk(u,{scopeElement:u.handleCloseOptions?.getScope?.()??u.pointerEventsScopeElement??r??e.closest(`[data-rootownerid]`)??n.body,referenceElement:e,floatingElement:t}),()=>{_()}}},[s,r,a,i,u,m,d,f,_]);let y=RT();b.useEffect(()=>{if(!s)return;function e(){u.openChangeTimeout.clear(),y.clear(),d?.events.off(`floating.closed`,r),_()}function t(e){if(d&&f&&vw(d.nodesRef.current,f).length>0){d.events.on(`floating.closed`,r);return}if(h(e.relatedTarget))return;let t=o.current.floatingContext?.nodeId??l,n=e.relatedTarget;if(!(d&&t&&$x(n)&&vw(d.nodesRef.current,t,!1).some(e=>cw(e.context?.elements.floating,n)))){if(u.handler){u.handler(e);return}_(),p()||g(e)}}function r(e){!d||!f||vw(d.nodesRef.current,f).length>0||y.start(0,()=>{d.events.off(`floating.closed`,r),n.setOpen(!1,mE(nE,e)),d.events.emit(`floating.closed`,e)})}let a=i;return WE(a&&DE(a,`mouseenter`,e),a&&DE(a,`mouseleave`,t),a&&DE(a,`pointerdown`,v,!0),()=>{d?.events.off(`floating.closed`,r)})},[s,i,n,o,l,p,h,g,_,v,u,d,f,y])}var Vk={current:null};function Hk(e,t={}){let n=`rootStore`in e?e.rootStore:e,{dataRef:r,events:i}=n.context,{enabled:a=!0,delay:o=0,handleClose:s=null,mouseOnly:c=!1,restMs:l=0,move:u=!0,triggerElementRef:d=Vk,externalTree:f,isActiveTrigger:p=!0,getHandleCloseContext:m,isClosing:h}=t,g=ED(f),_=zk(n),v=b.useRef(!1),y=GE(s),x=GE(o),S=GE(l),C=GE(a),w=GE(h);p&&(_.handleCloseOptions=y.current?.__options);let T=CS(()=>BE(r.current.openEvent?.type,_.interactedInside)),E=CS(e=>uw(e,n.context.triggerElements)),D=CS((e,t,r)=>{let i=n.context.triggerElements;if(i.hasElement(t))return!e||!cw(e,t);if(!$x(r))return!1;let a=r;return i.hasMatchingElement(e=>cw(e,a))&&(!e||!cw(e,a))}),O=CS((e,t=!0)=>{let r=RE(x.current,`close`,_.pointerType);r?_.openChangeTimeout.start(r,()=>{n.setOpen(!1,mE(nE,e)),g?.events.emit(`floating.closed`,e)}):t&&(_.openChangeTimeout.clear(),n.setOpen(!1,mE(nE,e)),g?.events.emit(`floating.closed`,e))}),k=CS(()=>{_.handler&&=(VC(n.select(`domReferenceElement`)).removeEventListener(`mousemove`,_.handler),void 0)}),A=CS(()=>{Lk(_)});return b.useEffect(()=>k,[k]),b.useEffect(()=>{if(!a)return;function e(e){e.open?v.current=!1:(v.current=e.reason===nE,k(),_.openChangeTimeout.clear(),_.restTimeout.clear(),_.blockMouseMove=!0,_.restTimeoutPending=!1)}return i.on(`openchange`,e),()=>{i.off(`openchange`,e)}},[a,i,_,k]),b.useEffect(()=>{if(!a)return;let e=d.current??(p?n.select(`domReferenceElement`):null);if(!$x(e))return;function t(e){if(_.openChangeTimeout.clear(),_.blockMouseMove=!1,c&&!ww(_.pointerType))return;let t=zE(S.current),r=RE(x.current,`open`,_.pointerType),i=lw(e),a=e.currentTarget??null,o=n.select(`domReferenceElement`),s=a;if($x(i)&&!n.context.triggerElements.hasElement(i)){for(let e of n.context.triggerElements.elements())if(cw(e,i)){s=e;break}}$x(a)&&$x(o)&&!n.context.triggerElements.hasElement(a)&&cw(a,o)&&(s=o);let l=s==null?!1:D(o,s,i),u=n.select(`open`),d=w.current?.()??n.select(`transitionStatus`)===`ending`,f=!u&&d&&v.current,p=!l&&$x(s)&&$x(o)&&cw(o,s)&&f,m=t>0&&!r,h=l&&(u||f)||p,g=!u||l;if(h){n.setOpen(!0,mE(nE,e,s));return}m||(r?_.openChangeTimeout.start(r,()=>{g&&n.setOpen(!0,mE(nE,e,s))}):g&&n.setOpen(!0,mE(nE,e,s)))}function i(e){if(T()){A();return}k();let t=VC(n.select(`domReferenceElement`));_.restTimeout.clear(),_.restTimeoutPending=!1;let i=r.current.floatingContext??m?.();if(!E(e.relatedTarget)){if(y.current&&i){n.select(`open`)||_.openChangeTimeout.clear();let r=d.current;_.handler=y.current({...i,tree:g,x:e.clientX,y:e.clientY,onClose(){A(),k(),C.current&&!T()&&r===n.select(`domReferenceElement`)&&O(e,!0)}}),t.addEventListener(`mousemove`,_.handler),_.handler(e);return}(_.pointerType!==`touch`||!cw(n.select(`floatingElement`),e.relatedTarget))&&O(e)}}return u?WE(DE(e,`mousemove`,t,{once:!0}),DE(e,`mouseenter`,t),DE(e,`mouseleave`,i)):WE(DE(e,`mouseenter`,t),DE(e,`mouseleave`,i))},[k,A,r,x,O,n,a,y,_,p,D,T,E,c,u,S,d,g,C,m,w]),b.useMemo(()=>{if(!a)return;function e(e){_.pointerType=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){let{nativeEvent:t}=e,r=e.currentTarget,i=n.select(`domReferenceElement`),a=n.select(`open`),o=D(i,r,e.target);if(c&&!ww(_.pointerType))return;if(a&&o&&_.handleCloseOptions?.blockPointerEvents){let e=n.select(`floatingElement`);e&&Rk(_,{scopeElement:_.handleCloseOptions?.getScope?.()??r.ownerDocument.body,referenceElement:r,floatingElement:e})}let s=zE(S.current);if(a&&!o||s===0||!o&&_.restTimeoutPending&&e.movementX**2+e.movementY**2<2)return;_.restTimeout.clear();function l(){if(_.restTimeoutPending=!1,T())return;let e=n.select(`open`);!_.blockMouseMove&&(!e||o)&&n.setOpen(!0,mE(nE,t,r))}_.pointerType===`touch`?JT.flushSync(()=>{l()}):o&&a?l():(_.restTimeoutPending=!0,_.restTimeout.start(s,l))}}},[a,_,T,D,c,n,S])}function Uk(e=[]){let t=e.map(e=>e?.reference),n=e.map(e=>e?.floating),r=e.map(e=>e?.item),i=e.map(e=>e?.trigger),a=b.useCallback(t=>Wk(t,e,`reference`),t),o=b.useCallback(t=>Wk(t,e,`floating`),n),s=b.useCallback(t=>Wk(t,e,`item`),r),c=b.useCallback(t=>Wk(t,e,`trigger`),i);return b.useMemo(()=>({getReferenceProps:a,getFloatingProps:o,getItemProps:s,getTriggerProps:c}),[a,o,s,c])}function Wk(e,t,n){let r=new Map,i=n===`item`,a={};n===`floating`&&(a.tabIndex=-1,a[tw]=``);for(let t in e)i&&e&&(t===`active`||t===`selected`)||(a[t]=e[t]);for(let o=0;o<t.length;o+=1){let s,c=t[o]?.[n];s=typeof c==`function`?e?c(e):null:c,s&&Gk(a,s,i,r)}return Gk(a,e,i,r),a}function Gk(e,t,n,r){for(let i in t){let a=t[i];n&&(i===`active`||i===`selected`)||(i.startsWith(`on`)?(r.has(i)||r.set(i,[]),typeof a==`function`&&(r.get(i)?.push(a),e[i]=(...e)=>r.get(i)?.map(t=>t(...e)).find(e=>e!==void 0))):e[i]=a)}}var Kk=`Escape`;function qk(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function Jk(e,t){return qk(t,e===`ArrowUp`||e===`ArrowDown`,e===`ArrowLeft`||e===`ArrowRight`)}function Yk(e,t,n){return qk(t,e===`ArrowDown`,n?e===`ArrowLeft`:e===`ArrowRight`)||e===`Enter`||e===` `||e===``}function Xk(e,t,n){return qk(t,n?e===rw:e===iw,e===ow)}function Zk(e,t,n,r){return t===`both`||t===`horizontal`&&r&&r>1?e===Kk:qk(t,n?e===iw:e===rw,e===aw)}function Qk(e,t){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`open`),i=n.useState(`floatingElement`),a=n.useState(`domReferenceElement`),o=n.context.dataRef,{listRef:s,activeIndex:c,onNavigate:l=()=>{},enabled:u=!0,selectedIndex:d=null,allowEscape:f=!1,loopFocus:p=!1,nested:m=!1,rtl:h=!1,virtual:g=!1,focusItemOnOpen:_=`auto`,focusItemOnHover:v=!0,openOnArrowKeyDown:y=!0,disabledIndices:x=void 0,orientation:S=`vertical`,parentOrientation:C,cols:w=1,id:T,resetOnPointerLeave:E=!0,externalTree:D}=t,O=GE(_w(i)),k=TD(),A=ED(D);Q(()=>{o.current.orientation=S},[o,S]);let j=hw(a),M=b.useRef(_),N=b.useRef(d??-1),P=b.useRef(null),F=b.useRef(!0),I=CS(e=>{l(N.current===-1?null:N.current,e)}),L=b.useRef(I),R=b.useRef(!!i),z=b.useRef(r),ee=b.useRef(!1),B=b.useRef(!1),V=b.useRef(null),H=GE(x),te=GE(r),ne=GE(d),U=GE(E),re=CS(()=>{function e(e){g?A?.events.emit(`virtualfocus`,e):V.current=$E(e,{sync:ee.current,preventScroll:!0})}let t=s.current[N.current],n=B.current;t&&e(t),(ee.current?e=>e():requestAnimationFrame)(()=>{let r=s.current[N.current]||t;r&&(t||e(r),oe&&(n||!F.current)&&r.scrollIntoView?.({block:`nearest`,inline:`nearest`}))})});Q(()=>{u&&(r&&i?(N.current=d??-1,M.current&&d!=null&&(B.current=!0,I())):R.current&&(N.current=-1,L.current()))},[u,r,i,d,I]),Q(()=>{if(u){if(!r){ee.current=!1;return}if(i)if(c==null){if(ee.current=!1,ne.current!=null)return;if(R.current&&(N.current=-1,re()),(!z.current||!R.current)&&M.current&&(P.current!=null||M.current===!0&&P.current==null)){let e=0,t=()=>{s.current[0]==null?(e<2&&(e?requestAnimationFrame:queueMicrotask)(t),e+=1):(N.current=P.current==null||Yk(P.current,S,h)||m?nT(s):rT(s),P.current=null,I())};t()}}else tT(s.current,c)||(N.current=c,re(),B.current=!1)}},[u,r,i,c,ne,m,s,S,h,I,re,H]),Q(()=>{if(!u||i||!A||g||!R.current)return;let e=A.nodesRef.current,t=e.find(e=>e.id===k)?.context?.elements.floating,n=sw(VC(i)),r=e.some(e=>e.context&&cw(e.context.elements.floating,n));t&&!r&&F.current&&t.focus({preventScroll:!0})},[u,i,A,k,g]),Q(()=>{L.current=I,z.current=r,R.current=!!i}),Q(()=>{r||(P.current=null,M.current=_)},[r,_]);let ie=c!=null,ae=CS(e=>{if(!te.current)return;let t=s.current.indexOf(e.currentTarget);t!==-1&&(N.current!==t||c!==t)&&(N.current=t,I(e))}),oe=b.useMemo(()=>({onFocus(e){ee.current=!0,ae(e)},onClick:({currentTarget:e})=>e.focus({preventScroll:!0}),onMouseMove(e){ee.current=!0,B.current=!1,v&&ae(e)},onPointerLeave(e){if(!te.current||!F.current||e.pointerType===`touch`)return;ee.current=!0;let t=e.relatedTarget;if(!(!v||s.current.includes(t))&&U.current&&(V.current?.(),V.current=null,N.current=-1,I(e),!g)){let e=O.current,t=sw(VC(e));e&&cw(e,t)&&e.focus({preventScroll:!0})}}}),[ae,te,O,v,s,I,U,g]),se=b.useCallback(()=>C??A?.nodesRef.current.find(e=>e.id===k)?.context?.dataRef?.current.orientation,[k,A,C]),ce=CS(e=>{if(F.current=!1,ee.current=!0,e.which===229||!te.current&&e.currentTarget===O.current)return;if(m&&Zk(e.key,S,h,w)){Jk(e.key,se())||bw(e),n.setOpen(!1,mE(lE,e.nativeEvent)),eS(a)&&(g?A?.events.emit(`virtualfocus`,a):a.focus());return}let t=N.current,i=nT(s,x),o=rT(s,x);if(j||(e.key===`Home`&&(bw(e),N.current=i,I(e)),e.key===`End`&&(bw(e),N.current=o,I(e))),w>1){let t=Array.from({length:s.current.length},()=>({width:1,height:1})),n=oT(t,w,!1),r=n.findIndex(e=>e!=null&&!lT(s.current,e,x)),a=n.reduce((e,t,n)=>t!=null&&!lT(s.current,t,x)?n:e,-1),c=n[aT(n.map(e=>e==null?null:s.current[e]),{event:e,orientation:S,loopFocus:p,rtl:h,cols:w,disabledIndices:cT([...(typeof x==`function`?null:x)||s.current.map((e,t)=>lT(s.current,t,x)?t:void 0),void 0],n),minIndex:r,maxIndex:a,prevIndex:sT(N.current>o?i:N.current,t,n,w,e.key===`ArrowDown`?`bl`:e.key===(h?`ArrowLeft`:`ArrowRight`)?`tr`:`tl`),stopEvent:!0})];if(c!=null&&(N.current=c,I(e)),S===`both`)return}if(Jk(e.key,S)){if(bw(e),r&&!g&&sw(e.currentTarget.ownerDocument)===e.currentTarget){N.current=Yk(e.key,S,h)?i:o,I(e);return}Yk(e.key,S,h)?p?t>=o?f&&t!==s.current.length?N.current=-1:(ee.current=!1,N.current=i):N.current=iT(s.current,{startingIndex:t,disabledIndices:x}):N.current=Math.min(o,iT(s.current,{startingIndex:t,disabledIndices:x})):p?t<=i?f&&t!==-1?N.current=s.current.length:(ee.current=!1,N.current=o):N.current=iT(s.current,{startingIndex:t,decrement:!0,disabledIndices:x}):N.current=Math.max(i,iT(s.current,{startingIndex:t,decrement:!0,disabledIndices:x})),tT(s.current,N.current)&&(N.current=-1),I(e)}}),le=b.useMemo(()=>g&&r&&ie&&{"aria-activedescendant":`${T}-${c}`},[g,r,ie,T,c]),ue=b.useMemo(()=>({"aria-orientation":S===`both`?void 0:S,...j?{}:le,onKeyDown(e){if(e.key===`Tab`&&e.shiftKey&&r&&!g){let t=lw(e.nativeEvent);if(t&&!cw(O.current,t))return;bw(e),n.setOpen(!1,mE(sE,e.nativeEvent)),eS(a)&&a.focus();return}ce(e)},onPointerMove(){F.current=!0}}),[le,ce,O,S,j,n,r,g,a]),de=b.useMemo(()=>{function e(e){_===`auto`&&Sw(e.nativeEvent)&&(M.current=!g)}function t(e){M.current=_,_===`auto`&&Cw(e.nativeEvent)&&(M.current=!0)}return{onKeyDown(e){let t=n.select(`open`);F.current=!1;let r=e.key.startsWith(`Arrow`),i=Xk(e.key,se(),h),a=Jk(e.key,S),o=(m?i:a)||e.key===`Enter`||e.key.trim()===``;if(g&&t)return ce(e);if(!(!t&&!y&&r)){if(o){let t=Jk(e.key,se());P.current=m&&t?null:e.key}if(m){i&&(bw(e),t?(N.current=nT(s,H.current),I(e)):n.setOpen(!0,mE(lE,e.nativeEvent,e.currentTarget)));return}a&&(ne.current!=null&&(N.current=ne.current),bw(e),!t&&y?n.setOpen(!0,mE(lE,e.nativeEvent,e.currentTarget)):ce(e),t&&I(e))}},onFocus(e){n.select(`open`)&&!g&&(N.current=-1,I(e))},onPointerDown:t,onPointerEnter:t,onMouseDown:e,onClick:e}},[ce,H,_,s,m,I,n,y,S,se,h,ne,g]),fe=b.useMemo(()=>({...le,...de}),[le,de]);return b.useMemo(()=>u?{reference:fe,floating:ue,item:oe,trigger:de}:{},[u,fe,ue,de,oe])}var $k=new Map([[`select`,`listbox`],[`combobox`,`listbox`],[`label`,!1]]);function eA(e,t={}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`open`),i=n.useState(`floatingId`),a=n.useState(`domReferenceElement`),o=n.useState(`floatingElement`),{role:s=`dialog`}=t,c=NC(),l=a?.id||c,u=b.useMemo(()=>_w(o)?.id||i,[o,i]),d=$k.get(s)??s,f=TD()!=null,p=b.useMemo(()=>d===`tooltip`||s===`label`?cC:{"aria-haspopup":d===`alertdialog`?`dialog`:d,"aria-expanded":`false`,...d===`listbox`&&{role:`combobox`},...d===`menu`&&f&&{role:`menuitem`},...s===`select`&&{"aria-autocomplete":`none`},...s===`combobox`&&{"aria-autocomplete":`list`}},[d,f,s]),m=b.useMemo(()=>d===`tooltip`||s===`label`?{[`aria-${s===`label`?`labelledby`:`describedby`}`]:r?u:void 0}:{...p,"aria-expanded":r?`true`:`false`,"aria-controls":r?u:void 0,...d===`menu`&&{id:l}},[d,u,r,l,s,p]),h=b.useMemo(()=>{let e={id:u,...d&&{role:d}};return d===`tooltip`||s===`label`?e:{...e,...d===`menu`&&{"aria-labelledby":l}}},[d,u,l,s]),g=b.useCallback(({active:e,selected:t})=>{let n={role:`option`,...e&&{id:`${u}-fui-option`}};switch(s){case`select`:case`combobox`:return{...n,"aria-selected":t};default:}return{}},[u,s]);return b.useMemo(()=>({reference:m,floating:h,item:g,trigger:p}),[m,h,p,g])}function tA(e,t){let n=`rootStore`in e?e.rootStore:e,r=n.context.dataRef,i=n.useState(`open`),{listRef:a,elementsRef:o,activeIndex:s,onMatch:c,onTypingChange:l,enabled:u=!0,resetMs:d=750,selectedIndex:f=null}=t,p=RT(),m=b.useRef(``),h=b.useRef(f??s??-1),g=b.useRef(null);Q(()=>{!i&&f!==null||(p.clear(),g.current=null,m.current!==``&&(m.current=``))},[i,f,p]),Q(()=>{i&&m.current===``&&(h.current=f??s??-1)},[i,f,s]);let _=CS(e=>{e?r.current.typing||(r.current.typing=e,l?.(e)):r.current.typing&&(r.current.typing=e,l?.(e))}),v=CS(e=>{function t(e){let t=o?.current[e];return!t||dT(t)}function n(e,n,r=0){if(e.length===0)return-1;let i=(r%e.length+e.length)%e.length,a=n.toLocaleLowerCase();for(let n=0;n<e.length;n+=1){let r=(i+n)%e.length;if(!(!e[r]?.toLocaleLowerCase().startsWith(a)||!t(r)))return r}return-1}let r=a.current;if(m.current.length>0&&e.key===` `&&(bw(e),_(!0)),m.current.length>0&&m.current[0]!==` `&&n(r,m.current)===-1&&e.key!==` `&&_(!1),r==null||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;i&&e.key!==` `&&(bw(e),_(!0));let l=m.current===``;l&&(h.current=f??s??-1),r.every(e=>e?e[0]?.toLocaleLowerCase()!==e[1]?.toLocaleLowerCase():!0)&&m.current===e.key&&(m.current=``,h.current=g.current),m.current+=e.key,p.start(d,()=>{m.current=``,h.current=g.current,_(!1)});let u=((l?f??s??-1:h.current)??0)+1,v=n(r,m.current,u);v===-1?e.key!==` `&&(m.current=``,_(!1)):(c?.(v),g.current=v)}),y=CS(e=>{let t=e.relatedTarget,r=n.select(`domReferenceElement`),i=n.select(`floatingElement`),a=cw(r,t),o=cw(i,t);a||o||(p.clear(),m.current=``,h.current=g.current,_(!1))}),x=b.useMemo(()=>({onKeyDown:v,onBlur:y}),[v,y]),S=b.useMemo(()=>({onKeyDown:v,onBlur:y}),[v,y]);return b.useMemo(()=>u?{reference:x,floating:S}:{},[u,x,S])}var nA=.1,rA=nA*nA,iA=.5;function aA(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function oA(e,t,n,r,i,a,o,s,c,l){let u=!1;return aA(e,t,n,r,i,a)&&(u=!u),aA(e,t,i,a,o,s)&&(u=!u),aA(e,t,o,s,c,l)&&(u=!u),aA(e,t,c,l,n,r)&&(u=!u),u}function sA(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function cA(e,t,n,r,i,a){return e>=Math.min(n,i)&&e<=Math.max(n,i)&&t>=Math.min(r,a)&&t<=Math.max(r,a)}function lA(e={}){let{blockPointerEvents:t=!1}=e,n=new LT,r=({x:e,y:t,placement:r,elements:i,onClose:a,nodeId:o,tree:s})=>{let c=r?.split(`-`)[0],l=!1,u=null,d=null,f=typeof performance<`u`?performance.now():0;function p(e,t){let n=performance.now(),r=n-f;if(u===null||d===null||r===0)return u=e,d=t,f=n,!1;let i=e-u,a=t-d,o=i*i+a*a,s=r*r*rA;return u=e,d=t,f=n,o<s}function m(){n.clear(),a()}return function(r){n.clear();let a=i.domReference,u=i.floating;if(!a||!u||c==null||e==null||t==null)return;let{clientX:d,clientY:f}=r,h=lw(r),g=r.type===`mouseleave`,_=cw(u,h),v=cw(a,h);if(_&&(l=!0,!g))return;if(v&&(l=!1,!g)){l=!0;return}if(g&&$x(r.relatedTarget)&&cw(u,r.relatedTarget))return;function y(){return!!(s&&vw(s.nodesRef.current,o).length>0)}function b(){y()||m()}if(y())return;let x=a.getBoundingClientRect(),S=u.getBoundingClientRect(),C=e>S.right-S.width/2,w=t>S.bottom-S.height/2,T=S.width>x.width,E=S.height>x.height,D=(T?x:S).left,O=(T?x:S).right,k=(E?x:S).top,A=(E?x:S).bottom;if(c===`top`&&t>=x.bottom-1||c===`bottom`&&t<=x.top+1||c===`left`&&e>=x.right-1||c===`right`&&e<=x.left+1){b();return}let j=!1;switch(c){case`top`:j=cA(d,f,D,x.top+1,O,S.bottom-1);break;case`bottom`:j=cA(d,f,D,S.top+1,O,x.bottom-1);break;case`left`:j=cA(d,f,S.right-1,A,x.left+1,k);break;case`right`:j=cA(d,f,x.right-1,A,S.left+1,k);break;default:}if(j)return;if(l&&!sA(d,f,x)){b();return}if(!g&&p(d,f)){b();return}let M=!1;switch(c){case`top`:{let n=T?iA/2:iA*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t+iA+1,o=C||T?S.bottom-iA:S.top,s=C?T?S.bottom-iA:S.top:S.bottom-iA;M=oA(d,f,r,a,i,a,S.left,o,S.right,s);break}case`bottom`:{let n=T?iA/2:iA*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t-iA,o=C||T?S.top+iA:S.bottom,s=C?T?S.top+iA:S.bottom:S.top+iA;M=oA(d,f,r,a,i,a,S.left,o,S.right,s);break}case`left`:{let n=E?iA/2:iA*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e+iA+1,o=w||E?S.right-iA:S.left,s=w?E?S.right-iA:S.left:S.right-iA;M=oA(d,f,o,S.top,s,S.bottom,a,r,a,i);break}case`right`:{let n=E?iA/2:iA*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e-iA,o=w||E?S.left+iA:S.right,s=w?E?S.left+iA:S.right:S.left+iA;M=oA(d,f,a,r,a,i,o,S.top,s,S.bottom);break}default:}M?l||n.start(40,b):b()}};return r.__options={...e,blockPointerEvents:t},r}function uA(e){let t=b.useRef(``),n=b.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:b.useCallback(n=>{if(n.detail===0){e(n,`keyboard`);return}`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``},[e]),onPointerDown:n}}function dA(e,t){let n=b.useRef(e),r=CS(t);Q(()=>{n.current!==e&&r(n.current)},[e,r]),Q(()=>{n.current=e},[e])}function fA(e){let[t,n]=b.useState(null),r=CS((t,r)=>{e||n(r||(qC?`touch`:``))});dA(e,t=>{t&&!e&&n(null)});let{onClick:i,onPointerDown:a}=uA(r);return b.useMemo(()=>({openMethod:t,triggerProps:{onClick:i,onPointerDown:a}}),[t,i,a])}function pA(e){let{store:t,parentContext:n,actionsRef:r,isDrawer:i}=e,a=t.useState(`open`),o=t.useState(`disablePointerDismissal`),s=t.useState(`modal`),c=t.useState(`popupElement`),{openMethod:l,triggerProps:u}=fA(a);Ck(t);let{forceUnmount:d}=wk(a,t),f=b.useCallback(()=>{t.setOpen(!1,mE(fE))},[t]);b.useImperativeHandle(r,()=>({unmount:d,close:f}),[d,f]);let p=Mk({popupStore:t,onOpenChange:t.setOpen,treatPopupAsFloatingElement:!0}),[m,h]=b.useState(0),[g,_]=b.useState(0),v=m===0,y=eA(p),x=UD(p,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?`intentional`:{mouse:s===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(e){if(!t.context.outsidePressEnabledRef.current||`button`in e&&e.button!==0||`touches`in e&&e.touches.length!==1)return!1;let n=lw(e);if(v&&!o){let e=n;return s&&(t.context.internalBackdropRef.current||t.context.backdropRef.current)?t.context.internalBackdropRef.current===e||t.context.backdropRef.current===e||cw(e,c)&&!e?.hasAttribute(`data-base-ui-portal`):!0}return!1},escapeKey:v});IE(a&&s===!0,c);let{getReferenceProps:S,getFloatingProps:C,getTriggerProps:w}=Uk([y,x]);t.useContextCallback(`onNestedDialogOpen`,(e,t)=>{h(e),_(t)}),t.useContextCallback(`onNestedDialogClose`,()=>{h(0),_(0)}),b.useEffect(()=>(n?.onNestedDialogOpen&&a&&n.onNestedDialogOpen(m+1,g+ +!!i),n?.onNestedDialogClose&&!a&&n.onNestedDialogClose(),()=>{n?.onNestedDialogClose&&a&&n.onNestedDialogClose()}),[i,a,m,g,n]);let T=b.useMemo(()=>S(u),[S,u]),E=b.useMemo(()=>w(u),[w,u]),D=b.useMemo(()=>C(),[C]);t.useSyncedValues({openMethod:l,activeTriggerProps:T,inactiveTriggerProps:E,popupProps:D,floatingRootContext:p,nestedOpenDialogCount:m,nestedOpenDrawerCount:g})}var mA=b.createContext(void 0);function hA(e){let t=b.useContext(mA);if(e===!1&&t===void 0)throw Error(WS(27));return t}var gA={...kk,modal:$(e=>e.modal),nested:$(e=>e.nested),nestedOpenDialogCount:$(e=>e.nestedOpenDialogCount),nestedOpenDrawerCount:$(e=>e.nestedOpenDrawerCount),disablePointerDismissal:$(e=>e.disablePointerDismissal),openMethod:$(e=>e.openMethod),descriptionElementId:$(e=>e.descriptionElementId),titleElementId:$(e=>e.titleElementId),viewportElement:$(e=>e.viewportElement),role:$(e=>e.role)},_A=class e extends vk{constructor(e){super(vA(e),{popupRef:b.createRef(),backdropRef:b.createRef(),internalBackdropRef:b.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:new Tk,onOpenChange:void 0,onOpenChangeComplete:void 0},gA)}setOpen=(e,t)=>{if(t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null&&(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let n={open:e},r=t.trigger?.id??null;(r||e)&&(n.activeTriggerId=r,n.activeTriggerElement=t.trigger??null),this.update(n)};static useStore(t,n){let r=bS(()=>new e(n)).current;return t??r}};function vA(e={}){return{...Dk(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:`dialog`,...e}}var yA=b.createContext(!1);function bA(e){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,disablePointerDismissal:o=!1,modal:s=!0,actionsRef:c,handle:l,triggerId:u,defaultTriggerId:d=null}=e,f=hA(!0),p=b.useContext(yA),m=!!f,h=_A.useStore(l?.store,{open:r,openProp:n,activeTriggerId:d,triggerIdProp:u,modal:s,disablePointerDismissal:o,nested:m});EE(()=>{n===void 0&&h.state.open===!1&&r===!0&&h.update({open:!0,activeTriggerId:d})}),h.useControlledProp(`openProp`,n),h.useControlledProp(`triggerIdProp`,u),h.useSyncedValues({disablePointerDismissal:o,nested:m,modal:s}),h.useContextCallback(`onOpenChange`,i),h.useContextCallback(`onOpenChangeComplete`,a);let g=h.useState(`payload`);pA({store:h,actionsRef:c,parentContext:f?.store.context,isDrawer:p,onOpenChange:i,triggerIdProp:u});let _=b.useMemo(()=>({store:h}),[h]);return(0,y.jsx)(yA.Provider,{value:!1,children:(0,y.jsx)(mA.Provider,{value:_,children:typeof t==`function`?t({payload:g}):t})})}function xA(e){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,actionsRef:o,handle:s,triggerId:c,defaultTriggerId:l=null}=e,u=hA(!0),d=!!u,f=_A.useStore(s?.store,{open:r,openProp:n,activeTriggerId:l,triggerIdProp:c,modal:!0,disablePointerDismissal:!0,nested:d,role:`alertdialog`});f.useControlledProp(`openProp`,n),f.useControlledProp(`triggerIdProp`,c),f.useSyncedValue(`nested`,d),f.useContextCallback(`onOpenChange`,i),f.useContextCallback(`onOpenChangeComplete`,a);let p=f.useState(`payload`);pA({store:f,actionsRef:o,parentContext:u?.store.context,isDrawer:!1,onOpenChange:i,triggerIdProp:c});let m=b.useMemo(()=>({store:f}),[f]);return(0,y.jsx)(yA.Provider,{value:!1,children:(0,y.jsx)(mA.Provider,{value:m,children:typeof t==`function`?t({payload:p}):t})})}var SA=function(e){return e.open=`data-open`,e.closed=`data-closed`,e[e.startingStyle=WT.startingStyle]=`startingStyle`,e[e.endingStyle=WT.endingStyle]=`endingStyle`,e.anchorHidden=`data-anchor-hidden`,e.side=`data-side`,e.align=`data-align`,e}({}),CA=function(e){return e.popupOpen=`data-popup-open`,e.pressed=`data-pressed`,e}({}),wA={[CA.popupOpen]:``},TA={[CA.popupOpen]:``,[CA.pressed]:``},EA={[SA.open]:``},DA={[SA.closed]:``},OA={[SA.anchorHidden]:``},kA={open(e){return e?wA:null}},AA={open(e){return e?TA:null}},jA={open(e){return e?EA:DA},anchorHidden(e){return e?OA:null}},MA={...jA,...qT},NA=b.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:a=!1,...o}=e,{store:s}=hA(),c=s.useState(`open`),l=s.useState(`nested`),u=s.useState(`mounted`);return fC(`div`,e,{state:{open:c,transitionStatus:s.useState(`transitionStatus`)},ref:[s.context.backdropRef,t],stateAttributesMapping:MA,props:[{role:`presentation`,hidden:!u,style:{userSelect:`none`,WebkitUserSelect:`none`}},o],enabled:a||!l})}),PA=b.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,nativeButton:a=!0,style:o,...s}=e,{store:c}=hA(),l=c.useState(`open`);function u(e){l&&c.setOpen(!1,mE(oE,e.nativeEvent))}let{getButtonProps:d,buttonRef:f}=JS({disabled:i,native:a});return fC(`button`,e,{state:{disabled:i},ref:[t,f],props:[{onClick:u},s,d]})}),FA=b.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,{store:s}=hA(),c=PC(a);return s.useSyncedValueWithCleanup(`descriptionElementId`,c),fC(`p`,e,{ref:t,props:[{id:c},o]})}),IA=function(e){return e.nestedDialogs=`--nested-dialogs`,e}({}),LA=function(e){return e[e.open=SA.open]=`open`,e[e.closed=SA.closed]=`closed`,e[e.startingStyle=SA.startingStyle]=`startingStyle`,e[e.endingStyle=SA.endingStyle]=`endingStyle`,e.nested=`data-nested`,e.nestedDialogOpen=`data-nested-dialog-open`,e}({}),RA=b.createContext(void 0);function zA(){let e=b.useContext(RA);if(e===void 0)throw Error(WS(26));return e}var BA=`ArrowUp`,VA=`ArrowDown`,HA=`ArrowLeft`,UA=`ArrowRight`,WA=`Home`,GA=new Set([HA,UA]),KA=new Set([BA,VA]),qA=new Set([...GA,...KA]);new Set([...qA,WA,`End`]);var JA=new Set([BA,VA,HA,UA,WA,`End`]),YA={...jA,...qT,nestedDialogOpen(e){return e?{[LA.nestedDialogOpen]:``}:null}},XA=b.forwardRef(function(e,t){let{className:n,finalFocus:r,initialFocus:i,render:a,style:o,...s}=e,{store:c}=hA(),l=c.useState(`descriptionElementId`),u=c.useState(`disablePointerDismissal`),d=c.useState(`floatingRootContext`),f=c.useState(`popupProps`),p=c.useState(`modal`),m=c.useState(`mounted`),h=c.useState(`nested`),g=c.useState(`nestedOpenDialogCount`),_=c.useState(`open`),v=c.useState(`openMethod`),b=c.useState(`titleElementId`),x=c.useState(`transitionStatus`),S=c.useState(`role`);zA(),XT({open:_,ref:c.context.popupRef,onComplete(){_&&c.context.onOpenChangeComplete?.(!0)}});function C(e){return e===`touch`?c.context.popupRef.current:!0}let w=i===void 0?C:i,T=fC(`div`,e,{state:{open:_,nested:h,transitionStatus:x,nestedDialogOpen:g>0},props:[f,{"aria-labelledby":b??void 0,"aria-describedby":l??void 0,role:S,tabIndex:-1,hidden:!m,onKeyDown(e){JA.has(e.key)&&e.stopPropagation()},style:{[IA.nestedDialogs]:g}},s],ref:[t,c.context.popupRef,c.useStateSetter(`popupElement`)],stateAttributesMapping:YA});return(0,y.jsx)(FD,{context:d,openInteractionType:v,disabled:!m,closeOnFocusOut:!u,initialFocus:w,returnFocus:r,modal:p!==!1,restoreFocus:`popup`,children:T})});function ZA(e){return iC(19)?e:e?`true`:void 0}var QA=b.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`}return(0,y.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})}),$A=b.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i}=hA(),a=i.useState(`mounted`),o=i.useState(`modal`),s=i.useState(`open`);return a||n?(0,y.jsx)(RA.Provider,{value:n,children:(0,y.jsxs)(xD,{ref:t,...r,children:[a&&o===!0&&(0,y.jsx)(QA,{ref:i.context.internalBackdropRef,inert:ZA(!s)}),e.children]})}):null}),ej=b.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,{store:s}=hA(),c=PC(a);return s.useSyncedValueWithCleanup(`titleElementId`,c),fC(`h2`,e,{ref:t,props:[{id:c},o]})}),tj=b.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,nativeButton:a=!0,id:o,payload:s,handle:c,style:l,...u}=e,d=hA(!0),f=c?.store??d?.store;if(!f)throw Error(WS(79));let p=PC(o),m=f.useState(`floatingRootContext`),h=f.useState(`isOpenedByTrigger`,p),g=b.useRef(null),{registerTrigger:_,isMountedByThisTrigger:v}=Sk(p,g,f,{payload:s}),{getButtonProps:y,buttonRef:x}=JS({disabled:i,native:a}),S=Uk([ID(m,{enabled:m!=null})]),C={disabled:i,open:h},w=f.useState(`triggerProps`,v);return fC(`button`,e,{state:C,ref:[x,t,_,g],props:[S.getReferenceProps(),w,{[pD]:``,id:p},u,y],stateAttributesMapping:kA})});function nj({...e}){return(0,y.jsx)(xA,{"data-slot":`alert-dialog`,...e})}function rj({...e}){return(0,y.jsx)($A,{"data-slot":`alert-dialog-portal`,...e})}function ij({className:e,...t}){return(0,y.jsx)(NA,{"data-slot":`alert-dialog-overlay`,className:qx(`fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}function aj({className:e,size:t=`default`,...n}){return(0,y.jsxs)(rj,{children:[(0,y.jsx)(ij,{}),(0,y.jsx)(XA,{"data-slot":`alert-dialog-content`,"data-size":t,className:qx(`group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 gap-6 rounded-xl bg-popover p-6 text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-lg data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...n})]})}function oj({className:e,...t}){return(0,y.jsx)(`div`,{"data-slot":`alert-dialog-header`,className:qx(`grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-6 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]`,e),...t})}function sj({className:e,...t}){return(0,y.jsx)(`div`,{"data-slot":`alert-dialog-footer`,className:qx(`flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end`,e),...t})}function cj({className:e,...t}){return(0,y.jsx)(ej,{"data-slot":`alert-dialog-title`,className:qx(`font-heading text-lg font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2`,e),...t})}function lj({className:e,...t}){return(0,y.jsx)(FA,{"data-slot":`alert-dialog-description`,className:qx(`text-sm text-balance text-muted-foreground md:text-pretty *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground`,e),...t})}function uj({className:e,...t}){return(0,y.jsx)(bC,{"data-slot":`alert-dialog-action`,className:qx(e),...t})}function dj({className:e,...t}){return(0,y.jsx)(db,{role:`status`,"aria-label":`Loading`,className:qx(`spinner-line-fade size-4`,e),...t})}var fj=({isModalOpen:e,exitInfo:t,isRetryingConnection:n,hasCopiedRestartCommand:r,newTabUrl:i,onReconnect:a,onCopyRestartCommand:o})=>(0,y.jsx)(nj,{open:e,children:(0,y.jsx)(aj,{children:t===null?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(oj,{children:[(0,y.jsxs)(cj,{className:`flex items-center gap-2`,children:[(0,y.jsx)(dj,{"aria-hidden":`true`,role:`presentation`}),`Lost connection`]}),(0,y.jsx)(lj,{children:`The localterm server isn't responding. Start it again from your terminal, then retry.`})]}),(0,y.jsxs)(vE,{children:[(0,y.jsx)(wE,{readOnly:!0,value:ad,"aria-label":`restart command`,className:`font-mono`}),(0,y.jsx)(bE,{align:`inline-end`,children:(0,y.jsx)(SE,{size:`icon-xs`,onClick:o,"aria-label":r?`Copied`:`Copy restart command`,children:r?(0,y.jsx)(sb,{}):(0,y.jsx)(ub,{})})})]}),(0,y.jsx)(sj,{children:(0,y.jsxs)(uj,{onClick:a,disabled:n,children:[n?(0,y.jsx)(dj,{"data-icon":`inline-start`}):null,`Retry`]})})]}):t.reason===`shell-exited`?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(oj,{children:[(0,y.jsx)(cj,{children:`Shell ended`}),(0,y.jsx)(lj,{children:t.exitCode===null||t.exitCode===0?`Open a new shell to keep going, or close this tab.`:`Exit code ${t.exitCode}. Open a new shell to keep going.`})]}),(0,y.jsx)(sj,{children:(0,y.jsx)(uj,{onClick:()=>window.open(i,`_blank`,`noopener,noreferrer`),children:`New shell`})})]}):(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(oj,{children:[(0,y.jsxs)(cj,{className:`flex items-center gap-2`,children:[(0,y.jsx)(dj,{"aria-hidden":`true`,role:`presentation`}),`Connection lost`]}),(0,y.jsxs)(lj,{children:[`The browser lost its connection to the localterm daemon (close code`,` `,t.closeCode,t.closeReason?` · ${t.closeReason}`:``,`). Reconnecting spawns a fresh shell. The previous one can't be reattached.`]})]}),(0,y.jsx)(sj,{children:(0,y.jsxs)(uj,{onClick:a,disabled:n,children:[n?(0,y.jsx)(dj,{"data-icon":`inline-start`}):null,`Reconnect`]})})]})})});function pj({...e}){return(0,y.jsx)(bA,{"data-slot":`dialog`,...e})}function mj({...e}){return(0,y.jsx)(tj,{"data-slot":`dialog-trigger`,...e})}function hj({...e}){return(0,y.jsx)($A,{"data-slot":`dialog-portal`,...e})}function gj({className:e,...t}){return(0,y.jsx)(NA,{"data-slot":`dialog-overlay`,className:qx(`fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}function _j({className:e,children:t,showCloseButton:n=!0,...r}){return(0,y.jsxs)(hj,{children:[(0,y.jsx)(gj,{}),(0,y.jsxs)(XA,{"data-slot":`dialog-content`,className:qx(`fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-6 rounded-xl bg-popover p-6 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-md data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...r,children:[t,n?(0,y.jsxs)(PA,{"data-slot":`dialog-close`,render:(0,y.jsx)(bC,{variant:`ghost`,className:`absolute top-4 right-4`,size:`icon-sm`}),children:[(0,y.jsx)(_b,{}),(0,y.jsx)(`span`,{className:`sr-only`,children:`Close`})]}):null]})]})}function vj({className:e,...t}){return(0,y.jsx)(`div`,{"data-slot":`dialog-header`,className:qx(`flex flex-col gap-2`,e),...t})}function yj({className:e,...t}){return(0,y.jsx)(ej,{"data-slot":`dialog-title`,className:qx(`font-heading leading-none font-medium`,e),...t})}var bj=`border border-border/60 bg-background/70 text-muted-foreground shadow-xs ring-0 backdrop-blur-md`,xj=`duration-150 ease-snappy data-closed:duration-100 data-closed:fade-out-0 data-closed:zoom-out-95 data-closed:blur-out-[5px] data-closed:slide-out-to-top-2 data-open:fade-in-0 data-open:zoom-in-95 data-open:blur-in-[5px] data-open:slide-in-from-top-2`,Sj=async()=>{if(typeof navigator>`u`||!navigator.permissions)return`unsupported`;try{return(await navigator.permissions.query({name:`local-fonts`})).state}catch{return`unsupported`}},Cj=()=>typeof window<`u`&&typeof window.queryLocalFonts==`function`,wj=async()=>{if(typeof window>`u`)return[];let e=window.queryLocalFonts;if(typeof e!=`function`)return[];try{let t=await e(),n=new Set;for(let e of t)e.family&&n.add(e.family);return[...n].sort((e,t)=>e.localeCompare(t,void 0,{sensitivity:`base`}))}catch{return[]}},Tj=`flex w-full items-center justify-between gap-2 rounded-sm px-2 py-1.5 text-left text-xs text-foreground/90 outline-none transition-colors hover:bg-foreground/10 focus-visible:bg-foreground/10`,Ej={contentVisibility:`auto`,containIntrinsicSize:`auto 28px`},Dj=`text-xs leading-snug text-muted-foreground/80`,Oj=(e,t)=>{let n=t.trim().toLowerCase();return n?e.filter(e=>e.toLowerCase().includes(n)):e},kj=({initialValue:e,onApply:t})=>{let[n,r]=(0,b.useState)(e),i=n.trim(),a=(0,b.useCallback)(()=>{i&&t(i)},[i,t]);return(0,y.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,y.jsx)(_E,{autoFocus:!0,value:n,onChange:e=>r(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),a())},placeholder:`Family name (e.g. Iosevka)`,className:`h-8 text-xs`}),(0,y.jsx)(bC,{type:`button`,size:`sm`,variant:`secondary`,disabled:!i,onClick:a,className:`h-7 text-xs`,children:`Apply`})]})},Aj=({open:e,onOpenChange:t,currentFamily:n,onApply:r})=>{let[i,a]=(0,b.useState)({kind:`loading`}),[o,s]=(0,b.useState)(``),c=(0,b.useDeferredValue)(o);(0,b.useEffect)(()=>{if(!e)return;s(``);let t=!1;return a({kind:`loading`}),(async()=>{if(!Cj()){t||a({kind:`unsupported`});return}let e=await Sj();if(!t)if(e===`granted`){let e=await wj();t||a({kind:`ready`,families:e})}else a(e===`denied`?{kind:`denied`}:{kind:`prompt`})})(),()=>{t=!0}},[e]);let l=async()=>{a({kind:`loading`});let e=await wj();if(e.length===0){a({kind:`denied`});return}a({kind:`ready`,families:e})},u=e=>{r(e),t(!1)},d=(0,b.useMemo)(()=>i.kind===`ready`?Oj(i.families,c):[],[i.kind,i.kind===`ready`?i.families:void 0,c]);return(0,y.jsx)(pj,{open:e,onOpenChange:t,children:(0,y.jsxs)(_j,{className:qx(`max-h-[calc(100dvh-2rem)] gap-2 overflow-hidden p-4 sm:max-w-sm`,bj),children:[(0,y.jsx)(vj,{className:`pr-8`,children:(0,y.jsx)(yj,{children:`Local font`})}),i.kind===`loading`?(0,y.jsx)(`p`,{className:Dj,children:`Loading…`}):i.kind===`unsupported`?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`p`,{className:Dj,children:`This browser doesn't expose installed fonts. Type a family name to use any installed font.`}),(0,y.jsx)(kj,{initialValue:n??``,onApply:u})]}):i.kind===`denied`?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`p`,{className:Dj,children:`Permission denied. Re-allow in browser site settings, or type a family name.`}),(0,y.jsx)(kj,{initialValue:n??``,onApply:u})]}):i.kind===`prompt`?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`p`,{className:Dj,children:`Allow localterm to read your installed fonts to preview them.`}),(0,y.jsx)(bC,{type:`button`,size:`sm`,variant:`secondary`,onClick:l,className:`h-7 text-xs`,children:`Allow access`}),(0,y.jsx)(`div`,{className:`my-1 border-t border-border/40`}),(0,y.jsx)(`p`,{className:Dj,children:`Or type a family name:`}),(0,y.jsx)(kj,{initialValue:n??``,onApply:u})]}):(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(`div`,{className:`relative`,children:[(0,y.jsx)(hb,{className:`pointer-events-none absolute top-1/2 left-2 size-3 -translate-y-1/2 text-muted-foreground/70`}),(0,y.jsx)(_E,{autoFocus:!0,value:o,onChange:e=>s(e.target.value),placeholder:`Search installed fonts`,className:`h-8 pl-7 text-xs`})]}),(0,y.jsx)(`div`,{className:`-mx-1 max-h-72 overflow-y-auto pr-1 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden`,children:d.length===0?(0,y.jsxs)(`p`,{className:qx(Dj,`px-2 py-2`),children:[`No fonts match "`,o,`".`]}):d.map(e=>(0,y.jsx)(`button`,{type:`button`,onClick:()=>u(e),className:qx(Tj,e===n&&`bg-foreground/5`),style:{...Ej,fontFamily:`"${Cd(e)}", ui-monospace, monospace`},children:(0,y.jsx)(`span`,{className:`truncate`,children:e})},e))}),(0,y.jsx)(`p`,{className:qx(Dj,`px-1 tabular-nums`),children:c?`${d.length} of ${i.families.length}`:`${i.families.length} fonts`})]})]})})};function jj(e){return fC(e.defaultTagName??`div`,e,e)}var Mj=b.forwardRef(function(e,t){let{className:n,render:r,orientation:i=`horizontal`,style:a,...o}=e;return fC(`div`,e,{state:{orientation:i},ref:t,props:[{role:`separator`,"aria-orientation":i},o]})});function Nj({className:e,orientation:t=`horizontal`,...n}){return(0,y.jsx)(Mj,{"data-slot":`separator`,orientation:t,className:qx(`shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch`,e),...n})}var Pj=Sb(`flex w-fit items-stretch *:focus-visible:relative *:focus-visible:z-10 has-[>[data-slot=button-group]]:gap-2 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1`,{variants:{orientation:{horizontal:`*:data-slot:rounded-r-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-r-md! [&>[data-slot]~[data-slot]]:rounded-l-none [&>[data-slot]~[data-slot]]:border-l-0`,vertical:`flex-col *:data-slot:rounded-b-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-b-md! [&>[data-slot]~[data-slot]]:rounded-t-none [&>[data-slot]~[data-slot]]:border-t-0`}},defaultVariants:{orientation:`horizontal`}});function Fj({className:e,orientation:t,...n}){return(0,y.jsx)(`div`,{role:`group`,"data-slot":`button-group`,"data-orientation":t,className:qx(Pj({orientation:t}),e),...n})}function Ij({className:e,render:t,...n}){return jj({defaultTagName:`div`,props:kS({className:qx(`flex items-center gap-2 rounded-md border bg-muted px-2.5 text-sm font-medium shadow-xs [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4`,e)},n),render:t,state:{slot:`button-group-text`}})}var Lj=e=>String(e),Rj=`size-7 rounded-none border-0 bg-transparent text-foreground hover:bg-foreground/10 hover:text-foreground disabled:opacity-30 [&_svg]:size-3.5`,zj=`h-7 min-w-[3rem] cursor-ew-resize touch-none justify-center border-y-0 border-r border-l! border-border/60 bg-transparent px-1.5 text-xs font-medium tabular-nums text-foreground select-none hover:bg-foreground/5 focus-visible:outline-none focus-visible:bg-foreground/5`,Bj={ArrowRight:1,ArrowUp:1,ArrowLeft:-1,ArrowDown:-1},Vj=({value:e,min:t,max:n,step:r,ariaLabel:i,decrementAriaLabel:a,incrementAriaLabel:o,formatDisplay:s=Lj,onValueChange:c})=>{let l=(0,b.useRef)(null),u=(0,b.useRef)(e),d=t=>{if(t.button===0){try{t.currentTarget.setPointerCapture(t.pointerId)}catch{}l.current=t.clientX,u.current=e}},f=e=>{let i=l.current;if(i===null)return;let a=e.clientX-i,o=Math.round(a/5);if(o===0)return;let s=u.current+o*r;c(Math.max(t,Math.min(n,s)))},p=e=>{if(l.current!==null){try{e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId)}catch{}l.current=null}};return(0,y.jsxs)(Fj,{"aria-label":i,className:`h-7 overflow-hidden rounded-md border border-border/60`,children:[(0,y.jsx)(bC,{variant:`ghost`,size:`icon-xs`,onClick:()=>c(e-r),disabled:e<=t,"aria-label":a,className:Rj,children:(0,y.jsx)(fb,{})}),(0,y.jsx)(Ij,{role:`slider`,tabIndex:0,"aria-label":i,"aria-valuemin":t,"aria-valuemax":n,"aria-valuenow":e,"aria-valuetext":s(e),"aria-orientation":`horizontal`,title:`Drag or use arrow keys to adjust`,className:zj,onPointerDown:d,onPointerMove:f,onPointerUp:p,onPointerCancel:p,onPointerLeave:e=>{if(l.current===null)return;let t=!1;try{t=e.currentTarget.hasPointerCapture(e.pointerId)}catch{}t||(l.current=null)},onKeyDown:i=>{if(i.key===`Home`){i.preventDefault(),c(t);return}if(i.key===`End`){i.preventDefault(),c(n);return}let a=Bj[i.key];a!==void 0&&(i.preventDefault(),c(Math.max(t,Math.min(n,e+a*r))))},children:s(e)}),(0,y.jsx)(bC,{variant:`ghost`,size:`icon-xs`,onClick:()=>c(e+r),disabled:e>=n,"aria-label":o,className:Rj,children:(0,y.jsx)(mb,{})})]})};function Hj(e){let[t,n]=b.useState({current:e,previous:null});return e!==t.current&&n({current:e,previous:t.current}),t.previous}var Uj=b.createContext(null),Wj=b.createContext(null);function Gj(){let e=b.useContext(Uj);if(e===null)throw Error(WS(60));return e}function Kj(){let e=b.useContext(Wj);if(e===null)throw Error(WS(61));return e}var qj=(e,t)=>Object.is(e,t);function Jj(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function Yj(e,t,n){return!e||e.length===0?!1:e.some(e=>e===void 0?!1:Jj(t,e,n))}function Xj(e,t,n){return!e||e.length===0?-1:e.findIndex(e=>e===void 0?!1:Jj(e,t,n))}function Zj(e,t,n){return e.filter(e=>!Jj(t,e,n))}function Qj(e){if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}function $j(e){return e!=null&&e.length>0&&typeof e[0]==`object`&&e[0]!=null&&`items`in e[0]}function eM(e){if(!Array.isArray(e))return e!=null&&`null`in e;let t=e;if($j(t)){for(let e of t)for(let t of e.items)if(t&&t.value==null&&t.label!=null)return!0;return!1}for(let e of t)if(e&&e.value==null&&e.label!=null)return!0;return!1}function tM(e,t){if(t&&e!=null)return t(e)??``;if(e&&typeof e==`object`){if(`label`in e&&e.label!=null)return String(e.label);if(`value`in e)return String(e.value)}return Qj(e)}function nM(e,t){return t&&e!=null?t(e)??``:e&&typeof e==`object`&&`value`in e&&`label`in e?Qj(e.value):Qj(e)}function rM(e,t,n){function r(){return tM(e,n)}if(n&&e!=null)return n(e);if(e&&typeof e==`object`&&`label`in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return t[e]??r();if(Array.isArray(t)){let n=t,i=$j(n)?n.flatMap(e=>e.items):n;if(typeof e!=`object`||!e){let t=i.find(t=>t.value===e);return t&&t.label!=null?t.label:r()}if(`value`in e){let t=i.find(t=>t&&t.value===e.value);if(t&&t.label!=null)return t.label}}return r()}function iM(e,t,n){return e.reduce((e,r,i)=>(i>0&&e.push(`, `),e.push((0,y.jsx)(b.Fragment,{children:rM(r,t,n)},i)),e),[])}var aM={id:$(e=>e.id),labelId:$(e=>e.labelId),modal:$(e=>e.modal),multiple:$(e=>e.multiple),items:$(e=>e.items),itemToStringLabel:$(e=>e.itemToStringLabel),itemToStringValue:$(e=>e.itemToStringValue),isItemEqualToValue:$(e=>e.isItemEqualToValue),value:$(e=>e.value),hasSelectedValue:$(e=>{let{value:t,multiple:n,itemToStringValue:r}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:nM(t,r)!==``}),hasNullItemLabel:$((e,t)=>t?eM(e.items):!1),open:$(e=>e.open),mounted:$(e=>e.mounted),forceMount:$(e=>e.forceMount),transitionStatus:$(e=>e.transitionStatus),openMethod:$(e=>e.openMethod),activeIndex:$(e=>e.activeIndex),selectedIndex:$(e=>e.selectedIndex),isActive:$((e,t)=>e.activeIndex===t),isSelected:$((e,t,n)=>{let r=e.isItemEqualToValue,i=e.value;return e.multiple?Array.isArray(i)&&i.some(e=>Jj(n,e,r)):e.selectedIndex===t&&e.selectedIndex!==null?!0:Jj(n,i,r)}),isSelectedByFocus:$((e,t)=>e.selectedIndex===t),popupProps:$(e=>e.popupProps),triggerProps:$(e=>e.triggerProps),triggerElement:$(e=>e.triggerElement),positionerElement:$(e=>e.positionerElement),listElement:$(e=>e.listElement),scrollUpArrowVisible:$(e=>e.scrollUpArrowVisible),scrollDownArrowVisible:$(e=>e.scrollDownArrowVisible),hasScrollArrows:$(e=>e.hasScrollArrows)};function oM(e,t=-(2**53-1),n=2**53-1){return Math.max(t,Math.min(e,n))}function sM(e,t){return Math.max(0,e-t)}function cM(e,t){if(t<=0)return 0;let n=oM(e,0,t),r=n,i=t-n,a=r<=1,o=i<=1;return a&&o?r<=i?0:t:a?0:o?t:n}function lM(e){let{id:t,value:n,defaultValue:r=null,onValueChange:i,open:a,defaultOpen:o=!1,onOpenChange:s,name:c,form:l,autoComplete:u,disabled:d=!1,readOnly:f=!1,required:p=!1,modal:m=!0,actionsRef:h,inputRef:g,onOpenChangeComplete:_,items:v,multiple:x=!1,itemToStringLabel:S,itemToStringValue:C,isItemEqualToValue:w=qj,highlightItemOnHover:T=!0,children:E}=e,{clearErrors:D}=kC(),{setDirty:O,setTouched:k,setFocused:A,shouldValidateOnChange:j,validityData:M,setFilled:N,name:P,disabled:F,validation:I,validationMode:L}=DC(),R=BC({id:t}),z=F||d,ee=P??c,[B,V]=QT({controlled:n,default:x?r??sC:r,name:`Select`,state:`value`}),[H,te]=QT({controlled:a,default:o,name:`Select`,state:`open`}),ne=b.useRef([]),U=b.useRef([]),re=b.useRef(null),ie=b.useRef(null),ae=b.useRef(0),oe=b.useRef(null),se=b.useRef([]),ce=b.useRef(!1),le=b.useRef(!1),ue=b.useRef(null),de=b.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}),fe=b.useRef(!1),{mounted:pe,setMounted:me,transitionStatus:he}=ZT(H),{openMethod:ge,triggerProps:_e}=fA(H),ve=bS(()=>new _k({id:R,labelId:void 0,modal:m,multiple:x,itemToStringLabel:S,itemToStringValue:C,isItemEqualToValue:w,value:B,open:H,mounted:pe,transitionStatus:he,items:v,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,ye=pk(ve,aM.activeIndex),be=pk(ve,aM.selectedIndex),xe=pk(ve,aM.triggerElement),Se=pk(ve,aM.positionerElement),Ce=Hj(ge),we=ge??Ce,Te=b.useMemo(()=>x&&Array.isArray(B)&&B.length===0?``:nM(B,C),[x,B,C]),Ee=b.useMemo(()=>x&&Array.isArray(B)?B.map(e=>nM(e,C)):nM(B,C),[x,B,C]);$T(GE(ve.state.triggerElement),{id:R,value:B,getValue:CS(()=>Ee)});let De=b.useRef(B);Q(()=>{B!==De.current&&ve.set(`forceMount`,!0)},[ve,B]),Q(()=>{N(x?Array.isArray(B)&&B.length>0:B!=null)},[x,B,N]),Q(function(){if(H)return;let e=se.current;if(x){let t=Array.isArray(B)?B:[];if(t.length===0){ve.set(`selectedIndex`,null);return}let n=t[t.length-1],r=Xj(e,n,w);ve.set(`selectedIndex`,r===-1?null:r);return}let t=Xj(e,B,w);ve.set(`selectedIndex`,t===-1?null:t)},[x,H,B,se,w,ve]),dA(B,()=>{D(ee),O(B!==M.initialValue),j()?I.commit(B):I.commit(B,!0)});let Oe=CS((e,t)=>{if(s?.(e,t),!t.isCanceled&&(te(e),!e&&(t.reason===`focus-out`||t.reason===`outside-press`)&&(k(!0),A(!1),L===`onBlur`&&I.commit(B)),!e&&ve.state.activeIndex!==null)){let e=ne.current[ve.state.activeIndex];queueMicrotask(()=>{e?.setAttribute(`tabindex`,`-1`)})}}),ke=CS(()=>{me(!1),ve.update({activeIndex:null,openMethod:null}),_?.(!1)});XT({enabled:!h,open:H,ref:re,onComplete(){H||ke()}}),b.useImperativeHandle(h,()=>({unmount:ke}),[ke]);let Ae=CS((e,t)=>{i?.(e,t),!t.isCanceled&&V(e)}),je=CS(()=>{let e=ve.state.listElement||re.current;if(!e)return;let t=sM(e.scrollHeight,e.clientHeight),n=cM(e.scrollTop,t),r=n>0,i=n<t;ve.state.scrollUpArrowVisible!==r&&ve.set(`scrollUpArrowVisible`,r),ve.state.scrollDownArrowVisible!==i&&ve.set(`scrollDownArrowVisible`,i)}),Me=Ak({open:H,onOpenChange:Oe,elements:{reference:xe,floating:Se}}),{getReferenceProps:Ne,getFloatingProps:Pe,getItemProps:Fe}=Uk([ID(Me,{enabled:!f&&!z,event:`mousedown`}),UD(Me,{bubbles:!1}),Qk(Me,{enabled:!f&&!z,listRef:ne,activeIndex:ye,selectedIndex:be,disabledIndices:sC,onNavigate(e){e===null&&!H||ve.set(`activeIndex`,e)},focusItemOnHover:T}),tA(Me,{enabled:!f&&!z&&(H||!x),listRef:U,activeIndex:ye,selectedIndex:be,onMatch(e){H?ve.set(`activeIndex`,e):Ae(se.current[e],mE(`none`))},onTypingChange(e){ce.current=e}})]),Ie=b.useMemo(()=>kS(Ne(),_e,R?{id:R}:cC),[Ne,_e,R]);EE(()=>{ve.update({popupProps:Pe(),triggerProps:Ie})}),Q(()=>{ve.update({id:R,modal:m,multiple:x,value:B,open:H,mounted:pe,transitionStatus:he,popupProps:Pe(),triggerProps:Ie,items:v,itemToStringLabel:S,itemToStringValue:C,isItemEqualToValue:w,openMethod:we})},[ve,R,m,x,B,H,pe,he,Pe,Ie,v,S,C,w,we]);let Le=b.useMemo(()=>({store:ve,name:ee,required:p,disabled:z,readOnly:f,multiple:x,highlightItemOnHover:T,setValue:Ae,setOpen:Oe,listRef:ne,popupRef:re,scrollHandlerRef:ie,handleScrollArrowVisibility:je,scrollArrowsMountedCountRef:ae,getItemProps:Fe,events:Me.context.events,valueRef:oe,valuesRef:se,labelsRef:U,typingRef:ce,selectionRef:de,selectedItemTextRef:ue,validation:I,onOpenChangeComplete:_,keyboardActiveRef:le,alignItemWithTriggerActiveRef:fe,initialValueRef:De}),[ve,ee,p,z,f,x,T,Ae,Oe,Fe,Me.context.events,I,_,je]),Re=ZS(g,I.inputRef),ze=x&&Array.isArray(B)&&B.length>0,Be=x?void 0:ee,Ve=b.useMemo(()=>!x||!Array.isArray(B)||!ee?null:B.map(e=>{let t=nM(e,C);return(0,y.jsx)(`input`,{type:`hidden`,form:l,name:ee,value:t},t)}),[x,B,l,ee,C]);return(0,y.jsx)(Uj.Provider,{value:Le,children:(0,y.jsxs)(Wj.Provider,{value:Me,children:[E,(0,y.jsx)(`input`,{...I.getInputValidationProps({onFocus(){ve.state.triggerElement?.focus({focusVisible:!0})},onChange(e){if(e.nativeEvent.defaultPrevented)return;let t=e.currentTarget.value,n=mE(eE,e.nativeEvent);function r(){if(x)return;let e=se.current.find(e=>nM(e,C).toLowerCase()===t.toLowerCase()||tM(e,S).toLowerCase()===t.toLowerCase());e!=null&&(O(e!==M.initialValue),Ae(e,n),j()&&I.commit(e))}ve.set(`forceMount`,!0),queueMicrotask(r)}}),id:R&&Be==null?`${R}-hidden-input`:void 0,form:l,name:Be,autoComplete:u,value:Te,disabled:z,required:p&&!ze,readOnly:f,ref:Re,style:ee?YE:JE,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),Ve]})})}function uM(e,t){return e??t}function dM(e){let t=e.getBoundingClientRect(),n=Xx(e),r=n.getComputedStyle(e,`::before`),i=n.getComputedStyle(e,`::after`);if(!(r.content!==`none`||i.content!==`none`))return t;let a=parseFloat(r.width)||0,o=parseFloat(r.height)||0,s=parseFloat(i.width)||0,c=parseFloat(i.height)||0,l=Math.max(t.width,a,s),u=Math.max(t.height,o,c),d=l-t.width,f=u-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-f/2,bottom:t.bottom+f/2}}var fM=2,pM=400,mM=200,hM={...AA,...TC,value:()=>null},gM=b.forwardRef(function(e,t){let{render:n,className:r,id:i,disabled:a=!1,nativeButton:o=!0,style:s,...c}=e,{setTouched:l,setFocused:u,validationMode:d,state:f,disabled:p}=DC(),{labelId:m}=IC(),{store:h,setOpen:g,selectionRef:_,validation:v,readOnly:y,required:x,alignItemWithTriggerActiveRef:S,disabled:C,keyboardActiveRef:w}=Gj(),T=p||C||a,E=pk(h,aM.open),D=pk(h,aM.value),O=pk(h,aM.triggerProps),k=pk(h,aM.positionerElement),A=pk(h,aM.listElement),j=pk(h,aM.id),M=pk(h,aM.labelId),N=pk(h,aM.hasSelectedValue),P=!N&&E,F=pk(h,aM.hasNullItemLabel,P),I=i??j,L=uM(m,M);BC({id:I});let R=GE(k),z=b.useRef(null),{getButtonProps:ee,buttonRef:B}=JS({disabled:T,native:o}),V=ZS(t,z,B,CS(e=>{h.set(`triggerElement`,e)})),H=RT(),te=RT(),ne=RT(),U=RT();b.useEffect(()=>{if(E)return N||F?U.start(mM,()=>{_.current.allowUnselectedMouseUp=!0,ne.start(mM,()=>{_.current.allowSelectedMouseUp=!0})}):ne.start(pM,()=>{_.current.allowUnselectedMouseUp=!0,_.current.allowSelectedMouseUp=!0}),()=>{ne.clear(),U.clear()};_.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1},te.clear()},[E,N,F,_,te,ne,U]);let re=b.useMemo(()=>A?.id??_w(k)?.id,[A,k]),ie=kS(O,{id:I,role:`combobox`,"aria-expanded":E?`true`:`false`,"aria-haspopup":`listbox`,"aria-controls":E?re:void 0,"aria-labelledby":L,"aria-readonly":y||void 0,"aria-required":x||void 0,tabIndex:T?-1:0,ref:V,onFocus(e){u(!0),E&&S.current&&g(!1,mE(eE,e.nativeEvent)),H.start(0,()=>{h.set(`forceMount`,!0)})},onBlur(e){cw(k,e.relatedTarget)||(l(!0),u(!1),d===`onBlur`&&v.commit(D))},onPointerMove(){w.current=!1},onKeyDown(){w.current=!0},onMouseDown(e){if(E)return;let t=VC(e.currentTarget);function n(e){if(!z.current)return;let t=e.target;if(cw(z.current,t)||cw(R.current,t)||t===z.current)return;let n=dM(z.current);e.clientX>=n.left-fM&&e.clientX<=n.right+fM&&e.clientY>=n.top-fM&&e.clientY<=n.bottom+fM||g(!1,mE(uE,e))}te.start(0,()=>{t.addEventListener(`mouseup`,n,{once:!0})})}},v.getValidationProps,c,ee);ie.role=`combobox`;let ae={...f,open:E,disabled:T,value:D,readOnly:y,placeholder:!N};return fC(`button`,e,{ref:[t,z],state:ae,stateAttributesMapping:hM,props:ie})}),_M={value:()=>null},vM=b.forwardRef(function(e,t){let{className:n,render:r,children:i,placeholder:a,style:o,...s}=e,{store:c,valueRef:l}=Gj(),u=pk(c,aM.value),d=pk(c,aM.items),f=pk(c,aM.itemToStringLabel),p=pk(c,aM.hasSelectedValue),m=!p&&a!=null&&i==null,h=pk(c,aM.hasNullItemLabel,m),g={value:u,placeholder:!p},_=null;return _=typeof i==`function`?i(u):i??(!p&&a!=null&&!h?a:Array.isArray(u)?iM(u,d,f):rM(u,d,f)),fC(`span`,e,{state:g,ref:[t,l],props:[{children:_},s],stateAttributesMapping:_M})}),yM=b.forwardRef(function(e,t){let{className:n,render:r,style:i,...a}=e,{store:o}=Gj();return fC(`span`,e,{state:{open:pk(o,aM.open)},ref:t,props:[{"aria-hidden":!0,children:`▼`},a],stateAttributesMapping:kA})}),bM=b.createContext(void 0),xM=b.forwardRef(function(e,t){let{store:n}=Gj(),r=pk(n,aM.mounted),i=pk(n,aM.forceMount);return r||i?(0,y.jsx)(bM.Provider,{value:!0,children:(0,y.jsx)(xD,{ref:t,...e})}):null}),SM=b.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function CM(){return b.useContext(SM)}function wM(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=CS(i),o=b.useRef(0),s=bS(EM).current,c=bS(TM).current,[l,u]=b.useState(0),d=b.useRef(l),f=CS((e,t)=>{c.set(e,t??null),d.current+=1,u(d.current)}),p=CS(e=>{c.delete(e),d.current+=1,u(d.current)}),m=b.useMemo(()=>{let e=new Map;return Array.from(c.keys()).filter(e=>e.isConnected).sort(DM).forEach((t,n)=>{let r=c.get(t)??{};e.set(t,{...r,index:n})}),e},[c,l]);Q(()=>{if(typeof MutationObserver!=`function`||m.size===0)return;let e=new MutationObserver(e=>{let t=new Set,n=e=>t.has(e)?t.delete(e):t.add(e);e.forEach(e=>{e.removedNodes.forEach(n),e.addedNodes.forEach(n)}),t.size===0&&(d.current+=1,u(d.current))});return m.forEach((t,n)=>{n.parentElement&&e.observe(n.parentElement,{childList:!0})}),()=>{e.disconnect()}},[m]),Q(()=>{d.current===l&&(n.current.length!==m.size&&(n.current.length=m.size),r&&r.current.length!==m.size&&(r.current.length=m.size),o.current=m.size),a(m)},[a,m,n,r,l]),Q(()=>()=>{n.current=[]},[n]),Q(()=>()=>{r&&(r.current=[])},[r]);let h=CS(e=>(s.add(e),()=>{s.delete(e)}));Q(()=>{s.forEach(e=>e(m))},[s,m]);let g=b.useMemo(()=>({register:f,unregister:p,subscribeMapChange:h,elementsRef:n,labelsRef:r,nextIndexRef:o}),[f,p,h,n,r,o]);return(0,y.jsx)(SM.Provider,{value:g,children:t})}function TM(){return new Map}function EM(){return new Set}function DM(e,t){let n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}var OM=b.createContext(void 0);function kM(){return b.useContext(OM)?.direction??`ltr`}var AM=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0,offsetParent:d=`real`}=Pw(e,t)||{};if(l==null)return{};let f=Qw(u),p={x:n,y:r},m=Bw(i),h=Rw(m),g=await o.getDimensions(l),_=m===`y`,v=_?`top`:`left`,y=_?`bottom`:`right`,b=_?`clientHeight`:`clientWidth`,x=a.reference[h]+a.reference[m]-p[m]-a.floating[h],S=p[m]-a.reference[m],C=d===`real`?await o.getOffsetParent?.(l):s.floating,w=s.floating[b]||a.floating[h];(!w||!await o.isElement?.(C))&&(w=s.floating[b]||a.floating[h]);let T=x/2-S/2,E=w/2-g[h]/2-1,D=Math.min(f[v],E),O=Math.min(f[y],E),k=D,A=w-g[h]-O,j=w/2-g[h]/2+T,M=Nw(k,j,A),N=!c.arrow&&Iw(i)!=null&&j!==M&&a.reference[h]/2-(j<k?D:O)-g[h]/2<0,P=N?j<k?j-k:j-A:0;return{[m]:p[m]+P,data:{[m]:M,centerOffset:j-M-P,...N&&{alignmentOffset:P}},reset:N}}}),jM=(e,t)=>({...AM(e),options:[e,t]}),MM={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0;return{data:{referenceHidden:(await QO().fn(e)).data?.referenceHidden||a}}}},NM={sideX:`left`,sideY:`top`},PM={name:`adaptiveOrigin`,async fn(e){let{x:t,y:n,rects:{floating:r},elements:{floating:i},platform:a,strategy:o,placement:s}=e,c=Xx(i),l=c.getComputedStyle(i);if(!(l.transitionDuration!==`0s`&&l.transitionDuration!==``))return{x:t,y:n,data:NM};let u=await a.getOffsetParent?.(i),d={width:0,height:0};if(o===`fixed`&&c?.visualViewport)d={width:c.visualViewport.width,height:c.visualViewport.height};else if(u===c){let e=VC(i);d={width:e.documentElement.clientWidth,height:e.documentElement.clientHeight}}else await a.isElement?.(u)&&(d=await a.getDimensions(u));let f=Fw(s),p=t,m=n;f===`left`&&(p=d.width-(t+r.width)),f===`top`&&(m=d.height-(n+r.height));let h=f===`left`?`right`:NM.sideX,g=f===`top`?`bottom`:NM.sideY;return{x:p,y:m,data:{sideX:h,sideY:g}}}};function FM(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function IM(e,t,n){let{rects:r,placement:i}=e;return{side:FM(t,Fw(i),n),align:Iw(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function LM(e){let{anchor:t,positionMethod:n=`absolute`,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,collisionBoundary:s,collisionPadding:c=5,sticky:l=!1,arrowPadding:u=5,disableAnchorTracking:d=!1,keepMounted:f=!1,floatingRootContext:p,mounted:m,collisionAvoidance:h,shiftCrossAxis:g=!1,nodeId:_,adaptiveOrigin:v,lazyFlip:y=!1,externalTree:x}=e,[S,C]=b.useState(null);!m&&S!==null&&C(null);let w=h.side||`flip`,T=h.align||`flip`,E=h.fallbackAxisSide||`end`,D=typeof t==`function`?t:void 0,O=CS(D),k=D?O:t,A=GE(t),j=GE(m),M=kM()===`rtl`,N=S||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":M?`left`:`right`,"inline-start":M?`right`:`left`}[r],P=a===`center`?N:`${N}-${a}`,F=c,I=+(r===`bottom`),L=+(r===`top`),R=+(r===`right`),z=+(r===`left`);typeof F==`number`?F={top:F+I,right:F+z,bottom:F+L,left:F+R}:F&&={top:(F.top||0)+I,right:(F.right||0)+z,bottom:(F.bottom||0)+L,left:(F.left||0)+R};let ee={boundary:s===`clipping-ancestors`?`clippingAncestors`:s,padding:F},B=b.useRef(null),V=GE(i),H=GE(o),te=[qO(e=>{let t=IM(e,r,M),n=typeof V.current==`function`?V.current(t):V.current,i=typeof H.current==`function`?H.current(t):H.current;return{mainAxis:n,crossAxis:i,alignmentAxis:i}},[typeof i==`function`?0:i,typeof o==`function`?0:o,M,r])],ne=T===`none`&&w!==`shift`,U=!ne&&(l||g||w===`shift`),re=w===`none`?null:XO({...ee,padding:{top:F.top+1,right:F.right+1,bottom:F.bottom+1,left:F.left+1},mainAxis:!g&&w===`flip`,crossAxis:T===`flip`?`alignment`:!1,fallbackAxisSideDirection:E}),ie=ne?null:JO(e=>{let t=VC(e.elements.floating).documentElement;return{...ee,rootBoundary:g?{x:0,y:0,width:t.clientWidth,height:t.clientHeight}:void 0,mainAxis:T!==`none`,crossAxis:U,limiter:l||g?void 0:YO(e=>{if(!B.current)return{};let{width:t,height:n}=B.current.getBoundingClientRect(),r=zw(Fw(e.placement)),i=r===`y`?t:n,a=r===`y`?F.left+F.right:F.top+F.bottom;return{offset:i/2+a/2}})}},[ee,l,g,F,T]);w===`shift`||T===`shift`||a===`center`?te.push(ie,re):te.push(re,ie),te.push(ZO({...ee,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!j.current)return;let i=e.style;i.setProperty(`--available-width`,`${t}px`),i.setProperty(`--available-height`,`${n}px`);let a=Xx(e).devicePixelRatio||1,{x:o,y:s,width:c,height:l}=r.reference,u=(Math.round((o+c)*a)-Math.round(o*a))/a,d=(Math.round((s+l)*a)-Math.round(s*a))/a;i.setProperty(`--anchor-width`,`${u}px`),i.setProperty(`--anchor-height`,`${d}px`)}}),jM(()=>({element:B.current||VC(B.current).createElement(`div`),padding:u,offsetParent:`floating`}),[u]),{name:`transformOrigin`,fn(e){let{elements:t,middlewareData:n,placement:a,rects:o,y:s}=e,c=Fw(a),l=zw(c),u=B.current,d=n.arrow?.x||0,f=n.arrow?.y||0,p=u?.clientWidth||0,m=u?.clientHeight||0,h=d+p/2,g=f+m/2,_=Math.abs(n.shift?.y||0),v=o.reference.height/2,y=typeof i==`function`?i(IM(e,r,M)):i,b=_>y,x={top:`${h}px calc(100% + ${y}px)`,bottom:`${h}px ${-y}px`,left:`calc(100% + ${y}px) ${g}px`,right:`${-y}px ${g}px`}[c],S=`${h}px ${o.reference.y+v-s}px`;return t.floating.style.setProperty(`--transform-origin`,U&&l===`y`&&b?S:x),{}}},MM,v),Q(()=>{!m&&p&&p.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[m,p]);let ae=b.useMemo(()=>({elementResize:!d&&typeof ResizeObserver<`u`,layoutShift:!d&&typeof IntersectionObserver<`u`}),[d]),{refs:oe,elements:se,x:ce,y:le,middlewareData:ue,update:de,placement:fe,context:pe,isPositioned:me,floatingStyles:he}=jk({rootContext:p,open:f?m:void 0,placement:P,middleware:te,strategy:n,whileElementsMounted:f?void 0:(...e)=>NO(...e,ae),nodeId:_,externalTree:x}),{sideX:ge,sideY:_e}=ue.adaptiveOrigin||NM,ve=me?n:`fixed`,ye=b.useMemo(()=>{let e=v?{position:ve,[ge]:ce,[_e]:le}:{position:ve,...he};return me||(e.opacity=0),e},[v,ve,ge,ce,_e,le,he,me]),be=b.useRef(null);Q(()=>{if(!m)return;let e=A.current,t=typeof e==`function`?e():e,n=(RM(t)?t.current:t)||null;n!==be.current&&(oe.setPositionReference(n),be.current=n)},[m,oe,k,A]),b.useEffect(()=>{if(!m)return;let e=A.current;typeof e!=`function`&&RM(e)&&e.current!==be.current&&(oe.setPositionReference(e.current),be.current=e.current)},[m,oe,k,A]),b.useEffect(()=>{if(f&&m&&se.domReference&&se.floating)return NO(se.domReference,se.floating,de,ae)},[f,m,se,de,ae]);let xe=Fw(fe),Se=FM(r,xe,M),Ce=Iw(fe)||`center`,we=!!ue.hide?.referenceHidden;Q(()=>{y&&m&&me&&C(xe)},[y,m,me,xe]);let Te=b.useMemo(()=>({position:`absolute`,top:ue.arrow?.y,left:ue.arrow?.x}),[ue.arrow]),Ee=ue.arrow?.centerOffset!==0;return b.useMemo(()=>({positionerStyles:ye,arrowStyles:Te,arrowRef:B,arrowUncentered:Ee,side:Se,align:Ce,physicalSide:xe,anchorHidden:we,refs:oe,context:pe,isPositioned:me,update:de}),[ye,Te,B,Ee,Se,Ce,xe,we,oe,pe,me,de])}function RM(e){return e!=null&&`current`in e}var zM=b.createContext(void 0);function BM(){let e=b.useContext(zM);if(!e)throw Error(WS(59));return e}function VM(e,t){e&&Object.assign(e.style,t)}var HM={position:`relative`,maxHeight:`100%`,overflowX:`hidden`,overflowY:`auto`};function UM(e){return e===`starting`?fD:cC}function WM(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),fC(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},UM(r),i],stateAttributesMapping:jA})}var GM=20;function KM(e,t,n,r){let[i,a]=b.useState(!1);Q(()=>{if(!e||!t||n==null){a(!1);return}let r=VC(n).documentElement.clientWidth,i=n.offsetWidth;a(r>0&&i>0&&i>=r-GM)},[e,t,n]),IE(e&&(!t||i),r)}var qM={position:`fixed`},JM=b.forwardRef(function(e,t){let{anchor:n,positionMethod:r=`absolute`,className:i,render:a,side:o=`bottom`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m,alignItemWithTrigger:h=!0,collisionAvoidance:g=mD,style:_,...v}=e,{store:x,listRef:S,labelsRef:C,alignItemWithTriggerActiveRef:w,selectedItemTextRef:T,valuesRef:E,initialValueRef:D,popupRef:O,setValue:k}=Gj(),A=Kj(),j=pk(x,aM.open),M=pk(x,aM.mounted),N=pk(x,aM.modal),P=pk(x,aM.value),F=pk(x,aM.openMethod),I=pk(x,aM.positionerElement),L=pk(x,aM.triggerElement),R=pk(x,aM.isItemEqualToValue),z=pk(x,aM.transitionStatus),ee=b.useRef(null),B=b.useRef(null),[V,H]=b.useState(h),te=M&&V&&F!==`touch`;!M&&V!==h&&H(h),Q(()=>{M||(aM.scrollUpArrowVisible(x.state)&&x.set(`scrollUpArrowVisible`,!1),aM.scrollDownArrowVisible(x.state)&&x.set(`scrollDownArrowVisible`,!1))},[x,M]),b.useImperativeHandle(w,()=>te),KM((te||N)&&j,F===`touch`,I,L);let ne=LM({anchor:n,floatingRootContext:A,positionMethod:r,mounted:M,side:o,sideOffset:c,align:s,alignOffset:l,arrowPadding:f,collisionBoundary:u,collisionPadding:d,sticky:p,disableAnchorTracking:m??te,collisionAvoidance:g,keepMounted:!0}),U=te?`none`:ne.side,re=te?qM:ne.positionerStyles,ie=WM(e,{open:j,side:U,align:ne.align,anchorHidden:ne.anchorHidden},{styles:re,transitionStatus:z,props:v,refs:[t,CS(e=>{x.set(`positionerElement`,e)})],hidden:!M,inert:!j}),ae=b.useRef(0),oe=CS(e=>{if(e.size===0&&ae.current===0||E.current.length===0)return;let t=ae.current;if(ae.current=e.size,e.size===t)return;let n=mE(eE);if(t!==0&&!x.state.multiple&&P!==null&&Xj(E.current,P,R)===-1){let e=D.current,t=e!=null&&Xj(E.current,e,R)!==-1?e:null;k(t,n),t===null&&(x.set(`selectedIndex`,null),T.current=null)}if(t!==0&&x.state.multiple&&Array.isArray(P)){let e=e=>Xj(E.current,e,R)!==-1,t=P.filter(t=>e(t));(t.length!==P.length||t.some(e=>!Yj(P,e,R)))&&(k(t,n),t.length===0&&(x.set(`selectedIndex`,null),T.current=null))}if(j&&te){x.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});let e={height:``};VM(I,e),VM(O.current,e)}}),se=b.useMemo(()=>({...ne,side:U,alignItemWithTriggerActive:te,setControlledAlignItemWithTrigger:H,scrollUpArrowRef:ee,scrollDownArrowRef:B}),[ne,U,te,H]);return(0,y.jsx)(wM,{elementsRef:S,labelsRef:C,onMapChange:oe,children:(0,y.jsxs)(zM.Provider,{value:se,children:[M&&N&&(0,y.jsx)(QA,{inert:ZA(!j),cutout:L}),ie]})})}),YM=`base-ui-disable-scrollbar`,XM={className:YM,getElement(e){return(0,y.jsx)(`style`,{nonce:e,href:YM,precedence:`base-ui:low`,children:`.${YM}{scrollbar-width:none}.${YM}::-webkit-scrollbar{display:none}`})}},ZM=b.createContext(void 0);function QM(e){let t=b.useContext(ZM);if(t===void 0&&!e)throw Error(WS(69));return t}var $M=b.createContext(void 0),eN={disableStyleElements:!1};function tN(){return b.useContext($M)??eN}var nN={...jA,...qT},rN=b.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,...o}=e,{store:s,popupRef:c,onOpenChangeComplete:l,setOpen:u,valueRef:d,selectedItemTextRef:f,keyboardActiveRef:p,multiple:m,handleScrollArrowVisibility:h,scrollHandlerRef:g,listRef:_,highlightItemOnHover:v}=Gj(),{side:x,align:S,alignItemWithTriggerActive:C,isPositioned:w,setControlledAlignItemWithTrigger:T,scrollDownArrowRef:E,scrollUpArrowRef:D}=BM(),O=QM(!0)!=null,k=Kj(),A=kM(),{nonce:j,disableStyleElements:M}=tN(),N=pk(s,aM.id),P=pk(s,aM.open),F=pk(s,aM.mounted),I=pk(s,aM.popupProps),L=pk(s,aM.transitionStatus),R=pk(s,aM.triggerElement),z=pk(s,aM.positionerElement),ee=pk(s,aM.listElement),B=b.useRef(!1),V=b.useRef(!1),H=b.useRef({}),te=HT(),ne=CS(e=>{if(!z||!c.current||!V.current)return;if(B.current||!C){h();return}let t=z.style.top===`0px`,n=z.style.bottom===`0px`;if(!t&&!n){h();return}let r=oN(z),i=sN(z.getBoundingClientRect().height,`y`,r),a=VC(z),o=getComputedStyle(z),s=parseFloat(o.marginTop),l=parseFloat(o.marginBottom),u=iN(getComputedStyle(c.current)),d=Math.min(a.documentElement.clientHeight-s-l,u),f=e.scrollTop,p=aN(e),m=0,g=null,_=!1,v=!1,y=e=>{z.style.height=`${e}px`},b=(t,n)=>{let r=oM(t,0,d-i);r>0&&y(i+r),e.scrollTop=n,d-(i+r)<=1&&(B.current=!0),h()},x=t?p-f:f,S=Math.min(i+x,d);if(m=S,x<=1){b(x,t?p:0);return}if(d-S>1?t?v=!0:g=0:(_=!0,n&&f<p&&(g=f-(x-(i+x-d)))),m=Math.ceil(m),m!==0&&y(m),v||g!=null){let t=aN(e),n=v?t:oM(g,0,t);Math.abs(e.scrollTop-n)>1&&(e.scrollTop=n)}(_||m>=d-1)&&(B.current=!0),h()});b.useImperativeHandle(g,()=>ne,[ne]),XT({open:P,ref:c,onComplete(){P&&l?.(!0)}});let U={open:P,transitionStatus:L,side:x,align:S};Q(()=>{!z||!c.current||Object.keys(H.current).length||(H.current={top:z.style.top||`0`,left:z.style.left||`0`,right:z.style.right,height:z.style.height,bottom:z.style.bottom,minHeight:z.style.minHeight,maxHeight:z.style.maxHeight,marginTop:z.style.marginTop,marginBottom:z.style.marginBottom})},[c,z]),Q(()=>{P||C||(V.current=!1,B.current=!1,VM(z,H.current))},[P,C,z,c]),Q(()=>{let e=c.current;if(!P||!R||!z||!e||C&&!w||s.state.transitionStatus===`ending`)return;if(!C){V.current=!0,te.request(h),e.style.removeProperty(`--transform-origin`);return}let t=uN(e);e.style.removeProperty(`--transform-origin`);try{let t=f.current,n=d.current,r=getComputedStyle(z),i=getComputedStyle(e),a=VC(R),o=Xx(z),c=oN(R),l=cN(R.getBoundingClientRect(),c),u=cN(z.getBoundingClientRect(),c),p=l.height,m=ee||e,g=m.scrollHeight,y=parseFloat(i.borderBottomWidth),b=parseFloat(r.marginTop)||10,x=parseFloat(r.marginBottom)||10,S=parseFloat(r.minHeight)||100,C=iN(i),w=a.documentElement.clientHeight-b-x,E=a.documentElement.clientWidth,D=w-l.bottom+p,O,k=A===`rtl`?l.right-u.width:l.left,j=0;if(t&&n){let e=cN(n.getBoundingClientRect(),c);O=cN(t.getBoundingClientRect(),c),k=u.left+(A===`rtl`?e.right-O.right:e.left-O.left);let r=e.top-l.top+e.height/2;j=O.top-u.top+O.height/2-r}let M=D+j+x+y,N=Math.min(w,M),P=w-b-x,F=M-N,I=E-5;z.style.left=`${oM(k,5,I-u.width)}px`,z.style.height=`${N}px`,z.style.maxHeight=`auto`,z.style.marginTop=`${b}px`,z.style.marginBottom=`${x}px`,e.style.height=`100%`;let L=aN(m),te=F>=L-1;te&&(N=Math.min(w,u.height)-(F-L));let ne=l.top<20||l.bottom>w-20||Math.ceil(N)+1<Math.min(g,S),U=(o.visualViewport?.scale??1)!==1&&KC;if(ne||U){V.current=!0,VM(z,H.current),T(!1);return}let re=Math.max(S,N);if(te){let e=Math.max(0,w-M);z.style.top=u.height>=P?`0`:`${e}px`,z.style.height=`${N}px`,m.scrollTop=aN(m)}else z.style.bottom=`0`,m.scrollTop=F;if(O){let t=u.top,n=u.height,r=O.top+O.height/2,i=oM(n>0?(r-t)/n*100:50,0,100);e.style.setProperty(`--transform-origin`,`50% ${i}%`)}(re===w||N>=C)&&(B.current=!0),h(),v&&s.state.selectedIndex===null&&s.state.activeIndex===null&&_.current[0]!=null&&s.set(`activeIndex`,0),V.current=!0}finally{t()}},[s,P,z,R,d,f,c,h,C,T,te,E,D,ee,_,v,A,w]),b.useEffect(()=>{if(!C||!z||!P)return;let e=Xx(z);function t(e){u(!1,mE(pE,e))}return DE(e,`resize`,t)},[u,C,z,P]);let re={...ee?{role:`presentation`,"aria-orientation":void 0}:{role:`listbox`,"aria-multiselectable":m||void 0,id:`${N}-list`},onKeyDown(e){p.current=!0,O&&JA.has(e.key)&&e.stopPropagation()},onMouseMove(){p.current=!1},onScroll(e){ee||ne(e.currentTarget)},...C&&{style:ee?{height:`100%`}:HM}},ie=fC(`div`,e,{ref:[t,c],state:U,stateAttributesMapping:nN,props:[I,re,UM(L),{className:!ee&&C?XM.className:void 0},o]});return(0,y.jsxs)(b.Fragment,{children:[!M&&XM.getElement(j),(0,y.jsx)(FD,{context:k,modal:!1,disabled:!F,returnFocus:a,restoreFocus:!0,children:ie})]})});function iN(e){let t=e.maxHeight||``;return t.endsWith(`px`)&&parseFloat(t)||1/0}function aN(e){return sM(e.scrollHeight,e.clientHeight)}function oN(e){return AO.getScale(e)}function sN(e,t,n){return e/n[t]}function cN(e,t){return $w({x:sN(e.x,`x`,t),y:sN(e.y,`y`,t),width:sN(e.width,`x`,t),height:sN(e.height,`y`,t)})}var lN=[[`transform`,`none`],[`scale`,`1`],[`translate`,`0 0`]];function uN(e){let{style:t}=e,n={};for(let[e,r]of lN)n[e]=t.getPropertyValue(e),t.setProperty(e,r,`important`);return()=>{for(let[e]of lN){let r=n[e];r?t.setProperty(e,r):t.removeProperty(e)}}}var dN=b.forwardRef(function(e,t){let{className:n,render:r,style:i,...a}=e,{store:o,scrollHandlerRef:s}=Gj(),{alignItemWithTriggerActive:c}=BM(),l=pk(o,aM.hasScrollArrows),u=pk(o,aM.openMethod),d=pk(o,aM.multiple),f={id:`${pk(o,aM.id)}-list`,role:`listbox`,"aria-multiselectable":d||void 0,onScroll(e){s.current?.(e.currentTarget)},...c&&{style:HM},className:l&&u!==`touch`?XM.className:void 0};return fC(`div`,e,{ref:[t,CS(e=>{o.set(`listElement`,e)})],props:[f,a]})}),fN=function(e){return e[e.None=0]=`None`,e[e.GuessFromOrder=1]=`GuessFromOrder`,e}({});function pN(e={}){let{label:t,metadata:n,textRef:r,indexGuessBehavior:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,elementsRef:l,labelsRef:u,nextIndexRef:d}=CM(),f=b.useRef(-1),[p,m]=b.useState(a??(i===fN.GuessFromOrder?()=>{if(f.current===-1){let e=d.current;d.current+=1,f.current=e}return f.current}:-1)),h=b.useRef(null),g=b.useCallback(e=>{if(h.current=e,p!==-1&&e!==null&&(l.current[p]=e,u)){let n=t!==void 0;u.current[p]=n?t:r?.current?.textContent??e.textContent}},[p,l,u,t,r]);return Q(()=>{if(a!=null)return;let e=h.current;if(e)return o(e,n),()=>{s(e)}},[a,o,s,n]),Q(()=>{if(a==null)return c(e=>{let t=h.current?e.get(h.current)?.index:null;t!=null&&m(t)})},[a,c,m]),b.useMemo(()=>({ref:g,index:p}),[p,g])}var mN=b.createContext(void 0);function hN(){let e=b.useContext(mN);if(!e)throw Error(WS(57));return e}var gN=b.memo(b.forwardRef(function(e,t){let{render:n,className:r,value:i=null,label:a,disabled:o=!1,nativeButton:s=!1,style:c,...l}=e,u=b.useRef(null),d=pN({label:a,textRef:u,indexGuessBehavior:fN.GuessFromOrder}),{store:f,getItemProps:p,setOpen:m,setValue:h,selectionRef:g,typingRef:_,valuesRef:v,multiple:x,selectedItemTextRef:S}=Gj(),C=pk(f,aM.isActive,d.index),w=pk(f,aM.isSelected,d.index,i),T=pk(f,aM.isSelectedByFocus,d.index),E=pk(f,aM.isItemEqualToValue),D=d.index,O=D!==-1,k=b.useRef(null),A=GE(D);Q(()=>{if(!O)return;let e=v.current;return e[D]=i,()=>{delete e[D]}},[O,D,i,v]),Q(()=>{if(!O)return;let e=f.state.value,t=e;x&&Array.isArray(e)&&e.length>0&&(t=e[e.length-1]),t!==void 0&&Jj(i,t,E)&&(f.set(`selectedIndex`,D),u.current&&(S.current=u.current))},[O,D,x,E,f,i,S]);let j={disabled:o,selected:w,highlighted:C},M=p({active:C,selected:w});M.id=void 0;let N=b.useRef(null),P=b.useRef(`mouse`),F=b.useRef(!1),{getButtonProps:I,buttonRef:L}=JS({disabled:o,focusableWhenDisabled:!0,native:s,composite:!0});function R(e){let t=f.state.value;if(x){let n=Array.isArray(t)?t:[];h(w?Zj(n,i,E):[...n,i],mE(aE,e))}else h(i,mE(aE,e)),m(!1,mE(aE,e))}let z={role:`option`,"aria-selected":w,tabIndex:C?0:-1,onTouchStart(){g.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}},onKeyDown(e){N.current=e.key,f.set(`activeIndex`,D),e.key===` `&&_.current&&e.preventDefault()},onClick(e){F.current=!1,!(e.type===`keydown`&&N.current===null)&&(o||e.type===`keydown`&&N.current===` `&&_.current||P.current!==`touch`&&!C||(N.current=null,R(e.nativeEvent)))},onPointerEnter(e){P.current=e.pointerType},onPointerDown(e){P.current=e.pointerType,F.current=!0},onMouseUp(){if(o)return;if(F.current){F.current=!1;return}let e=!g.current.allowSelectedMouseUp&&w,t=!g.current.allowUnselectedMouseUp&&!w;e||t||P.current!==`touch`&&!C||k.current?.click()}},ee=fC(`div`,e,{ref:[L,t,d.ref,k],state:j,props:[M,z,l,I]}),B=b.useMemo(()=>({selected:w,indexRef:A,textRef:u,selectedByFocus:T,hasRegistered:O}),[w,A,u,T,O]);return(0,y.jsx)(mN.Provider,{value:B,children:ee})})),_N=b.forwardRef(function(e,t){let n=e.keepMounted??!1,{selected:r}=hN();return n||r?(0,y.jsx)(vN,{...e,ref:t}):null}),vN=b.memo(b.forwardRef((e,t)=>{let{render:n,className:r,style:i,keepMounted:a,...o}=e,{selected:s}=hN(),c=b.useRef(null),{transitionStatus:l,setMounted:u}=ZT(s),d=fC(`span`,e,{ref:[t,c],state:{selected:s,transitionStatus:l},props:[{"aria-hidden":!0,children:`✔️`},o],stateAttributesMapping:qT});return XT({open:s,ref:c,onComplete(){s||u(!1)}}),d})),yN=b.memo(b.forwardRef(function(e,t){let{indexRef:n,textRef:r,selectedByFocus:i,hasRegistered:a}=hN(),{selectedItemTextRef:o}=Gj(),{className:s,render:c,style:l,...u}=e;return fC(`div`,e,{ref:[b.useCallback(e=>{if(!e||!a)return;let t=o.current===null||!o.current.isConnected;(i||t&&n.current===0)&&(o.current=e)},[o,n,i,a]),t,r],props:u})})),bN=b.forwardRef(function(e,t){let{render:n,className:r,style:i,direction:a,keepMounted:o=!1,...s}=e,c=a===`up`,{store:l,popupRef:u,listRef:d,handleScrollArrowVisibility:f,scrollArrowsMountedCountRef:p}=Gj(),{side:m,scrollDownArrowRef:h,scrollUpArrowRef:g}=BM(),_=pk(l,c?aM.scrollUpArrowVisible:aM.scrollDownArrowVisible),v=pk(l,aM.openMethod),y=_&&v!==`touch`,b=RT(),x=c?g:h,{transitionStatus:S,setMounted:C}=ZT(y);Q(()=>(p.current+=1,l.state.hasScrollArrows||l.set(`hasScrollArrows`,!0),()=>{p.current=Math.max(0,p.current-1),p.current===0&&l.state.hasScrollArrows&&l.set(`hasScrollArrows`,!1)}),[l,p]),XT({open:y,ref:x,onComplete(){y||C(!1)}});let w=fC(`div`,e,{ref:[t,x],state:{direction:a,visible:y,side:m,transitionStatus:S},props:[{"aria-hidden":!0,children:c?`▲`:`▼`,style:{position:`absolute`},onMouseMove(e){if(e.movementX===0&&e.movementY===0||b.isStarted())return;l.set(`activeIndex`,null);function t(){let e=l.state.listElement??u.current;if(!e)return;l.set(`activeIndex`,null),f();let n=sM(e.scrollHeight,e.clientHeight),r=cM(e.scrollTop,n),i=r===(c?0:n),a=d.current;if(r!==e.scrollTop&&(e.scrollTop=r),a.length===0&&l.set(c?`scrollUpArrowVisible`:`scrollDownArrowVisible`,!i),i){b.clear();return}if(a.length>0){let t=x.current?.offsetHeight||0;e.scrollTop=xN(a,c,r,e.clientHeight,t,n)}b.start(40,t)}b.start(40,t)},onMouseLeave(){b.clear()}},s]});return y||o?w:null});function xN(e,t,n,r,i,a){if(t){let t=0,r=n+i-1;for(let n=0;n<e.length;n+=1){let i=e[n];if(i&&i.offsetTop>=r){t=n;break}}let o=Math.max(0,t-1),s=e[o];return o<t&&s?cM(s.offsetTop-i,a):0}let o=e.length-1,s=n+r-i+1;for(let t=0;t<e.length;t+=1){let n=e[t];if(n&&n.offsetTop+n.offsetHeight>s){o=Math.max(0,t-1);break}}let c=Math.min(e.length-1,o+1),l=e[c];return c>o&&l?cM(l.offsetTop+l.offsetHeight-r+i,a):a}var SN=b.forwardRef(function(e,t){return(0,y.jsx)(bN,{...e,ref:t,direction:`down`})}),CN=b.forwardRef(function(e,t){return(0,y.jsx)(bN,{...e,ref:t,direction:`up`})}),wN=lM;function TN({className:e,...t}){return(0,y.jsx)(vM,{"data-slot":`select-value`,className:qx(`flex flex-1 text-left`,e),...t})}function EN({className:e,size:t=`default`,children:n,...r}){return(0,y.jsxs)(gM,{"data-slot":`select-trigger`,"data-size":t,className:qx(`flex w-fit items-center justify-between gap-1.5 rounded-md border border-input bg-transparent py-2 pr-2 pl-2.5 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...r,children:[n,(0,y.jsx)(yM,{render:(0,y.jsx)(cb,{className:`pointer-events-none size-4 text-muted-foreground`})})]})}function DN({className:e,children:t,footer:n,side:r=`bottom`,sideOffset:i=4,align:a=`center`,alignOffset:o=0,alignItemWithTrigger:s=!0,...c}){return(0,y.jsx)(xM,{children:(0,y.jsx)(JM,{side:r,sideOffset:i,align:a,alignOffset:o,alignItemWithTrigger:s,className:`isolate z-50`,children:(0,y.jsxs)(rN,{"data-slot":`select-content`,"data-align-trigger":s,className:qx(`relative isolate z-50 max-h-(--available-height) w-(--anchor-width) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-md bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...c,children:[(0,y.jsx)(kN,{}),(0,y.jsx)(dN,{children:t}),(0,y.jsx)(AN,{}),n]})})})}function ON({className:e,children:t,...n}){return(0,y.jsxs)(gN,{"data-slot":`select-item`,className:qx(`relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2`,e),...n,children:[(0,y.jsx)(yN,{className:`flex flex-1 shrink-0 gap-2 whitespace-nowrap`,children:t}),(0,y.jsx)(_N,{render:(0,y.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex size-4 items-center justify-center`}),children:(0,y.jsx)(sb,{className:`pointer-events-none`})})]})}function kN({className:e,...t}){return(0,y.jsx)(CN,{"data-slot":`select-scroll-up-button`,className:qx(`top-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4`,e),...t,children:(0,y.jsx)(lb,{})})}function AN({className:e,...t}){return(0,y.jsx)(SN,{"data-slot":`select-scroll-down-button`,className:qx(`bottom-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4`,e),...t,children:(0,y.jsx)(cb,{})})}var jN=`h-7 justify-between gap-1.5 rounded-md border-border/60 bg-transparent px-2 text-xs font-normal text-foreground shadow-none focus-visible:border-ring/40 focus-visible:ring-1 focus-visible:ring-ring/40 dark:bg-transparent`,MN=`max-h-72 w-(--anchor-width) origin-(--transform-origin) gap-0 overflow-hidden p-1 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden`,NN=`rounded-sm py-1.5 pr-7 pl-2 text-xs hover:bg-foreground/10 hover:text-foreground focus:bg-foreground/10 focus:text-foreground`,PN=({value:e,items:t,ariaLabel:n,placeholder:r,onValueChange:i,open:a,onOpenChange:o,onItemHover:s,triggerClassName:c,triggerStyle:l,footerSlot:u})=>{let d=(0,b.useMemo)(()=>t.find(t=>t.id===e),[t,e]),f=(0,b.useMemo)(()=>d?.itemStyle?{...d.itemStyle,...l}:l,[d?.itemStyle,l]);return(0,y.jsxs)(wN,{value:e,onValueChange:i,open:a,onOpenChange:o,children:[(0,y.jsx)(EN,{size:`sm`,"aria-label":n,className:qx(jN,`w-full`,c),style:f,children:(0,y.jsx)(TN,{placeholder:r,children:()=>d?.label||r})}),(0,y.jsx)(DN,{alignItemWithTrigger:!1,sideOffset:4,className:qx(MN,bj,xj),footer:u?(0,y.jsx)(`div`,{className:`border-t border-border/40 p-1`,children:u}):void 0,children:t.map(e=>(0,y.jsx)(ON,{value:e.id,className:NN,style:e.itemStyle,onPointerEnter:s?()=>s(e.id):void 0,onFocus:s?()=>s(e.id):void 0,children:e.label},e.id))})]})},FN=Sb(`group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,secondary:`bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80`,destructive:`bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20`,outline:`border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground`,ghost:`hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50`,link:`text-primary underline-offset-4 hover:underline`}},defaultVariants:{variant:`default`}});function IN({className:e,variant:t=`default`,render:n,...r}){return jj({defaultTagName:`span`,props:kS({className:qx(FN({variant:t}),e)},r),render:n,state:{slot:`badge`,variant:t}})}function LN(e){let{open:t,defaultOpen:n,onOpenChange:r,disabled:i}=e,a=t!==void 0,[o,s]=QT({controlled:t,default:n,name:`Collapsible`,state:`open`}),{mounted:c,setMounted:l,transitionStatus:u}=ZT(o,!0,!0),[d,f]=b.useState(o),[{height:p,width:m},h]=b.useState({height:void 0,width:void 0}),g=PC(),[_,v]=b.useState(),y=_??g,[x,S]=b.useState(!1),[C,w]=b.useState(!1),T=b.useRef(null),E=b.useRef(null),D=b.useRef(null),O=b.useRef(null),k=YT(O,!1),A=CS(e=>{let t=!o,n=mE(tE,e.nativeEvent);if(r(t,n),n.isCanceled)return;let i=O.current;E.current===`css-animation`&&i!=null&&i.style.removeProperty(`animation-name`),!x&&!C&&(E.current!=null&&E.current!==`css-animation`&&!c&&t&&l(!0),E.current===`css-animation`&&(!d&&t&&f(!0),!c&&t&&l(!0))),s(t),E.current===`none`&&c&&!t&&l(!1)});return Q(()=>{a&&E.current===`none`&&!o&&l(!1)},[a,o,t,l]),b.useMemo(()=>({abortControllerRef:T,animationTypeRef:E,disabled:i,handleTrigger:A,height:p,mounted:c,open:o,panelId:y,panelRef:O,runOnceAnimationsFinish:k,setDimensions:h,setHiddenUntilFound:S,setKeepMounted:w,setMounted:l,setOpen:s,setPanelIdState:v,setVisible:f,transitionDimensionRef:D,transitionStatus:u,visible:d,width:m}),[T,E,i,A,p,c,o,y,O,k,h,S,w,l,s,f,D,u,d,m])}var RN=b.createContext(void 0);function zN(){let e=b.useContext(RN);if(e===void 0)throw Error(WS(15));return e}var BN=function(e){return e.open=`data-open`,e.closed=`data-closed`,e[e.startingStyle=WT.startingStyle]=`startingStyle`,e[e.endingStyle=WT.endingStyle]=`endingStyle`,e}({}),VN=function(e){return e.panelOpen=`data-panel-open`,e}({}),HN={[BN.open]:``},UN={[BN.closed]:``},WN={open(e){return e?{[VN.panelOpen]:``}:null}},GN={open(e){return e?HN:UN},...qT},KN=b.forwardRef(function(e,t){let{render:n,className:r,defaultOpen:i=!1,disabled:a=!1,onOpenChange:o,open:s,style:c,...l}=e,u=CS(o),d=LN({open:s,defaultOpen:i,onOpenChange:u,disabled:a}),f=b.useMemo(()=>({open:d.open,disabled:d.disabled,transitionStatus:d.transitionStatus}),[d.open,d.disabled,d.transitionStatus]),p=b.useMemo(()=>({...d,onOpenChange:u,state:f}),[d,u,f]),m=fC(`div`,e,{state:f,ref:t,props:l,stateAttributesMapping:GN});return(0,y.jsx)(RN.Provider,{value:p,children:m})}),qN={...WN,...qT},JN=b.forwardRef(function(e,t){let{panelId:n,open:r,handleTrigger:i,state:a,disabled:o}=zN(),{className:s,disabled:c=o,id:l,render:u,nativeButton:d=!0,style:f,...p}=e,{getButtonProps:m,buttonRef:h}=JS({disabled:c,focusableWhenDisabled:!0,native:d}),g=b.useMemo(()=>({"aria-controls":r?n:void 0,"aria-expanded":r,onClick:i}),[n,r,i]);return fC(`button`,e,{state:a,ref:[t,h],props:[g,p,m],stateAttributesMapping:qN})}),YN=function(e){return e.disabled=`data-disabled`,e.orientation=`data-orientation`,e}({});function XN(e){let{abortControllerRef:t,animationTypeRef:n,externalRef:r,height:i,hiddenUntilFound:a,keepMounted:o,id:s,mounted:c,onOpenChange:l,open:u,panelRef:d,runOnceAnimationsFinish:f,setDimensions:p,setMounted:m,setOpen:h,setVisible:g,transitionDimensionRef:_,visible:v,width:y}=e,x=b.useRef(!1),S=b.useRef(null),C=b.useRef(u),w=b.useRef(u),T=HT(),E=b.useMemo(()=>n.current===`css-animation`?!v:!u&&!c,[u,c,v,n]),D=ZS(r,d,CS(e=>{if(!e)return;if(n.current==null||_.current==null){let t=getComputedStyle(e),r=t.animationName!==`none`&&t.animationName!==``,i=t.transitionDuration!==`0s`&&t.transitionDuration!==``;r&&i||(t.animationName===`none`&&t.transitionDuration!==`0s`?n.current=`css-transition`:t.animationName!==`none`&&t.transitionDuration===`0s`?n.current=`css-animation`:n.current=`none`),e.getAttribute(YN.orientation)===`horizontal`||t.transitionProperty.indexOf(`width`)>-1?_.current=`width`:_.current=`height`}if(n.current!==`css-transition`)return;(i===void 0||y===void 0)&&(p({height:e.scrollHeight,width:e.scrollWidth}),w.current&&e.style.setProperty(`transition-duration`,`0s`));let t=-1,r=-1;return t=VT.request(()=>{w.current=!1,r=VT.request(()=>{setTimeout(()=>{e.style.removeProperty(`transition-duration`)})})}),()=>{VT.cancel(t),VT.cancel(r)}}));return Q(()=>{if(n.current!==`css-transition`)return;let e=d.current;if(!e)return;let r=-1;if(t.current!=null&&(t.current.abort(),t.current=null),u){let t={"justify-content":e.style.justifyContent,"align-items":e.style.alignItems,"align-content":e.style.alignContent,"justify-items":e.style.justifyItems};Object.keys(t).forEach(t=>{e.style.setProperty(t,`initial`,`important`)}),!w.current&&!o&&e.setAttribute(BN.startingStyle,``),p({height:e.scrollHeight,width:e.scrollWidth}),r=VT.request(()=>{Object.entries(t).forEach(([t,n])=>{n===``?e.style.removeProperty(t):e.style.setProperty(t,n)})})}else{if(e.scrollHeight===0&&e.scrollWidth===0)return;p({height:e.scrollHeight,width:e.scrollWidth});let n=new AbortController;t.current=n;let r=n.signal,i=null,a=BN.endingStyle;return i=new MutationObserver(o=>{o.some(e=>e.type===`attributes`&&e.attributeName===a)&&(i?.disconnect(),i=null,f(()=>{p({height:0,width:0}),e.style.removeProperty(`content-visibility`),m(!1),t.current===n&&(t.current=null)},r))}),i.observe(e,{attributes:!0,attributeFilter:[a]}),()=>{i?.disconnect(),T.cancel(),t.current===n&&(n.abort(),t.current=null)}}return()=>{VT.cancel(r)}},[t,n,T,a,o,c,u,d,f,p,m]),Q(()=>{if(n.current!==`css-animation`)return;let e=d.current;e&&(S.current=e.style.animationName||S.current,e.style.setProperty(`animation-name`,`none`),p({height:e.scrollHeight,width:e.scrollWidth}),!C.current&&!x.current&&e.style.removeProperty(`animation-name`),u?(t.current!=null&&(t.current.abort(),t.current=null),m(!0),g(!0)):(t.current=new AbortController,f(()=>{m(!1),g(!1),t.current=null},t.current.signal)))},[t,n,u,d,f,p,m,g,v]),FT(()=>{let e=VT.request(()=>{C.current=!1});return()=>VT.cancel(e)}),Q(()=>{if(!a)return;let e=d.current;if(!e)return;let t=-1,n=-1;return u&&x.current&&(e.style.transitionDuration=`0s`,p({height:e.scrollHeight,width:e.scrollWidth}),t=VT.request(()=>{x.current=!1,n=VT.request(()=>{setTimeout(()=>{e.style.removeProperty(`transition-duration`)})})})),()=>{VT.cancel(t),VT.cancel(n)}},[a,u,d,p]),Q(()=>{let e=d.current;e&&a&&E&&(e.setAttribute(`hidden`,`until-found`),n.current===`css-transition`&&e.setAttribute(BN.startingStyle,``))},[a,E,n,d]),b.useEffect(function(){let e=d.current;if(!e)return;function t(e){x.current=!0,h(!0),l(!0,mE(eE,e))}return DE(e,`beforematch`,t)},[l,d,h]),b.useMemo(()=>({props:{hidden:E,id:s,ref:D}}),[E,s,D])}var ZN=function(e){return e.collapsiblePanelHeight=`--collapsible-panel-height`,e.collapsiblePanelWidth=`--collapsible-panel-width`,e}({}),QN=b.forwardRef(function(e,t){let{className:n,hiddenUntilFound:r,keepMounted:i,render:a,id:o,style:s,...c}=e,{abortControllerRef:l,animationTypeRef:u,height:d,mounted:f,onOpenChange:p,open:m,panelId:h,panelRef:g,runOnceAnimationsFinish:_,setDimensions:v,setHiddenUntilFound:y,setKeepMounted:x,setMounted:S,setPanelIdState:C,setOpen:w,setVisible:T,state:E,transitionDimensionRef:D,visible:O,width:k,transitionStatus:A}=zN(),j=r??!1,M=i??!1;Q(()=>{if(o)return C(o),()=>{C(void 0)}},[o,C]),Q(()=>{y(j)},[y,j]),Q(()=>{x(M)},[x,M]);let{props:N}=XN({abortControllerRef:l,animationTypeRef:u,externalRef:t,height:d,hiddenUntilFound:j,id:h,keepMounted:M,mounted:f,onOpenChange:p,open:m,panelRef:g,runOnceAnimationsFinish:_,setDimensions:v,setMounted:S,setOpen:w,setVisible:T,transitionDimensionRef:D,visible:O,width:k});XT({open:m&&A===`idle`,ref:g,onComplete(){m&&v({height:void 0,width:void 0})}});let P=fC(`div`,e,{state:b.useMemo(()=>({...E,transitionStatus:A}),[E,A]),ref:[t,g],props:[N,{style:{[ZN.collapsiblePanelHeight]:d===void 0?`auto`:`${d}px`,[ZN.collapsiblePanelWidth]:k===void 0?`auto`:`${k}px`}},c],stateAttributesMapping:GN});return M||j||f?P:null});function $N({...e}){return(0,y.jsx)(KN,{"data-slot":`collapsible`,...e})}function eP({...e}){return(0,y.jsx)(JN,{"data-slot":`collapsible-trigger`,...e})}function tP({...e}){return(0,y.jsx)(QN,{"data-slot":`collapsible-content`,...e})}function nP({className:e,...t}){return(0,y.jsx)(`label`,{"data-slot":`label`,className:qx(`flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,e),...t})}function rP({className:e,...t}){return(0,y.jsx)(`div`,{"data-slot":`field-group`,className:qx(`group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4`,e),...t})}var iP=Sb(`group/field flex w-full gap-3 data-[invalid=true]:text-destructive`,{variants:{orientation:{vertical:`flex-col *:w-full [&>.sr-only]:w-auto`,horizontal:`flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`,responsive:`flex-col *:w-full @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:*:data-[slot=field-label]:flex-auto [&>.sr-only]:w-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`}},defaultVariants:{orientation:`vertical`}});function aP({className:e,orientation:t=`vertical`,...n}){return(0,y.jsx)(`div`,{role:`group`,"data-slot":`field`,"data-orientation":t,className:qx(iP({orientation:t}),e),...n})}function oP({className:e,...t}){return(0,y.jsx)(nP,{"data-slot":`field-label`,className:qx(`group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50 has-data-checked:border-primary/30 has-data-checked:bg-primary/5 has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border *:data-[slot=field]:p-3 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10`,`has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col`,e),...t})}var sP=b.createContext(void 0);function cP(){let e=b.useContext(sP);if(e===void 0)throw Error(WS(63));return e}var lP=function(e){return e.checked=`data-checked`,e.unchecked=`data-unchecked`,e.disabled=`data-disabled`,e.readonly=`data-readonly`,e.required=`data-required`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.filled=`data-filled`,e.focused=`data-focused`,e}({}),uP={...TC,checked(e){return e?{[lP.checked]:``}:{[lP.unchecked]:``}}},dP=b.forwardRef(function(e,t){let{checked:n,className:r,defaultChecked:i,"aria-labelledby":a,form:o,id:s,inputRef:c,name:l,nativeButton:u=!1,onCheckedChange:d,readOnly:f=!1,required:p=!1,disabled:m=!1,render:h,uncheckedValue:g,value:_,style:v,...x}=e,{clearErrors:S}=kC(),{state:C,setTouched:w,setDirty:T,validityData:E,setFilled:D,setFocused:O,shouldValidateOnChange:k,validationMode:A,disabled:j,name:M,validation:N}=DC(),{labelId:P}=IC(),F=j||m,I=M??l,L=CS(d),R=b.useRef(null),z=ZS(R,c,N.inputRef),ee=b.useRef(null),B=PC(),V=BC({id:s,implicit:!1,controlRef:ee}),H=u?void 0:V,[te,ne]=QT({controlled:n,default:!!i,name:`Switch`,state:`checked`});$T(ee,{id:B,value:te}),Q(()=>{R.current&&D(R.current.checked)},[R,D]),dA(te,()=>{S(I),T(te!==E.initialValue),D(te),k()?N.commit(te):N.commit(te,!0)});let{getButtonProps:U,buttonRef:re}=JS({disabled:F,native:u}),ie=LC(a,P,R,!u,H),ae={id:u?V:B,role:`switch`,"aria-checked":te,"aria-readonly":f||void 0,"aria-required":p||void 0,"aria-labelledby":ie,onFocus(){F||O(!0)},onBlur(){let e=R.current;!e||F||(w(!0),O(!1),A===`onBlur`&&N.commit(e.checked))},onClick(e){f||F||(e.preventDefault(),R.current?.dispatchEvent(new PointerEvent(`click`,{bubbles:!0,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey})))}},oe=b.useMemo(()=>kS({checked:te,disabled:F,form:o,id:H,name:I,required:p,style:I?YE:JE,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,ref:z,onChange(e){if(e.nativeEvent.defaultPrevented)return;if(f){e.preventDefault();return}let t=e.currentTarget.checked,n=mE(eE,e.nativeEvent);L?.(t,n),!n.isCanceled&&ne(t)},onFocus(){ee.current?.focus()}},N.getInputValidationProps,_===void 0?cC:{value:_}),[te,F,o,z,H,I,L,f,p,ne,N,_]),se=b.useMemo(()=>({...C,checked:te,disabled:F,readOnly:f,required:p}),[C,te,F,f,p]),ce=fC(`span`,e,{state:se,ref:[t,ee,re],props:[ae,N.getValidationProps,x,U],stateAttributesMapping:uP});return(0,y.jsxs)(sP.Provider,{value:se,children:[ce,!te&&I&&g!==void 0&&(0,y.jsx)(`input`,{type:`hidden`,form:o,name:I,value:g}),(0,y.jsx)(`input`,{...oe,suppressHydrationWarning:!0})]})}),fP=b.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{state:o}=DC(),s=cP();return fC(`span`,e,{state:{...o,...s},ref:t,stateAttributesMapping:uP,props:a})});function pP({className:e,size:t=`default`,...n}){return(0,y.jsx)(dP,{"data-slot":`switch`,"data-size":t,className:qx(`peer group/switch relative inline-flex shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:bg-primary data-unchecked:bg-input dark:data-unchecked:bg-input/80 data-disabled:cursor-not-allowed data-disabled:opacity-50`,e),...n,children:(0,y.jsx)(fP,{"data-slot":`switch-thumb`,className:`pointer-events-none block rounded-full bg-background ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%_-_2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%_-_2px)] dark:data-checked:bg-primary-foreground group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 dark:data-unchecked:bg-foreground`})})}var mP=b.createContext(void 0);function hP(e){let t=b.useContext(mP);if(t===void 0&&!e)throw Error(WS(72));return t}var gP={...kk,disabled:$(e=>e.disabled),instantType:$(e=>e.instantType),isInstantPhase:$(e=>e.isInstantPhase),trackCursorAxis:$(e=>e.trackCursorAxis),disableHoverablePopup:$(e=>e.disableHoverablePopup),lastOpenChangeReason:$(e=>e.openChangeReason),closeOnClick:$(e=>e.closeOnClick),closeDelay:$(e=>e.closeDelay),hasViewport:$(e=>e.hasViewport)},_P=class e extends vk{constructor(e){super({...vP(),...e},{popupRef:b.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:new Tk},gP)}setOpen=(e,t)=>{let n=t.reason,r=n===nE,i=e&&n===`trigger-focus`,a=!e&&(n===`trigger-press`||n===`escape-key`);if(t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let o=()=>{let r={open:e,openChangeReason:n};i?r.instantType=`focus`:a?r.instantType=`dismiss`:n===`trigger-hover`&&(r.instantType=void 0);let o=t.trigger?.id??null;(o||e)&&(r.activeTriggerId=o,r.activeTriggerElement=t.trigger??null),this.update(r)};r?JT.flushSync(o):o()};static useStore(t,n){let r=bS(()=>new e(n)).current,i=t??r,a=Mk({popupStore:i,onOpenChange:i.setOpen});return i.state.floatingRootContext=a,i}};function vP(){return{...Dk(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:`none`,disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,hasViewport:!1}}var yP=sk(function(e){let{disabled:t=!1,defaultOpen:n=!1,open:r,disableHoverablePopup:i=!1,trackCursorAxis:a=`none`,actionsRef:o,onOpenChange:s,onOpenChangeComplete:c,handle:l,triggerId:u,defaultTriggerId:d=null,children:f}=e,p=_P.useStore(l?.store,{open:n,openProp:r,activeTriggerId:d,triggerIdProp:u});EE(()=>{r===void 0&&p.state.open===!1&&n===!0&&p.update({open:!0,activeTriggerId:d})}),p.useControlledProp(`openProp`,r),p.useControlledProp(`triggerIdProp`,u),p.useContextCallback(`onOpenChange`,s),p.useContextCallback(`onOpenChangeComplete`,c);let m=p.useState(`open`),h=!t&&m,g=p.useState(`activeTriggerId`),_=p.useState(`payload`);p.useSyncedValues({trackCursorAxis:a,disableHoverablePopup:i}),Q(()=>{m&&t&&p.setOpen(!1,mE(dE))},[m,t,p]),p.useSyncedValue(`disabled`,t),Ck(p);let{forceUnmount:v,transitionStatus:x}=wk(h,p),S=p.select(`floatingRootContext`),C=p.useState(`isInstantPhase`),w=p.useState(`instantType`),T=p.useState(`lastOpenChangeReason`),E=b.useRef(null);Q(()=>{x===`ending`&&T===`none`||x!==`ending`&&C?(w!==`delay`&&(E.current=w),p.set(`instantType`,`delay`)):E.current!==null&&(p.set(`instantType`,E.current),E.current=null)},[x,C,T,w,p]),Q(()=>{h&&(g??p.set(`payload`,void 0))},[p,g,h]);let D=b.useCallback(()=>{p.setOpen(!1,mE(fE))},[p]);b.useImperativeHandle(o,()=>({unmount:v,close:D}),[v,D]);let{getReferenceProps:O,getFloatingProps:k,getTriggerProps:A}=Uk([UD(S,{enabled:!t,referencePress:()=>p.select(`closeOnClick`)}),zD(S,{enabled:!t&&a!==`none`,axis:a===`none`?void 0:a})]),j=b.useMemo(()=>O(),[O]),M=b.useMemo(()=>A(),[A]),N=b.useMemo(()=>k(),[k]);return p.useSyncedValues({activeTriggerProps:j,inactiveTriggerProps:M,popupProps:N}),(0,y.jsx)(mP.Provider,{value:p,children:typeof f==`function`?f({payload:_}):f})}),bP=b.createContext(void 0);function xP(){return b.useContext(bP)}var SP=function(e){return e[e.popupOpen=CA.popupOpen]=`popupOpen`,e.triggerDisabled=`data-trigger-disabled`,e}({}),CP=ck(function(e,t){let{className:n,render:r,handle:i,payload:a,disabled:o,delay:s,closeOnClick:c=!0,closeDelay:l,id:u,style:d,...f}=e,p=hP(!0),m=i?.store??p;if(!m)throw Error(WS(82));let h=PC(u),g=m.useState(`isTriggerActive`,h),_=m.useState(`isOpenedByTrigger`,h),v=m.useState(`floatingRootContext`),y=b.useRef(null),x=s??600,S=l??0,{registerTrigger:C,isMountedByThisTrigger:w}=Sk(h,y,m,{payload:a,closeOnClick:c,closeDelay:S}),T=xP(),{delayRef:E,isInstantPhase:D,hasProvider:O}=UE(v,{open:_});m.useSyncedValue(`isInstantPhase`,D);let k=m.useState(`disabled`),A=o??k,j=m.useState(`trackCursorAxis`),M=m.useState(`disableHoverablePopup`),N=Hk(v,{enabled:!A,mouseOnly:!0,move:!1,handleClose:!M&&j!==`both`?lA():null,restMs(){let e=T?.delay,t=typeof E.current==`object`?E.current.open:void 0,n=x;return O&&(n=t===0?0:s??e??x),n},delay(){let e=typeof E.current==`object`?E.current.close:void 0,t=S;return l==null&&O&&(t=e),{close:t}},triggerElementRef:y,isActiveTrigger:g,isClosing:()=>m.select(`transitionStatus`)===`ending`}),P=Pk(v,{enabled:!A}).reference,F={open:_},I=m.useState(`triggerProps`,w);return fC(`button`,e,{state:F,ref:[t,C,y],props:[N,P,I,{onPointerDown(){m.set(`closeOnClick`,c)},id:h,[SP.triggerDisabled]:A?``:void 0},f],stateAttributesMapping:kA})}),wP=b.createContext(void 0);function TP(){let e=b.useContext(wP);if(e===void 0)throw Error(WS(70));return e}var EP=b.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,style:o,...s}=e,{portalNode:c,portalSubtree:l}=bD({container:r,ref:t,componentProps:e,elementProps:s});return!l&&!c?null:(0,y.jsxs)(b.Fragment,{children:[l,c&&JT.createPortal(n,c)]})}),DP=b.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return hP().useState(`mounted`)||n?(0,y.jsx)(wP.Provider,{value:n,children:(0,y.jsx)(EP,{ref:t,...r})}):null}),OP=b.createContext(void 0);function kP(){let e=b.useContext(OP);if(e===void 0)throw Error(WS(71));return e}var AP=b.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a=`absolute`,side:o=`top`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=hD,style:g,..._}=e,v=hP(),x=TP(),S=v.useState(`open`),C=v.useState(`mounted`),w=v.useState(`trackCursorAxis`),T=v.useState(`disableHoverablePopup`),E=v.useState(`floatingRootContext`),D=v.useState(`instantType`),O=v.useState(`transitionStatus`),k=LM({anchor:i,positionMethod:a,floatingRootContext:E,mounted:C,side:o,sideOffset:c,align:s,alignOffset:l,collisionBoundary:u,collisionPadding:d,sticky:p,arrowPadding:f,disableAnchorTracking:m,keepMounted:x,collisionAvoidance:h,adaptiveOrigin:v.useState(`hasViewport`)?PM:void 0}),A=WM(e,b.useMemo(()=>({open:S,side:k.side,align:k.align,anchorHidden:k.anchorHidden,instant:w===`none`?D:`tracking-cursor`}),[S,k.side,k.align,k.anchorHidden,w,D]),{styles:k.positionerStyles,transitionStatus:O,props:_,refs:[t,v.useStateSetter(`positionerElement`)],hidden:!C,inert:!S||w===`both`||T});return(0,y.jsx)(OP.Provider,{value:k,children:A})}),jP={...jA,...qT},MP=b.forwardRef(function(e,t){let{className:n,render:r,style:i,...a}=e,o=hP(),{side:s,align:c}=kP(),l=o.useState(`open`),u=o.useState(`instantType`),d=o.useState(`transitionStatus`),f=o.useState(`popupProps`),p=o.useState(`floatingRootContext`);XT({open:l,ref:o.context.popupRef,onComplete(){l&&o.context.onOpenChangeComplete?.(!0)}});let m=o.useState(`disabled`),h=o.useState(`closeDelay`);return Bk(p,{enabled:!m,closeDelay:h}),fC(`div`,e,{state:{open:l,side:s,align:c,instant:u,transitionStatus:d},ref:[t,o.context.popupRef,o.useStateSetter(`popupElement`)],props:[f,UM(d),a],stateAttributesMapping:jP})}),NP=b.forwardRef(function(e,t){let{className:n,render:r,style:i,...a}=e,o=hP(),s=o.useState(`open`),c=o.useState(`instantType`),{arrowRef:l,side:u,align:d,arrowUncentered:f,arrowStyles:p}=kP();return fC(`div`,e,{state:{open:s,side:u,align:d,uncentered:f,instant:c},ref:[t,l],props:[{style:p,"aria-hidden":!0},a],stateAttributesMapping:jA})}),PP=function(e){let{delay:t,closeDelay:n,timeout:r=400}=e,i=b.useMemo(()=>({delay:t,closeDelay:n}),[t,n]),a=b.useMemo(()=>({open:t,close:n}),[t,n]);return(0,y.jsx)(bP.Provider,{value:i,children:(0,y.jsx)(HE,{delay:a,timeoutMs:r,children:e.children})})};function FP({delay:e=0,...t}){return(0,y.jsx)(PP,{"data-slot":`tooltip-provider`,delay:e,...t})}function IP({...e}){return(0,y.jsx)(yP,{"data-slot":`tooltip`,...e})}function LP({...e}){return(0,y.jsx)(CP,{"data-slot":`tooltip-trigger`,...e})}function RP({className:e,side:t=`top`,sideOffset:n=4,align:r=`center`,alignOffset:i=0,children:a,...o}){return(0,y.jsx)(DP,{children:(0,y.jsx)(AP,{align:r,alignOffset:i,side:t,sideOffset:n,className:`isolate z-50`,children:(0,y.jsxs)(MP,{"data-slot":`tooltip-content`,className:qx(`z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...o,children:[a,(0,y.jsx)(NP,{className:`z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5`})]})})})}var zP=`text-[10px] font-medium tracking-wide text-muted-foreground/70 uppercase`,BP=`text-xs font-normal text-muted-foreground`,VP=Object.fromEntries(kd.map(e=>[e.id,{fontFamily:e.family}])),HP=Pd.map(e=>({id:e.id,label:e.name})),UP=kd.map(e=>({id:e.id,label:e.name,itemStyle:VP[e.id]})),WP=e=>({id:pd,label:(0,y.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,y.jsx)(`span`,{className:`truncate`,children:e}),(0,y.jsx)(IN,{variant:`secondary`,className:`h-4 px-1.5 text-[10px] font-medium`,children:`Local`})]}),itemStyle:{fontFamily:`"${Cd(e)}", ui-monospace, monospace`}}),GP=gf.map(e=>({id:e.id,label:e.name})),KP=bf.map(e=>({id:String(e.value),label:e.label})),qP=e=>e.toFixed(1),JP=({label:e,value:t,title:n,valueClassName:r})=>(0,y.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3`,children:[(0,y.jsx)(`dt`,{className:BP,children:e}),(0,y.jsx)(`dd`,{title:n??t,className:qx(`min-w-0 truncate text-right text-foreground/90`,r),children:t})]}),YP=({themeId:e,onThemeChange:t,onThemePreview:n,fontId:r,onFontChange:i,onFontPreview:a,localFontFamily:o,onLocalFontChange:s,fontSize:c,onFontSizeChange:l,lineHeight:u,onLineHeightChange:d,cursorStyle:f,onCursorStyleChange:p,onCursorStylePreview:m,cursorBlink:h,onCursorBlinkChange:g,scrollback:_,onScrollbackChange:v,scrollOnUserInput:x,onScrollOnUserInputChange:S,sessionInfo:C})=>{let[w,T]=(0,b.useState)(!1),[E,D]=(0,b.useState)(!1),[O,k]=(0,b.useState)(!1),A=(0,b.useMemo)(()=>r!==`local`||!o?UP:[...UP,WP(o)],[r,o]);return(0,y.jsxs)(pj,{open:w,onOpenChange:e=>{T(e),e||(D(!1),k(!1),n?.(null),a?.(null),m?.(null))},children:[(0,y.jsxs)(IP,{children:[(0,y.jsx)(LP,{render:(0,y.jsx)(mj,{render:(0,y.jsx)(bC,{variant:`ghost`,size:`icon-sm`,"aria-label":`terminal settings`,className:`hover:text-foreground`})}),children:(0,y.jsx)(gb,{})}),w?null:(0,y.jsx)(RP,{side:`bottom`,sideOffset:8,children:`Settings`})]}),(0,y.jsxs)(_j,{className:qx(`max-h-[calc(100dvh-2rem)] gap-0 overflow-y-auto p-4 sm:max-w-md`,bj),children:[(0,y.jsx)(vj,{className:`mb-4 pr-8`,children:(0,y.jsx)(yj,{children:`Settings`})}),(0,y.jsxs)(rP,{className:`gap-3`,children:[(0,y.jsxs)(aP,{orientation:`vertical`,className:`gap-1.5`,children:[(0,y.jsx)(oP,{className:zP,children:`Theme`}),(0,y.jsx)(PN,{value:e,items:HP,ariaLabel:`select theme`,placeholder:`Theme`,onValueChange:e=>{e&&t(e)},onOpenChange:e=>{e||n?.(null)},onItemHover:n??void 0})]}),(0,y.jsx)(Nj,{className:`bg-border/40`}),(0,y.jsxs)(aP,{orientation:`vertical`,className:`gap-1.5`,children:[(0,y.jsx)(oP,{className:zP,children:`Font`}),(0,y.jsx)(PN,{value:r,items:A,ariaLabel:`select font`,placeholder:`Font`,open:E,onValueChange:e=>{e&&i(e)},onOpenChange:e=>{D(e),e||a?.(null)},onItemHover:a??void 0,footerSlot:(0,y.jsxs)(`button`,{type:`button`,className:`flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-xs text-muted-foreground outline-none transition-colors hover:bg-foreground/10 hover:text-foreground focus-visible:bg-foreground/10 focus-visible:text-foreground`,onClick:()=>{D(!1),k(!0)},children:[(0,y.jsx)(pb,{className:`size-3`}),(0,y.jsx)(`span`,{children:`Local font…`})]})}),(0,y.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,y.jsx)(`span`,{className:BP,children:`Size`}),(0,y.jsx)(Vj,{value:c,min:9,max:24,step:1,ariaLabel:`terminal font size`,decrementAriaLabel:`decrease font size`,incrementAriaLabel:`increase font size`,onValueChange:l})]}),(0,y.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,y.jsx)(`span`,{className:BP,children:`Line height`}),(0,y.jsx)(Vj,{value:u,min:1,max:2,step:id,ariaLabel:`terminal line height`,decrementAriaLabel:`decrease line height`,incrementAriaLabel:`increase line height`,formatDisplay:qP,onValueChange:d})]})]}),(0,y.jsx)(Nj,{className:`bg-border/40`}),(0,y.jsxs)(aP,{orientation:`vertical`,className:`gap-1.5`,children:[(0,y.jsx)(oP,{className:zP,children:`Cursor`}),(0,y.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,y.jsx)(`span`,{className:BP,children:`Style`}),(0,y.jsx)(PN,{value:f,items:GP,ariaLabel:`select cursor style`,placeholder:`Cursor style`,triggerClassName:`w-fit min-w-[7rem]`,onValueChange:e=>{yf(e)&&p(e)},onOpenChange:e=>{e||m?.(null)},onItemHover:m?e=>{yf(e)&&m?.(e)}:void 0})]}),(0,y.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,y.jsx)(`span`,{className:BP,children:`Blink`}),(0,y.jsx)(pP,{"aria-label":`toggle cursor blink`,checked:h,onCheckedChange:g})]})]}),(0,y.jsx)(Nj,{className:`bg-border/40`}),(0,y.jsxs)(aP,{orientation:`vertical`,className:`gap-1.5`,children:[(0,y.jsx)(oP,{className:zP,children:`Scrollback`}),(0,y.jsx)(PN,{value:String(_),items:KP,ariaLabel:`select scrollback`,placeholder:`Scrollback`,onValueChange:e=>{if(e===null)return;let t=Number(e);Cf(t)&&v(t)}}),(0,y.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,y.jsxs)(IP,{children:[(0,y.jsx)(LP,{render:(0,y.jsx)(`span`,{className:BP}),children:`Pin to bottom on input`}),(0,y.jsx)(RP,{side:`bottom`,sideOffset:8,className:`max-w-xs`,children:`When on, typing scrolls the viewport back to the bottom. When off, the viewport stays where you scrolled — useful for reading history while typing.`})]}),(0,y.jsx)(pP,{"aria-label":`toggle pin to bottom on input`,checked:x,onCheckedChange:S})]})]}),C?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(Nj,{className:`bg-border/40`}),(0,y.jsxs)($N,{defaultOpen:!1,children:[(0,y.jsx)(eP,{render:(0,y.jsxs)(`button`,{type:`button`,className:`group/shell flex w-full items-center justify-between gap-2 rounded-sm py-1 text-left transition-colors outline-none hover:text-foreground/90 focus-visible:text-foreground/90`,children:[(0,y.jsx)(`span`,{className:zP,children:`Shell`}),(0,y.jsx)(cb,{className:`size-3 text-muted-foreground/60 transition-transform duration-200 ease-snappy will-change-transform group-aria-expanded/shell:rotate-180`})]})}),(0,y.jsx)(tP,{className:`h-(--collapsible-panel-height) overflow-hidden transition-[height] duration-200 ease-snappy data-closed:h-0`,children:(0,y.jsxs)(`dl`,{className:`flex flex-col gap-1 pt-2 text-xs`,children:[(0,y.jsx)(JP,{label:`Name`,value:C.shellName}),(0,y.jsx)(JP,{label:`Path`,value:C.shell,title:C.shell}),(0,y.jsx)(JP,{label:`PID`,value:String(C.pid),valueClassName:`tabular-nums`}),(0,y.jsx)(JP,{label:`Cwd`,value:C.cwd,title:C.cwd})]})})]})]}):null]})]}),(0,y.jsx)(Aj,{open:O,onOpenChange:k,currentFamily:o,onApply:s})]})},XP=({activeThemeId:e,onThemeChange:t,onThemePreview:n,activeFontId:r,onFontChange:i,onFontPreview:a,activeLocalFontFamily:o,onLocalFontChange:s,activeFontSize:c,onFontSizeChange:l,activeLineHeight:u,onLineHeightChange:d,activeCursorStyle:f,onCursorStyleChange:p,onCursorStylePreview:m,activeCursorBlink:h,onCursorBlinkChange:g,activeScrollback:_,onScrollbackChange:v,activeScrollOnUserInput:b,onScrollOnUserInputChange:x,sessionInfo:S,newTabUrl:C,onOpenSearch:w,isMac:T,isSearchOpen:E})=>E?null:(0,y.jsxs)(`div`,{role:`toolbar`,"aria-label":`terminal actions`,"data-terminal-toolbar":!0,className:`absolute top-2 right-3 z-10 flex items-center gap-0.5 rounded-md border border-border/60 bg-background/70 p-0.5 text-muted-foreground shadow-xs backdrop-blur-md`,children:[(0,y.jsx)(YP,{themeId:e,onThemeChange:t,onThemePreview:n,fontId:r,onFontChange:i,onFontPreview:a,localFontFamily:o,onLocalFontChange:s,fontSize:c,onFontSizeChange:l,lineHeight:u,onLineHeightChange:d,cursorStyle:f,onCursorStyleChange:p,onCursorStylePreview:m,cursorBlink:h,onCursorBlinkChange:g,scrollback:_,onScrollbackChange:v,scrollOnUserInput:b,onScrollOnUserInputChange:x,sessionInfo:S}),(0,y.jsxs)(IP,{children:[(0,y.jsx)(LP,{render:(0,y.jsx)(bC,{variant:`ghost`,size:`icon-sm`,onClick:w,"aria-label":`find in terminal`,className:`hover:text-foreground`}),children:(0,y.jsx)(hb,{})}),(0,y.jsxs)(RP,{side:`bottom`,sideOffset:8,children:[`Find `,T?`(⌘F)`:`(Ctrl+F)`]})]}),(0,y.jsxs)(IP,{children:[(0,y.jsx)(LP,{render:(0,y.jsx)(bC,{variant:`ghost`,size:`icon-sm`,nativeButton:!1,"aria-label":`open a new shell in a new browser tab`,render:(0,y.jsx)(`a`,{href:C,target:`_blank`,rel:`noopener noreferrer`}),className:`hover:text-foreground`}),children:(0,y.jsx)(mb,{})}),(0,y.jsx)(RP,{side:`bottom`,sideOffset:8,children:`New shell (new tab)`})]})]}),ZP=async e=>{if(!(typeof document>`u`)&&e.name)try{await Promise.all([document.fonts.load(`16px "${e.name}"`),document.fonts.load(`bold 16px "${e.name}"`)])}catch{}},QP=(e,t,n,r)=>{n?.clearTextureAtlas(),e.options.fontFamily=``,e.options.fontFamily=r,Yy(e,t),n?.clearTextureAtlas()},$P=(e,t)=>{let n=null,r=()=>{n=null,e.style.height=`${t.height}px`,e.style.transform=t.offsetTop?`translateY(${t.offsetTop}px)`:``},i=()=>{n===null&&(n=window.requestAnimationFrame(r))};return i(),t.addEventListener(`resize`,i),t.addEventListener(`scroll`,i),()=>{n!==null&&window.cancelAnimationFrame(n),t.removeEventListener(`resize`,i),t.removeEventListener(`scroll`,i),e.style.height=``,e.style.transform=``}},eF=()=>typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(`(pointer: coarse)`).matches,tF=()=>typeof navigator<`u`&&navigator.vendor===`Apple Computer, Inc.`,nF=()=>{if(typeof navigator>`u`)return!1;let e=navigator.platform||navigator.userAgent||``;return/Mac|iPhone|iPad|iPod/i.test(e)},rF=()=>({isMac:(0,b.useMemo)(nF,[]),isTouchDevice:(0,b.useMemo)(eF,[]),isAppleWebKit:(0,b.useMemo)(tF,[])}),iF=(e,t,n)=>{(0,b.useEffect)(()=>{if(!t||!n)return;let r=e.current,i=window.visualViewport;if(!(!r||!i))return $P(r,i)},[t,n,e])},aF=(e,t,n,r)=>{(0,b.useEffect)(()=>{let i=e.current;if(!i)return;i.options.fontSize=n,i.options.lineHeight=r;let a=t.current;a&&Yy(i,a)},[n,r,e,t])},oF=(e,t,n,r,i,a)=>{(0,b.useEffect)(()=>{let o=e.current;o&&(o.options.theme=t.colors,o.options.cursorStyle=n,o.options.cursorBlink=r,o.options.scrollback=i,o.options.scrollOnUserInput=a)},[t,n,r,i,a,e])},sF=(e,t,n,r)=>{(0,b.useEffect)(()=>{if(!e.current)return;let i=!1;return ZP(r).then(()=>{if(i)return;let a=e.current;if(!a)return;let o=t.current;o&&QP(a,o,n.current,r.family)}),()=>{i=!0}},[r,e,t,n])},cF=(e,t)=>{(0,b.useEffect)(()=>()=>{e.current!==null&&(window.clearTimeout(e.current),e.current=null),t.current!==null&&(window.clearTimeout(t.current),t.current=null)},[e,t])},lF=e=>{(0,b.useEffect)(()=>{if(!e)return;let t=new URL(window.location.href);t.searchParams.set(`cwd`,e),window.history.replaceState(null,``,t)},[e])},uF=(e,t,n)=>{(0,b.useEffect)(()=>{if(!e)return;let t=n.current;t&&(t.focus(),t.select())},[e,t,n])},dF=(e,t,n)=>{(0,b.useEffect)(()=>{if(!e)return;let r=window.setInterval(()=>{t()},n);return()=>window.clearInterval(r)},[e,t,n])},fF=(e,t)=>{(0,b.useEffect)(()=>{t?.(e)},[e,t])},pF=({onModalOpenChange:e}={})=>{let t=(0,b.useRef)(null),n=(0,b.useRef)(null),r=(0,b.useRef)(null),i=(0,b.useRef)(null),a=(0,b.useRef)(null),o=(0,b.useRef)(null),s=(0,b.useRef)(null),c=(0,b.useRef)(null),l=(0,b.useRef)(null),u=(0,b.useRef)(!1),d=(0,b.useRef)(null),f=(0,b.useRef)(null),p=(0,b.useRef)(null),m=(0,b.useRef)(null),h=(0,b.useRef)(Of()),g=(0,b.useRef)(jf()),_=(0,b.useRef)(Tf()),v=(0,b.useRef)(Pf()),x=(0,b.useRef)(Lf()),C=(0,b.useRef)(Bf()),w=(0,b.useRef)(Uf()),T=(0,b.useRef)(Kf()),E=(0,b.useRef)(Yf()),[O,k]=(0,b.useState)(null),[A,j]=(0,b.useState)(0),[M,N]=(0,b.useState)(!1),[P,F]=(0,b.useState)(!1),[I,L]=(0,b.useState)(!1),[R,z]=(0,b.useState)(0),[ee,B]=(0,b.useState)(``),[V,H]=(0,b.useState)({resultIndex:-1,resultCount:0}),[te,ne]=(0,b.useState)(h.current),[U,re]=(0,b.useState)(null),[ie,ae]=(0,b.useState)(g.current),[oe,se]=(0,b.useState)(_.current),[ce,le]=(0,b.useState)(null),[ue,de]=(0,b.useState)(v.current),[fe,pe]=(0,b.useState)(x.current),[me,he]=(0,b.useState)(C.current),[ge,_e]=(0,b.useState)(null),[ve,ye]=(0,b.useState)(w.current),[be,xe]=(0,b.useState)(T.current),[Se,Ce]=(0,b.useState)(E.current),[we,Te]=(0,b.useState)(null),[Ee,De]=(0,b.useState)(null),{isMac:Oe,isTouchDevice:ke,isAppleWebKit:Ae}=rF();iF(t,ke,Ae);let je=U??te,Me=(0,b.useMemo)(()=>Id(je),[je]),Ne=ce??ie,Pe=(0,b.useMemo)(()=>jd(Ne,oe),[Ne,oe]),Fe=ge??me,Ie=Me.colors.background??`#101010`,Le=(0,b.useMemo)(()=>zy(Ee),[Ee]);(0,b.useEffect)(()=>{let e=n.current;if(!e)return;let t=!1,s=!1,c=``,l=null,y=null,b=null,O=null,A=`idle`,M=new AbortController,N=!1,P=e=>{l?.readyState===WebSocket.OPEN&&l.send(JSON.stringify(e))},F=()=>{O!==null&&(window.clearTimeout(O),O=null),A===`idle`&&b===null&&(b=window.setTimeout(()=>{b=null,!(t||s)&&(A=`active`,pf(`active`))},250)),O=window.setTimeout(()=>{O=null,b!==null&&(window.clearTimeout(b),b=null),A===`active`&&(A=`idle`,pf(`idle`))},750)},I=()=>{b!==null&&(window.clearTimeout(b),b=null),O!==null&&(window.clearTimeout(O),O=null),A===`active`&&(A=`idle`,pf(`idle`))},L=jd(g.current,_.current),R=new ed({allowProposedApi:!0,cursorBlink:w.current,cursorStyle:C.current,fontFamily:L.family,fontSize:v.current,lineHeight:x.current,scrollback:T.current,theme:Id(h.current).colors,macOptionIsMeta:!0,scrollOnUserInput:E.current});r.current=R;let z=new D;i.current=z,R.loadAddon(z),R.loadAddon(new Nn),R.loadAddon(new S),R.loadAddon(new qe),R.loadAddon(new Ye),R.loadAddon(new Dn);let ee=new ut;R.loadAddon(ee),o.current=ee;let B=ee.onDidChangeResults(H);R.open(e);try{let e=new aa;e.onContextLoss(()=>{a.current===e&&(a.current=null),e.dispose()}),R.loadAddon(e),a.current=e}catch{a.current=null}let V=R.textarea;V&&(V.autocomplete=`off`,V.setAttribute(`autocapitalize`,`off`),V.setAttribute(`autocorrect`,`off`),V.spellcheck=!1);let te=0,ne=0,U=!1,re=()=>{R.textarea&&(R.textarea.inputMode=``),R.focus()},ie=()=>{ke&&R.textarea&&(R.textarea.inputMode=`none`),R.focus()};if(f.current=ie,ke){let e=M.signal,t=()=>{R.textarea&&(R.textarea.inputMode=`none`)},n=()=>{R.textarea&&(R.textarea.blur(),R.textarea.inputMode=`none`)};t(),R.textarea?.addEventListener(`blur`,t,{signal:e});let r=window.visualViewport;if(r){let t=r.height,i=r.width;r.addEventListener(`resize`,()=>{let e=r.height,a=r.width,o=e>t+150,s=Math.abs(a-i)<20;o&&s&&n(),t=e,i=a},{signal:e})}R.element?.addEventListener(`touchstart`,e=>{if(e.touches.length!==1){U=!0;return}te=e.touches[0].clientX,ne=e.touches[0].clientY,U=!1},{capture:!0,passive:!0,signal:e}),R.element?.addEventListener(`touchmove`,e=>{if(e.touches.length!==1){U=!0;return}Math.hypot(e.touches[0].clientX-te,e.touches[0].clientY-ne)>10&&(U=!0)},{capture:!0,passive:!0,signal:e}),R.element?.addEventListener(`touchend`,e=>{if(U){e.preventDefault();return}re()},{capture:!0,passive:!1,signal:e})}let ae=Wy(R);R.parser.registerCsiHandler({final:`J`},mf),R.parser.registerCsiHandler({prefix:`?`,final:`J`},mf);let oe=Xy({terminal:R,fitAddon:z,sendResize:(e,t)=>P({type:`resize`,cols:e,rows:t}),resizeDebounceMs:80}),se=By({terminalWrite:(e,t)=>R.write(e,t),sendFlowPause:()=>P({type:`flow-pause`}),sendFlowResume:()=>P({type:`flow-resume`}),captureScrollAnchor:()=>oe.captureAnchor(),restoreScrollAnchor:e=>oe.restoreAnchor(e),hasScrollRestore:()=>oe.hasResizeRestore(),restoreScrollFromResize:()=>oe.restoreResizeScroll(),isExited:()=>s});Gy(R,{isMac:Oe,getKittyFlags:()=>ae.getFlags(),openFindOverlay:()=>d.current?.(),sendInput:e=>P({type:`input`,data:e}),isTouchDevice:ke}),Ky(R);let ce=R.onTitleChange(e=>{if(s)return;let t=e.trim();t&&(c=t,document.title=t||`localterm`)});R.onData(e=>{for(let t of Ld(e,Zf))P({type:`input`,data:t})}),R.onResize(({cols:e,rows:t})=>P({type:`resize`,cols:e,rows:t}));let le=new ResizeObserver(()=>oe.scheduleFit());le.observe(e),oe.fitToContainer(),ie();let ue=e=>{s||(s=!0,I(),pf(`dead`),R.write(Ud(e)),document.title=`† ${c||`localterm`}`,k({reason:`shell-exited`,exitCode:e}),Te(null))},de=(e,t,n)=>{s||(s=!0,I(),pf(`dead`),R.write(Hd(e,t)),document.title=`† ${c||`localterm`}`,k({reason:`connection-lost`,closeCode:e,closeReason:t,wasClean:n}),Te(null))},fe=()=>{if(se.clear(),t)return;let e=new WebSocket(Ry(p.current));e.binaryType=`arraybuffer`,l=e,e.addEventListener(`open`,()=>{t||l!==e||(N=!0,j(0),P({type:`resize`,cols:R.cols,rows:R.rows}),u.current=!1)}),e.addEventListener(`message`,n=>{if(t||l!==e)return;if(n.data instanceof ArrayBuffer){se.write(new Uint8Array(n.data)),F();return}if(typeof n.data!=`string`)return;let r;try{r=JSON.parse(n.data)}catch{return}if(typeof r!=`object`||!r||typeof r.type!=`string`)return;let i=r;if(i.type===`output`)se.write(i.data),F();else if(i.type===`title`){let e=i.title.trim();if(!e)return;c=e,document.title=e}else i.type===`session`?(Te({shell:i.shell,shellName:i.shellName,pid:i.pid,cwd:i.cwd}),De(i.cwd)):i.type===`cwd`?De(i.cwd):i.type===`exit`&&(I(),ue(i.code))}),e.addEventListener(`close`,n=>{if(l===e&&(l=null,u.current=!1,!t&&!s)){if(N){console.warn(`[localterm] websocket closed: code=${n.code} reason=${JSON.stringify(n.reason)} wasClean=${n.wasClean}`),de(n.code,n.reason,n.wasClean);return}j(e=>e+1),y=window.setTimeout(fe,td)}}),e.addEventListener(`error`,()=>{console.warn(`[localterm] websocket error`);try{e.close()}catch{}})};return m.current=()=>{if(!t){s=!1,N=!1,k(null),Te(null),j(0),pf(`idle`),y!==null&&(window.clearTimeout(y),y=null);try{l?.close()}catch{}l=null,fe()}},fe(),()=>{t=!0,m.current=null,f.current=null,d.current=null,o.current=null,r.current=null,i.current=null,a.current=null,ce.dispose(),B.dispose(),M.abort(),oe.cleanupResizeScroll(),I(),y!==null&&window.clearTimeout(y),le.disconnect();try{l?.close()}catch{}l=null,R.dispose(),document.title=`localterm`}},[]),aF(r,i,ue,fe),oF(r,Me,Fe,ve,be,Se),sF(r,i,a,Pe),uF(I,R,s),cF(c,l),(0,b.useEffect)(()=>{p.current=Ee},[Ee]),lF(Ee);let Re=(0,b.useCallback)(e=>{ne(e),re(null),kf(e)},[]),ze=(0,b.useCallback)(e=>{ae(e),le(null),Mf(e)},[]),Be=(0,b.useCallback)(e=>{se(e),ae(pd),le(null),Ef(e),Mf(pd)},[]),Ve=(0,b.useCallback)(e=>{let t=Rd(e);de(t),Ff(t)},[]),He=(0,b.useCallback)(e=>{let t=Vd(e);pe(t),Rf(t)},[]),Ue=(0,b.useCallback)(e=>{he(e),_e(null),Vf(e)},[]),We=(0,b.useCallback)(e=>{ye(e),Wf(e)},[]),Ge=(0,b.useCallback)(e=>{xe(e),qf(e)},[]),Ke=(0,b.useCallback)(e=>{Ce(e),Xf(e)},[]),Je=(0,b.useCallback)(e=>{if(!e){o.current?.clearDecorations(),H({resultIndex:-1,resultCount:0});return}o.current?.findNext(e)},[]),Xe=(0,b.useCallback)(e=>{e&&o.current?.findPrevious(e)},[]),Ze=(0,b.useCallback)(()=>{L(!1),B(``),H({resultIndex:-1,resultCount:0}),o.current?.clearDecorations(),f.current?.()},[]),Qe=(0,b.useCallback)(()=>{L(!0),z(e=>e+1)},[]);d.current=Qe;let $e=(0,b.useCallback)(e=>{let t=e.target.value;B(t),Je(t)},[Je]),et=(0,b.useCallback)(e=>{if(Wd(e.nativeEvent,Oe)){e.preventDefault(),e.currentTarget.select();return}if(e.key===`Escape`){e.preventDefault(),Ze();return}e.key===`Enter`&&(e.preventDefault(),e.shiftKey?Xe(ee):Je(ee))},[Ze,Je,Xe,Oe,ee]),tt=(0,b.useCallback)(()=>{u.current||(u.current=!0,F(!0),m.current?.(),c.current!==null&&window.clearTimeout(c.current),c.current=window.setTimeout(()=>{c.current=null,F(!1)},800))},[]),nt=(0,b.useCallback)(()=>{navigator.clipboard.writeText(ad).then(()=>{N(!0),l.current!==null&&window.clearTimeout(l.current),l.current=window.setTimeout(()=>{l.current=null,N(!1)},od)}).catch(()=>{})},[]),rt=O!==null,it=rt||!rt&&A>=2;return dF(O!==null&&O.reason!==`shell-exited`,tt,sd),fF(it,e),(0,y.jsxs)(`main`,{ref:t,className:`h-dvh w-dvw pt-[env(safe-area-inset-top)] pr-[env(safe-area-inset-right)] pb-[env(safe-area-inset-bottom)] pl-[env(safe-area-inset-left)]`,style:{background:Ie},children:[(0,y.jsxs)(`div`,{className:`relative h-full w-full`,children:[(0,y.jsx)(`div`,{ref:n,"aria-label":`terminal session`,className:`absolute inset-0`}),rt&&O?(0,y.jsx)(`span`,{role:`status`,"aria-live":`polite`,className:`absolute top-2 left-3 z-10 inline-flex items-center rounded-md border border-red-500/30 bg-red-500/10 px-2 py-0.5 text-xs font-medium text-red-400`,children:O.reason===`shell-exited`?O.exitCode===null?`exited`:`exited · code ${O.exitCode}`:`disconnected · code ${O.closeCode}`}):null,(0,y.jsx)(XP,{activeThemeId:te,onThemeChange:Re,onThemePreview:re,activeFontId:ie,onFontChange:ze,onFontPreview:le,activeLocalFontFamily:oe,onLocalFontChange:Be,activeFontSize:ue,onFontSizeChange:Ve,activeLineHeight:fe,onLineHeightChange:He,activeCursorStyle:me,onCursorStyleChange:Ue,onCursorStylePreview:_e,activeCursorBlink:ve,onCursorBlinkChange:We,activeScrollback:be,onScrollbackChange:Ge,activeScrollOnUserInput:Se,onScrollOnUserInputChange:Ke,sessionInfo:we,newTabUrl:Le,onOpenSearch:Qe,isMac:Oe,isSearchOpen:I}),(0,y.jsx)(TE,{searchInputRef:s,searchQuery:ee,searchResults:V,onSearchChange:$e,onKeyDown:et,onFindNext:()=>Je(ee),onFindPrevious:()=>Xe(ee)})]}),(0,y.jsx)(fj,{isModalOpen:it,exitInfo:O,isRetryingConnection:P,hasCopiedRestartCommand:M,newTabUrl:Le,onReconnect:tt,onCopyRestartCommand:nt})]})},mF=()=>{let e=(0,b.useRef)(!1);return(0,b.useEffect)(()=>{let t=t=>{e.current||(t.preventDefault(),t.returnValue=``)};return window.addEventListener(`beforeunload`,t),()=>{window.removeEventListener(`beforeunload`,t)}},[]),(0,y.jsx)(pF,{onModalOpenChange:(0,b.useCallback)(t=>{e.current=t},[])})},hF=null,gF=null,_F=()=>hF||(typeof BroadcastChannel>`u`||typeof crypto>`u`||typeof crypto.randomUUID!=`function`?null:(gF=crypto.randomUUID(),hF=new BroadcastChannel(ld),hF.addEventListener(`message`,e=>{let t=e.data,n=sf();t.type===`ping`&&t.tabId!==gF&&t.hue===n&&hF&&gF&&hF.postMessage({type:`claimed`,tabId:gF,hue:n})}),hF));ff(),pf(`idle`),(()=>{let e=_F();if(!e||!gF)return()=>{};let t=sf(),n=new Set,r=e=>{let r=e.data;r.type===`claimed`&&r.tabId!==gF&&r.hue===t&&n.add(r.hue)};e.addEventListener(`message`,r),e.postMessage({type:`ping`,tabId:gF,hue:t});let i=setTimeout(()=>{if(e.removeEventListener(`message`,r),n.size===0)return;let i=cf([...n]);i!==t&&(lf(i),pf(`idle`))},250);return()=>{clearTimeout(i),e.removeEventListener(`message`,r),hF?.close(),hF=null,gF=null}})(),(()=>{if(typeof document>`u`||document.getElementById(`localterm-google-fonts`))return;let e=Md();if(!e)return;let t=document.createElement(`link`);t.id=bd,t.rel=`stylesheet`,t.href=e,document.head.appendChild(t)})(),((e=!1)=>{e||typeof navigator>`u`||!(`serviceWorker`in navigator)||navigator.serviceWorker.register(`/sw.js`,{scope:`/`}).catch(e=>{console.warn(`[localterm] service worker registration failed`,e)})})();var vF=document.getElementById(`root`);if(!vF)throw Error(`Root element not found`);(0,x.createRoot)(vF,{onCaughtError(e,t){console.error(`[localterm] React caught error:`,e,t)},onUncaughtError(e,t){console.error(`[localterm] React uncaught error:`,e,t)},onRecoverableError(e,t){console.error(`[localterm] React recoverable error:`,e,t)}}).render((0,y.jsx)(b.StrictMode,{children:(0,y.jsx)(FP,{delay:300,children:(0,y.jsx)(mF,{})})}));
|
|
121
|
-
//# sourceMappingURL=index-
|
|
120
|
+
`),!1}return!0})},Ky=e=>{e.attachCustomWheelEventHandler(t=>Uy(t,e)?(t.preventDefault(),!1):!0)},qy=e=>{let t=e.buffer.active,n=Math.max(0,t.baseY-t.viewportY);return{distanceFromBottom:n,wasAtBottom:n===0}},Jy=(e,t)=>{if(t.wasAtBottom){e.scrollToBottom();return}let n=e.buffer.active,r=Math.max(0,n.baseY-t.distanceFromBottom)-n.viewportY;r!==0&&e.scrollLines(r)},Yy=(e,t)=>{let n=e.buffer.active,r=Math.max(0,n.baseY-n.viewportY),i=r===0;try{t.fit()}catch{return!1}try{if(i)return e.scrollToBottom(),!0;let t=e.buffer.active;if(r>t.baseY)return e.scrollToBottom(),!0;let n=Math.max(0,t.baseY-r)-t.viewportY;n!==0&&e.scrollLines(n)}catch{}return!0},Xy=e=>{let t=null,n=null,r=null,i=()=>qy(e.terminal),a=t=>{Jy(e.terminal,t)},o=()=>{r&&window.clearTimeout(r.timer),n!==null&&(window.cancelAnimationFrame(n),n=null),r=null},s=()=>{r&&a(r.anchor)},c=e=>{o(),r={anchor:e,timer:window.setTimeout(()=>{s(),r=null},nd)},n=window.requestAnimationFrame(()=>{n=null,s()})},l=()=>{let t=i();Yy(e.terminal,e.fitAddon)&&c(t)};return{captureAnchor:i,restoreAnchor:a,fitToContainer:l,scheduleFit:()=>{t!==null&&window.clearTimeout(t),t=window.setTimeout(()=>{t=null,l()},e.resizeDebounceMs)},beginResizeScrollRestore:c,clearResizeScrollRestore:o,restoreResizeScroll:s,hasResizeRestore:()=>r!==null,cleanupResizeScroll:()=>{t!==null&&window.clearTimeout(t),o()}}},Zy=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),Qy=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),$y=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),eb=e=>{let t=$y(e);return t.charAt(0).toUpperCase()+t.slice(1)},tb={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},nb=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},rb=(0,b.createContext)({}),ib=()=>(0,b.useContext)(rb),ab=(0,b.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=ib()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,b.createElement)(`svg`,{ref:c,...tb,width:t??l??tb.width,height:t??l??tb.height,stroke:e??f,strokeWidth:m,className:Zy(`lucide`,p,i),...!a&&!nb(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,b.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),ob=(e,t)=>{let n=(0,b.forwardRef)(({className:n,...r},i)=>(0,b.createElement)(ab,{ref:i,iconNode:t,className:Zy(`lucide-${Qy(eb(e))}`,`lucide-${e}`,n),...r}));return n.displayName=eb(e),n},sb=ob(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),cb=ob(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),lb=ob(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),ub=ob(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),db=ob(`loader`,[[`path`,{d:`M12 2v4`,key:`3427ic`}],[`path`,{d:`m16.2 7.8 2.9-2.9`,key:`r700ao`}],[`path`,{d:`M18 12h4`,key:`wj9ykh`}],[`path`,{d:`m16.2 16.2 2.9 2.9`,key:`1bxg5t`}],[`path`,{d:`M12 18v4`,key:`jadmvz`}],[`path`,{d:`m4.9 19.1 2.9-2.9`,key:`bwix9q`}],[`path`,{d:`M2 12h4`,key:`j09sii`}],[`path`,{d:`m4.9 4.9 2.9 2.9`,key:`giyufr`}]]),fb=ob(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),pb=ob(`monitor-cog`,[[`path`,{d:`M12 17v4`,key:`1riwvh`}],[`path`,{d:`m14.305 7.53.923-.382`,key:`1mlnsw`}],[`path`,{d:`m15.228 4.852-.923-.383`,key:`82mpwg`}],[`path`,{d:`m16.852 3.228-.383-.924`,key:`ln4sir`}],[`path`,{d:`m16.852 8.772-.383.923`,key:`1dejw0`}],[`path`,{d:`m19.148 3.228.383-.924`,key:`192kgf`}],[`path`,{d:`m19.53 9.696-.382-.924`,key:`fiavlr`}],[`path`,{d:`m20.772 4.852.924-.383`,key:`1j8mgp`}],[`path`,{d:`m20.772 7.148.924.383`,key:`zix9be`}],[`path`,{d:`M22 13v2a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7`,key:`1tnzv8`}],[`path`,{d:`M8 21h8`,key:`1ev6f3`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}]]),mb=ob(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),hb=ob(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),gb=ob(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),_b=ob(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]);function vb(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=vb(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function yb(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=vb(e))&&(r&&(r+=` `),r+=t);return r}var bb=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,xb=yb,Sb=(e,t)=>n=>{if(t?.variants==null)return xb(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=bb(t)||bb(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return xb(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},Cb=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},wb=(e,t)=>({classGroupId:e,validator:t}),Tb=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Eb=`-`,Db=[],Ob=`arbitrary..`,kb=e=>{let t=Mb(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return jb(e);let n=e.split(Eb);return Ab(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?Cb(i,t):t:i||Db}return n[e]||Db}}},Ab=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=Ab(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(Eb):e.slice(t).join(Eb),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},jb=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?Ob+r:void 0})(),Mb=e=>{let{theme:t,classGroups:n}=e;return Nb(n,t)},Nb=(e,t)=>{let n=Tb();for(let r in e){let i=e[r];Pb(i,n,r,t)}return n},Pb=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];Fb(i,t,n,r)}},Fb=(e,t,n,r)=>{if(typeof e==`string`){Ib(e,t,n);return}if(typeof e==`function`){Lb(e,t,n,r);return}Rb(e,t,n,r)},Ib=(e,t,n)=>{let r=e===``?t:zb(t,e);r.classGroupId=n},Lb=(e,t,n,r)=>{if(Bb(e)){Pb(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(wb(n,e))},Rb=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];Pb(o,zb(t,a),n,r)}},zb=(e,t)=>{let n=e,r=t.split(Eb),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=Tb(),n.nextPart.set(t,i)),n=i}return n},Bb=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,Vb=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},Hb=`!`,Ub=`:`,Wb=[],Gb=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),Kb=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===Ub){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(Hb)?(c=s.slice(0,-1),l=!0):s.startsWith(Hb)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return Gb(t,l,c,u)};if(t){let e=t+Ub,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):Gb(Wb,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},qb=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},Jb=e=>({cache:Vb(e.cacheSize),parseClassName:Kb(e),sortModifiers:qb(e),...kb(e)}),Yb=/\s+/,Xb=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a}=t,o=[],s=e.trim().split(Yb),c=``;for(let e=s.length-1;e>=0;--e){let t=s[e],{isExternal:l,modifiers:u,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:p}=n(t);if(l){c=t+(c.length>0?` `+c:c);continue}let m=!!p,h=r(m?f.substring(0,p):f);if(!h){if(!m){c=t+(c.length>0?` `+c:c);continue}if(h=r(f),!h){c=t+(c.length>0?` `+c:c);continue}m=!1}let g=u.length===0?``:u.length===1?u[0]:a(u).join(`:`),_=d?g+Hb:g,v=_+h;if(o.indexOf(v)>-1)continue;o.push(v);let y=i(h,m);for(let e=0;e<y.length;++e){let t=y[e];o.push(_+t)}c=t+(c.length>0?` `+c:c)}return c},Zb=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=Qb(n))&&(i&&(i+=` `),i+=r);return i},Qb=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=Qb(e[r]))&&(n&&(n+=` `),n+=t);return n},$b=(e,...t)=>{let n,r,i,a,o=o=>(n=Jb(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=Xb(e,n);return i(e,a),a};return a=o,(...e)=>a(Zb(...e))},ex=[],tx=e=>{let t=t=>t[e]||ex;return t.isThemeGetter=!0,t},nx=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,rx=/^\((?:(\w[\w-]*):)?(.+)\)$/i,ix=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,ax=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ox=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,sx=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,cx=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,lx=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ux=e=>ix.test(e),dx=e=>!!e&&!Number.isNaN(Number(e)),fx=e=>!!e&&Number.isInteger(Number(e)),px=e=>e.endsWith(`%`)&&dx(e.slice(0,-1)),mx=e=>ax.test(e),hx=()=>!0,gx=e=>ox.test(e)&&!sx.test(e),_x=()=>!1,vx=e=>cx.test(e),yx=e=>lx.test(e),bx=e=>!X(e)&&!Z(e),xx=e=>Ix(e,Bx,_x),X=e=>nx.test(e),Sx=e=>Ix(e,Vx,gx),Cx=e=>Ix(e,Hx,dx),wx=e=>Ix(e,Wx,hx),Tx=e=>Ix(e,Ux,_x),Ex=e=>Ix(e,Rx,_x),Dx=e=>Ix(e,zx,yx),Ox=e=>Ix(e,Gx,vx),Z=e=>rx.test(e),kx=e=>Lx(e,Vx),Ax=e=>Lx(e,Ux),jx=e=>Lx(e,Rx),Mx=e=>Lx(e,Bx),Nx=e=>Lx(e,zx),Px=e=>Lx(e,Gx,!0),Fx=e=>Lx(e,Wx,!0),Ix=(e,t,n)=>{let r=nx.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Lx=(e,t,n=!1)=>{let r=rx.exec(e);return r?r[1]?t(r[1]):n:!1},Rx=e=>e===`position`||e===`percentage`,zx=e=>e===`image`||e===`url`,Bx=e=>e===`length`||e===`size`||e===`bg-size`,Vx=e=>e===`length`,Hx=e=>e===`number`,Ux=e=>e===`family-name`,Wx=e=>e===`number`||e===`weight`,Gx=e=>e===`shadow`,Kx=$b(()=>{let e=tx(`color`),t=tx(`font`),n=tx(`text`),r=tx(`font-weight`),i=tx(`tracking`),a=tx(`leading`),o=tx(`breakpoint`),s=tx(`container`),c=tx(`spacing`),l=tx(`radius`),u=tx(`shadow`),d=tx(`inset-shadow`),f=tx(`text-shadow`),p=tx(`drop-shadow`),m=tx(`blur`),h=tx(`perspective`),g=tx(`aspect`),_=tx(`ease`),v=tx(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),Z,X],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[Z,X,c],T=()=>[ux,`full`,`auto`,...w()],E=()=>[fx,`none`,`subgrid`,Z,X],D=()=>[`auto`,{span:[`full`,fx,Z,X]},fx,Z,X],O=()=>[fx,`auto`,Z,X],k=()=>[`auto`,`min`,`max`,`fr`,Z,X],A=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],j=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],M=()=>[`auto`,...w()],N=()=>[ux,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],P=()=>[ux,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],F=()=>[ux,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],I=()=>[e,Z,X],L=()=>[...b(),jx,Ex,{position:[Z,X]}],R=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],z=()=>[`auto`,`cover`,`contain`,Mx,xx,{size:[Z,X]}],ee=()=>[px,kx,Sx],B=()=>[``,`none`,`full`,l,Z,X],V=()=>[``,dx,kx,Sx],H=()=>[`solid`,`dashed`,`dotted`,`double`],te=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],ne=()=>[dx,px,jx,Ex],U=()=>[``,`none`,m,Z,X],re=()=>[`none`,dx,Z,X],ie=()=>[`none`,dx,Z,X],ae=()=>[dx,Z,X],oe=()=>[ux,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[mx],breakpoint:[mx],color:[hx],container:[mx],"drop-shadow":[mx],ease:[`in`,`out`,`in-out`],font:[bx],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[mx],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[mx],shadow:[mx],spacing:[`px`,dx],text:[mx],"text-shadow":[mx],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,ux,X,Z,g]}],container:[`container`],columns:[{columns:[dx,X,Z,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[fx,`auto`,Z,X]}],basis:[{basis:[ux,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[dx,ux,`auto`,`initial`,`none`,X]}],grow:[{grow:[``,dx,Z,X]}],shrink:[{shrink:[``,dx,Z,X]}],order:[{order:[fx,`first`,`last`,`none`,Z,X]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...A(),`normal`]}],"justify-items":[{"justify-items":[...j(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...j()]}],"align-content":[{content:[`normal`,...A()]}],"align-items":[{items:[...j(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...j(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":A()}],"place-items":[{"place-items":[...j(),`baseline`]}],"place-self":[{"place-self":[`auto`,...j()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mbs:[{mbs:M()}],mbe:[{mbe:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:N()}],"inline-size":[{inline:[`auto`,...P()]}],"min-inline-size":[{"min-inline":[`auto`,...P()]}],"max-inline-size":[{"max-inline":[`none`,...P()]}],"block-size":[{block:[`auto`,...F()]}],"min-block-size":[{"min-block":[`auto`,...F()]}],"max-block-size":[{"max-block":[`none`,...F()]}],w:[{w:[s,`screen`,...N()]}],"min-w":[{"min-w":[s,`screen`,`none`,...N()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...N()]}],h:[{h:[`screen`,`lh`,...N()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...N()]}],"max-h":[{"max-h":[`screen`,`lh`,...N()]}],"font-size":[{text:[`base`,n,kx,Sx]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,Fx,wx]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,px,X]}],"font-family":[{font:[Ax,Tx,t]}],"font-features":[{"font-features":[X]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,Z,X]}],"line-clamp":[{"line-clamp":[dx,`none`,Z,Cx]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,Z,X]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,Z,X]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:I()}],"text-color":[{text:I()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...H(),`wavy`]}],"text-decoration-thickness":[{decoration:[dx,`from-font`,`auto`,Z,Sx]}],"text-decoration-color":[{decoration:I()}],"underline-offset":[{"underline-offset":[dx,`auto`,Z,X]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,Z,X]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,Z,X]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:L()}],"bg-repeat":[{bg:R()}],"bg-size":[{bg:z()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},fx,Z,X],radial:[``,Z,X],conic:[fx,Z,X]},Nx,Dx]}],"bg-color":[{bg:I()}],"gradient-from-pos":[{from:ee()}],"gradient-via-pos":[{via:ee()}],"gradient-to-pos":[{to:ee()}],"gradient-from":[{from:I()}],"gradient-via":[{via:I()}],"gradient-to":[{to:I()}],rounded:[{rounded:B()}],"rounded-s":[{"rounded-s":B()}],"rounded-e":[{"rounded-e":B()}],"rounded-t":[{"rounded-t":B()}],"rounded-r":[{"rounded-r":B()}],"rounded-b":[{"rounded-b":B()}],"rounded-l":[{"rounded-l":B()}],"rounded-ss":[{"rounded-ss":B()}],"rounded-se":[{"rounded-se":B()}],"rounded-ee":[{"rounded-ee":B()}],"rounded-es":[{"rounded-es":B()}],"rounded-tl":[{"rounded-tl":B()}],"rounded-tr":[{"rounded-tr":B()}],"rounded-br":[{"rounded-br":B()}],"rounded-bl":[{"rounded-bl":B()}],"border-w":[{border:V()}],"border-w-x":[{"border-x":V()}],"border-w-y":[{"border-y":V()}],"border-w-s":[{"border-s":V()}],"border-w-e":[{"border-e":V()}],"border-w-bs":[{"border-bs":V()}],"border-w-be":[{"border-be":V()}],"border-w-t":[{"border-t":V()}],"border-w-r":[{"border-r":V()}],"border-w-b":[{"border-b":V()}],"border-w-l":[{"border-l":V()}],"divide-x":[{"divide-x":V()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":V()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...H(),`hidden`,`none`]}],"divide-style":[{divide:[...H(),`hidden`,`none`]}],"border-color":[{border:I()}],"border-color-x":[{"border-x":I()}],"border-color-y":[{"border-y":I()}],"border-color-s":[{"border-s":I()}],"border-color-e":[{"border-e":I()}],"border-color-bs":[{"border-bs":I()}],"border-color-be":[{"border-be":I()}],"border-color-t":[{"border-t":I()}],"border-color-r":[{"border-r":I()}],"border-color-b":[{"border-b":I()}],"border-color-l":[{"border-l":I()}],"divide-color":[{divide:I()}],"outline-style":[{outline:[...H(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[dx,Z,X]}],"outline-w":[{outline:[``,dx,kx,Sx]}],"outline-color":[{outline:I()}],shadow:[{shadow:[``,`none`,u,Px,Ox]}],"shadow-color":[{shadow:I()}],"inset-shadow":[{"inset-shadow":[`none`,d,Px,Ox]}],"inset-shadow-color":[{"inset-shadow":I()}],"ring-w":[{ring:V()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:I()}],"ring-offset-w":[{"ring-offset":[dx,Sx]}],"ring-offset-color":[{"ring-offset":I()}],"inset-ring-w":[{"inset-ring":V()}],"inset-ring-color":[{"inset-ring":I()}],"text-shadow":[{"text-shadow":[`none`,f,Px,Ox]}],"text-shadow-color":[{"text-shadow":I()}],opacity:[{opacity:[dx,Z,X]}],"mix-blend":[{"mix-blend":[...te(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":te()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[dx]}],"mask-image-linear-from-pos":[{"mask-linear-from":ne()}],"mask-image-linear-to-pos":[{"mask-linear-to":ne()}],"mask-image-linear-from-color":[{"mask-linear-from":I()}],"mask-image-linear-to-color":[{"mask-linear-to":I()}],"mask-image-t-from-pos":[{"mask-t-from":ne()}],"mask-image-t-to-pos":[{"mask-t-to":ne()}],"mask-image-t-from-color":[{"mask-t-from":I()}],"mask-image-t-to-color":[{"mask-t-to":I()}],"mask-image-r-from-pos":[{"mask-r-from":ne()}],"mask-image-r-to-pos":[{"mask-r-to":ne()}],"mask-image-r-from-color":[{"mask-r-from":I()}],"mask-image-r-to-color":[{"mask-r-to":I()}],"mask-image-b-from-pos":[{"mask-b-from":ne()}],"mask-image-b-to-pos":[{"mask-b-to":ne()}],"mask-image-b-from-color":[{"mask-b-from":I()}],"mask-image-b-to-color":[{"mask-b-to":I()}],"mask-image-l-from-pos":[{"mask-l-from":ne()}],"mask-image-l-to-pos":[{"mask-l-to":ne()}],"mask-image-l-from-color":[{"mask-l-from":I()}],"mask-image-l-to-color":[{"mask-l-to":I()}],"mask-image-x-from-pos":[{"mask-x-from":ne()}],"mask-image-x-to-pos":[{"mask-x-to":ne()}],"mask-image-x-from-color":[{"mask-x-from":I()}],"mask-image-x-to-color":[{"mask-x-to":I()}],"mask-image-y-from-pos":[{"mask-y-from":ne()}],"mask-image-y-to-pos":[{"mask-y-to":ne()}],"mask-image-y-from-color":[{"mask-y-from":I()}],"mask-image-y-to-color":[{"mask-y-to":I()}],"mask-image-radial":[{"mask-radial":[Z,X]}],"mask-image-radial-from-pos":[{"mask-radial-from":ne()}],"mask-image-radial-to-pos":[{"mask-radial-to":ne()}],"mask-image-radial-from-color":[{"mask-radial-from":I()}],"mask-image-radial-to-color":[{"mask-radial-to":I()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[dx]}],"mask-image-conic-from-pos":[{"mask-conic-from":ne()}],"mask-image-conic-to-pos":[{"mask-conic-to":ne()}],"mask-image-conic-from-color":[{"mask-conic-from":I()}],"mask-image-conic-to-color":[{"mask-conic-to":I()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:L()}],"mask-repeat":[{mask:R()}],"mask-size":[{mask:z()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,Z,X]}],filter:[{filter:[``,`none`,Z,X]}],blur:[{blur:U()}],brightness:[{brightness:[dx,Z,X]}],contrast:[{contrast:[dx,Z,X]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,Px,Ox]}],"drop-shadow-color":[{"drop-shadow":I()}],grayscale:[{grayscale:[``,dx,Z,X]}],"hue-rotate":[{"hue-rotate":[dx,Z,X]}],invert:[{invert:[``,dx,Z,X]}],saturate:[{saturate:[dx,Z,X]}],sepia:[{sepia:[``,dx,Z,X]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,Z,X]}],"backdrop-blur":[{"backdrop-blur":U()}],"backdrop-brightness":[{"backdrop-brightness":[dx,Z,X]}],"backdrop-contrast":[{"backdrop-contrast":[dx,Z,X]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,dx,Z,X]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[dx,Z,X]}],"backdrop-invert":[{"backdrop-invert":[``,dx,Z,X]}],"backdrop-opacity":[{"backdrop-opacity":[dx,Z,X]}],"backdrop-saturate":[{"backdrop-saturate":[dx,Z,X]}],"backdrop-sepia":[{"backdrop-sepia":[``,dx,Z,X]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,Z,X]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[dx,`initial`,Z,X]}],ease:[{ease:[`linear`,`initial`,_,Z,X]}],delay:[{delay:[dx,Z,X]}],animate:[{animate:[`none`,v,Z,X]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,Z,X]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:re()}],"rotate-x":[{"rotate-x":re()}],"rotate-y":[{"rotate-y":re()}],"rotate-z":[{"rotate-z":re()}],scale:[{scale:ie()}],"scale-x":[{"scale-x":ie()}],"scale-y":[{"scale-y":ie()}],"scale-z":[{"scale-z":ie()}],"scale-3d":[`scale-3d`],skew:[{skew:ae()}],"skew-x":[{"skew-x":ae()}],"skew-y":[{"skew-y":ae()}],transform:[{transform:[Z,X,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:oe()}],"translate-x":[{"translate-x":oe()}],"translate-y":[{"translate-y":oe()}],"translate-z":[{"translate-z":oe()}],"translate-none":[`translate-none`],accent:[{accent:I()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:I()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,Z,X]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,Z,X]}],fill:[{fill:[`none`,...I()]}],"stroke-w":[{stroke:[dx,kx,Sx,Cx]}],stroke:[{stroke:[`none`,...I()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function qx(...e){return Kx(yb(e))}function Jx(){return typeof window<`u`}function Yx(e){return Qx(e)?(e.nodeName||``).toLowerCase():`#document`}function Xx(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Zx(e){return((Qx(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Qx(e){return Jx()?e instanceof Node||e instanceof Xx(e).Node:!1}function $x(e){return Jx()?e instanceof Element||e instanceof Xx(e).Element:!1}function eS(e){return Jx()?e instanceof HTMLElement||e instanceof Xx(e).HTMLElement:!1}function tS(e){return!Jx()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Xx(e).ShadowRoot}function nS(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=pS(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function rS(e){return/^(table|td|th)$/.test(Yx(e))}function iS(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var aS=/transform|translate|scale|rotate|perspective|filter/,oS=/paint|layout|strict|content/,sS=e=>!!e&&e!==`none`,cS;function lS(e){let t=$x(e)?pS(e):e;return sS(t.transform)||sS(t.translate)||sS(t.scale)||sS(t.rotate)||sS(t.perspective)||!dS()&&(sS(t.backdropFilter)||sS(t.filter))||aS.test(t.willChange||``)||oS.test(t.contain||``)}function uS(e){let t=hS(e);for(;eS(t)&&!fS(t);){if(lS(t))return t;if(iS(t))return null;t=hS(t)}return null}function dS(){return cS??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),cS}function fS(e){return/^(html|body|#document)$/.test(Yx(e))}function pS(e){return Xx(e).getComputedStyle(e)}function mS(e){return $x(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function hS(e){if(Yx(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||tS(e)&&e.host||Zx(e);return tS(t)?t.host:t}function gS(e){let t=hS(e);return fS(t)?e.ownerDocument?e.ownerDocument.body:e.body:eS(t)&&nS(t)?t:gS(t)}function _S(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=gS(e),i=r===e.ownerDocument?.body,a=Xx(r);if(i){let e=vS(a);return t.concat(a,a.visualViewport||[],nS(r)?r:[],e&&n?_S(e):[])}else return t.concat(r,_S(r,[],n))}function vS(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var yS={};function bS(e,t){let n=b.useRef(yS);return n.current===yS&&(n.current=e(t)),n}var xS=b[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],SS=xS&&xS!==b.useLayoutEffect?xS:e=>e();function CS(e){let t=bS(wS).current;return t.next=e,SS(t.effect),t.trampoline}function wS(){let e={next:void 0,callback:TS,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function TS(){}var ES={...b},Q=typeof document<`u`?b.useLayoutEffect:()=>{};function DS(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}var OS={};function kS(e,t,n,r,i){if(!n&&!r&&!i&&!e)return jS(t);let a=jS(e);return t&&(a=MS(a,t)),n&&(a=MS(a,n)),r&&(a=MS(a,r)),i&&(a=MS(a,i)),a}function AS(e){if(e.length===0)return OS;if(e.length===1)return jS(e[0]);let t=jS(e[0]);for(let n=1;n<e.length;n+=1)t=MS(t,e[n]);return t}function jS(e){return IS(e)?{...LS(e,OS)}:NS(e)}function MS(e,t){return IS(t)?LS(t,e):PS(e,t)}function NS(e){let t={...e};for(let e in t){let n=t[e];FS(e,n)&&(t[e]=zS(n))}return t}function PS(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=DS(e.style,r);break;case`className`:e[n]=VS(e.className,r);break;default:FS(n,r)?e[n]=RS(e[n],r):e[n]=r}}return e}function FS(e,t){let n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof t==`function`||t===void 0)}function IS(e){return typeof e==`function`}function LS(e,t){return IS(e)?e(t):e??OS}function RS(e,t){return t?e?(...n)=>{let r=n[0];if(HS(r)){let i=r;BS(i);let a=t(...n);return i.baseUIHandlerPrevented||e?.(...n),a}let i=t(...n);return e?.(...n),i}:zS(t):e}function zS(e){return e&&((...t)=>{let n=t[0];return HS(n)&&BS(n),e(...t)})}function BS(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function VS(e,t){return t?e?t+` `+e:t:e}function HS(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function US(e,t){return function(n,...r){let i=new URL(e);return i.searchParams.set(`code`,n.toString()),r.forEach(e=>i.searchParams.append(`args[]`,e)),`${t} error #${n}; visit ${i} for the full message.`}}var WS=US(`https://base-ui.com/production-error`,`Base UI`),GS=b.createContext(void 0);function KS(e=!1){let t=b.useContext(GS);if(t===void 0&&!e)throw Error(WS(16));return t}function qS(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=e,o=r&&t!==!1,s=r&&t===!1;return{props:b.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=i,!a&&n&&(e.tabIndex=t?i:-1)),(a&&(t||o)||!a&&n)&&(e[`aria-disabled`]=n),a&&(!t||s)&&(e.disabled=n),e},[r,n,t,o,s,a,i])}}function JS(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:a}=e,o=b.useRef(null),s=KS(!0),c=a??s!==void 0,{props:l}=qS({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:r,isNativeButton:i}),u=b.useCallback(()=>{let e=o.current;YS(e)&&c&&t&&l.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,l.disabled,c]);return Q(u,[u]),{getButtonProps:b.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:s,...u}=e;return kS({type:i?`button`:void 0,onClick(e){if(t){e.preventDefault();return}n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(BS(e),o?.(e),e.baseUIHandlerPrevented))return;let r=e.target===e.currentTarget,a=e.currentTarget,s=YS(a),l=!i&&XS(a),u=r&&(i?s:!l),d=e.key===`Enter`,f=e.key===` `,p=a.getAttribute(`role`),m=p?.startsWith(`menuitem`)||p===`option`||p===`gridcell`;if(r&&c&&f){if(e.defaultPrevented&&m)return;e.preventDefault(),l||i&&s?(a.click(),e.preventBaseUIHandler()):u&&(n?.(e),e.preventBaseUIHandler());return}u&&(!i&&(f||d)&&e.preventDefault(),!i&&d&&n?.(e))},onKeyUp(e){if(!t){if(BS(e),a?.(e),e.target===e.currentTarget&&i&&c&&YS(e.currentTarget)&&e.key===` `){e.preventDefault();return}e.baseUIHandlerPrevented||e.target===e.currentTarget&&!i&&!c&&e.key===` `&&n?.(e)}},onPointerDown(e){if(t){e.preventDefault();return}s?.(e)}},i?void 0:{role:`button`},l,u)},[t,l,c,i]),buttonRef:CS(e=>{o.current=e,u()})}}function YS(e){return eS(e)&&e.tagName===`BUTTON`}function XS(e){return!!(e?.tagName===`A`&&e?.href)}function ZS(e,t,n,r){let i=bS($S).current;return eC(i,e,t,n,r)&&nC(i,[e,t,n,r]),i.callback}function QS(e){let t=bS($S).current;return tC(t,e)&&nC(t,e),t.callback}function $S(){return{callback:null,cleanup:null,refs:[]}}function eC(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function tC(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function nC(e,t){if(e.refs=t,t.every(e=>e==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&=(e.cleanup(),null),n!=null){let r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let i=t[e];if(i!=null)switch(typeof i){case`function`:{let t=i(n);typeof t==`function`&&(r[e]=t);break}case`object`:i.current=n;break;default:}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let n=t[e];if(n!=null)switch(typeof n){case`function`:{let t=r[e];typeof t==`function`?t():n(null);break}case`object`:n.current=null;break;default:}}}}}}var rC=19;function iC(e){return rC>=e}function aC(e){if(!b.isValidElement(e))return null;let t=e,n=t.props;return(iC(19)?n?.ref:t.ref)??null}function oC(){}var sC=Object.freeze([]),cC=Object.freeze({});function lC(e,t){let n={};for(let r in e){let i=e[r];if(t?.hasOwnProperty(r)){let e=t[r](i);e!=null&&Object.assign(n,e);continue}i===!0?n[`data-${r.toLowerCase()}`]=``:i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function uC(e,t){return typeof e==`function`?e(t):e}function dC(e,t){return typeof e==`function`?e(t):e}function fC(e,t,n={}){let r=t.render,i=pC(t,n);return n.enabled===!1?null:gC(e,r,i,n.state??cC)}function pC(e,t={}){let{className:n,style:r,render:i}=e,{state:a=cC,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?uC(n,a):void 0,d=l?dC(r,a):void 0,f=l?lC(a,c):cC,p=l&&s?mC(s):void 0,m=l?DS(f,p)??{}:cC;return typeof document<`u`&&(l?Array.isArray(o)?m.ref=QS([m.ref,aC(i),...o]):m.ref=ZS(m.ref,aC(i),o):ZS(null,null)),l?(u!==void 0&&(m.className=VS(m.className,u)),d!==void 0&&(m.style=DS(m.style,d)),m):cC}function mC(e){return Array.isArray(e)?AS(e):kS(void 0,e)}var hC=Symbol.for(`react.lazy`);function gC(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=kS(n,t.props);e.ref=n.ref;let i=t;return i?.$$typeof===hC&&(i=b.Children.toArray(t)[0]),b.cloneElement(i,e)}if(e&&typeof e==`string`)return _C(e,n);throw Error(WS(8))}function _C(e,t){return e===`button`?(0,b.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,b.createElement)(`img`,{alt:``,...t,key:t.key}):b.createElement(e,t)}var vC=b.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,focusableWhenDisabled:a=!1,nativeButton:o=!0,style:s,...c}=e,{getButtonProps:l,buttonRef:u}=JS({disabled:i,focusableWhenDisabled:a,native:o});return fC(`button`,e,{state:{disabled:i},ref:[t,u],props:[c,l]})}),yC=Sb(`group/button inline-flex shrink-0 items-center justify-center rounded-md border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/80`,outline:`border-border bg-background shadow-xs hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,ghost:`hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50`,destructive:`bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-9 gap-1.5 px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,xs:`h-6 gap-1 rounded-[min(var(--radius-md),8px)] px-2 text-xs in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-8 gap-1 rounded-[min(var(--radius-md),10px)] px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5`,lg:`h-10 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,icon:`size-9`,"icon-xs":`size-6 rounded-[min(var(--radius-md),8px)] in-data-[slot=button-group]:rounded-md [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-8 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-md`,"icon-lg":`size-10`}},defaultVariants:{variant:`default`,size:`default`}});function bC({className:e,variant:t=`default`,size:n=`default`,...r}){return(0,y.jsx)(vC,{"data-slot":`button`,className:qx(yC({variant:t,size:n,className:e})),...r})}var xC=function(e){return e.disabled=`data-disabled`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.filled=`data-filled`,e.focused=`data-focused`,e}({}),SC={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},CC={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},wC={disabled:!1,...CC},TC={valid(e){return e===null?null:e?{[xC.valid]:``}:{[xC.invalid]:``}}},EC=b.createContext({invalid:void 0,name:void 0,validityData:{state:SC,errors:[],error:``,value:``,initialValue:null},setValidityData:oC,disabled:void 0,touched:CC.touched,setTouched:oC,dirty:CC.dirty,setDirty:oC,filled:CC.filled,setFilled:oC,focused:CC.focused,setFocused:oC,validate:()=>null,validationMode:`onSubmit`,validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:wC,markedDirtyRef:{current:!1},registerFieldControl:oC,validation:{getValidationProps:(e=cC)=>e,getInputValidationProps:(e=cC)=>e,inputRef:{current:null},commit:async()=>{}}});function DC(e=!0){let t=b.useContext(EC);if(t.setValidityData===oC&&!e)throw Error(WS(28));return t}var OC=b.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:oC,validationMode:`onSubmit`,submitAttemptedRef:{current:!1}});function kC(){return b.useContext(OC)}var AC=0;function jC(e,t=`mui`){let[n,r]=b.useState(e),i=e||n;return b.useEffect(()=>{n??(AC+=1,r(`${t}-${AC}`))},[n,t]),i}var MC=ES.useId;function NC(e,t){if(MC!==void 0){let n=MC();return e??(t?`${t}-${n}`:n)}return jC(e,t)}function PC(e){return NC(e,`base-ui`)}var FC=b.createContext({controlId:void 0,registerControlId:oC,labelId:void 0,setLabelId:oC,messageIds:[],setMessageIds:oC,getDescriptionProps:e=>e});function IC(){return b.useContext(FC)}function LC(e,t,n,r=!0,i){let[a,o]=b.useState(),s=PC(i?`${i}-label`:void 0),c=e??t??a;return Q(()=>{let i=e||t||!r?void 0:RC(n.current,s);a!==i&&o(i)}),c}function RC(e,t){let n=zC(e);if(n)return!n.id&&t&&(n.id=t),n.id||void 0}function zC(e){if(!e)return;let t=e.parentElement;if(t&&t.tagName===`LABEL`)return t;let n=e.id;if(n){let t=e.nextElementSibling;if(t&&t.htmlFor===n)return t}let r=e.labels;return r&&r[0]}function BC(e={}){let{id:t,implicit:n=!1,controlRef:r}=e,{controlId:i,registerControlId:a}=IC(),o=PC(t),s=n?i:void 0,c=bS(()=>Symbol(`labelable-control`)),l=b.useRef(!1),u=b.useRef(t!=null),d=CS(()=>{!l.current||a===oC||(l.current=!1,a(c.current,void 0))});return Q(()=>{if(a===oC)return;let e;if(n){let n=r?.current;e=$x(n)&&n.closest(`label`)!=null?t??null:s??o}else if(t!=null)u.current=!0,e=t;else if(u.current)e=o;else{d();return}if(e===void 0){d();return}l.current=!0,a(c.current,e)},[t,r,s,a,n,o,c,d]),b.useEffect(()=>d,[d]),i??o}function VC(e){return e?.ownerDocument||document}var HC=typeof navigator<`u`,UC=QC(),WC=ew(),GC=$C(),KC=typeof CSS>`u`||!CSS.supports?!1:CSS.supports(`-webkit-backdrop-filter:none`),qC=UC.platform===`MacIntel`&&UC.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(UC.platform);HC&&/firefox/i.test(GC);var JC=HC&&/apple/i.test(navigator.vendor);HC&&/Edg/i.test(GC);var YC=HC&&/android/i.test(WC)||/android/i.test(GC),XC=HC&&WC.toLowerCase().startsWith(`mac`)&&!navigator.maxTouchPoints,ZC=GC.includes(`jsdom/`);function QC(){if(!HC)return{platform:``,maxTouchPoints:-1};let e=navigator.userAgentData;return e?.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??-1}}function $C(){if(!HC)return``;let e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:e,version:t})=>`${e}/${t}`).join(` `):navigator.userAgent}function ew(){if(!HC)return``;let e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??``}var tw=`data-base-ui-focusable`,nw=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,rw=`ArrowLeft`,iw=`ArrowRight`,aw=`ArrowUp`,ow=`ArrowDown`;function sw(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function cw(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&tS(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function lw(e){return`composedPath`in e?e.composedPath()[0]:e.target}function uw(e,t){if(!$x(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(`data-trigger-disabled`);for(let[,e]of t.entries())if(cw(e,n))return!e.hasAttribute(`data-trigger-disabled`);return!1}function dw(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function fw(e){return e.matches(`html,body`)}function pw(e){return eS(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function mw(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${nw}`)!=null}function hw(e){return e?e.getAttribute(`role`)===`combobox`&&pw(e):!1}function gw(e){if(!e||ZC)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function _w(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function vw(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...vw(e,t.id,n)])}function yw(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function bw(e){e.preventDefault(),e.stopPropagation()}function xw(e){return`nativeEvent`in e}function Sw(e){return e.pointerType===``&&e.isTrusted?!0:YC&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function Cw(e){return ZC?!1:!YC&&e.width===0&&e.height===0||YC&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function ww(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function Tw(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}var Ew=[`top`,`right`,`bottom`,`left`],Dw=Math.min,Ow=Math.max,kw=Math.round,Aw=Math.floor,jw=e=>({x:e,y:e}),Mw={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Nw(e,t,n){return Ow(e,Dw(t,n))}function Pw(e,t){return typeof e==`function`?e(t):e}function Fw(e){return e.split(`-`)[0]}function Iw(e){return e.split(`-`)[1]}function Lw(e){return e===`x`?`y`:`x`}function Rw(e){return e===`y`?`height`:`width`}function zw(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Bw(e){return Lw(zw(e))}function Vw(e,t,n){n===void 0&&(n=!1);let r=Iw(e),i=Bw(e),a=Rw(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Xw(o)),[o,Xw(o)]}function Hw(e){let t=Xw(e);return[Uw(e),t,Uw(t)]}function Uw(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Ww=[`left`,`right`],Gw=[`right`,`left`],Kw=[`top`,`bottom`],qw=[`bottom`,`top`];function Jw(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Gw:Ww:t?Ww:Gw;case`left`:case`right`:return t?Kw:qw;default:return[]}}function Yw(e,t,n,r){let i=Iw(e),a=Jw(Fw(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Uw)))),a}function Xw(e){let t=Fw(e);return Mw[t]+e.slice(t.length)}function Zw(e){return{top:0,right:0,bottom:0,left:0,...e}}function Qw(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Zw(e)}function $w(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function eT(e,t,n){return Math.floor(e/t)!==n}function tT(e,t){return t<0||t>=e.length}function nT(e,t){return iT(e.current,{disabledIndices:t})}function rT(e,t){return iT(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function iT(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.length-1&&lT(e,a,r));return a}function aT(e,{event:t,orientation:n,loopFocus:r,onLoop:i,rtl:a,cols:o,disabledIndices:s,minIndex:c,maxIndex:l,prevIndex:u,stopEvent:d=!1}){let f=u,p;if(t.key===`ArrowUp`?p=`up`:t.key===`ArrowDown`&&(p=`down`),p){let n=[],a=[],m=!1,h=0;{let t=null,r=-1;e.forEach((e,i)=>{if(e==null)return;h+=1;let o=e.closest(`[role="row"]`);o&&(m=!0),(o!==t||r===-1)&&(t=o,r+=1,n[r]=[]),n[r].push(i),a[i]=r})}let g=!1,_=0;if(m)for(let e of n){let t=e.length;t>_&&(_=t),t!==o&&(g=!0)}let v=g&&h<e.length,y=_||o,b=o=>{if(!g||u===-1)return;let c=a[u];if(c==null)return;let l=n[c].indexOf(u),d=o===`up`?-1:1;for(let o=c+d,f=0;f<n.length;f+=1,o+=d){if(o<0||o>=n.length){if(!r||v)return;if(o=o<0?n.length-1:0,i){let e=Math.min(l,n[o].length-1);o=a[i(t,u,n[o][e]??n[o][0])]??o}}let c=n[o];for(let t=Math.min(l,c.length-1);t>=0;--t){let n=c[t];if(!lT(e,n,s))return n}}},x=t=>{if(!v||u===-1)return;let n=u%y,i=t===`up`?-y:y,a=l-l%y,o=Aw(l/y)+1;for(let t=u-n+i,c=0;c<o;c+=1,t+=i){if(t<0||t>l){if(!r)return;t=t<0?a:0}let i=Math.min(t+y-1,l);for(let r=Math.min(t+n,i);r>=t;--r)if(!lT(e,r,s))return r}};d&&bw(t);let S=b(p)??x(p);if(S!==void 0)f=S;else if(u===-1)f=p===`up`?l:c;else if(f=iT(e,{startingIndex:u,amount:y,decrement:p===`up`,disabledIndices:s}),r){if(p===`up`&&(u-y<c||f<0)){let e=u%y,n=l%y,r=l-(n-e);f=n===e?l:n>e?r:r-y,i&&(f=i(t,u,f))}p===`down`&&u+y>l&&(f=iT(e,{startingIndex:u%y-y,amount:y,disabledIndices:s}),i&&(f=i(t,u,f)))}tT(e,f)&&(f=u)}if(n===`both`){let n=Aw(u/o);t.key===(a?`ArrowLeft`:`ArrowRight`)&&(d&&bw(t),u%o===o-1?r&&(f=iT(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f))):(f=iT(e,{startingIndex:u,disabledIndices:s}),r&&eT(f,o,n)&&(f=iT(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f)))),eT(f,o,n)&&(f=u)),t.key===(a?`ArrowRight`:`ArrowLeft`)&&(d&&bw(t),u%o===0?r&&(f=iT(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:s}),i&&(f=i(t,u,f))):(f=iT(e,{startingIndex:u,decrement:!0,disabledIndices:s}),r&&eT(f,o,n)&&(f=iT(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:s}),i&&(f=i(t,u,f)))),eT(f,o,n)&&(f=u));let c=Aw(l/o)===n;tT(e,f)&&(r&&c?(f=t.key===(a?`ArrowRight`:`ArrowLeft`)?l:iT(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f))):f=u)}return f}function oT(e,t,n){let r=[],i=0;return e.forEach(({width:e,height:a},o)=>{let s=!1;for(n&&(i=0);!s;){let n=[];for(let r=0;r<e;r+=1)for(let e=0;e<a;e+=1)n.push(i+r+e*t);i%t+e<=t&&n.every(e=>r[e]==null)?(n.forEach(e=>{r[e]=o}),s=!0):i+=1}}),[...r]}function sT(e,t,n,r,i){if(e===-1)return-1;let a=n.indexOf(e),o=t[e];switch(i){case`tl`:return a;case`tr`:return o?a+o.width-1:a;case`bl`:return o?a+(o.height-1)*r:a;case`br`:return n.lastIndexOf(e);default:return-1}}function cT(e,t){return t.flatMap((t,n)=>e.includes(t)?[n]:[])}function lT(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?dT(r)?!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!0:!1}function uT(e){return e.visibility===`hidden`||e.visibility===`collapse`}function dT(e,t=e?pS(e):null){return!e||!e.isConnected||!t||uT(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var fT=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function pT(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return tS(n)?n.host:null}function mT(e){for(let t of Array.from(e.children))if(Yx(t)===`summary`)return t;return null}function hT(e,t){let n=mT(t);return!!n&&(e===n||cw(n,e))}function gT(e){let t=e?Yx(e):``;return e!=null&&e.matches(fT)&&(t!==`summary`||e.parentElement!=null&&Yx(e.parentElement)===`details`&&mT(e.parentElement)===e)&&(t!==`details`||mT(e)==null)&&(t!==`input`||e.type!==`hidden`)}function _T(e){if(!gT(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=pT(t)){let n=t!==e,r=Yx(t)===`slot`;if(t.hasAttribute(`inert`)||n&&Yx(t)===`details`&&!t.open&&!hT(e,t)||t.hasAttribute(`hidden`)||!r&&!vT(t,n))return!1}return!0}function vT(e,t){let n=pS(e);return t?n.display!==`none`:dT(e,n)}function yT(e){let t=e.tabIndex;if(t<0){let t=Yx(e);if(t===`details`||t===`audio`||t===`video`||eS(e)&&e.isContentEditable)return 0}return t}function bT(e){if(Yx(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function xT(e,t){let n=bT(e);if(!n)return!0;let r=t.find(e=>{let t=bT(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=bT(e);return t?.name===n.name&&t.form===n.form})===n}function ST(e){if(eS(e)&&Yx(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return eS(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function CT(e,t){ST(e).forEach(e=>{gT(e)&&t.push(e),CT(e,t)})}function wT(e,t,n){ST(e).forEach(e=>{eS(e)&&e.matches(t)&&n.push(e),wT(e,t,n)})}function TT(e){return _T(e)&&yT(e)>=0}function ET(e){let t=[];return CT(e,t),t.filter(_T)}function DT(e){let t=ET(e);return t.filter(e=>yT(e)>=0&&xT(e,t))}function OT(e,t){let n=DT(e),r=n.length;if(r===0)return;let i=sw(VC(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function kT(e){return OT(VC(e).body,1)||e}function AT(e){return OT(VC(e).body,-1)||e}function jT(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!cw(n,r)}function MT(e){DT(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function NT(e){let t=[];wT(e,`[data-tabindex]`,t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}var PT=[];function FT(e){b.useEffect(e,PT)}var IT=0,LT=class e{static create(){return new e}currentId=IT;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=IT,t()},e)}isStarted(){return this.currentId!==IT}clear=()=>{this.currentId!==IT&&(clearTimeout(this.currentId),this.currentId=IT)};disposeEffect=()=>this.clear};function RT(){let e=bS(LT.create).current;return FT(e.disposeEffect),e}var zT=null;globalThis.requestAnimationFrame;var BT=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||=(requestAnimationFrame(this.tick),!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||(this.callbacks[t]=null,--this.callbacksCount)}},VT=class e{static create(){return new e}static request(e){return BT.request(e)}static cancel(e){return BT.cancel(e)}currentId=zT;request(e){this.cancel(),this.currentId=BT.request(()=>{this.currentId=zT,e()})}cancel=()=>{this.currentId!==zT&&(BT.cancel(this.currentId),this.currentId=zT)};disposeEffect=()=>this.cancel};function HT(){let e=bS(VT.create).current;return FT(e.disposeEffect),e}function UT(e){return e==null?e:`current`in e?e.current:e}var WT=function(e){return e.startingStyle=`data-starting-style`,e.endingStyle=`data-ending-style`,e}({}),GT={[WT.startingStyle]:``},KT={[WT.endingStyle]:``},qT={transitionStatus(e){return e===`starting`?GT:e===`ending`?KT:null}},JT=c(g());function YT(e,t=!1,n=!0){let r=HT();return CS((i,a=null)=>{r.cancel();let o=UT(e);if(o==null)return;let s=o,c=()=>{JT.flushSync(i)};if(typeof s.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function l(){Promise.all(s.getAnimations().map(e=>e.finished)).then(()=>{a?.aborted||c()}).catch(()=>{if(n){a?.aborted||c();return}let e=s.getAnimations();!a?.aborted&&e.length>0&&e.some(e=>e.pending||e.playState!==`finished`)&&l()})}if(t){let e=WT.startingStyle;if(!s.hasAttribute(e)){r.request(l);return}let t=new MutationObserver(()=>{s.hasAttribute(e)||(t.disconnect(),l())});t.observe(s,{attributes:!0,attributeFilter:[e]}),a?.addEventListener(`abort`,()=>t.disconnect(),{once:!0});return}r.request(l)})}function XT(e){let{enabled:t=!0,open:n,ref:r,onComplete:i}=e,a=CS(i),o=YT(r,n,!1);b.useEffect(()=>{if(!t)return;let e=new AbortController;return o(a,e.signal),()=>{e.abort()}},[t,n,a,o])}function ZT(e,t=!1,n=!1){let[r,i]=b.useState(e&&t?`idle`:void 0),[a,o]=b.useState(e);return e&&!a&&(o(!0),i(`starting`)),!e&&a&&r!==`ending`&&!n&&i(`ending`),!e&&!a&&r===`ending`&&i(void 0),Q(()=>{if(!e&&a&&r!==`ending`&&n){let e=VT.request(()=>{i(`ending`)});return()=>{VT.cancel(e)}}},[e,a,r,n]),Q(()=>{if(!e||t)return;let n=VT.request(()=>{i(void 0)});return()=>{VT.cancel(n)}},[t,e]),Q(()=>{if(!e||!t)return;e&&a&&r!==`idle`&&i(`starting`);let n=VT.request(()=>{i(`idle`)});return()=>{VT.cancel(n)}},[t,e,a,r]),{mounted:a,setMounted:o,transitionStatus:r}}function QT({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=b.useRef(e!==void 0),[a,o]=b.useState(t);return[i?e:a,b.useCallback(e=>{i||o(e)},[])]}function $T(e,t){let{enabled:n=!0,getValue:r,id:i,value:a}=t,{registerFieldControl:o}=DC(),s=b.useRef(null);s.current||=Symbol(),Q(()=>{let t=s.current;if(!(!t||!n))return o(t,{controlRef:e,getValue:r,id:i,value:a}),()=>{o(t,void 0)}},[e,n,r,i,o,a])}var eE=`none`,tE=`trigger-press`,nE=`trigger-hover`,rE=`trigger-focus`,iE=`outside-press`,aE=`item-press`,oE=`close-press`,sE=`focus-out`,cE=`escape-key`,lE=`list-navigation`,uE=`cancel-open`,dE=`disabled`,fE=`imperative-action`,pE=`window-resize`;function mE(e,t,n,r){let i=!1,a=!1,o=r??cC;return{reason:e,event:t??new Event(`base-ui`),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...o}}var hE=b.forwardRef(function(e,t){let{render:n,className:r,id:i,name:a,value:o,disabled:s=!1,onValueChange:c,defaultValue:l,autoFocus:u=!1,style:d,...f}=e,{state:p,name:m,disabled:h,setTouched:g,setDirty:_,validityData:v,setFocused:y,setFilled:x,validationMode:S,validation:C}=DC(),w=h||s,T=m??a,E={...p,disabled:w},{labelId:D}=IC(),O=BC({id:i});Q(()=>{let e=o!=null;C.inputRef.current?.value||e&&o!==``?x(!0):e&&o===``&&x(!1)},[C.inputRef,x,o]);let k=b.useRef(null);Q(()=>{u&&k.current===sw(VC(k.current))&&y(!0)},[u,y]);let[A]=QT({controlled:o,default:l,name:`FieldControl`,state:`value`}),j=o!==void 0,M=j?A:void 0,N=CS(()=>C.inputRef.current?.value);return $T(C.inputRef,{id:O,value:M,getValue:N}),fC(`input`,e,{ref:[t,k],state:E,props:[{id:O,disabled:w,name:T,ref:C.inputRef,"aria-labelledby":D,autoFocus:u,...j?{value:M}:{defaultValue:l},onChange(e){let t=e.currentTarget.value;c?.(t,mE(eE,e.nativeEvent)),_(t!==v.initialValue),x(t!==``)},onFocus(){y(!0)},onBlur(e){g(!0),y(!1),S===`onBlur`&&C.commit(e.currentTarget.value)},onKeyDown(e){e.currentTarget.tagName===`INPUT`&&e.key===`Enter`&&(g(!0),C.commit(e.currentTarget.value))}},C.getInputValidationProps(),f],stateAttributesMapping:TC})}),gE=b.forwardRef(function(e,t){return(0,y.jsx)(hE,{ref:t,...e})});function _E({className:e,type:t,...n}){return(0,y.jsx)(gE,{type:t,"data-slot":`input`,className:qx(`h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-2.5 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,e),...n})}function vE({className:e,...t}){return(0,y.jsx)(`div`,{"data-slot":`input-group`,role:`group`,className:qx(`group/input-group relative flex h-9 w-full min-w-0 items-center rounded-md border border-input shadow-xs transition-[color,box-shadow] outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5`,e),...t})}var yE=Sb(`flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4`,{variants:{align:{"inline-start":`order-first pl-2 has-[>button]:-ml-1 has-[>kbd]:ml-[-0.15rem]`,"inline-end":`order-last pr-2 has-[>button]:-mr-1 has-[>kbd]:mr-[-0.15rem]`,"block-start":`order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2`,"block-end":`order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2`}},defaultVariants:{align:`inline-start`}});function bE({className:e,align:t=`inline-start`,...n}){return(0,y.jsx)(`div`,{role:`group`,"data-slot":`input-group-addon`,"data-align":t,className:qx(yE({align:t}),e),onClick:e=>{e.target.closest(`button`)||e.currentTarget.parentElement?.querySelector(`input`)?.focus()},...n})}var xE=Sb(`flex items-center gap-2 text-sm shadow-none`,{variants:{size:{xs:`h-6 gap-1 rounded-[calc(var(--radius)-5px)] px-1.5 [&>svg:not([class*='size-'])]:size-3.5`,sm:``,"icon-xs":`size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>svg]:p-0`,"icon-sm":`size-8 p-0 has-[>svg]:p-0`}},defaultVariants:{size:`xs`}});function SE({className:e,type:t=`button`,variant:n=`ghost`,size:r=`xs`,...i}){return(0,y.jsx)(bC,{type:t,"data-size":r,variant:n,className:qx(xE({size:r}),e),...i})}function CE({className:e,...t}){return(0,y.jsx)(`span`,{className:qx(`flex items-center gap-2 text-sm text-muted-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4`,e),...t})}function wE({className:e,...t}){return(0,y.jsx)(_E,{"data-slot":`input-group-control`,className:qx(`flex-1 rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 aria-invalid:ring-0 dark:bg-transparent`,e),...t})}var TE=({searchInputRef:e,searchQuery:t,searchResults:n,onSearchChange:r,onKeyDown:i,onFindNext:a,onFindPrevious:o})=>{let s=n.resultCount===0?`0/0`:`${n.resultIndex+1}/${n.resultCount}`;return(0,y.jsxs)(vE,{role:`search`,"aria-label":`find in terminal`,className:`absolute top-2 right-3 z-10 w-[min(20rem,calc(100vw-1.5rem))] border-border/60 bg-background/70 text-muted-foreground shadow-xs backdrop-blur-md dark:bg-background/70`,children:[(0,y.jsx)(wE,{ref:e,type:`search`,value:t,onChange:r,onKeyDown:i,placeholder:`Find`,"aria-label":`find query`,className:`text-xs`}),(0,y.jsxs)(bE,{align:`inline-end`,children:[(0,y.jsx)(CE,{role:`status`,"aria-label":`match count`,className:`text-xs tabular-nums`,children:s}),(0,y.jsx)(SE,{size:`icon-xs`,onClick:o,disabled:n.resultCount===0,"aria-label":`previous match`,children:(0,y.jsx)(lb,{})}),(0,y.jsx)(SE,{size:`icon-xs`,onClick:a,disabled:n.resultCount===0,"aria-label":`next match`,children:(0,y.jsx)(cb,{})})]})]})};function EE(e){let t=b.useRef(!0);t.current&&(t.current=!1,e())}function DE(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}var OE={},kE={},AE=``;function jE(e){if(typeof document>`u`)return!1;let t=VC(e);return Xx(t).innerWidth-t.documentElement.clientWidth>0}function ME(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=VC(e),n=t.documentElement,r=t.body,i=nS(n)?n:r,a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function NE(e){let t=VC(e),n=t.documentElement,r=t.body,i=nS(n)?n:r,a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function PE(e){let t=VC(e),n=t.documentElement,r=t.body,i=Xx(n),a=0,o=0,s=!1,c=VT.create();if(KC&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let t=i.getComputedStyle(n),c=i.getComputedStyle(r),l=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,OE={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},AE=n.style.scrollBehavior,kE={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let u=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,f=t.overflowY===`scroll`||c.overflowY===`scroll`,p=t.overflowX===`scroll`||c.overflowX===`scroll`,m=Math.max(0,i.innerWidth-r.clientWidth),h=Math.max(0,i.innerHeight-r.clientHeight),g=parseFloat(c.marginTop)+parseFloat(c.marginBottom),_=parseFloat(c.marginLeft)+parseFloat(c.marginRight),v=nS(n)?n:r;if(s=ME(e),s){n.style.scrollbarGutter=l,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`;return}Object.assign(n.style,{scrollbarGutter:l,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(n.style.overflowY=`scroll`),(d||p)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:g||h?`calc(100dvh - ${g+h}px)`:`100dvh`,width:_||m?`calc(100vw - ${_+m}px)`:`100vw`,boxSizing:`border-box`,overflow:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`}function u(){Object.assign(n.style,OE),Object.assign(r.style,kE),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=AE)}function d(){u(),c.request(l)}l();let f=DE(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&f()}}var FE=new class{lockCount=0;restore=null;timeoutLock=LT.create();timeoutUnlock=LT.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=VC(e).documentElement,n=Xx(t).getComputedStyle(t).overflowY;if(n===`hidden`||n===`clip`){this.restore=oC;return}let r=qC||!jE(e);this.restore=r?NE(e):PE(e)}};function IE(e=!0,t=null){Q(()=>{if(e)return FE.acquire(t)},[e,t])}function LE(e,t){return t!=null&&!ww(t)?0:typeof e==`function`?e():e}function RE(e,t,n){let r=LE(e,n);return typeof r==`number`?r:r?.[t]}function zE(e){return typeof e==`function`?e():e}function BE(e,t){return t||e===`click`||e===`mousedown`}var VE=b.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new LT,currentIdRef:{current:null},currentContextRef:{current:null}});function HE(e){let{children:t,delay:n,timeoutMs:r=0}=e,i=b.useRef(n),a=b.useRef(n),o=b.useRef(null),s=b.useRef(null),c=RT();return(0,y.jsx)(VE.Provider,{value:b.useMemo(()=>({hasProvider:!0,delayRef:i,initialDelayRef:a,currentIdRef:o,timeoutMs:r,currentContextRef:s,timeout:c}),[r,c]),children:t})}function UE(e,t={open:!1}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`floatingId`),{open:i}=t,{currentIdRef:a,delayRef:o,timeoutMs:s,initialDelayRef:c,currentContextRef:l,hasProvider:u,timeout:d}=b.useContext(VE),[f,p]=b.useState(!1);return Q(()=>{function e(){p(!1),l.current?.setIsInstantPhase(!1),a.current=null,l.current=null,o.current=c.current}if(a.current&&!i&&a.current===r){if(p(!1),s){let t=r;return d.start(s,()=>{n.select(`open`)||a.current&&a.current!==t||e()}),()=>{d.clear()}}e()}},[i,r,a,o,s,c,l,d,n]),Q(()=>{if(!i)return;let e=l.current,t=a.current;d.clear(),l.current={onOpenChange:n.setOpen,setIsInstantPhase:p},a.current=r,o.current={open:0,close:RE(c.current,`close`)},t!==null&&t!==r?(p(!0),e?.setIsInstantPhase(!0),e?.onOpenChange(!1,mE(eE))):(p(!1),e?.setIsInstantPhase(!1))},[i,r,n,a,o,s,c,l,d]),Q(()=>()=>{l.current=null},[l]),b.useMemo(()=>({hasProvider:u,delayRef:o,isInstantPhase:f}),[u,o,f])}function WE(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function GE(e){let t=bS(KE,e).current;return t.next=e,Q(t.effect),t}function KE(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var qE={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},JE={...qE,position:`fixed`,top:0,left:0},YE={...qE,position:`absolute`},XE=b.forwardRef(function(e,t){let[n,r]=b.useState();Q(()=>{JC&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,y.jsx)(`span`,{...e,ref:t,style:JE,"aria-hidden":n?void 0:!0,...i,"data-base-ui-focus-guard":``})});function ZE(e){return`data-base-ui-${e}`}var QE=0;function $E(e,t={}){let{preventScroll:n=!1,cancelPrevious:r=!0,sync:i=!1}=t;r&&cancelAnimationFrame(QE);let a=()=>e?.focus({preventScroll:n});if(i)return a(),oC;let o=requestAnimationFrame(a);return QE=o,()=>{QE===o&&(cancelAnimationFrame(o),QE=0)}}var eD={inert:new WeakMap,"aria-hidden":new WeakMap},tD=`data-base-ui-inert`,nD={inert:new WeakSet,"aria-hidden":new WeakSet},rD=new WeakMap,iD=0;function aD(e){return nD[e]}function oD(e){return e?tS(e)?e.host:oD(e.parentNode):null}var sD=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=oD(t);return e.contains(n)?n:null}).filter(e=>e!=null),cD=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},lD=(e,t,n)=>{let r=[],i=e=>{!e||n.has(e)||Array.from(e.children).forEach(e=>{Yx(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function uD(e,t,n,r,{mark:i=!0,markerIgnoreElements:a=[]}){let o=r?`inert`:n?`aria-hidden`:null,s=null,c=null,l=sD(t,e),u=i?sD(t,a):[],d=new Set(u),f=i?lD(t,cD(l),new Set(l)).filter(e=>!d.has(e)):[],p=[],m=[];if(o){let e=eD[o],n=aD(o);c=n,s=e;let r=sD(t,Array.from(t.querySelectorAll(`[aria-live]`))),i=l.concat(r);lD(t,cD(i),new Set(i)).forEach(t=>{let r=t.getAttribute(o),i=r!==null&&r!==`false`,a=(e.get(t)||0)+1;e.set(t,a),p.push(t),a===1&&i&&n.add(t),i||t.setAttribute(o,o===`inert`?``:`true`)})}return i&&f.forEach(e=>{let t=(rD.get(e)||0)+1;rD.set(e,t),m.push(e),t===1&&e.setAttribute(tD,``)}),iD+=1,()=>{s&&p.forEach(e=>{let t=(s.get(e)||0)-1;s.set(e,t),t||(!c?.has(e)&&o&&e.removeAttribute(o),c?.delete(e))}),i&&m.forEach(e=>{let t=(rD.get(e)||0)-1;rD.set(e,t),t||e.removeAttribute(tD)}),--iD,iD||(eD.inert=new WeakMap,eD[`aria-hidden`]=new WeakMap,nD.inert=new WeakSet,nD[`aria-hidden`]=new WeakSet,rD=new WeakMap)}}function dD(e,t={}){let{ariaHidden:n=!1,inert:r=!1,mark:i=!0,markerIgnoreElements:a=[]}=t,o=VC(e[0]).body;return uD(e,o,n,r,{mark:i,markerIgnoreElements:a})}var fD={style:{transition:`none`}},pD=`data-base-ui-click-trigger`,mD={fallbackAxisSide:`none`},hD={fallbackAxisSide:`end`},gD={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},_D=b.createContext(null),vD=()=>b.useContext(_D),yD=ZE(`portal`);function bD(e={}){let{ref:t,container:n,componentProps:r=cC,elementProps:i}=e,a=NC(),o=vD()?.portalNode,[s,c]=b.useState(null),[l,u]=b.useState(null),d=CS(e=>{e!==null&&u(e)}),f=b.useRef(null);Q(()=>{if(n===null){f.current&&(f.current=null,u(null),c(null));return}if(a==null)return;let e=(n&&(Qx(n)?n:n.current))??o??document.body;if(e==null){f.current&&(f.current=null,u(null),c(null));return}f.current!==e&&(f.current=e,u(null),c(e))},[n,o,a]);let p=fC(`div`,r,{ref:[t,d],props:[{id:a,[yD]:``},i]});return{portalNode:l,portalSubtree:s&&p?JT.createPortal(p,s):null}}var xD=b.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,renderGuards:o,style:s,...c}=e,{portalNode:l,portalSubtree:u}=bD({container:r,ref:t,componentProps:e,elementProps:c}),d=b.useRef(null),f=b.useRef(null),p=b.useRef(null),m=b.useRef(null),[h,g]=b.useState(null),_=b.useRef(!1),v=h?.modal,x=h?.open,S=typeof o==`boolean`?o:!!h&&!h.modal&&h.open&&!!l;b.useEffect(()=>{if(!l||v)return;function e(e){l&&e.relatedTarget&&jT(e)&&(e.type===`focusin`?_.current&&=(NT(l),!1):(MT(l),_.current=!0))}return WE(DE(l,`focusin`,e,!0),DE(l,`focusout`,e,!0))},[l,v]),b.useEffect(()=>{!l||x!==!1||(NT(l),_.current=!1)},[x,l]);let C=b.useMemo(()=>({beforeOutsideRef:d,afterOutsideRef:f,beforeInsideRef:p,afterInsideRef:m,portalNode:l,setFocusManagerState:g}),[l]);return(0,y.jsxs)(b.Fragment,{children:[u,(0,y.jsxs)(_D.Provider,{value:C,children:[S&&l&&(0,y.jsx)(XE,{"data-type":`outside`,ref:d,onFocus:e=>{jT(e,l)?p.current?.focus():AT(h?h.domReference:null)?.focus()}}),S&&l&&(0,y.jsx)(`span`,{"aria-owns":l.id,style:gD}),l&&JT.createPortal(n,l),S&&l&&(0,y.jsx)(XE,{"data-type":`outside`,ref:f,onFocus:e=>{jT(e,l)?m.current?.focus():(kT(h?h.domReference:null)?.focus(),h?.closeOnFocusOut&&h?.onOpenChange(!1,mE(`focus-out`,e.nativeEvent)))}})]})]})});function SD(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var CD=b.createContext(null),wD=b.createContext(null),TD=()=>b.useContext(CD)?.id||null,ED=e=>{let t=b.useContext(wD);return e??t};function DD(e,t){let n=Xx(lw(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||`keyboard`:`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var OD=20,kD=[];function AD(){kD=kD.filter(e=>e.deref()?.isConnected)}function jD(e){AD(),e&&Yx(e)!==`body`&&(kD.push(new WeakRef(e)),kD.length>OD&&(kD=kD.slice(-OD)))}function MD(){return AD(),kD[kD.length-1]?.deref()}function ND(e){return e?TT(e)?e:DT(e)[0]||e:null}function PD(e,t){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!t.current.includes(`floating`)&&!e.getAttribute(`role`)?.includes(`dialog`))return;let n=ET(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return TT(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),r=e.getAttribute(`tabindex`);t.current.includes(`floating`)||n.length===0?r!==`0`&&e.setAttribute(`tabindex`,`0`):(r!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function FD(e){let{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:a=!0,restoreFocus:o=!1,modal:s=!0,closeOnFocusOut:c=!0,openInteractionType:l=``,nextFocusableElement:u,previousFocusableElement:d,beforeContentFocusGuardRef:f,externalTree:p,getInsideElements:m}=e,h=`rootStore`in t?t.rootStore:t,g=h.useState(`open`),_=h.useState(`domReferenceElement`),v=h.useState(`floatingElement`),{events:x,dataRef:S}=h.context,C=CS(()=>S.current.floatingContext?.nodeId),w=i===!1,T=hw(_)&&w,E=b.useRef([`content`]),D=GE(i),O=GE(a),k=GE(l),A=ED(p),j=vD(),M=b.useRef(!1),N=b.useRef(!1),P=b.useRef(!1),F=b.useRef(null),I=b.useRef(``),L=b.useRef(``),R=b.useRef(null),z=b.useRef(null),ee=ZS(R,f,j?.beforeInsideRef),B=ZS(z,j?.afterInsideRef),V=RT(),H=RT(),te=HT(),ne=j!=null,U=_w(v),re=CS((e=U)=>e?DT(e):[]),ie=CS(()=>m?.().filter(e=>e!=null)??[]);b.useEffect(()=>{if(r||!s)return;function e(e){e.key===`Tab`&&cw(U,sw(VC(U)))&&re().length===0&&!T&&bw(e)}return DE(VC(U),`keydown`,e)},[r,_,U,s,E,T,re]),b.useEffect(()=>{if(r||!g)return;let e=VC(U);function t(){P.current=!1}function n(e){let t=lw(e),n=ie();P.current=!(cw(v,t)||cw(_,t)||cw(j?.portalNode,t)||n.some(e=>e===t||cw(e,t))),L.current=e.pointerType||`keyboard`,t?.closest(`[data-base-ui-click-trigger]`)&&(N.current=!0)}function i(){L.current=`keyboard`}return WE(DE(e,`pointerdown`,n,!0),DE(e,`pointerup`,t,!0),DE(e,`pointercancel`,t,!0),DE(e,`keydown`,i,!0))},[r,v,_,U,g,j,ie]),b.useEffect(()=>{if(r||!c)return;let e=VC(U);function t(){N.current=!0,H.start(0,()=>{N.current=!1})}function n(e){let t=lw(e);TT(t)&&(F.current=t)}function i(t){let n=t.relatedTarget,r=t.currentTarget,i=lw(t);queueMicrotask(()=>{let a=C(),c=h.context.triggerElements,l=ie(),f=n?.hasAttribute(ZE(`focus-guard`))&&[R.current,z.current,j?.beforeInsideRef.current,j?.afterInsideRef.current,j?.beforeOutsideRef.current,j?.afterOutsideRef.current,UT(d),UT(u)].includes(n),p=!(cw(_,n)||cw(v,n)||cw(n,v)||cw(j?.portalNode,n)||l.some(e=>e===n||cw(e,n))||n!=null&&c.hasElement(n)||c.hasMatchingElement(e=>cw(e,n))||f||A&&(vw(A.nodesRef.current,a).find(e=>cw(e.context?.elements.floating,n)||cw(e.context?.elements.domReference,n))||yw(A.nodesRef.current,a).find(e=>[e.context?.elements.floating,_w(e.context?.elements.floating)].includes(n)||e.context?.elements.domReference===n)));if(r===_&&U&&PD(U,E),o&&r!==_&&!dT(i)&&sw(e)===e.body){if(eS(U)&&(U.focus(),o===`popup`)){te.request(()=>{U.focus()});return}let e=re(),t=F.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||U;eS(n)&&n.focus()}if(S.current.insideReactTree){S.current.insideReactTree=!1;return}(T||!s)&&n&&p&&!N.current&&(T||n!==MD())&&(M.current=!0,h.setOpen(!1,mE(sE,t)))})}function a(){P.current||(S.current.insideReactTree=!0,V.start(0,()=>{S.current.insideReactTree=!1}))}let l=eS(_)?_:null;if(!(!v&&!l))return WE(l&&DE(l,`focusout`,i),l&&DE(l,`pointerdown`,t),v&&DE(v,`focusin`,n),v&&DE(v,`focusout`,i),v&&j&&DE(v,`focusout`,a,!0))},[r,_,v,U,s,A,j,h,c,o,re,T,C,E,S,V,H,te,u,d,ie]),b.useEffect(()=>{if(r||!v||!g)return;let e=Array.from(j?.portalNode?.querySelectorAll(`[${ZE(`portal`)}]`)||[]),t=(A?yw(A.nodesRef.current,C()):[]).find(e=>hw(e.context?.elements.domReference||null))?.context?.elements.domReference,n=dD([...[v,...e,R.current,z.current,j?.beforeOutsideRef.current,j?.afterOutsideRef.current,...ie()],t,UT(d),UT(u),T?_:null].filter(e=>e!=null),{ariaHidden:s||T,mark:!1}),i=dD([v,...e].filter(e=>e!=null));return()=>{i(),n()}},[g,r,_,v,s,E,j,T,A,C,u,d,ie]),Q(()=>{if(!g||r||!eS(U))return;let e=sw(VC(U));queueMicrotask(()=>{let t=D.current,n=typeof t==`function`?t(k.current||``):t;if(n===void 0||n===!1||cw(U,e))return;let r=null,i=()=>(r??=re(U),r[0]||U),a;a=n===!0||n===null?i():UT(n),a||=i(),$E(a,{preventScroll:a===U})})},[r,g,U,w,re,D,k]),Q(()=>{if(r||!U)return;let e=VC(U);jD(sw(e));function t(e){if(e.open||(I.current=DD(e.nativeEvent,L.current)),e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`&&(M.current=!0),e.reason===`outside-press`)if(e.nested)M.current=!1;else if(Sw(e.nativeEvent)||Cw(e.nativeEvent))M.current=!1;else{let e=!1;VC(U).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?M.current=!1:M.current=!0}}x.on(`openchange`,t);function n(){let e=O.current,t=typeof e==`function`?e(I.current):e;if(t===void 0||t===!1)return null;if(t===null&&(t=!0),typeof t==`boolean`){let e=_||MD();return e&&e.isConnected?e:null}let n=_||MD();return UT(t)||n||null}return()=>{x.off(`openchange`,t);let r=sw(e),i=ie(),a=cw(v,r)||i.some(e=>e===r||cw(e,r))||A&&vw(A.nodesRef.current,C(),!1).some(e=>cw(e.context?.elements.floating,r)),o=O.current,s=n();queueMicrotask(()=>{let t=ND(s),n=typeof o!=`boolean`;o&&!M.current&&eS(t)&&(!(!n&&t!==r&&r!==e.body)||a)&&t.focus({preventScroll:!0}),M.current=!1})}},[r,v,U,O,S,x,A,_,C,ie]),Q(()=>{if(!KC||g||!v)return;let e=sw(VC(v));!eS(e)||!pw(e)||cw(v,e)&&e.blur()},[g,v]),Q(()=>{if(!(r||!j))return j.setFocusManagerState({modal:s,closeOnFocusOut:c,open:g,onOpenChange:h.setOpen,domReference:_}),()=>{j.setFocusManagerState(null)}},[r,j,s,g,h,c,_]),Q(()=>{if(!(r||!U))return PD(U,E),()=>{queueMicrotask(AD)}},[r,U,E]);let ae=!r&&(s?!T:!0)&&(ne||s);return(0,y.jsxs)(b.Fragment,{children:[ae&&(0,y.jsx)(XE,{"data-type":`inside`,ref:ee,onFocus:e=>{if(s){let e=re();$E(e[e.length-1])}else j?.portalNode&&(M.current=!1,jT(e,j.portalNode)?kT(_)?.focus():UT(d??j.beforeOutsideRef)?.focus())}}),n,ae&&(0,y.jsx)(XE,{"data-type":`inside`,ref:B,onFocus:e=>{s?$E(re()[0]):j?.portalNode&&(c&&(M.current=!0),jT(e,j.portalNode)?AT(_)?.focus():UT(u??j.afterOutsideRef)?.focus())}})]})}function ID(e,t={}){let n=`rootStore`in e?e.rootStore:e,r=n.context.dataRef,{enabled:i=!0,event:a=`click`,toggle:o=!0,ignoreMouse:s=!1,stickIfOpen:c=!0,touchOpenDelay:l=0,reason:u=tE}=t,d=b.useRef(void 0),f=HT(),p=RT(),m=b.useMemo(()=>({onPointerDown(e){d.current=e.pointerType},onMouseDown(e){let t=d.current,i=e.nativeEvent,m=n.select(`open`);if(e.button!==0||a===`click`||ww(t,!0)&&s)return;let h=r.current.openEvent,g=h?.type,_=n.select(`domReferenceElement`)!==e.currentTarget,v=m&&_||!(m&&o&&(!(h&&c)||g===`click`||g===`mousedown`)),y=lw(i);if(pw(y)){let e=mE(u,i,y);v&&t===`touch`&&l>0?p.start(l,()=>{n.setOpen(!0,e)}):n.setOpen(v,e);return}let b=e.currentTarget;f.request(()=>{let e=mE(u,i,b);v&&t===`touch`&&l>0?p.start(l,()=>{n.setOpen(!0,e)}):n.setOpen(v,e)})},onClick(e){if(a===`mousedown-only`)return;let t=d.current;if(a===`mousedown`&&t){d.current=void 0;return}if(ww(t,!0)&&s)return;let i=n.select(`open`),f=r.current.openEvent,m=n.select(`domReferenceElement`)!==e.currentTarget,h=i&&m||!(i&&o&&(!(f&&c)||Tw(f))),g=mE(u,e.nativeEvent,e.currentTarget);h&&t===`touch`&&l>0?p.start(l,()=>{n.setOpen(!0,g)}):n.setOpen(h,g)},onKeyDown(){d.current=void 0}}),[r,a,s,n,c,o,f,p,l,u]);return b.useMemo(()=>i?{reference:m}:cC,[i,m])}function LD(e,t){let n=null,r=null,i=!1;return{contextElement:e||void 0,getBoundingClientRect(){let a=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},o=t.axis===`x`||t.axis===`both`,s=t.axis===`y`||t.axis===`both`,c=[`mouseenter`,`mousemove`].includes(t.dataRef.current.openEvent?.type||``)&&t.pointerType!==`touch`,l=a.width,u=a.height,d=a.x,f=a.y;return n==null&&t.x&&o&&(n=a.x-t.x),r==null&&t.y&&s&&(r=a.y-t.y),d-=n||0,f-=r||0,l=0,u=0,!i||c?(l=t.axis===`y`?a.width:0,u=t.axis===`x`?a.height:0,d=o&&t.x!=null?t.x:d,f=s&&t.y!=null?t.y:f):i&&!c&&(u=t.axis===`x`?a.height:u,l=t.axis===`y`?a.width:l),i=!0,{width:l,height:u,x:d,y:f,top:f,right:d+l,bottom:f+u,left:d}}}}function RD(e){return e!=null&&e.clientX!=null}function zD(e,t={}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`open`),i=n.useState(`floatingElement`),a=n.useState(`domReferenceElement`),o=n.context.dataRef,{enabled:s=!0,axis:c=`both`}=t,l=b.useRef(!1),u=b.useRef(null),[d,f]=b.useState(),[p,m]=b.useState([]),h=CS((e,t,r)=>{l.current||o.current.openEvent&&!RD(o.current.openEvent)||n.set(`positionReference`,LD(r??a,{x:e,y:t,axis:c,dataRef:o,pointerType:d}))}),g=CS(e=>{r?u.current||m([]):h(e.clientX,e.clientY,e.currentTarget)}),_=ww(d)?i:r,v=b.useCallback(()=>{if(!_||!s)return;let e=Xx(i);function t(e){cw(i,lw(e))?(u.current?.(),u.current=null):h(e.clientX,e.clientY)}if(!o.current.openEvent||RD(o.current.openEvent))return u.current=DE(e,`mousemove`,t),()=>{u.current?.(),u.current=null};n.set(`positionReference`,a)},[_,s,i,o,a,n,h]);b.useEffect(()=>v(),[v,p]),b.useEffect(()=>{s&&!i&&(l.current=!1)},[s,i]),b.useEffect(()=>{!s&&r&&(l.current=!0)},[s,r]);let y=b.useMemo(()=>{function e(e){f(e.pointerType)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:g,onMouseEnter:g}},[g]);return b.useMemo(()=>s?{reference:y,trigger:y}:{},[s,y])}var BD={intentional:`onClick`,sloppy:`onPointerDown`};function VD(){return!1}function HD(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function UD(e,t={}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`open`),i=n.useState(`floatingElement`),{dataRef:a}=n.context,{enabled:o=!0,escapeKey:s=!0,outsidePress:c=!0,outsidePressEvent:l=`sloppy`,referencePress:u=VD,referencePressEvent:d=`sloppy`,bubbles:f,externalTree:p}=t,m=ED(p),h=CS(typeof c==`function`?c:()=>!1),g=typeof c==`function`?h:c,_=g!==!1,v=CS(()=>l),y=b.useRef(!1),x=b.useRef(!1),S=b.useRef(!1),{escapeKey:C,outsidePress:w}=HD(f),T=b.useRef(null),E=RT(),D=RT(),O=CS(()=>{D.clear(),a.current.insideReactTree=!1}),k=b.useRef(!1),A=b.useRef(``),j=CS(u),M=CS(e=>{if(!r||!o||!s||e.key!==`Escape`||k.current)return;let t=a.current.floatingContext?.nodeId,i=m?vw(m.nodesRef.current,t):[];if(!C&&i.length>0){let e=!0;if(i.forEach(t=>{t.context?.open&&!t.context.dataRef.current.__escapeKeyBubbles&&(e=!1)}),!e)return}let c=mE(cE,xw(e)?e.nativeEvent:e);n.setOpen(!1,c),!C&&!c.isPropagationAllowed&&e.stopPropagation()}),N=CS(()=>{a.current.insideReactTree=!0,D.start(0,O)});b.useEffect(()=>{if(!r||!o)return;a.current.__escapeKeyBubbles=C,a.current.__outsidePressBubbles=w;let e=new LT,t=new LT;function c(){e.clear(),k.current=!0}function l(){e.start(dS()?5:0,()=>{k.current=!1})}function u(){S.current=!0,t.start(0,()=>{S.current=!1})}function d(){y.current=!1,x.current=!1}function f(){let e=A.current,t=e===`pen`||!e?`mouse`:e,n=v(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function p(e){let t=f();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function h(e){let t=a.current.floatingContext?.nodeId,r=m&&vw(m.nodesRef.current,t).some(t=>dw(e,t.context?.elements.floating));return dw(e,n.select(`floatingElement`))||dw(e,n.select(`domReferenceElement`))||r}function b(e){if(p(e)){O();return}if(a.current.insideReactTree){O();return}let r=lw(e),i=`[${ZE(`inert`)}]`,o=$x(r)?r.getRootNode():null,s=Array.from((tS(o)?o:VC(n.select(`floatingElement`))).querySelectorAll(i)),c=n.context.triggerElements;if(r&&(c.hasElement(r)||c.hasMatchingElement(e=>cw(e,r))))return;let l=$x(r)?r:null;for(;l&&!fS(l);){let e=hS(l);if(fS(e)||!$x(e))break;l=e}if(s.length&&$x(r)&&!fw(r)&&!cw(r,n.select(`floatingElement`))&&s.every(e=>!cw(l,e)))return;if(eS(r)&&!(`touches`in e)){let t=fS(r),n=pS(r),i=/auto|scroll/,a=t||i.test(n.overflowX),o=t||i.test(n.overflowY),s=a&&r.clientWidth>0&&r.scrollWidth>r.clientWidth,c=o&&r.clientHeight>0&&r.scrollHeight>r.clientHeight,l=n.direction===`rtl`,u=c&&(l?e.offsetX<=r.offsetWidth-r.clientWidth:e.offsetX>r.clientWidth),d=s&&e.offsetY>r.clientHeight;if(u||d)return}if(h(e))return;if(f()===`intentional`&&S.current){t.clear(),S.current=!1;return}if(typeof g==`function`&&!g(e))return;let u=a.current.floatingContext?.nodeId,d=m?vw(m.nodesRef.current,u):[];if(d.length>0){let e=!0;if(d.forEach(t=>{t.context?.open&&!t.context.dataRef.current.__outsidePressBubbles&&(e=!1)}),!e)return}n.setOpen(!1,mE(iE,e)),O()}function D(e){f()!==`sloppy`||e.pointerType===`touch`||!n.select(`open`)||!o||dw(e,n.select(`floatingElement`))||dw(e,n.select(`domReferenceElement`))||b(e)}function j(e){if(f()!==`sloppy`||!n.select(`open`)||!o||dw(e,n.select(`floatingElement`))||dw(e,n.select(`domReferenceElement`)))return;let t=e.touches[0];t&&(T.current={startTime:Date.now(),startX:t.clientX,startY:t.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},E.start(1e3,()=>{T.current&&(T.current.dismissOnTouchEnd=!1,T.current.dismissOnMouseDown=!1)}))}function N(e,t){let n=lw(e);if(!n)return;let r=DE(n,e.type,()=>{t(e),r()})}function P(e){A.current=`touch`,N(e,j)}function F(e){E.clear(),e.type===`pointerdown`&&(A.current=e.pointerType),!(e.type===`mousedown`&&T.current&&!T.current.dismissOnMouseDown)&&N(e,e=>{e.type===`pointerdown`?D(e):b(e)})}function I(e){if(!y.current)return;let n=x.current;if(d(),f()===`intentional`){if(e.type===`pointercancel`){n&&u();return}if(!h(e)){if(n){u();return}typeof g==`function`&&!g(e)||(t.clear(),S.current=!0,O())}}}function L(e){if(f()!==`sloppy`||!T.current||dw(e,n.select(`floatingElement`))||dw(e,n.select(`domReferenceElement`)))return;let t=e.touches[0];if(!t)return;let r=Math.abs(t.clientX-T.current.startX),i=Math.abs(t.clientY-T.current.startY),a=Math.sqrt(r*r+i*i);a>5&&(T.current.dismissOnTouchEnd=!0),a>10&&(b(e),E.clear(),T.current=null)}function R(e){N(e,L)}function z(e){f()!==`sloppy`||!T.current||dw(e,n.select(`floatingElement`))||dw(e,n.select(`domReferenceElement`))||(T.current.dismissOnTouchEnd&&b(e),E.clear(),T.current=null)}function ee(e){N(e,z)}let B=VC(i),V=WE(s&&WE(DE(B,`keydown`,M),DE(B,`compositionstart`,c),DE(B,`compositionend`,l)),_&&WE(DE(B,`click`,F,!0),DE(B,`pointerdown`,F,!0),DE(B,`pointerup`,I,!0),DE(B,`pointercancel`,I,!0),DE(B,`mousedown`,F,!0),DE(B,`mouseup`,I,!0),DE(B,`touchstart`,P,!0),DE(B,`touchmove`,R,!0),DE(B,`touchend`,ee,!0)));return()=>{V(),e.clear(),t.clear(),d(),S.current=!1}},[a,i,s,_,g,r,o,C,w,M,O,v,m,n,E]),b.useEffect(O,[g,O]);let P=b.useMemo(()=>({onKeyDown:M,[BD[d]]:e=>{j()&&n.setOpen(!1,mE(tE,e.nativeEvent))},...d!==`intentional`&&{onClick(e){j()&&n.setOpen(!1,mE(`trigger-press`,e.nativeEvent))}}}),[M,n,d,j]),F=CS(e=>{if(!r||!o||e.button!==0)return;let t=lw(e.nativeEvent);cw(n.select(`floatingElement`),t)&&(y.current||(y.current=!0,x.current=!1))}),I=CS(e=>{!r||!o||(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&y.current&&(x.current=!0)}),L=b.useMemo(()=>({onKeyDown:M,onPointerDown:I,onMouseDown:I,onClickCapture:N,onMouseDownCapture(e){N(),F(e)},onPointerDownCapture(e){N(),F(e)},onMouseUpCapture:N,onTouchEndCapture:N,onTouchMoveCapture:N}),[M,N,F,I]);return b.useMemo(()=>o?{reference:P,floating:L,trigger:P}:{},[o,P,L])}function WD(e,t,n){let{reference:r,floating:i}=e,a=zw(t),o=Bw(t),s=Rw(o),c=Fw(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(Iw(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function GD(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=Pw(t,e),p=Qw(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=$w(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=$w(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var KD=50,qD=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:GD},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=WD(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<KD&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=WD(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},JD=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=Pw(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Fw(r),_=zw(o),v=Fw(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Xw(o)]:Hw(o)),x=p!==`none`;!d&&x&&b.push(...Yw(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=Vw(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==zw(t))||T.every(e=>zw(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=zw(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function YD(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function XD(e){return Ew.some(t=>e[t]>=0)}var ZD=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=Pw(e,t);switch(i){case`referenceHidden`:{let e=YD(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:XD(e)}}}case`escaped`:{let e=YD(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:XD(e)}}}default:return{}}}}},QD=new Set([`left`,`top`]);async function $D(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Fw(n),s=Iw(n),c=zw(n)===`y`,l=QD.has(o)?-1:1,u=a&&c?-1:1,d=Pw(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var eO=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await $D(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},tO=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Pw(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=zw(Fw(i)),p=Lw(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=Nw(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=Nw(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},nO=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=Pw(e,t),u={x:n,y:r},d=zw(i),f=Lw(d),p=u[f],m=u[d],h=Pw(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=QD.has(Fw(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},rO=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=Pw(e,t),u=await o.detectOverflow(t,l),d=Fw(i),f=Iw(i),p=zw(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=Dw(h-u[g],v),x=Dw(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=Ow(u.left,0),t=Ow(u.right,0),n=Ow(u.top,0),r=Ow(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:Ow(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:Ow(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function iO(e){let t=pS(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=eS(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=kw(n)!==a||kw(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function aO(e){return $x(e)?e:e.contextElement}function oO(e){let t=aO(e);if(!eS(t))return jw(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=iO(t),o=(a?kw(n.width):n.width)/r,s=(a?kw(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var sO=jw(0);function cO(e){let t=Xx(e);return!dS()||!t.visualViewport?sO:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function lO(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Xx(e)?!1:t}function uO(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=aO(e),o=jw(1);t&&(r?$x(r)&&(o=oO(r)):o=oO(e));let s=lO(a,n,r)?cO(a):jw(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=Xx(a),t=r&&$x(r)?Xx(r):r,n=e,i=vS(n);for(;i&&r&&t!==n;){let e=oO(i),t=i.getBoundingClientRect(),r=pS(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=Xx(i),i=vS(n)}}return $w({width:u,height:d,x:c,y:l})}function dO(e,t){let n=mS(e).scrollLeft;return t?t.left+n:uO(Zx(e)).left+n}function fO(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-dO(e,n),y:n.top+t.scrollTop}}function pO(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Zx(r),s=t?iS(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=jw(1),u=jw(0),d=eS(r);if((d||!d&&!a)&&((Yx(r)!==`body`||nS(o))&&(c=mS(r)),d)){let e=uO(r);l=oO(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?fO(o,c):jw(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function mO(e){return Array.from(e.getClientRects())}function hO(e){let t=Zx(e),n=mS(e),r=e.ownerDocument.body,i=Ow(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=Ow(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+dO(e),s=-n.scrollTop;return pS(r).direction===`rtl`&&(o+=Ow(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var gO=25;function _O(e,t){let n=Xx(e),r=Zx(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=dS();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=dO(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=gO&&(a-=o)}else l<=gO&&(a+=l);return{width:a,height:o,x:s,y:c}}function vO(e,t){let n=uO(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=eS(e)?oO(e):jw(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function yO(e,t,n){let r;if(t===`viewport`)r=_O(e,n);else if(t===`document`)r=hO(Zx(e));else if($x(t))r=vO(t,n);else{let n=cO(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return $w(r)}function bO(e,t){let n=hS(e);return n===t||!$x(n)||fS(n)?!1:pS(n).position===`fixed`||bO(n,t)}function xO(e,t){let n=t.get(e);if(n)return n;let r=_S(e,[],!1).filter(e=>$x(e)&&Yx(e)!==`body`),i=null,a=pS(e).position===`fixed`,o=a?hS(e):e;for(;$x(o)&&!fS(o);){let t=pS(o),n=lS(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||nS(o)&&!n&&bO(e,o))?r=r.filter(e=>e!==o):i=t,o=hS(o)}return t.set(e,r),r}function SO(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?iS(t)?[]:xO(t,this._c):[].concat(n),r],o=yO(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=yO(t,a[e],i);s=Ow(n.top,s),c=Dw(n.right,c),l=Dw(n.bottom,l),u=Ow(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function CO(e){let{width:t,height:n}=iO(e);return{width:t,height:n}}function wO(e,t,n){let r=eS(t),i=Zx(t),a=n===`fixed`,o=uO(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=jw(0);function l(){c.x=dO(i)}if(r||!r&&!a)if((Yx(t)!==`body`||nS(i))&&(s=mS(t)),r){let e=uO(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?fO(i,s):jw(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function TO(e){return pS(e).position===`static`}function EO(e,t){if(!eS(e)||pS(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Zx(e)===n&&(n=n.ownerDocument.body),n}function DO(e,t){let n=Xx(e);if(iS(e))return n;if(!eS(e)){let t=hS(e);for(;t&&!fS(t);){if($x(t)&&!TO(t))return t;t=hS(t)}return n}let r=EO(e,t);for(;r&&rS(r)&&TO(r);)r=EO(r,t);return r&&fS(r)&&TO(r)&&!lS(r)?n:r||uS(e)||n}var OO=async function(e){let t=this.getOffsetParent||DO,n=this.getDimensions,r=await n(e.floating);return{reference:wO(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function kO(e){return pS(e).direction===`rtl`}var AO={convertOffsetParentRelativeRectToViewportRelativeRect:pO,getDocumentElement:Zx,getClippingRect:SO,getOffsetParent:DO,getElementRects:OO,getClientRects:mO,getDimensions:CO,getScale:oO,isElement:$x,isRTL:kO};function jO(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function MO(e,t){let n=null,r,i=Zx(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=Aw(d),h=Aw(i.clientWidth-(u+f)),g=Aw(i.clientHeight-(d+p)),_=Aw(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Ow(0,Dw(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!jO(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function NO(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=aO(e),u=i||a?[...l?_S(l):[],...t?_S(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?MO(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?uO(e):null;c&&g();function g(){let t=uO(e);h&&!jO(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var PO=eO,FO=tO,IO=JD,LO=rO,RO=ZD,zO=nO,BO=(e,t,n)=>{let r=new Map,i={platform:AO,...n},a={...i.platform,_c:r};return qD(e,t,{...i,platform:a})},VO=typeof document<`u`?b.useLayoutEffect:function(){};function HO(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!HO(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!HO(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function UO(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function WO(e,t){let n=UO(e);return Math.round(t*n)/n}function GO(e){let t=b.useRef(e);return VO(()=>{t.current=e}),t}function KO(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=b.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=b.useState(r);HO(f,r)||p(r);let[m,h]=b.useState(null),[g,_]=b.useState(null),v=b.useCallback(e=>{e!==C.current&&(C.current=e,h(e))},[]),y=b.useCallback(e=>{e!==w.current&&(w.current=e,_(e))},[]),x=a||m,S=o||g,C=b.useRef(null),w=b.useRef(null),T=b.useRef(u),E=c!=null,D=GO(c),O=GO(i),k=GO(l),A=b.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),BO(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!HO(T.current,t)&&(T.current=t,JT.flushSync(()=>{d(t)}))})},[f,t,n,O,k]);VO(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let j=b.useRef(!1);VO(()=>(j.current=!0,()=>{j.current=!1}),[]),VO(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,A);A()}},[x,S,A,D,E]);let M=b.useMemo(()=>({reference:C,floating:w,setReference:v,setFloating:y}),[v,y]),N=b.useMemo(()=>({reference:x,floating:S}),[x,S]),P=b.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=WO(N.floating,u.x),r=WO(N.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...UO(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,N.floating,u.x,u.y]);return b.useMemo(()=>({...u,update:A,refs:M,elements:N,floatingStyles:P}),[u,A,M,N,P])}var qO=(e,t)=>{let n=PO(e);return{name:n.name,fn:n.fn,options:[e,t]}},JO=(e,t)=>{let n=FO(e);return{name:n.name,fn:n.fn,options:[e,t]}},YO=(e,t)=>({fn:zO(e).fn,options:[e,t]}),XO=(e,t)=>{let n=IO(e);return{name:n.name,fn:n.fn,options:[e,t]}},ZO=(e,t)=>{let n=LO(e);return{name:n.name,fn:n.fn,options:[e,t]}},QO=(e,t)=>{let n=RO(e);return{name:n.name,fn:n.fn,options:[e,t]}},$=(e,t,n,r,i,a,...o)=>{if(o.length>0)throw Error(WS(1));let s;if(e&&t&&n&&r&&i&&a)s=(o,s,c,l)=>a(e(o,s,c,l),t(o,s,c,l),n(o,s,c,l),r(o,s,c,l),i(o,s,c,l),s,c,l);else if(e&&t&&n&&r&&i)s=(a,o,s,c)=>i(e(a,o,s,c),t(a,o,s,c),n(a,o,s,c),r(a,o,s,c),o,s,c);else if(e&&t&&n&&r)s=(i,a,o,s)=>r(e(i,a,o,s),t(i,a,o,s),n(i,a,o,s),a,o,s);else if(e&&t&&n)s=(r,i,a,o)=>n(e(r,i,a,o),t(r,i,a,o),i,a,o);else if(e&&t)s=(n,r,i,a)=>t(e(n,r,i,a),r,i,a);else if(e)s=e;else throw Error(`Missing arguments`);return s},$O=o((e=>{var t=f();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore})),ek=o(((e,t)=>{t.exports=$O()})),tk=o((e=>{var t=f(),n=ek();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),nk=o(((e,t)=>{t.exports=tk()})),rk=[],ik=void 0;function ak(){return ik}function ok(e){rk.push(e)}function sk(e){let t=(t,n)=>{let r=bS(lk).current,i;try{ik=r;for(let e of rk)e.before(r);i=e(t,n);for(let e of rk)e.after(r);r.didInitialize=!0}finally{ik=void 0}return i};return t.displayName=e.displayName||e.name,t}function ck(e){return b.forwardRef(sk(e))}function lk(){return{didInitialize:!1}}var uk=ek(),dk=nk(),fk=iC(19)?hk:gk;function pk(e,t,n,r,i){return fk(e,t,n,r,i)}function mk(e,t,n,r,i){let a=b.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,uk.useSyncExternalStore)(e.subscribe,a,a)}ok({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);(r.didChange||!Object.is(r.value,i))&&(t=!0,r.value=i,r.didChange=!1)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,uk.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function hk(e,t,n,r,i){let a=ak();if(!a)return mk(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],(s.store!==e||s.selector!==t||!Object.is(s.a1,n)||!Object.is(s.a2,r)||!Object.is(s.a3,i))&&(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.didChange=!0)):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i),didChange:!1},a.syncHooks.push(s)),s.value}function gk(e,t,n,r,i){return(0,dk.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var _k=class{constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return pk(this,e,t,n,r)}},vk=class extends _k{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){b.useDebugValue(e),Q(()=>{this.state[e]!==t&&this.set(e,t)},[e,t])}useSyncedValueWithCleanup(e,t){let n=this;Q(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;Q(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){b.useDebugValue(e);let n=t!==void 0;Q(()=>{n&&!Object.is(this.state[e],t)&&super.setState({...this.state,[e]:t})},[e,t,n])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return b.useDebugValue(e),pk(this,this.selectors[e],t,n,r)}useContextCallback(e,t){b.useDebugValue(e);let n=CS(t??oC);this.context[e]=n}useStateSetter(e){let t=b.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}},yk={open:$(e=>e.open),transitionStatus:$(e=>e.transitionStatus),domReferenceElement:$(e=>e.domReferenceElement),referenceElement:$(e=>e.positionReference??e.referenceElement),floatingElement:$(e=>e.floatingElement),floatingId:$(e=>e.floatingId)},bk=class extends vk{constructor(e){let{syncOnly:t,nested:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:SD(),nested:n,triggerElements:i},yk),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&Tw(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)};setOpen=(e,t)=>{if(this.syncOnly){this.context.onOpenChange?.(e,t);return}this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}};function xk(e,t){let n=b.useRef(null),r=b.useRef(null);return b.useCallback(i=>{if(e!==void 0){if(n.current!==null){let e=n.current,i=r.current,a=t.context.triggerElements.getById(e);i&&a===i&&t.context.triggerElements.delete(e),n.current=null,r.current=null}i!==null&&(n.current=e,r.current=i,t.context.triggerElements.add(e,i))}},[t,e])}function Sk(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=xk(e,n),o=CS(t=>{if(a(t),!t||!n.select(`open`))return;let i=n.select(`activeTriggerId`);if(i===e){n.update({activeTriggerElement:t,...r});return}i??n.update({activeTriggerId:e,activeTriggerElement:t,...r})});return Q(()=>{i&&n.update({activeTriggerElement:t.current,...r})},[i,n,t,...Object.values(r)]),{registerTrigger:o,isMountedByThisTrigger:i}}function Ck(e){let t=e.useState(`open`);Q(()=>{if(t&&!e.select(`activeTriggerId`)&&e.context.triggerElements.size===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[n,r]=t.value;e.update({activeTriggerId:n,activeTriggerElement:r})}}},[t,e])}function wk(e,t,n){let{mounted:r,setMounted:i,transitionStatus:a}=ZT(e);t.useSyncedValues({mounted:r,transitionStatus:a});let o=CS(()=>{i(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return XT({enabled:!t.useState(`preventUnmountingOnClose`),open:e,ref:t.context.popupRef,onComplete(){e||o()}}),{forceUnmount:o,transitionStatus:a}}var Tk=class{constructor(){this.elementsSet=new Set,this.idMap=new Map}add(e,t){let n=this.idMap.get(e);n!==t&&(n!==void 0&&this.elementsSet.delete(n),this.elementsSet.add(t),this.idMap.set(e,t))}delete(e){let t=this.idMap.get(e);t&&(this.elementsSet.delete(t),this.idMap.delete(e))}hasElement(e){return this.elementsSet.has(e)}hasMatchingElement(e){for(let t of this.elementsSet)if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.elementsSet.values()}get size(){return this.idMap.size}};function Ek(){return new bk({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new Tk,floatingId:``,syncOnly:!1,nested:!1,onOpenChange:void 0})}function Dk(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:Ek(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:cC,inactiveTriggerProps:cC,popupProps:cC}}var Ok=$(e=>e.triggerIdProp??e.activeTriggerId),kk={open:$(e=>e.openProp??e.open),mounted:$(e=>e.mounted),transitionStatus:$(e=>e.transitionStatus),floatingRootContext:$(e=>e.floatingRootContext),preventUnmountingOnClose:$(e=>e.preventUnmountingOnClose),payload:$(e=>e.payload),activeTriggerId:Ok,activeTriggerElement:$(e=>e.mounted?e.activeTriggerElement:null),isTriggerActive:$((e,t)=>t!==void 0&&Ok(e)===t),isOpenedByTrigger:$((e,t)=>t!==void 0&&Ok(e)===t&&e.open),isMountedByTrigger:$((e,t)=>t!==void 0&&Ok(e)===t&&e.mounted),triggerProps:$((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),popupProps:$(e=>e.popupProps),popupElement:$(e=>e.popupElement),positionerElement:$(e=>e.positionerElement)};function Ak(e){let{open:t=!1,onOpenChange:n,elements:r={}}=e,i=NC(),a=TD()!=null,o=bS(()=>new bk({open:t,transitionStatus:void 0,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new Tk,floatingId:i,syncOnly:!1,nested:a})).current;return Q(()=>{let e={open:t,floatingId:i};r.reference!==void 0&&(e.referenceElement=r.reference,e.domReferenceElement=$x(r.reference)?r.reference:null),r.floating!==void 0&&(e.floatingElement=r.floating),o.update(e)},[t,i,r.reference,r.floating,o]),o.context.onOpenChange=n,o.context.nested=a,o}function jk(e={}){let{nodeId:t,externalTree:n}=e,r=Ak(e),i=e.rootContext||r,a={reference:i.useState(`referenceElement`),floating:i.useState(`floatingElement`),domReference:i.useState(`domReferenceElement`)},[o,s]=b.useState(null),c=b.useRef(null),l=ED(n);Q(()=>{a.domReference&&(c.current=a.domReference)},[a.domReference]);let u=KO({...e,elements:{...a,...o&&{reference:o}}}),d=b.useCallback(e=>{let t=$x(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;s(t),u.refs.setReference(t)},[u.refs]),[f,p]=b.useState(void 0),[m,h]=b.useState(null);i.useSyncedValue(`referenceElement`,f??null);let g=$x(f)?f:null;i.useSyncedValue(`domReferenceElement`,f===void 0?a.domReference:g),i.useSyncedValue(`floatingElement`,m);let _=b.useCallback(e=>{($x(e)||e===null)&&(c.current=e,p(e)),($x(u.refs.reference.current)||u.refs.reference.current===null||e!==null&&!$x(e))&&u.refs.setReference(e)},[u.refs,p]),v=b.useCallback(e=>{h(e),u.refs.setFloating(e)},[u.refs]),y=b.useMemo(()=>({...u.refs,setReference:_,setFloating:v,setPositionReference:d,domReference:c}),[u.refs,_,v,d]),x=b.useMemo(()=>({...u.elements,domReference:a.domReference}),[u.elements,a.domReference]),S=i.useState(`open`),C=i.useState(`floatingId`),w=b.useMemo(()=>({...u,dataRef:i.context.dataRef,open:S,onOpenChange:i.setOpen,events:i.context.events,floatingId:C,refs:y,elements:x,nodeId:t,rootStore:i}),[u,y,x,t,i,S,C]);return Q(()=>{i.context.dataRef.current.floatingContext=w;let e=l?.nodesRef.current.find(e=>e.id===t);e&&(e.context=w)}),b.useMemo(()=>({...u,context:w,refs:y,elements:x,rootStore:i}),[u,y,x,w,i])}function Mk(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,onOpenChange:r}=e,i=NC(),a=TD()!=null,o=t.useState(`open`),s=t.useState(`activeTriggerElement`),c=t.useState(n?`popupElement`:`positionerElement`),l=t.context.triggerElements,u=bS(()=>new bk({open:o,transitionStatus:void 0,referenceElement:s,floatingElement:c,triggerElements:l,onOpenChange:r,floatingId:i,syncOnly:!0,nested:a})).current;return Q(()=>{let e={open:o,floatingId:i,referenceElement:s,floatingElement:c};$x(s)&&(e.domReferenceElement=s),u.state.positionReference===u.state.referenceElement&&(e.positionReference=s),u.update(e)},[o,i,s,c,u]),u.context.onOpenChange=r,u.context.nested=a,u}var Nk=XC&&JC;function Pk(e,t={}){let n=`rootStore`in e?e.rootStore:e,{events:r,dataRef:i}=n.context,{enabled:a=!0,delay:o}=t,s=b.useRef(!1),c=b.useRef(null),l=RT(),u=b.useRef(!0);b.useEffect(()=>{let e=n.select(`domReferenceElement`);if(!a)return;let t=Xx(e);function r(){let e=n.select(`domReferenceElement`);!n.select(`open`)&&eS(e)&&e===sw(VC(e))&&(s.current=!0)}function i(){u.current=!0}function o(){u.current=!1}return WE(DE(t,`blur`,r),Nk&&DE(t,`keydown`,i,!0),Nk&&DE(t,`pointerdown`,o,!0))},[n,a]),b.useEffect(()=>{if(!a)return;function e(e){if(e.reason===`trigger-press`||e.reason===`escape-key`){let e=n.select(`domReferenceElement`);$x(e)&&(c.current=e,s.current=!0)}}return r.on(`openchange`,e),()=>{r.off(`openchange`,e)}},[r,a,n]);let d=b.useMemo(()=>({onMouseLeave(){s.current=!1,c.current=null},onFocus(e){let t=e.currentTarget;if(s.current){if(c.current===t)return;s.current=!1,c.current=null}let r=lw(e.nativeEvent);if($x(r)){if(Nk&&!e.relatedTarget){if(!u.current&&!pw(r))return}else if(!gw(r))return}let i=uw(e.relatedTarget,n.context.triggerElements),{nativeEvent:a,currentTarget:d}=e,f=typeof o==`function`?o():o;if(n.select(`open`)&&i||f===0||f===void 0){n.setOpen(!0,mE(rE,a,d));return}l.start(f,()=>{s.current||n.setOpen(!0,mE(rE,a,d))})},onBlur(e){s.current=!1,c.current=null;let t=e.relatedTarget,r=e.nativeEvent,a=$x(t)&&t.hasAttribute(ZE(`focus-guard`))&&t.getAttribute(`data-type`)===`outside`;l.start(0,()=>{let e=n.select(`domReferenceElement`),o=sw(VC(e));!t&&o===e||cw(i.current.floatingContext?.refs.floating.current,o)||cw(e,o)||a||uw(t??o,n.context.triggerElements)||n.setOpen(!1,mE(rE,r))})}}),[i,n,l,o]);return b.useMemo(()=>a?{reference:d,trigger:d}:{},[a,d])}var Fk=class e{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new LT,this.restTimeout=new LT,this.handleCloseOptions=void 0}static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose},Ik=new WeakMap;function Lk(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;t&&Ik.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty(`pointer-events`),e.pointerEventsReferenceElement?.style.removeProperty(`pointer-events`),e.pointerEventsFloatingElement?.style.removeProperty(`pointer-events`),Ik.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function Rk(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=Ik.get(n);a&&a!==e&&Lk(a),Lk(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,Ik.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function zk(e){let t=bS(Fk.create).current,n=e.context.dataRef.current;return n.hoverInteractionState||=t,FT(n.hoverInteractionState.disposeEffect),n.hoverInteractionState}function Bk(e,t={}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`open`),i=n.useState(`floatingElement`),a=n.useState(`domReferenceElement`),{dataRef:o}=n.context,{enabled:s=!0,closeDelay:c=0,nodeId:l}=t,u=zk(n),d=ED(),f=TD(),p=CS(()=>BE(o.current.openEvent?.type,u.interactedInside)),m=CS(()=>{let e=o.current.openEvent?.type;return e?.includes(`mouse`)&&e!==`mousedown`}),h=CS(e=>uw(e,n.context.triggerElements)),g=b.useCallback(e=>{let t=RE(c,`close`,u.pointerType),r=()=>{n.setOpen(!1,mE(nE,e)),d?.events.emit(`floating.closed`,e)};t?u.openChangeTimeout.start(t,r):(u.openChangeTimeout.clear(),r())},[c,n,u,d]),_=CS(()=>{Lk(u)}),v=CS(e=>{let t=lw(e);if(!mw(t)){u.interactedInside=!1;return}u.interactedInside=t?.closest(`[aria-haspopup]`)!=null});Q(()=>{r||(u.pointerType=void 0,u.restTimeoutPending=!1,u.interactedInside=!1,_())},[r,u,_]),b.useEffect(()=>_,[_]),Q(()=>{if(s&&r&&u.handleCloseOptions?.blockPointerEvents&&m()&&$x(a)&&i){let e=a,t=i,n=VC(i),r=d?.nodesRef.current.find(e=>e.id===f)?.context?.elements.floating;return r&&(r.style.pointerEvents=``),Rk(u,{scopeElement:u.handleCloseOptions?.getScope?.()??u.pointerEventsScopeElement??r??e.closest(`[data-rootownerid]`)??n.body,referenceElement:e,floatingElement:t}),()=>{_()}}},[s,r,a,i,u,m,d,f,_]);let y=RT();b.useEffect(()=>{if(!s)return;function e(){u.openChangeTimeout.clear(),y.clear(),d?.events.off(`floating.closed`,r),_()}function t(e){if(d&&f&&vw(d.nodesRef.current,f).length>0){d.events.on(`floating.closed`,r);return}if(h(e.relatedTarget))return;let t=o.current.floatingContext?.nodeId??l,n=e.relatedTarget;if(!(d&&t&&$x(n)&&vw(d.nodesRef.current,t,!1).some(e=>cw(e.context?.elements.floating,n)))){if(u.handler){u.handler(e);return}_(),p()||g(e)}}function r(e){!d||!f||vw(d.nodesRef.current,f).length>0||y.start(0,()=>{d.events.off(`floating.closed`,r),n.setOpen(!1,mE(nE,e)),d.events.emit(`floating.closed`,e)})}let a=i;return WE(a&&DE(a,`mouseenter`,e),a&&DE(a,`mouseleave`,t),a&&DE(a,`pointerdown`,v,!0),()=>{d?.events.off(`floating.closed`,r)})},[s,i,n,o,l,p,h,g,_,v,u,d,f,y])}var Vk={current:null};function Hk(e,t={}){let n=`rootStore`in e?e.rootStore:e,{dataRef:r,events:i}=n.context,{enabled:a=!0,delay:o=0,handleClose:s=null,mouseOnly:c=!1,restMs:l=0,move:u=!0,triggerElementRef:d=Vk,externalTree:f,isActiveTrigger:p=!0,getHandleCloseContext:m,isClosing:h}=t,g=ED(f),_=zk(n),v=b.useRef(!1),y=GE(s),x=GE(o),S=GE(l),C=GE(a),w=GE(h);p&&(_.handleCloseOptions=y.current?.__options);let T=CS(()=>BE(r.current.openEvent?.type,_.interactedInside)),E=CS(e=>uw(e,n.context.triggerElements)),D=CS((e,t,r)=>{let i=n.context.triggerElements;if(i.hasElement(t))return!e||!cw(e,t);if(!$x(r))return!1;let a=r;return i.hasMatchingElement(e=>cw(e,a))&&(!e||!cw(e,a))}),O=CS((e,t=!0)=>{let r=RE(x.current,`close`,_.pointerType);r?_.openChangeTimeout.start(r,()=>{n.setOpen(!1,mE(nE,e)),g?.events.emit(`floating.closed`,e)}):t&&(_.openChangeTimeout.clear(),n.setOpen(!1,mE(nE,e)),g?.events.emit(`floating.closed`,e))}),k=CS(()=>{_.handler&&=(VC(n.select(`domReferenceElement`)).removeEventListener(`mousemove`,_.handler),void 0)}),A=CS(()=>{Lk(_)});return b.useEffect(()=>k,[k]),b.useEffect(()=>{if(!a)return;function e(e){e.open?v.current=!1:(v.current=e.reason===nE,k(),_.openChangeTimeout.clear(),_.restTimeout.clear(),_.blockMouseMove=!0,_.restTimeoutPending=!1)}return i.on(`openchange`,e),()=>{i.off(`openchange`,e)}},[a,i,_,k]),b.useEffect(()=>{if(!a)return;let e=d.current??(p?n.select(`domReferenceElement`):null);if(!$x(e))return;function t(e){if(_.openChangeTimeout.clear(),_.blockMouseMove=!1,c&&!ww(_.pointerType))return;let t=zE(S.current),r=RE(x.current,`open`,_.pointerType),i=lw(e),a=e.currentTarget??null,o=n.select(`domReferenceElement`),s=a;if($x(i)&&!n.context.triggerElements.hasElement(i)){for(let e of n.context.triggerElements.elements())if(cw(e,i)){s=e;break}}$x(a)&&$x(o)&&!n.context.triggerElements.hasElement(a)&&cw(a,o)&&(s=o);let l=s==null?!1:D(o,s,i),u=n.select(`open`),d=w.current?.()??n.select(`transitionStatus`)===`ending`,f=!u&&d&&v.current,p=!l&&$x(s)&&$x(o)&&cw(o,s)&&f,m=t>0&&!r,h=l&&(u||f)||p,g=!u||l;if(h){n.setOpen(!0,mE(nE,e,s));return}m||(r?_.openChangeTimeout.start(r,()=>{g&&n.setOpen(!0,mE(nE,e,s))}):g&&n.setOpen(!0,mE(nE,e,s)))}function i(e){if(T()){A();return}k();let t=VC(n.select(`domReferenceElement`));_.restTimeout.clear(),_.restTimeoutPending=!1;let i=r.current.floatingContext??m?.();if(!E(e.relatedTarget)){if(y.current&&i){n.select(`open`)||_.openChangeTimeout.clear();let r=d.current;_.handler=y.current({...i,tree:g,x:e.clientX,y:e.clientY,onClose(){A(),k(),C.current&&!T()&&r===n.select(`domReferenceElement`)&&O(e,!0)}}),t.addEventListener(`mousemove`,_.handler),_.handler(e);return}(_.pointerType!==`touch`||!cw(n.select(`floatingElement`),e.relatedTarget))&&O(e)}}return u?WE(DE(e,`mousemove`,t,{once:!0}),DE(e,`mouseenter`,t),DE(e,`mouseleave`,i)):WE(DE(e,`mouseenter`,t),DE(e,`mouseleave`,i))},[k,A,r,x,O,n,a,y,_,p,D,T,E,c,u,S,d,g,C,m,w]),b.useMemo(()=>{if(!a)return;function e(e){_.pointerType=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){let{nativeEvent:t}=e,r=e.currentTarget,i=n.select(`domReferenceElement`),a=n.select(`open`),o=D(i,r,e.target);if(c&&!ww(_.pointerType))return;if(a&&o&&_.handleCloseOptions?.blockPointerEvents){let e=n.select(`floatingElement`);e&&Rk(_,{scopeElement:_.handleCloseOptions?.getScope?.()??r.ownerDocument.body,referenceElement:r,floatingElement:e})}let s=zE(S.current);if(a&&!o||s===0||!o&&_.restTimeoutPending&&e.movementX**2+e.movementY**2<2)return;_.restTimeout.clear();function l(){if(_.restTimeoutPending=!1,T())return;let e=n.select(`open`);!_.blockMouseMove&&(!e||o)&&n.setOpen(!0,mE(nE,t,r))}_.pointerType===`touch`?JT.flushSync(()=>{l()}):o&&a?l():(_.restTimeoutPending=!0,_.restTimeout.start(s,l))}}},[a,_,T,D,c,n,S])}function Uk(e=[]){let t=e.map(e=>e?.reference),n=e.map(e=>e?.floating),r=e.map(e=>e?.item),i=e.map(e=>e?.trigger),a=b.useCallback(t=>Wk(t,e,`reference`),t),o=b.useCallback(t=>Wk(t,e,`floating`),n),s=b.useCallback(t=>Wk(t,e,`item`),r),c=b.useCallback(t=>Wk(t,e,`trigger`),i);return b.useMemo(()=>({getReferenceProps:a,getFloatingProps:o,getItemProps:s,getTriggerProps:c}),[a,o,s,c])}function Wk(e,t,n){let r=new Map,i=n===`item`,a={};n===`floating`&&(a.tabIndex=-1,a[tw]=``);for(let t in e)i&&e&&(t===`active`||t===`selected`)||(a[t]=e[t]);for(let o=0;o<t.length;o+=1){let s,c=t[o]?.[n];s=typeof c==`function`?e?c(e):null:c,s&&Gk(a,s,i,r)}return Gk(a,e,i,r),a}function Gk(e,t,n,r){for(let i in t){let a=t[i];n&&(i===`active`||i===`selected`)||(i.startsWith(`on`)?(r.has(i)||r.set(i,[]),typeof a==`function`&&(r.get(i)?.push(a),e[i]=(...e)=>r.get(i)?.map(t=>t(...e)).find(e=>e!==void 0))):e[i]=a)}}var Kk=`Escape`;function qk(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function Jk(e,t){return qk(t,e===`ArrowUp`||e===`ArrowDown`,e===`ArrowLeft`||e===`ArrowRight`)}function Yk(e,t,n){return qk(t,e===`ArrowDown`,n?e===`ArrowLeft`:e===`ArrowRight`)||e===`Enter`||e===` `||e===``}function Xk(e,t,n){return qk(t,n?e===rw:e===iw,e===ow)}function Zk(e,t,n,r){return t===`both`||t===`horizontal`&&r&&r>1?e===Kk:qk(t,n?e===iw:e===rw,e===aw)}function Qk(e,t){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`open`),i=n.useState(`floatingElement`),a=n.useState(`domReferenceElement`),o=n.context.dataRef,{listRef:s,activeIndex:c,onNavigate:l=()=>{},enabled:u=!0,selectedIndex:d=null,allowEscape:f=!1,loopFocus:p=!1,nested:m=!1,rtl:h=!1,virtual:g=!1,focusItemOnOpen:_=`auto`,focusItemOnHover:v=!0,openOnArrowKeyDown:y=!0,disabledIndices:x=void 0,orientation:S=`vertical`,parentOrientation:C,cols:w=1,id:T,resetOnPointerLeave:E=!0,externalTree:D}=t,O=GE(_w(i)),k=TD(),A=ED(D);Q(()=>{o.current.orientation=S},[o,S]);let j=hw(a),M=b.useRef(_),N=b.useRef(d??-1),P=b.useRef(null),F=b.useRef(!0),I=CS(e=>{l(N.current===-1?null:N.current,e)}),L=b.useRef(I),R=b.useRef(!!i),z=b.useRef(r),ee=b.useRef(!1),B=b.useRef(!1),V=b.useRef(null),H=GE(x),te=GE(r),ne=GE(d),U=GE(E),re=CS(()=>{function e(e){g?A?.events.emit(`virtualfocus`,e):V.current=$E(e,{sync:ee.current,preventScroll:!0})}let t=s.current[N.current],n=B.current;t&&e(t),(ee.current?e=>e():requestAnimationFrame)(()=>{let r=s.current[N.current]||t;r&&(t||e(r),oe&&(n||!F.current)&&r.scrollIntoView?.({block:`nearest`,inline:`nearest`}))})});Q(()=>{u&&(r&&i?(N.current=d??-1,M.current&&d!=null&&(B.current=!0,I())):R.current&&(N.current=-1,L.current()))},[u,r,i,d,I]),Q(()=>{if(u){if(!r){ee.current=!1;return}if(i)if(c==null){if(ee.current=!1,ne.current!=null)return;if(R.current&&(N.current=-1,re()),(!z.current||!R.current)&&M.current&&(P.current!=null||M.current===!0&&P.current==null)){let e=0,t=()=>{s.current[0]==null?(e<2&&(e?requestAnimationFrame:queueMicrotask)(t),e+=1):(N.current=P.current==null||Yk(P.current,S,h)||m?nT(s):rT(s),P.current=null,I())};t()}}else tT(s.current,c)||(N.current=c,re(),B.current=!1)}},[u,r,i,c,ne,m,s,S,h,I,re,H]),Q(()=>{if(!u||i||!A||g||!R.current)return;let e=A.nodesRef.current,t=e.find(e=>e.id===k)?.context?.elements.floating,n=sw(VC(i)),r=e.some(e=>e.context&&cw(e.context.elements.floating,n));t&&!r&&F.current&&t.focus({preventScroll:!0})},[u,i,A,k,g]),Q(()=>{L.current=I,z.current=r,R.current=!!i}),Q(()=>{r||(P.current=null,M.current=_)},[r,_]);let ie=c!=null,ae=CS(e=>{if(!te.current)return;let t=s.current.indexOf(e.currentTarget);t!==-1&&(N.current!==t||c!==t)&&(N.current=t,I(e))}),oe=b.useMemo(()=>({onFocus(e){ee.current=!0,ae(e)},onClick:({currentTarget:e})=>e.focus({preventScroll:!0}),onMouseMove(e){ee.current=!0,B.current=!1,v&&ae(e)},onPointerLeave(e){if(!te.current||!F.current||e.pointerType===`touch`)return;ee.current=!0;let t=e.relatedTarget;if(!(!v||s.current.includes(t))&&U.current&&(V.current?.(),V.current=null,N.current=-1,I(e),!g)){let e=O.current,t=sw(VC(e));e&&cw(e,t)&&e.focus({preventScroll:!0})}}}),[ae,te,O,v,s,I,U,g]),se=b.useCallback(()=>C??A?.nodesRef.current.find(e=>e.id===k)?.context?.dataRef?.current.orientation,[k,A,C]),ce=CS(e=>{if(F.current=!1,ee.current=!0,e.which===229||!te.current&&e.currentTarget===O.current)return;if(m&&Zk(e.key,S,h,w)){Jk(e.key,se())||bw(e),n.setOpen(!1,mE(lE,e.nativeEvent)),eS(a)&&(g?A?.events.emit(`virtualfocus`,a):a.focus());return}let t=N.current,i=nT(s,x),o=rT(s,x);if(j||(e.key===`Home`&&(bw(e),N.current=i,I(e)),e.key===`End`&&(bw(e),N.current=o,I(e))),w>1){let t=Array.from({length:s.current.length},()=>({width:1,height:1})),n=oT(t,w,!1),r=n.findIndex(e=>e!=null&&!lT(s.current,e,x)),a=n.reduce((e,t,n)=>t!=null&&!lT(s.current,t,x)?n:e,-1),c=n[aT(n.map(e=>e==null?null:s.current[e]),{event:e,orientation:S,loopFocus:p,rtl:h,cols:w,disabledIndices:cT([...(typeof x==`function`?null:x)||s.current.map((e,t)=>lT(s.current,t,x)?t:void 0),void 0],n),minIndex:r,maxIndex:a,prevIndex:sT(N.current>o?i:N.current,t,n,w,e.key===`ArrowDown`?`bl`:e.key===(h?`ArrowLeft`:`ArrowRight`)?`tr`:`tl`),stopEvent:!0})];if(c!=null&&(N.current=c,I(e)),S===`both`)return}if(Jk(e.key,S)){if(bw(e),r&&!g&&sw(e.currentTarget.ownerDocument)===e.currentTarget){N.current=Yk(e.key,S,h)?i:o,I(e);return}Yk(e.key,S,h)?p?t>=o?f&&t!==s.current.length?N.current=-1:(ee.current=!1,N.current=i):N.current=iT(s.current,{startingIndex:t,disabledIndices:x}):N.current=Math.min(o,iT(s.current,{startingIndex:t,disabledIndices:x})):p?t<=i?f&&t!==-1?N.current=s.current.length:(ee.current=!1,N.current=o):N.current=iT(s.current,{startingIndex:t,decrement:!0,disabledIndices:x}):N.current=Math.max(i,iT(s.current,{startingIndex:t,decrement:!0,disabledIndices:x})),tT(s.current,N.current)&&(N.current=-1),I(e)}}),le=b.useMemo(()=>g&&r&&ie&&{"aria-activedescendant":`${T}-${c}`},[g,r,ie,T,c]),ue=b.useMemo(()=>({"aria-orientation":S===`both`?void 0:S,...j?{}:le,onKeyDown(e){if(e.key===`Tab`&&e.shiftKey&&r&&!g){let t=lw(e.nativeEvent);if(t&&!cw(O.current,t))return;bw(e),n.setOpen(!1,mE(sE,e.nativeEvent)),eS(a)&&a.focus();return}ce(e)},onPointerMove(){F.current=!0}}),[le,ce,O,S,j,n,r,g,a]),de=b.useMemo(()=>{function e(e){_===`auto`&&Sw(e.nativeEvent)&&(M.current=!g)}function t(e){M.current=_,_===`auto`&&Cw(e.nativeEvent)&&(M.current=!0)}return{onKeyDown(e){let t=n.select(`open`);F.current=!1;let r=e.key.startsWith(`Arrow`),i=Xk(e.key,se(),h),a=Jk(e.key,S),o=(m?i:a)||e.key===`Enter`||e.key.trim()===``;if(g&&t)return ce(e);if(!(!t&&!y&&r)){if(o){let t=Jk(e.key,se());P.current=m&&t?null:e.key}if(m){i&&(bw(e),t?(N.current=nT(s,H.current),I(e)):n.setOpen(!0,mE(lE,e.nativeEvent,e.currentTarget)));return}a&&(ne.current!=null&&(N.current=ne.current),bw(e),!t&&y?n.setOpen(!0,mE(lE,e.nativeEvent,e.currentTarget)):ce(e),t&&I(e))}},onFocus(e){n.select(`open`)&&!g&&(N.current=-1,I(e))},onPointerDown:t,onPointerEnter:t,onMouseDown:e,onClick:e}},[ce,H,_,s,m,I,n,y,S,se,h,ne,g]),fe=b.useMemo(()=>({...le,...de}),[le,de]);return b.useMemo(()=>u?{reference:fe,floating:ue,item:oe,trigger:de}:{},[u,fe,ue,de,oe])}var $k=new Map([[`select`,`listbox`],[`combobox`,`listbox`],[`label`,!1]]);function eA(e,t={}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`open`),i=n.useState(`floatingId`),a=n.useState(`domReferenceElement`),o=n.useState(`floatingElement`),{role:s=`dialog`}=t,c=NC(),l=a?.id||c,u=b.useMemo(()=>_w(o)?.id||i,[o,i]),d=$k.get(s)??s,f=TD()!=null,p=b.useMemo(()=>d===`tooltip`||s===`label`?cC:{"aria-haspopup":d===`alertdialog`?`dialog`:d,"aria-expanded":`false`,...d===`listbox`&&{role:`combobox`},...d===`menu`&&f&&{role:`menuitem`},...s===`select`&&{"aria-autocomplete":`none`},...s===`combobox`&&{"aria-autocomplete":`list`}},[d,f,s]),m=b.useMemo(()=>d===`tooltip`||s===`label`?{[`aria-${s===`label`?`labelledby`:`describedby`}`]:r?u:void 0}:{...p,"aria-expanded":r?`true`:`false`,"aria-controls":r?u:void 0,...d===`menu`&&{id:l}},[d,u,r,l,s,p]),h=b.useMemo(()=>{let e={id:u,...d&&{role:d}};return d===`tooltip`||s===`label`?e:{...e,...d===`menu`&&{"aria-labelledby":l}}},[d,u,l,s]),g=b.useCallback(({active:e,selected:t})=>{let n={role:`option`,...e&&{id:`${u}-fui-option`}};switch(s){case`select`:case`combobox`:return{...n,"aria-selected":t};default:}return{}},[u,s]);return b.useMemo(()=>({reference:m,floating:h,item:g,trigger:p}),[m,h,p,g])}function tA(e,t){let n=`rootStore`in e?e.rootStore:e,r=n.context.dataRef,i=n.useState(`open`),{listRef:a,elementsRef:o,activeIndex:s,onMatch:c,onTypingChange:l,enabled:u=!0,resetMs:d=750,selectedIndex:f=null}=t,p=RT(),m=b.useRef(``),h=b.useRef(f??s??-1),g=b.useRef(null);Q(()=>{!i&&f!==null||(p.clear(),g.current=null,m.current!==``&&(m.current=``))},[i,f,p]),Q(()=>{i&&m.current===``&&(h.current=f??s??-1)},[i,f,s]);let _=CS(e=>{e?r.current.typing||(r.current.typing=e,l?.(e)):r.current.typing&&(r.current.typing=e,l?.(e))}),v=CS(e=>{function t(e){let t=o?.current[e];return!t||dT(t)}function n(e,n,r=0){if(e.length===0)return-1;let i=(r%e.length+e.length)%e.length,a=n.toLocaleLowerCase();for(let n=0;n<e.length;n+=1){let r=(i+n)%e.length;if(!(!e[r]?.toLocaleLowerCase().startsWith(a)||!t(r)))return r}return-1}let r=a.current;if(m.current.length>0&&e.key===` `&&(bw(e),_(!0)),m.current.length>0&&m.current[0]!==` `&&n(r,m.current)===-1&&e.key!==` `&&_(!1),r==null||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;i&&e.key!==` `&&(bw(e),_(!0));let l=m.current===``;l&&(h.current=f??s??-1),r.every(e=>e?e[0]?.toLocaleLowerCase()!==e[1]?.toLocaleLowerCase():!0)&&m.current===e.key&&(m.current=``,h.current=g.current),m.current+=e.key,p.start(d,()=>{m.current=``,h.current=g.current,_(!1)});let u=((l?f??s??-1:h.current)??0)+1,v=n(r,m.current,u);v===-1?e.key!==` `&&(m.current=``,_(!1)):(c?.(v),g.current=v)}),y=CS(e=>{let t=e.relatedTarget,r=n.select(`domReferenceElement`),i=n.select(`floatingElement`),a=cw(r,t),o=cw(i,t);a||o||(p.clear(),m.current=``,h.current=g.current,_(!1))}),x=b.useMemo(()=>({onKeyDown:v,onBlur:y}),[v,y]),S=b.useMemo(()=>({onKeyDown:v,onBlur:y}),[v,y]);return b.useMemo(()=>u?{reference:x,floating:S}:{},[u,x,S])}var nA=.1,rA=nA*nA,iA=.5;function aA(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function oA(e,t,n,r,i,a,o,s,c,l){let u=!1;return aA(e,t,n,r,i,a)&&(u=!u),aA(e,t,i,a,o,s)&&(u=!u),aA(e,t,o,s,c,l)&&(u=!u),aA(e,t,c,l,n,r)&&(u=!u),u}function sA(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function cA(e,t,n,r,i,a){return e>=Math.min(n,i)&&e<=Math.max(n,i)&&t>=Math.min(r,a)&&t<=Math.max(r,a)}function lA(e={}){let{blockPointerEvents:t=!1}=e,n=new LT,r=({x:e,y:t,placement:r,elements:i,onClose:a,nodeId:o,tree:s})=>{let c=r?.split(`-`)[0],l=!1,u=null,d=null,f=typeof performance<`u`?performance.now():0;function p(e,t){let n=performance.now(),r=n-f;if(u===null||d===null||r===0)return u=e,d=t,f=n,!1;let i=e-u,a=t-d,o=i*i+a*a,s=r*r*rA;return u=e,d=t,f=n,o<s}function m(){n.clear(),a()}return function(r){n.clear();let a=i.domReference,u=i.floating;if(!a||!u||c==null||e==null||t==null)return;let{clientX:d,clientY:f}=r,h=lw(r),g=r.type===`mouseleave`,_=cw(u,h),v=cw(a,h);if(_&&(l=!0,!g))return;if(v&&(l=!1,!g)){l=!0;return}if(g&&$x(r.relatedTarget)&&cw(u,r.relatedTarget))return;function y(){return!!(s&&vw(s.nodesRef.current,o).length>0)}function b(){y()||m()}if(y())return;let x=a.getBoundingClientRect(),S=u.getBoundingClientRect(),C=e>S.right-S.width/2,w=t>S.bottom-S.height/2,T=S.width>x.width,E=S.height>x.height,D=(T?x:S).left,O=(T?x:S).right,k=(E?x:S).top,A=(E?x:S).bottom;if(c===`top`&&t>=x.bottom-1||c===`bottom`&&t<=x.top+1||c===`left`&&e>=x.right-1||c===`right`&&e<=x.left+1){b();return}let j=!1;switch(c){case`top`:j=cA(d,f,D,x.top+1,O,S.bottom-1);break;case`bottom`:j=cA(d,f,D,S.top+1,O,x.bottom-1);break;case`left`:j=cA(d,f,S.right-1,A,x.left+1,k);break;case`right`:j=cA(d,f,x.right-1,A,S.left+1,k);break;default:}if(j)return;if(l&&!sA(d,f,x)){b();return}if(!g&&p(d,f)){b();return}let M=!1;switch(c){case`top`:{let n=T?iA/2:iA*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t+iA+1,o=C||T?S.bottom-iA:S.top,s=C?T?S.bottom-iA:S.top:S.bottom-iA;M=oA(d,f,r,a,i,a,S.left,o,S.right,s);break}case`bottom`:{let n=T?iA/2:iA*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t-iA,o=C||T?S.top+iA:S.bottom,s=C?T?S.top+iA:S.bottom:S.top+iA;M=oA(d,f,r,a,i,a,S.left,o,S.right,s);break}case`left`:{let n=E?iA/2:iA*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e+iA+1,o=w||E?S.right-iA:S.left,s=w?E?S.right-iA:S.left:S.right-iA;M=oA(d,f,o,S.top,s,S.bottom,a,r,a,i);break}case`right`:{let n=E?iA/2:iA*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e-iA,o=w||E?S.left+iA:S.right,s=w?E?S.left+iA:S.right:S.left+iA;M=oA(d,f,a,r,a,i,o,S.top,s,S.bottom);break}default:}M?l||n.start(40,b):b()}};return r.__options={...e,blockPointerEvents:t},r}function uA(e){let t=b.useRef(``),n=b.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:b.useCallback(n=>{if(n.detail===0){e(n,`keyboard`);return}`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``},[e]),onPointerDown:n}}function dA(e,t){let n=b.useRef(e),r=CS(t);Q(()=>{n.current!==e&&r(n.current)},[e,r]),Q(()=>{n.current=e},[e])}function fA(e){let[t,n]=b.useState(null),r=CS((t,r)=>{e||n(r||(qC?`touch`:``))});dA(e,t=>{t&&!e&&n(null)});let{onClick:i,onPointerDown:a}=uA(r);return b.useMemo(()=>({openMethod:t,triggerProps:{onClick:i,onPointerDown:a}}),[t,i,a])}function pA(e){let{store:t,parentContext:n,actionsRef:r,isDrawer:i}=e,a=t.useState(`open`),o=t.useState(`disablePointerDismissal`),s=t.useState(`modal`),c=t.useState(`popupElement`),{openMethod:l,triggerProps:u}=fA(a);Ck(t);let{forceUnmount:d}=wk(a,t),f=b.useCallback(()=>{t.setOpen(!1,mE(fE))},[t]);b.useImperativeHandle(r,()=>({unmount:d,close:f}),[d,f]);let p=Mk({popupStore:t,onOpenChange:t.setOpen,treatPopupAsFloatingElement:!0}),[m,h]=b.useState(0),[g,_]=b.useState(0),v=m===0,y=eA(p),x=UD(p,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?`intentional`:{mouse:s===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(e){if(!t.context.outsidePressEnabledRef.current||`button`in e&&e.button!==0||`touches`in e&&e.touches.length!==1)return!1;let n=lw(e);if(v&&!o){let e=n;return s&&(t.context.internalBackdropRef.current||t.context.backdropRef.current)?t.context.internalBackdropRef.current===e||t.context.backdropRef.current===e||cw(e,c)&&!e?.hasAttribute(`data-base-ui-portal`):!0}return!1},escapeKey:v});IE(a&&s===!0,c);let{getReferenceProps:S,getFloatingProps:C,getTriggerProps:w}=Uk([y,x]);t.useContextCallback(`onNestedDialogOpen`,(e,t)=>{h(e),_(t)}),t.useContextCallback(`onNestedDialogClose`,()=>{h(0),_(0)}),b.useEffect(()=>(n?.onNestedDialogOpen&&a&&n.onNestedDialogOpen(m+1,g+ +!!i),n?.onNestedDialogClose&&!a&&n.onNestedDialogClose(),()=>{n?.onNestedDialogClose&&a&&n.onNestedDialogClose()}),[i,a,m,g,n]);let T=b.useMemo(()=>S(u),[S,u]),E=b.useMemo(()=>w(u),[w,u]),D=b.useMemo(()=>C(),[C]);t.useSyncedValues({openMethod:l,activeTriggerProps:T,inactiveTriggerProps:E,popupProps:D,floatingRootContext:p,nestedOpenDialogCount:m,nestedOpenDrawerCount:g})}var mA=b.createContext(void 0);function hA(e){let t=b.useContext(mA);if(e===!1&&t===void 0)throw Error(WS(27));return t}var gA={...kk,modal:$(e=>e.modal),nested:$(e=>e.nested),nestedOpenDialogCount:$(e=>e.nestedOpenDialogCount),nestedOpenDrawerCount:$(e=>e.nestedOpenDrawerCount),disablePointerDismissal:$(e=>e.disablePointerDismissal),openMethod:$(e=>e.openMethod),descriptionElementId:$(e=>e.descriptionElementId),titleElementId:$(e=>e.titleElementId),viewportElement:$(e=>e.viewportElement),role:$(e=>e.role)},_A=class e extends vk{constructor(e){super(vA(e),{popupRef:b.createRef(),backdropRef:b.createRef(),internalBackdropRef:b.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:new Tk,onOpenChange:void 0,onOpenChangeComplete:void 0},gA)}setOpen=(e,t)=>{if(t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null&&(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let n={open:e},r=t.trigger?.id??null;(r||e)&&(n.activeTriggerId=r,n.activeTriggerElement=t.trigger??null),this.update(n)};static useStore(t,n){let r=bS(()=>new e(n)).current;return t??r}};function vA(e={}){return{...Dk(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:`dialog`,...e}}var yA=b.createContext(!1);function bA(e){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,disablePointerDismissal:o=!1,modal:s=!0,actionsRef:c,handle:l,triggerId:u,defaultTriggerId:d=null}=e,f=hA(!0),p=b.useContext(yA),m=!!f,h=_A.useStore(l?.store,{open:r,openProp:n,activeTriggerId:d,triggerIdProp:u,modal:s,disablePointerDismissal:o,nested:m});EE(()=>{n===void 0&&h.state.open===!1&&r===!0&&h.update({open:!0,activeTriggerId:d})}),h.useControlledProp(`openProp`,n),h.useControlledProp(`triggerIdProp`,u),h.useSyncedValues({disablePointerDismissal:o,nested:m,modal:s}),h.useContextCallback(`onOpenChange`,i),h.useContextCallback(`onOpenChangeComplete`,a);let g=h.useState(`payload`);pA({store:h,actionsRef:c,parentContext:f?.store.context,isDrawer:p,onOpenChange:i,triggerIdProp:u});let _=b.useMemo(()=>({store:h}),[h]);return(0,y.jsx)(yA.Provider,{value:!1,children:(0,y.jsx)(mA.Provider,{value:_,children:typeof t==`function`?t({payload:g}):t})})}function xA(e){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,actionsRef:o,handle:s,triggerId:c,defaultTriggerId:l=null}=e,u=hA(!0),d=!!u,f=_A.useStore(s?.store,{open:r,openProp:n,activeTriggerId:l,triggerIdProp:c,modal:!0,disablePointerDismissal:!0,nested:d,role:`alertdialog`});f.useControlledProp(`openProp`,n),f.useControlledProp(`triggerIdProp`,c),f.useSyncedValue(`nested`,d),f.useContextCallback(`onOpenChange`,i),f.useContextCallback(`onOpenChangeComplete`,a);let p=f.useState(`payload`);pA({store:f,actionsRef:o,parentContext:u?.store.context,isDrawer:!1,onOpenChange:i,triggerIdProp:c});let m=b.useMemo(()=>({store:f}),[f]);return(0,y.jsx)(yA.Provider,{value:!1,children:(0,y.jsx)(mA.Provider,{value:m,children:typeof t==`function`?t({payload:p}):t})})}var SA=function(e){return e.open=`data-open`,e.closed=`data-closed`,e[e.startingStyle=WT.startingStyle]=`startingStyle`,e[e.endingStyle=WT.endingStyle]=`endingStyle`,e.anchorHidden=`data-anchor-hidden`,e.side=`data-side`,e.align=`data-align`,e}({}),CA=function(e){return e.popupOpen=`data-popup-open`,e.pressed=`data-pressed`,e}({}),wA={[CA.popupOpen]:``},TA={[CA.popupOpen]:``,[CA.pressed]:``},EA={[SA.open]:``},DA={[SA.closed]:``},OA={[SA.anchorHidden]:``},kA={open(e){return e?wA:null}},AA={open(e){return e?TA:null}},jA={open(e){return e?EA:DA},anchorHidden(e){return e?OA:null}},MA={...jA,...qT},NA=b.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:a=!1,...o}=e,{store:s}=hA(),c=s.useState(`open`),l=s.useState(`nested`),u=s.useState(`mounted`);return fC(`div`,e,{state:{open:c,transitionStatus:s.useState(`transitionStatus`)},ref:[s.context.backdropRef,t],stateAttributesMapping:MA,props:[{role:`presentation`,hidden:!u,style:{userSelect:`none`,WebkitUserSelect:`none`}},o],enabled:a||!l})}),PA=b.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,nativeButton:a=!0,style:o,...s}=e,{store:c}=hA(),l=c.useState(`open`);function u(e){l&&c.setOpen(!1,mE(oE,e.nativeEvent))}let{getButtonProps:d,buttonRef:f}=JS({disabled:i,native:a});return fC(`button`,e,{state:{disabled:i},ref:[t,f],props:[{onClick:u},s,d]})}),FA=b.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,{store:s}=hA(),c=PC(a);return s.useSyncedValueWithCleanup(`descriptionElementId`,c),fC(`p`,e,{ref:t,props:[{id:c},o]})}),IA=function(e){return e.nestedDialogs=`--nested-dialogs`,e}({}),LA=function(e){return e[e.open=SA.open]=`open`,e[e.closed=SA.closed]=`closed`,e[e.startingStyle=SA.startingStyle]=`startingStyle`,e[e.endingStyle=SA.endingStyle]=`endingStyle`,e.nested=`data-nested`,e.nestedDialogOpen=`data-nested-dialog-open`,e}({}),RA=b.createContext(void 0);function zA(){let e=b.useContext(RA);if(e===void 0)throw Error(WS(26));return e}var BA=`ArrowUp`,VA=`ArrowDown`,HA=`ArrowLeft`,UA=`ArrowRight`,WA=`Home`,GA=new Set([HA,UA]),KA=new Set([BA,VA]),qA=new Set([...GA,...KA]);new Set([...qA,WA,`End`]);var JA=new Set([BA,VA,HA,UA,WA,`End`]),YA={...jA,...qT,nestedDialogOpen(e){return e?{[LA.nestedDialogOpen]:``}:null}},XA=b.forwardRef(function(e,t){let{className:n,finalFocus:r,initialFocus:i,render:a,style:o,...s}=e,{store:c}=hA(),l=c.useState(`descriptionElementId`),u=c.useState(`disablePointerDismissal`),d=c.useState(`floatingRootContext`),f=c.useState(`popupProps`),p=c.useState(`modal`),m=c.useState(`mounted`),h=c.useState(`nested`),g=c.useState(`nestedOpenDialogCount`),_=c.useState(`open`),v=c.useState(`openMethod`),b=c.useState(`titleElementId`),x=c.useState(`transitionStatus`),S=c.useState(`role`);zA(),XT({open:_,ref:c.context.popupRef,onComplete(){_&&c.context.onOpenChangeComplete?.(!0)}});function C(e){return e===`touch`?c.context.popupRef.current:!0}let w=i===void 0?C:i,T=fC(`div`,e,{state:{open:_,nested:h,transitionStatus:x,nestedDialogOpen:g>0},props:[f,{"aria-labelledby":b??void 0,"aria-describedby":l??void 0,role:S,tabIndex:-1,hidden:!m,onKeyDown(e){JA.has(e.key)&&e.stopPropagation()},style:{[IA.nestedDialogs]:g}},s],ref:[t,c.context.popupRef,c.useStateSetter(`popupElement`)],stateAttributesMapping:YA});return(0,y.jsx)(FD,{context:d,openInteractionType:v,disabled:!m,closeOnFocusOut:!u,initialFocus:w,returnFocus:r,modal:p!==!1,restoreFocus:`popup`,children:T})});function ZA(e){return iC(19)?e:e?`true`:void 0}var QA=b.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`}return(0,y.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})}),$A=b.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i}=hA(),a=i.useState(`mounted`),o=i.useState(`modal`),s=i.useState(`open`);return a||n?(0,y.jsx)(RA.Provider,{value:n,children:(0,y.jsxs)(xD,{ref:t,...r,children:[a&&o===!0&&(0,y.jsx)(QA,{ref:i.context.internalBackdropRef,inert:ZA(!s)}),e.children]})}):null}),ej=b.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,{store:s}=hA(),c=PC(a);return s.useSyncedValueWithCleanup(`titleElementId`,c),fC(`h2`,e,{ref:t,props:[{id:c},o]})}),tj=b.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,nativeButton:a=!0,id:o,payload:s,handle:c,style:l,...u}=e,d=hA(!0),f=c?.store??d?.store;if(!f)throw Error(WS(79));let p=PC(o),m=f.useState(`floatingRootContext`),h=f.useState(`isOpenedByTrigger`,p),g=b.useRef(null),{registerTrigger:_,isMountedByThisTrigger:v}=Sk(p,g,f,{payload:s}),{getButtonProps:y,buttonRef:x}=JS({disabled:i,native:a}),S=Uk([ID(m,{enabled:m!=null})]),C={disabled:i,open:h},w=f.useState(`triggerProps`,v);return fC(`button`,e,{state:C,ref:[x,t,_,g],props:[S.getReferenceProps(),w,{[pD]:``,id:p},u,y],stateAttributesMapping:kA})});function nj({...e}){return(0,y.jsx)(xA,{"data-slot":`alert-dialog`,...e})}function rj({...e}){return(0,y.jsx)($A,{"data-slot":`alert-dialog-portal`,...e})}function ij({className:e,...t}){return(0,y.jsx)(NA,{"data-slot":`alert-dialog-overlay`,className:qx(`fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}function aj({className:e,size:t=`default`,...n}){return(0,y.jsxs)(rj,{children:[(0,y.jsx)(ij,{}),(0,y.jsx)(XA,{"data-slot":`alert-dialog-content`,"data-size":t,className:qx(`group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 gap-6 rounded-xl bg-popover p-6 text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-lg data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...n})]})}function oj({className:e,...t}){return(0,y.jsx)(`div`,{"data-slot":`alert-dialog-header`,className:qx(`grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-6 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]`,e),...t})}function sj({className:e,...t}){return(0,y.jsx)(`div`,{"data-slot":`alert-dialog-footer`,className:qx(`flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end`,e),...t})}function cj({className:e,...t}){return(0,y.jsx)(ej,{"data-slot":`alert-dialog-title`,className:qx(`font-heading text-lg font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2`,e),...t})}function lj({className:e,...t}){return(0,y.jsx)(FA,{"data-slot":`alert-dialog-description`,className:qx(`text-sm text-balance text-muted-foreground md:text-pretty *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground`,e),...t})}function uj({className:e,...t}){return(0,y.jsx)(bC,{"data-slot":`alert-dialog-action`,className:qx(e),...t})}function dj({className:e,...t}){return(0,y.jsx)(db,{role:`status`,"aria-label":`Loading`,className:qx(`spinner-line-fade size-4`,e),...t})}var fj=({isModalOpen:e,exitInfo:t,isRetryingConnection:n,hasCopiedRestartCommand:r,newTabUrl:i,onReconnect:a,onCopyRestartCommand:o})=>(0,y.jsx)(nj,{open:e,children:(0,y.jsx)(aj,{children:t===null?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(oj,{children:[(0,y.jsxs)(cj,{className:`flex items-center gap-2`,children:[(0,y.jsx)(dj,{"aria-hidden":`true`,role:`presentation`}),`Lost connection`]}),(0,y.jsx)(lj,{children:`The localterm server isn't responding. Start it again from your terminal, then retry.`})]}),(0,y.jsxs)(vE,{children:[(0,y.jsx)(wE,{readOnly:!0,value:ad,"aria-label":`restart command`,className:`font-mono`}),(0,y.jsx)(bE,{align:`inline-end`,children:(0,y.jsx)(SE,{size:`icon-xs`,onClick:o,"aria-label":r?`Copied`:`Copy restart command`,children:r?(0,y.jsx)(sb,{}):(0,y.jsx)(ub,{})})})]}),(0,y.jsx)(sj,{children:(0,y.jsxs)(uj,{onClick:a,disabled:n,children:[n?(0,y.jsx)(dj,{"data-icon":`inline-start`}):null,`Retry`]})})]}):t.reason===`shell-exited`?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(oj,{children:[(0,y.jsx)(cj,{children:`Shell ended`}),(0,y.jsx)(lj,{children:t.exitCode===null||t.exitCode===0?`Open a new shell to keep going, or close this tab.`:`Exit code ${t.exitCode}. Open a new shell to keep going.`})]}),(0,y.jsx)(sj,{children:(0,y.jsx)(uj,{onClick:()=>window.open(i,`_blank`,`noopener,noreferrer`),children:`New shell`})})]}):(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(oj,{children:[(0,y.jsxs)(cj,{className:`flex items-center gap-2`,children:[(0,y.jsx)(dj,{"aria-hidden":`true`,role:`presentation`}),`Connection lost`]}),(0,y.jsxs)(lj,{children:[`The browser lost its connection to the localterm daemon (close code`,` `,t.closeCode,t.closeReason?` · ${t.closeReason}`:``,`). Reconnecting spawns a fresh shell. The previous one can't be reattached.`]})]}),(0,y.jsx)(sj,{children:(0,y.jsxs)(uj,{onClick:a,disabled:n,children:[n?(0,y.jsx)(dj,{"data-icon":`inline-start`}):null,`Reconnect`]})})]})})});function pj({...e}){return(0,y.jsx)(bA,{"data-slot":`dialog`,...e})}function mj({...e}){return(0,y.jsx)(tj,{"data-slot":`dialog-trigger`,...e})}function hj({...e}){return(0,y.jsx)($A,{"data-slot":`dialog-portal`,...e})}function gj({className:e,...t}){return(0,y.jsx)(NA,{"data-slot":`dialog-overlay`,className:qx(`fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}function _j({className:e,children:t,showCloseButton:n=!0,...r}){return(0,y.jsxs)(hj,{children:[(0,y.jsx)(gj,{}),(0,y.jsxs)(XA,{"data-slot":`dialog-content`,className:qx(`fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-6 rounded-xl bg-popover p-6 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-md data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...r,children:[t,n?(0,y.jsxs)(PA,{"data-slot":`dialog-close`,render:(0,y.jsx)(bC,{variant:`ghost`,className:`absolute top-4 right-4`,size:`icon-sm`}),children:[(0,y.jsx)(_b,{}),(0,y.jsx)(`span`,{className:`sr-only`,children:`Close`})]}):null]})]})}function vj({className:e,...t}){return(0,y.jsx)(`div`,{"data-slot":`dialog-header`,className:qx(`flex flex-col gap-2`,e),...t})}function yj({className:e,...t}){return(0,y.jsx)(ej,{"data-slot":`dialog-title`,className:qx(`font-heading leading-none font-medium`,e),...t})}var bj=`border border-border/60 bg-background/70 text-muted-foreground shadow-xs ring-0 backdrop-blur-md`,xj=`duration-150 ease-snappy data-closed:duration-100 data-closed:fade-out-0 data-closed:zoom-out-95 data-closed:blur-out-[5px] data-closed:slide-out-to-top-2 data-open:fade-in-0 data-open:zoom-in-95 data-open:blur-in-[5px] data-open:slide-in-from-top-2`,Sj=async()=>{if(typeof navigator>`u`||!navigator.permissions)return`unsupported`;try{return(await navigator.permissions.query({name:`local-fonts`})).state}catch{return`unsupported`}},Cj=()=>typeof window<`u`&&typeof window.queryLocalFonts==`function`,wj=async()=>{if(typeof window>`u`)return[];let e=window.queryLocalFonts;if(typeof e!=`function`)return[];try{let t=await e(),n=new Set;for(let e of t)e.family&&n.add(e.family);return[...n].sort((e,t)=>e.localeCompare(t,void 0,{sensitivity:`base`}))}catch{return[]}},Tj=`flex w-full items-center justify-between gap-2 rounded-sm px-2 py-1.5 text-left text-xs text-foreground/90 outline-none transition-colors hover:bg-foreground/10 focus-visible:bg-foreground/10`,Ej={contentVisibility:`auto`,containIntrinsicSize:`auto 28px`},Dj=`text-xs leading-snug text-muted-foreground/80`,Oj=(e,t)=>{let n=t.trim().toLowerCase();return n?e.filter(e=>e.toLowerCase().includes(n)):e},kj=({initialValue:e,onApply:t})=>{let[n,r]=(0,b.useState)(e),i=n.trim(),a=(0,b.useCallback)(()=>{i&&t(i)},[i,t]);return(0,y.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,y.jsx)(_E,{autoFocus:!0,value:n,onChange:e=>r(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),a())},placeholder:`Family name (e.g. Iosevka)`,className:`h-8 text-xs`}),(0,y.jsx)(bC,{type:`button`,size:`sm`,variant:`secondary`,disabled:!i,onClick:a,className:`h-7 text-xs`,children:`Apply`})]})},Aj=({open:e,onOpenChange:t,currentFamily:n,onApply:r})=>{let[i,a]=(0,b.useState)({kind:`loading`}),[o,s]=(0,b.useState)(``),c=(0,b.useDeferredValue)(o);(0,b.useEffect)(()=>{if(!e)return;s(``);let t=!1;return a({kind:`loading`}),(async()=>{if(!Cj()){t||a({kind:`unsupported`});return}let e=await Sj();if(!t)if(e===`granted`){let e=await wj();t||a({kind:`ready`,families:e})}else a(e===`denied`?{kind:`denied`}:{kind:`prompt`})})(),()=>{t=!0}},[e]);let l=async()=>{a({kind:`loading`});let e=await wj();if(e.length===0){a({kind:`denied`});return}a({kind:`ready`,families:e})},u=e=>{r(e),t(!1)},d=(0,b.useMemo)(()=>i.kind===`ready`?Oj(i.families,c):[],[i.kind,i.kind===`ready`?i.families:void 0,c]);return(0,y.jsx)(pj,{open:e,onOpenChange:t,children:(0,y.jsxs)(_j,{className:qx(`max-h-[calc(100dvh-2rem)] gap-2 overflow-hidden p-4 sm:max-w-sm`,bj),children:[(0,y.jsx)(vj,{className:`pr-8`,children:(0,y.jsx)(yj,{children:`Local font`})}),i.kind===`loading`?(0,y.jsx)(`p`,{className:Dj,children:`Loading…`}):i.kind===`unsupported`?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`p`,{className:Dj,children:`This browser doesn't expose installed fonts. Type a family name to use any installed font.`}),(0,y.jsx)(kj,{initialValue:n??``,onApply:u})]}):i.kind===`denied`?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`p`,{className:Dj,children:`Permission denied. Re-allow in browser site settings, or type a family name.`}),(0,y.jsx)(kj,{initialValue:n??``,onApply:u})]}):i.kind===`prompt`?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`p`,{className:Dj,children:`Allow localterm to read your installed fonts to preview them.`}),(0,y.jsx)(bC,{type:`button`,size:`sm`,variant:`secondary`,onClick:l,className:`h-7 text-xs`,children:`Allow access`}),(0,y.jsx)(`div`,{className:`my-1 border-t border-border/40`}),(0,y.jsx)(`p`,{className:Dj,children:`Or type a family name:`}),(0,y.jsx)(kj,{initialValue:n??``,onApply:u})]}):(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(`div`,{className:`relative`,children:[(0,y.jsx)(hb,{className:`pointer-events-none absolute top-1/2 left-2 size-3 -translate-y-1/2 text-muted-foreground/70`}),(0,y.jsx)(_E,{autoFocus:!0,value:o,onChange:e=>s(e.target.value),placeholder:`Search installed fonts`,className:`h-8 pl-7 text-xs`})]}),(0,y.jsx)(`div`,{className:`-mx-1 max-h-72 overflow-y-auto pr-1 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden`,children:d.length===0?(0,y.jsxs)(`p`,{className:qx(Dj,`px-2 py-2`),children:[`No fonts match "`,o,`".`]}):d.map(e=>(0,y.jsx)(`button`,{type:`button`,onClick:()=>u(e),className:qx(Tj,e===n&&`bg-foreground/5`),style:{...Ej,fontFamily:`"${Cd(e)}", ui-monospace, monospace`},children:(0,y.jsx)(`span`,{className:`truncate`,children:e})},e))}),(0,y.jsx)(`p`,{className:qx(Dj,`px-1 tabular-nums`),children:c?`${d.length} of ${i.families.length}`:`${i.families.length} fonts`})]})]})})};function jj(e){return fC(e.defaultTagName??`div`,e,e)}var Mj=b.forwardRef(function(e,t){let{className:n,render:r,orientation:i=`horizontal`,style:a,...o}=e;return fC(`div`,e,{state:{orientation:i},ref:t,props:[{role:`separator`,"aria-orientation":i},o]})});function Nj({className:e,orientation:t=`horizontal`,...n}){return(0,y.jsx)(Mj,{"data-slot":`separator`,orientation:t,className:qx(`shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch`,e),...n})}var Pj=Sb(`flex w-fit items-stretch *:focus-visible:relative *:focus-visible:z-10 has-[>[data-slot=button-group]]:gap-2 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1`,{variants:{orientation:{horizontal:`*:data-slot:rounded-r-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-r-md! [&>[data-slot]~[data-slot]]:rounded-l-none [&>[data-slot]~[data-slot]]:border-l-0`,vertical:`flex-col *:data-slot:rounded-b-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-b-md! [&>[data-slot]~[data-slot]]:rounded-t-none [&>[data-slot]~[data-slot]]:border-t-0`}},defaultVariants:{orientation:`horizontal`}});function Fj({className:e,orientation:t,...n}){return(0,y.jsx)(`div`,{role:`group`,"data-slot":`button-group`,"data-orientation":t,className:qx(Pj({orientation:t}),e),...n})}function Ij({className:e,render:t,...n}){return jj({defaultTagName:`div`,props:kS({className:qx(`flex items-center gap-2 rounded-md border bg-muted px-2.5 text-sm font-medium shadow-xs [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4`,e)},n),render:t,state:{slot:`button-group-text`}})}var Lj=e=>String(e),Rj=`size-7 rounded-none border-0 bg-transparent text-foreground hover:bg-foreground/10 hover:text-foreground disabled:opacity-30 [&_svg]:size-3.5`,zj=`h-7 min-w-[3rem] cursor-ew-resize touch-none justify-center border-y-0 border-r border-l! border-border/60 bg-transparent px-1.5 text-xs font-medium tabular-nums text-foreground select-none hover:bg-foreground/5 focus-visible:outline-none focus-visible:bg-foreground/5`,Bj={ArrowRight:1,ArrowUp:1,ArrowLeft:-1,ArrowDown:-1},Vj=({value:e,min:t,max:n,step:r,ariaLabel:i,decrementAriaLabel:a,incrementAriaLabel:o,formatDisplay:s=Lj,onValueChange:c})=>{let l=(0,b.useRef)(null),u=(0,b.useRef)(e),d=t=>{if(t.button===0){try{t.currentTarget.setPointerCapture(t.pointerId)}catch{}l.current=t.clientX,u.current=e}},f=e=>{let i=l.current;if(i===null)return;let a=e.clientX-i,o=Math.round(a/5);if(o===0)return;let s=u.current+o*r;c(Math.max(t,Math.min(n,s)))},p=e=>{if(l.current!==null){try{e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId)}catch{}l.current=null}};return(0,y.jsxs)(Fj,{"aria-label":i,className:`h-7 overflow-hidden rounded-md border border-border/60`,children:[(0,y.jsx)(bC,{variant:`ghost`,size:`icon-xs`,onClick:()=>c(e-r),disabled:e<=t,"aria-label":a,className:Rj,children:(0,y.jsx)(fb,{})}),(0,y.jsx)(Ij,{role:`slider`,tabIndex:0,"aria-label":i,"aria-valuemin":t,"aria-valuemax":n,"aria-valuenow":e,"aria-valuetext":s(e),"aria-orientation":`horizontal`,title:`Drag or use arrow keys to adjust`,className:zj,onPointerDown:d,onPointerMove:f,onPointerUp:p,onPointerCancel:p,onPointerLeave:e=>{if(l.current===null)return;let t=!1;try{t=e.currentTarget.hasPointerCapture(e.pointerId)}catch{}t||(l.current=null)},onKeyDown:i=>{if(i.key===`Home`){i.preventDefault(),c(t);return}if(i.key===`End`){i.preventDefault(),c(n);return}let a=Bj[i.key];a!==void 0&&(i.preventDefault(),c(Math.max(t,Math.min(n,e+a*r))))},children:s(e)}),(0,y.jsx)(bC,{variant:`ghost`,size:`icon-xs`,onClick:()=>c(e+r),disabled:e>=n,"aria-label":o,className:Rj,children:(0,y.jsx)(mb,{})})]})};function Hj(e){let[t,n]=b.useState({current:e,previous:null});return e!==t.current&&n({current:e,previous:t.current}),t.previous}var Uj=b.createContext(null),Wj=b.createContext(null);function Gj(){let e=b.useContext(Uj);if(e===null)throw Error(WS(60));return e}function Kj(){let e=b.useContext(Wj);if(e===null)throw Error(WS(61));return e}var qj=(e,t)=>Object.is(e,t);function Jj(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function Yj(e,t,n){return!e||e.length===0?!1:e.some(e=>e===void 0?!1:Jj(t,e,n))}function Xj(e,t,n){return!e||e.length===0?-1:e.findIndex(e=>e===void 0?!1:Jj(e,t,n))}function Zj(e,t,n){return e.filter(e=>!Jj(t,e,n))}function Qj(e){if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}function $j(e){return e!=null&&e.length>0&&typeof e[0]==`object`&&e[0]!=null&&`items`in e[0]}function eM(e){if(!Array.isArray(e))return e!=null&&`null`in e;let t=e;if($j(t)){for(let e of t)for(let t of e.items)if(t&&t.value==null&&t.label!=null)return!0;return!1}for(let e of t)if(e&&e.value==null&&e.label!=null)return!0;return!1}function tM(e,t){if(t&&e!=null)return t(e)??``;if(e&&typeof e==`object`){if(`label`in e&&e.label!=null)return String(e.label);if(`value`in e)return String(e.value)}return Qj(e)}function nM(e,t){return t&&e!=null?t(e)??``:e&&typeof e==`object`&&`value`in e&&`label`in e?Qj(e.value):Qj(e)}function rM(e,t,n){function r(){return tM(e,n)}if(n&&e!=null)return n(e);if(e&&typeof e==`object`&&`label`in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return t[e]??r();if(Array.isArray(t)){let n=t,i=$j(n)?n.flatMap(e=>e.items):n;if(typeof e!=`object`||!e){let t=i.find(t=>t.value===e);return t&&t.label!=null?t.label:r()}if(`value`in e){let t=i.find(t=>t&&t.value===e.value);if(t&&t.label!=null)return t.label}}return r()}function iM(e,t,n){return e.reduce((e,r,i)=>(i>0&&e.push(`, `),e.push((0,y.jsx)(b.Fragment,{children:rM(r,t,n)},i)),e),[])}var aM={id:$(e=>e.id),labelId:$(e=>e.labelId),modal:$(e=>e.modal),multiple:$(e=>e.multiple),items:$(e=>e.items),itemToStringLabel:$(e=>e.itemToStringLabel),itemToStringValue:$(e=>e.itemToStringValue),isItemEqualToValue:$(e=>e.isItemEqualToValue),value:$(e=>e.value),hasSelectedValue:$(e=>{let{value:t,multiple:n,itemToStringValue:r}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:nM(t,r)!==``}),hasNullItemLabel:$((e,t)=>t?eM(e.items):!1),open:$(e=>e.open),mounted:$(e=>e.mounted),forceMount:$(e=>e.forceMount),transitionStatus:$(e=>e.transitionStatus),openMethod:$(e=>e.openMethod),activeIndex:$(e=>e.activeIndex),selectedIndex:$(e=>e.selectedIndex),isActive:$((e,t)=>e.activeIndex===t),isSelected:$((e,t,n)=>{let r=e.isItemEqualToValue,i=e.value;return e.multiple?Array.isArray(i)&&i.some(e=>Jj(n,e,r)):e.selectedIndex===t&&e.selectedIndex!==null?!0:Jj(n,i,r)}),isSelectedByFocus:$((e,t)=>e.selectedIndex===t),popupProps:$(e=>e.popupProps),triggerProps:$(e=>e.triggerProps),triggerElement:$(e=>e.triggerElement),positionerElement:$(e=>e.positionerElement),listElement:$(e=>e.listElement),scrollUpArrowVisible:$(e=>e.scrollUpArrowVisible),scrollDownArrowVisible:$(e=>e.scrollDownArrowVisible),hasScrollArrows:$(e=>e.hasScrollArrows)};function oM(e,t=-(2**53-1),n=2**53-1){return Math.max(t,Math.min(e,n))}function sM(e,t){return Math.max(0,e-t)}function cM(e,t){if(t<=0)return 0;let n=oM(e,0,t),r=n,i=t-n,a=r<=1,o=i<=1;return a&&o?r<=i?0:t:a?0:o?t:n}function lM(e){let{id:t,value:n,defaultValue:r=null,onValueChange:i,open:a,defaultOpen:o=!1,onOpenChange:s,name:c,form:l,autoComplete:u,disabled:d=!1,readOnly:f=!1,required:p=!1,modal:m=!0,actionsRef:h,inputRef:g,onOpenChangeComplete:_,items:v,multiple:x=!1,itemToStringLabel:S,itemToStringValue:C,isItemEqualToValue:w=qj,highlightItemOnHover:T=!0,children:E}=e,{clearErrors:D}=kC(),{setDirty:O,setTouched:k,setFocused:A,shouldValidateOnChange:j,validityData:M,setFilled:N,name:P,disabled:F,validation:I,validationMode:L}=DC(),R=BC({id:t}),z=F||d,ee=P??c,[B,V]=QT({controlled:n,default:x?r??sC:r,name:`Select`,state:`value`}),[H,te]=QT({controlled:a,default:o,name:`Select`,state:`open`}),ne=b.useRef([]),U=b.useRef([]),re=b.useRef(null),ie=b.useRef(null),ae=b.useRef(0),oe=b.useRef(null),se=b.useRef([]),ce=b.useRef(!1),le=b.useRef(!1),ue=b.useRef(null),de=b.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}),fe=b.useRef(!1),{mounted:pe,setMounted:me,transitionStatus:he}=ZT(H),{openMethod:ge,triggerProps:_e}=fA(H),ve=bS(()=>new _k({id:R,labelId:void 0,modal:m,multiple:x,itemToStringLabel:S,itemToStringValue:C,isItemEqualToValue:w,value:B,open:H,mounted:pe,transitionStatus:he,items:v,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,ye=pk(ve,aM.activeIndex),be=pk(ve,aM.selectedIndex),xe=pk(ve,aM.triggerElement),Se=pk(ve,aM.positionerElement),Ce=Hj(ge),we=ge??Ce,Te=b.useMemo(()=>x&&Array.isArray(B)&&B.length===0?``:nM(B,C),[x,B,C]),Ee=b.useMemo(()=>x&&Array.isArray(B)?B.map(e=>nM(e,C)):nM(B,C),[x,B,C]);$T(GE(ve.state.triggerElement),{id:R,value:B,getValue:CS(()=>Ee)});let De=b.useRef(B);Q(()=>{B!==De.current&&ve.set(`forceMount`,!0)},[ve,B]),Q(()=>{N(x?Array.isArray(B)&&B.length>0:B!=null)},[x,B,N]),Q(function(){if(H)return;let e=se.current;if(x){let t=Array.isArray(B)?B:[];if(t.length===0){ve.set(`selectedIndex`,null);return}let n=t[t.length-1],r=Xj(e,n,w);ve.set(`selectedIndex`,r===-1?null:r);return}let t=Xj(e,B,w);ve.set(`selectedIndex`,t===-1?null:t)},[x,H,B,se,w,ve]),dA(B,()=>{D(ee),O(B!==M.initialValue),j()?I.commit(B):I.commit(B,!0)});let Oe=CS((e,t)=>{if(s?.(e,t),!t.isCanceled&&(te(e),!e&&(t.reason===`focus-out`||t.reason===`outside-press`)&&(k(!0),A(!1),L===`onBlur`&&I.commit(B)),!e&&ve.state.activeIndex!==null)){let e=ne.current[ve.state.activeIndex];queueMicrotask(()=>{e?.setAttribute(`tabindex`,`-1`)})}}),ke=CS(()=>{me(!1),ve.update({activeIndex:null,openMethod:null}),_?.(!1)});XT({enabled:!h,open:H,ref:re,onComplete(){H||ke()}}),b.useImperativeHandle(h,()=>({unmount:ke}),[ke]);let Ae=CS((e,t)=>{i?.(e,t),!t.isCanceled&&V(e)}),je=CS(()=>{let e=ve.state.listElement||re.current;if(!e)return;let t=sM(e.scrollHeight,e.clientHeight),n=cM(e.scrollTop,t),r=n>0,i=n<t;ve.state.scrollUpArrowVisible!==r&&ve.set(`scrollUpArrowVisible`,r),ve.state.scrollDownArrowVisible!==i&&ve.set(`scrollDownArrowVisible`,i)}),Me=Ak({open:H,onOpenChange:Oe,elements:{reference:xe,floating:Se}}),{getReferenceProps:Ne,getFloatingProps:Pe,getItemProps:Fe}=Uk([ID(Me,{enabled:!f&&!z,event:`mousedown`}),UD(Me,{bubbles:!1}),Qk(Me,{enabled:!f&&!z,listRef:ne,activeIndex:ye,selectedIndex:be,disabledIndices:sC,onNavigate(e){e===null&&!H||ve.set(`activeIndex`,e)},focusItemOnHover:T}),tA(Me,{enabled:!f&&!z&&(H||!x),listRef:U,activeIndex:ye,selectedIndex:be,onMatch(e){H?ve.set(`activeIndex`,e):Ae(se.current[e],mE(`none`))},onTypingChange(e){ce.current=e}})]),Ie=b.useMemo(()=>kS(Ne(),_e,R?{id:R}:cC),[Ne,_e,R]);EE(()=>{ve.update({popupProps:Pe(),triggerProps:Ie})}),Q(()=>{ve.update({id:R,modal:m,multiple:x,value:B,open:H,mounted:pe,transitionStatus:he,popupProps:Pe(),triggerProps:Ie,items:v,itemToStringLabel:S,itemToStringValue:C,isItemEqualToValue:w,openMethod:we})},[ve,R,m,x,B,H,pe,he,Pe,Ie,v,S,C,w,we]);let Le=b.useMemo(()=>({store:ve,name:ee,required:p,disabled:z,readOnly:f,multiple:x,highlightItemOnHover:T,setValue:Ae,setOpen:Oe,listRef:ne,popupRef:re,scrollHandlerRef:ie,handleScrollArrowVisibility:je,scrollArrowsMountedCountRef:ae,getItemProps:Fe,events:Me.context.events,valueRef:oe,valuesRef:se,labelsRef:U,typingRef:ce,selectionRef:de,selectedItemTextRef:ue,validation:I,onOpenChangeComplete:_,keyboardActiveRef:le,alignItemWithTriggerActiveRef:fe,initialValueRef:De}),[ve,ee,p,z,f,x,T,Ae,Oe,Fe,Me.context.events,I,_,je]),Re=ZS(g,I.inputRef),ze=x&&Array.isArray(B)&&B.length>0,Be=x?void 0:ee,Ve=b.useMemo(()=>!x||!Array.isArray(B)||!ee?null:B.map(e=>{let t=nM(e,C);return(0,y.jsx)(`input`,{type:`hidden`,form:l,name:ee,value:t},t)}),[x,B,l,ee,C]);return(0,y.jsx)(Uj.Provider,{value:Le,children:(0,y.jsxs)(Wj.Provider,{value:Me,children:[E,(0,y.jsx)(`input`,{...I.getInputValidationProps({onFocus(){ve.state.triggerElement?.focus({focusVisible:!0})},onChange(e){if(e.nativeEvent.defaultPrevented)return;let t=e.currentTarget.value,n=mE(eE,e.nativeEvent);function r(){if(x)return;let e=se.current.find(e=>nM(e,C).toLowerCase()===t.toLowerCase()||tM(e,S).toLowerCase()===t.toLowerCase());e!=null&&(O(e!==M.initialValue),Ae(e,n),j()&&I.commit(e))}ve.set(`forceMount`,!0),queueMicrotask(r)}}),id:R&&Be==null?`${R}-hidden-input`:void 0,form:l,name:Be,autoComplete:u,value:Te,disabled:z,required:p&&!ze,readOnly:f,ref:Re,style:ee?YE:JE,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),Ve]})})}function uM(e,t){return e??t}function dM(e){let t=e.getBoundingClientRect(),n=Xx(e),r=n.getComputedStyle(e,`::before`),i=n.getComputedStyle(e,`::after`);if(!(r.content!==`none`||i.content!==`none`))return t;let a=parseFloat(r.width)||0,o=parseFloat(r.height)||0,s=parseFloat(i.width)||0,c=parseFloat(i.height)||0,l=Math.max(t.width,a,s),u=Math.max(t.height,o,c),d=l-t.width,f=u-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-f/2,bottom:t.bottom+f/2}}var fM=2,pM=400,mM=200,hM={...AA,...TC,value:()=>null},gM=b.forwardRef(function(e,t){let{render:n,className:r,id:i,disabled:a=!1,nativeButton:o=!0,style:s,...c}=e,{setTouched:l,setFocused:u,validationMode:d,state:f,disabled:p}=DC(),{labelId:m}=IC(),{store:h,setOpen:g,selectionRef:_,validation:v,readOnly:y,required:x,alignItemWithTriggerActiveRef:S,disabled:C,keyboardActiveRef:w}=Gj(),T=p||C||a,E=pk(h,aM.open),D=pk(h,aM.value),O=pk(h,aM.triggerProps),k=pk(h,aM.positionerElement),A=pk(h,aM.listElement),j=pk(h,aM.id),M=pk(h,aM.labelId),N=pk(h,aM.hasSelectedValue),P=!N&&E,F=pk(h,aM.hasNullItemLabel,P),I=i??j,L=uM(m,M);BC({id:I});let R=GE(k),z=b.useRef(null),{getButtonProps:ee,buttonRef:B}=JS({disabled:T,native:o}),V=ZS(t,z,B,CS(e=>{h.set(`triggerElement`,e)})),H=RT(),te=RT(),ne=RT(),U=RT();b.useEffect(()=>{if(E)return N||F?U.start(mM,()=>{_.current.allowUnselectedMouseUp=!0,ne.start(mM,()=>{_.current.allowSelectedMouseUp=!0})}):ne.start(pM,()=>{_.current.allowUnselectedMouseUp=!0,_.current.allowSelectedMouseUp=!0}),()=>{ne.clear(),U.clear()};_.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1},te.clear()},[E,N,F,_,te,ne,U]);let re=b.useMemo(()=>A?.id??_w(k)?.id,[A,k]),ie=kS(O,{id:I,role:`combobox`,"aria-expanded":E?`true`:`false`,"aria-haspopup":`listbox`,"aria-controls":E?re:void 0,"aria-labelledby":L,"aria-readonly":y||void 0,"aria-required":x||void 0,tabIndex:T?-1:0,ref:V,onFocus(e){u(!0),E&&S.current&&g(!1,mE(eE,e.nativeEvent)),H.start(0,()=>{h.set(`forceMount`,!0)})},onBlur(e){cw(k,e.relatedTarget)||(l(!0),u(!1),d===`onBlur`&&v.commit(D))},onPointerMove(){w.current=!1},onKeyDown(){w.current=!0},onMouseDown(e){if(E)return;let t=VC(e.currentTarget);function n(e){if(!z.current)return;let t=e.target;if(cw(z.current,t)||cw(R.current,t)||t===z.current)return;let n=dM(z.current);e.clientX>=n.left-fM&&e.clientX<=n.right+fM&&e.clientY>=n.top-fM&&e.clientY<=n.bottom+fM||g(!1,mE(uE,e))}te.start(0,()=>{t.addEventListener(`mouseup`,n,{once:!0})})}},v.getValidationProps,c,ee);ie.role=`combobox`;let ae={...f,open:E,disabled:T,value:D,readOnly:y,placeholder:!N};return fC(`button`,e,{ref:[t,z],state:ae,stateAttributesMapping:hM,props:ie})}),_M={value:()=>null},vM=b.forwardRef(function(e,t){let{className:n,render:r,children:i,placeholder:a,style:o,...s}=e,{store:c,valueRef:l}=Gj(),u=pk(c,aM.value),d=pk(c,aM.items),f=pk(c,aM.itemToStringLabel),p=pk(c,aM.hasSelectedValue),m=!p&&a!=null&&i==null,h=pk(c,aM.hasNullItemLabel,m),g={value:u,placeholder:!p},_=null;return _=typeof i==`function`?i(u):i??(!p&&a!=null&&!h?a:Array.isArray(u)?iM(u,d,f):rM(u,d,f)),fC(`span`,e,{state:g,ref:[t,l],props:[{children:_},s],stateAttributesMapping:_M})}),yM=b.forwardRef(function(e,t){let{className:n,render:r,style:i,...a}=e,{store:o}=Gj();return fC(`span`,e,{state:{open:pk(o,aM.open)},ref:t,props:[{"aria-hidden":!0,children:`▼`},a],stateAttributesMapping:kA})}),bM=b.createContext(void 0),xM=b.forwardRef(function(e,t){let{store:n}=Gj(),r=pk(n,aM.mounted),i=pk(n,aM.forceMount);return r||i?(0,y.jsx)(bM.Provider,{value:!0,children:(0,y.jsx)(xD,{ref:t,...e})}):null}),SM=b.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function CM(){return b.useContext(SM)}function wM(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=CS(i),o=b.useRef(0),s=bS(EM).current,c=bS(TM).current,[l,u]=b.useState(0),d=b.useRef(l),f=CS((e,t)=>{c.set(e,t??null),d.current+=1,u(d.current)}),p=CS(e=>{c.delete(e),d.current+=1,u(d.current)}),m=b.useMemo(()=>{let e=new Map;return Array.from(c.keys()).filter(e=>e.isConnected).sort(DM).forEach((t,n)=>{let r=c.get(t)??{};e.set(t,{...r,index:n})}),e},[c,l]);Q(()=>{if(typeof MutationObserver!=`function`||m.size===0)return;let e=new MutationObserver(e=>{let t=new Set,n=e=>t.has(e)?t.delete(e):t.add(e);e.forEach(e=>{e.removedNodes.forEach(n),e.addedNodes.forEach(n)}),t.size===0&&(d.current+=1,u(d.current))});return m.forEach((t,n)=>{n.parentElement&&e.observe(n.parentElement,{childList:!0})}),()=>{e.disconnect()}},[m]),Q(()=>{d.current===l&&(n.current.length!==m.size&&(n.current.length=m.size),r&&r.current.length!==m.size&&(r.current.length=m.size),o.current=m.size),a(m)},[a,m,n,r,l]),Q(()=>()=>{n.current=[]},[n]),Q(()=>()=>{r&&(r.current=[])},[r]);let h=CS(e=>(s.add(e),()=>{s.delete(e)}));Q(()=>{s.forEach(e=>e(m))},[s,m]);let g=b.useMemo(()=>({register:f,unregister:p,subscribeMapChange:h,elementsRef:n,labelsRef:r,nextIndexRef:o}),[f,p,h,n,r,o]);return(0,y.jsx)(SM.Provider,{value:g,children:t})}function TM(){return new Map}function EM(){return new Set}function DM(e,t){let n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}var OM=b.createContext(void 0);function kM(){return b.useContext(OM)?.direction??`ltr`}var AM=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0,offsetParent:d=`real`}=Pw(e,t)||{};if(l==null)return{};let f=Qw(u),p={x:n,y:r},m=Bw(i),h=Rw(m),g=await o.getDimensions(l),_=m===`y`,v=_?`top`:`left`,y=_?`bottom`:`right`,b=_?`clientHeight`:`clientWidth`,x=a.reference[h]+a.reference[m]-p[m]-a.floating[h],S=p[m]-a.reference[m],C=d===`real`?await o.getOffsetParent?.(l):s.floating,w=s.floating[b]||a.floating[h];(!w||!await o.isElement?.(C))&&(w=s.floating[b]||a.floating[h]);let T=x/2-S/2,E=w/2-g[h]/2-1,D=Math.min(f[v],E),O=Math.min(f[y],E),k=D,A=w-g[h]-O,j=w/2-g[h]/2+T,M=Nw(k,j,A),N=!c.arrow&&Iw(i)!=null&&j!==M&&a.reference[h]/2-(j<k?D:O)-g[h]/2<0,P=N?j<k?j-k:j-A:0;return{[m]:p[m]+P,data:{[m]:M,centerOffset:j-M-P,...N&&{alignmentOffset:P}},reset:N}}}),jM=(e,t)=>({...AM(e),options:[e,t]}),MM={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0;return{data:{referenceHidden:(await QO().fn(e)).data?.referenceHidden||a}}}},NM={sideX:`left`,sideY:`top`},PM={name:`adaptiveOrigin`,async fn(e){let{x:t,y:n,rects:{floating:r},elements:{floating:i},platform:a,strategy:o,placement:s}=e,c=Xx(i),l=c.getComputedStyle(i);if(!(l.transitionDuration!==`0s`&&l.transitionDuration!==``))return{x:t,y:n,data:NM};let u=await a.getOffsetParent?.(i),d={width:0,height:0};if(o===`fixed`&&c?.visualViewport)d={width:c.visualViewport.width,height:c.visualViewport.height};else if(u===c){let e=VC(i);d={width:e.documentElement.clientWidth,height:e.documentElement.clientHeight}}else await a.isElement?.(u)&&(d=await a.getDimensions(u));let f=Fw(s),p=t,m=n;f===`left`&&(p=d.width-(t+r.width)),f===`top`&&(m=d.height-(n+r.height));let h=f===`left`?`right`:NM.sideX,g=f===`top`?`bottom`:NM.sideY;return{x:p,y:m,data:{sideX:h,sideY:g}}}};function FM(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function IM(e,t,n){let{rects:r,placement:i}=e;return{side:FM(t,Fw(i),n),align:Iw(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function LM(e){let{anchor:t,positionMethod:n=`absolute`,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,collisionBoundary:s,collisionPadding:c=5,sticky:l=!1,arrowPadding:u=5,disableAnchorTracking:d=!1,keepMounted:f=!1,floatingRootContext:p,mounted:m,collisionAvoidance:h,shiftCrossAxis:g=!1,nodeId:_,adaptiveOrigin:v,lazyFlip:y=!1,externalTree:x}=e,[S,C]=b.useState(null);!m&&S!==null&&C(null);let w=h.side||`flip`,T=h.align||`flip`,E=h.fallbackAxisSide||`end`,D=typeof t==`function`?t:void 0,O=CS(D),k=D?O:t,A=GE(t),j=GE(m),M=kM()===`rtl`,N=S||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":M?`left`:`right`,"inline-start":M?`right`:`left`}[r],P=a===`center`?N:`${N}-${a}`,F=c,I=+(r===`bottom`),L=+(r===`top`),R=+(r===`right`),z=+(r===`left`);typeof F==`number`?F={top:F+I,right:F+z,bottom:F+L,left:F+R}:F&&={top:(F.top||0)+I,right:(F.right||0)+z,bottom:(F.bottom||0)+L,left:(F.left||0)+R};let ee={boundary:s===`clipping-ancestors`?`clippingAncestors`:s,padding:F},B=b.useRef(null),V=GE(i),H=GE(o),te=[qO(e=>{let t=IM(e,r,M),n=typeof V.current==`function`?V.current(t):V.current,i=typeof H.current==`function`?H.current(t):H.current;return{mainAxis:n,crossAxis:i,alignmentAxis:i}},[typeof i==`function`?0:i,typeof o==`function`?0:o,M,r])],ne=T===`none`&&w!==`shift`,U=!ne&&(l||g||w===`shift`),re=w===`none`?null:XO({...ee,padding:{top:F.top+1,right:F.right+1,bottom:F.bottom+1,left:F.left+1},mainAxis:!g&&w===`flip`,crossAxis:T===`flip`?`alignment`:!1,fallbackAxisSideDirection:E}),ie=ne?null:JO(e=>{let t=VC(e.elements.floating).documentElement;return{...ee,rootBoundary:g?{x:0,y:0,width:t.clientWidth,height:t.clientHeight}:void 0,mainAxis:T!==`none`,crossAxis:U,limiter:l||g?void 0:YO(e=>{if(!B.current)return{};let{width:t,height:n}=B.current.getBoundingClientRect(),r=zw(Fw(e.placement)),i=r===`y`?t:n,a=r===`y`?F.left+F.right:F.top+F.bottom;return{offset:i/2+a/2}})}},[ee,l,g,F,T]);w===`shift`||T===`shift`||a===`center`?te.push(ie,re):te.push(re,ie),te.push(ZO({...ee,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!j.current)return;let i=e.style;i.setProperty(`--available-width`,`${t}px`),i.setProperty(`--available-height`,`${n}px`);let a=Xx(e).devicePixelRatio||1,{x:o,y:s,width:c,height:l}=r.reference,u=(Math.round((o+c)*a)-Math.round(o*a))/a,d=(Math.round((s+l)*a)-Math.round(s*a))/a;i.setProperty(`--anchor-width`,`${u}px`),i.setProperty(`--anchor-height`,`${d}px`)}}),jM(()=>({element:B.current||VC(B.current).createElement(`div`),padding:u,offsetParent:`floating`}),[u]),{name:`transformOrigin`,fn(e){let{elements:t,middlewareData:n,placement:a,rects:o,y:s}=e,c=Fw(a),l=zw(c),u=B.current,d=n.arrow?.x||0,f=n.arrow?.y||0,p=u?.clientWidth||0,m=u?.clientHeight||0,h=d+p/2,g=f+m/2,_=Math.abs(n.shift?.y||0),v=o.reference.height/2,y=typeof i==`function`?i(IM(e,r,M)):i,b=_>y,x={top:`${h}px calc(100% + ${y}px)`,bottom:`${h}px ${-y}px`,left:`calc(100% + ${y}px) ${g}px`,right:`${-y}px ${g}px`}[c],S=`${h}px ${o.reference.y+v-s}px`;return t.floating.style.setProperty(`--transform-origin`,U&&l===`y`&&b?S:x),{}}},MM,v),Q(()=>{!m&&p&&p.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[m,p]);let ae=b.useMemo(()=>({elementResize:!d&&typeof ResizeObserver<`u`,layoutShift:!d&&typeof IntersectionObserver<`u`}),[d]),{refs:oe,elements:se,x:ce,y:le,middlewareData:ue,update:de,placement:fe,context:pe,isPositioned:me,floatingStyles:he}=jk({rootContext:p,open:f?m:void 0,placement:P,middleware:te,strategy:n,whileElementsMounted:f?void 0:(...e)=>NO(...e,ae),nodeId:_,externalTree:x}),{sideX:ge,sideY:_e}=ue.adaptiveOrigin||NM,ve=me?n:`fixed`,ye=b.useMemo(()=>{let e=v?{position:ve,[ge]:ce,[_e]:le}:{position:ve,...he};return me||(e.opacity=0),e},[v,ve,ge,ce,_e,le,he,me]),be=b.useRef(null);Q(()=>{if(!m)return;let e=A.current,t=typeof e==`function`?e():e,n=(RM(t)?t.current:t)||null;n!==be.current&&(oe.setPositionReference(n),be.current=n)},[m,oe,k,A]),b.useEffect(()=>{if(!m)return;let e=A.current;typeof e!=`function`&&RM(e)&&e.current!==be.current&&(oe.setPositionReference(e.current),be.current=e.current)},[m,oe,k,A]),b.useEffect(()=>{if(f&&m&&se.domReference&&se.floating)return NO(se.domReference,se.floating,de,ae)},[f,m,se,de,ae]);let xe=Fw(fe),Se=FM(r,xe,M),Ce=Iw(fe)||`center`,we=!!ue.hide?.referenceHidden;Q(()=>{y&&m&&me&&C(xe)},[y,m,me,xe]);let Te=b.useMemo(()=>({position:`absolute`,top:ue.arrow?.y,left:ue.arrow?.x}),[ue.arrow]),Ee=ue.arrow?.centerOffset!==0;return b.useMemo(()=>({positionerStyles:ye,arrowStyles:Te,arrowRef:B,arrowUncentered:Ee,side:Se,align:Ce,physicalSide:xe,anchorHidden:we,refs:oe,context:pe,isPositioned:me,update:de}),[ye,Te,B,Ee,Se,Ce,xe,we,oe,pe,me,de])}function RM(e){return e!=null&&`current`in e}var zM=b.createContext(void 0);function BM(){let e=b.useContext(zM);if(!e)throw Error(WS(59));return e}function VM(e,t){e&&Object.assign(e.style,t)}var HM={position:`relative`,maxHeight:`100%`,overflowX:`hidden`,overflowY:`auto`};function UM(e){return e===`starting`?fD:cC}function WM(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),fC(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},UM(r),i],stateAttributesMapping:jA})}var GM=20;function KM(e,t,n,r){let[i,a]=b.useState(!1);Q(()=>{if(!e||!t||n==null){a(!1);return}let r=VC(n).documentElement.clientWidth,i=n.offsetWidth;a(r>0&&i>0&&i>=r-GM)},[e,t,n]),IE(e&&(!t||i),r)}var qM={position:`fixed`},JM=b.forwardRef(function(e,t){let{anchor:n,positionMethod:r=`absolute`,className:i,render:a,side:o=`bottom`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m,alignItemWithTrigger:h=!0,collisionAvoidance:g=mD,style:_,...v}=e,{store:x,listRef:S,labelsRef:C,alignItemWithTriggerActiveRef:w,selectedItemTextRef:T,valuesRef:E,initialValueRef:D,popupRef:O,setValue:k}=Gj(),A=Kj(),j=pk(x,aM.open),M=pk(x,aM.mounted),N=pk(x,aM.modal),P=pk(x,aM.value),F=pk(x,aM.openMethod),I=pk(x,aM.positionerElement),L=pk(x,aM.triggerElement),R=pk(x,aM.isItemEqualToValue),z=pk(x,aM.transitionStatus),ee=b.useRef(null),B=b.useRef(null),[V,H]=b.useState(h),te=M&&V&&F!==`touch`;!M&&V!==h&&H(h),Q(()=>{M||(aM.scrollUpArrowVisible(x.state)&&x.set(`scrollUpArrowVisible`,!1),aM.scrollDownArrowVisible(x.state)&&x.set(`scrollDownArrowVisible`,!1))},[x,M]),b.useImperativeHandle(w,()=>te),KM((te||N)&&j,F===`touch`,I,L);let ne=LM({anchor:n,floatingRootContext:A,positionMethod:r,mounted:M,side:o,sideOffset:c,align:s,alignOffset:l,arrowPadding:f,collisionBoundary:u,collisionPadding:d,sticky:p,disableAnchorTracking:m??te,collisionAvoidance:g,keepMounted:!0}),U=te?`none`:ne.side,re=te?qM:ne.positionerStyles,ie=WM(e,{open:j,side:U,align:ne.align,anchorHidden:ne.anchorHidden},{styles:re,transitionStatus:z,props:v,refs:[t,CS(e=>{x.set(`positionerElement`,e)})],hidden:!M,inert:!j}),ae=b.useRef(0),oe=CS(e=>{if(e.size===0&&ae.current===0||E.current.length===0)return;let t=ae.current;if(ae.current=e.size,e.size===t)return;let n=mE(eE);if(t!==0&&!x.state.multiple&&P!==null&&Xj(E.current,P,R)===-1){let e=D.current,t=e!=null&&Xj(E.current,e,R)!==-1?e:null;k(t,n),t===null&&(x.set(`selectedIndex`,null),T.current=null)}if(t!==0&&x.state.multiple&&Array.isArray(P)){let e=e=>Xj(E.current,e,R)!==-1,t=P.filter(t=>e(t));(t.length!==P.length||t.some(e=>!Yj(P,e,R)))&&(k(t,n),t.length===0&&(x.set(`selectedIndex`,null),T.current=null))}if(j&&te){x.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});let e={height:``};VM(I,e),VM(O.current,e)}}),se=b.useMemo(()=>({...ne,side:U,alignItemWithTriggerActive:te,setControlledAlignItemWithTrigger:H,scrollUpArrowRef:ee,scrollDownArrowRef:B}),[ne,U,te,H]);return(0,y.jsx)(wM,{elementsRef:S,labelsRef:C,onMapChange:oe,children:(0,y.jsxs)(zM.Provider,{value:se,children:[M&&N&&(0,y.jsx)(QA,{inert:ZA(!j),cutout:L}),ie]})})}),YM=`base-ui-disable-scrollbar`,XM={className:YM,getElement(e){return(0,y.jsx)(`style`,{nonce:e,href:YM,precedence:`base-ui:low`,children:`.${YM}{scrollbar-width:none}.${YM}::-webkit-scrollbar{display:none}`})}},ZM=b.createContext(void 0);function QM(e){let t=b.useContext(ZM);if(t===void 0&&!e)throw Error(WS(69));return t}var $M=b.createContext(void 0),eN={disableStyleElements:!1};function tN(){return b.useContext($M)??eN}var nN={...jA,...qT},rN=b.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,...o}=e,{store:s,popupRef:c,onOpenChangeComplete:l,setOpen:u,valueRef:d,selectedItemTextRef:f,keyboardActiveRef:p,multiple:m,handleScrollArrowVisibility:h,scrollHandlerRef:g,listRef:_,highlightItemOnHover:v}=Gj(),{side:x,align:S,alignItemWithTriggerActive:C,isPositioned:w,setControlledAlignItemWithTrigger:T,scrollDownArrowRef:E,scrollUpArrowRef:D}=BM(),O=QM(!0)!=null,k=Kj(),A=kM(),{nonce:j,disableStyleElements:M}=tN(),N=pk(s,aM.id),P=pk(s,aM.open),F=pk(s,aM.mounted),I=pk(s,aM.popupProps),L=pk(s,aM.transitionStatus),R=pk(s,aM.triggerElement),z=pk(s,aM.positionerElement),ee=pk(s,aM.listElement),B=b.useRef(!1),V=b.useRef(!1),H=b.useRef({}),te=HT(),ne=CS(e=>{if(!z||!c.current||!V.current)return;if(B.current||!C){h();return}let t=z.style.top===`0px`,n=z.style.bottom===`0px`;if(!t&&!n){h();return}let r=oN(z),i=sN(z.getBoundingClientRect().height,`y`,r),a=VC(z),o=getComputedStyle(z),s=parseFloat(o.marginTop),l=parseFloat(o.marginBottom),u=iN(getComputedStyle(c.current)),d=Math.min(a.documentElement.clientHeight-s-l,u),f=e.scrollTop,p=aN(e),m=0,g=null,_=!1,v=!1,y=e=>{z.style.height=`${e}px`},b=(t,n)=>{let r=oM(t,0,d-i);r>0&&y(i+r),e.scrollTop=n,d-(i+r)<=1&&(B.current=!0),h()},x=t?p-f:f,S=Math.min(i+x,d);if(m=S,x<=1){b(x,t?p:0);return}if(d-S>1?t?v=!0:g=0:(_=!0,n&&f<p&&(g=f-(x-(i+x-d)))),m=Math.ceil(m),m!==0&&y(m),v||g!=null){let t=aN(e),n=v?t:oM(g,0,t);Math.abs(e.scrollTop-n)>1&&(e.scrollTop=n)}(_||m>=d-1)&&(B.current=!0),h()});b.useImperativeHandle(g,()=>ne,[ne]),XT({open:P,ref:c,onComplete(){P&&l?.(!0)}});let U={open:P,transitionStatus:L,side:x,align:S};Q(()=>{!z||!c.current||Object.keys(H.current).length||(H.current={top:z.style.top||`0`,left:z.style.left||`0`,right:z.style.right,height:z.style.height,bottom:z.style.bottom,minHeight:z.style.minHeight,maxHeight:z.style.maxHeight,marginTop:z.style.marginTop,marginBottom:z.style.marginBottom})},[c,z]),Q(()=>{P||C||(V.current=!1,B.current=!1,VM(z,H.current))},[P,C,z,c]),Q(()=>{let e=c.current;if(!P||!R||!z||!e||C&&!w||s.state.transitionStatus===`ending`)return;if(!C){V.current=!0,te.request(h),e.style.removeProperty(`--transform-origin`);return}let t=uN(e);e.style.removeProperty(`--transform-origin`);try{let t=f.current,n=d.current,r=getComputedStyle(z),i=getComputedStyle(e),a=VC(R),o=Xx(z),c=oN(R),l=cN(R.getBoundingClientRect(),c),u=cN(z.getBoundingClientRect(),c),p=l.height,m=ee||e,g=m.scrollHeight,y=parseFloat(i.borderBottomWidth),b=parseFloat(r.marginTop)||10,x=parseFloat(r.marginBottom)||10,S=parseFloat(r.minHeight)||100,C=iN(i),w=a.documentElement.clientHeight-b-x,E=a.documentElement.clientWidth,D=w-l.bottom+p,O,k=A===`rtl`?l.right-u.width:l.left,j=0;if(t&&n){let e=cN(n.getBoundingClientRect(),c);O=cN(t.getBoundingClientRect(),c),k=u.left+(A===`rtl`?e.right-O.right:e.left-O.left);let r=e.top-l.top+e.height/2;j=O.top-u.top+O.height/2-r}let M=D+j+x+y,N=Math.min(w,M),P=w-b-x,F=M-N,I=E-5;z.style.left=`${oM(k,5,I-u.width)}px`,z.style.height=`${N}px`,z.style.maxHeight=`auto`,z.style.marginTop=`${b}px`,z.style.marginBottom=`${x}px`,e.style.height=`100%`;let L=aN(m),te=F>=L-1;te&&(N=Math.min(w,u.height)-(F-L));let ne=l.top<20||l.bottom>w-20||Math.ceil(N)+1<Math.min(g,S),U=(o.visualViewport?.scale??1)!==1&&KC;if(ne||U){V.current=!0,VM(z,H.current),T(!1);return}let re=Math.max(S,N);if(te){let e=Math.max(0,w-M);z.style.top=u.height>=P?`0`:`${e}px`,z.style.height=`${N}px`,m.scrollTop=aN(m)}else z.style.bottom=`0`,m.scrollTop=F;if(O){let t=u.top,n=u.height,r=O.top+O.height/2,i=oM(n>0?(r-t)/n*100:50,0,100);e.style.setProperty(`--transform-origin`,`50% ${i}%`)}(re===w||N>=C)&&(B.current=!0),h(),v&&s.state.selectedIndex===null&&s.state.activeIndex===null&&_.current[0]!=null&&s.set(`activeIndex`,0),V.current=!0}finally{t()}},[s,P,z,R,d,f,c,h,C,T,te,E,D,ee,_,v,A,w]),b.useEffect(()=>{if(!C||!z||!P)return;let e=Xx(z);function t(e){u(!1,mE(pE,e))}return DE(e,`resize`,t)},[u,C,z,P]);let re={...ee?{role:`presentation`,"aria-orientation":void 0}:{role:`listbox`,"aria-multiselectable":m||void 0,id:`${N}-list`},onKeyDown(e){p.current=!0,O&&JA.has(e.key)&&e.stopPropagation()},onMouseMove(){p.current=!1},onScroll(e){ee||ne(e.currentTarget)},...C&&{style:ee?{height:`100%`}:HM}},ie=fC(`div`,e,{ref:[t,c],state:U,stateAttributesMapping:nN,props:[I,re,UM(L),{className:!ee&&C?XM.className:void 0},o]});return(0,y.jsxs)(b.Fragment,{children:[!M&&XM.getElement(j),(0,y.jsx)(FD,{context:k,modal:!1,disabled:!F,returnFocus:a,restoreFocus:!0,children:ie})]})});function iN(e){let t=e.maxHeight||``;return t.endsWith(`px`)&&parseFloat(t)||1/0}function aN(e){return sM(e.scrollHeight,e.clientHeight)}function oN(e){return AO.getScale(e)}function sN(e,t,n){return e/n[t]}function cN(e,t){return $w({x:sN(e.x,`x`,t),y:sN(e.y,`y`,t),width:sN(e.width,`x`,t),height:sN(e.height,`y`,t)})}var lN=[[`transform`,`none`],[`scale`,`1`],[`translate`,`0 0`]];function uN(e){let{style:t}=e,n={};for(let[e,r]of lN)n[e]=t.getPropertyValue(e),t.setProperty(e,r,`important`);return()=>{for(let[e]of lN){let r=n[e];r?t.setProperty(e,r):t.removeProperty(e)}}}var dN=b.forwardRef(function(e,t){let{className:n,render:r,style:i,...a}=e,{store:o,scrollHandlerRef:s}=Gj(),{alignItemWithTriggerActive:c}=BM(),l=pk(o,aM.hasScrollArrows),u=pk(o,aM.openMethod),d=pk(o,aM.multiple),f={id:`${pk(o,aM.id)}-list`,role:`listbox`,"aria-multiselectable":d||void 0,onScroll(e){s.current?.(e.currentTarget)},...c&&{style:HM},className:l&&u!==`touch`?XM.className:void 0};return fC(`div`,e,{ref:[t,CS(e=>{o.set(`listElement`,e)})],props:[f,a]})}),fN=function(e){return e[e.None=0]=`None`,e[e.GuessFromOrder=1]=`GuessFromOrder`,e}({});function pN(e={}){let{label:t,metadata:n,textRef:r,indexGuessBehavior:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,elementsRef:l,labelsRef:u,nextIndexRef:d}=CM(),f=b.useRef(-1),[p,m]=b.useState(a??(i===fN.GuessFromOrder?()=>{if(f.current===-1){let e=d.current;d.current+=1,f.current=e}return f.current}:-1)),h=b.useRef(null),g=b.useCallback(e=>{if(h.current=e,p!==-1&&e!==null&&(l.current[p]=e,u)){let n=t!==void 0;u.current[p]=n?t:r?.current?.textContent??e.textContent}},[p,l,u,t,r]);return Q(()=>{if(a!=null)return;let e=h.current;if(e)return o(e,n),()=>{s(e)}},[a,o,s,n]),Q(()=>{if(a==null)return c(e=>{let t=h.current?e.get(h.current)?.index:null;t!=null&&m(t)})},[a,c,m]),b.useMemo(()=>({ref:g,index:p}),[p,g])}var mN=b.createContext(void 0);function hN(){let e=b.useContext(mN);if(!e)throw Error(WS(57));return e}var gN=b.memo(b.forwardRef(function(e,t){let{render:n,className:r,value:i=null,label:a,disabled:o=!1,nativeButton:s=!1,style:c,...l}=e,u=b.useRef(null),d=pN({label:a,textRef:u,indexGuessBehavior:fN.GuessFromOrder}),{store:f,getItemProps:p,setOpen:m,setValue:h,selectionRef:g,typingRef:_,valuesRef:v,multiple:x,selectedItemTextRef:S}=Gj(),C=pk(f,aM.isActive,d.index),w=pk(f,aM.isSelected,d.index,i),T=pk(f,aM.isSelectedByFocus,d.index),E=pk(f,aM.isItemEqualToValue),D=d.index,O=D!==-1,k=b.useRef(null),A=GE(D);Q(()=>{if(!O)return;let e=v.current;return e[D]=i,()=>{delete e[D]}},[O,D,i,v]),Q(()=>{if(!O)return;let e=f.state.value,t=e;x&&Array.isArray(e)&&e.length>0&&(t=e[e.length-1]),t!==void 0&&Jj(i,t,E)&&(f.set(`selectedIndex`,D),u.current&&(S.current=u.current))},[O,D,x,E,f,i,S]);let j={disabled:o,selected:w,highlighted:C},M=p({active:C,selected:w});M.id=void 0;let N=b.useRef(null),P=b.useRef(`mouse`),F=b.useRef(!1),{getButtonProps:I,buttonRef:L}=JS({disabled:o,focusableWhenDisabled:!0,native:s,composite:!0});function R(e){let t=f.state.value;if(x){let n=Array.isArray(t)?t:[];h(w?Zj(n,i,E):[...n,i],mE(aE,e))}else h(i,mE(aE,e)),m(!1,mE(aE,e))}let z={role:`option`,"aria-selected":w,tabIndex:C?0:-1,onTouchStart(){g.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}},onKeyDown(e){N.current=e.key,f.set(`activeIndex`,D),e.key===` `&&_.current&&e.preventDefault()},onClick(e){F.current=!1,!(e.type===`keydown`&&N.current===null)&&(o||e.type===`keydown`&&N.current===` `&&_.current||P.current!==`touch`&&!C||(N.current=null,R(e.nativeEvent)))},onPointerEnter(e){P.current=e.pointerType},onPointerDown(e){P.current=e.pointerType,F.current=!0},onMouseUp(){if(o)return;if(F.current){F.current=!1;return}let e=!g.current.allowSelectedMouseUp&&w,t=!g.current.allowUnselectedMouseUp&&!w;e||t||P.current!==`touch`&&!C||k.current?.click()}},ee=fC(`div`,e,{ref:[L,t,d.ref,k],state:j,props:[M,z,l,I]}),B=b.useMemo(()=>({selected:w,indexRef:A,textRef:u,selectedByFocus:T,hasRegistered:O}),[w,A,u,T,O]);return(0,y.jsx)(mN.Provider,{value:B,children:ee})})),_N=b.forwardRef(function(e,t){let n=e.keepMounted??!1,{selected:r}=hN();return n||r?(0,y.jsx)(vN,{...e,ref:t}):null}),vN=b.memo(b.forwardRef((e,t)=>{let{render:n,className:r,style:i,keepMounted:a,...o}=e,{selected:s}=hN(),c=b.useRef(null),{transitionStatus:l,setMounted:u}=ZT(s),d=fC(`span`,e,{ref:[t,c],state:{selected:s,transitionStatus:l},props:[{"aria-hidden":!0,children:`✔️`},o],stateAttributesMapping:qT});return XT({open:s,ref:c,onComplete(){s||u(!1)}}),d})),yN=b.memo(b.forwardRef(function(e,t){let{indexRef:n,textRef:r,selectedByFocus:i,hasRegistered:a}=hN(),{selectedItemTextRef:o}=Gj(),{className:s,render:c,style:l,...u}=e;return fC(`div`,e,{ref:[b.useCallback(e=>{if(!e||!a)return;let t=o.current===null||!o.current.isConnected;(i||t&&n.current===0)&&(o.current=e)},[o,n,i,a]),t,r],props:u})})),bN=b.forwardRef(function(e,t){let{render:n,className:r,style:i,direction:a,keepMounted:o=!1,...s}=e,c=a===`up`,{store:l,popupRef:u,listRef:d,handleScrollArrowVisibility:f,scrollArrowsMountedCountRef:p}=Gj(),{side:m,scrollDownArrowRef:h,scrollUpArrowRef:g}=BM(),_=pk(l,c?aM.scrollUpArrowVisible:aM.scrollDownArrowVisible),v=pk(l,aM.openMethod),y=_&&v!==`touch`,b=RT(),x=c?g:h,{transitionStatus:S,setMounted:C}=ZT(y);Q(()=>(p.current+=1,l.state.hasScrollArrows||l.set(`hasScrollArrows`,!0),()=>{p.current=Math.max(0,p.current-1),p.current===0&&l.state.hasScrollArrows&&l.set(`hasScrollArrows`,!1)}),[l,p]),XT({open:y,ref:x,onComplete(){y||C(!1)}});let w=fC(`div`,e,{ref:[t,x],state:{direction:a,visible:y,side:m,transitionStatus:S},props:[{"aria-hidden":!0,children:c?`▲`:`▼`,style:{position:`absolute`},onMouseMove(e){if(e.movementX===0&&e.movementY===0||b.isStarted())return;l.set(`activeIndex`,null);function t(){let e=l.state.listElement??u.current;if(!e)return;l.set(`activeIndex`,null),f();let n=sM(e.scrollHeight,e.clientHeight),r=cM(e.scrollTop,n),i=r===(c?0:n),a=d.current;if(r!==e.scrollTop&&(e.scrollTop=r),a.length===0&&l.set(c?`scrollUpArrowVisible`:`scrollDownArrowVisible`,!i),i){b.clear();return}if(a.length>0){let t=x.current?.offsetHeight||0;e.scrollTop=xN(a,c,r,e.clientHeight,t,n)}b.start(40,t)}b.start(40,t)},onMouseLeave(){b.clear()}},s]});return y||o?w:null});function xN(e,t,n,r,i,a){if(t){let t=0,r=n+i-1;for(let n=0;n<e.length;n+=1){let i=e[n];if(i&&i.offsetTop>=r){t=n;break}}let o=Math.max(0,t-1),s=e[o];return o<t&&s?cM(s.offsetTop-i,a):0}let o=e.length-1,s=n+r-i+1;for(let t=0;t<e.length;t+=1){let n=e[t];if(n&&n.offsetTop+n.offsetHeight>s){o=Math.max(0,t-1);break}}let c=Math.min(e.length-1,o+1),l=e[c];return c>o&&l?cM(l.offsetTop+l.offsetHeight-r+i,a):a}var SN=b.forwardRef(function(e,t){return(0,y.jsx)(bN,{...e,ref:t,direction:`down`})}),CN=b.forwardRef(function(e,t){return(0,y.jsx)(bN,{...e,ref:t,direction:`up`})}),wN=lM;function TN({className:e,...t}){return(0,y.jsx)(vM,{"data-slot":`select-value`,className:qx(`flex flex-1 text-left`,e),...t})}function EN({className:e,size:t=`default`,children:n,...r}){return(0,y.jsxs)(gM,{"data-slot":`select-trigger`,"data-size":t,className:qx(`flex w-fit items-center justify-between gap-1.5 rounded-md border border-input bg-transparent py-2 pr-2 pl-2.5 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...r,children:[n,(0,y.jsx)(yM,{render:(0,y.jsx)(cb,{className:`pointer-events-none size-4 text-muted-foreground`})})]})}function DN({className:e,children:t,footer:n,side:r=`bottom`,sideOffset:i=4,align:a=`center`,alignOffset:o=0,alignItemWithTrigger:s=!0,...c}){return(0,y.jsx)(xM,{children:(0,y.jsx)(JM,{side:r,sideOffset:i,align:a,alignOffset:o,alignItemWithTrigger:s,className:`isolate z-50`,children:(0,y.jsxs)(rN,{"data-slot":`select-content`,"data-align-trigger":s,className:qx(`relative isolate z-50 max-h-(--available-height) w-(--anchor-width) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-md bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...c,children:[(0,y.jsx)(kN,{}),(0,y.jsx)(dN,{children:t}),(0,y.jsx)(AN,{}),n]})})})}function ON({className:e,children:t,...n}){return(0,y.jsxs)(gN,{"data-slot":`select-item`,className:qx(`relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2`,e),...n,children:[(0,y.jsx)(yN,{className:`flex flex-1 shrink-0 gap-2 whitespace-nowrap`,children:t}),(0,y.jsx)(_N,{render:(0,y.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex size-4 items-center justify-center`}),children:(0,y.jsx)(sb,{className:`pointer-events-none`})})]})}function kN({className:e,...t}){return(0,y.jsx)(CN,{"data-slot":`select-scroll-up-button`,className:qx(`top-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4`,e),...t,children:(0,y.jsx)(lb,{})})}function AN({className:e,...t}){return(0,y.jsx)(SN,{"data-slot":`select-scroll-down-button`,className:qx(`bottom-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4`,e),...t,children:(0,y.jsx)(cb,{})})}var jN=`h-7 justify-between gap-1.5 rounded-md border-border/60 bg-transparent px-2 text-xs font-normal text-foreground shadow-none focus-visible:border-ring/40 focus-visible:ring-1 focus-visible:ring-ring/40 dark:bg-transparent`,MN=`max-h-72 w-(--anchor-width) origin-(--transform-origin) gap-0 overflow-hidden p-1 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden`,NN=`rounded-sm py-1.5 pr-7 pl-2 text-xs hover:bg-foreground/10 hover:text-foreground focus:bg-foreground/10 focus:text-foreground`,PN=({value:e,items:t,ariaLabel:n,placeholder:r,onValueChange:i,open:a,onOpenChange:o,onItemHover:s,triggerClassName:c,triggerStyle:l,footerSlot:u})=>{let d=(0,b.useMemo)(()=>t.find(t=>t.id===e),[t,e]),f=(0,b.useMemo)(()=>d?.itemStyle?{...d.itemStyle,...l}:l,[d?.itemStyle,l]);return(0,y.jsxs)(wN,{value:e,onValueChange:i,open:a,onOpenChange:o,children:[(0,y.jsx)(EN,{size:`sm`,"aria-label":n,className:qx(jN,`w-full`,c),style:f,children:(0,y.jsx)(TN,{placeholder:r,children:()=>d?.label||r})}),(0,y.jsx)(DN,{alignItemWithTrigger:!1,sideOffset:4,className:qx(MN,bj,xj),footer:u?(0,y.jsx)(`div`,{className:`border-t border-border/40 p-1`,children:u}):void 0,children:t.map(e=>(0,y.jsx)(ON,{value:e.id,className:NN,style:e.itemStyle,onPointerEnter:s?()=>s(e.id):void 0,onFocus:s?()=>s(e.id):void 0,children:e.label},e.id))})]})},FN=Sb(`group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,secondary:`bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80`,destructive:`bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20`,outline:`border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground`,ghost:`hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50`,link:`text-primary underline-offset-4 hover:underline`}},defaultVariants:{variant:`default`}});function IN({className:e,variant:t=`default`,render:n,...r}){return jj({defaultTagName:`span`,props:kS({className:qx(FN({variant:t}),e)},r),render:n,state:{slot:`badge`,variant:t}})}function LN(e){let{open:t,defaultOpen:n,onOpenChange:r,disabled:i}=e,a=t!==void 0,[o,s]=QT({controlled:t,default:n,name:`Collapsible`,state:`open`}),{mounted:c,setMounted:l,transitionStatus:u}=ZT(o,!0,!0),[d,f]=b.useState(o),[{height:p,width:m},h]=b.useState({height:void 0,width:void 0}),g=PC(),[_,v]=b.useState(),y=_??g,[x,S]=b.useState(!1),[C,w]=b.useState(!1),T=b.useRef(null),E=b.useRef(null),D=b.useRef(null),O=b.useRef(null),k=YT(O,!1),A=CS(e=>{let t=!o,n=mE(tE,e.nativeEvent);if(r(t,n),n.isCanceled)return;let i=O.current;E.current===`css-animation`&&i!=null&&i.style.removeProperty(`animation-name`),!x&&!C&&(E.current!=null&&E.current!==`css-animation`&&!c&&t&&l(!0),E.current===`css-animation`&&(!d&&t&&f(!0),!c&&t&&l(!0))),s(t),E.current===`none`&&c&&!t&&l(!1)});return Q(()=>{a&&E.current===`none`&&!o&&l(!1)},[a,o,t,l]),b.useMemo(()=>({abortControllerRef:T,animationTypeRef:E,disabled:i,handleTrigger:A,height:p,mounted:c,open:o,panelId:y,panelRef:O,runOnceAnimationsFinish:k,setDimensions:h,setHiddenUntilFound:S,setKeepMounted:w,setMounted:l,setOpen:s,setPanelIdState:v,setVisible:f,transitionDimensionRef:D,transitionStatus:u,visible:d,width:m}),[T,E,i,A,p,c,o,y,O,k,h,S,w,l,s,f,D,u,d,m])}var RN=b.createContext(void 0);function zN(){let e=b.useContext(RN);if(e===void 0)throw Error(WS(15));return e}var BN=function(e){return e.open=`data-open`,e.closed=`data-closed`,e[e.startingStyle=WT.startingStyle]=`startingStyle`,e[e.endingStyle=WT.endingStyle]=`endingStyle`,e}({}),VN=function(e){return e.panelOpen=`data-panel-open`,e}({}),HN={[BN.open]:``},UN={[BN.closed]:``},WN={open(e){return e?{[VN.panelOpen]:``}:null}},GN={open(e){return e?HN:UN},...qT},KN=b.forwardRef(function(e,t){let{render:n,className:r,defaultOpen:i=!1,disabled:a=!1,onOpenChange:o,open:s,style:c,...l}=e,u=CS(o),d=LN({open:s,defaultOpen:i,onOpenChange:u,disabled:a}),f=b.useMemo(()=>({open:d.open,disabled:d.disabled,transitionStatus:d.transitionStatus}),[d.open,d.disabled,d.transitionStatus]),p=b.useMemo(()=>({...d,onOpenChange:u,state:f}),[d,u,f]),m=fC(`div`,e,{state:f,ref:t,props:l,stateAttributesMapping:GN});return(0,y.jsx)(RN.Provider,{value:p,children:m})}),qN={...WN,...qT},JN=b.forwardRef(function(e,t){let{panelId:n,open:r,handleTrigger:i,state:a,disabled:o}=zN(),{className:s,disabled:c=o,id:l,render:u,nativeButton:d=!0,style:f,...p}=e,{getButtonProps:m,buttonRef:h}=JS({disabled:c,focusableWhenDisabled:!0,native:d}),g=b.useMemo(()=>({"aria-controls":r?n:void 0,"aria-expanded":r,onClick:i}),[n,r,i]);return fC(`button`,e,{state:a,ref:[t,h],props:[g,p,m],stateAttributesMapping:qN})}),YN=function(e){return e.disabled=`data-disabled`,e.orientation=`data-orientation`,e}({});function XN(e){let{abortControllerRef:t,animationTypeRef:n,externalRef:r,height:i,hiddenUntilFound:a,keepMounted:o,id:s,mounted:c,onOpenChange:l,open:u,panelRef:d,runOnceAnimationsFinish:f,setDimensions:p,setMounted:m,setOpen:h,setVisible:g,transitionDimensionRef:_,visible:v,width:y}=e,x=b.useRef(!1),S=b.useRef(null),C=b.useRef(u),w=b.useRef(u),T=HT(),E=b.useMemo(()=>n.current===`css-animation`?!v:!u&&!c,[u,c,v,n]),D=ZS(r,d,CS(e=>{if(!e)return;if(n.current==null||_.current==null){let t=getComputedStyle(e),r=t.animationName!==`none`&&t.animationName!==``,i=t.transitionDuration!==`0s`&&t.transitionDuration!==``;r&&i||(t.animationName===`none`&&t.transitionDuration!==`0s`?n.current=`css-transition`:t.animationName!==`none`&&t.transitionDuration===`0s`?n.current=`css-animation`:n.current=`none`),e.getAttribute(YN.orientation)===`horizontal`||t.transitionProperty.indexOf(`width`)>-1?_.current=`width`:_.current=`height`}if(n.current!==`css-transition`)return;(i===void 0||y===void 0)&&(p({height:e.scrollHeight,width:e.scrollWidth}),w.current&&e.style.setProperty(`transition-duration`,`0s`));let t=-1,r=-1;return t=VT.request(()=>{w.current=!1,r=VT.request(()=>{setTimeout(()=>{e.style.removeProperty(`transition-duration`)})})}),()=>{VT.cancel(t),VT.cancel(r)}}));return Q(()=>{if(n.current!==`css-transition`)return;let e=d.current;if(!e)return;let r=-1;if(t.current!=null&&(t.current.abort(),t.current=null),u){let t={"justify-content":e.style.justifyContent,"align-items":e.style.alignItems,"align-content":e.style.alignContent,"justify-items":e.style.justifyItems};Object.keys(t).forEach(t=>{e.style.setProperty(t,`initial`,`important`)}),!w.current&&!o&&e.setAttribute(BN.startingStyle,``),p({height:e.scrollHeight,width:e.scrollWidth}),r=VT.request(()=>{Object.entries(t).forEach(([t,n])=>{n===``?e.style.removeProperty(t):e.style.setProperty(t,n)})})}else{if(e.scrollHeight===0&&e.scrollWidth===0)return;p({height:e.scrollHeight,width:e.scrollWidth});let n=new AbortController;t.current=n;let r=n.signal,i=null,a=BN.endingStyle;return i=new MutationObserver(o=>{o.some(e=>e.type===`attributes`&&e.attributeName===a)&&(i?.disconnect(),i=null,f(()=>{p({height:0,width:0}),e.style.removeProperty(`content-visibility`),m(!1),t.current===n&&(t.current=null)},r))}),i.observe(e,{attributes:!0,attributeFilter:[a]}),()=>{i?.disconnect(),T.cancel(),t.current===n&&(n.abort(),t.current=null)}}return()=>{VT.cancel(r)}},[t,n,T,a,o,c,u,d,f,p,m]),Q(()=>{if(n.current!==`css-animation`)return;let e=d.current;e&&(S.current=e.style.animationName||S.current,e.style.setProperty(`animation-name`,`none`),p({height:e.scrollHeight,width:e.scrollWidth}),!C.current&&!x.current&&e.style.removeProperty(`animation-name`),u?(t.current!=null&&(t.current.abort(),t.current=null),m(!0),g(!0)):(t.current=new AbortController,f(()=>{m(!1),g(!1),t.current=null},t.current.signal)))},[t,n,u,d,f,p,m,g,v]),FT(()=>{let e=VT.request(()=>{C.current=!1});return()=>VT.cancel(e)}),Q(()=>{if(!a)return;let e=d.current;if(!e)return;let t=-1,n=-1;return u&&x.current&&(e.style.transitionDuration=`0s`,p({height:e.scrollHeight,width:e.scrollWidth}),t=VT.request(()=>{x.current=!1,n=VT.request(()=>{setTimeout(()=>{e.style.removeProperty(`transition-duration`)})})})),()=>{VT.cancel(t),VT.cancel(n)}},[a,u,d,p]),Q(()=>{let e=d.current;e&&a&&E&&(e.setAttribute(`hidden`,`until-found`),n.current===`css-transition`&&e.setAttribute(BN.startingStyle,``))},[a,E,n,d]),b.useEffect(function(){let e=d.current;if(!e)return;function t(e){x.current=!0,h(!0),l(!0,mE(eE,e))}return DE(e,`beforematch`,t)},[l,d,h]),b.useMemo(()=>({props:{hidden:E,id:s,ref:D}}),[E,s,D])}var ZN=function(e){return e.collapsiblePanelHeight=`--collapsible-panel-height`,e.collapsiblePanelWidth=`--collapsible-panel-width`,e}({}),QN=b.forwardRef(function(e,t){let{className:n,hiddenUntilFound:r,keepMounted:i,render:a,id:o,style:s,...c}=e,{abortControllerRef:l,animationTypeRef:u,height:d,mounted:f,onOpenChange:p,open:m,panelId:h,panelRef:g,runOnceAnimationsFinish:_,setDimensions:v,setHiddenUntilFound:y,setKeepMounted:x,setMounted:S,setPanelIdState:C,setOpen:w,setVisible:T,state:E,transitionDimensionRef:D,visible:O,width:k,transitionStatus:A}=zN(),j=r??!1,M=i??!1;Q(()=>{if(o)return C(o),()=>{C(void 0)}},[o,C]),Q(()=>{y(j)},[y,j]),Q(()=>{x(M)},[x,M]);let{props:N}=XN({abortControllerRef:l,animationTypeRef:u,externalRef:t,height:d,hiddenUntilFound:j,id:h,keepMounted:M,mounted:f,onOpenChange:p,open:m,panelRef:g,runOnceAnimationsFinish:_,setDimensions:v,setMounted:S,setOpen:w,setVisible:T,transitionDimensionRef:D,visible:O,width:k});XT({open:m&&A===`idle`,ref:g,onComplete(){m&&v({height:void 0,width:void 0})}});let P=fC(`div`,e,{state:b.useMemo(()=>({...E,transitionStatus:A}),[E,A]),ref:[t,g],props:[N,{style:{[ZN.collapsiblePanelHeight]:d===void 0?`auto`:`${d}px`,[ZN.collapsiblePanelWidth]:k===void 0?`auto`:`${k}px`}},c],stateAttributesMapping:GN});return M||j||f?P:null});function $N({...e}){return(0,y.jsx)(KN,{"data-slot":`collapsible`,...e})}function eP({...e}){return(0,y.jsx)(JN,{"data-slot":`collapsible-trigger`,...e})}function tP({...e}){return(0,y.jsx)(QN,{"data-slot":`collapsible-content`,...e})}function nP({className:e,...t}){return(0,y.jsx)(`label`,{"data-slot":`label`,className:qx(`flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,e),...t})}function rP({className:e,...t}){return(0,y.jsx)(`div`,{"data-slot":`field-group`,className:qx(`group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4`,e),...t})}var iP=Sb(`group/field flex w-full gap-3 data-[invalid=true]:text-destructive`,{variants:{orientation:{vertical:`flex-col *:w-full [&>.sr-only]:w-auto`,horizontal:`flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`,responsive:`flex-col *:w-full @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:*:data-[slot=field-label]:flex-auto [&>.sr-only]:w-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`}},defaultVariants:{orientation:`vertical`}});function aP({className:e,orientation:t=`vertical`,...n}){return(0,y.jsx)(`div`,{role:`group`,"data-slot":`field`,"data-orientation":t,className:qx(iP({orientation:t}),e),...n})}function oP({className:e,...t}){return(0,y.jsx)(nP,{"data-slot":`field-label`,className:qx(`group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50 has-data-checked:border-primary/30 has-data-checked:bg-primary/5 has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border *:data-[slot=field]:p-3 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10`,`has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col`,e),...t})}var sP=b.createContext(void 0);function cP(){let e=b.useContext(sP);if(e===void 0)throw Error(WS(63));return e}var lP=function(e){return e.checked=`data-checked`,e.unchecked=`data-unchecked`,e.disabled=`data-disabled`,e.readonly=`data-readonly`,e.required=`data-required`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.filled=`data-filled`,e.focused=`data-focused`,e}({}),uP={...TC,checked(e){return e?{[lP.checked]:``}:{[lP.unchecked]:``}}},dP=b.forwardRef(function(e,t){let{checked:n,className:r,defaultChecked:i,"aria-labelledby":a,form:o,id:s,inputRef:c,name:l,nativeButton:u=!1,onCheckedChange:d,readOnly:f=!1,required:p=!1,disabled:m=!1,render:h,uncheckedValue:g,value:_,style:v,...x}=e,{clearErrors:S}=kC(),{state:C,setTouched:w,setDirty:T,validityData:E,setFilled:D,setFocused:O,shouldValidateOnChange:k,validationMode:A,disabled:j,name:M,validation:N}=DC(),{labelId:P}=IC(),F=j||m,I=M??l,L=CS(d),R=b.useRef(null),z=ZS(R,c,N.inputRef),ee=b.useRef(null),B=PC(),V=BC({id:s,implicit:!1,controlRef:ee}),H=u?void 0:V,[te,ne]=QT({controlled:n,default:!!i,name:`Switch`,state:`checked`});$T(ee,{id:B,value:te}),Q(()=>{R.current&&D(R.current.checked)},[R,D]),dA(te,()=>{S(I),T(te!==E.initialValue),D(te),k()?N.commit(te):N.commit(te,!0)});let{getButtonProps:U,buttonRef:re}=JS({disabled:F,native:u}),ie=LC(a,P,R,!u,H),ae={id:u?V:B,role:`switch`,"aria-checked":te,"aria-readonly":f||void 0,"aria-required":p||void 0,"aria-labelledby":ie,onFocus(){F||O(!0)},onBlur(){let e=R.current;!e||F||(w(!0),O(!1),A===`onBlur`&&N.commit(e.checked))},onClick(e){f||F||(e.preventDefault(),R.current?.dispatchEvent(new PointerEvent(`click`,{bubbles:!0,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey})))}},oe=b.useMemo(()=>kS({checked:te,disabled:F,form:o,id:H,name:I,required:p,style:I?YE:JE,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,ref:z,onChange(e){if(e.nativeEvent.defaultPrevented)return;if(f){e.preventDefault();return}let t=e.currentTarget.checked,n=mE(eE,e.nativeEvent);L?.(t,n),!n.isCanceled&&ne(t)},onFocus(){ee.current?.focus()}},N.getInputValidationProps,_===void 0?cC:{value:_}),[te,F,o,z,H,I,L,f,p,ne,N,_]),se=b.useMemo(()=>({...C,checked:te,disabled:F,readOnly:f,required:p}),[C,te,F,f,p]),ce=fC(`span`,e,{state:se,ref:[t,ee,re],props:[ae,N.getValidationProps,x,U],stateAttributesMapping:uP});return(0,y.jsxs)(sP.Provider,{value:se,children:[ce,!te&&I&&g!==void 0&&(0,y.jsx)(`input`,{type:`hidden`,form:o,name:I,value:g}),(0,y.jsx)(`input`,{...oe,suppressHydrationWarning:!0})]})}),fP=b.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{state:o}=DC(),s=cP();return fC(`span`,e,{state:{...o,...s},ref:t,stateAttributesMapping:uP,props:a})});function pP({className:e,size:t=`default`,...n}){return(0,y.jsx)(dP,{"data-slot":`switch`,"data-size":t,className:qx(`peer group/switch relative inline-flex shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:bg-primary data-unchecked:bg-input dark:data-unchecked:bg-input/80 data-disabled:cursor-not-allowed data-disabled:opacity-50`,e),...n,children:(0,y.jsx)(fP,{"data-slot":`switch-thumb`,className:`pointer-events-none block rounded-full bg-background ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%_-_2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%_-_2px)] dark:data-checked:bg-primary-foreground group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 dark:data-unchecked:bg-foreground`})})}var mP=b.createContext(void 0);function hP(e){let t=b.useContext(mP);if(t===void 0&&!e)throw Error(WS(72));return t}var gP={...kk,disabled:$(e=>e.disabled),instantType:$(e=>e.instantType),isInstantPhase:$(e=>e.isInstantPhase),trackCursorAxis:$(e=>e.trackCursorAxis),disableHoverablePopup:$(e=>e.disableHoverablePopup),lastOpenChangeReason:$(e=>e.openChangeReason),closeOnClick:$(e=>e.closeOnClick),closeDelay:$(e=>e.closeDelay),hasViewport:$(e=>e.hasViewport)},_P=class e extends vk{constructor(e){super({...vP(),...e},{popupRef:b.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:new Tk},gP)}setOpen=(e,t)=>{let n=t.reason,r=n===nE,i=e&&n===`trigger-focus`,a=!e&&(n===`trigger-press`||n===`escape-key`);if(t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let o=()=>{let r={open:e,openChangeReason:n};i?r.instantType=`focus`:a?r.instantType=`dismiss`:n===`trigger-hover`&&(r.instantType=void 0);let o=t.trigger?.id??null;(o||e)&&(r.activeTriggerId=o,r.activeTriggerElement=t.trigger??null),this.update(r)};r?JT.flushSync(o):o()};static useStore(t,n){let r=bS(()=>new e(n)).current,i=t??r,a=Mk({popupStore:i,onOpenChange:i.setOpen});return i.state.floatingRootContext=a,i}};function vP(){return{...Dk(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:`none`,disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,hasViewport:!1}}var yP=sk(function(e){let{disabled:t=!1,defaultOpen:n=!1,open:r,disableHoverablePopup:i=!1,trackCursorAxis:a=`none`,actionsRef:o,onOpenChange:s,onOpenChangeComplete:c,handle:l,triggerId:u,defaultTriggerId:d=null,children:f}=e,p=_P.useStore(l?.store,{open:n,openProp:r,activeTriggerId:d,triggerIdProp:u});EE(()=>{r===void 0&&p.state.open===!1&&n===!0&&p.update({open:!0,activeTriggerId:d})}),p.useControlledProp(`openProp`,r),p.useControlledProp(`triggerIdProp`,u),p.useContextCallback(`onOpenChange`,s),p.useContextCallback(`onOpenChangeComplete`,c);let m=p.useState(`open`),h=!t&&m,g=p.useState(`activeTriggerId`),_=p.useState(`payload`);p.useSyncedValues({trackCursorAxis:a,disableHoverablePopup:i}),Q(()=>{m&&t&&p.setOpen(!1,mE(dE))},[m,t,p]),p.useSyncedValue(`disabled`,t),Ck(p);let{forceUnmount:v,transitionStatus:x}=wk(h,p),S=p.select(`floatingRootContext`),C=p.useState(`isInstantPhase`),w=p.useState(`instantType`),T=p.useState(`lastOpenChangeReason`),E=b.useRef(null);Q(()=>{x===`ending`&&T===`none`||x!==`ending`&&C?(w!==`delay`&&(E.current=w),p.set(`instantType`,`delay`)):E.current!==null&&(p.set(`instantType`,E.current),E.current=null)},[x,C,T,w,p]),Q(()=>{h&&(g??p.set(`payload`,void 0))},[p,g,h]);let D=b.useCallback(()=>{p.setOpen(!1,mE(fE))},[p]);b.useImperativeHandle(o,()=>({unmount:v,close:D}),[v,D]);let{getReferenceProps:O,getFloatingProps:k,getTriggerProps:A}=Uk([UD(S,{enabled:!t,referencePress:()=>p.select(`closeOnClick`)}),zD(S,{enabled:!t&&a!==`none`,axis:a===`none`?void 0:a})]),j=b.useMemo(()=>O(),[O]),M=b.useMemo(()=>A(),[A]),N=b.useMemo(()=>k(),[k]);return p.useSyncedValues({activeTriggerProps:j,inactiveTriggerProps:M,popupProps:N}),(0,y.jsx)(mP.Provider,{value:p,children:typeof f==`function`?f({payload:_}):f})}),bP=b.createContext(void 0);function xP(){return b.useContext(bP)}var SP=function(e){return e[e.popupOpen=CA.popupOpen]=`popupOpen`,e.triggerDisabled=`data-trigger-disabled`,e}({}),CP=ck(function(e,t){let{className:n,render:r,handle:i,payload:a,disabled:o,delay:s,closeOnClick:c=!0,closeDelay:l,id:u,style:d,...f}=e,p=hP(!0),m=i?.store??p;if(!m)throw Error(WS(82));let h=PC(u),g=m.useState(`isTriggerActive`,h),_=m.useState(`isOpenedByTrigger`,h),v=m.useState(`floatingRootContext`),y=b.useRef(null),x=s??600,S=l??0,{registerTrigger:C,isMountedByThisTrigger:w}=Sk(h,y,m,{payload:a,closeOnClick:c,closeDelay:S}),T=xP(),{delayRef:E,isInstantPhase:D,hasProvider:O}=UE(v,{open:_});m.useSyncedValue(`isInstantPhase`,D);let k=m.useState(`disabled`),A=o??k,j=m.useState(`trackCursorAxis`),M=m.useState(`disableHoverablePopup`),N=Hk(v,{enabled:!A,mouseOnly:!0,move:!1,handleClose:!M&&j!==`both`?lA():null,restMs(){let e=T?.delay,t=typeof E.current==`object`?E.current.open:void 0,n=x;return O&&(n=t===0?0:s??e??x),n},delay(){let e=typeof E.current==`object`?E.current.close:void 0,t=S;return l==null&&O&&(t=e),{close:t}},triggerElementRef:y,isActiveTrigger:g,isClosing:()=>m.select(`transitionStatus`)===`ending`}),P=Pk(v,{enabled:!A}).reference,F={open:_},I=m.useState(`triggerProps`,w);return fC(`button`,e,{state:F,ref:[t,C,y],props:[N,P,I,{onPointerDown(){m.set(`closeOnClick`,c)},id:h,[SP.triggerDisabled]:A?``:void 0},f],stateAttributesMapping:kA})}),wP=b.createContext(void 0);function TP(){let e=b.useContext(wP);if(e===void 0)throw Error(WS(70));return e}var EP=b.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,style:o,...s}=e,{portalNode:c,portalSubtree:l}=bD({container:r,ref:t,componentProps:e,elementProps:s});return!l&&!c?null:(0,y.jsxs)(b.Fragment,{children:[l,c&&JT.createPortal(n,c)]})}),DP=b.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return hP().useState(`mounted`)||n?(0,y.jsx)(wP.Provider,{value:n,children:(0,y.jsx)(EP,{ref:t,...r})}):null}),OP=b.createContext(void 0);function kP(){let e=b.useContext(OP);if(e===void 0)throw Error(WS(71));return e}var AP=b.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a=`absolute`,side:o=`top`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=hD,style:g,..._}=e,v=hP(),x=TP(),S=v.useState(`open`),C=v.useState(`mounted`),w=v.useState(`trackCursorAxis`),T=v.useState(`disableHoverablePopup`),E=v.useState(`floatingRootContext`),D=v.useState(`instantType`),O=v.useState(`transitionStatus`),k=LM({anchor:i,positionMethod:a,floatingRootContext:E,mounted:C,side:o,sideOffset:c,align:s,alignOffset:l,collisionBoundary:u,collisionPadding:d,sticky:p,arrowPadding:f,disableAnchorTracking:m,keepMounted:x,collisionAvoidance:h,adaptiveOrigin:v.useState(`hasViewport`)?PM:void 0}),A=WM(e,b.useMemo(()=>({open:S,side:k.side,align:k.align,anchorHidden:k.anchorHidden,instant:w===`none`?D:`tracking-cursor`}),[S,k.side,k.align,k.anchorHidden,w,D]),{styles:k.positionerStyles,transitionStatus:O,props:_,refs:[t,v.useStateSetter(`positionerElement`)],hidden:!C,inert:!S||w===`both`||T});return(0,y.jsx)(OP.Provider,{value:k,children:A})}),jP={...jA,...qT},MP=b.forwardRef(function(e,t){let{className:n,render:r,style:i,...a}=e,o=hP(),{side:s,align:c}=kP(),l=o.useState(`open`),u=o.useState(`instantType`),d=o.useState(`transitionStatus`),f=o.useState(`popupProps`),p=o.useState(`floatingRootContext`);XT({open:l,ref:o.context.popupRef,onComplete(){l&&o.context.onOpenChangeComplete?.(!0)}});let m=o.useState(`disabled`),h=o.useState(`closeDelay`);return Bk(p,{enabled:!m,closeDelay:h}),fC(`div`,e,{state:{open:l,side:s,align:c,instant:u,transitionStatus:d},ref:[t,o.context.popupRef,o.useStateSetter(`popupElement`)],props:[f,UM(d),a],stateAttributesMapping:jP})}),NP=b.forwardRef(function(e,t){let{className:n,render:r,style:i,...a}=e,o=hP(),s=o.useState(`open`),c=o.useState(`instantType`),{arrowRef:l,side:u,align:d,arrowUncentered:f,arrowStyles:p}=kP();return fC(`div`,e,{state:{open:s,side:u,align:d,uncentered:f,instant:c},ref:[t,l],props:[{style:p,"aria-hidden":!0},a],stateAttributesMapping:jA})}),PP=function(e){let{delay:t,closeDelay:n,timeout:r=400}=e,i=b.useMemo(()=>({delay:t,closeDelay:n}),[t,n]),a=b.useMemo(()=>({open:t,close:n}),[t,n]);return(0,y.jsx)(bP.Provider,{value:i,children:(0,y.jsx)(HE,{delay:a,timeoutMs:r,children:e.children})})};function FP({delay:e=0,...t}){return(0,y.jsx)(PP,{"data-slot":`tooltip-provider`,delay:e,...t})}function IP({...e}){return(0,y.jsx)(yP,{"data-slot":`tooltip`,...e})}function LP({...e}){return(0,y.jsx)(CP,{"data-slot":`tooltip-trigger`,...e})}function RP({className:e,side:t=`top`,sideOffset:n=4,align:r=`center`,alignOffset:i=0,children:a,...o}){return(0,y.jsx)(DP,{children:(0,y.jsx)(AP,{align:r,alignOffset:i,side:t,sideOffset:n,className:`isolate z-50`,children:(0,y.jsxs)(MP,{"data-slot":`tooltip-content`,className:qx(`z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...o,children:[a,(0,y.jsx)(NP,{className:`z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5`})]})})})}var zP=`text-[10px] font-medium tracking-wide text-muted-foreground/70 uppercase`,BP=`text-xs font-normal text-muted-foreground`,VP=Object.fromEntries(kd.map(e=>[e.id,{fontFamily:e.family}])),HP=Pd.map(e=>({id:e.id,label:e.name})),UP=kd.map(e=>({id:e.id,label:e.name,itemStyle:VP[e.id]})),WP=e=>({id:pd,label:(0,y.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,y.jsx)(`span`,{className:`truncate`,children:e}),(0,y.jsx)(IN,{variant:`secondary`,className:`h-4 px-1.5 text-[10px] font-medium`,children:`Local`})]}),itemStyle:{fontFamily:`"${Cd(e)}", ui-monospace, monospace`}}),GP=gf.map(e=>({id:e.id,label:e.name})),KP=bf.map(e=>({id:String(e.value),label:e.label})),qP=e=>e.toFixed(1),JP=({label:e,value:t,title:n,valueClassName:r})=>(0,y.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3`,children:[(0,y.jsx)(`dt`,{className:BP,children:e}),(0,y.jsx)(`dd`,{title:n??t,className:qx(`min-w-0 truncate text-right text-foreground/90`,r),children:t})]}),YP=({themeId:e,onThemeChange:t,onThemePreview:n,fontId:r,onFontChange:i,onFontPreview:a,localFontFamily:o,onLocalFontChange:s,fontSize:c,onFontSizeChange:l,lineHeight:u,onLineHeightChange:d,cursorStyle:f,onCursorStyleChange:p,onCursorStylePreview:m,cursorBlink:h,onCursorBlinkChange:g,scrollback:_,onScrollbackChange:v,scrollOnUserInput:x,onScrollOnUserInputChange:S,sessionInfo:C})=>{let[w,T]=(0,b.useState)(!1),[E,D]=(0,b.useState)(!1),[O,k]=(0,b.useState)(!1),A=(0,b.useMemo)(()=>r!==`local`||!o?UP:[...UP,WP(o)],[r,o]);return(0,y.jsxs)(pj,{open:w,onOpenChange:e=>{T(e),e||(D(!1),k(!1),n?.(null),a?.(null),m?.(null))},children:[(0,y.jsxs)(IP,{children:[(0,y.jsx)(LP,{render:(0,y.jsx)(mj,{render:(0,y.jsx)(bC,{variant:`ghost`,size:`icon-sm`,"aria-label":`terminal settings`,className:`hover:text-foreground`})}),children:(0,y.jsx)(gb,{})}),w?null:(0,y.jsx)(RP,{side:`bottom`,sideOffset:8,children:`Settings`})]}),(0,y.jsxs)(_j,{className:qx(`max-h-[calc(100dvh-2rem)] gap-0 overflow-y-auto p-4 sm:max-w-md`,bj),children:[(0,y.jsx)(vj,{className:`mb-4 pr-8`,children:(0,y.jsx)(yj,{children:`Settings`})}),(0,y.jsxs)(rP,{className:`gap-3`,children:[(0,y.jsxs)(aP,{orientation:`vertical`,className:`gap-1.5`,children:[(0,y.jsx)(oP,{className:zP,children:`Theme`}),(0,y.jsx)(PN,{value:e,items:HP,ariaLabel:`select theme`,placeholder:`Theme`,onValueChange:e=>{e&&t(e)},onOpenChange:e=>{e||n?.(null)},onItemHover:n??void 0})]}),(0,y.jsx)(Nj,{className:`bg-border/40`}),(0,y.jsxs)(aP,{orientation:`vertical`,className:`gap-1.5`,children:[(0,y.jsx)(oP,{className:zP,children:`Font`}),(0,y.jsx)(PN,{value:r,items:A,ariaLabel:`select font`,placeholder:`Font`,open:E,onValueChange:e=>{e&&i(e)},onOpenChange:e=>{D(e),e||a?.(null)},onItemHover:a??void 0,footerSlot:(0,y.jsxs)(`button`,{type:`button`,className:`flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-xs text-muted-foreground outline-none transition-colors hover:bg-foreground/10 hover:text-foreground focus-visible:bg-foreground/10 focus-visible:text-foreground`,onClick:()=>{D(!1),k(!0)},children:[(0,y.jsx)(pb,{className:`size-3`}),(0,y.jsx)(`span`,{children:`Local font…`})]})}),(0,y.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,y.jsx)(`span`,{className:BP,children:`Size`}),(0,y.jsx)(Vj,{value:c,min:9,max:24,step:1,ariaLabel:`terminal font size`,decrementAriaLabel:`decrease font size`,incrementAriaLabel:`increase font size`,onValueChange:l})]}),(0,y.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,y.jsx)(`span`,{className:BP,children:`Line height`}),(0,y.jsx)(Vj,{value:u,min:1,max:2,step:id,ariaLabel:`terminal line height`,decrementAriaLabel:`decrease line height`,incrementAriaLabel:`increase line height`,formatDisplay:qP,onValueChange:d})]})]}),(0,y.jsx)(Nj,{className:`bg-border/40`}),(0,y.jsxs)(aP,{orientation:`vertical`,className:`gap-1.5`,children:[(0,y.jsx)(oP,{className:zP,children:`Cursor`}),(0,y.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,y.jsx)(`span`,{className:BP,children:`Style`}),(0,y.jsx)(PN,{value:f,items:GP,ariaLabel:`select cursor style`,placeholder:`Cursor style`,triggerClassName:`w-fit min-w-[7rem]`,onValueChange:e=>{yf(e)&&p(e)},onOpenChange:e=>{e||m?.(null)},onItemHover:m?e=>{yf(e)&&m?.(e)}:void 0})]}),(0,y.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,y.jsx)(`span`,{className:BP,children:`Blink`}),(0,y.jsx)(pP,{"aria-label":`toggle cursor blink`,checked:h,onCheckedChange:g})]})]}),(0,y.jsx)(Nj,{className:`bg-border/40`}),(0,y.jsxs)(aP,{orientation:`vertical`,className:`gap-1.5`,children:[(0,y.jsx)(oP,{className:zP,children:`Scrollback`}),(0,y.jsx)(PN,{value:String(_),items:KP,ariaLabel:`select scrollback`,placeholder:`Scrollback`,onValueChange:e=>{if(e===null)return;let t=Number(e);Cf(t)&&v(t)}}),(0,y.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,y.jsxs)(IP,{children:[(0,y.jsx)(LP,{render:(0,y.jsx)(`span`,{className:BP}),children:`Pin to bottom on input`}),(0,y.jsx)(RP,{side:`bottom`,sideOffset:8,className:`max-w-xs`,children:`When on, typing scrolls the viewport back to the bottom. When off, the viewport stays where you scrolled — useful for reading history while typing.`})]}),(0,y.jsx)(pP,{"aria-label":`toggle pin to bottom on input`,checked:x,onCheckedChange:S})]})]}),C?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(Nj,{className:`bg-border/40`}),(0,y.jsxs)($N,{defaultOpen:!1,children:[(0,y.jsx)(eP,{render:(0,y.jsxs)(`button`,{type:`button`,className:`group/shell flex w-full items-center justify-between gap-2 rounded-sm py-1 text-left transition-colors outline-none hover:text-foreground/90 focus-visible:text-foreground/90`,children:[(0,y.jsx)(`span`,{className:zP,children:`Shell`}),(0,y.jsx)(cb,{className:`size-3 text-muted-foreground/60 transition-transform duration-200 ease-snappy will-change-transform group-aria-expanded/shell:rotate-180`})]})}),(0,y.jsx)(tP,{className:`h-(--collapsible-panel-height) overflow-hidden transition-[height] duration-200 ease-snappy data-closed:h-0`,children:(0,y.jsxs)(`dl`,{className:`flex flex-col gap-1 pt-2 text-xs`,children:[(0,y.jsx)(JP,{label:`Name`,value:C.shellName}),(0,y.jsx)(JP,{label:`Path`,value:C.shell,title:C.shell}),(0,y.jsx)(JP,{label:`PID`,value:String(C.pid),valueClassName:`tabular-nums`}),(0,y.jsx)(JP,{label:`Cwd`,value:C.cwd,title:C.cwd})]})})]})]}):null]})]}),(0,y.jsx)(Aj,{open:O,onOpenChange:k,currentFamily:o,onApply:s})]})},XP=({activeThemeId:e,onThemeChange:t,onThemePreview:n,activeFontId:r,onFontChange:i,onFontPreview:a,activeLocalFontFamily:o,onLocalFontChange:s,activeFontSize:c,onFontSizeChange:l,activeLineHeight:u,onLineHeightChange:d,activeCursorStyle:f,onCursorStyleChange:p,onCursorStylePreview:m,activeCursorBlink:h,onCursorBlinkChange:g,activeScrollback:_,onScrollbackChange:v,activeScrollOnUserInput:b,onScrollOnUserInputChange:x,sessionInfo:S,newTabUrl:C,onOpenSearch:w,isMac:T,isSearchOpen:E})=>E?null:(0,y.jsxs)(`div`,{role:`toolbar`,"aria-label":`terminal actions`,"data-terminal-toolbar":!0,className:`absolute top-2 right-3 z-10 flex items-center gap-0.5 rounded-md border border-border/60 bg-background/70 p-0.5 text-muted-foreground shadow-xs backdrop-blur-md`,children:[(0,y.jsx)(YP,{themeId:e,onThemeChange:t,onThemePreview:n,fontId:r,onFontChange:i,onFontPreview:a,localFontFamily:o,onLocalFontChange:s,fontSize:c,onFontSizeChange:l,lineHeight:u,onLineHeightChange:d,cursorStyle:f,onCursorStyleChange:p,onCursorStylePreview:m,cursorBlink:h,onCursorBlinkChange:g,scrollback:_,onScrollbackChange:v,scrollOnUserInput:b,onScrollOnUserInputChange:x,sessionInfo:S}),(0,y.jsxs)(IP,{children:[(0,y.jsx)(LP,{render:(0,y.jsx)(bC,{variant:`ghost`,size:`icon-sm`,onClick:w,"aria-label":`find in terminal`,className:`hover:text-foreground`}),children:(0,y.jsx)(hb,{})}),(0,y.jsxs)(RP,{side:`bottom`,sideOffset:8,children:[`Find `,T?`(⌘F)`:`(Ctrl+F)`]})]}),(0,y.jsxs)(IP,{children:[(0,y.jsx)(LP,{render:(0,y.jsx)(bC,{variant:`ghost`,size:`icon-sm`,nativeButton:!1,"aria-label":`open a new shell in a new browser tab`,render:(0,y.jsx)(`a`,{href:C,target:`_blank`,rel:`noopener noreferrer`}),className:`hover:text-foreground`}),children:(0,y.jsx)(mb,{})}),(0,y.jsx)(RP,{side:`bottom`,sideOffset:8,children:`New shell (new tab)`})]})]}),ZP=async e=>{if(!(typeof document>`u`)&&e.name)try{await Promise.all([document.fonts.load(`16px "${e.name}"`),document.fonts.load(`bold 16px "${e.name}"`)])}catch{}},QP=(e,t,n,r)=>{n?.clearTextureAtlas(),e.options.fontFamily=``,e.options.fontFamily=r,Yy(e,t),n?.clearTextureAtlas()},$P=(e,t)=>{let n=null,r=()=>{n=null,e.style.height=`${t.height}px`,e.style.transform=t.offsetTop?`translateY(${t.offsetTop}px)`:``},i=()=>{n===null&&(n=window.requestAnimationFrame(r))};return i(),t.addEventListener(`resize`,i),t.addEventListener(`scroll`,i),()=>{n!==null&&window.cancelAnimationFrame(n),t.removeEventListener(`resize`,i),t.removeEventListener(`scroll`,i),e.style.height=``,e.style.transform=``}},eF=()=>typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(`(pointer: coarse)`).matches,tF=()=>typeof navigator<`u`&&navigator.vendor===`Apple Computer, Inc.`,nF=()=>{if(typeof navigator>`u`)return!1;let e=navigator.platform||navigator.userAgent||``;return/Mac|iPhone|iPad|iPod/i.test(e)},rF=()=>({isMac:(0,b.useMemo)(nF,[]),isTouchDevice:(0,b.useMemo)(eF,[]),isAppleWebKit:(0,b.useMemo)(tF,[])}),iF=(e,t,n)=>{(0,b.useEffect)(()=>{if(!t||!n)return;let r=e.current,i=window.visualViewport;if(!(!r||!i))return $P(r,i)},[t,n,e])},aF=(e,t,n,r)=>{(0,b.useEffect)(()=>{let i=e.current;if(!i)return;i.options.fontSize=n,i.options.lineHeight=r;let a=t.current;a&&Yy(i,a)},[n,r,e,t])},oF=(e,t,n,r,i,a)=>{(0,b.useEffect)(()=>{let o=e.current;o&&(o.options.theme=t.colors,o.options.cursorStyle=n,o.options.cursorBlink=r,o.options.scrollback=i,o.options.scrollOnUserInput=a)},[t,n,r,i,a,e])},sF=(e,t,n,r)=>{(0,b.useEffect)(()=>{if(!e.current)return;let i=!1;return ZP(r).then(()=>{if(i)return;let a=e.current;if(!a)return;let o=t.current;o&&QP(a,o,n.current,r.family)}),()=>{i=!0}},[r,e,t,n])},cF=(e,t)=>{(0,b.useEffect)(()=>()=>{e.current!==null&&(window.clearTimeout(e.current),e.current=null),t.current!==null&&(window.clearTimeout(t.current),t.current=null)},[e,t])},lF=e=>{(0,b.useEffect)(()=>{if(!e)return;let t=new URL(window.location.href);t.searchParams.set(`cwd`,e),window.history.replaceState(null,``,t)},[e])},uF=(e,t,n)=>{(0,b.useEffect)(()=>{if(!e)return;let t=n.current;t&&(t.focus(),t.select())},[e,t,n])},dF=(e,t,n)=>{(0,b.useEffect)(()=>{if(!e)return;let r=window.setInterval(()=>{t()},n);return()=>window.clearInterval(r)},[e,t,n])},fF=(e,t)=>{(0,b.useEffect)(()=>{t?.(e)},[e,t])},pF=({onModalOpenChange:e}={})=>{let t=(0,b.useRef)(null),n=(0,b.useRef)(null),r=(0,b.useRef)(null),i=(0,b.useRef)(null),a=(0,b.useRef)(null),o=(0,b.useRef)(null),s=(0,b.useRef)(null),c=(0,b.useRef)(null),l=(0,b.useRef)(null),u=(0,b.useRef)(!1),d=(0,b.useRef)(null),f=(0,b.useRef)(null),p=(0,b.useRef)(null),m=(0,b.useRef)(null),h=(0,b.useRef)(Of()),g=(0,b.useRef)(jf()),_=(0,b.useRef)(Tf()),v=(0,b.useRef)(Pf()),x=(0,b.useRef)(Lf()),C=(0,b.useRef)(Bf()),w=(0,b.useRef)(Uf()),T=(0,b.useRef)(Kf()),E=(0,b.useRef)(Yf()),[O,k]=(0,b.useState)(null),[A,j]=(0,b.useState)(0),[M,N]=(0,b.useState)(!1),[P,F]=(0,b.useState)(!1),[I,L]=(0,b.useState)(!1),[R,z]=(0,b.useState)(0),[ee,B]=(0,b.useState)(``),[V,H]=(0,b.useState)({resultIndex:-1,resultCount:0}),[te,ne]=(0,b.useState)(h.current),[U,re]=(0,b.useState)(null),[ie,ae]=(0,b.useState)(g.current),[oe,se]=(0,b.useState)(_.current),[ce,le]=(0,b.useState)(null),[ue,de]=(0,b.useState)(v.current),[fe,pe]=(0,b.useState)(x.current),[me,he]=(0,b.useState)(C.current),[ge,_e]=(0,b.useState)(null),[ve,ye]=(0,b.useState)(w.current),[be,xe]=(0,b.useState)(T.current),[Se,Ce]=(0,b.useState)(E.current),[we,Te]=(0,b.useState)(null),[Ee,De]=(0,b.useState)(null),{isMac:Oe,isTouchDevice:ke,isAppleWebKit:Ae}=rF();iF(t,ke,Ae);let je=U??te,Me=(0,b.useMemo)(()=>Id(je),[je]),Ne=ce??ie,Pe=(0,b.useMemo)(()=>jd(Ne,oe),[Ne,oe]),Fe=ge??me,Ie=Me.colors.background??`#101010`,Le=(0,b.useMemo)(()=>zy(Ee),[Ee]);(0,b.useEffect)(()=>{let e=n.current;if(!e)return;let t=!1,s=!1,c=``,l=null,y=null,b=null,O=null,A=`idle`,M=new AbortController,N=!1,P=e=>{l?.readyState===WebSocket.OPEN&&l.send(JSON.stringify(e))},F=()=>{O!==null&&(window.clearTimeout(O),O=null),A===`idle`&&b===null&&(b=window.setTimeout(()=>{b=null,!(t||s)&&(A=`active`,pf(`active`))},250)),O=window.setTimeout(()=>{O=null,b!==null&&(window.clearTimeout(b),b=null),A===`active`&&(A=`idle`,pf(`idle`))},750)},I=()=>{b!==null&&(window.clearTimeout(b),b=null),O!==null&&(window.clearTimeout(O),O=null),A===`active`&&(A=`idle`,pf(`idle`))},L=jd(g.current,_.current),R=new ed({allowProposedApi:!0,cursorBlink:w.current,cursorStyle:C.current,fontFamily:L.family,fontSize:v.current,lineHeight:x.current,scrollback:T.current,theme:Id(h.current).colors,macOptionIsMeta:!0,scrollOnUserInput:E.current});r.current=R;let z=new D;i.current=z,R.loadAddon(z),R.loadAddon(new Nn),R.loadAddon(new S),R.loadAddon(new qe),R.loadAddon(new Ye),R.loadAddon(new Dn);let ee=new ut;R.loadAddon(ee),o.current=ee;let B=ee.onDidChangeResults(H);R.open(e);try{let e=new aa;e.onContextLoss(()=>{a.current===e&&(a.current=null),e.dispose()}),R.loadAddon(e),a.current=e}catch{a.current=null}let V=R.textarea;V&&(V.autocomplete=`off`,V.setAttribute(`autocapitalize`,`off`),V.setAttribute(`autocorrect`,`off`),V.spellcheck=!1);let te=0,ne=0,U=!1,re=()=>{R.textarea&&(R.textarea.inputMode=``),R.focus()},ie=()=>{ke&&R.textarea&&(R.textarea.inputMode=`none`),R.focus()};if(f.current=ie,ke){let e=M.signal,t=()=>{R.textarea&&(R.textarea.inputMode=`none`)},n=()=>{R.textarea&&(R.textarea.blur(),R.textarea.inputMode=`none`)};t(),R.textarea?.addEventListener(`blur`,t,{signal:e});let r=window.visualViewport;if(r){let t=r.height,i=r.width;r.addEventListener(`resize`,()=>{let e=r.height,a=r.width,o=e>t+150,s=Math.abs(a-i)<20;o&&s&&n(),t=e,i=a},{signal:e})}R.element?.addEventListener(`touchstart`,e=>{if(e.touches.length!==1){U=!0;return}te=e.touches[0].clientX,ne=e.touches[0].clientY,U=!1},{capture:!0,passive:!0,signal:e}),R.element?.addEventListener(`touchmove`,e=>{if(e.touches.length!==1){U=!0;return}Math.hypot(e.touches[0].clientX-te,e.touches[0].clientY-ne)>10&&(U=!0)},{capture:!0,passive:!0,signal:e}),R.element?.addEventListener(`touchend`,e=>{if(U){e.preventDefault();return}re()},{capture:!0,passive:!1,signal:e})}let ae=Wy(R);R.parser.registerCsiHandler({final:`J`},mf),R.parser.registerCsiHandler({prefix:`?`,final:`J`},mf);let oe=Xy({terminal:R,fitAddon:z,sendResize:(e,t)=>P({type:`resize`,cols:e,rows:t}),resizeDebounceMs:80}),se=By({terminalWrite:(e,t)=>R.write(e,t),sendFlowPause:()=>P({type:`flow-pause`}),sendFlowResume:()=>P({type:`flow-resume`}),captureScrollAnchor:()=>oe.captureAnchor(),restoreScrollAnchor:e=>oe.restoreAnchor(e),hasScrollRestore:()=>oe.hasResizeRestore(),restoreScrollFromResize:()=>oe.restoreResizeScroll(),isExited:()=>s});Gy(R,{isMac:Oe,getKittyFlags:()=>ae.getFlags(),openFindOverlay:()=>d.current?.(),sendInput:e=>P({type:`input`,data:e}),isTouchDevice:ke}),Ky(R);let ce=R.onTitleChange(e=>{if(s)return;let t=e.trim();t&&(c=t,document.title=t||`localterm`)});R.onData(e=>{for(let t of Ld(e,Zf))P({type:`input`,data:t})}),R.onResize(({cols:e,rows:t})=>P({type:`resize`,cols:e,rows:t}));let le=new ResizeObserver(()=>oe.scheduleFit());le.observe(e),oe.fitToContainer(),ie();let ue=e=>{s||(s=!0,I(),pf(`dead`),R.write(Ud(e)),document.title=`† ${c||`localterm`}`,k({reason:`shell-exited`,exitCode:e}),Te(null))},de=(e,t,n)=>{s||(s=!0,I(),pf(`dead`),R.write(Hd(e,t)),document.title=`† ${c||`localterm`}`,k({reason:`connection-lost`,closeCode:e,closeReason:t,wasClean:n}),Te(null))},fe=()=>{if(se.clear(),t)return;let e=new WebSocket(Ry(p.current));e.binaryType=`arraybuffer`,l=e,e.addEventListener(`open`,()=>{t||l!==e||(N=!0,j(0),P({type:`resize`,cols:R.cols,rows:R.rows}),u.current=!1)}),e.addEventListener(`message`,n=>{if(t||l!==e)return;if(n.data instanceof ArrayBuffer){se.write(new Uint8Array(n.data)),F();return}if(typeof n.data!=`string`)return;let r;try{r=JSON.parse(n.data)}catch{return}if(typeof r!=`object`||!r||typeof r.type!=`string`)return;let i=r;if(i.type===`output`)se.write(i.data),F();else if(i.type===`title`){let e=i.title.trim();if(!e)return;c=e,document.title=e}else i.type===`session`?(Te({shell:i.shell,shellName:i.shellName,pid:i.pid,cwd:i.cwd}),De(i.cwd)):i.type===`cwd`?De(i.cwd):i.type===`exit`&&(I(),ue(i.code))}),e.addEventListener(`close`,n=>{if(l===e&&(l=null,u.current=!1,!t&&!s)){if(N){console.warn(`[localterm] websocket closed: code=${n.code} reason=${JSON.stringify(n.reason)} wasClean=${n.wasClean}`),de(n.code,n.reason,n.wasClean);return}j(e=>e+1),y=window.setTimeout(fe,td)}}),e.addEventListener(`error`,()=>{console.warn(`[localterm] websocket error`);try{e.close()}catch{}})};return m.current=()=>{if(!t){s=!1,N=!1,k(null),Te(null),j(0),pf(`idle`),y!==null&&(window.clearTimeout(y),y=null);try{l?.close()}catch{}l=null,fe()}},fe(),()=>{t=!0,m.current=null,f.current=null,d.current=null,o.current=null,r.current=null,i.current=null,a.current=null,ce.dispose(),B.dispose(),M.abort(),oe.cleanupResizeScroll(),I(),y!==null&&window.clearTimeout(y),le.disconnect();try{l?.close()}catch{}l=null,R.dispose(),document.title=`localterm`}},[]),aF(r,i,ue,fe),oF(r,Me,Fe,ve,be,Se),sF(r,i,a,Pe),uF(I,R,s),cF(c,l),(0,b.useEffect)(()=>{p.current=Ee},[Ee]),lF(Ee);let Re=(0,b.useCallback)(e=>{ne(e),re(null),kf(e)},[]),ze=(0,b.useCallback)(e=>{ae(e),le(null),Mf(e)},[]),Be=(0,b.useCallback)(e=>{se(e),ae(pd),le(null),Ef(e),Mf(pd)},[]),Ve=(0,b.useCallback)(e=>{let t=Rd(e);de(t),Ff(t)},[]),He=(0,b.useCallback)(e=>{let t=Vd(e);pe(t),Rf(t)},[]),Ue=(0,b.useCallback)(e=>{he(e),_e(null),Vf(e)},[]),We=(0,b.useCallback)(e=>{ye(e),Wf(e)},[]),Ge=(0,b.useCallback)(e=>{xe(e),qf(e)},[]),Ke=(0,b.useCallback)(e=>{Ce(e),Xf(e)},[]),Je=(0,b.useCallback)(e=>{if(!e){o.current?.clearDecorations(),H({resultIndex:-1,resultCount:0});return}o.current?.findNext(e)},[]),Xe=(0,b.useCallback)(e=>{e&&o.current?.findPrevious(e)},[]),Ze=(0,b.useCallback)(()=>{L(!1),B(``),H({resultIndex:-1,resultCount:0}),o.current?.clearDecorations(),f.current?.()},[]),Qe=(0,b.useCallback)(()=>{L(!0),z(e=>e+1)},[]);d.current=Qe;let $e=(0,b.useCallback)(e=>{let t=e.target.value;B(t),Je(t)},[Je]),et=(0,b.useCallback)(e=>{if(Wd(e.nativeEvent,Oe)){e.preventDefault(),e.currentTarget.select();return}if(e.key===`Escape`){e.preventDefault(),Ze();return}e.key===`Enter`&&(e.preventDefault(),e.shiftKey?Xe(ee):Je(ee))},[Ze,Je,Xe,Oe,ee]),tt=(0,b.useCallback)(()=>{u.current||(u.current=!0,F(!0),m.current?.(),c.current!==null&&window.clearTimeout(c.current),c.current=window.setTimeout(()=>{c.current=null,F(!1)},800))},[]),nt=(0,b.useCallback)(()=>{navigator.clipboard.writeText(ad).then(()=>{N(!0),l.current!==null&&window.clearTimeout(l.current),l.current=window.setTimeout(()=>{l.current=null,N(!1)},od)}).catch(()=>{})},[]),rt=O!==null,it=rt||!rt&&A>=2;return dF(O!==null&&O.reason!==`shell-exited`,tt,sd),fF(it,e),(0,y.jsxs)(`main`,{ref:t,className:`h-dvh w-dvw pt-[env(safe-area-inset-top)] pr-[env(safe-area-inset-right)] pb-[env(safe-area-inset-bottom)] pl-[env(safe-area-inset-left)]`,style:{background:Ie},children:[(0,y.jsxs)(`div`,{className:`relative h-full w-full`,children:[(0,y.jsx)(`div`,{ref:n,"aria-label":`terminal session`,className:`absolute inset-0`}),rt&&O?(0,y.jsx)(`span`,{role:`status`,"aria-live":`polite`,className:`absolute top-2 left-3 z-10 inline-flex items-center rounded-md border border-red-500/30 bg-red-500/10 px-2 py-0.5 text-xs font-medium text-red-400`,children:O.reason===`shell-exited`?O.exitCode===null?`exited`:`exited · code ${O.exitCode}`:`disconnected · code ${O.closeCode}`}):null,(0,y.jsx)(XP,{activeThemeId:te,onThemeChange:Re,onThemePreview:re,activeFontId:ie,onFontChange:ze,onFontPreview:le,activeLocalFontFamily:oe,onLocalFontChange:Be,activeFontSize:ue,onFontSizeChange:Ve,activeLineHeight:fe,onLineHeightChange:He,activeCursorStyle:me,onCursorStyleChange:Ue,onCursorStylePreview:_e,activeCursorBlink:ve,onCursorBlinkChange:We,activeScrollback:be,onScrollbackChange:Ge,activeScrollOnUserInput:Se,onScrollOnUserInputChange:Ke,sessionInfo:we,newTabUrl:Le,onOpenSearch:Qe,isMac:Oe,isSearchOpen:I}),(0,y.jsx)(TE,{searchInputRef:s,searchQuery:ee,searchResults:V,onSearchChange:$e,onKeyDown:et,onFindNext:()=>Je(ee),onFindPrevious:()=>Xe(ee)})]}),(0,y.jsx)(fj,{isModalOpen:it,exitInfo:O,isRetryingConnection:P,hasCopiedRestartCommand:M,newTabUrl:Le,onReconnect:tt,onCopyRestartCommand:nt})]})},mF=()=>{let e=(0,b.useRef)(!1);return(0,b.useEffect)(()=>{let t=t=>{e.current||(t.preventDefault(),t.returnValue=``)};return window.addEventListener(`beforeunload`,t),()=>{window.removeEventListener(`beforeunload`,t)}},[]),(0,y.jsx)(pF,{onModalOpenChange:(0,b.useCallback)(t=>{e.current=t},[])})},hF=null,gF=null,_F=()=>hF||(typeof BroadcastChannel>`u`||typeof crypto>`u`||typeof crypto.randomUUID!=`function`?null:(gF=crypto.randomUUID(),hF=new BroadcastChannel(ld),hF.addEventListener(`message`,e=>{let t=e.data,n=sf();t.type===`ping`&&t.tabId!==gF&&t.hue===n&&hF&&gF&&hF.postMessage({type:`claimed`,tabId:gF,hue:n})}),hF));ff(),pf(`idle`),(()=>{let e=_F();if(!e||!gF)return()=>{};let t=sf(),n=new Set,r=e=>{let r=e.data;r.type===`claimed`&&r.tabId!==gF&&r.hue===t&&n.add(r.hue)};e.addEventListener(`message`,r),e.postMessage({type:`ping`,tabId:gF,hue:t});let i=setTimeout(()=>{if(e.removeEventListener(`message`,r),n.size===0)return;let i=cf([...n]);i!==t&&(lf(i),pf(`idle`))},250);return()=>{clearTimeout(i),e.removeEventListener(`message`,r),hF?.close(),hF=null,gF=null}})(),(()=>{if(typeof document>`u`||document.getElementById(`localterm-google-fonts`))return;let e=Md();if(!e)return;let t=document.createElement(`link`);t.id=bd,t.rel=`stylesheet`,t.href=e,document.head.appendChild(t)})(),((e=!1)=>{e||typeof navigator>`u`||!(`serviceWorker`in navigator)||navigator.serviceWorker.register(`/sw.js`,{scope:`/`}).catch(e=>{console.warn(`[localterm] service worker registration failed`,e)})})();var vF=document.getElementById(`root`);if(!vF)throw Error(`Root element not found`);(0,x.createRoot)(vF,{onCaughtError(e,t){console.error(`[localterm] React caught error:`,e,t)},onUncaughtError(e,t){console.error(`[localterm] React uncaught error:`,e,t)},onRecoverableError(e,t){console.error(`[localterm] React recoverable error:`,e,t)}}).render((0,y.jsx)(b.StrictMode,{children:(0,y.jsx)(FP,{delay:300,children:(0,y.jsx)(mF,{})})}));
|
|
121
|
+
//# sourceMappingURL=index-ePo6BQr3.js.map
|