@tavlo-dsh/dsh-plugin-tapd 0.0.0-stage → 0.5.0

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.
package/lib/client.js ADDED
@@ -0,0 +1,1069 @@
1
+ // Generated by scripts/build-client.mjs. See client.js.LEGAL.txt for third-party notices.
2
+ window.__ModuleLoader__.load({
3
+ id: '@tavlo-dsh/dsh-plugin-tapd',
4
+ factory(require) {
5
+ const { createElement: h, useCallback, useEffect, useId, useRef, useState } = require('react')
6
+ const { Input, Select, Disclosure, ArcStyle } = (()=>{const Pa={exports:{}},ip=`.tapd_arc_accordion_accordion{width:100%;border-top:1px solid var(--border)}.tapd_arc_accordion_item{border-bottom:1px solid var(--border)}.tapd_arc_accordion_header{margin:0}.tapd_arc_accordion_trigger{display:flex;width:100%;min-height:var(--control-height-lg);align-items:center;justify-content:space-between;gap:var(--space-5);padding:var(--space-2) 0;border:0;background:transparent;color:var(--foreground);font:inherit;font-size:var(--text-sm);font-weight:500;line-height:var(--leading-body);text-align:left;cursor:pointer;-webkit-tap-highlight-color:transparent;transition:color var(--duration-fast) var(--ease-standard)}.tapd_arc_accordion_caption{display:flex;flex-wrap:wrap;align-items:baseline;gap:0 var(--space-3);min-width:0}.tapd_arc_accordion_annotation{font-size:var(--text-xs);color:var(--text-muted);font-weight:400}.tapd_arc_accordion_trigger:focus-visible{outline:2px solid var(--focus-ring);outline-offset:1px;border-radius:var(--radius-control)}@media(hover:hover)and (pointer:fine){.tapd_arc_accordion_trigger:hover{color:var(--text-secondary)}.tapd_arc_accordion_trigger:hover .tapd_arc_accordion_icon{color:var(--foreground)}}.tapd_arc_accordion_icon{display:inline-flex;flex:0 0 auto;color:var(--text-muted);transition:color var(--duration-fast) var(--ease-standard)}.tapd_arc_accordion_trigger[data-state=open] .tapd_arc_accordion_icon{color:var(--foreground)}.tapd_arc_accordion_panel{overflow:hidden;color:var(--text-secondary);font-size:var(--text-sm);line-height:var(--leading-body)}.tapd_arc_accordion_panelInner{overflow-wrap:anywhere;padding:0 var(--space-8) var(--space-5) 0}.tapd_arc_accordion_lg .tapd_arc_accordion_trigger{min-height:76px;gap:var(--space-8);padding-block:var(--space-5);font-size:var(--text-lg);letter-spacing:var(--tracking-body)}.tapd_arc_accordion_lg .tapd_arc_accordion_panel{font-size:var(--text-base);line-height:1.65}.tapd_arc_accordion_lg .tapd_arc_accordion_panelInner{max-width:62ch;padding:0 var(--space-12) var(--space-6) 0}@media(max-width:520px){.tapd_arc_accordion_lg .tapd_arc_accordion_trigger{min-height:68px;font-size:var(--text-base)}.tapd_arc_accordion_lg .tapd_arc_accordion_panel{font-size:var(--text-sm)}.tapd_arc_accordion_lg .tapd_arc_accordion_panelInner{padding-right:var(--space-6)}}@media(prefers-reduced-motion:reduce){.tapd_arc_accordion_trigger,.tapd_arc_accordion_icon{transition:none}}.tapd_arc_select_field{display:grid;gap:var(--space-2);min-width:0}.tapd_arc_select_field label{font-size:var(--text-sm);font-weight:500}.tapd_arc_select_trigger{position:relative;box-sizing:border-box;display:flex;align-items:center;justify-content:space-between;gap:var(--space-3);width:100%;min-height:var(--control-height-md);border:1px solid var(--border);border-radius:var(--radius-control);padding:0 var(--space-3);background:var(--surface);color:var(--foreground);font:inherit;font-size:var(--text-sm);text-align:left;cursor:pointer;transition:border-color var(--duration-fast) var(--ease-standard),background-color var(--duration-fast) var(--ease-standard),box-shadow var(--duration-fast) var(--ease-standard)}@media(hover:hover)and (pointer:fine){.tapd_arc_select_trigger:hover:not([data-disabled]){border-color:var(--border-strong);background:var(--surface-muted)}}.tapd_arc_select_trigger:active:not([data-disabled]),.tapd_arc_select_trigger[data-state=open]{border-color:var(--border-strong);background:var(--surface-muted)}.tapd_arc_select_trigger:focus-visible{outline:2px solid var(--focus-ring);outline-offset:1px}.tapd_arc_select_trigger[aria-invalid=true]{border-color:var(--danger)}.tapd_arc_select_trigger[data-disabled]{opacity:.5;cursor:not-allowed}.tapd_arc_select_valueText{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tapd_arc_select_rollingValue{display:inline-block;max-width:100%;overflow:hidden;text-overflow:ellipsis;vertical-align:bottom}.tapd_arc_select_trigger[data-placeholder] .tapd_arc_select_valueText{color:var(--text-muted)}.tapd_arc_select_chevron{display:inline-flex;flex:0 0 auto;color:var(--text-muted);transition:transform var(--duration-spring) var(--ease-spring),color var(--duration-fast) var(--ease-standard)}.tapd_arc_select_trigger[data-state=open] .tapd_arc_select_chevron{transform:rotate(180deg)}.tapd_arc_select_hint{color:var(--text-muted);font-size:var(--text-xs)}.tapd_arc_select_content{--menu-x: 0px;--menu-y: -6px;box-sizing:border-box;z-index:1000;width:var(--radix-select-trigger-width);max-width:min(calc(100vw - 24px),var(--radix-select-content-available-width, 100vw));max-height:min(320px,var(--radix-select-content-available-height));overflow:hidden;border:1px solid var(--border);border-radius:calc(var(--radius-control) + 2px);padding:6px;background:var(--surface-raised);color:var(--foreground);box-shadow:var(--shadow-floating);transform-origin:var(--radix-select-content-transform-origin);animation:tapd_arc_select_select-in var(--duration-standard) var(--ease-enter) both}.tapd_arc_select_content[data-side=top]{--menu-y: 6px}.tapd_arc_select_content[data-side=left]{--menu-x: 6px;--menu-y: 0px}.tapd_arc_select_content[data-side=right]{--menu-x: -6px;--menu-y: 0px}.tapd_arc_select_content[data-state=closed]{animation:tapd_arc_select_select-out var(--duration-instant) var(--ease-standard) both}.tapd_arc_select_viewport{padding:2px 0}.tapd_arc_select_item{position:relative;display:flex;align-items:center;min-height:36px;border-radius:calc(var(--radius-control) - 4px);padding:0 34px 0 11px;color:var(--foreground);font-size:var(--text-sm);cursor:default;outline:none;user-select:none;transition:background-color var(--duration-instant) var(--ease-standard),color var(--duration-instant) var(--ease-standard)}.tapd_arc_select_item>span:first-child{min-width:0;overflow-wrap:anywhere}.tapd_arc_select_item[data-highlighted]{background:var(--surface-muted);outline:1px solid var(--focus-ring);outline-offset:-1px}.tapd_arc_select_item[data-disabled]{opacity:.45}.tapd_arc_select_indicator{position:absolute;right:10px;display:inline-flex;align-items:center;color:var(--foreground);animation:tapd_arc_select_indicator-in var(--duration-standard) var(--ease-enter) 40ms both}.tapd_arc_select_scrollButton{display:grid;height:28px;place-items:center;color:var(--text-muted)}@keyframes tapd_arc_select_select-in{0%{opacity:0;transform:translate(var(--menu-x),var(--menu-y)) scale(.97)}}@keyframes tapd_arc_select_select-out{to{opacity:0;transform:translate(calc(var(--menu-x) / 2),calc(var(--menu-y) / 2)) scale(.98)}}@keyframes tapd_arc_select_indicator-in{0%{opacity:0;transform:scale(.7);filter:blur(2px)}}@media(prefers-reduced-transparency:reduce){.tapd_arc_select_content{background:var(--surface-raised);backdrop-filter:none;-webkit-backdrop-filter:none}}@media(prefers-reduced-motion:reduce){.tapd_arc_select_trigger,.tapd_arc_select_chevron,.tapd_arc_select_item{transition:none}.tapd_arc_select_content{animation:tapd_arc_select_select-fade var(--duration-instant) var(--ease-standard) both}.tapd_arc_select_content[data-state=closed]{animation:tapd_arc_select_select-fade-out var(--duration-instant) var(--ease-standard) both}.tapd_arc_select_indicator{animation:none}}@keyframes tapd_arc_select_select-fade{0%{opacity:0}}@keyframes tapd_arc_select_select-fade-out{to{opacity:0}}[data-tavlo-tapd-arc-ui]{color-scheme:light dark;--foreground: var(--dsw-alias-label-primary, light-dark(#172c43, #e9f0f9));--text-secondary: var(--dsw-alias-label-secondary, light-dark(#516581, #b3c2d6));--text-muted: var(--text-secondary);--border: var(--dsw-alias-border-l3, light-dark(#8591a3, #728398));--border-strong: var(--dsw-alias-border-l2, var(--border));--surface: var(--dsw-alias-bg-base, light-dark(#fff, #21252b));--surface-muted: var(--dsw-alias-bg-layer-2, light-dark(#eef2f7, #323940));--surface-raised: var(--dsw-alias-bg-layer-1, light-dark(#fff, #282e37));--focus-ring: var(--dsw-alias-brand-primary, light-dark(#165bbc, #8db8ff));--danger: var(--dsw-alias-state-error-primary, light-dark(#b42318, #ffb4ab));--radius-control: var(--dsw-radius-md, 8px);--shadow-floating: var(--dsw-shadow-lg, 0 6px 20px rgb(0 0 0 / .2));--control-height-md: 36px;--control-height-lg: 40px;--space-2: 4px;--space-3: 8px;--space-5: 12px;--space-6: 16px;--space-8: 20px;--space-12: 24px;--text-xs: 12px;--text-sm: 13px;--text-field: 13px;--text-base: 14px;--text-lg: 16px;--leading-body: 1.45;--tracking-body: normal;--duration-instant: .1s;--duration-fast: .15s;--duration-standard: .2s;--duration-spring: .2s;--ease-standard: cubic-bezier(.22, 1, .36, 1);--ease-enter: cubic-bezier(.16, 1, .3, 1);--ease-spring: var(--ease-enter)}body[data-ds-dark-theme] [data-tavlo-tapd-arc-ui]{color-scheme:dark}.tapd-console{--tapd-ink: var(--dsw-alias-label-primary, light-dark(#172c43, #e9f0f9));--tapd-muted: var(--dsw-alias-label-secondary, light-dark(#516581, #b3c2d6));--tapd-surface: var(--dsw-alias-bg-base, light-dark(#fff, #21252b));color-scheme:light dark;--tapd-accent: var(--dsw-alias-brand-primary, light-dark(#165bbc, #8db8ff));--tapd-prime: #165bbc;--tapd-line: color-mix(in srgb, var(--tapd-ink) 15%, transparent);--tapd-soft: color-mix(in srgb, var(--tapd-accent) 5.5%, var(--tapd-surface));--tapd-outline: color-mix(in srgb, var(--tapd-accent) 29%, transparent);--tapd-focus: var(--tapd-accent);container:tapd-settings / inline-size;display:grid;color:var(--tapd-ink);background:var(--tapd-surface);border:1px solid var(--tapd-line);border-radius:18px;min-width:0;isolation:isolate;font-size:14px;line-height:1.5}body[data-ds-dark-theme] .tapd-console{color-scheme:dark}.tapd-console h2,.tapd-console h3,.tapd-console h4,.tapd-console p{margin:0}.tapd-hero{position:relative;display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:22px;padding:clamp(18px,4cqi,32px);border-radius:17px 17px 0 0;border-bottom:1px solid var(--tapd-line);background:var(--tapd-soft);background-image:radial-gradient(color-mix(in srgb,var(--tapd-accent) 21%,transparent) .75px,transparent .75px);background-size:12px 12px}.tapd-hero-title{display:grid;min-width:0;gap:6px}.tapd-console .tapd-hero h2{font-weight:700;font-size:clamp(21px,4.9cqi,30px);line-height:1.2;letter-spacing:-.035em}.tapd-hero-title p{color:var(--tapd-muted);max-width:50ch}.tapd-route{display:flex;align-items:center;gap:8px;font:600 11px/1.6 ui-monospace,SFMono-Regular,Consolas,monospace;letter-spacing:.05em;color:var(--tapd-accent)}.tapd-route span{padding:1px 7px;border:1px solid var(--tapd-outline);border-radius:5px;background:var(--tapd-surface)}.tapd-route svg{width:24px;height:13px}.tapd-control{display:grid;align-content:center;gap:2px;min-width:165px;padding:8px 14px;border:1px solid var(--tapd-line);border-radius:12px;background:var(--tapd-surface)}.tapd-control [role=status]{display:flex;align-items:baseline;gap:6px;color:var(--tapd-muted);font-size:12px}.tapd-dot{align-self:center;flex:none;width:7px;height:7px;border-radius:50%;background:currentColor}.tapd-dot[data-ready=true]{background:#228166}.tapd-body{display:grid;gap:0;border:0;margin:0;min-width:0;padding:0}.tapd-step{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:start;gap:12px;padding:21px clamp(18px,4cqi,32px)}.tapd-step+.tapd-step{border-top:1px solid var(--tapd-line)}.tapd-step-index{display:grid;place-content:center;inline-size:30px;block-size:30px;border-radius:9px;border:1px solid var(--tapd-outline);color:var(--tapd-accent);background:var(--tapd-soft);font:700 12px/1 ui-monospace,SFMono-Regular,Consolas,monospace}.tapd-step-content{min-width:0;display:grid;gap:12px}.tapd-step-header{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:8px 12px}.tapd-console .tapd-step-header h3{font-size:16px;line-height:1.35;font-weight:680}.tapd-step-header small{color:var(--tapd-muted)}.tapd-step-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.tapd-count{color:var(--tapd-muted);font:600 12px/1 ui-monospace,SFMono-Regular,Consolas,monospace}.tapd-stack{display:grid;gap:10px;min-width:0}.tapd-field-row{display:flex;gap:11px;align-items:start;flex-wrap:wrap}.tapd-connection-scope{display:grid;gap:10px;max-inline-size:32rem}.tapd-project{display:grid;min-width:0;gap:8px;padding:10px 12px;border:1px solid var(--tapd-line);border-radius:12px}.tapd-project-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 14px;align-items:start}.tapd-project .tapd-field{min-inline-size:0}.tapd-project .tapd-field :is(input,button){min-inline-size:0;max-inline-size:100%;box-sizing:border-box}.tapd-project .tapd-field-label{font-size:13px;font-weight:500}.tapd-picker{position:relative;display:grid;gap:4px}.tapd-picker-popup{position:absolute;z-index:2;inset-inline:0;inset-block-start:calc(100% + 4px);box-sizing:border-box;padding:5px;border:1px solid var(--tapd-outline);border-radius:9px;background:var(--tapd-surface);box-shadow:0 6px 22px #0002}.tapd-picker-popup ul{list-style:none;max-block-size:14rem;overflow:auto;overscroll-behavior:contain;margin:0;padding:0}.tapd-picker-popup [role=option],.tapd-picker-popup p{padding:7px 9px;border-radius:5px;overflow-wrap:anywhere}.tapd-picker-popup [role=option]{cursor:pointer}.tapd-picker-popup [role=option][aria-disabled=true]{opacity:.45;cursor:not-allowed}.tapd-picker-popup [role=option]:not([aria-disabled=true]):hover,.tapd-picker-popup [data-active]{outline:1px solid var(--tapd-outline);outline-offset:-1px;background:var(--tapd-soft)}.tapd-picker-popup [aria-selected=true]{font-weight:650}.tapd-status-group{display:grid;gap:6px;min-inline-size:0;margin:0;padding:5px 10px 10px;border:1px solid var(--tapd-line);border-radius:8px}.tapd-status-group>button{justify-self:start}.tapd-status-choices{display:grid;gap:3px;max-block-size:13rem;overflow:auto}.tapd-status-choices label{display:flex;gap:7px;align-items:baseline;padding:2px 1px;overflow-wrap:anywhere}.tapd-project-advisory{font-size:13px}.tapd-project-head{display:flex;justify-content:space-between;align-items:center;gap:8px;min-width:0}.tapd-project-head h4{color:var(--tapd-ink);font-size:14px;overflow-wrap:anywhere}.tapd-project-code{color:var(--tapd-muted);font:500 11px/1.4 ui-monospace,SFMono-Regular,Consolas,monospace}.tapd-empty{border:1px dashed var(--tapd-outline);padding:13px;border-radius:10px;color:var(--tapd-muted);font-size:13px}.tapd-actions{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:8px 12px;padding:13px clamp(18px,4cqi,32px);border-top:1px solid var(--tapd-line);background:var(--tapd-soft);border-radius:0 0 17px 17px}.tapd-feedback{display:grid;gap:5px;flex:1 1 240px;min-width:0;color:var(--tapd-muted);font-size:13px}.tapd-link{color:var(--tapd-accent);text-decoration:underline;text-underline-offset:3px}.tapd-button{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:36px;padding:5px 12px;border:1px solid var(--tapd-line);border-radius:8px;color:var(--tapd-ink);background:var(--tapd-surface);font:inherit;font-size:13px;line-height:1.45;font-weight:650;text-align:center;cursor:pointer;overflow-wrap:anywhere}.tapd-button:hover:enabled{border-color:var(--tapd-outline);background:var(--tapd-soft)}.tapd-button:disabled{cursor:not-allowed;opacity:.64}.tapd-button:focus-visible,.tapd-link:focus-visible,.tapd-console [role=switch]:focus-visible{outline:2px solid var(--tapd-focus);outline-offset:2px}.tapd-button[data-tone=primary]{color:#fff;background:var(--tapd-prime);border-color:var(--tapd-prime)}.tapd-button[data-tone=primary]:hover:enabled{color:#fff;background:#104e9f;border-color:#104e9f}.tapd-button[data-tone=quiet]{min-height:32px;border-color:transparent;color:var(--tapd-muted)}.tapd-chip-line{display:flex;flex-wrap:wrap;gap:5px;min-width:0}.tapd-chip{max-width:100%;border-radius:5px;padding:2px 7px;background:var(--tapd-soft);color:var(--tapd-muted);font-size:11px;overflow-wrap:anywhere}.tapd-standalone-note{margin:14px clamp(18px,4cqi,32px)!important}.tapd-console input[type=checkbox]{accent-color:var(--tapd-accent)}@container tapd-settings (max-width: 480px){.tapd-step{grid-template-columns:minmax(0,1fr);gap:8px}.tapd-step-index{inline-size:25px;block-size:25px;border-radius:6px}.tapd-project-fields{grid-template-columns:minmax(0,1fr)}.tapd-actions>.tapd-button{width:100%}}@media(forced-colors:active){.tapd-hero{background-image:none}.tapd-button[data-tone=primary]{color:ButtonText;background:ButtonFace;border-color:ButtonText}}.tapd_arc_input_field{display:grid;min-width:0}.tapd_arc_input_label{margin-bottom:var(--space-2);color:var(--foreground);font-size:var(--text-sm);font-weight:500;line-height:var(--leading-body)}.tapd_arc_input_input{box-sizing:border-box;width:100%;min-height:var(--control-height-md);padding:0 var(--space-3);border:1px solid var(--border-strong);border-radius:var(--radius-control);background:var(--surface);color:var(--foreground);font:inherit;font-size:var(--text-field);line-height:var(--leading-body);letter-spacing:var(--tracking-body);outline:none;transition:border-color var(--duration-fast) var(--ease-standard),background-color var(--duration-fast) var(--ease-standard)}.tapd_arc_input_input::placeholder{color:var(--text-muted)}@media(hover:hover)and (pointer:fine){.tapd_arc_input_input:hover:not(:disabled,[aria-invalid=true]){border-color:var(--foreground)}}.tapd_arc_input_input:focus-visible{outline:2px solid var(--focus-ring);outline-offset:1px}.tapd_arc_input_input[aria-invalid=true]{border-color:var(--danger)}.tapd_arc_input_input:disabled{cursor:not-allowed;opacity:.5;background:var(--surface-muted)}.tapd_arc_input_messageSlot{display:block;overflow:hidden}.tapd_arc_input_description,.tapd_arc_input_error{display:block;padding-top:var(--space-2);font-size:var(--text-xs);line-height:var(--leading-body)}.tapd_arc_input_description{color:var(--text-muted)}.tapd_arc_input_error{color:var(--danger)}.tapd_arc_input_words{position:relative;display:block}.tapd_arc_input_word{display:inline-block;white-space:pre}.tapd_arc_input_column{position:relative;display:inline-flex;justify-content:center;font-variant-numeric:tabular-nums}.tapd_arc_input_column>span{display:inline-block}.tapd_arc_input_srOnly{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}@media(prefers-reduced-motion:reduce){.tapd_arc_input_input{transition-duration:.01ms}}
7
+ `;var op=Object.create,Hr=Object.defineProperty,ap=Object.getOwnPropertyDescriptor,sp=Object.getOwnPropertyNames,lp=Object.getPrototypeOf,cp=Object.prototype.hasOwnProperty,_a=e=>{throw TypeError(e)},up=(e,t)=>{for(var r in t)Hr(e,r,{get:t[r],enumerable:!0})},Ta=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of sp(t))!cp.call(e,i)&&i!==r&&Hr(e,i,{get:()=>t[i],enumerable:!(n=ap(t,i))||n.enumerable});return e},z=(e,t,r)=>(r=e!=null?op(lp(e)):{},Ta(t||!e||!e.__esModule?Hr(r,"default",{value:e,enumerable:!0}):r,e)),dp=e=>Ta(Hr({},"__esModule",{value:!0}),e),Ra=(e,t,r)=>t.has(e)||_a("Cannot "+r),ge=(e,t,r)=>(Ra(e,t,"read from private field"),r?r.call(e):t.get(e)),pp=(e,t,r)=>t.has(e)?_a("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),Ea=(e,t,r,n)=>(Ra(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),Aa={};up(Aa,{ArcStyle:()=>bw,Disclosure:()=>Sw,Input:()=>np,Select:()=>ww}),Pa.exports=dp(Aa);var hp=require("react"),Ma=require("react"),_e=z(require("react"),1),ot=z(require("react"),1),Da=require("react/jsx-runtime"),fp=Object.defineProperty,De=(e,t)=>fp(e,"name",{value:t,configurable:!0});function mp(e,t){let r=ot.createContext(t);r.displayName=e+"Context";let n=De(o=>{let{children:a,...s}=o,l=ot.useMemo(()=>s,Object.values(s));return(0,Da.jsx)(r.Provider,{value:l,children:a})},"Provider");n.displayName=e+"Provider";function i(o,a={}){let{optional:s=!1}=a,l=ot.useContext(r);if(l)return l;if(t!==void 0)return t;if(!s)throw new Error(`\`${o}\` must be used within \`${e}\``)}return De(i,"useContext"),[n,i]}De(mp,"createContext");function Tt(e,t=[]){let r=[];function n(o,a){let s=ot.createContext(a);s.displayName=o+"Context";let l=r.length;r=[...r,a];let u=De(d=>{let{scope:p,children:m,...f}=d,h=p?.[e]?.[l]||s,g=ot.useMemo(()=>f,Object.values(f));return(0,Da.jsx)(h.Provider,{value:g,children:m})},"Provider");u.displayName=o+"Provider";function c(d,p,m={}){let{optional:f=!1}=m,h=p?.[e]?.[l]||s,g=ot.useContext(h);if(g)return g;if(a!==void 0)return a;if(!f)throw new Error(`\`${d}\` must be used within \`${o}\``)}return De(c,"useContext"),[u,c]}De(n,"createContext");let i=De(()=>{let o=r.map(a=>ot.createContext(a));return De(function(a){let s=a?.[e]||o;return ot.useMemo(()=>({[`__scope${e}`]:{...a,[e]:s}}),[a,s])},"useScope")},"createScope");return i.scopeName=e,[n,ka(i,...t)]}De(Tt,"createContextScope");function ka(...e){let t=e[0];if(e.length===1)return t;let r=De(()=>{let n=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return De(function(i){let o=n.reduce((a,{useScope:s,scopeName:l})=>{let u=s(i)[`__scope${l}`];return{...a,...u}},{});return ot.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])},"useComposedScopes")},"createScope");return r.scopeName=t.scopeName,r}De(ka,"composeContextScopes");var Rt=z(require("react"),1),gp=z(require("react"),1),vp=Object.defineProperty,ri=(e,t)=>vp(e,"name",{value:t,configurable:!0});function ni(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}ri(ni,"setRef");function Oa(...e){return t=>{let r=!1,n=e.map(i=>{let o=ni(i,t);return!r&&typeof o=="function"&&(r=!0),o});if(r)return()=>{for(let i=0;i<n.length;i++){let o=n[i];typeof o=="function"?o():ni(e[i],null)}}}}ri(Oa,"composeRefs");function Y(...e){return gp.useCallback(Oa(...e),e)}ri(Y,"useComposedRefs");var ke=z(require("react"),1),yp=Object.defineProperty,Te=(e,t)=>yp(e,"name",{value:t,configurable:!0});function Et(e){let t=ke.forwardRef((r,n)=>{let{children:i,...o}=r,a=null,s=!1,l=[];i=Fa(i),ke.Children.forEach(i,p=>{if(ja(p)){s=!0;let m=p,f="child"in m.props?m.props.child:m.props.children;for(;ii(f)&&typeof $r=="function";)f=$r(f._payload);a=bp(m,f),l.push(a?.props?.children)}else l.push(p)}),a?a=ke.cloneElement(a,void 0,l):!s&&ke.Children.count(i)===1&&ke.isValidElement(i)&&(a=i);let u=a?La(a):void 0,c=Y(n,u);if(!a){if(i||i===0)throw new Error(s?Cp(e):Sp(e));return i}let d=Va(o,a.props??{});return a.type!==ke.Fragment&&(d.ref=n?c:u),ke.cloneElement(a,d)});return t.displayName=`${e}.Slot`,t}Te(Et,"createSlot");var Ia=Symbol.for("radix.slottable");function xp(e){let t=Te(r=>"child"in r?r.children(r.child):r.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=Ia,t}Te(xp,"createSlottable");var bp=Te((e,t)=>"child"in e.props?ke.isValidElement(t)?ke.cloneElement(t,void 0,e.props.children(t.props.children)):null:ke.isValidElement(t)?t:null,"getSlottableElementFromSlottable");function Va(e,t){let r={...t};for(let n in t){let i=e[n],o=t[n];/^on[A-Z]/.test(n)?i&&o?r[n]=(...a)=>{let s=o(...a);return i(...a),s}:i&&(r[n]=i):n==="style"?r[n]={...i,...o}:n==="className"?r[n]=[i,o].filter(Boolean).join(" "):n==="aria-describedby"&&(r[n]=Ba(o,i))}return{...e,...r}}Te(Va,"mergeProps");function La(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}Te(La,"getElementRef");function ja(e){return ke.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Ia}Te(ja,"isSlottable");var wp=Symbol.for("react.lazy");function ii(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===wp&&"_payload"in e&&Na(e._payload)}Te(ii,"isLazyComponent");function Na(e){return typeof e=="object"&&e!==null&&"then"in e}Te(Na,"isPromiseLike");function Fa(e){let t=e;for(;ii(t)&&typeof $r=="function";)t=$r(t._payload);return t}Te(Fa,"useUnwrappedLazy");function Ba(...e){let t=new Set;for(let r of e)if(typeof r=="string")for(let n of String(r).trim().split(/\s+/))n&&t.add(n);return t.size>0?Array.from(t).join(" "):void 0}Te(Ba,"concatAriaDescribedby");var Sp=Te(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),Cp=Te(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),$r=ke[" use ".trim().toString()],oi=require("react/jsx-runtime"),Se=z(require("react"),1),Pp=z(require("react"),1),ee=globalThis?.document?Pp.useLayoutEffect:()=>{},At=require("react/jsx-runtime"),_p=Object.defineProperty,ce=(e,t)=>_p(e,"name",{value:t,configurable:!0});function za(e){let t=e+"CollectionProvider",[r,n]=Tt(t),[i,o]=r(t,{collectionRef:{current:null},itemMap:new Map}),a=ce(h=>{let{scope:g,children:y}=h,v=Rt.useRef(null),x=Rt.useRef(new Map).current;return(0,oi.jsx)(i,{scope:g,itemMap:x,collectionRef:v,children:y})},"CollectionProvider");a.displayName=t;let s=e+"CollectionSlot",l=Et(s),u=Rt.forwardRef((h,g)=>{let{scope:y,children:v}=h,x=o(s,y),w=Y(g,x.collectionRef);return(0,oi.jsx)(l,{ref:w,children:v})});u.displayName=s;let c=e+"CollectionItemSlot",d="data-radix-collection-item",p=Et(c),m=Rt.forwardRef((h,g)=>{let{scope:y,children:v,...x}=h,w=Rt.useRef(null),b=Y(g,w),S=o(c,y);return Rt.useEffect(()=>(S.itemMap.set(w,{ref:w,...x}),()=>{S.itemMap.delete(w)})),(0,oi.jsx)(p,{[d]:"",ref:b,children:v})});m.displayName=c;function f(h){let g=o(e+"CollectionConsumer",h);return Rt.useCallback(()=>{let y=g.collectionRef.current;if(!y)return[];let v=Array.from(y.querySelectorAll(`[${d}]`));return Array.from(g.itemMap.values()).sort((x,w)=>v.indexOf(x.ref.current)-v.indexOf(w.ref.current))},[g.collectionRef,g.itemMap])}return ce(f,"useCollection"),[{Provider:a,Slot:u,ItemSlot:m},f,n]}ce(za,"createCollection");var Wa=new WeakMap,ie,$e,qr=($e=class extends Map{constructor(e){super(e),pp(this,ie),Ea(this,ie,[...super.keys()]),Wa.set(this,!0)}set(e,t){return Wa.get(this)&&!this.has(e)&&ge(this,ie).push(e),super.set(e,t),this}insert(e,t,r){let n=this.has(t),i=n?this.size:this.size+1,o=ai(e),a=o>=0?Math.min(o,i-1):Math.max(i+o,0);if(n?ge(this,ie).indexOf(t)===a:a===this.size)return this.set(t,r),this;let s=ge(this,ie).filter(u=>u!==t);s.splice(a,0,t);let l=s.map(u=>[u,u===t?r:this.get(u)]);this.clear();for(let[u,c]of l)this.set(u,c);return this}with(e,t,r){let n=new $e(this);return n.insert(e,t,r),n}before(e){let t=ge(this,ie).indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,r){let n=ge(this,ie).indexOf(e);if(n===-1)return this;let i=ge(this,ie).indexOf(t),o=i!==-1&&i<n?n-1:n;return this.insert(o,t,r)}after(e){let t=ge(this,ie).indexOf(e);if(t=t===-1||t===this.size-1?-1:t+1,t!==-1)return this.entryAt(t)}setAfter(e,t,r){let n=ge(this,ie).indexOf(e);if(n===-1)return this;let i=ge(this,ie).indexOf(t),o=i!==-1&&i<=n?n:n+1;return this.insert(o,t,r)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return Ea(this,ie,[]),super.clear()}delete(e){let t=super.delete(e);return t&&ge(this,ie).splice(ge(this,ie).indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return t!==void 0?this.delete(t):!1}at(e){let t=Kr(ge(this,ie),e);if(t!==void 0)return this.get(t)}entryAt(e){let t=Kr(ge(this,ie),e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return ge(this,ie).indexOf(e)}keyAt(e){return Kr(ge(this,ie),e)}from(e,t){let r=this.indexOf(e);if(r===-1)return;let n=r+t;return n<0&&(n=0),n>=this.size&&(n=this.size-1),this.at(n)}keyFrom(e,t){let r=this.indexOf(e);if(r===-1)return;let n=r+t;return n<0&&(n=0),n>=this.size&&(n=this.size-1),this.keyAt(n)}find(e,t){let r=0;for(let n of this){if(Reflect.apply(e,t,[n,r,this]))return n;r++}}findIndex(e,t){let r=0;for(let n of this){if(Reflect.apply(e,t,[n,r,this]))return r;r++}return-1}filter(e,t){let r=[],n=0;for(let i of this)Reflect.apply(e,t,[i,n,this])&&r.push(i),n++;return new $e(r)}map(e,t){let r=[],n=0;for(let i of this)r.push([i[0],Reflect.apply(e,t,[i,n,this])]),n++;return new $e(r)}reduce(...e){let[t,r]=e,n=e.length>1;if(!n&&this.size===0)throw new TypeError("Reduce of empty OrderedDict with no initial value");let i=0,o=r;for(let a of this)i===0&&!n?o=a:o=Reflect.apply(t,this,[o,a,i,this]),i++;return o}reduceRight(...e){let[t,r]=e,n=e.length>1;if(!n&&this.size===0)throw new TypeError("Reduce of empty OrderedDict with no initial value");let i=r;for(let o=this.size-1;o>=0;o--){let a=this.entryAt(o);o===this.size-1&&!n?i=a:i=Reflect.apply(t,this,[i,a,o,this])}return i}sort(e){if(typeof e!="function")throw new TypeError("OrderedDict.sort requires a compare function");let t=[...this.entries()].sort(e);this.clear();for(let[r,n]of t)this.set(r,n);return this}toSorted(e){if(typeof e!="function")throw new TypeError("OrderedDict.toSorted requires a compare function");let t=[...this.entries()].sort(e);return new $e(t)}toReversed(){let e=new $e;for(let t=this.size-1;t>=0;t--){let r=this.keyAt(t),n=this.get(r);e.set(r,n)}return e}toSpliced(...e){let t=[...this.entries()];return t.splice(...e),new $e(t)}slice(e,t){let r=new $e;for(let n of ge(this,ie).slice(e,t))r.set(n,this.get(n));return r}every(e,t){let r=0;for(let n of this){if(!Reflect.apply(e,t,[n,r,this]))return!1;r++}return!0}some(e,t){let r=0;for(let n of this){if(Reflect.apply(e,t,[n,r,this]))return!0;r++}return!1}},ie=new WeakMap,ce($e,"OrderedDict"),$e);function Kr(e,t){if("at"in Array.prototype)return Array.prototype.at.call(e,t);let r=Ua(e,t);return r===-1?void 0:e[r]}ce(Kr,"at");function Ua(e,t){let r=e.length,n=ai(t),i=n>=0?n:r+n;return i<0||i>=r?-1:i}ce(Ua,"toSafeIndex");function ai(e){return e!==e||e===0?0:Math.trunc(e)}ce(ai,"toSafeInteger");function Ha(e){let t=e+"CollectionProvider",[r,n]=Tt(t),[i,o]=r(t);i.displayName=e+"CollectionStableContextProvider";let[a,s]=r(t);a.displayName=e+"CollectionStatefulContextProvider";let l=ce(({state:b,...S})=>b?(0,At.jsx)(c,{...S,state:b}):(0,At.jsx)(u,{...S}),"CollectionProvider");l.displayName=t;let u=ce(b=>{let S=v();return(0,At.jsx)(c,{...b,state:S})},"CollectionInit");u.displayName=e+"CollectionInit";let c=ce(b=>{let{scope:S,children:C,state:P}=b,T=Se.useRef(null),[_,R]=Se.useState(null),k=Y(T,R),[I,O]=P,B=Se.useRef(new qr),N=Se.useCallback(()=>{let V=B.current;return Ka(V)||V.sort(Gr),V},[]);return Se.useEffect(()=>{if(!_)return;let V=Ga(()=>{O(M=>{let D=M.toSorted(Gr);return D.some(([j],J)=>M.keyAt(J)!==j)?D:M})});return V.observe(_,{childList:!0,subtree:!0}),()=>{V.disconnect()}},[_,O]),(0,At.jsx)(i,{scope:S,collectionElementRef:k,collectionElementRefObject:T,getCollection:N,setCollection:O,registryRef:B,children:(0,At.jsx)(a,{scope:S,collectionElement:_,collection:I,children:C})})},"CollectionProviderImpl");c.displayName=e+"CollectionProviderImpl";let d=e+"CollectionSlot",p=Et(d),m=Se.forwardRef((b,S)=>{let{scope:C,children:P}=b,T=o(d,C),_=Y(S,T.collectionElementRef);return(0,At.jsx)(p,{ref:_,children:P})});m.displayName=d;let f=e+"CollectionItemSlot",h="data-radix-collection-item",g=Et(f),y=Se.forwardRef((b,S)=>{let{scope:C,children:P,...T}=b,_=Se.useRef(null),R=o(f,C),{setCollection:k,registryRef:I}=R,O=Se.useRef(T);$a(O.current,T)||(O.current=T);let B=O.current,N=Se.useCallback(D=>{let j=I.current;D?j.set(D,{...O.current,element:D}):_.current&&j.delete(_.current)},[I]),V=Y(S,N,_);ee(()=>{let D=_.current,j=I.current;D&&j.has(D)&&j.set(D,{...B,element:D})},[B,I]);let M=Se.useRef(null);return Se.useEffect(()=>{let D=_.current,j=M.current;(j?.element??null)===D&&(!D||j?.itemData===B)||(M.current=D?{element:D,itemData:B}:null,k(J=>{let je=new qr(J);return j&&j.element!==D&&je.delete(j.element),D&&je.set(D,{...B,element:D}),je.sort(Gr)}))}),Se.useEffect(()=>()=>{let D=M.current;M.current=null,D&&k(j=>{if(!j.has(D.element))return j;let J=new qr(j);return J.delete(D.element),J})},[k]),(0,At.jsx)(g,{[h]:"",ref:V,children:P})});y.displayName=f;function v(){return Se.useState(new qr)}ce(v,"useInitCollection");function x(b){let{collection:S}=s(e+"CollectionConsumer",b);return S}ce(x,"useCollection");function w(b){let{getCollection:S}=o(e+"CollectionConsumer",b);return S}return ce(w,"useGetCollection"),[{Provider:l,Slot:m,ItemSlot:y},{createCollectionScope:n,useCollection:x,useGetCollection:w,useInitCollection:v}]}ce(Ha,"createCollection");function $a(e,t){if(e===t)return!0;if(typeof e!="object"||typeof t!="object"||e==null||t==null)return!1;let r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(let i of r)if(!Object.prototype.hasOwnProperty.call(t,i)||e[i]!==t[i])return!1;return!0}ce($a,"shallowEqual");function qa(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}ce(qa,"isElementPreceding");function Ka(e){let t;for(let r of e.keys()){if(t){let n=t.compareDocumentPosition(r);if(!(n&Node.DOCUMENT_POSITION_DISCONNECTED)&&n&Node.DOCUMENT_POSITION_PRECEDING)return!1}t=r}return!0}ce(Ka,"isInDocumentOrder");function Gr(e,t){return!e[1].element||!t[1].element?0:qa(e[1].element,t[1].element)?-1:1}ce(Gr,"sortByDocumentPosition");function Ga(e){return new MutationObserver(t=>{for(let r of t)if(r.type==="childList"){e();return}})}ce(Ga,"getChildListObserver");var Tp=Object.defineProperty,Gt=(e,t)=>Tp(e,"name",{value:t,configurable:!0}),Ya=!!(typeof window<"u"&&window.document&&window.document.createElement);function X(e,t,{checkForDefaultPrevented:r=!0}={}){return Gt(function(n){if(e?.(n),r===!1||!n||!n.defaultPrevented)return t?.(n)},"handleEvent")}Gt(X,"composeEventHandlers");function Rp(e){if(!Ya)throw new Error("Cannot access window outside of the DOM");return e?.ownerDocument?.defaultView??window}Gt(Rp,"getOwnerWindow");function si(e){if(!Ya)throw new Error("Cannot access document outside of the DOM");return e?.ownerDocument??document}Gt(si,"getOwnerDocument");function Xa(e,t=!1){let{activeElement:r}=si(e);if(!r?.nodeName)return null;if(Za(r)&&r.contentDocument)return Xa(r.contentDocument.body,t);if(t){let n=r.getAttribute("aria-activedescendant");if(n){let i=si(r).getElementById(n);if(i)return i}}return r}Gt(Xa,"getActiveElement");function Za(e){return e.tagName==="IFRAME"}Gt(Za,"isFrame");var mt=z(require("react"),1),Qa=!1,Mt=z(require("react"),1),Yr=z(require("react"),1),Ep=Object.defineProperty,Ap=(e,t)=>Ep(e,"name",{value:t,configurable:!0}),Ja=Yr[" useEffectEvent ".trim().toString()],es=Yr[" useInsertionEffect ".trim().toString()];function ts(e){if(typeof Ja=="function")return Ja(e);let t=Yr.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof es=="function"?es(()=>{t.current=e}):ee(()=>{t.current=e}),Yr.useMemo(()=>((...r)=>t.current?.(...r)),[])}Ap(ts,"useEffectEvent");var Mp=Object.defineProperty,yr=(e,t)=>Mp(e,"name",{value:t,configurable:!0}),Dp=mt[" useInsertionEffect ".trim().toString()]||ee;function Yt({prop:e,defaultProp:t,onChange:r=yr(()=>{},"onChange"),caller:n}){let[i,o,a]=rs({defaultProp:t,onChange:r}),s=e!==void 0,l=s?e:i;if(Qa){let c=mt.useRef(e!==void 0);mt.useEffect(()=>{let d=c.current;d!==s&&console.warn(`${n} is changing from ${d?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),c.current=s},[s,n])}let u=mt.useCallback(c=>{if(s){let d=ns(c)?c(e):c;d!==e&&a.current?.(d)}else o(c)},[s,e,o,a]);return[l,u]}yr(Yt,"useControllableState");function rs({defaultProp:e,onChange:t}){let[r,n]=mt.useState(e),i=mt.useRef(r),o=mt.useRef(t);return Dp(()=>{o.current=t},[t]),mt.useEffect(()=>{i.current!==r&&(o.current?.(r),i.current=r)},[r,i]),[r,n,o]}yr(rs,"useUncontrolledState");function ns(e){return typeof e=="function"}yr(ns,"isFunction");var is=Symbol("RADIX:SYNC_STATE");function kp(e,t,r,n){let{prop:i,defaultProp:o,onChange:a,caller:s}=t,l=i!==void 0,u=ts(a);if(Qa){let g=Mt.useRef(i!==void 0);Mt.useEffect(()=>{let y=g.current;y!==l&&console.warn(`${s} is changing from ${y?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),g.current=l},[l,s])}let c=[{...r,state:o}];n&&c.push(n);let[d,p]=Mt.useReducer((g,y)=>{if(y.type===is)return{...g,state:y.state};let v=e(g,y);return l&&!Object.is(v.state,g.state)&&u(v.state),v},...c),m=d.state,f=Mt.useRef(m);Mt.useEffect(()=>{f.current!==m&&(f.current=m,l||u(m))},[m,f,l]);let h=Mt.useMemo(()=>i!==void 0?{...d,state:i}:d,[d,i]);return Mt.useEffect(()=>{l&&!Object.is(i,d.state)&&p({type:is,state:i})},[i,d.state,l]),[h,p]}yr(kp,"useControllableStateReducer");var Op=z(require("react"),1),Ip=z(require("react-dom"),1),Vp=require("react/jsx-runtime"),Lp=Object.defineProperty,jp=(e,t)=>Lp(e,"name",{value:t,configurable:!0}),Np=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],oe=Np.reduce((e,t)=>{let r=Et(`Primitive.${t}`),n=Op.forwardRef((i,o)=>{let{asChild:a,...s}=i,l=a?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),(0,Vp.jsx)(l,{...s,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function os(e,t){e&&Ip.flushSync(()=>e.dispatchEvent(t))}jp(os,"dispatchDiscreteCustomEvent");var Oe=z(require("react"),1),Ne=z(require("react"),1),Fp=z(require("react"),1),Bp=Object.defineProperty,at=(e,t)=>Bp(e,"name",{value:t,configurable:!0});function as(e,t){return Fp.useReducer((r,n)=>t[r][n]??r,e)}at(as,"useStateMachine");var ss=at(e=>{let{present:t,children:r}=e,n=ls(t),i=typeof r=="function"?r({present:n.isPresent}):Ne.Children.only(r),o=cs(n.ref,us(i));return typeof r=="function"||n.isPresent?Ne.cloneElement(i,{ref:o}):null},"Presence");function ls(e){let[t,r]=Ne.useState(),n=Ne.useRef(null),i=Ne.useRef(e),o=Ne.useRef("none"),a=Ne.useRef(void 0),s=e?"mounted":"unmounted",[l,u]=as(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return Ne.useEffect(()=>{l==="mounted"?(o.current=a.current??Xt(n.current),a.current=void 0):o.current="none"},[l]),ee(()=>{let c=n.current,d=i.current;if(d!==e){let p=o.current,m=Xt(c);e?(a.current=m,u("MOUNT")):m==="none"||c?.display==="none"?u("UNMOUNT"):u(d&&p!==m?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,u]),ee(()=>{if(t){let c,d=t.ownerDocument.defaultView??window,p=at(f=>{let h=Xt(n.current).includes(CSS.escape(f.animationName));if(f.target===t&&h&&(u("ANIMATION_END"),!i.current)){let g=t.style.animationFillMode;t.style.animationFillMode="forwards",c=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=g)})}},"handleAnimationEnd"),m=at(f=>{f.target===t&&(o.current=Xt(n.current))},"handleAnimationStart");return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{d.clearTimeout(c),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:Ne.useCallback(c=>{if(c){let d=getComputedStyle(c);n.current=d,a.current=Xt(d)}else n.current=null;r(c)},[])}}at(ls,"usePresence");function li(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}at(li,"setRef");function cs(...e){let t=Ne.useRef(e);return t.current=e,Ne.useCallback(r=>{let n=t.current,i=!1,o=n.map(a=>{let s=li(a,r);return!i&&typeof s=="function"&&(i=!0),s});if(i)return()=>{for(let a=0;a<o.length;a++){let s=o[a];typeof s=="function"?s():li(n[a],null)}}},[])}at(cs,"useStableComposedRefs");function Xt(e){return e?.animationName||"none"}at(Xt,"getAnimationName");function us(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}at(us,"getElementRef");var ds=z(require("react"),1),zp=Object.defineProperty,Wp=(e,t)=>zp(e,"name",{value:t,configurable:!0}),Up=ds[" useId ".trim().toString()]||(()=>{}),Hp=0;function xr(e){let[t,r]=ds.useState(Up());return ee(()=>{e||r(n=>n??String(Hp++))},[e]),e||(t?`radix-${t}`:"")}Wp(xr,"useId");var Zt=require("react/jsx-runtime"),$p=Object.defineProperty,br=(e,t)=>$p(e,"name",{value:t,configurable:!0}),ci="Collapsible",[qp,ps]=Tt(ci),[Kp,ui]=qp(ci),Gp=Oe.forwardRef(br(function(e,t){let{__scopeCollapsible:r,open:n,defaultOpen:i,disabled:o,onOpenChange:a,...s}=e,[l,u]=Yt({prop:n,defaultProp:i??!1,onChange:a,caller:ci});return(0,Zt.jsx)(Kp,{scope:r,disabled:o,contentId:xr(),open:l,onOpenToggle:Oe.useCallback(()=>u(c=>!c),[u]),children:(0,Zt.jsx)(oe.div,{"data-state":Xr(l),"data-disabled":o?"":void 0,...s,ref:t})})},"Collapsible")),Yp="CollapsibleTrigger",Xp=Oe.forwardRef(br(function(e,t){let{__scopeCollapsible:r,...n}=e,i=ui(Yp,r);return(0,Zt.jsx)(oe.button,{type:"button","aria-controls":i.open?i.contentId:void 0,"aria-expanded":i.open||!1,"data-state":Xr(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...n,ref:t,onClick:X(e.onClick,i.onOpenToggle)})},"CollapsibleTrigger")),hs="CollapsibleContent",Zp=Oe.forwardRef(br(function(e,t){let{forceMount:r,...n}=e,i=ui(hs,e.__scopeCollapsible);return(0,Zt.jsx)(ss,{present:r||i.open,children:({present:o})=>(0,Zt.jsx)(Qp,{...n,ref:t,present:o})})},"CollapsibleContent")),Qp=Oe.forwardRef(br(function(e,t){let{__scopeCollapsible:r,present:n,children:i,...o}=e,a=ui(hs,r),[s,l]=Oe.useState(n),u=Oe.useRef(null),c=Y(t,u),d=Oe.useRef(0),p=d.current,m=Oe.useRef(0),f=m.current,h=a.open||s,g=Oe.useRef(h),y=Oe.useRef(void 0);return Oe.useEffect(()=>{let v=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(v)},[]),ee(()=>{let v=u.current;if(v){y.current=y.current||{transitionDuration:v.style.transitionDuration,animationName:v.style.animationName},v.style.transitionDuration="0s",v.style.animationName="none";let x=v.getBoundingClientRect();d.current=x.height,m.current=x.width,g.current||(v.style.transitionDuration=y.current.transitionDuration,v.style.animationName=y.current.animationName),l(n)}},[a.open,n]),(0,Zt.jsx)(oe.div,{"data-state":Xr(a.open),"data-disabled":a.disabled?"":void 0,id:a.contentId,hidden:!h,...o,ref:c,style:{"--radix-collapsible-content-height":p?`${p}px`:void 0,"--radix-collapsible-content-width":f?`${f}px`:void 0,...e.style},children:h&&i})},"CollapsibleContentImpl"));function Xr(e){return e?"open":"closed"}br(Xr,"getState");var fs=z(require("react"),1),Cw=require("react/jsx-runtime"),Jp=Object.defineProperty,eh=(e,t)=>Jp(e,"name",{value:t,configurable:!0}),th={LTR:"ltr",RTL:"rtl"},rh=fs.createContext(void 0);function di(e){let t=fs.useContext(rh);return e||t||th.LTR}eh(di,"useDirection");var pe=require("react/jsx-runtime"),nh=Object.defineProperty,Re=(e,t)=>nh(e,"name",{value:t,configurable:!0}),ih={Single:"single",Multiple:"multiple"},wr={Vertical:"vertical",Horizontal:"horizontal"},oh={LTR:"ltr",RTL:"rtl"},qe="Accordion",ah=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[pi,{useGetCollection:sh,createCollectionScope:lh}]=Ha(qe),[Zr,Pw]=Tt(qe,[lh,ps]),hi=ps(),ch=_e.forwardRef(Re(function(e,t){let{type:r,...n}=e,i=n,o=n;return(0,pe.jsx)(pi.Provider,{scope:e.__scopeAccordion,children:r===ih.Multiple?(0,pe.jsx)(hh,{...o,ref:t}):(0,pe.jsx)(ph,{...i,ref:t})})},"Accordion")),[ms,uh]=Zr(qe),[gs,dh]=Zr(qe,{collapsible:!1}),ph=_e.forwardRef(Re(function(e,t){let{value:r,defaultValue:n,onValueChange:i=Re(()=>{},"onValueChange"),collapsible:o=!1,...a}=e,[s,l]=Yt({prop:r,defaultProp:n??"",onChange:i,caller:qe});return(0,pe.jsx)(ms,{scope:e.__scopeAccordion,value:_e.useMemo(()=>s?[s]:[],[s]),onItemOpen:l,onItemClose:_e.useCallback(()=>o&&l(""),[o,l]),children:(0,pe.jsx)(gs,{scope:e.__scopeAccordion,collapsible:o,children:(0,pe.jsx)(vs,{...a,ref:t})})})},"AccordionImplSingle")),hh=_e.forwardRef(Re(function(e,t){let{value:r,defaultValue:n,onValueChange:i=Re(()=>{},"onValueChange"),...o}=e,[a,s]=Yt({prop:r,defaultProp:n??[],onChange:i,caller:qe}),l=_e.useCallback(c=>s((d=[])=>[...d,c]),[s]),u=_e.useCallback(c=>s((d=[])=>d.filter(p=>p!==c)),[s]);return(0,pe.jsx)(ms,{scope:e.__scopeAccordion,value:a,onItemOpen:l,onItemClose:u,children:(0,pe.jsx)(gs,{scope:e.__scopeAccordion,collapsible:!0,children:(0,pe.jsx)(vs,{...o,ref:t})})})},"AccordionImplMultiple")),[fh,Qr]=Zr(qe),vs=_e.forwardRef(Re(function(e,t){let{__scopeAccordion:r,disabled:n,dir:i,orientation:o=wr.Vertical,...a}=e,s=_e.useRef(null),l=Y(s,t),u=sh(r),c=di(i)===oh.LTR,d=X(e.onKeyDown,p=>{if(!ah.includes(p.key))return;let m=u(),f=p.target,h=m.filter(([,P])=>!P.element.disabled),g=h.findIndex(([,P])=>P.element===f),y=h.size;if(g===-1)return;p.preventDefault();let v=g,x=0,w=y-1,b=Re(()=>{v=g+1,v>w&&(v=x)},"moveNext"),S=Re(()=>{v=g-1,v<x&&(v=w)},"movePrev");switch(p.key){case"Home":v=x;break;case"End":v=w;break;case"ArrowRight":o===wr.Horizontal&&(c?b():S());break;case"ArrowDown":o===wr.Vertical&&b();break;case"ArrowLeft":o===wr.Horizontal&&(c?S():b());break;case"ArrowUp":o===wr.Vertical&&S();break}let C=v%y;h.at(C)?.element.focus()});return(0,pe.jsx)(fh,{scope:r,disabled:n,direction:i,orientation:o,children:(0,pe.jsx)(pi.Slot,{scope:r,children:(0,pe.jsx)(oe.div,{...a,"data-orientation":o,ref:l,onKeyDown:n?void 0:d})})})},"AccordionImpl")),fi="AccordionItem",[mh,mi]=Zr(fi),gh=_e.forwardRef(Re(function(e,t){let{__scopeAccordion:r,value:n,...i}=e,o=Qr(fi,r),a=uh(fi,r),s=hi(r),l=xr(),u=n&&a.value.includes(n)||!1,c=o.disabled||e.disabled;return(0,pe.jsx)(mh,{scope:r,open:u,disabled:c,triggerId:l,children:(0,pe.jsx)(Gp,{"data-orientation":o.orientation,"data-state":gi(u),...s,...i,ref:t,disabled:c,open:u,onOpenChange:d=>{d?a.onItemOpen(n):a.onItemClose(n)}})})},"AccordionItem")),vh="AccordionHeader",yh=_e.forwardRef(Re(function(e,t){let{__scopeAccordion:r,...n}=e,i=Qr(qe,r),o=mi(vh,r);return(0,pe.jsx)(oe.h3,{"data-orientation":i.orientation,"data-state":gi(o.open),"data-disabled":o.disabled?"":void 0,...n,ref:t})},"AccordionHeader")),ys="AccordionTrigger",xh=_e.forwardRef(Re(function(e,t){let{__scopeAccordion:r,...n}=e,i=Qr(qe,r),o=mi(ys,r),a=dh(ys,r),s=hi(r);return(0,pe.jsx)(pi.ItemSlot,{scope:r,children:(0,pe.jsx)(Xp,{"aria-disabled":o.open&&!a.collapsible||void 0,"data-orientation":i.orientation,id:o.triggerId,...s,...n,ref:t})})},"AccordionTrigger")),bh="AccordionContent",wh=_e.forwardRef(Re(function(e,t){let{__scopeAccordion:r,...n}=e,i=Qr(qe,r),o=mi(bh,r),a=hi(r);return(0,pe.jsx)(Zp,{role:"region","aria-labelledby":o.triggerId,"data-orientation":i.orientation,...a,...n,ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})},"AccordionContent"));function gi(e){return e?"open":"closed"}Re(gi,"getState");var xs=require("react");/**
8
+ * @license lucide-react v0.577.0 - ISC
9
+ *
10
+ * This source code is licensed under the ISC license.
11
+ * See the LICENSE file in the root directory of this source tree.
12
+ */var bs=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim();/**
13
+ * @license lucide-react v0.577.0 - ISC
14
+ *
15
+ * This source code is licensed under the ISC license.
16
+ * See the LICENSE file in the root directory of this source tree.
17
+ */var Sh=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
18
+ * @license lucide-react v0.577.0 - ISC
19
+ *
20
+ * This source code is licensed under the ISC license.
21
+ * See the LICENSE file in the root directory of this source tree.
22
+ */var Ch=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,n)=>n?n.toUpperCase():r.toLowerCase());/**
23
+ * @license lucide-react v0.577.0 - ISC
24
+ *
25
+ * This source code is licensed under the ISC license.
26
+ * See the LICENSE file in the root directory of this source tree.
27
+ */var ws=e=>{let t=Ch(e);return t.charAt(0).toUpperCase()+t.slice(1)},vi=require("react");/**
28
+ * @license lucide-react v0.577.0 - ISC
29
+ *
30
+ * This source code is licensed under the ISC license.
31
+ * See the LICENSE file in the root directory of this source tree.
32
+ */var Ph={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"};/**
33
+ * @license lucide-react v0.577.0 - ISC
34
+ *
35
+ * This source code is licensed under the ISC license.
36
+ * See the LICENSE file in the root directory of this source tree.
37
+ */var _h=e=>{for(let t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};/**
38
+ * @license lucide-react v0.577.0 - ISC
39
+ *
40
+ * This source code is licensed under the ISC license.
41
+ * See the LICENSE file in the root directory of this source tree.
42
+ */var Th=(0,vi.forwardRef)(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:i="",children:o,iconNode:a,...s},l)=>(0,vi.createElement)("svg",{ref:l,...Ph,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:bs("lucide",i),...!o&&!_h(s)&&{"aria-hidden":"true"},...s},[...a.map(([u,c])=>(0,vi.createElement)(u,c)),...Array.isArray(o)?o:[o]]));/**
43
+ * @license lucide-react v0.577.0 - ISC
44
+ *
45
+ * This source code is licensed under the ISC license.
46
+ * See the LICENSE file in the root directory of this source tree.
47
+ */var yi=(e,t)=>{let r=(0,xs.forwardRef)(({className:n,...i},o)=>(0,xs.createElement)(Th,{ref:o,iconNode:t,className:bs(`lucide-${Sh(ws(e))}`,`lucide-${e}`,n),...i}));return r.displayName=ws(e),r};/**
48
+ * @license lucide-react v0.577.0 - ISC
49
+ *
50
+ * This source code is licensed under the ISC license.
51
+ * See the LICENSE file in the root directory of this source tree.
52
+ */var Rh=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Eh=yi("check",Rh);/**
53
+ * @license lucide-react v0.577.0 - ISC
54
+ *
55
+ * This source code is licensed under the ISC license.
56
+ * See the LICENSE file in the root directory of this source tree.
57
+ */var Ah=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],xi=yi("chevron-down",Ah);/**
58
+ * @license lucide-react v0.577.0 - ISC
59
+ *
60
+ * This source code is licensed under the ISC license.
61
+ * See the LICENSE file in the root directory of this source tree.
62
+ */var Mh=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Dh=yi("chevron-up",Mh);/**
63
+ * @license lucide-react v0.577.0 - ISC
64
+ *
65
+ * This source code is licensed under the ISC license.
66
+ * See the LICENSE file in the root directory of this source tree.
67
+ */var bi=require("react/jsx-runtime"),Dt=require("react"),kh=require("react"),wi=(0,kh.createContext)({}),Oh=require("react");function Si(e){let t=(0,Oh.useRef)(null);return t.current===null&&(t.current=e()),t.current}var Ss=require("react"),Ih=typeof window<"u",Ci=Ih?Ss.useLayoutEffect:Ss.useEffect,Cs=require("react/jsx-runtime"),Vh=z(require("react"),1),Sr=require("react"),Lh=require("react"),Jr=(0,Lh.createContext)(null),jh=require("react/jsx-runtime");function Pi(e,t){e.indexOf(t)===-1&&e.push(t)}function en(e,t){let r=e.indexOf(t);r>-1&&e.splice(r,1)}var Ke=(e,t,r)=>r>t?t:r<e?e:r,tn=()=>{},kt=()=>{},gt={},Ps=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),_s=e=>typeof e=="object"&&e!==null,Ts=e=>/^0[^.\s]+$/u.test(e);function Rs(e){let t;return()=>(t===void 0&&(t=e()),t)}var Ie=e=>e,Cr=(...e)=>e.reduce((t,r)=>n=>r(t(n))),Pr=(e,t,r)=>{let n=t-e;return n?(r-e)/n:1},_i=class{constructor(){this.subscriptions=[]}add(e){return Pi(this.subscriptions,e),()=>en(this.subscriptions,e)}notify(e,t,r){let n=this.subscriptions.length;if(n)if(n===1)this.subscriptions[0](e,t,r);else for(let i=0;i<n;i++){let o=this.subscriptions[i];o&&o(e,t,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}},Ce=e=>e*1e3,Ve=e=>e/1e3,Es=(e,t)=>t?e*(1e3/t):0,As=(e,t,r)=>(((1-3*r+3*t)*e+(3*r-6*t))*e+3*t)*e,Nh=1e-7,Fh=12;function Bh(e,t,r,n,i){let o,a,s=0;do a=t+(r-t)/2,o=As(a,n,i)-e,o>0?r=a:t=a;while(Math.abs(o)>Nh&&++s<Fh);return a}function _r(e,t,r,n){if(e===t&&r===n)return Ie;let i=o=>Bh(o,0,1,e,r);return o=>o===0||o===1?o:As(i(o),t,n)}var Ms=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Ds=e=>t=>1-e(1-t),ks=_r(.33,1.53,.69,.99),Ti=Ds(ks),Os=Ms(Ti),Is=e=>e>=1?1:(e*=2)<1?.5*Ti(e):.5*(2-Math.pow(2,-10*(e-1))),Ri=e=>1-Math.sin(Math.acos(e)),Vs=Ds(Ri),Ls=Ms(Ri),zh=_r(.42,0,1,1),Wh=_r(0,0,.58,1),js=_r(.42,0,.58,1),Uh=e=>Array.isArray(e)&&typeof e[0]!="number",Ns=e=>Array.isArray(e)&&typeof e[0]=="number",Fs={linear:Ie,easeIn:zh,easeInOut:js,easeOut:Wh,circIn:Ri,circInOut:Ls,circOut:Vs,backIn:Ti,backInOut:Os,backOut:ks,anticipate:Is},Hh=e=>typeof e=="string",Bs=e=>{if(Ns(e)){kt(e.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");let[t,r,n,i]=e;return _r(t,r,n,i)}else if(Hh(e))return kt(Fs[e]!==void 0,`Invalid easing type '${e}'`,"invalid-easing-type"),Fs[e];return e},rn=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function $h(e){let t=new Set,r=new Set,n=!1,i=!1,o=new WeakSet,a={delta:0,timestamp:0,isProcessing:!1};function s(u){o.has(u)&&(l.schedule(u),e()),u(a)}let l={schedule:(u,c=!1,d=!1)=>{let p=d&&n?t:r;return c&&o.add(u),p.add(u),u},cancel:u=>{r.delete(u),o.delete(u)},process:u=>{if(a=u,n){i=!0;return}n=!0;let c=t;t=r,r=c,t.forEach(s),t.clear(),n=!1,i&&(i=!1,l.process(u))}};return l}var qh=40;function zs(e,t){let r=!1,n=!0,i={delta:0,timestamp:0,isProcessing:!1},o=()=>r=!0,a=rn.reduce((y,v)=>(y[v]=$h(o),y),{}),{setup:s,read:l,resolveKeyframes:u,preUpdate:c,update:d,preRender:p,render:m,postRender:f}=a,h=()=>{let y=gt.useManualTiming,v=y?i.timestamp:performance.now();r=!1,y||(i.delta=n?1e3/60:Math.max(Math.min(v-i.timestamp,qh),1)),i.timestamp=v,i.isProcessing=!0,s.process(i),l.process(i),u.process(i),c.process(i),d.process(i),p.process(i),m.process(i),f.process(i),i.isProcessing=!1,r&&t&&(n=!1,e(h))},g=()=>{r=!0,n=!0,i.isProcessing||e(h)};return{schedule:rn.reduce((y,v)=>{let x=a[v];return y[v]=(w,b=!1,S=!1)=>(r||g(),x.schedule(w,b,S)),y},{}),cancel:y=>{for(let v=0;v<rn.length;v++)a[rn[v]].cancel(y)},state:i,steps:a}}var{schedule:q,cancel:vt,state:fe,steps:Ei}=zs(typeof requestAnimationFrame<"u"?requestAnimationFrame:Ie,!0),nn;function Kh(){nn=void 0}var xe={now:()=>(nn===void 0&&xe.set(fe.isProcessing||gt.useManualTiming?fe.timestamp:performance.now()),nn),set:e=>{nn=e,queueMicrotask(Kh)}},Ws=e=>t=>typeof t=="string"&&t.startsWith(e),Us=Ws("--"),Gh=Ws("var(--"),Ai=e=>Gh(e)?Yh.test(e.split("/*")[0].trim()):!1,Yh=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Hs(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}var Qt={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Tr={...Qt,transform:e=>Ke(0,1,e)},on={...Qt,default:1},Rr=e=>Math.round(e*1e5)/1e5,Mi=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Xh(e){return e==null}var Zh=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Di=(e,t)=>r=>!!(typeof r=="string"&&Zh.test(r)&&r.startsWith(e)||t&&!Xh(r)&&Object.prototype.hasOwnProperty.call(r,t)),$s=(e,t,r)=>n=>{if(typeof n!="string")return n;let[i,o,a,s]=n.match(Mi);return{[e]:parseFloat(i),[t]:parseFloat(o),[r]:parseFloat(a),alpha:s!==void 0?parseFloat(s):1}},Qh=e=>Ke(0,255,e),ki={...Qt,transform:e=>Math.round(Qh(e))},Ot={test:Di("rgb","red"),parse:$s("red","green","blue"),transform:({red:e,green:t,blue:r,alpha:n=1})=>"rgba("+ki.transform(e)+", "+ki.transform(t)+", "+ki.transform(r)+", "+Rr(Tr.transform(n))+")"};function Jh(e){let t="",r="",n="",i="";return e.length>5?(t=e.substring(1,3),r=e.substring(3,5),n=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),r=e.substring(2,3),n=e.substring(3,4),i=e.substring(4,5),t+=t,r+=r,n+=n,i+=i),{red:parseInt(t,16),green:parseInt(r,16),blue:parseInt(n,16),alpha:i?parseInt(i,16)/255:1}}var Oi={test:Di("#"),parse:Jh,transform:Ot.transform},Er=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),st=Er("deg"),Ge=Er("%"),A=Er("px"),ef=Er("vh"),tf=Er("vw"),qs={...Ge,parse:e=>Ge.parse(e)/100,transform:e=>Ge.transform(e*100)},Jt={test:Di("hsl","hue"),parse:$s("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:r,alpha:n=1})=>"hsla("+Math.round(e)+", "+Ge.transform(Rr(t))+", "+Ge.transform(Rr(r))+", "+Rr(Tr.transform(n))+")"},ae={test:e=>Ot.test(e)||Oi.test(e)||Jt.test(e),parse:e=>Ot.test(e)?Ot.parse(e):Jt.test(e)?Jt.parse(e):Oi.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Ot.transform(e):Jt.transform(e),getAnimatableNone:e=>{let t=ae.parse(e);return t.alpha=0,ae.transform(t)}},rf=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function nf(e){return isNaN(e)&&typeof e=="string"&&(e.match(Mi)?.length||0)+(e.match(rf)?.length||0)>0}var Ks="number",Gs="color",of="var",af="var(",Ys="${}",sf=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function er(e){let t=e.toString(),r=[],n={color:[],number:[],var:[]},i=[],o=0,a=t.replace(sf,s=>(ae.test(s)?(n.color.push(o),i.push(Gs),r.push(ae.parse(s))):s.startsWith(af)?(n.var.push(o),i.push(of),r.push(s)):(n.number.push(o),i.push(Ks),r.push(parseFloat(s))),++o,Ys)).split(Ys);return{values:r,split:a,indexes:n,types:i}}function lf(e){return er(e).values}function Xs({split:e,types:t}){let r=e.length;return n=>{let i="";for(let o=0;o<r;o++)if(i+=e[o],n[o]!==void 0){let a=t[o];a===Ks?i+=Rr(n[o]):a===Gs?i+=ae.transform(n[o]):i+=n[o]}return i}}function cf(e){return Xs(er(e))}var uf=e=>typeof e=="number"?0:ae.test(e)?ae.getAnimatableNone(e):e,df=(e,t)=>typeof e=="number"?t?.trim().endsWith("/")?e:0:uf(e);function pf(e){let t=er(e);return Xs(t)(t.values.map((r,n)=>df(r,t.split[n])))}var Fe={test:nf,parse:lf,createTransformer:cf,getAnimatableNone:pf};function Ii(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*6*r:r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function hf({hue:e,saturation:t,lightness:r,alpha:n}){e/=360,t/=100,r/=100;let i=0,o=0,a=0;if(!t)i=o=a=r;else{let s=r<.5?r*(1+t):r+t-r*t,l=2*r-s;i=Ii(l,s,e+1/3),o=Ii(l,s,e),a=Ii(l,s,e-1/3)}return{red:Math.round(i*255),green:Math.round(o*255),blue:Math.round(a*255),alpha:n}}function an(e,t){return r=>r>0?t:e}var K=(e,t,r)=>e+(t-e)*r,Vi=(e,t,r)=>{let n=e*e,i=r*(t*t-n)+n;return i<0?0:Math.sqrt(i)},ff=[Oi,Ot,Jt],mf=e=>ff.find(t=>t.test(e));function Zs(e){let t=mf(e);if(tn(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!t)return!1;let r=t.parse(e);return t===Jt&&(r=hf(r)),r}var Qs=(e,t)=>{let r=Zs(e),n=Zs(t);if(!r||!n)return an(e,t);let i={...r};return o=>(i.red=Vi(r.red,n.red,o),i.green=Vi(r.green,n.green,o),i.blue=Vi(r.blue,n.blue,o),i.alpha=K(r.alpha,n.alpha,o),Ot.transform(i))},Li=new Set(["none","hidden"]);function gf(e,t){return Li.has(e)?r=>r<=0?e:t:r=>r>=1?t:e}function vf(e,t){return r=>K(e,t,r)}function ji(e){return typeof e=="number"?vf:typeof e=="string"?Ai(e)?an:ae.test(e)?Qs:bf:Array.isArray(e)?Js:typeof e=="object"?ae.test(e)?Qs:yf:an}function Js(e,t){let r=[...e],n=r.length,i=e.map((o,a)=>ji(o)(o,t[a]));return o=>{for(let a=0;a<n;a++)r[a]=i[a](o);return r}}function yf(e,t){let r={...e,...t},n={};for(let i in r)e[i]!==void 0&&t[i]!==void 0&&(n[i]=ji(e[i])(e[i],t[i]));return i=>{for(let o in n)r[o]=n[o](i);return r}}function xf(e,t){let r=[],n={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){let o=t.types[i],a=e.indexes[o][n[o]],s=e.values[a]??0;r[i]=s,n[o]++}return r}var bf=(e,t)=>{let r=Fe.createTransformer(t),n=er(e),i=er(t);return n.indexes.var.length===i.indexes.var.length&&n.indexes.color.length===i.indexes.color.length&&n.indexes.number.length>=i.indexes.number.length?Li.has(e)&&!i.values.length||Li.has(t)&&!n.values.length?gf(e,t):Cr(Js(xf(n,i),i.values),r):(tn(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),an(e,t))};function el(e,t,r){return typeof e=="number"&&typeof t=="number"&&typeof r=="number"?K(e,t,r):ji(e)(e,t)}var wf=e=>{let t=({timestamp:r})=>e(r);return{start:(r=!0)=>q.update(t,r),stop:()=>vt(t),now:()=>fe.isProcessing?fe.timestamp:xe.now()}},tl=(e,t,r=10)=>{let n="",i=Math.max(Math.round(t/r),2);for(let o=0;o<i;o++)n+=Math.round(e(o/(i-1))*1e4)/1e4+", ";return`linear(${n.substring(0,n.length-2)})`};function Ni(e){let t=0,r=50,n=e.next(t);for(;!n.done&&t<2e4;)t+=r,n=e.next(t);return t>=2e4?1/0:t}function Sf(e,t=100,r){let n=r({...e,keyframes:[0,t]}),i=Math.min(Ni(n),2e4);return{type:"keyframes",ease:o=>n.next(i*o).value/t,duration:Ve(i)}}var Z={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function Fi(e,t){return e*Math.sqrt(1-t*t)}var Cf=12;function Pf(e,t,r){let n=r;for(let i=1;i<Cf;i++)n=n-e(n)/t(n);return n}var Bi=.001;function _f({duration:e=Z.duration,bounce:t=Z.bounce,velocity:r=Z.velocity,mass:n=Z.mass}){let i,o;tn(e<=Ce(Z.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let a=1-t;a=Ke(Z.minDamping,Z.maxDamping,a),e=Ke(Z.minDuration,Z.maxDuration,Ve(e)),a<1?(i=u=>{let c=u*a,d=c*e,p=c-r,m=Fi(u,a),f=Math.exp(-d);return Bi-p/m*f},o=u=>{let c=u*a*e,d=c*r+r,p=Math.pow(a,2)*Math.pow(u,2)*e,m=Math.exp(-c),f=Fi(Math.pow(u,2),a);return(-i(u)+Bi>0?-1:1)*((d-p)*m)/f}):(i=u=>{let c=Math.exp(-u*e),d=(u-r)*e+1;return-Bi+c*d},o=u=>{let c=Math.exp(-u*e),d=(r-u)*(e*e);return c*d});let s=5/e,l=Pf(i,o,s);if(e=Ce(e),isNaN(l))return{stiffness:Z.stiffness,damping:Z.damping,duration:e};{let u=Math.pow(l,2)*n;return{stiffness:u,damping:a*2*Math.sqrt(n*u),duration:e}}}var Tf=["duration","bounce"],Rf=["stiffness","damping","mass"];function rl(e,t){return t.some(r=>e[r]!==void 0)}function Ef(e){let t={velocity:Z.velocity,stiffness:Z.stiffness,damping:Z.damping,mass:Z.mass,isResolvedFromDuration:!1,...e};if(!rl(e,Rf)&&rl(e,Tf))if(t.velocity=0,e.visualDuration){let r=e.visualDuration,n=2*Math.PI/(r*1.2),i=n*n,o=2*Ke(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:Z.mass,stiffness:i,damping:o}}else{let r=_f({...e,velocity:0});t={...t,...r,mass:Z.mass},t.isResolvedFromDuration=!0}return t}function sn(e=Z.visualDuration,t=Z.bounce){let r=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e,{restSpeed:n,restDelta:i}=r,o=r.keyframes[0],a=r.keyframes[r.keyframes.length-1],s={done:!1,value:o},{stiffness:l,damping:u,mass:c,duration:d,velocity:p,isResolvedFromDuration:m}=Ef({...r,velocity:-Ve(r.velocity||0)}),f=p||0,h=u/(2*Math.sqrt(l*c)),g=a-o,y=Ve(Math.sqrt(l/c)),v=Math.abs(g)<5;n||(n=v?Z.restSpeed.granular:Z.restSpeed.default),i||(i=v?Z.restDelta.granular:Z.restDelta.default);let x,w,b,S,C,P;if(h<1)b=Fi(y,h),S=(f+h*y*g)/b,x=_=>{let R=Math.exp(-h*y*_);return a-R*(S*Math.sin(b*_)+g*Math.cos(b*_))},C=h*y*S+g*b,P=h*y*g-S*b,w=_=>Math.exp(-h*y*_)*(C*Math.sin(b*_)+P*Math.cos(b*_));else if(h===1){x=R=>a-Math.exp(-y*R)*(g+(f+y*g)*R);let _=f+y*g;w=R=>Math.exp(-y*R)*(y*_*R-f)}else{let _=y*Math.sqrt(h*h-1);x=O=>{let B=Math.exp(-h*y*O),N=Math.min(_*O,300);return a-B*((f+h*y*g)*Math.sinh(N)+_*g*Math.cosh(N))/_};let R=(f+h*y*g)/_,k=h*y*R-g*_,I=h*y*g-R*_;w=O=>{let B=Math.exp(-h*y*O),N=Math.min(_*O,300);return B*(k*Math.sinh(N)+I*Math.cosh(N))}}let T={calculatedDuration:m&&d||null,velocity:_=>Ce(w(_)),next:_=>{if(!m&&h<1){let k=Math.exp(-h*y*_),I=Math.sin(b*_),O=Math.cos(b*_),B=a-k*(S*I+g*O),N=Ce(k*(C*I+P*O));return s.done=Math.abs(N)<=n&&Math.abs(a-B)<=i,s.value=s.done?a:B,s}let R=x(_);if(m)s.done=_>=d;else{let k=Ce(w(_));s.done=Math.abs(k)<=n&&Math.abs(a-R)<=i}return s.value=s.done?a:R,s},toString:()=>{let _=Math.min(Ni(T),2e4),R=tl(k=>T.next(_*k).value,_,30);return _+"ms "+R},toTransition:()=>{}};return T}sn.applyToOptions=e=>{let t=Sf(e,100,sn);return e.ease=t.ease,e.duration=Ce(t.duration),e.type="keyframes",e};var Af=5;function nl(e,t,r){let n=Math.max(t-Af,0);return Es(r-e(n),t-n)}function zi({keyframes:e,velocity:t=0,power:r=.8,timeConstant:n=325,bounceDamping:i=10,bounceStiffness:o=500,modifyTarget:a,min:s,max:l,restDelta:u=.5,restSpeed:c}){let d=e[0],p={done:!1,value:d},m=P=>s!==void 0&&P<s||l!==void 0&&P>l,f=P=>s===void 0?l:l===void 0||Math.abs(s-P)<Math.abs(l-P)?s:l,h=r*t,g=d+h,y=a===void 0?g:a(g);y!==g&&(h=y-d);let v=P=>-h*Math.exp(-P/n),x=P=>y+v(P),w=P=>{let T=v(P),_=x(P);p.done=Math.abs(T)<=u,p.value=p.done?y:_},b,S,C=P=>{m(p.value)&&(b=P,S=sn({keyframes:[p.value,f(p.value)],velocity:nl(x,P,p.value),damping:i,stiffness:o,restDelta:u,restSpeed:c}))};return C(0),{calculatedDuration:null,next:P=>{let T=!1;return!S&&b===void 0&&(T=!0,w(P),C(P)),b!==void 0&&P>=b?S.next(P-b):(!T&&w(P),p)}}}function Mf(e,t,r){let n=[],i=r||gt.mix||el,o=e.length-1;for(let a=0;a<o;a++){let s=i(e[a],e[a+1]);if(t){let l=Array.isArray(t)?t[a]||Ie:t;s=Cr(l,s)}n.push(s)}return n}function Df(e,t,{clamp:r=!0,ease:n,mixer:i}={}){let o=e.length;if(kt(o===t.length,"Both input and output ranges must be the same length","range-length"),o===1)return()=>t[0];if(o===2&&t[0]===t[1])return()=>t[1];let a=e[0]===e[1];e[0]>e[o-1]&&(e=[...e].reverse(),t=[...t].reverse());let s=Mf(t,n,i),l=s.length,u=c=>{if(a&&c<e[0])return t[0];let d=0;if(l>1)for(;d<e.length-2&&!(c<e[d+1]);d++);let p=Pr(e[d],e[d+1],c);return s[d](p)};return r?c=>u(Ke(e[0],e[o-1],c)):u}function kf(e,t){let r=e[e.length-1];for(let n=1;n<=t;n++){let i=Pr(0,t,n);e.push(K(r,1,i))}}function Of(e){let t=[0];return kf(t,e.length-1),t}function If(e,t){return e.map(r=>r*t)}function Vf(e,t){return e.map(()=>t||js).splice(0,e.length-1)}function Ar({duration:e=300,keyframes:t,times:r,ease:n="easeInOut"}){let i=Uh(n)?n.map(Bs):Bs(n),o={done:!1,value:t[0]},a=If(r&&r.length===t.length?r:Of(t),e),s=Df(a,t,{ease:Array.isArray(i)?i:Vf(t,i)});return{calculatedDuration:e,next:l=>(o.value=s(l),o.done=l>=e,o)}}var Lf=e=>e!==null;function ln(e,{repeat:t,repeatType:r="loop"},n,i=1){let o=e.filter(Lf),a=i<0||t&&r!=="loop"&&t%2===1?0:o.length-1;return!a||n===void 0?o[a]:n}var jf={decay:zi,inertia:zi,tween:Ar,keyframes:Ar,spring:sn};function il(e){typeof e.type=="string"&&(e.type=jf[e.type])}var Wi=class{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,t){return this.finished.then(e,t)}},Nf=e=>e/100,cn=class extends Wi{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{let{motionValue:t}=this.options;t&&t.updatedAt!==xe.now()&&this.tick(xe.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){let{options:e}=this;il(e);let{type:t=Ar,repeat:r=0,repeatDelay:n=0,repeatType:i,velocity:o=0}=e,{keyframes:a}=e,s=t||Ar;s!==Ar&&typeof a[0]!="number"&&(this.mixKeyframes=Cr(Nf,el(a[0],a[1])),a=[0,100]);let l=s({...e,keyframes:a});i==="mirror"&&(this.mirroredGenerator=s({...e,keyframes:[...a].reverse(),velocity:-o})),l.calculatedDuration===null&&(l.calculatedDuration=Ni(l));let{calculatedDuration:u}=l;this.calculatedDuration=u,this.resolvedDuration=u+n,this.totalDuration=this.resolvedDuration*(r+1)-n,this.generator=l}updateTime(e){let t=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=t}tick(e,t=!1){let{generator:r,totalDuration:n,mixKeyframes:i,mirroredGenerator:o,resolvedDuration:a,calculatedDuration:s}=this;if(this.startTime===null)return r.next(0);let{delay:l=0,keyframes:u,repeat:c,repeatType:d,repeatDelay:p,type:m,onUpdate:f,finalKeyframe:h}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-n/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let g=this.currentTime-l*(this.playbackSpeed>=0?1:-1),y=this.playbackSpeed>=0?g<0:g>n;this.currentTime=Math.max(g,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=n);let v=this.currentTime,x=r;if(c){let C=Math.min(this.currentTime,n)/a,P=Math.floor(C),T=C%1;!T&&C>=1&&(T=1),T===1&&P--,P=Math.min(P,c+1),P%2&&(d==="reverse"?(T=1-T,p&&(T-=p/a)):d==="mirror"&&(x=o)),v=Ke(0,1,T)*a}let w;y?(this.delayState.value=u[0],w=this.delayState):w=x.next(v),i&&!y&&(w.value=i(w.value));let{done:b}=w;!y&&s!==null&&(b=this.playbackSpeed>=0?this.currentTime>=n:this.currentTime<=0);let S=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&b);return S&&m!==zi&&(w.value=ln(u,this.options,h,this.speed)),f&&f(w.value),S&&this.finish(),w}then(e,t){return this.finished.then(e,t)}get duration(){return Ve(this.calculatedDuration)}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+Ve(e)}get time(){return Ve(this.currentTime)}set time(e){e=Ce(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=e,this.tick(e))}getGeneratorVelocity(){let e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);let t=this.generator.next(e).value;return nl(r=>this.generator.next(r).value,e,t)}get speed(){return this.playbackSpeed}set speed(e){let t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(xe.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=Ve(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=wf,startTime:t}=this.options;this.driver||(this.driver=e(n=>this.tick(n))),this.options.onPlay?.();let r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=t??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(xe.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),e.observe(this)}};function Ff(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}var It=e=>e*180/Math.PI,Ui=e=>{let t=It(Math.atan2(e[1],e[0]));return Hi(t)},Bf={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Ui,rotateZ:Ui,skewX:e=>It(Math.atan(e[1])),skewY:e=>It(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Hi=e=>(e=e%360,e<0&&(e+=360),e),ol=Ui,al=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),sl=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),zf={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:al,scaleY:sl,scale:e=>(al(e)+sl(e))/2,rotateX:e=>Hi(It(Math.atan2(e[6],e[5]))),rotateY:e=>Hi(It(Math.atan2(-e[2],e[0]))),rotateZ:ol,rotate:ol,skewX:e=>It(Math.atan(e[4])),skewY:e=>It(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function $i(e){return e.includes("scale")?1:0}function qi(e,t){if(!e||e==="none")return $i(t);let r=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),n,i;if(r)n=zf,i=r;else{let s=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);n=Bf,i=s}if(!i)return $i(t);let o=n[t],a=i[1].split(",").map(Uf);return typeof o=="function"?o(a):a[o]}var Wf=(e,t)=>{let{transform:r="none"}=getComputedStyle(e);return qi(r,t)};function Uf(e){return parseFloat(e.trim())}var tr=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],rr=new Set([...tr,"pathRotation"]),ll=e=>e===Qt||e===A,Hf=new Set(["x","y","z"]),$f=tr.filter(e=>!Hf.has(e));function qf(e){let t=[];return $f.forEach(r=>{let n=e.getValue(r);n!==void 0&&(t.push([r,n.get()]),n.set(r.startsWith("scale")?1:0))}),t}var yt={width:({x:e},{paddingLeft:t="0",paddingRight:r="0",boxSizing:n})=>{let i=e.max-e.min;return n==="border-box"?i:i-parseFloat(t)-parseFloat(r)},height:({y:e},{paddingTop:t="0",paddingBottom:r="0",boxSizing:n})=>{let i=e.max-e.min;return n==="border-box"?i:i-parseFloat(t)-parseFloat(r)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>qi(t,"x"),y:(e,{transform:t})=>qi(t,"y")};yt.translateX=yt.x,yt.translateY=yt.y;var Vt=new Set,Ki=!1,Gi=!1,Yi=!1;function cl(){if(Gi){let e=Array.from(Vt).filter(n=>n.needsMeasurement),t=new Set(e.map(n=>n.element)),r=new Map;t.forEach(n=>{let i=qf(n);i.length&&(r.set(n,i),n.render())}),e.forEach(n=>n.measureInitialState()),t.forEach(n=>{n.render();let i=r.get(n);i&&i.forEach(([o,a])=>{n.getValue(o)?.set(a)})}),e.forEach(n=>n.measureEndState()),e.forEach(n=>{n.suspendedScrollY!==void 0&&window.scrollTo(0,n.suspendedScrollY)})}Gi=!1,Ki=!1,Vt.forEach(e=>e.complete(Yi)),Vt.clear()}function ul(){Vt.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Gi=!0)})}function Kf(){Yi=!0,ul(),cl(),Yi=!1}var Xi=class{constructor(e,t,r,n,i,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=r,this.motionValue=n,this.element=i,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(Vt.add(this),Ki||(Ki=!0,q.read(ul),q.resolveKeyframes(cl))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:r,motionValue:n}=this;if(e[0]===null){let i=n?.get(),o=e[e.length-1];if(i!==void 0)e[0]=i;else if(r&&t){let a=r.readValue(t,o);a!=null&&(e[0]=a)}e[0]===void 0&&(e[0]=o),n&&i===void 0&&n.set(e[0])}Ff(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),Vt.delete(this)}cancel(){this.state==="scheduled"&&(Vt.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}},Gf=e=>e.startsWith("--");function dl(e,t,r){Gf(t)?e.style.setProperty(t,r):e.style[t]=r}var Yf={};function pl(e,t){let r=Rs(e);return()=>Yf[t]??r()}var Xf=pl(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),hl=pl(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Mr=([e,t,r,n])=>`cubic-bezier(${e}, ${t}, ${r}, ${n})`,fl={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Mr([0,.65,.55,1]),circOut:Mr([.55,0,1,.45]),backIn:Mr([.31,.01,.66,-.59]),backOut:Mr([.33,1.53,.69,.99])};function ml(e,t){if(e)return typeof e=="function"?hl()?tl(e,t):"ease-out":Ns(e)?Mr(e):Array.isArray(e)?e.map(r=>ml(r,t)||fl.easeOut):fl[e]}function Zf(e,t,r,{delay:n=0,duration:i=300,repeat:o=0,repeatType:a="loop",ease:s="easeOut",times:l}={},u=void 0){let c={[t]:r};l&&(c.offset=l);let d=ml(s,i);Array.isArray(d)&&(c.easing=d);let p={delay:n,duration:i,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:o+1,direction:a==="reverse"?"alternate":"normal"};return u&&(p.pseudoElement=u),e.animate(c,p)}function gl(e){return typeof e=="function"&&"applyToOptions"in e}function Qf({type:e,...t}){return gl(e)&&hl()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}var vl=class extends Wi{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;let{element:t,name:r,keyframes:n,pseudoElement:i,allowFlatten:o=!1,finalKeyframe:a,onComplete:s}=e;this.isPseudoElement=!!i,this.allowFlatten=o,this.options=e,kt(typeof e.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");let l=Qf(e);this.animation=Zf(t,r,n,l,i),l.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let u=ln(n,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(u),dl(t,r,u),this.animation.cancel()}s?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){let e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){let e=this.animation.effect?.getComputedTiming?.().duration||0;return Ve(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+Ve(e)}get time(){return Ve(Number(this.animation.currentTime)||0)}set time(e){let t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Ce(e),t&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:t,rangeEnd:r,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,e&&Xf()?(this.animation.timeline=e,t&&(this.animation.rangeStart=t),r&&(this.animation.rangeEnd=r),Ie):n(this)}},yl={anticipate:Is,backInOut:Os,circInOut:Ls};function Jf(e){return e in yl}function em(e){typeof e.ease=="string"&&Jf(e.ease)&&(e.ease=yl[e.ease])}var Zi=10,tm=class extends vl{constructor(e){em(e),il(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){let{motionValue:t,onUpdate:r,onComplete:n,element:i,...o}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let a=new cn({...o,autoplay:!1}),s=Math.max(Zi,xe.now()-this.startTime),l=Ke(0,Zi,s-Zi),u=a.sample(s).value,{name:c}=this.options;i&&c&&dl(i,c,u),t.setWithVelocity(a.sample(Math.max(0,s-l)).value,u,l),a.stop()}},xl=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Fe.test(e)||e==="0")&&!e.startsWith("url("));function rm(e){let t=e[0];if(e.length===1)return!0;for(let r=0;r<e.length;r++)if(e[r]!==t)return!0}function nm(e,t,r,n){let i=e[0];if(i===null)return!1;if(t==="display"||t==="visibility")return!0;let o=e[e.length-1],a=xl(i,t),s=xl(o,t);return tn(a===s,`You are trying to animate ${t} from "${i}" to "${o}". "${a?o:i}" is not an animatable value.`,"value-not-animatable"),!a||!s?!1:rm(e)||(r==="spring"||gl(r))&&n}function Qi(e){e.duration=0,e.type="keyframes"}var bl=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),im=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function om(e){for(let t=0;t<e.length;t++)if(typeof e[t]=="string"&&im.test(e[t]))return!0;return!1}var am=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),sm=Rs(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function lm(e){let{motionValue:t,name:r,repeatDelay:n,repeatType:i,damping:o,type:a,keyframes:s}=e,l=t?.owner?.current;if(!(l instanceof HTMLElement)&&!(l instanceof SVGElement))return!1;let{onUpdate:u,transformTemplate:c}=t.owner.getProps();return sm()&&r&&(bl.has(r)||am.has(r)&&om(s))&&(r!=="transform"||!c)&&!u&&!n&&i!=="mirror"&&o!==0&&a!=="inertia"}var cm=40,um=class extends Wi{constructor({autoplay:e=!0,delay:t=0,type:r="keyframes",repeat:n=0,repeatDelay:i=0,repeatType:o="loop",keyframes:a,name:s,motionValue:l,element:u,...c}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=xe.now();let d={autoplay:e,delay:t,type:r,repeat:n,repeatDelay:i,repeatType:o,name:s,motionValue:l,element:u,...c},p=u?.KeyframeResolver||Xi;this.keyframeResolver=new p(a,(m,f,h)=>this.onKeyframesResolved(m,f,d,!h),s,l,u),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,r,n){this.keyframeResolver=void 0;let{name:i,type:o,velocity:a,delay:s,isHandoff:l,onUpdate:u}=r;this.resolvedAt=xe.now();let c=!0;nm(e,i,o,a)||(c=!1,(gt.instantAnimations||!s)&&u?.(ln(e,r,t)),e[0]=e[e.length-1],Qi(r),r.repeat=0);let d={startTime:n?this.resolvedAt?this.resolvedAt-this.createdAt>cm?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:t,...r,keyframes:e},p=c&&!l&&lm(d),m=d.motionValue?.owner?.current,f;if(p)try{f=new tm({...d,element:m})}catch{f=new cn(d)}else f=new cn(d);f.finished.then(()=>{this.notifyFinished()}).catch(Ie),this.pendingTimeline&&(this.stopTimeline=f.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=f}get finished(){return this._animation?this.animation.finished:this._finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),Kf()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}};function wl(e,t,r,n=0,i=1){let o=Array.from(e).sort((l,u)=>l.sortNodePosition(u)).indexOf(t),a=e.size,s=(a-1)*n;return typeof r=="function"?r(o,a):i===1?o*n:s-o*n}var Sl=30,dm=e=>!isNaN(parseFloat(e)),Cl={current:void 0},pm=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{let n=xe.now();if(this.updatedAt!==n&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(let i of this.dependents)i.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=xe.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=dm(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,t){this.events[e]||(this.events[e]=new _i);let r=this.events[e].add(t);return e==="change"?()=>{r(),q.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,r){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-r}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return Cl.current&&Cl.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let e=xe.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>Sl)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,Sl);return Es(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function nr(e,t){return new pm(e,t)}function Pl(e,t){if(e?.inherit&&t){let{inherit:r,...n}=e;return{...t,...n}}return e}function Ji(e,t){let r=e?.[t]??e?.default??e;return r!==e?Pl(r,e):r}var hm={type:"spring",stiffness:500,damping:25,restSpeed:10},fm=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),mm={type:"keyframes",duration:.8},gm={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},vm=(e,{keyframes:t})=>t.length>2?mm:rr.has(e)?e.startsWith("scale")?fm(t[1]):hm:gm,ym=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function xm(e){for(let t in e)if(!ym.has(t))return!0;return!1}var eo=(e,t,r,n={},i,o)=>a=>{let s=Ji(n,e)||{},l=s.delay||n.delay||0,{elapsed:u=0}=n;u=u-Ce(l);let c={keyframes:Array.isArray(r)?r:[null,r],ease:"easeOut",velocity:t.getVelocity(),...s,delay:-u,onUpdate:p=>{t.set(p),s.onUpdate&&s.onUpdate(p)},onComplete:()=>{a(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:o?void 0:i};xm(s)||Object.assign(c,vm(e,c)),c.duration&&(c.duration=Ce(c.duration)),c.repeatDelay&&(c.repeatDelay=Ce(c.repeatDelay)),c.from!==void 0&&(c.keyframes[0]=c.from);let d=!1;if((c.type===!1||c.duration===0&&!c.repeatDelay)&&(Qi(c),c.delay===0&&(d=!0)),(gt.instantAnimations||gt.skipAnimations||i?.shouldSkipAnimations||s.skipAnimations)&&(d=!0,Qi(c),c.delay=0),c.allowFlatten=!s.type&&!s.ease,d&&!o&&t.get()!==void 0){let p=ln(c.keyframes,s);if(p!==void 0){q.update(()=>{c.onUpdate(p),c.onComplete()});return}}return s.isSync?new cn(c):new um(c)},bm=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function wm(e){let t=bm.exec(e);if(!t)return[,];let[,r,n,i]=t;return[`--${r??n}`,i]}var Sm=4;function _l(e,t,r=1){kt(r<=Sm,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");let[n,i]=wm(e);if(!n)return;let o=window.getComputedStyle(t).getPropertyValue(n);if(o){let a=o.trim();return Ps(a)?parseFloat(a):a}return Ai(i)?_l(i,t,r+1):i}function Tl(e){let t=[{},{}];return e?.values.forEach((r,n)=>{t[0][n]=r.get(),t[1][n]=r.getVelocity()}),t}function to(e,t,r,n){if(typeof t=="function"){let[i,o]=Tl(n);t=t(r!==void 0?r:e.custom,i,o)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){let[i,o]=Tl(n);t=t(r!==void 0?r:e.custom,i,o)}return t}function Lt(e,t,r){let n=e.getProps();return to(n,t,r!==void 0?r:n.custom,e)}var Rl=new Set(["width","height","top","left","right","bottom",...tr]),ro=e=>Array.isArray(e);function Cm(e,t,r){e.hasValue(t)?e.getValue(t).set(r):e.addValue(t,nr(r))}function Pm(e){return ro(e)?e[e.length-1]||0:e}function _m(e,t){let r=Lt(e,t),{transitionEnd:n={},transition:i={},...o}=r||{};o={...o,...n};for(let a in o){let s=Pm(o[a]);Cm(e,a,s)}}var me=e=>!!(e&&e.getVelocity);function Tm(e){return!!(me(e)&&e.add)}function no(e,t){let r=e.getValue("willChange");if(Tm(r))return r.add(t);if(!r&&gt.WillChange){let n=new gt.WillChange("auto");e.addValue("willChange",n),n.add(t)}}function io(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}var Rm="framerAppearId",El="data-"+io(Rm);function Al(e){return e.props[El]}function Em({protectedKeys:e,needsAnimating:t},r){let n=e.hasOwnProperty(r)&&t[r]!==!0;return t[r]=!1,n}function Ml(e,t,{delay:r=0,transitionOverride:n,type:i}={}){let{transition:o,transitionEnd:a,...s}=t,l=e.getDefaultTransition();o=o?Pl(o,l):l;let u=o?.reduceMotion,c=o?.skipAnimations;n&&(o=n);let d=[],p=i&&e.animationState&&e.animationState.getState()[i],m=o?.path;m&&m.animateVisualElement(e,s,o,r,d);for(let f in s){let h=e.getValue(f,e.latestValues[f]??null),g=s[f];if(g===void 0||p&&Em(p,f))continue;let y={delay:r,...Ji(o||{},f)};c&&(y.skipAnimations=!0);let v=h.get();if(v!==void 0&&!h.isAnimating()&&!Array.isArray(g)&&g===v&&!y.velocity){q.update(()=>h.set(g));continue}let x=!1;if(window.MotionHandoffAnimation){let S=Al(e);if(S){let C=window.MotionHandoffAnimation(S,f,q);C!==null&&(y.startTime=C,x=!0)}}no(e,f);let w=u??e.shouldReduceMotion;h.start(eo(f,h,g,w&&Rl.has(f)?{type:!1}:y,e,x));let b=h.animation;b&&d.push(b)}if(a){let f=()=>q.update(()=>{a&&_m(e,a)});d.length?Promise.all(d).then(f):f()}return d}function oo(e,t,r={}){let n=Lt(e,t,r.type==="exit"?e.presenceContext?.custom:void 0),{transition:i=e.getDefaultTransition()||{}}=n||{};r.transitionOverride&&(i=r.transitionOverride);let o=n?()=>Promise.all(Ml(e,n,r)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(l=0)=>{let{delayChildren:u=0,staggerChildren:c,staggerDirection:d}=i;return Am(e,t,l,u,c,d,r)}:()=>Promise.resolve(),{when:s}=i;if(s){let[l,u]=s==="beforeChildren"?[o,a]:[a,o];return l().then(()=>u())}else return Promise.all([o(),a(r.delay)])}function Am(e,t,r=0,n=0,i=0,o=1,a){let s=[];for(let l of e.variantChildren)l.notify("AnimationStart",t),s.push(oo(l,t,{...a,delay:r+(typeof n=="function"?0:n)+wl(e.variantChildren,l,n,i,o)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(s)}function Mm(e,t,r={}){e.notify("AnimationStart",t);let n;if(Array.isArray(t)){let i=t.map(o=>oo(e,o,r));n=Promise.all(i)}else if(typeof t=="string")n=oo(e,t,r);else{let i=typeof t=="function"?Lt(e,t,r.custom):t;n=Promise.all(Ml(e,i,r))}return n.then(()=>{e.notify("AnimationComplete",t)})}var Dm={test:e=>e==="auto",parse:e=>e},Dl=e=>t=>t.test(e),kl=[Qt,A,Ge,st,tf,ef,Dm],Ol=e=>kl.find(Dl(e));function km(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||Ts(e):!0}var Om=new Set(["brightness","contrast","saturate","opacity"]);function Im(e){let[t,r]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;let[n]=r.match(Mi)||[];if(!n)return e;let i=r.replace(n,""),o=Om.has(t)?1:0;return n!==r&&(o*=100),t+"("+o+i+")"}var Vm=/\b([a-z-]*)\(.*?\)/gu,ao={...Fe,getAnimatableNone:e=>{let t=e.match(Vm);return t?t.map(Im).join(" "):e}},so={...Fe,getAnimatableNone:e=>{let t=Fe.parse(e);return Fe.createTransformer(e)(t.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},Il={...Qt,transform:Math.round},Lm={rotate:st,pathRotation:st,rotateX:st,rotateY:st,rotateZ:st,scale:on,scaleX:on,scaleY:on,scaleZ:on,skew:st,skewX:st,skewY:st,distance:A,translateX:A,translateY:A,translateZ:A,x:A,y:A,z:A,perspective:A,transformPerspective:A,opacity:Tr,originX:qs,originY:qs,originZ:A},un={borderWidth:A,borderTopWidth:A,borderRightWidth:A,borderBottomWidth:A,borderLeftWidth:A,borderRadius:A,borderTopLeftRadius:A,borderTopRightRadius:A,borderBottomRightRadius:A,borderBottomLeftRadius:A,width:A,maxWidth:A,height:A,maxHeight:A,top:A,right:A,bottom:A,left:A,inset:A,insetBlock:A,insetBlockStart:A,insetBlockEnd:A,insetInline:A,insetInlineStart:A,insetInlineEnd:A,padding:A,paddingTop:A,paddingRight:A,paddingBottom:A,paddingLeft:A,paddingBlock:A,paddingBlockStart:A,paddingBlockEnd:A,paddingInline:A,paddingInlineStart:A,paddingInlineEnd:A,margin:A,marginTop:A,marginRight:A,marginBottom:A,marginLeft:A,marginBlock:A,marginBlockStart:A,marginBlockEnd:A,marginInline:A,marginInlineStart:A,marginInlineEnd:A,fontSize:A,backgroundPositionX:A,backgroundPositionY:A,...Lm,zIndex:Il,fillOpacity:Tr,strokeOpacity:Tr,numOctaves:Il},jm={...un,color:ae,backgroundColor:ae,outlineColor:ae,fill:ae,stroke:ae,borderColor:ae,borderTopColor:ae,borderRightColor:ae,borderBottomColor:ae,borderLeftColor:ae,filter:ao,WebkitFilter:ao,mask:so,WebkitMask:so},Vl=e=>jm[e],Nm=new Set([ao,so]);function Ll(e,t){let r=Vl(e);return Nm.has(r)||(r=Fe),r.getAnimatableNone?r.getAnimatableNone(t):void 0}var Fm=new Set(["auto","none","0"]);function Bm(e,t,r){let n=0,i;for(;n<e.length&&!i;){let o=e[n];typeof o=="string"&&!Fm.has(o)&&er(o).values.length&&(i=e[n]),n++}if(i&&r)for(let o of t)e[o]=Ll(r,i)}var zm=class extends Xi{constructor(e,t,r,n,i){super(e,t,r,n,i,!0)}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:r}=this;if(!t||!t.current)return;super.readKeyframes();for(let u=0;u<e.length;u++){let c=e[u];if(typeof c=="string"&&(c=c.trim(),Ai(c))){let d=_l(c,t.current);d!==void 0&&(e[u]=d),u===e.length-1&&(this.finalKeyframe=c)}}if(this.resolveNoneKeyframes(),!Rl.has(r)||e.length!==2)return;let[n,i]=e,o=Ol(n),a=Ol(i),s=Hs(n),l=Hs(i);if(s!==l&&yt[r]){this.needsMeasurement=!0;return}if(o!==a)if(ll(o)&&ll(a))for(let u=0;u<e.length;u++){let c=e[u];typeof c=="string"&&(e[u]=parseFloat(c))}else yt[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,r=[];for(let n=0;n<e.length;n++)(e[n]===null||km(e[n]))&&r.push(n);r.length&&Bm(e,r,t)}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:r}=this;if(!e||!e.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=yt[r](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;let n=t[t.length-1];n!==void 0&&e.getValue(r,n).jump(n,!1)}measureEndState(){let{element:e,name:t,unresolvedKeyframes:r}=this;if(!e||!e.current)return;let n=e.getValue(t);n&&n.jump(this.measuredOrigin,!1);let i=r.length-1,o=r[i];r[i]=yt[t](e.measureViewportBox(),window.getComputedStyle(e.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),this.removedTransforms?.length&&this.removedTransforms.forEach(([a,s])=>{e.getValue(a).set(s)}),this.resolveNoneKeyframes()}},lo=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function jl(e,t,r){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let n=document;t&&(n=t.current);let i=r?.[e]??n.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(n=>n!=null)}var co=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function dn(e){return _s(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}var{schedule:uo,cancel:_w}=zs(queueMicrotask,!1),Be={x:!1,y:!1};function Nl(){return Be.x||Be.y}function Wm(e){return e==="x"||e==="y"?Be[e]?null:(Be[e]=!0,()=>{Be[e]=!1}):Be.x||Be.y?null:(Be.x=Be.y=!0,()=>{Be.x=Be.y=!1})}function Fl(e,t){let r=jl(e),n=new AbortController,i={passive:!0,...t,signal:n.signal};return[r,i,()=>n.abort()]}function Um(e){return!(e.pointerType==="touch"||Nl())}function Hm(e,t,r={}){let[n,i,o]=Fl(e,r);return n.forEach(a=>{let s=!1,l=!1,u,c=()=>{a.removeEventListener("pointerleave",f)},d=g=>{u&&(u(g),u=void 0),c()},p=g=>{s=!1,window.removeEventListener("pointerup",p),window.removeEventListener("pointercancel",p),l&&(l=!1,d(g))},m=()=>{s=!0,window.addEventListener("pointerup",p,i),window.addEventListener("pointercancel",p,i)},f=g=>{if(g.pointerType!=="touch"){if(s){l=!0;return}d(g)}},h=g=>{if(!Um(g))return;l=!1;let y=t(a,g);typeof y=="function"&&(u=y,a.addEventListener("pointerleave",f,i))};a.addEventListener("pointerenter",h,i),a.addEventListener("pointerdown",m,i)}),o}var Bl=(e,t)=>t?e===t?!0:Bl(e,t.parentElement):!1,po=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,$m=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function qm(e){return $m.has(e.tagName)||e.isContentEditable===!0}var Km=new Set(["INPUT","SELECT","TEXTAREA"]);function Gm(e){return Km.has(e.tagName)||e.isContentEditable===!0}var pn=new WeakSet;function zl(e){return t=>{t.key==="Enter"&&e(t)}}function ho(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}var Ym=(e,t)=>{let r=e.currentTarget;if(!r)return;let n=zl(()=>{if(pn.has(r))return;ho(r,"down");let i=zl(()=>{ho(r,"up")}),o=()=>ho(r,"cancel");r.addEventListener("keyup",i,t),r.addEventListener("blur",o,t)});r.addEventListener("keydown",n,t),r.addEventListener("blur",()=>r.removeEventListener("keydown",n),t)};function Wl(e){return po(e)&&!Nl()}var Ul=new WeakSet;function Xm(e,t,r={}){let[n,i,o]=Fl(e,r),a=s=>{let l=s.currentTarget;if(!Wl(s)||Ul.has(s))return;pn.add(l),r.stopPropagation&&Ul.add(s);let u=t(l,s),c={...i,capture:!0},d=(f,h)=>{window.removeEventListener("pointerup",p,c),window.removeEventListener("pointercancel",m,c),pn.has(l)&&pn.delete(l),Wl(f)&&typeof u=="function"&&u(f,{success:h})},p=f=>{d(f,l===window||l===document||r.useGlobalTarget||Bl(l,f.target))},m=f=>{d(f,!1)};window.addEventListener("pointerup",p,c),window.addEventListener("pointercancel",m,c)};return n.forEach(s=>{(r.useGlobalTarget?window:s).addEventListener("pointerdown",a,i),dn(s)&&(s.addEventListener("focus",l=>Ym(l,i)),!qm(s)&&!s.hasAttribute("tabindex")&&(s.tabIndex=0))}),o}function fo(e){return _s(e)&&"ownerSVGElement"in e}var hn=new WeakMap,fn,Hl=(e,t,r)=>(n,i)=>i&&i[0]?i[0][e+"Size"]:fo(n)&&"getBBox"in n?n.getBBox()[t]:n[r],Zm=Hl("inline","width","offsetWidth"),Qm=Hl("block","height","offsetHeight");function Jm({target:e,borderBoxSize:t}){hn.get(e)?.forEach(r=>{r(e,{get width(){return Zm(e,t)},get height(){return Qm(e,t)}})})}function eg(e){e.forEach(Jm)}function tg(){typeof ResizeObserver>"u"||(fn=new ResizeObserver(eg))}function rg(e,t){fn||tg();let r=jl(e);return r.forEach(n=>{let i=hn.get(n);i||(i=new Set,hn.set(n,i)),i.add(t),fn?.observe(n)}),()=>{r.forEach(n=>{let i=hn.get(n);i?.delete(t),i?.size||fn?.unobserve(n)})}}var mn=new Set,ir;function ng(){ir=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};mn.forEach(t=>t(e))},window.addEventListener("resize",ir)}function ig(e){return mn.add(e),ir||ng(),()=>{mn.delete(e),!mn.size&&typeof ir=="function"&&(window.removeEventListener("resize",ir),ir=void 0)}}function $l(e,t){return typeof e=="function"?ig(e):rg(e,t)}var or={value:null,addProjectionMetrics:null};function og(e){return fo(e)&&e.tagName==="svg"}var ag=[...kl,ae,Fe],sg=e=>ag.find(Dl(e)),ql=()=>({translate:0,scale:1,origin:0,originPoint:0}),ar=()=>({x:ql(),y:ql()}),Kl=()=>({min:0,max:0}),ue=()=>({x:Kl(),y:Kl()}),lg=new WeakMap;function gn(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Dr(e){return typeof e=="string"||Array.isArray(e)}var mo=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],go=["initial",...mo];function vn(e){return gn(e.animate)||go.some(t=>Dr(e[t]))}function Gl(e){return!!(vn(e)||e.variants)}function cg(e,t,r){for(let n in t){let i=t[n],o=r[n];if(me(i))e.addValue(n,i);else if(me(o))e.addValue(n,nr(i,{owner:e}));else if(o!==i)if(e.hasValue(n)){let a=e.getValue(n);a.liveStyle===!0?a.jump(i):a.hasAnimated||a.set(i)}else{let a=e.getStaticValue(n);e.addValue(n,nr(a!==void 0?a:i,{owner:e}))}}for(let n in r)t[n]===void 0&&e.removeValue(n);return t}var yn={current:null},vo={current:!1},ug=typeof window<"u";function Yl(){if(vo.current=!0,!!ug)if(window.matchMedia){let e=window.matchMedia("(prefers-reduced-motion)"),t=()=>yn.current=e.matches;e.addEventListener("change",t),t()}else yn.current=!1}var Xl=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],xn={};function Zl(e){xn=e}function dg(){return xn}var pg=class{scrapeMotionValuesFromProps(e,t,r){return{}}constructor({parent:e,props:t,presenceContext:r,reducedMotionConfig:n,skipAnimations:i,blockInitialAnimation:o,visualState:a},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Xi,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let p=xe.now();this.renderScheduledAt<p&&(this.renderScheduledAt=p,q.render(this.render,!1,!0))};let{latestValues:l,renderState:u}=a;this.latestValues=l,this.baseTarget={...l},this.initialValues=t.initial?{...l}:{},this.renderState=u,this.parent=e,this.props=t,this.presenceContext=r,this.depth=e?e.depth+1:0,this.reducedMotionConfig=n,this.skipAnimationsConfig=i,this.options=s,this.blockInitialAnimation=!!o,this.isControllingVariants=vn(t),this.isVariantNode=Gl(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:c,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(let p in d){let m=d[p];l[p]!==void 0&&me(m)&&m.set(l[p])}}mount(e){if(this.hasBeenMounted)for(let t in this.initialValues)this.values.get(t)?.jump(this.initialValues[t]),this.latestValues[t]=this.initialValues[t];this.current=e,lg.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((t,r)=>this.bindToMotionValue(r,t)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(vo.current||Yl(),this.shouldReduceMotion=yn.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),vt(this.notifyUpdate),vt(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(let e in this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),t.accelerate&&bl.has(e)&&this.current instanceof HTMLElement){let{factory:o,keyframes:a,times:s,ease:l,duration:u}=t.accelerate,c=new vl({element:this.current,name:e,keyframes:a,times:s,ease:l,duration:Ce(u)}),d=o(c);this.valueSubscriptions.set(e,()=>{d(),c.cancel()});return}let r=rr.has(e);r&&this.onBindTransform&&this.onBindTransform();let n=t.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&q.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()}),i;typeof window<"u"&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{n(),i&&i()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in xn){let t=xn[e];if(!t)continue;let{isEnabled:r,Feature:n}=t;if(!this.features[e]&&n&&r(this.props)&&(this.features[e]=new n(this)),this.features[e]){let i=this.features[e];i.isMounted?i.update():(i.mount(),i.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):ue()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let r=0;r<Xl.length;r++){let n=Xl[r];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);let i="on"+n,o=e[i];o&&(this.propEventSubscriptions[n]=this.on(n,o))}this.prevMotionValues=cg(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){let t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){let r=this.values.get(e);t!==r&&(r&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);let t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let r=this.values.get(e);return r===void 0&&t!==void 0&&(r=nr(t===null?void 0:t,{owner:this}),this.addValue(e,r)),r}readValue(e,t){let r=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return r!=null&&(typeof r=="string"&&(Ps(r)||Ts(r))?r=parseFloat(r):!sg(r)&&Fe.test(t)&&(r=Ll(e,t)),this.setBaseTarget(e,me(r)?r.get():r)),me(r)?r.get():r}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){let{initial:t}=this.props,r;if(typeof t=="string"||typeof t=="object"){let i=to(this.props,t,this.presenceContext?.custom);i&&(r=i[e])}if(t&&r!==void 0)return r;let n=this.getBaseTargetFromProps(this.props,e);return n!==void 0&&!me(n)?n:this.initialValues[e]!==void 0&&r===void 0?void 0:this.baseTarget[e]}on(e,t){return this.events[e]||(this.events[e]=new _i),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){uo.render(this.render)}},Ql=class extends pg{constructor(){super(...arguments),this.KeyframeResolver=zm}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){let r=e.style;return r?r[t]:void 0}removeValueFromRenderState(e,{vars:t,style:r}){delete t[e],delete r[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;me(e)&&(this.childSubscription=e.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}},xt=class{constructor(e){this.isMounted=!1,this.node=e}update(){}};function Jl({top:e,left:t,right:r,bottom:n}){return{x:{min:t,max:r},y:{min:e,max:n}}}function hg({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function fg(e,t){if(!t)return e;let r=t({x:e.left,y:e.top}),n=t({x:e.right,y:e.bottom});return{top:r.y,left:r.x,bottom:n.y,right:n.x}}function yo(e){return e===void 0||e===1}function xo({scale:e,scaleX:t,scaleY:r}){return!yo(e)||!yo(t)||!yo(r)}function jt(e){return xo(e)||ec(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function ec(e){return tc(e.x)||tc(e.y)}function tc(e){return e&&e!=="0%"}function bn(e,t,r){let n=e-r,i=t*n;return r+i}function rc(e,t,r,n,i){return i!==void 0&&(e=bn(e,i,n)),bn(e,r,n)+t}function bo(e,t=0,r=1,n,i){e.min=rc(e.min,t,r,n,i),e.max=rc(e.max,t,r,n,i)}function nc(e,{x:t,y:r}){bo(e.x,t.translate,t.scale,t.originPoint),bo(e.y,r.translate,r.scale,r.originPoint)}var ic=.999999999999,oc=1.0000000000001;function mg(e,t,r,n=!1){let i=r.length;if(!i)return;t.x=t.y=1;let o,a;for(let s=0;s<i;s++){o=r[s],a=o.projectionDelta;let{visualElement:l}=o.options;l&&l.props.style&&l.props.style.display==="contents"||(n&&o.options.layoutScroll&&o.scroll&&o!==o.root&&(Ye(e.x,-o.scroll.offset.x),Ye(e.y,-o.scroll.offset.y)),a&&(t.x*=a.x.scale,t.y*=a.y.scale,nc(e,a)),n&&jt(o.latestValues)&&wn(e,o.latestValues,o.layout?.layoutBox))}t.x<oc&&t.x>ic&&(t.x=1),t.y<oc&&t.y>ic&&(t.y=1)}function Ye(e,t){e.min+=t,e.max+=t}function ac(e,t,r,n,i=.5){let o=K(e.min,e.max,i);bo(e,t,r,o,n)}function sc(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function wn(e,t,r){let n=r??e;ac(e.x,sc(t.x,n.x),t.scaleX,t.scale,t.originX),ac(e.y,sc(t.y,n.y),t.scaleY,t.scale,t.originY)}function lc(e,t){return Jl(fg(e.getBoundingClientRect(),t))}function gg(e,t,r){let n=lc(e,r),{scroll:i}=t;return i&&(Ye(n.x,i.offset.x),Ye(n.y,i.offset.y)),n}var vg={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},yg=tr.length;function xg(e,t,r){let n="",i=!0;for(let a=0;a<yg;a++){let s=tr[a],l=e[s];if(l===void 0)continue;let u=!0;if(typeof l=="number")u=l===(s.startsWith("scale")?1:0);else{let c=parseFloat(l);u=s.startsWith("scale")?c===1:c===0}if(!u||r){let c=co(l,un[s]);if(!u){i=!1;let d=vg[s]||s;n+=`${d}(${c}) `}r&&(t[s]=c)}}let o=e.pathRotation;return o&&(i=!1,n+=`rotate(${co(o,un.pathRotation)}) `),n=n.trim(),r?n=r(t,i?"":n):i&&(n="none"),n}function wo(e,t,r){let{style:n,vars:i,transformOrigin:o}=e,a=!1,s=!1;for(let l in t){let u=t[l];if(rr.has(l)){a=!0;continue}else if(Us(l)){i[l]=u;continue}else{let c=co(u,un[l]);l.startsWith("origin")?(s=!0,o[l]=c):n[l]=c}}if(t.transform||(a||r?n.transform=xg(t,e.transform,r):n.transform&&(n.transform="none")),s){let{originX:l="50%",originY:u="50%",originZ:c=0}=o;n.transformOrigin=`${l} ${u} ${c}`}}function cc(e,{style:t,vars:r},n,i){let o=e.style,a;for(a in t)o[a]=t[a];i?.applyProjectionStyles(o,n);for(a in r)o.setProperty(a,r[a])}function uc(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var kr={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(A.test(e))e=parseFloat(e);else return e;let r=uc(e,t.target.x),n=uc(e,t.target.y);return`${r}% ${n}%`}},bg={correct:(e,{treeScale:t,projectionDelta:r})=>{let n=e,i=Fe.parse(e);if(i.length>5)return n;let o=Fe.createTransformer(e),a=typeof i[0]!="number"?1:0,s=r.x.scale*t.x,l=r.y.scale*t.y;i[0+a]/=s,i[1+a]/=l;let u=K(s,l,.5);return typeof i[2+a]=="number"&&(i[2+a]/=u),typeof i[3+a]=="number"&&(i[3+a]/=u),o(i)}},So={borderRadius:{...kr,applyTo:[...lo]},borderTopLeftRadius:kr,borderTopRightRadius:kr,borderBottomLeftRadius:kr,borderBottomRightRadius:kr,boxShadow:bg};function dc(e,{layout:t,layoutId:r}){return rr.has(e)||e.startsWith("origin")||(t||r!==void 0)&&(!!So[e]||e==="opacity")}function Co(e,t,r){let n=e.style,i=t?.style,o={};if(!n)return o;for(let a in n)(me(n[a])||i&&me(i[a])||dc(a,e)||r?.getValue(a)?.liveStyle!==void 0)&&(o[a]=n[a]);return o}function wg(e){return window.getComputedStyle(e)}var Sg=class extends Ql{constructor(){super(...arguments),this.type="html",this.renderInstance=cc}mount(e){kt(!!e.style,"motion.create() components must forward their ref to a HTML or SVG element","custom-component-ref"),super.mount(e)}readValueFromInstance(e,t){if(rr.has(t))return this.projection?.isProjecting?$i(t):Wf(e,t);{let r=wg(e),n=(Us(t)?r.getPropertyValue(t):r[t])||0;return typeof n=="string"?n.trim():n}}measureInstanceViewportBox(e,{transformPagePoint:t}){return lc(e,t)}build(e,t,r){wo(e,t,r.transformTemplate)}scrapeMotionValuesFromProps(e,t,r){return Co(e,t,r)}},Cg={offset:"stroke-dashoffset",array:"stroke-dasharray"},Pg={offset:"strokeDashoffset",array:"strokeDasharray"};function _g(e,t,r=1,n=0,i=!0){e.pathLength=1;let o=i?Cg:Pg;e[o.offset]=`${-n}`,e[o.array]=`${t} ${r}`}var Tg=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function pc(e,{attrX:t,attrY:r,attrScale:n,pathLength:i,pathSpacing:o=1,pathOffset:a=0,...s},l,u,c){if(wo(e,s,u),l){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:d,style:p}=e;d.transform&&(p.transform=d.transform,delete d.transform),(p.transform||d.transformOrigin)&&(p.transformOrigin=d.transformOrigin??"50% 50%",delete d.transformOrigin),p.transform&&(p.transformBox=c?.transformBox??"fill-box",delete d.transformBox);for(let m of Tg)d[m]!==void 0&&(p[m]=d[m],delete d[m]);t!==void 0&&(d.x=t),r!==void 0&&(d.y=r),n!==void 0&&(d.scale=n),i!==void 0&&_g(d,i,o,a,!1)}var hc=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),fc=e=>typeof e=="string"&&e.toLowerCase()==="svg";function Rg(e,t,r,n){cc(e,t,void 0,n);for(let i in t.attrs)e.setAttribute(hc.has(i)?i:io(i),t.attrs[i])}function mc(e,t,r){let n=Co(e,t,r);for(let i in e)if(me(e[i])||me(t[i])){let o=tr.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;n[o]=e[i]}return n}var Eg=class extends Ql{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ue}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(rr.has(t)){let r=Vl(t);return r&&r.default||0}return t=hc.has(t)?t:io(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,r){return mc(e,t,r)}build(e,t,r){pc(e,t,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(e,t,r,n){Rg(e,t,r,n)}mount(e){this.isSVGTag=fc(e.tagName),super.mount(e)}},Ag=go.length;function gc(e){if(!e)return;if(!e.isControllingVariants){let r=e.parent?gc(e.parent)||{}:{};return e.props.initial!==void 0&&(r.initial=e.props.initial),r}let t={};for(let r=0;r<Ag;r++){let n=go[r],i=e.props[n];(Dr(i)||i===!1)&&(t[n]=i)}return t}function vc(e,t){if(!Array.isArray(t))return!1;let r=t.length;if(r!==e.length)return!1;for(let n=0;n<r;n++)if(t[n]!==e[n])return!1;return!0}var Mg=[...mo].reverse(),Dg=mo.length;function kg(e){return t=>Promise.all(t.map(({animation:r,options:n})=>Mm(e,r,n)))}function Og(e){let t=kg(e),r=yc(),n=!0,i=!1,o=u=>(c,d)=>{let p=Lt(e,d,u==="exit"?e.presenceContext?.custom:void 0);if(p){let{transition:m,transitionEnd:f,...h}=p;c={...c,...h,...f}}return c};function a(u){t=u(e)}function s(u){let{props:c}=e,d=gc(e.parent)||{},p=[],m=new Set,f={},h=1/0;for(let y=0;y<Dg;y++){let v=Mg[y],x=r[v],w=c[v]!==void 0?c[v]:d[v],b=Dr(w),S=v===u?x.isActive:null;S===!1&&(h=y);let C=w===d[v]&&w!==c[v]&&b;if(C&&(n||i)&&e.manuallyAnimateOnMount&&(C=!1),x.protectedKeys={...f},!x.isActive&&S===null||!w&&!x.prevProp||gn(w)||typeof w=="boolean")continue;if(v==="exit"&&x.isActive&&S!==!0){x.prevResolvedValues&&(f={...f,...x.prevResolvedValues});continue}let P=Ig(x.prevProp,w),T=P||v===u&&x.isActive&&!C&&b||y>h&&b,_=!1,R=Array.isArray(w)?w:[w],k=R.reduce(o(v),{});S===!1&&(k={});let{prevResolvedValues:I={}}=x,O={...I,...k},B=V=>{T=!0,m.has(V)&&(_=!0,m.delete(V)),x.needsAnimating[V]=!0;let M=e.getValue(V);M&&(M.liveStyle=!1)};for(let V in O){let M=k[V],D=I[V];if(f.hasOwnProperty(V))continue;let j=!1;ro(M)&&ro(D)?j=!vc(M,D)||P:j=M!==D,j?M!=null?B(V):m.add(V):M!==void 0&&m.has(V)?B(V):x.protectedKeys[V]=!0}x.prevProp=w,x.prevResolvedValues=k,x.isActive&&(f={...f,...k}),(n||i)&&e.blockInitialAnimation&&(T=!1);let N=C&&P;T&&(!N||_)&&p.push(...R.map(V=>{let M={type:v};if(typeof V=="string"&&(n||i)&&!N&&e.manuallyAnimateOnMount&&e.parent){let{parent:D}=e,j=Lt(D,V);if(D.enteringChildren&&j){let{delayChildren:J}=j.transition||{};M.delay=wl(D.enteringChildren,e,J)}}return{animation:V,options:M}}))}if(m.size){let y={};if(typeof c.initial!="boolean"){let v=Lt(e,Array.isArray(c.initial)?c.initial[0]:c.initial);v&&v.transition&&(y.transition=v.transition)}m.forEach(v=>{let x=e.getBaseTarget(v),w=e.getValue(v);w&&(w.liveStyle=!0),y[v]=x??null}),p.push({animation:y})}let g=!!p.length;return n&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(g=!1),n=!1,i=!1,g?t(p):Promise.resolve()}function l(u,c){if(r[u].isActive===c)return Promise.resolve();e.variantChildren?.forEach(p=>p.animationState?.setActive(u,c)),r[u].isActive=c;let d=s(u);for(let p in r)r[p].protectedKeys={};return d}return{animateChanges:s,setActive:l,setAnimateFunction:a,getState:()=>r,reset:()=>{r=yc(),i=!0}}}function Ig(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!vc(t,e):!1}function Nt(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function yc(){return{animate:Nt(!0),whileInView:Nt(),whileHover:Nt(),whileTap:Nt(),whileDrag:Nt(),whileFocus:Nt(),exit:Nt()}}function Po(e,t){e.min=t.min,e.max=t.max}function ze(e,t){Po(e.x,t.x),Po(e.y,t.y)}function xc(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}var bc=1e-4,Vg=1-bc,Lg=1+bc,wc=.01,jg=0-wc,Ng=0+wc;function be(e){return e.max-e.min}function Fg(e,t,r){return Math.abs(e-t)<=r}function Sc(e,t,r,n=.5){e.origin=n,e.originPoint=K(t.min,t.max,e.origin),e.scale=be(r)/be(t),e.translate=K(r.min,r.max,e.origin)-e.originPoint,(e.scale>=Vg&&e.scale<=Lg||isNaN(e.scale))&&(e.scale=1),(e.translate>=jg&&e.translate<=Ng||isNaN(e.translate))&&(e.translate=0)}function Or(e,t,r,n){Sc(e.x,t.x,r.x,n?n.originX:void 0),Sc(e.y,t.y,r.y,n?n.originY:void 0)}function Cc(e,t,r,n=0){let i=n?K(r.min,r.max,n):r.min;e.min=i+t.min,e.max=e.min+be(t)}function Bg(e,t,r,n){Cc(e.x,t.x,r.x,n?.x),Cc(e.y,t.y,r.y,n?.y)}function Pc(e,t,r,n=0){let i=n?K(r.min,r.max,n):r.min;e.min=t.min-i,e.max=e.min+be(t)}function Sn(e,t,r,n){Pc(e.x,t.x,r.x,n?.x),Pc(e.y,t.y,r.y,n?.y)}function _c(e,t,r,n,i){return e-=t,e=bn(e,1/r,n),i!==void 0&&(e=bn(e,1/i,n)),e}function zg(e,t=0,r=1,n=.5,i,o=e,a=e){if(Ge.test(t)&&(t=parseFloat(t),t=K(a.min,a.max,t/100)-a.min),typeof t!="number")return;let s=K(o.min,o.max,n);e===o&&(s-=t),e.min=_c(e.min,t,r,s,i),e.max=_c(e.max,t,r,s,i)}function Tc(e,t,[r,n,i],o,a){zg(e,t[r],t[n],t[i],t.scale,o,a)}var Wg=["x","scaleX","originX"],Ug=["y","scaleY","originY"];function Rc(e,t,r,n){Tc(e.x,t,Wg,r?r.x:void 0,n?n.x:void 0),Tc(e.y,t,Ug,r?r.y:void 0,n?n.y:void 0)}function Ec(e){return e.translate===0&&e.scale===1}function Ac(e){return Ec(e.x)&&Ec(e.y)}function Mc(e,t){return e.min===t.min&&e.max===t.max}function Hg(e,t){return Mc(e.x,t.x)&&Mc(e.y,t.y)}function Dc(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function kc(e,t){return Dc(e.x,t.x)&&Dc(e.y,t.y)}function Oc(e){return be(e.x)/be(e.y)}function Ic(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function Xe(e){return[e("x"),e("y")]}function $g(e,t,r){let n="",i=e.x.translate/t.x,o=e.y.translate/t.y,a=r?.z||0;if((i||o||a)&&(n=`translate3d(${i}px, ${o}px, ${a}px) `),(t.x!==1||t.y!==1)&&(n+=`scale(${1/t.x}, ${1/t.y}) `),r){let{transformPerspective:u,rotate:c,pathRotation:d,rotateX:p,rotateY:m,skewX:f,skewY:h}=r;u&&(n=`perspective(${u}px) ${n}`),c&&(n+=`rotate(${c}deg) `),d&&(n+=`rotate(${d}deg) `),p&&(n+=`rotateX(${p}deg) `),m&&(n+=`rotateY(${m}deg) `),f&&(n+=`skewX(${f}deg) `),h&&(n+=`skewY(${h}deg) `)}let s=e.x.scale*t.x,l=e.y.scale*t.y;return(s!==1||l!==1)&&(n+=`scale(${s}, ${l})`),n||"none"}var qg=lo.length,Vc=e=>typeof e=="string"?parseFloat(e):e,Lc=e=>typeof e=="number"||A.test(e);function Kg(e,t,r,n,i,o){i?(e.opacity=K(0,r.opacity??1,Gg(n)),e.opacityExit=K(t.opacity??1,0,Yg(n))):o&&(e.opacity=K(t.opacity??1,r.opacity??1,n));for(let a=0;a<qg;a++){let s=lo[a],l=jc(t,s),u=jc(r,s);l===void 0&&u===void 0||(l||(l=0),u||(u=0),l===0||u===0||Lc(l)===Lc(u)?(e[s]=Math.max(K(Vc(l),Vc(u),n),0),(Ge.test(u)||Ge.test(l))&&(e[s]+="%")):e[s]=u)}(t.rotate||r.rotate)&&(e.rotate=K(t.rotate||0,r.rotate||0,n))}function jc(e,t){return e[t]!==void 0?e[t]:e.borderRadius}var Gg=Nc(0,.5,Vs),Yg=Nc(.5,.95,Ie);function Nc(e,t,r){return n=>n<e?0:n>t?1:r(Pr(e,t,n))}function Xg(e,t,r){let n=me(e)?e:nr(e);return n.start(eo("",n,t,r)),n.animation}function Ir(e,t,r,n={passive:!0}){return e.addEventListener(t,r,n),()=>e.removeEventListener(t,r,n)}var Zg=(e,t)=>e.depth-t.depth,Qg=class{constructor(){this.children=[],this.isDirty=!1}add(e){Pi(this.children,e),this.isDirty=!0}remove(e){en(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Zg),this.isDirty=!1,this.children.forEach(e)}};function Jg(e,t){let r=xe.now(),n=({timestamp:i})=>{let o=i-r;o>=t&&(vt(n),e(o-t))};return q.setup(n,!0),()=>vt(n)}function Cn(e){return me(e)?e.get():e}var ev=class{constructor(){this.members=[]}add(e){Pi(this.members,e);for(let t=this.members.length-1;t>=0;t--){let r=this.members[t];if(r===e||r===this.lead||r===this.prevLead)continue;let n=r.instance;(!n||n.isConnected===!1)&&!r.snapshot&&(en(this.members,r),r.unmount())}e.scheduleRender()}remove(e){if(en(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(e){for(let t=this.members.indexOf(e)-1;t>=0;t--){let r=this.members[t];if(r.isPresent!==!1&&r.instance?.isConnected!==!1)return this.promote(r),!0}return!1}promote(e,t){let r=this.lead;if(e!==r&&(this.prevLead=r,this.lead=e,e.show(),r)){r.updateSnapshot(),e.scheduleRender();let{layoutDependency:n}=r.options,{layoutDependency:i}=e.options;(n===void 0||n!==i)&&(e.resumeFrom=r,t&&(r.preserveOpacity=!0),r.snapshot&&(e.snapshot=r.snapshot,e.snapshot.latestValues=r.animationValues||r.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}},Pn={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Ft={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},_o=["","X","Y","Z"],tv=1e3,rv=0;function To(e,t,r,n){let{latestValues:i}=t;i[e]&&(r[e]=i[e],t.setStaticValue(e,0),n&&(n[e]=0))}function Fc(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let r=Al(t);if(window.MotionHasOptimisedAnimation(r,"transform")){let{layout:i,layoutId:o}=e.options;window.MotionCancelOptimisedAnimation(r,"transform",q,!(i||o))}let{parent:n}=e;n&&!n.hasCheckedOptimisedAppear&&Fc(n)}function Bc({attachResizeListener:e,defaultParent:t,measureScroll:r,checkIsScrollRoot:n,resetTransform:i}){return class{constructor(o={},a=t?.()){this.id=rv++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,or.value&&(Ft.nodes=Ft.calculatedTargetDeltas=Ft.calculatedProjections=0),this.nodes.forEach(ov),this.nodes.forEach(dv),this.nodes.forEach(pv),this.nodes.forEach(av),or.addProjectionMetrics&&or.addProjectionMetrics(Ft)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let s=0;s<this.path.length;s++)this.path[s].shouldResetTransform=!0;this.root===this&&(this.nodes=new Qg)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new _i),this.eventHandlers.get(o).add(a)}notifyListeners(o,...a){let s=this.eventHandlers.get(o);s&&s.notify(...a)}hasListeners(o){return this.eventHandlers.has(o)}mount(o){if(this.instance)return;this.isSVG=fo(o)&&!og(o),this.instance=o;let{layoutId:a,layout:s,visualElement:l}=this.options;if(l&&!l.current&&l.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(s||a)&&(this.isLayoutDirty=!0),e){let u,c=0,d=()=>this.root.updateBlockedByResize=!1;q.read(()=>{c=window.innerWidth}),e(o,()=>{let p=window.innerWidth;p!==c&&(c=p,this.root.updateBlockedByResize=!0,u&&u(),u=Jg(d,250),Pn.hasAnimatedSinceResize&&(Pn.hasAnimatedSinceResize=!1,this.nodes.forEach(Uc)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&l&&(a||s)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:c,hasRelativeLayoutChanged:d,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let m=this.options.transition||l.getDefaultTransition()||vv,{onLayoutAnimationStart:f,onLayoutAnimationComplete:h}=l.getProps(),g=!this.targetLayout||!kc(this.targetLayout,p),y=!c&&d;if(this.options.layoutRoot||this.resumeFrom||y||c&&(g||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let v={...Ji(m,"layout"),onPlay:f,onComplete:h};(l.shouldReduceMotion||this.options.layoutRoot)&&(v.delay=0,v.type=!1),this.startAnimation(v),this.setAnimationOrigin(u,y,v.path)}else c||Uc(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),vt(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(hv),this.animationId++)}getTransformTemplate(){let{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Fc(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){let c=this.path[u];c.shouldResetTransform=!0,(typeof c.latestValues.x=="string"||typeof c.latestValues.y=="string")&&(c.isLayoutDirty=!0),c.updateScroll("snapshot"),c.options.layoutRoot&&c.willUpdate(!1)}let{layoutId:a,layout:s}=this.options;if(a===void 0&&!s)return;let l=this.getTransformTemplate();this.prevTransformTemplateValue=l?l(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){let a=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),a&&this.nodes.forEach(lv),this.nodes.forEach(zc);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Wc);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(cv),this.nodes.forEach(uv),this.nodes.forEach(nv),this.nodes.forEach(iv)):this.nodes.forEach(Wc),this.clearAllSnapshots();let o=xe.now();fe.delta=Ke(0,1e3/60,o-fe.timestamp),fe.timestamp=o,fe.isProcessing=!0,Ei.update.process(fe),Ei.preRender.process(fe),Ei.render.process(fe),fe.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,uo.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(sv),this.sharedNodes.forEach(fv)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,q.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){q.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!be(this.snapshot.measuredBox.x)&&!be(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let s=0;s<this.path.length;s++)this.path[s].updateScroll();let o=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=ue()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);let{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(a=!1),a&&this.instance){let s=n(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:s,offset:r(this.instance),wasRoot:this.scroll?this.scroll.isRoot:s}}}resetTransform(){if(!i)return;let o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!Ac(this.projectionDelta),s=this.getTransformTemplate(),l=s?s(this.latestValues,""):void 0,u=l!==this.prevTransformTemplateValue;o&&this.instance&&(a||jt(this.latestValues)||u)&&(i(this.instance,l),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){let a=this.measurePageBox(),s=this.removeElementScroll(a);return o&&(s=this.removeTransform(s)),yv(s),{animationId:this.root.animationId,measuredBox:a,layoutBox:s,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:o}=this.options;if(!o)return ue();let a=o.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(xv))){let{scroll:s}=this.root;s&&(Ye(a.x,s.offset.x),Ye(a.y,s.offset.y))}return a}removeElementScroll(o){let a=ue();if(ze(a,o),this.scroll?.wasRoot)return a;for(let s=0;s<this.path.length;s++){let l=this.path[s],{scroll:u,options:c}=l;l!==this.root&&u&&c.layoutScroll&&(u.wasRoot&&ze(a,o),Ye(a.x,u.offset.x),Ye(a.y,u.offset.y))}return a}applyTransform(o,a=!1,s){let l=s||ue();ze(l,o);for(let u=0;u<this.path.length;u++){let c=this.path[u];!a&&c.options.layoutScroll&&c.scroll&&c!==c.root&&(Ye(l.x,-c.scroll.offset.x),Ye(l.y,-c.scroll.offset.y)),jt(c.latestValues)&&wn(l,c.latestValues,c.layout?.layoutBox)}return jt(this.latestValues)&&wn(l,this.latestValues,this.layout?.layoutBox),l}removeTransform(o){let a=ue();ze(a,o);for(let s=0;s<this.path.length;s++){let l=this.path[s];if(!jt(l.latestValues))continue;let u;l.instance&&(xo(l.latestValues)&&l.updateSnapshot(),u=ue(),ze(u,l.measurePageBox())),Rc(a,l.latestValues,l.snapshot?.layoutBox,u)}return jt(this.latestValues)&&Rc(a,this.latestValues),a}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==fe.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){let a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);let s=!!this.resumingFrom||this!==a;if(!(o||s&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:l,layoutId:u}=this.options;if(!this.layout||!(l||u))return;this.resolvedRelativeTargetAt=fe.timestamp;let c=this.getClosestProjectingParent();c&&this.linkedParentVersion!==c.layoutVersion&&!c.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&c&&c.layout?this.createRelativeTarget(c,this.layout.layoutBox,c.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=ue(),this.targetWithTransforms=ue()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Bg(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):ze(this.target,this.layout.layoutBox),nc(this.target,this.targetDelta)):ze(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&c&&!!c.resumingFrom==!!this.resumingFrom&&!c.options.layoutScroll&&c.target&&this.animationProgress!==1?this.createRelativeTarget(c,this.target,c.target):this.relativeParent=this.relativeTarget=void 0),or.value&&Ft.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||xo(this.parent.latestValues)||ec(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(o,a,s){this.relativeParent=o,this.linkedParentVersion=o.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=ue(),this.relativeTargetOrigin=ue(),Sn(this.relativeTargetOrigin,a,s,this.options.layoutAnchor||void 0),ze(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let o=this.getLead(),a=!!this.resumingFrom||this!==o,s=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(s=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(s=!1),this.resolvedRelativeTargetAt===fe.timestamp&&(s=!1),s)return;let{layout:l,layoutId:u}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(l||u))return;ze(this.layoutCorrected,this.layout.layoutBox);let c=this.treeScale.x,d=this.treeScale.y;mg(this.layoutCorrected,this.treeScale,this.path,a),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=ue());let{target:p}=o;if(!p){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(xc(this.prevProjectionDelta.x,this.projectionDelta.x),xc(this.prevProjectionDelta.y,this.projectionDelta.y)),Or(this.projectionDelta,this.layoutCorrected,p,this.latestValues),(this.treeScale.x!==c||this.treeScale.y!==d||!Ic(this.projectionDelta.x,this.prevProjectionDelta.x)||!Ic(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",p)),or.value&&Ft.calculatedProjections++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){if(this.options.visualElement?.scheduleRender(),o){let a=this.getStack();a&&a.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=ar(),this.projectionDelta=ar(),this.projectionDeltaWithTransform=ar()}setAnimationOrigin(o,a=!1,s){let l=this.snapshot,u=l?l.latestValues:{},c={...this.latestValues},d=ar();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;let p=ue(),m=l?l.source:void 0,f=this.layout?this.layout.source:void 0,h=m!==f,g=this.getStack(),y=!g||g.members.length<=1,v=!!(h&&!y&&this.options.crossfade===!0&&!this.path.some(gv));this.animationProgress=0;let x,w=s?.interpolateProjection(o);this.mixTargetDelta=b=>{let S=b/1e3,C=w?.(S);C?(d.x.translate=C.x,d.x.scale=K(o.x.scale,1,S),d.x.origin=o.x.origin,d.x.originPoint=o.x.originPoint,d.y.translate=C.y,d.y.scale=K(o.y.scale,1,S),d.y.origin=o.y.origin,d.y.originPoint=o.y.originPoint):(Hc(d.x,o.x,S),Hc(d.y,o.y,S)),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Sn(p,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),mv(this.relativeTarget,this.relativeTargetOrigin,p,S),x&&Hg(this.relativeTarget,x)&&(this.isProjectionDirty=!1),x||(x=ue()),ze(x,this.relativeTarget)),h&&(this.animationValues=c,Kg(c,u,this.latestValues,S,v,y)),C&&C.rotate!==void 0&&(this.animationValues||(this.animationValues=c),this.animationValues.pathRotation=C.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=S},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(vt(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=q.update(()=>{Pn.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=nr(0)),this.motionValue.jump(0,!1),this.currentAnimation=Xg(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(tv),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let o=this.getLead(),{targetWithTransforms:a,target:s,layout:l,latestValues:u}=o;if(!(!a||!s||!l)){if(this!==o&&this.layout&&l&&Yc(this.options.animationType,this.layout.layoutBox,l.layoutBox)){s=this.target||ue();let c=be(this.layout.layoutBox.x);s.x.min=o.target.x.min,s.x.max=s.x.min+c;let d=be(this.layout.layoutBox.y);s.y.min=o.target.y.min,s.y.max=s.y.min+d}ze(a,s),wn(a,u),Or(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new ev),this.sharedNodes.get(o).add(a);let s=a.options.initialPromotionConfig;a.promote({transition:s?s.transition:void 0,preserveFollowOpacity:s&&s.shouldPreserveFollowOpacity?s.shouldPreserveFollowOpacity(a):void 0})}isLead(){let o=this.getStack();return o?o.lead===this:!0}getLead(){let{layoutId:o}=this.options;return o?this.getStack()?.lead||this:this}getPrevLead(){let{layoutId:o}=this.options;return o?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:s}={}){let l=this.getStack();l&&l.promote(this,s),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){let o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){let{visualElement:o}=this.options;if(!o)return;let a=!1,{latestValues:s}=o;if((s.z||s.rotate||s.rotateX||s.rotateY||s.rotateZ||s.skewX||s.skewY)&&(a=!0),!a)return;let l={};s.z&&To("z",o,l,this.animationValues);for(let u=0;u<_o.length;u++)To(`rotate${_o[u]}`,o,l,this.animationValues),To(`skew${_o[u]}`,o,l,this.animationValues);o.render();for(let u in l)o.setStaticValue(u,l[u]),this.animationValues&&(this.animationValues[u]=l[u]);o.scheduleRender()}applyProjectionStyles(o,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){o.visibility="hidden";return}let s=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,o.visibility="",o.opacity="",o.pointerEvents=Cn(a?.pointerEvents)||"",o.transform=s?s(this.latestValues,""):"none";return}let l=this.getLead();if(!this.projectionDelta||!this.layout||!l.target){this.options.layoutId&&(o.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,o.pointerEvents=Cn(a?.pointerEvents)||""),this.hasProjected&&!jt(this.latestValues)&&(o.transform=s?s({},""):"none",this.hasProjected=!1);return}o.visibility="";let u=l.animationValues||l.latestValues;this.applyTransformsToTarget();let c=$g(this.projectionDeltaWithTransform,this.treeScale,u);s&&(c=s(u,c)),o.transform=c;let{x:d,y:p}=this.projectionDelta;o.transformOrigin=`${d.origin*100}% ${p.origin*100}% 0`,l.animationValues?o.opacity=l===this?u.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:u.opacityExit:o.opacity=l===this?u.opacity!==void 0?u.opacity:"":u.opacityExit!==void 0?u.opacityExit:0;for(let m in So){if(u[m]===void 0)continue;let{correct:f,applyTo:h,isCSSVariable:g}=So[m],y=c==="none"?u[m]:f(u[m],l);if(h){let v=h.length;for(let x=0;x<v;x++)o[h[x]]=y}else g?this.options.visualElement.renderState.vars[m]=y:o[m]=y}this.options.layoutId&&(o.pointerEvents=l===this?Cn(a?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>o.currentAnimation?.stop()),this.root.nodes.forEach(zc),this.root.sharedNodes.clear()}}}function nv(e){e.updateLayout()}function iv(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){let{layoutBox:r,measuredBox:n}=e.layout,{animationType:i}=e.options,o=t.source!==e.layout.source;if(i==="size")Xe(c=>{let d=o?t.measuredBox[c]:t.layoutBox[c],p=be(d);d.min=r[c].min,d.max=d.min+p});else if(i==="x"||i==="y"){let c=i==="x"?"y":"x";Po(o?t.measuredBox[c]:t.layoutBox[c],r[c])}else Yc(i,t.layoutBox,r)&&Xe(c=>{let d=o?t.measuredBox[c]:t.layoutBox[c],p=be(r[c]);d.max=d.min+p,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[c].max=e.relativeTarget[c].min+p)});let a=ar();Or(a,r,t.layoutBox);let s=ar();o?Or(s,e.applyTransform(n,!0),t.measuredBox):Or(s,r,t.layoutBox);let l=!Ac(a),u=!1;if(!e.resumeFrom){let c=e.getClosestProjectingParent();if(c&&!c.resumeFrom){let{snapshot:d,layout:p}=c;if(d&&p){let m=e.options.layoutAnchor||void 0,f=ue();Sn(f,t.layoutBox,d.layoutBox,m);let h=ue();Sn(h,r,p.layoutBox,m),kc(f,h)||(u=!0),c.options.layoutRoot&&(e.relativeTarget=h,e.relativeTargetOrigin=f,e.relativeParent=c)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:s,layoutDelta:a,hasLayoutChanged:l,hasRelativeLayoutChanged:u})}else if(e.isLead()){let{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function ov(e){or.value&&Ft.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function av(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function sv(e){e.clearSnapshot()}function zc(e){e.clearMeasurements()}function lv(e){e.isLayoutDirty=!0,e.updateLayout()}function Wc(e){e.isLayoutDirty=!1}function cv(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function uv(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Uc(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function dv(e){e.resolveTargetDelta()}function pv(e){e.calcProjection()}function hv(e){e.resetSkewAndRotation()}function fv(e){e.removeLeadSnapshot()}function Hc(e,t,r){e.translate=K(t.translate,0,r),e.scale=K(t.scale,1,r),e.origin=t.origin,e.originPoint=t.originPoint}function $c(e,t,r,n){e.min=K(t.min,r.min,n),e.max=K(t.max,r.max,n)}function mv(e,t,r,n){$c(e.x,t.x,r.x,n),$c(e.y,t.y,r.y,n)}function gv(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var vv={duration:.45,ease:[.4,0,.1,1]},qc=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Kc=qc("applewebkit/")&&!qc("chrome/")?Math.round:Ie;function Gc(e){e.min=Kc(e.min),e.max=Kc(e.max)}function yv(e){Gc(e.x),Gc(e.y)}function Yc(e,t,r){return e==="position"||e==="preserve-aspect"&&!Fg(Oc(t),Oc(r),.2)}function xv(e){return e!==e.root&&e.scroll?.wasRoot}var bv=Bc({attachResizeListener:(e,t)=>Ir(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Ro={current:void 0},Xc=Bc({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Ro.current){let e=new bv({});e.mount(window),e.setOptions({layoutScroll:!0}),Ro.current=e}return Ro.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),Zc=z(require("react"),1),Vr=require("react"),wv=require("react"),Eo=(0,wv.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),Sv=z(require("react"),1);function Qc(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Cv(...e){return t=>{let r=!1,n=e.map(i=>{let o=Qc(i,t);return!r&&typeof o=="function"&&(r=!0),o});if(r)return()=>{for(let i=0;i<n.length;i++){let o=n[i];typeof o=="function"?o():Qc(e[i],null)}}}}function Pv(...e){return Sv.useCallback(Cv(...e),e)}var _v=class extends Zc.Component{getSnapshotBeforeUpdate(e){let t=this.props.childRef.current;if(dn(t)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){let r=t.offsetParent,n=dn(r)&&r.offsetWidth||0,i=dn(r)&&r.offsetHeight||0,o=getComputedStyle(t),a=this.props.sizeRef.current;a.height=parseFloat(o.height),a.width=parseFloat(o.width),a.top=t.offsetTop,a.left=t.offsetLeft,a.right=n-a.width-a.left,a.bottom=i-a.height-a.top,a.direction=o.direction}return null}componentDidUpdate(){}render(){return this.props.children}};function Tv({children:e,isPresent:t,anchorX:r,anchorY:n,root:i,pop:o}){let a=(0,Vr.useId)(),s=(0,Vr.useRef)(null),l=(0,Vr.useRef)({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:"ltr"}),{nonce:u}=(0,Vr.useContext)(Eo),c=o!==!1?e.props?.ref??e?.ref:void 0,d=Pv(s,c);return(0,Vr.useInsertionEffect)(()=>{let{width:p,height:m,top:f,left:h,right:g,bottom:y,direction:v}=l.current;if(t||o===!1||!s.current||!p||!m)return;let x=v==="rtl",w=r==="left"?x?`right: ${g}`:`left: ${h}`:x?`left: ${h}`:`right: ${g}`,b=n==="bottom"?`bottom: ${y}`:`top: ${f}`;s.current.dataset.motionPopId=a;let S=document.createElement("style");u&&(S.nonce=u);let C=i??document.head;return C.appendChild(S),S.sheet&&S.sheet.insertRule(`
68
+ [data-motion-pop-id="${a}"] {
69
+ position: absolute !important;
70
+ width: ${p}px !important;
71
+ height: ${m}px !important;
72
+ ${w}px !important;
73
+ ${b}px !important;
74
+ }
75
+ `),()=>{s.current?.removeAttribute("data-motion-pop-id"),C.contains(S)&&C.removeChild(S)}},[t]),(0,jh.jsx)(_v,{isPresent:t,childRef:s,sizeRef:l,pop:o,children:o===!1?e:Zc.cloneElement(e,{ref:d})})}var Rv=({children:e,initial:t,isPresent:r,onExitComplete:n,custom:i,presenceAffectsLayout:o,mode:a,anchorX:s,anchorY:l,root:u})=>{let c=Si(Ev),d=(0,Sr.useId)(),p=(0,Sr.useRef)(r),m=(0,Sr.useRef)(n);Ci(()=>{p.current=r,m.current=n});let f=!0,h=(0,Sr.useMemo)(()=>(f=!1,{id:d,initial:t,isPresent:r,custom:i,onExitComplete:g=>{c.set(g,!0);for(let y of c.values())if(!y)return;n&&n()},register:g=>(c.set(g,!1),()=>{c.delete(g),!p.current&&!c.size&&m.current?.()})}),[r,c,n]);return o&&f&&(h={...h}),(0,Sr.useMemo)(()=>{c.forEach((g,y)=>c.set(y,!1))},[r]),Vh.useEffect(()=>{!r&&!c.size&&n&&n()},[r]),e=(0,Cs.jsx)(Tv,{pop:a==="popLayout",isPresent:r,anchorX:s,anchorY:l,root:u,children:e}),(0,Cs.jsx)(Jr.Provider,{value:h,children:e})};function Ev(){return new Map}var _n=require("react");function Jc(e=!0){let t=(0,_n.useContext)(Jr);if(t===null)return[!0,null];let{isPresent:r,onExitComplete:n,register:i}=t,o=(0,_n.useId)();(0,_n.useEffect)(()=>{if(e)return i(o)},[e]);let a=(0,_n.useCallback)(()=>e&&n&&n(o),[o,n,e]);return!r&&n?[!1,a]:[!0]}var eu=require("react"),Tn=e=>e.key||"";function tu(e){let t=[];return eu.Children.forEach(e,r=>{(0,eu.isValidElement)(r)&&t.push(r)}),t}var Rn=({children:e,custom:t,initial:r=!0,onExitComplete:n,presenceAffectsLayout:i=!0,mode:o="sync",propagate:a=!1,anchorX:s="left",anchorY:l="top",root:u})=>{let[c,d]=Jc(a),p=(0,Dt.useMemo)(()=>tu(e),[e]),m=a&&!c?[]:p.map(Tn),f=(0,Dt.useRef)(!0),h=(0,Dt.useRef)(p),g=Si(()=>new Map),y=(0,Dt.useRef)(new Set),[v,x]=(0,Dt.useState)(p),[w,b]=(0,Dt.useState)(p);Ci(()=>{f.current=!1,h.current=p;for(let P=0;P<w.length;P++){let T=Tn(w[P]);m.includes(T)?(g.delete(T),y.current.delete(T)):g.get(T)!==!0&&g.set(T,!1)}},[w,m.length,m.join("-")]);let S=[];if(p!==v){let P=[...p];for(let T=0;T<w.length;T++){let _=w[T],R=Tn(_);m.includes(R)||(P.splice(T,0,_),S.push(_))}return o==="wait"&&S.length&&(P=S),b(tu(P)),x(p),null}let{forceRender:C}=(0,Dt.useContext)(wi);return(0,bi.jsx)(bi.Fragment,{children:w.map(P=>{let T=Tn(P),_=a&&!c?!1:p===w||m.includes(T),R=()=>{if(y.current.has(T))return;if(g.has(T))y.current.add(T),g.set(T,!0);else return;let k=!0;g.forEach(I=>{I||(k=!1)}),k&&(C?.(),b(h.current),a&&d?.(),n&&n())};return(0,bi.jsx)(Rv,{isPresent:_,initial:!f.current||r?void 0:!1,custom:t,presenceAffectsLayout:i,mode:o,root:u,onExitComplete:_?void 0:R,anchorX:s,anchorY:l,children:P},T)})})},Av=require("react"),ru=(0,Av.createContext)({strict:!1}),nu={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},iu=!1;function Mv(){if(iu)return;let e={};for(let t in nu)e[t]={isEnabled:r=>nu[t].some(n=>!!r[n])};Zl(e),iu=!0}function ou(){return Mv(),dg()}function Dv(e){let t=ou();for(let r in e)t[r]={...t[r],...e[r]};Zl(t)}function kv(e){var t=Object.create(null);return function(r){return t[r]===void 0&&(t[r]=e(r)),t[r]}}var Ov=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|popover|popoverTarget|popoverTargetAction|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,Iv=kv(function(e){return Ov.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),Vv=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function En(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Vv.has(e)}var au=e=>!En(e);function Lv(e){typeof e=="function"&&(au=t=>t.startsWith("on")?!En(t):e(t))}try{let e="@emotion/is-prop-valid";Lv(Iv)}catch{}function jv(e,t,r){let n={};for(let i in e)i==="values"&&typeof e.values=="object"||me(e[i])||(au(i)||r===!0&&En(i)||!t&&!En(i)||e.draggable&&i.startsWith("onDrag"))&&(n[i]=e[i]);return n}var su=require("react/jsx-runtime"),An=require("react"),Nv=require("react"),Mn=(0,Nv.createContext)({}),lu=require("react");function Fv(e,t){if(vn(e)){let{initial:r,animate:n}=e;return{initial:r===!1||Dr(r)?r:void 0,animate:Dr(n)?n:void 0}}return e.inherit!==!1?t:{}}function Bv(e){let{initial:t,animate:r}=Fv(e,(0,lu.useContext)(Mn));return(0,lu.useMemo)(()=>({initial:t,animate:r}),[cu(t),cu(r)])}function cu(e){return Array.isArray(e)?e.join(" "):e}var Ao=require("react"),zv=require("react"),Mo=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function uu(e,t,r){for(let n in t)!me(t[n])&&!dc(n,r)&&(e[n]=t[n])}function Wv({transformTemplate:e},t){return(0,zv.useMemo)(()=>{let r=Mo();return wo(r,t,e),Object.assign({},r.vars,r.style)},[t])}function Uv(e,t){let r=e.style||{},n={};return uu(n,r,e),Object.assign(n,Wv(e,t)),n}function Hv(e,t){let r={},n=Uv(e,t);return e.drag&&e.dragListener!==!1&&(r.draggable=!1,n.userSelect=n.WebkitUserSelect=n.WebkitTouchCallout="none",n.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(r.tabIndex=0),r.style=n,r}var $v=require("react"),du=()=>({...Mo(),attrs:{}});function qv(e,t,r,n){let i=(0,$v.useMemo)(()=>{let o=du();return pc(o,t,fc(n),e.transformTemplate,e.style),{...o.attrs,style:{...o.style}}},[t]);if(e.style){let o={};uu(o,e.style,e),i.style={...o,...i.style}}return i}var Kv=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Do(e){return typeof e!="string"||e.includes("-")?!1:!!(Kv.indexOf(e)>-1||/[A-Z]/u.test(e))}function Gv(e,t,r,{latestValues:n},i,o=!1,a){let s=(a??Do(e)?qv:Hv)(t,n,i,e),l=jv(t,typeof e=="string",o),u=e!==Ao.Fragment?{...l,...s,ref:r}:{},{children:c}=t,d=(0,Ao.useMemo)(()=>me(c)?c.get():c,[c]);return(0,Ao.createElement)(e,{...u,children:d})}var pu=require("react");function Yv({scrapeMotionValuesFromProps:e,createRenderState:t},r,n,i){return{latestValues:Xv(r,n,i,e),renderState:t()}}function Xv(e,t,r,n){let i={},o=n(e,{});for(let p in o)i[p]=Cn(o[p]);let{initial:a,animate:s}=e,l=vn(e),u=Gl(e);t&&u&&!l&&e.inherit!==!1&&(a===void 0&&(a=t.initial),s===void 0&&(s=t.animate));let c=r?r.initial===!1:!1;c=c||a===!1;let d=c?s:a;if(d&&typeof d!="boolean"&&!gn(d)){let p=Array.isArray(d)?d:[d];for(let m=0;m<p.length;m++){let f=to(e,p[m]);if(f){let{transitionEnd:h,transition:g,...y}=f;for(let v in y){let x=y[v];if(Array.isArray(x)){let w=c?x.length-1:0;x=x[w]}x!==null&&(i[v]=x)}for(let v in h)i[v]=h[v]}}}return i}var hu=e=>(t,r)=>{let n=(0,pu.useContext)(Mn),i=(0,pu.useContext)(Jr),o=()=>Yv(e,t,n,i);return r?o():Si(o)},Zv=hu({scrapeMotionValuesFromProps:Co,createRenderState:Mo}),Qv=hu({scrapeMotionValuesFromProps:mc,createRenderState:du}),Jv=Symbol.for("motionComponentSymbol"),Dn=require("react");function ey(e,t,r){let n=(0,Dn.useRef)(r);(0,Dn.useInsertionEffect)(()=>{n.current=r});let i=(0,Dn.useRef)(null);return(0,Dn.useCallback)(o=>{o&&e.onMount?.(o),t&&(o?t.mount(o):t.unmount());let a=n.current;if(typeof a=="function")if(o){let s=a(o);typeof s=="function"&&(i.current=s)}else i.current?(i.current(),i.current=null):a(o);else a&&(a.current=o)},[t])}var We=require("react"),ty=require("react"),fu=(0,ty.createContext)({});function sr(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function ry(e,t,r,n,i,o){let{visualElement:a}=(0,We.useContext)(Mn),s=(0,We.useContext)(ru),l=(0,We.useContext)(Jr),u=(0,We.useContext)(Eo),c=u.reducedMotion,d=u.skipAnimations,p=(0,We.useRef)(null),m=(0,We.useRef)(!1);n=n||s.renderer,!p.current&&n&&(p.current=n(e,{visualState:t,parent:a,props:r,presenceContext:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:c,skipAnimations:d,isSVG:o}),m.current&&p.current&&(p.current.manuallyAnimateOnMount=!0));let f=p.current,h=(0,We.useContext)(fu);f&&!f.projection&&i&&(f.type==="html"||f.type==="svg")&&ny(p.current,r,i,h);let g=(0,We.useRef)(!1);(0,We.useInsertionEffect)(()=>{f&&g.current&&f.update(r,l)});let y=r[El],v=(0,We.useRef)(!!y&&typeof window<"u"&&!window.MotionHandoffIsComplete?.(y)&&window.MotionHasOptimisedAnimation?.(y));return Ci(()=>{m.current=!0,f&&(g.current=!0,window.MotionIsMounted=!0,f.updateFeatures(),f.scheduleRenderMicrotask(),v.current&&f.animationState&&f.animationState.animateChanges())}),(0,We.useEffect)(()=>{f&&(!v.current&&f.animationState&&f.animationState.animateChanges(),v.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(y)}),v.current=!1),f.enteringChildren=void 0)}),f}function ny(e,t,r,n){let{layoutId:i,layout:o,drag:a,dragConstraints:s,layoutScroll:l,layoutRoot:u,layoutAnchor:c,layoutCrossfade:d}=t;e.projection=new r(e.latestValues,t["data-framer-portal-id"]?void 0:mu(e.parent)),e.projection.setOptions({layoutId:i,layout:o,alwaysMeasureLayout:!!a||s&&sr(s),visualElement:e,animationType:typeof o=="string"?o:"both",initialPromotionConfig:n,crossfade:d,layoutScroll:l,layoutRoot:u,layoutAnchor:c})}function mu(e){if(e)return e.options.allowProjection!==!1?e.projection:mu(e.parent)}function ko(e,{forwardMotionProps:t=!1,type:r}={},n,i){n&&Dv(n);let o=r?r==="svg":Do(e),a=o?Qv:Zv;function s(u,c){let d,p={...(0,An.useContext)(Eo),...u,layoutId:iy(u)},{isStatic:m}=p,f=Bv(u),h=a(u,m);if(!m&&typeof window<"u"){oy(p,n);let g=ay(p);d=g.MeasureLayout,f.visualElement=ry(e,h,p,i,g.ProjectionNode,o)}return(0,su.jsxs)(Mn.Provider,{value:f,children:[d&&f.visualElement?(0,su.jsx)(d,{visualElement:f.visualElement,...p}):null,Gv(e,u,ey(h,f.visualElement,c),h,m,t,o)]})}s.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;let l=(0,An.forwardRef)(s);return l[Jv]=e,l}function iy({layoutId:e}){let t=(0,An.useContext)(wi).id;return t&&e!==void 0?t+"-"+e:e}function oy(e,t){let r=(0,An.useContext)(ru).strict}function ay(e){let t=ou(),{drag:r,layout:n}=t;if(!r&&!n)return{};let i={...r,...n};return{MeasureLayout:r?.isEnabled(e)||n?.isEnabled(e)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}function sy(e,t){if(typeof Proxy>"u")return ko;let r=new Map,n=(o,a)=>ko(o,a,e,t),i=(o,a)=>n(o,a);return new Proxy(i,{get:(o,a)=>a==="create"?n:(r.has(a)||r.set(a,ko(a,void 0,e,t)),r.get(a))})}var ly=require("react"),cy=(e,t)=>t.isSVG??Do(e)?new Eg(t):new Sg(t,{allowProjection:e!==ly.Fragment}),uy=class extends xt{constructor(e){super(e),e.animationState||(e.animationState=Og(e))}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();gn(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}},dy=0,py=class extends xt{constructor(){super(...arguments),this.id=dy++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;let{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===r)return;if(e&&r===!1){if(this.isExitComplete){let{initial:i,custom:o}=this.node.getProps();if(typeof i=="string"||typeof i=="object"&&i!==null&&!Array.isArray(i)){let a=Lt(this.node,i,o);if(a){let{transition:s,transitionEnd:l,...u}=a;for(let c in u)this.node.getValue(c)?.jump(u[c])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}let n=this.node.animationState.setActive("exit",!e);t&&!e&&n.then(()=>{this.isExitComplete=!0,t(this.id)})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}},hy={animation:{Feature:uy},exit:{Feature:py}};function Lr(e){return{point:{x:e.pageX,y:e.pageY}}}var fy=e=>t=>po(t)&&e(t,Lr(t));function jr(e,t,r,n){return Ir(e,t,fy(r),n)}var gu=({current:e})=>e?e.ownerDocument.defaultView:null,vu=(e,t)=>Math.abs(e-t);function my(e,t){let r=vu(e.x,t.x),n=vu(e.y,t.y);return Math.sqrt(r**2+n**2)}var yu=new Set(["auto","scroll"]),xu=class{constructor(e,t,{transformPagePoint:r,contextWindow:n=window,dragSnapToOrigin:i=!1,distanceThreshold:o=3,element:a}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=m=>{this.handleScroll(m.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=kn(this.lastRawMoveEventInfo,this.transformPagePoint));let m=Oo(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,h=my(m.offset,{x:0,y:0})>=this.distanceThreshold;if(!f&&!h)return;let{point:g}=m,{timestamp:y}=fe;this.history.push({...g,timestamp:y});let{onStart:v,onMove:x}=this.handlers;f||(v&&v(this.lastMoveEvent,m),this.startEvent=this.lastMoveEvent),x&&x(this.lastMoveEvent,m)},this.handlePointerMove=(m,f)=>{this.lastMoveEvent=m,this.lastRawMoveEventInfo=f,this.lastMoveEventInfo=kn(f,this.transformPagePoint),q.update(this.updatePoint,!0)},this.handlePointerUp=(m,f)=>{this.end();let{onEnd:h,onSessionEnd:g,resumeAnimation:y}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&y&&y(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let v=Oo(m.type==="pointercancel"?this.lastMoveEventInfo:kn(f,this.transformPagePoint),this.history);this.startEvent&&h&&h(m,v),g&&g(m,v)},!po(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=r,this.distanceThreshold=o,this.contextWindow=n||window;let s=Lr(e),l=kn(s,this.transformPagePoint),{point:u}=l,{timestamp:c}=fe;this.history=[{...u,timestamp:c}];let{onSessionStart:d}=t;d&&d(e,Oo(l,this.history));let p={passive:!0,capture:!0};this.removeListeners=Cr(jr(this.contextWindow,"pointermove",this.handlePointerMove,p),jr(this.contextWindow,"pointerup",this.handlePointerUp,p),jr(this.contextWindow,"pointercancel",this.handlePointerUp,p)),a&&this.startScrollTracking(a)}startScrollTracking(e){let t=e.parentElement;for(;t;){let r=getComputedStyle(t);(yu.has(r.overflowX)||yu.has(r.overflowY))&&this.scrollPositions.set(t,{x:t.scrollLeft,y:t.scrollTop}),t=t.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(e){let t=this.scrollPositions.get(e);if(!t)return;let r=e===window,n=r?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},i={x:n.x-t.x,y:n.y-t.y};i.x===0&&i.y===0||(r?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,n),q.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),vt(this.updatePoint)}};function kn(e,t){return t?{point:t(e.point)}:e}function bu(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Oo({point:e},t){return{point:e,delta:bu(e,wu(t)),offset:bu(e,gy(t)),velocity:vy(t,.1)}}function gy(e){return e[0]}function wu(e){return e[e.length-1]}function vy(e,t){if(e.length<2)return{x:0,y:0};let r=e.length-1,n=null,i=wu(e);for(;r>=0&&(n=e[r],!(i.timestamp-n.timestamp>Ce(t)));)r--;if(!n)return{x:0,y:0};n===e[0]&&e.length>2&&i.timestamp-n.timestamp>Ce(t)*2&&(n=e[1]);let o=Ve(i.timestamp-n.timestamp);if(o===0)return{x:0,y:0};let a={x:(i.x-n.x)/o,y:(i.y-n.y)/o};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function yy(e,{min:t,max:r},n){return t!==void 0&&e<t?e=n?K(t,e,n.min):Math.max(e,t):r!==void 0&&e>r&&(e=n?K(r,e,n.max):Math.min(e,r)),e}function Su(e,t,r){return{min:t!==void 0?e.min+t:void 0,max:r!==void 0?e.max+r-(e.max-e.min):void 0}}function xy(e,{top:t,left:r,bottom:n,right:i}){return{x:Su(e.x,r,i),y:Su(e.y,t,n)}}function Cu(e,t){let r=t.min-e.min,n=t.max-e.max;return t.max-t.min<e.max-e.min&&([r,n]=[n,r]),{min:r,max:n}}function by(e,t){return{x:Cu(e.x,t.x),y:Cu(e.y,t.y)}}function wy(e,t){let r=.5,n=be(e),i=be(t);return i>n?r=Pr(t.min,t.max-n,e.min):n>i&&(r=Pr(e.min,e.max-i,t.min)),Ke(0,1,r)}function Sy(e,t){let r={};return t.min!==void 0&&(r.min=t.min-e.min),t.max!==void 0&&(r.max=t.max-e.min),r}var Io=.35;function Cy(e=Io){return e===!1?e=0:e===!0&&(e=Io),{x:Pu(e,"left","right"),y:Pu(e,"top","bottom")}}function Pu(e,t,r){return{min:_u(e,t),max:_u(e,r)}}function _u(e,t){return typeof e=="number"?e:e[t]||0}var Py=new WeakMap,_y=class{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=ue(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:t=!1,distanceThreshold:r}={}){let{presenceContext:n}=this.visualElement;if(n&&n.isPresent===!1)return;let i=c=>{t&&this.snapToCursor(Lr(c).point),this.stopAnimation()},o=(c,d)=>{let{drag:p,dragPropagation:m,onDragStart:f}=this.getProps();if(p&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Wm(p),!this.openDragLock))return;this.latestPointerEvent=c,this.latestPanInfo=d,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Xe(g=>{let y=this.getAxisMotionValue(g).get()||0;if(Ge.test(y)){let{projection:v}=this.visualElement;if(v&&v.layout){let x=v.layout.layoutBox[g];x&&(y=be(x)*(parseFloat(y)/100))}}this.originPoint[g]=y}),f&&q.update(()=>f(c,d),!1,!0),no(this.visualElement,"transform");let{animationState:h}=this.visualElement;h&&h.setActive("whileDrag",!0)},a=(c,d)=>{this.latestPointerEvent=c,this.latestPanInfo=d;let{dragPropagation:p,dragDirectionLock:m,onDirectionLock:f,onDrag:h}=this.getProps();if(!p&&!this.openDragLock)return;let{offset:g}=d;if(m&&this.currentDirection===null){this.currentDirection=Ry(g),this.currentDirection!==null&&f&&f(this.currentDirection);return}this.updateAxis("x",d.point,g),this.updateAxis("y",d.point,g),this.visualElement.render(),h&&q.update(()=>h(c,d),!1,!0)},s=(c,d)=>{this.latestPointerEvent=c,this.latestPanInfo=d,this.stop(c,d),this.latestPointerEvent=null,this.latestPanInfo=null},l=()=>{let{dragSnapToOrigin:c}=this.getProps();(c||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:u}=this.getProps();this.panSession=new xu(e,{onSessionStart:i,onStart:o,onMove:a,onSessionEnd:s,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:r,contextWindow:gu(this.visualElement),element:this.visualElement.current})}stop(e,t){let r=e||this.latestPointerEvent,n=t||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!n||!r)return;let{velocity:o}=n;this.startAnimation(o);let{onDragEnd:a}=this.getProps();a&&q.postRender(()=>a(r,n))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();let{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,t,r){let{drag:n}=this.getProps();if(!r||!On(e,n,this.currentDirection))return;let i=this.getAxisMotionValue(e),o=this.originPoint[e]+r[e];this.constraints&&this.constraints[e]&&(o=yy(o,this.constraints[e],this.elastic[e])),i.set(o)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,n=this.constraints;e&&sr(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&r?this.constraints=xy(r.layoutBox,e):this.constraints=!1,this.elastic=Cy(t),n!==this.constraints&&!sr(e)&&r&&this.constraints&&!this.hasMutatedConstraints&&Xe(i=>{this.constraints!==!1&&this.getAxisMotionValue(i)&&(this.constraints[i]=Sy(r.layoutBox[i],this.constraints[i]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!sr(e))return!1;let r=e.current;kt(r!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");let{projection:n}=this.visualElement;if(!n||!n.layout)return!1;n.root&&(n.root.scroll=void 0,n.root.updateScroll());let i=gg(r,n.root,this.visualElement.getTransformPagePoint()),o=by(n.layout.layoutBox,i);if(t){let a=t(hg(o));this.hasMutatedConstraints=!!a,a&&(o=Jl(a))}return o}startAnimation(e){let{drag:t,dragMomentum:r,dragElastic:n,dragTransition:i,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),s=this.constraints||{},l=Xe(u=>{if(!On(u,t,this.currentDirection))return;let c=s&&s[u]||{};(o===!0||o===u)&&(c={min:0,max:0});let d=n?200:1e6,p=n?40:1e7,m={type:"inertia",velocity:r?e[u]:0,bounceStiffness:d,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...i,...c};return this.startAxisValueAnimation(u,m)});return Promise.all(l).then(a)}startAxisValueAnimation(e,t){let r=this.getAxisMotionValue(e);return no(this.visualElement,e),r.start(eo(e,r,0,t,this.visualElement,!1))}stopAnimation(){Xe(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`;return this.visualElement.getProps()[t]||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor(e){Xe(t=>{let{drag:r}=this.getProps();if(!On(t,r,this.currentDirection))return;let{projection:n}=this.visualElement,i=this.getAxisMotionValue(t);if(n&&n.layout){let{min:o,max:a}=n.layout.layoutBox[t],s=i.get()||0;i.set(e[t]-K(o,a,.5)+s)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:r}=this.visualElement;if(!sr(t)||!r||!this.constraints)return;this.stopAnimation();let n={x:0,y:0};Xe(o=>{let a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){let s=a.get();n[o]=wy({min:s,max:s},this.constraints[o])}});let{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.constraints=!1,this.resolveConstraints(),Xe(o=>{if(!On(o,e,null))return;let a=this.getAxisMotionValue(o),{min:s,max:l}=this.constraints[o];a.set(K(s,l,n[o]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;Py.set(this.visualElement,this);let e=this.visualElement.current,t=jr(e,"pointerdown",l=>{let{drag:u,dragListener:c=!0}=this.getProps(),d=l.target,p=d!==e&&Gm(d);u&&c&&!p&&this.start(l)}),r,n=()=>{let{dragConstraints:l}=this.getProps();sr(l)&&l.current&&(this.constraints=this.resolveRefConstraints(),r||(r=Ty(e,l.current,()=>this.scalePositionWithinConstraints())))},{projection:i}=this.visualElement,o=i.addEventListener("measure",n);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),q.read(n);let a=Ir(window,"resize",()=>this.scalePositionWithinConstraints()),s=i.addEventListener("didUpdate",(({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(Xe(c=>{let d=this.getAxisMotionValue(c);d&&(this.originPoint[c]+=l[c].translate,d.set(d.get()+l[c].translate))}),this.visualElement.render())}));return()=>{a(),t(),o(),s&&s(),r&&r()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:r=!1,dragPropagation:n=!1,dragConstraints:i=!1,dragElastic:o=Io,dragMomentum:a=!0}=e;return{...e,drag:t,dragDirectionLock:r,dragPropagation:n,dragConstraints:i,dragElastic:o,dragMomentum:a}}};function Tu(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function Ty(e,t,r){let n=$l(e,Tu(r)),i=$l(t,Tu(r));return()=>{n(),i()}}function On(e,t,r){return(t===!0||t===e)&&(r===null||r===e)}function Ry(e,t=10){let r=null;return Math.abs(e.y)>t?r="y":Math.abs(e.x)>t&&(r="x"),r}var Ey=class extends xt{constructor(e){super(e),this.removeGroupControls=Ie,this.removeListeners=Ie,this.controls=new _y(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Ie}update(){let{dragControls:e}=this.node.getProps(),{dragControls:t}=this.node.prevProps||{};e!==t&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},Vo=e=>(t,r)=>{e&&q.update(()=>e(t,r),!1,!0)},Ay=class extends xt{constructor(){super(...arguments),this.removePointerDownListener=Ie}onPointerDown(e){this.session=new xu(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:gu(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:r,onPanEnd:n}=this.node.getProps();return{onSessionStart:Vo(e),onStart:Vo(t),onMove:Vo(r),onEnd:(i,o)=>{delete this.session,n&&q.postRender(()=>n(i,o))}}}mount(){this.removePointerDownListener=jr(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}},My=require("react/jsx-runtime"),Lo=require("react"),jo=!1,Dy=class extends Lo.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:r,layoutId:n}=this.props,{projection:i}=e;i&&(t.group&&t.group.add(i),r&&r.register&&n&&r.register(i),jo&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Pn.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:r,drag:n,isPresent:i}=this.props,{projection:o}=r;return o&&(o.isPresent=i,e.layoutDependency!==t&&o.setOptions({...o.options,layoutDependency:t}),jo=!0,n||e.layoutDependency!==t||t===void 0||e.isPresent!==i?o.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?o.promote():o.relegate()||q.postRender(()=>{let a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){let{visualElement:e,layoutAnchor:t}=this.props,{projection:r}=e;r&&(r.options.layoutAnchor=t,r.root.didUpdate(),uo.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:r}=this.props,{projection:n}=e;jo=!0,n&&(n.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(n),r&&r.deregister&&r.deregister(n))}safeToRemove(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}};function Ru(e){let[t,r]=Jc(),n=(0,Lo.useContext)(wi);return(0,My.jsx)(Dy,{...e,layoutGroup:n,switchLayoutGroup:(0,Lo.useContext)(fu),isPresent:t,safeToRemove:r})}var ky={pan:{Feature:Ay},drag:{Feature:Ey,ProjectionNode:Xc,MeasureLayout:Ru}};function Eu(e,t,r){let{props:n}=e;e.animationState&&n.whileHover&&e.animationState.setActive("whileHover",r==="Start");let i="onHover"+r,o=n[i];o&&q.postRender(()=>o(t,Lr(t)))}var Oy=class extends xt{mount(){let{current:e}=this.node;e&&(this.unmount=Hm(e,(t,r)=>(Eu(this.node,r,"Start"),n=>Eu(this.node,n,"End"))))}unmount(){}},Iy=class extends xt{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Cr(Ir(this.node.current,"focus",()=>this.onFocus()),Ir(this.node.current,"blur",()=>this.onBlur()))}unmount(){}};function Au(e,t,r){let{props:n}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&n.whileTap&&e.animationState.setActive("whileTap",r==="Start");let i="onTap"+(r==="End"?"":r),o=n[i];o&&q.postRender(()=>o(t,Lr(t)))}var Vy=class extends xt{mount(){let{current:e}=this.node;if(!e)return;let{globalTapTarget:t,propagate:r}=this.node.props;this.unmount=Xm(e,(n,i)=>(Au(this.node,i,"Start"),(o,{success:a})=>Au(this.node,o,a?"End":"Cancel")),{useGlobalTarget:t,stopPropagation:r?.tap===!1})}unmount(){}},No=new WeakMap,Fo=new WeakMap,Ly=e=>{let t=No.get(e.target);t&&t(e)},jy=e=>{e.forEach(Ly)};function Ny({root:e,...t}){let r=e||document;Fo.has(r)||Fo.set(r,{});let n=Fo.get(r),i=JSON.stringify(t);return n[i]||(n[i]=new IntersectionObserver(jy,{root:e,...t})),n[i]}function Fy(e,t,r){let n=Ny(t);return No.set(e,r),n.observe(e),()=>{No.delete(e),n.unobserve(e)}}var By={some:0,all:1},zy=class extends xt{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();let{viewport:e={}}=this.node.getProps(),{root:t,margin:r,amount:n="some",once:i}=e,o={root:t?t.current:void 0,rootMargin:r,threshold:typeof n=="number"?n:By[n]},a=s=>{let{isIntersecting:l}=s;if(this.isInView===l||(this.isInView=l,i&&!l&&this.hasEnteredView))return;l&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",l);let{onViewportEnter:u,onViewportLeave:c}=this.node.getProps(),d=l?u:c;d&&d(s)};this.stopObserver=Fy(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;let{props:e,prevProps:t}=this.node;["amount","margin","root"].some(Wy(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}};function Wy({viewport:e={}},{viewport:t={}}={}){return r=>e[r]!==t[r]}var Uy={inView:{Feature:zy},tap:{Feature:Vy},focus:{Feature:Iy},hover:{Feature:Oy}},Hy={layout:{ProjectionNode:Xc,MeasureLayout:Ru}},$y={...hy,...Uy,...ky,...Hy},qy=sy($y,cy),Ky=require("react");function Nr(){!vo.current&&Yl();let[e]=(0,Ky.useState)(yn.current);return e}var lt=qy,W={duration:{instant:.1,fast:.15,exit:.14,standard:.2,considered:.36},ease:{enter:[.16,1,.3,1],exit:[.7,0,.84,0],standard:[.22,1,.36,1],inOut:[.65,0,.35,1]},spring:{responsive:{type:"spring",stiffness:520,damping:44},gentle:{type:"spring",stiffness:340,damping:34},snappy:{type:"spring",visualDuration:.2,bounce:0},smooth:{type:"spring",visualDuration:.3,bounce:0},morph:{type:"spring",visualDuration:.3,bounce:0}},stagger:{char:.016,word:.04,line:.08,item:.035},blur:{subtle:2,soft:4,text:8}},Ze={accordion:"tapd_arc_accordion_accordion",item:"tapd_arc_accordion_item",header:"tapd_arc_accordion_header",trigger:"tapd_arc_accordion_trigger",caption:"tapd_arc_accordion_caption",annotation:"tapd_arc_accordion_annotation",icon:"tapd_arc_accordion_icon",panel:"tapd_arc_accordion_panel",panelInner:"tapd_arc_accordion_panelInner",lg:"tapd_arc_accordion_lg"},Ee=require("react/jsx-runtime"),Mu={height:"auto",opacity:1,visibility:"visible"},Du={height:0,opacity:0,transitionEnd:{visibility:"hidden"}},ku={y:0,filter:"blur(0px)",transitionEnd:{filter:"none"}},Ou={y:-6,filter:`blur(${W.blur.subtle}px)`},Gy={open:{...Mu,transition:{height:W.spring.smooth,opacity:{duration:W.duration.standard,ease:[...W.ease.enter]}}},closed:{...Du,transition:{height:W.spring.smooth,opacity:{duration:W.duration.fast,ease:[...W.ease.standard]}}}},Yy={open:{...ku,transition:{y:W.spring.smooth,filter:{duration:W.duration.standard,ease:[...W.ease.enter]}}},closed:{...Ou,transition:{duration:W.duration.fast,ease:[...W.ease.standard]}}},Xy={open:{...Mu,transition:{duration:0}},closed:{...Du,transition:{duration:0}}},Zy={open:{...ku,transition:{duration:0}},closed:{...Ou,transition:{duration:0}}};function Qy({items:e,defaultOpen:t=0,size:r="md"}){let n=t>=0&&t<e.length?String(t):"",[i,o]=(0,Ma.useState)(n),a=Nr(),s=(0,Ma.useId)();return(0,Ee.jsx)(ch,{className:[Ze.accordion,r==="lg"?Ze.lg:""].filter(Boolean).join(" "),"data-tavlo-tapd-arc-ui":"",type:"single",collapsible:!0,value:i,onValueChange:o,children:e.map((l,u)=>{let c=i===String(u),d=`${s}-title-${u}`,p=l.annotation==null?void 0:`${s}-annotation-${u}`;return(0,Ee.jsxs)(gh,{className:Ze.item,value:String(u),children:[(0,Ee.jsx)(yh,{className:Ze.header,children:(0,Ee.jsxs)(xh,{className:Ze.trigger,"aria-labelledby":d,"aria-describedby":p,children:[(0,Ee.jsxs)("span",{className:Ze.caption,children:[(0,Ee.jsx)("span",{id:d,children:l.title}),p&&(0,Ee.jsx)("span",{id:p,className:Ze.annotation,children:l.annotation})]}),(0,Ee.jsx)(lt.span,{className:Ze.icon,initial:!1,animate:{rotate:c?180:0},transition:a?{duration:0}:W.spring.snappy,children:(0,Ee.jsx)(xi,{width:17,height:17,"aria-hidden":"true"})})]})}),(0,Ee.jsx)(wh,{forceMount:!0,asChild:!0,children:(0,Ee.jsx)(lt.div,{className:Ze.panel,"aria-hidden":c?void 0:!0,initial:!1,animate:c?"open":"closed",variants:a?Xy:Gy,children:(0,Ee.jsx)(lt.div,{className:Ze.panelInner,variants:a?Zy:Yy,children:(0,Ee.jsx)("div",{...c?{}:{inert:""},children:l.content})})})})]},u)})})}var Bt=require("react"),E=z(require("react"),1),Iu=z(require("react-dom"),1),Jy=Object.defineProperty,e0=(e,t)=>Jy(e,"name",{value:t,configurable:!0});function Bo(e,[t,r]){return Math.min(r,Math.max(t,e))}e0(Bo,"clamp");var te=z(require("react"),1),zo=z(require("react"),1),t0=Object.defineProperty,r0=(e,t)=>t0(e,"name",{value:t,configurable:!0}),Vu=zo[" useInsertionEffect ".trim().toString()];function Qe(e){let t=zo.useRef(e);return typeof Vu=="function"?Vu(()=>{t.current=e}):ee(()=>{t.current=e}),zo.useMemo(()=>((...r)=>t.current?.(...r)),[])}r0(Qe,"useCallbackRef");var n0=require("react/jsx-runtime"),i0=Object.defineProperty,he=(e,t)=>i0(e,"name",{value:t,configurable:!0}),Wo="dismissableLayer.update",o0="dismissableLayer.pointerDownOutside",a0="dismissableLayer.focusOutside",Lu,ju=te.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),s0=te.forwardRef(he(function(e,t){let{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:n=!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:a,onInteractOutside:s,onDismiss:l,...u}=e,c=te.useContext(ju),[d,p]=te.useState(null),m=d?.ownerDocument??globalThis?.document,[,f]=te.useState({}),h=Y(t,p),g=Array.from(c.layers),[y]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),v=y?g.indexOf(y):-1,x=d?g.indexOf(d):-1,w=c.layersWithOutsidePointerEventsDisabled.size>0,b=x>=v,S=te.useRef(!1),C=Nu(R=>{o?.(R),s?.(R),R.defaultPrevented||l?.()},{ownerDocument:m,deferPointerDownOutside:n,isDeferredPointerDownOutsideRef:S,dismissableSurfaces:c.dismissableSurfaces,shouldHandlePointerDownOutside:te.useCallback(R=>{if(!(R instanceof Node))return!1;let k=[...c.branches].some(I=>I.contains(R));return b&&!k},[c.branches,b])}),P=Fu(R=>{if(n&&S.current)return;let k=R.target;[...c.branches].some(I=>I.contains(k))||(a?.(R),s?.(R),R.defaultPrevented||l?.())},m),T=d?x===g.length-1:!1,_=Qe(R=>{R.key==="Escape"&&(i?.(R),!R.defaultPrevented&&l&&(R.preventDefault(),l()))});return te.useEffect(()=>{if(T)return m.addEventListener("keydown",_,{capture:!0}),()=>m.removeEventListener("keydown",_,{capture:!0})},[m,T,_]),te.useEffect(()=>{if(d)return r&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(Lu=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(d)),c.layers.add(d),Uo(),()=>{r&&(c.layersWithOutsidePointerEventsDisabled.delete(d),c.layersWithOutsidePointerEventsDisabled.size===0&&(m.body.style.pointerEvents=Lu))}},[d,m,r,c]),te.useEffect(()=>()=>{d&&(c.layers.delete(d),c.layersWithOutsidePointerEventsDisabled.delete(d),Uo())},[d,c]),te.useEffect(()=>{let R=he(()=>f({}),"handleUpdate");return document.addEventListener(Wo,R),()=>document.removeEventListener(Wo,R)},[]),(0,n0.jsx)(oe.div,{...u,ref:h,style:{pointerEvents:w?b?"auto":"none":void 0,...e.style},onFocusCapture:X(e.onFocusCapture,P.onFocusCapture),onBlurCapture:X(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:X(e.onPointerDownCapture,C.onPointerDownCapture)})},"DismissableLayer"));function l0(){let e=te.useContext(ju),[t,r]=te.useState(null);return te.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),r}he(l0,"useDismissableLayerSurface");var c0=he(()=>!0,"IS_TRUE");function Nu(e,t){let{ownerDocument:r=globalThis?.document,deferPointerDownOutside:n=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:o,shouldHandlePointerDownOutside:a=c0}=t,s=Qe(e),l=te.useRef(!1),u=te.useRef(!1),c=te.useRef(new Map),d=te.useRef(()=>{});return te.useEffect(()=>{function p(){u.current=!1,i.current=!1,c.current.clear()}he(p,"resetOutsideInteraction");function m(){return Array.from(c.current.values()).some(Boolean)}he(m,"isOutsideInteractionIntercepted");function f(x){if(!u.current)return;let w=x.target;w instanceof Node&&[...o].some(b=>b.contains(w))||c.current.set(x.type,!0),x.type==="click"&&window.setTimeout(()=>{u.current&&d.current()},0)}he(f,"handleInteractionCapture");function h(x){u.current&&c.current.set(x.type,!1)}he(h,"handleInteractionBubble");let g=he(x=>{if(x.target&&!l.current){let b=function(){r.removeEventListener("click",d.current);let C=m();p(),C||Ho(o0,s,S,{discrete:!0})};var w=b;if(he(b,"handleAndDispatchPointerDownOutsideEvent"),!a(x.target)){r.removeEventListener("click",d.current),p(),l.current=!1;return}let S={originalEvent:x};u.current=!0,i.current=n&&x.button===0,c.current.clear(),!n||x.button!==0?b():(r.removeEventListener("click",d.current),d.current=b,r.addEventListener("click",d.current,{once:!0}))}else r.removeEventListener("click",d.current),p();l.current=!1},"handlePointerDown"),y=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(let x of y)r.addEventListener(x,f,!0),r.addEventListener(x,h);let v=window.setTimeout(()=>{r.addEventListener("pointerdown",g)},0);return()=>{window.clearTimeout(v),r.removeEventListener("pointerdown",g),r.removeEventListener("click",d.current);for(let x of y)r.removeEventListener(x,f,!0),r.removeEventListener(x,h)}},[r,s,n,i,o,a]),{onPointerDownCapture:he(()=>l.current=!0,"onPointerDownCapture")}}he(Nu,"usePointerDownOutside");function Fu(e,t=globalThis?.document){let r=Qe(e),n=te.useRef(!1);return te.useEffect(()=>{let i=he(o=>{o.target&&!n.current&&Ho(a0,r,{originalEvent:o},{discrete:!1})},"handleFocus");return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,r]),{onFocusCapture:he(()=>n.current=!0,"onFocusCapture"),onBlurCapture:he(()=>n.current=!1,"onBlurCapture")}}he(Fu,"useFocusOutside");function Uo(){let e=new CustomEvent(Wo);document.dispatchEvent(e)}he(Uo,"dispatchUpdate");function Ho(e,t,r,{discrete:n}){let i=r.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&i.addEventListener(e,t,{once:!0}),n?os(i,o):i.dispatchEvent(o)}he(Ho,"handleAndDispatchCustomEvent");var u0=z(require("react"),1),d0=Object.defineProperty,$o=(e,t)=>d0(e,"name",{value:t,configurable:!0}),In=0,lr=null;function p0(e){return qo(),e.children}$o(p0,"FocusGuards");function qo(){u0.useEffect(()=>{lr||(lr={start:Ko(),end:Ko()});let{start:e,end:t}=lr;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),In++,()=>{In===1&&(lr?.start.remove(),lr?.end.remove(),lr=null),In=Math.max(0,In-1)}},[])}$o(qo,"useFocusGuards");function Ko(){let e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}$o(Ko,"createFocusGuard");var we=z(require("react"),1),Bu=require("react/jsx-runtime"),h0=Object.defineProperty,se=(e,t)=>h0(e,"name",{value:t,configurable:!0}),Go="focusScope.autoFocusOnMount",Yo="focusScope.autoFocusOnUnmount",zu={bubbles:!1,cancelable:!0},f0=we.forwardRef(se(function(e,t){let{loop:r=!1,trapped:n=!1,branches:i,onMountAutoFocus:o,onUnmountAutoFocus:a,...s}=e,[l,u]=we.useState(null),c=Qe(o),d=Qe(a),p=we.useRef(null),m=Y(t,u),f=we.useRef(i);we.useEffect(()=>{f.current=i});let h=we.useCallback(v=>v?l?.contains(v)?!0:!!f.current?.some(x=>x.contains(v)):!1,[l]),g=we.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;we.useEffect(()=>{if(n){let b=function(T){if(g.paused||!l)return;let _=T.target;h(_)?p.current=_:ct(p.current,{select:!0})},S=function(T){if(g.paused||!l)return;let _=T.relatedTarget;_!==null&&(h(_)||ct(p.current,{select:!0}))},C=function(T){if(document.activeElement===document.body)for(let _ of T)_.removedNodes.length>0&&ct(l)};var v=b,x=S,w=C;se(b,"handleFocusIn"),se(S,"handleFocusOut"),se(C,"handleMutations"),document.addEventListener("focusin",b),document.addEventListener("focusout",S);let P=new MutationObserver(C);return l&&P.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",S),P.disconnect()}}},[n,l,g.paused,h]),we.useEffect(()=>{if(l){Ku.add(g);let v=document.activeElement;if(!l.contains(v)){let x=new CustomEvent(Go,zu);l.addEventListener(Go,c),l.dispatchEvent(x),x.defaultPrevented||(Uu(Yu(Xo(l)),{select:!0}),document.activeElement===v&&ct(l))}return()=>{l.removeEventListener(Go,c);let x=l.ownerDocument,w=CustomEvent;setTimeout(()=>{let b=new w(Yo,zu);l.addEventListener(Yo,d),l.dispatchEvent(b),b.defaultPrevented||ct(v??x.body,{select:!0}),l.removeEventListener(Yo,d),Ku.remove(g)},0)}}},[l,c,d,g]);let y=we.useCallback(v=>{if(!r&&!n||g.paused)return;let x=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,w=document.activeElement;if(x&&w){let b=v.currentTarget,[S,C]=Hu(b);S&&C?!v.shiftKey&&w===C?(v.preventDefault(),r&&ct(S,{select:!0})):v.shiftKey&&w===S&&(v.preventDefault(),r&&ct(C,{select:!0})):w===b&&v.preventDefault()}},[r,n,g.paused]);return(0,Bu.jsx)(oe.div,{tabIndex:-1,...s,ref:m,onKeyDown:y})},"FocusScope")),Wu=we.createContext(null);function m0({registry:e,children:t}){return e?(0,Bu.jsx)(Wu.Provider,{value:e,children:t}):t}se(m0,"FocusScopeBranchProvider");function g0(){let[e,t]=we.useState([]),r=we.useMemo(()=>({add:se(n=>t(i=>i.includes(n)?i:[...i,n]),"add"),remove:se(n=>t(i=>i.filter(o=>o!==n)),"remove")}),[]);return{nodes:e,registry:r}}se(g0,"useFocusScopeBranchRegistry");function v0(e){let t=we.useContext(Wu);we.useEffect(()=>{if(!(!e||!t))return t.add(e),()=>t.remove(e)},[e,t])}se(v0,"useFocusScopeBranch");function Uu(e,{select:t=!1}={}){let r=document.activeElement;for(let n of e)if(ct(n,{select:t}),document.activeElement!==r)return}se(Uu,"focusFirst");function Hu(e){let t=Xo(e),r=Zo(t,e),n=Zo(t.reverse(),e);return[r,n]}se(Hu,"getTabbableEdges");function Xo(e){let t=[],r=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:se(n=>{let i=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||i?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;r.nextNode();)t.push(r.currentNode);return t}se(Xo,"getTabbableCandidates");function Zo(e,t){let r=typeof t.checkVisibility=="function"&&t.checkVisibility({checkVisibilityCSS:!0});for(let n of e)if(!(r?!n.checkVisibility({checkVisibilityCSS:!0}):$u(n,{upTo:t})))return n}se(Zo,"findVisible");function $u(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}se($u,"isHidden");function qu(e){return e.tagName==="INPUT"&&typeof e.select=="function"}se(qu,"isSelectableInput");function ct(e,{select:t=!1}={}){if(e&&e.focus){let r=(e.ownerDocument??document).activeElement;e.focus({preventScroll:!0}),e!==r&&qu(e)&&t&&e.select()}}se(ct,"focus");var Ku=Gu();function Gu(){let e=[];return{add(t){let r=e[0];t!==r&&r?.pause(),e=Qo(e,t),e.unshift(t)},remove(t){e=Qo(e,t),e[0]?.resume()}}}se(Gu,"createFocusScopesStack");function Qo(e,t){let r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}se(Qo,"arrayRemove");function Yu(e){return e.filter(t=>t.tagName!=="A")}se(Yu,"removeLinks");var Ue=z(require("react"),1),y0=["top","right","bottom","left"],bt=Math.min,ut=Math.max,Vn=Math.round,Ln=Math.floor,dt=e=>({x:e,y:e}),x0={left:"right",right:"left",bottom:"top",top:"bottom"};function Xu(e,t,r){return ut(e,bt(t,r))}function pt(e,t){return typeof e=="function"?e(t):e}function wt(e){return e.split("-")[0]}function cr(e){return e.split("-")[1]}function Jo(e){return e==="x"?"y":"x"}function ea(e){return e==="y"?"height":"width"}function Je(e){let t=e[0];return t==="t"||t==="b"?"y":"x"}function ta(e){return Jo(Je(e))}function b0(e,t,r){r===void 0&&(r=!1);let n=cr(e),i=ta(e),o=ea(i),a=i==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=jn(a)),[a,jn(a)]}function w0(e){let t=jn(e);return[ra(e),t,ra(t)]}function ra(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}var Zu=["left","right"],Qu=["right","left"],S0=["top","bottom"],C0=["bottom","top"];function P0(e,t,r){switch(e){case"top":case"bottom":return r?t?Qu:Zu:t?Zu:Qu;case"left":case"right":return t?S0:C0;default:return[]}}function _0(e,t,r,n){let i=cr(e),o=P0(wt(e),r==="start",n);return i&&(o=o.map(a=>a+"-"+i),t&&(o=o.concat(o.map(ra)))),o}function jn(e){let t=wt(e);return x0[t]+e.slice(t.length)}function T0(e){var t,r,n,i;return{top:(t=e.top)!=null?t:0,right:(r=e.right)!=null?r:0,bottom:(n=e.bottom)!=null?n:0,left:(i=e.left)!=null?i:0}}function Ju(e){return typeof e!="number"?T0(e):{top:e,right:e,bottom:e,left:e}}function Nn(e){let{x:t,y:r,width:n,height:i}=e;return{width:n,height:i,top:r,left:t,right:t+n,bottom:r+i,x:t,y:r}}function ed(e,t,r){let{reference:n,floating:i}=e,o=Je(t),a=ta(t),s=ea(a),l=wt(t),u=o==="y",c=n.x+n.width/2-i.width/2,d=n.y+n.height/2-i.height/2,p=n[s]/2-i[s]/2,m;switch(l){case"top":m={x:c,y:n.y-i.height};break;case"bottom":m={x:c,y:n.y+n.height};break;case"right":m={x:n.x+n.width,y:d};break;case"left":m={x:n.x-i.width,y:d};break;default:m={x:n.x,y:n.y}}let f=cr(t);return f&&(m[a]+=p*(f==="end"?1:-1)*(r&&u?-1:1)),m}async function R0(e,t){var r;t===void 0&&(t={});let{x:n,y:i,platform:o,rects:a,elements:s,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:p=!1,padding:m=0}=pt(t,e),f=Ju(m),h=s[p?d==="floating"?"reference":"floating":d],g=Nn(await o.getClippingRect({element:(r=await(o.isElement==null?void 0:o.isElement(h)))==null||r?h:h.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(s.floating)),boundary:u,rootBoundary:c,strategy:l})),y=d==="floating"?{x:n,y:i,width:a.floating.width,height:a.floating.height}:a.reference,v=await(o.getOffsetParent==null?void 0:o.getOffsetParent(s.floating)),x=await(o.isElement==null?void 0:o.isElement(v))&&await(o.getScale==null?void 0:o.getScale(v))||{x:1,y:1},w=Nn(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:y,offsetParent:v,strategy:l}):y);return{top:(g.top-w.top+f.top)/x.y,bottom:(w.bottom-g.bottom+f.bottom)/x.y,left:(g.left-w.left+f.left)/x.x,right:(w.right-g.right+f.right)/x.x}}var E0=50,A0=async(e,t,r)=>{let{placement:n="bottom",strategy:i="absolute",middleware:o=[],platform:a}=r,s=a.detectOverflow?a:{...a,detectOverflow:R0},l=await(a.isRTL==null?void 0:a.isRTL(t)),u=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:c,y:d}=ed(u,n,l),p=n,m=0,f={};for(let h=0;h<o.length;h++){let g=o[h];if(!g)continue;let{name:y,fn:v}=g,{x,y:w,data:b,reset:S}=await v({x:c,y:d,initialPlacement:n,placement:p,strategy:i,middlewareData:f,rects:u,platform:s,elements:{reference:e,floating:t}});c=x??c,d=w??d,f[y]={...f[y],...b},S&&m<E0&&(m++,typeof S=="object"&&(S.placement&&(p=S.placement),S.rects&&(u=S.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:i}):S.rects),{x:c,y:d}=ed(u,p,l)),h=-1)}return{x:c,y:d,placement:p,strategy:i,middlewareData:f}},M0=e=>({name:"arrow",options:e,async fn(t){let{x:r,y:n,placement:i,rects:o,platform:a,elements:s,middlewareData:l}=t,{element:u,padding:c=0}=pt(e,t)||{};if(u==null)return{};let d=Ju(c),p={x:r,y:n},m=ta(i),f=ea(m),h=await a.getDimensions(u),g=m==="y",y=g?"top":"left",v=g?"bottom":"right",x=g?"clientHeight":"clientWidth",w=o.reference[f]+o.reference[m]-p[m]-o.floating[f],b=p[m]-o.reference[m],S=await(a.getOffsetParent==null?void 0:a.getOffsetParent(u)),C=S?S[x]:0;(!C||!await(a.isElement==null?void 0:a.isElement(S)))&&(C=s.floating[x]||o.floating[f]);let P=w/2-b/2,T=C/2-h[f]/2-1,_=bt(d[y],T),R=bt(d[v],T),k=C-h[f]-R,I=C/2-h[f]/2+P,O=Xu(_,I,k),B=!l.arrow&&cr(i)!=null&&I!==O&&o.reference[f]/2-(I<_?_:R)-h[f]/2<0,N=B?I<_?I-_:I-k:0;return{[m]:p[m]+N,data:{[m]:O,centerOffset:I-O-N,...B&&{alignmentOffset:N}},reset:B}}}),D0=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;let{placement:i,middlewareData:o,rects:a,initialPlacement:s,platform:l,elements:u}=t,{mainAxis:c=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:h=!0,...g}=pt(e,t);if((r=o.arrow)!=null&&r.alignmentOffset)return{};let y=wt(i),v=Je(s),x=wt(s)===s,w=await(l.isRTL==null?void 0:l.isRTL(u.floating)),b=p||(x||!h?[jn(s)]:w0(s)),S=f!=="none";!p&&S&&b.push(..._0(s,h,f,w));let C=[s,...b],P=await l.detectOverflow(t,g),T=[],_=((n=o.flip)==null?void 0:n.overflows)||[];if(c&&T.push(P[y]),d){let O=b0(i,a,w);T.push(P[O[0]],P[O[1]])}if(_=[..._,{placement:i,overflows:T}],!T.every(O=>O<=0)){var R,k;let O=(((R=o.flip)==null?void 0:R.index)||0)+1,B=C[O];if(B&&(!(d==="alignment"&&v!==Je(B))||_.every(V=>Je(V.placement)===v?V.overflows[0]>0:!0)))return{data:{index:O,overflows:_},reset:{placement:B}};let N=(k=_.filter(V=>V.overflows[0]<=0).sort((V,M)=>V.overflows[1]-M.overflows[1])[0])==null?void 0:k.placement;if(!N)switch(m){case"bestFit":{var I;let V=(I=_.filter(M=>{if(S){let D=Je(M.placement);return D===v||D==="y"}return!0}).map(M=>[M.placement,M.overflows.filter(D=>D>0).reduce((D,j)=>D+j,0)]).sort((M,D)=>M[1]-D[1])[0])==null?void 0:I[0];V&&(N=V);break}case"initialPlacement":N=s;break}if(i!==N)return{reset:{placement:N}}}return{}}}};function td(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function rd(e){return y0.some(t=>e[t]>=0)}var k0=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){let{rects:r,platform:n}=t,{strategy:i="referenceHidden",...o}=pt(e,t);switch(i){case"referenceHidden":{let a=await n.detectOverflow(t,{...o,elementContext:"reference"}),s=td(a,r.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:rd(s)}}}case"escaped":{let a=await n.detectOverflow(t,{...o,altBoundary:!0}),s=td(a,r.floating);return{data:{escapedOffsets:s,escaped:rd(s)}}}default:return{}}}}},nd=new Set(["left","top"]);async function O0(e,t){let{placement:r,platform:n,elements:i}=e,o=await(n.isRTL==null?void 0:n.isRTL(i.floating)),a=wt(r),s=cr(r),l=Je(r)==="y",u=nd.has(a)?-1:1,c=o&&l?-1:1,d=pt(t,e),{mainAxis:p,crossAxis:m,alignmentAxis:f}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof f=="number"&&(m=s==="end"?f*-1:f),l?{x:m*c,y:p*u}:{x:p*u,y:m*c}}var I0=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;let{x:i,y:o,placement:a,middlewareData:s}=t,l=await O0(t,e);return a===((r=s.offset)==null?void 0:r.placement)&&(n=s.arrow)!=null&&n.alignmentOffset?{}:{x:i+l.x,y:o+l.y,data:{...l,placement:a}}}}},V0=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){let{x:r,y:n,placement:i,platform:o}=t,{mainAxis:a=!0,crossAxis:s=!1,limiter:l={fn:v=>{let{x,y:w}=v;return{x,y:w}}},...u}=pt(e,t),c={x:r,y:n},d=await o.detectOverflow(t,u),p=Je(i),m=Jo(p),f=c[m],h=c[p],g=(v,x)=>Xu(x+d[v==="y"?"top":"left"],x,x-d[v==="y"?"bottom":"right"]);a&&(f=g(m,f)),s&&(h=g(p,h));let y=l.fn({...t,[m]:f,[p]:h});return{...y,data:{x:y.x-r,y:y.y-n,enabled:{[m]:a,[p]:s}}}}}},L0=function(e){return e===void 0&&(e={}),{options:e,fn(t){var r,n;let{x:i,y:o,placement:a,rects:s,middlewareData:l}=t,{offset:u=0,mainAxis:c=!0,crossAxis:d=!0}=pt(e,t),p={x:i,y:o},m=Je(a),f=Jo(m),h=p[f],g=p[m],y=pt(u,t),v=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:(r=y.mainAxis)!=null?r:0,crossAxis:(n=y.crossAxis)!=null?n:0};if(c){let b=f==="y"?"height":"width",S=s.reference[f]-s.floating[b]+v.mainAxis,C=s.reference[f]+s.reference[b]-v.mainAxis;h<S?h=S:h>C&&(h=C)}if(d){var x,w;let b=f==="y"?"width":"height",S=nd.has(wt(a)),C=s.reference[m]-s.floating[b]+(S&&((x=l.offset)==null?void 0:x[m])||0)+(S?0:v.crossAxis),P=s.reference[m]+s.reference[b]+(S?0:((w=l.offset)==null?void 0:w[m])||0)-(S?v.crossAxis:0);g<C?g=C:g>P&&(g=P)}return{[f]:h,[m]:g}}}},j0=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){let{placement:r,rects:n,platform:i,elements:o}=t,{apply:a=()=>{},...s}=pt(e,t),l=await i.detectOverflow(t,s),u=wt(r),c=cr(r),d=Je(r)==="y",{width:p,height:m}=n.floating,f,h;u==="top"||u==="bottom"?(f=u,h=c===(await(i.isRTL==null?void 0:i.isRTL(o.floating))?"start":"end")?"left":"right"):(h=u,f=c==="end"?"top":"bottom");let g=m-l.top-l.bottom,y=p-l.left-l.right,v=bt(m-l[f],g),x=bt(p-l[h],y),w=t.middlewareData.shift,b=!w,S=v,C=x;w!=null&&w.enabled.x&&(C=y),w!=null&&w.enabled.y&&(S=g),b&&!c&&(d?C=p-2*ut(l.left,l.right):S=m-2*ut(l.top,l.bottom)),await a({...t,availableWidth:C,availableHeight:S});let P=await i.getDimensions(o.floating);return p!==P.width||m!==P.height?{reset:{rects:!0}}:{}}}};function Fn(){return typeof window<"u"}function ur(e){return id(e)?(e.nodeName||"").toLowerCase():"#document"}function Pe(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ht(e){var t;return(t=(id(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function id(e){return Fn()?e instanceof Node||e instanceof Pe(e).Node:!1}function et(e){return Fn()?e instanceof Element||e instanceof Pe(e).Element:!1}function St(e){return Fn()?e instanceof HTMLElement||e instanceof Pe(e).HTMLElement:!1}function od(e){return!Fn()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Pe(e).ShadowRoot}function Bn(e){let{overflow:t,overflowX:r,overflowY:n,display:i}=tt(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&i!=="inline"&&i!=="contents"}function N0(e){return/^(table|td|th)$/.test(ur(e))}function zn(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}var F0=/transform|translate|scale|rotate|perspective|filter/,B0=/paint|layout|strict|content/,zt=e=>!!e&&e!=="none",na;function ia(e){let t=et(e)?tt(e):e;return zt(t.transform)||zt(t.translate)||zt(t.scale)||zt(t.rotate)||zt(t.perspective)||!oa()&&(zt(t.backdropFilter)||zt(t.filter))||F0.test(t.willChange||"")||B0.test(t.contain||"")}function z0(e){let t=Wt(e);for(;St(t)&&!Fr(t);){if(ia(t))return t;if(zn(t))return null;t=Wt(t)}return null}function oa(){return na==null&&(na=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),na}function Fr(e){return/^(html|body|#document)$/.test(ur(e))}function tt(e){return Pe(e).getComputedStyle(e)}function Wn(e){return et(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Wt(e){if(ur(e)==="html")return e;let t=e.assignedSlot||e.parentNode||od(e)&&e.host||ht(e);return od(t)?t.host:t}function ad(e){let t=Wt(e);return Fr(t)?(e.ownerDocument||e).body:St(t)&&Bn(t)?t:ad(t)}function Br(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);let i=ad(e),o=i===((n=e.ownerDocument)==null?void 0:n.body),a=Pe(i);if(o){let s=aa(a);return t.concat(a,a.visualViewport||[],Bn(i)?i:[],s&&r?Br(s):[])}else return t.concat(i,Br(i,[],r))}function aa(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function sd(e){let t=tt(e),r=parseFloat(t.width)||0,n=parseFloat(t.height)||0,i=St(e),o=i?e.offsetWidth:r,a=i?e.offsetHeight:n,s=Vn(r)!==o||Vn(n)!==a;return s&&(r=o,n=a),{width:r,height:n,$:s}}function sa(e){return et(e)?e:e.contextElement}function dr(e){let t=sa(e);if(!St(t))return dt(1);let r=t.getBoundingClientRect(),{width:n,height:i,$:o}=sd(t),a=(o?Vn(r.width):r.width)/n,s=(o?Vn(r.height):r.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}var W0=dt(0);function ld(e){let t=Pe(e);return!oa()||!t.visualViewport?W0:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function U0(e,t,r){return t===void 0&&(t=!1),!!r&&t&&r===Pe(e)}function Ut(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);let i=e.getBoundingClientRect(),o=sa(e),a=dt(1);t&&(n?et(n)&&(a=dr(n)):a=dr(e));let s=U0(o,r,n)?ld(o):dt(0),l=(i.left+s.x)/a.x,u=(i.top+s.y)/a.y,c=i.width/a.x,d=i.height/a.y;if(o&&n){let p=Pe(o),m=et(n)?Pe(n):n,f=p,h=aa(f);for(;h&&m!==f;){let g=dr(h),y=h.getBoundingClientRect(),v=tt(h),x=y.left+(h.clientLeft+parseFloat(v.paddingLeft))*g.x,w=y.top+(h.clientTop+parseFloat(v.paddingTop))*g.y;l*=g.x,u*=g.y,c*=g.x,d*=g.y,l+=x,u+=w,f=Pe(h),h=aa(f)}}return Nn({width:c,height:d,x:l,y:u})}function Un(e,t){let r=Wn(e).scrollLeft;return t?t.left+r:Ut(ht(e)).left+r}function cd(e,t){let r=e.getBoundingClientRect(),n=r.left+t.scrollLeft-Un(e,r),i=r.top+t.scrollTop;return{x:n,y:i}}function H0(e){let{elements:t,rect:r,offsetParent:n,strategy:i}=e,o=i==="fixed",a=ht(n),s=t?zn(t.floating):!1;if(n===a||s&&o)return r;let l={scrollLeft:0,scrollTop:0},u=dt(1),c=dt(0),d=St(n);if((d||!o)&&((ur(n)!=="body"||Bn(a))&&(l=Wn(n)),d)){let m=Ut(n);u=dr(n),c.x=m.x+n.clientLeft,c.y=m.y+n.clientTop}let p=a&&!d&&!o?cd(a,l):dt(0);return{width:r.width*u.x,height:r.height*u.y,x:r.x*u.x-l.scrollLeft*u.x+c.x+p.x,y:r.y*u.y-l.scrollTop*u.y+c.y+p.y}}function $0(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function q0(e){let t=Wn(e),r=e.ownerDocument.body,n=ut(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),i=ut(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight),o=-t.scrollLeft+Un(e),a=-t.scrollTop;return tt(r).direction==="rtl"&&(o+=ut(e.clientWidth,r.clientWidth)-n),{width:n,height:i,x:o,y:a}}var K0=25;function G0(e,t,r){r===void 0&&(r="viewport");let n=r==="layoutViewport",i=Pe(e),o=ht(e),a=i.visualViewport,s=o.clientWidth,l=o.clientHeight,u=0,c=0;if(a){let d=!oa()||t==="fixed";n?d||(u=-a.offsetLeft,c=-a.offsetTop):(s=a.width,l=a.height,d&&(u=a.offsetLeft,c=a.offsetTop))}if(Un(o)<=0){let d=o.ownerDocument,p=d.body,m=getComputedStyle(p),f=d.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,h=Math.abs(o.clientWidth-p.clientWidth-f),g=getComputedStyle(o).scrollbarGutter==="stable both-edges"?h/2:h;g<=K0&&(s-=g)}return{width:s,height:l,x:u,y:c}}function Y0(e,t){let r=Ut(e,!0,t==="fixed"),n=r.top+e.clientTop,i=r.left+e.clientLeft,o=dr(e),a=e.clientWidth*o.x,s=e.clientHeight*o.y,l=i*o.x,u=n*o.y;return{width:a,height:s,x:l,y:u}}function ud(e,t,r){let n;if(t==="viewport"||t==="layoutViewport")n=G0(e,r,t);else if(t==="document")n=q0(ht(e));else if(et(t))n=Y0(t,r);else{let i=ld(e);n={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Nn(n)}function X0(e,t){let r=t.get(e);if(r)return r;let n=Br(e,[],!1).filter(s=>et(s)&&ur(s)!=="body"),i=null,o=tt(e).position==="fixed",a=o?Wt(e):e;for(;et(a)&&!Fr(a);){let s=tt(a),l=ia(a),u=i?i.position:o?"fixed":"";!l&&(u==="fixed"||u==="absolute"&&s.position==="static")?n=n.filter(c=>c!==a):i=s,a=Wt(a)}return t.set(e,n),n}function Z0(e){let{element:t,boundary:r,rootBoundary:n,strategy:i}=e,o=[...r==="clippingAncestors"?zn(t)?[]:X0(t,this._c):[].concat(r),n],a=ud(t,o[0],i),s=a.top,l=a.right,u=a.bottom,c=a.left;for(let d=1;d<o.length;d++){let p=ud(t,o[d],i);s=ut(p.top,s),l=bt(p.right,l),u=bt(p.bottom,u),c=ut(p.left,c)}return{width:l-c,height:u-s,x:c,y:s}}function Q0(e){let{width:t,height:r}=sd(e);return{width:t,height:r}}function J0(e,t,r){let n=St(t),i=ht(t),o=r==="fixed",a=Ut(e,!0,o,t),s={scrollLeft:0,scrollTop:0},l=dt(0);if((n||!o)&&((ur(t)!=="body"||Bn(i))&&(s=Wn(t)),n)){let p=Ut(t,!0,o,t);l.x=p.x+t.clientLeft,l.y=p.y+t.clientTop}!n&&i&&(l.x=Un(i));let u=i&&!n&&!o?cd(i,s):dt(0),c=a.left+s.scrollLeft-l.x-u.x,d=a.top+s.scrollTop-l.y-u.y;return{x:c,y:d,width:a.width,height:a.height}}function la(e){return tt(e).position==="static"}function dd(e,t){if(!St(e)||tt(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return ht(e)===r&&(r=r.ownerDocument.body),r}function pd(e,t){let r=Pe(e);if(zn(e))return r;if(!St(e)){let i=Wt(e);for(;i&&!Fr(i);){if(et(i)&&!la(i))return i;i=Wt(i)}return r}let n=dd(e,t);for(;n&&N0(n)&&la(n);)n=dd(n,t);return n&&Fr(n)&&la(n)&&!ia(n)?r:n||z0(e)||r}var ex=async function(e){let t=this.getOffsetParent||pd,r=this.getDimensions,n=await r(e.floating);return{reference:J0(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function tx(e){return tt(e).direction==="rtl"}var rx={convertOffsetParentRelativeRectToViewportRelativeRect:H0,getDocumentElement:ht,getClippingRect:Z0,getOffsetParent:pd,getElementRects:ex,getClientRects:$0,getDimensions:Q0,getScale:dr,isElement:et,isRTL:tx};function hd(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function nx(e,t,r){let n=null,i,o=ht(e);function a(){var c;clearTimeout(i),(c=n)==null||c.disconnect(),n=null}function s(c,d){c===void 0&&(c=!1),d===void 0&&(d=1),a();let p=e.getBoundingClientRect(),{left:m,top:f,width:h,height:g}=p;if(c||t(),!h||!g)return;let y=Ln(f),v=Ln(o.clientWidth-(m+h)),x=Ln(o.clientHeight-(f+g)),w=Ln(m),b={rootMargin:-y+"px "+-v+"px "+-x+"px "+-w+"px",threshold:ut(0,bt(1,d))||1},S=!0;function C(P){let T=P[0].intersectionRatio;if(!hd(p,e.getBoundingClientRect()))return s();if(T!==d){if(!S)return s();T?s(!1,T):i=setTimeout(()=>{s(!1,1e-7)},1e3)}S=!1}try{n=new IntersectionObserver(C,{...b,root:o.ownerDocument})}catch{n=new IntersectionObserver(C,b)}n.observe(e)}let l=Pe(e),u=()=>s(r);return l.addEventListener("resize",u),s(!0),()=>{l.removeEventListener("resize",u),a()}}function ix(e,t,r,n){n===void 0&&(n={});let{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=n,u=sa(e),c=i||o?[...u?Br(u):[],...t?Br(t):[]]:[];c.forEach(y=>{i&&y.addEventListener("scroll",r),o&&y.addEventListener("resize",r)});let d=u&&s?nx(u,r,o):null,p=-1,m=null;a&&(m=new ResizeObserver(y=>{let[v]=y;v&&v.target===u&&m&&t&&(m.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var x;(x=m)==null||x.observe(t)})),r()}),u&&!l&&m.observe(u),t&&m.observe(t));let f,h=l?Ut(e):null;l&&g();function g(){let y=Ut(e);h&&!hd(h,y)&&r(),h=y,f=requestAnimationFrame(g)}return r(),()=>{var y;c.forEach(v=>{i&&v.removeEventListener("scroll",r),o&&v.removeEventListener("resize",r)}),d?.(),(y=m)==null||y.disconnect(),m=null,l&&cancelAnimationFrame(f)}}var ox=I0,ax=V0,sx=D0,lx=j0,cx=k0,fd=M0,ux=L0,dx=(e,t,r)=>{let n=new Map,i=r??{},o={...rx,...i.platform,_c:n};return A0(e,t,{...i,platform:o})},ve=z(require("react"),1),px=require("react"),hx=z(require("react-dom"),1),fx=typeof document<"u",mx=function(){},Hn=fx?px.useLayoutEffect:mx;function $n(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 r,n,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!$n(e[n],t[n]))return!1;return!0}if(i=Object.keys(e),r=i.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,i[n]))return!1;for(n=r;n--!==0;){let o=i[n];if(!(o==="_owner"&&e.$$typeof)&&!$n(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function md(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function gd(e,t){let r=md(e);return Math.round(t*r)/r}function ca(e){let t=ve.useRef(e);return Hn(()=>{t.current=e}),t}function gx(e){e===void 0&&(e={});let{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:i,elements:{reference:o,floating:a}={},transform:s=!0,whileElementsMounted:l,open:u}=e,[c,d]=ve.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=ve.useState(n);$n(p,n)||m(n);let[f,h]=ve.useState(null),[g,y]=ve.useState(null),v=ve.useCallback(M=>{M!==S.current&&(S.current=M,h(M))},[]),x=ve.useCallback(M=>{M!==C.current&&(C.current=M,y(M))},[]),w=o||f,b=a||g,S=ve.useRef(null),C=ve.useRef(null),P=ve.useRef(c),T=l!=null,_=ca(l),R=ca(i),k=ca(u),I=ve.useCallback(()=>{if(!S.current||!C.current)return;let M={placement:t,strategy:r,middleware:p};R.current&&(M.platform=R.current),dx(S.current,C.current,M).then(D=>{let j={...D,isPositioned:k.current!==!1};O.current&&!$n(P.current,j)&&(P.current=j,hx.flushSync(()=>{d(j)}))})},[p,t,r,R,k]);Hn(()=>{u===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,d(M=>({...M,isPositioned:!1})))},[u]);let O=ve.useRef(!1);Hn(()=>(O.current=!0,()=>{O.current=!1}),[]),Hn(()=>{if(w&&(S.current=w),b&&(C.current=b),w&&b){if(_.current)return _.current(w,b,I);I()}},[w,b,I,_,T]);let B=ve.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:x}),[v,x]),N=ve.useMemo(()=>({reference:w,floating:b}),[w,b]),V=ve.useMemo(()=>{let M={position:r,left:0,top:0};if(!N.floating)return M;let D=gd(N.floating,c.x),j=gd(N.floating,c.y);return s?{...M,transform:"translate("+D+"px, "+j+"px)",...md(N.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:D,top:j}},[r,s,N.floating,c.x,c.y]);return ve.useMemo(()=>({...c,update:I,refs:B,elements:N,floatingStyles:V}),[c,I,B,N,V])}var vx=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){let{element:n,padding:i}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?fd({element:n.current,padding:i}).fn(r):{}:n?fd({element:n,padding:i}).fn(r):{}}}},yx=(e,t)=>{let r=ox(e);return{name:r.name,fn:r.fn,options:[e,t]}},xx=(e,t)=>{let r=ax(e);return{name:r.name,fn:r.fn,options:[e,t]}},bx=(e,t)=>({fn:ux(e).fn,options:[e,t]}),wx=(e,t)=>{let r=sx(e);return{name:r.name,fn:r.fn,options:[e,t]}},Sx=(e,t)=>{let r=lx(e);return{name:r.name,fn:r.fn,options:[e,t]}},Cx=(e,t)=>{let r=cx(e);return{name:r.name,fn:r.fn,options:[e,t]}},Px=(e,t)=>{let r=vx(e);return{name:r.name,fn:r.fn,options:[e,t]}},_x=z(require("react"),1),Tx=Object.defineProperty,Rx=(e,t)=>Tx(e,"name",{value:t,configurable:!0});function vd(e){let[t,r]=_x.useState(void 0);return ee(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});let n=0,i=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;let a=o[0];window.cancelAnimationFrame(n),n=window.requestAnimationFrame(()=>{let s,l;if("borderBoxSize"in a){let u=a.borderBoxSize,c=Array.isArray(u)?u[0]:u;s=c.inlineSize,l=c.blockSize}else s=e.offsetWidth,l=e.offsetHeight;r({width:s,height:l})})});return i.observe(e,{box:"border-box"}),()=>{window.cancelAnimationFrame(n),i.unobserve(e)}}else r(void 0)},[e]),t}Rx(vd,"useSize");var zr=require("react/jsx-runtime"),Ex=Object.defineProperty,Ct=(e,t)=>Ex(e,"name",{value:t,configurable:!0}),yd={Partial:"partial",Always:"always"},xd={Optimized:"optimized",Always:"always"},bd="Popper",[wd,Sd]=Tt(bd),[Ax,Cd]=wd(bd),Mx=Ct(e=>{let{__scopePopper:t,children:r}=e,[n,i]=Ue.useState(null),[o,a]=Ue.useState(void 0);return(0,zr.jsx)(Ax,{scope:t,anchor:n,onAnchorChange:i,placementState:o,setPlacementState:a,children:r})},"Popper"),Dx="PopperAnchor",kx=Ue.forwardRef(Ct(function(e,t){let{__scopePopper:r,virtualRef:n,...i}=e,o=Cd(Dx,r),a=Ue.useRef(null),s=o.onAnchorChange,l=Ue.useCallback(f=>{a.current=f,f&&s(f)},[s]),u=Y(t,l),c=Ue.useRef(null);Ue.useEffect(()=>{if(!n)return;let f=c.current;c.current=n.current,f!==c.current&&s(c.current)});let d=o.placementState&&qn(o.placementState),p=d?.[0],m=d?.[1];return n?null:(0,zr.jsx)(oe.div,{"data-radix-popper-side":p,"data-radix-popper-align":m,...i,ref:u})},"PopperAnchor")),Pd="PopperContent",[Ox,Tw]=wd(Pd),Ix=Ue.forwardRef(Ct(function(e,t){let{__scopePopper:r,side:n="bottom",sideOffset:i=0,align:o="center",alignOffset:a=0,arrowPadding:s=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:c=0,sticky:d=yd.Partial,hideWhenDetached:p=!1,updatePositionStrategy:m=xd.Optimized,onPlaced:f,...h}=e,g=Cd(Pd,r),[y,v]=Ue.useState(null),x=Y(t,v),[w,b]=Ue.useState(null),S=vd(w),C=S?.width??0,P=S?.height??0,T=n+(o!=="center"?"-"+o:""),_=typeof c=="number"?c:{top:0,right:0,bottom:0,left:0,...c},R=Array.isArray(u)?u:[u],k=R.length>0,I={padding:_,boundary:R.filter(_d),altBoundary:k},{refs:O,floatingStyles:B,placement:N,isPositioned:V,middlewareData:M}=gx({strategy:"fixed",placement:T,whileElementsMounted:Ct((...Me)=>ix(...Me,{animationFrame:m===xd.Always}),"whileElementsMounted"),elements:{reference:g.anchor},middleware:[yx({mainAxis:i+P,alignmentAxis:a}),l&&xx({mainAxis:!0,crossAxis:!1,...d===yd.Partial?{limiter:bx()}:{},...I}),l&&wx({...I}),Sx({...I,apply:Ct(({elements:Me,rects:F,availableWidth:G,availableHeight:$})=>{let{width:H,height:Q}=F.reference,ye=Me.floating.style;ye.setProperty("--radix-popper-available-width",`${G}px`),ye.setProperty("--radix-popper-available-height",`${$}px`),ye.setProperty("--radix-popper-anchor-width",`${H}px`),ye.setProperty("--radix-popper-anchor-height",`${Q}px`)},"apply")}),w&&Px({element:w,padding:s}),Vx({arrowWidth:C,arrowHeight:P}),p&&Cx(k?{strategy:"referenceHidden",...I}:{strategy:"referenceHidden",padding:I.padding,altBoundary:I.altBoundary})]}),D=g.setPlacementState;ee(()=>(D(N),()=>{D(void 0)}),[N,D]);let[j,J]=qn(N),je=Qe(f);ee(()=>{V&&je?.()},[V,je]);let Kt=M.arrow?.x,it=M.arrow?.y,_t=M.arrow?.centerOffset!==0,[le,Ae]=Ue.useState();return ee(()=>{y&&Ae(window.getComputedStyle(y).zIndex)},[y]),(0,zr.jsx)("div",{ref:O.setFloating,"data-radix-popper-content-wrapper":"",style:{...B,transform:V?B.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:le,"--radix-popper-transform-origin":[M.transformOrigin?.x,M.transformOrigin?.y].join(" "),...M.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:(0,zr.jsx)(Ox,{scope:r,placedSide:j,placedAlign:J,onArrowChange:b,arrowX:Kt,arrowY:it,shouldHideArrow:_t,children:(0,zr.jsx)(oe.div,{"data-side":j,"data-align":J,...h,ref:x,style:{...h.style,animation:V?h.style?.animation:"none"}})})})},"PopperContent"));function _d(e){return e!==null}Ct(_d,"isNotNull");var Vx=Ct(e=>({name:"transformOrigin",options:e,fn(t){let{placement:r,rects:n,middlewareData:i}=t,o=i.arrow?.centerOffset!==0,a=o?0:e.arrowWidth,s=o?0:e.arrowHeight,[l,u]=qn(r),c={start:"0%",center:"50%",end:"100%"}[u],d=(i.arrow?.x??0)+a/2,p=(i.arrow?.y??0)+s/2,m="",f="";return l==="bottom"?(m=o?c:`${d}px`,f=`${-s}px`):l==="top"?(m=o?c:`${d}px`,f=`${n.floating.height+s}px`):l==="right"?(m=`${-s}px`,f=o?c:`${p}px`):l==="left"&&(m=`${n.floating.width+s}px`,f=o?c:`${p}px`),{data:{x:m,y:f}}}}),"transformOrigin");function qn(e){let[t,r="center"]=e.split("-");return[t,r]}Ct(qn,"getSideAndAlignFromPlacement");var Td=z(require("react"),1),Lx=z(require("react-dom"),1),jx=require("react/jsx-runtime"),Nx=Object.defineProperty,Fx=(e,t)=>Nx(e,"name",{value:t,configurable:!0}),Bx=Td.forwardRef(Fx(function(e,t){let{container:r,...n}=e,[i,o]=Td.useState(!1);ee(()=>o(!0),[]);let a=r||i&&globalThis?.document?.body;return a?Lx.createPortal((0,jx.jsx)(oe.div,{...n,ref:t}),a):null},"Portal")),Rw=z(require("react"),1),Ew=require("react/jsx-runtime"),zx=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),Wx=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},pr=new WeakMap,Kn=new WeakMap,Gn={},ua=0,Rd=function(e){return e&&(e.host||Rd(e.parentNode))},Ux=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=Rd(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},Hx=function(e,t,r,n){var i=Ux(t,Array.isArray(e)?e:[e]);Gn[r]||(Gn[r]=new WeakMap);var o=Gn[r],a=[],s=new Set,l=new Set(i),u=function(d){!d||s.has(d)||(s.add(d),u(d.parentNode))};i.forEach(u);var c=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(p){if(s.has(p))c(p);else try{var m=p.getAttribute(n),f=m!==null&&m!=="false",h=(pr.get(p)||0)+1,g=(o.get(p)||0)+1;pr.set(p,h),o.set(p,g),a.push(p),h===1&&f&&Kn.set(p,!0),g===1&&p.setAttribute(r,"true"),f||p.setAttribute(n,"true")}catch(y){console.error("aria-hidden: cannot operate on ",p,y)}})};return c(t),s.clear(),ua++,function(){a.forEach(function(d){var p=pr.get(d)-1,m=o.get(d)-1;pr.set(d,p),o.set(d,m),p||(Kn.has(d)||d.removeAttribute(n),Kn.delete(d)),m||d.removeAttribute(r)}),ua--,ua||(pr=new WeakMap,pr=new WeakMap,Kn=new WeakMap,Gn={})}},$x=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),i=t||Wx(e);return i?(n.push.apply(n,Array.from(i.querySelectorAll("[aria-live], script"))),Hx(n,i,r,"aria-hidden")):function(){return null}},rt=function(){return rt=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},rt.apply(this,arguments)};function Ed(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r}function qx(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,o;n<i;n++)(o||!(n in t))&&(o||(o=Array.prototype.slice.call(t,0,n)),o[n]=t[n]);return e.concat(o||Array.prototype.slice.call(t))}var Ad=z(require("react")),ft=z(require("react")),Yn="right-scroll-bar-position",Xn="width-before-scroll-bar",Kx="with-scroll-bars-hidden",Gx="--removed-body-scroll-bar-size";function da(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}var Yx=require("react");function Xx(e,t){var r=(0,Yx.useState)(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(n){var i=r.value;i!==n&&(r.value=n,r.callback(n,i))}}}})[0];return r.callback=t,r.facade}var Md=z(require("react")),Zx=typeof window<"u"?Md.useLayoutEffect:Md.useEffect,Dd=new WeakMap;function Qx(e,t){var r=Xx(t||null,function(n){return e.forEach(function(i){return da(i,n)})});return Zx(function(){var n=Dd.get(r);if(n){var i=new Set(n),o=new Set(e),a=r.current;i.forEach(function(s){o.has(s)||da(s,null)}),o.forEach(function(s){i.has(s)||da(s,a)})}Dd.set(r,e)},[e]),r}function Jx(e){return e}function eb(e,t){t===void 0&&(t=Jx);var r=[],n=!1,i={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(o){var a=t(o,n);return r.push(a),function(){r=r.filter(function(s){return s!==a})}},assignSyncMedium:function(o){for(n=!0;r.length;){var a=r;r=[],a.forEach(o)}r={push:function(s){return o(s)},filter:function(){return r}}},assignMedium:function(o){n=!0;var a=[];if(r.length){var s=r;r=[],s.forEach(o),a=r}var l=function(){var c=a;a=[],c.forEach(o)},u=function(){return Promise.resolve().then(l)};u(),r={push:function(c){a.push(c),u()},filter:function(c){return a=a.filter(c),r}}}};return i}function tb(e){e===void 0&&(e={});var t=eb(null);return t.options=rt({async:!0,ssr:!1},e),t}var rb=z(require("react")),kd=function(e){var t=e.sideCar,r=Ed(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return rb.createElement(n,rt({},r))};kd.isSideCarExport=!0;function nb(e,t){return e.useMedium(t),kd}var Od=tb(),pa=function(){},Zn=ft.forwardRef(function(e,t){var r=ft.useRef(null),n=ft.useState({onScrollCapture:pa,onWheelCapture:pa,onTouchMoveCapture:pa}),i=n[0],o=n[1],a=e.forwardProps,s=e.children,l=e.className,u=e.removeScrollBar,c=e.enabled,d=e.shards,p=e.sideCar,m=e.noRelative,f=e.noIsolation,h=e.inert,g=e.allowPinchZoom,y=e.as,v=y===void 0?"div":y,x=e.gapMode,w=Ed(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),b=p,S=Qx([r,t]),C=rt(rt({},w),i);return ft.createElement(ft.Fragment,null,c&&ft.createElement(b,{sideCar:Od,removeScrollBar:u,shards:d,noRelative:m,noIsolation:f,inert:h,setCallbacks:o,allowPinchZoom:!!g,lockRef:r,gapMode:x}),a?ft.cloneElement(ft.Children.only(s),rt(rt({},C),{ref:S})):ft.createElement(v,rt({},C,{className:l,ref:S}),s))});Zn.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Zn.classNames={fullWidth:Xn,zeroRight:Yn};var de=z(require("react")),ha=z(require("react")),ib=z(require("react")),Id,ob=function(){if(Id)return Id;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function ab(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=ob();return t&&e.setAttribute("nonce",t),e}function sb(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function lb(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var cb=function(){var e=0,t=null;return{add:function(r){e==0&&(t=ab())&&(sb(t,r),lb(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},ub=function(){var e=cb();return function(t,r){ib.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},Vd=function(){var e=ub(),t=function(r){var n=r.styles,i=r.dynamic;return e(n,i),null};return t},db={left:0,top:0,right:0,gap:0},fa=function(e){return parseInt(e||"",10)||0},pb=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[fa(r),fa(n),fa(i)]},hb=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return db;var t=pb(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},fb=Vd(),hr="data-scroll-locked",mb=function(e,t,r,n){var i=e.left,o=e.top,a=e.right,s=e.gap;return r===void 0&&(r="margin"),`
76
+ .`.concat(Kx,` {
77
+ overflow: hidden `).concat(n,`;
78
+ padding-right: `).concat(s,"px ").concat(n,`;
79
+ }
80
+ body[`).concat(hr,`] {
81
+ overflow: hidden `).concat(n,`;
82
+ overscroll-behavior: contain;
83
+ `).concat([t&&"position: relative ".concat(n,";"),r==="margin"&&`
84
+ padding-left: `.concat(i,`px;
85
+ padding-top: `).concat(o,`px;
86
+ padding-right: `).concat(a,`px;
87
+ margin-left:0;
88
+ margin-top:0;
89
+ margin-right: `).concat(s,"px ").concat(n,`;
90
+ `),r==="padding"&&"padding-right: ".concat(s,"px ").concat(n,";")].filter(Boolean).join(""),`
91
+ }
92
+
93
+ .`).concat(Yn,` {
94
+ right: `).concat(s,"px ").concat(n,`;
95
+ }
96
+
97
+ .`).concat(Xn,` {
98
+ margin-right: `).concat(s,"px ").concat(n,`;
99
+ }
100
+
101
+ .`).concat(Yn," .").concat(Yn,` {
102
+ right: 0 `).concat(n,`;
103
+ }
104
+
105
+ .`).concat(Xn," .").concat(Xn,` {
106
+ margin-right: 0 `).concat(n,`;
107
+ }
108
+
109
+ body[`).concat(hr,`] {
110
+ `).concat(Gx,": ").concat(s,`px;
111
+ }
112
+ `)},Ld=function(){var e=parseInt(document.body.getAttribute(hr)||"0",10);return isFinite(e)?e:0},gb=function(){ha.useEffect(function(){return document.body.setAttribute(hr,(Ld()+1).toString()),function(){var e=Ld()-1;e<=0?document.body.removeAttribute(hr):document.body.setAttribute(hr,e.toString())}},[])},vb=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,i=n===void 0?"margin":n;gb();var o=ha.useMemo(function(){return hb(i)},[i]);return ha.createElement(fb,{styles:mb(o,!t,i,r?"":"!important")})},ma=!1;if(typeof window<"u")try{Wr=Object.defineProperty({},"passive",{get:function(){return ma=!0,!0}}),window.addEventListener("test",Wr,Wr),window.removeEventListener("test",Wr,Wr)}catch{ma=!1}var Wr,fr=ma?{passive:!1}:!1,yb=function(e){return e.tagName==="TEXTAREA"},jd=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!yb(e)&&r[t]==="visible")},xb=function(e){return jd(e,"overflowY")},bb=function(e){return jd(e,"overflowX")},Nd=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var i=Fd(e,n);if(i){var o=Bd(e,n),a=o[1],s=o[2];if(a>s)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},wb=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},Sb=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},Fd=function(e,t){return e==="v"?xb(t):bb(t)},Bd=function(e,t){return e==="v"?wb(t):Sb(t)},Cb=function(e,t){return e==="h"&&t==="rtl"?-1:1},Pb=function(e,t,r,n,i){var o=Cb(e,window.getComputedStyle(t).direction),a=o*n,s=r.target,l=t.contains(s),u=!1,c=a>0,d=0,p=0;do{if(!s)break;var m=Bd(e,s),f=m[0],h=m[1],g=m[2],y=h-g-o*f;(f||y)&&Fd(e,s)&&(d+=y,p+=f);var v=s.parentNode;s=v&&v.nodeType===Node.DOCUMENT_FRAGMENT_NODE?v.host:v}while(!l&&s!==document.body||l&&(t.contains(s)||t===s));return(c&&(i&&Math.abs(d)<1||!i&&a>d)||!c&&(i&&Math.abs(p)<1||!i&&-a>p))&&(u=!0),u},Qn=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},zd=function(e){return[e.deltaX,e.deltaY]},Wd=function(e){return e&&"current"in e?e.current:e},_b=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Tb=function(e){return`
113
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
114
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
115
+ `)},Rb=0,mr=[];function Eb(e){var t=de.useRef([]),r=de.useRef([0,0]),n=de.useRef(),i=de.useState(Rb++)[0],o=de.useState(Vd)[0],a=de.useRef(e);de.useEffect(function(){a.current=e},[e]),de.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var h=qx([e.lockRef.current],(e.shards||[]).map(Wd),!0).filter(Boolean);return h.forEach(function(g){return g.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),h.forEach(function(g){return g.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var s=de.useCallback(function(h,g){if("touches"in h&&h.touches.length===2||h.type==="wheel"&&h.ctrlKey)return!a.current.allowPinchZoom;var y=Qn(h),v=r.current,x="deltaX"in h?h.deltaX:v[0]-y[0],w="deltaY"in h?h.deltaY:v[1]-y[1],b,S=h.target,C=Math.abs(x)>Math.abs(w)?"h":"v";if("touches"in h&&C==="h"&&S.type==="range")return!1;var P=window.getSelection(),T=P&&P.anchorNode,_=T?T===S||T.contains(S):!1;if(_)return!1;var R=Nd(C,S);if(!R)return!0;if(R?b=C:(b=C==="v"?"h":"v",R=Nd(C,S)),!R)return!1;if(!n.current&&"changedTouches"in h&&(x||w)&&(n.current=b),!b)return!0;var k=n.current||b;return Pb(k,g,h,k==="h"?x:w,!0)},[]),l=de.useCallback(function(h){var g=h;if(!(!mr.length||mr[mr.length-1]!==o)){var y="deltaY"in g?zd(g):Qn(g),v=t.current.filter(function(b){return b.name===g.type&&(b.target===g.target||g.target===b.shadowParent)&&_b(b.delta,y)})[0];if(v&&v.should){g.cancelable&&g.preventDefault();return}if(!v){var x=(a.current.shards||[]).map(Wd).filter(Boolean).filter(function(b){return b.contains(g.target)}),w=x.length>0?s(g,x[0]):!a.current.noIsolation;w&&g.cancelable&&g.preventDefault()}}},[]),u=de.useCallback(function(h,g,y,v){var x={name:h,delta:g,target:y,should:v,shadowParent:Ab(y)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(w){return w!==x})},1)},[]),c=de.useCallback(function(h){r.current=Qn(h),n.current=void 0},[]),d=de.useCallback(function(h){u(h.type,zd(h),h.target,s(h,e.lockRef.current))},[]),p=de.useCallback(function(h){u(h.type,Qn(h),h.target,s(h,e.lockRef.current))},[]);de.useEffect(function(){return mr.push(o),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:p}),document.addEventListener("wheel",l,fr),document.addEventListener("touchmove",l,fr),document.addEventListener("touchstart",c,fr),function(){mr=mr.filter(function(h){return h!==o}),document.removeEventListener("wheel",l,fr),document.removeEventListener("touchmove",l,fr),document.removeEventListener("touchstart",c,fr)}},[]);var m=e.removeScrollBar,f=e.inert;return de.createElement(de.Fragment,null,f?de.createElement(o,{styles:Tb(i)}):null,m?de.createElement(vb,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Ab(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Mb=nb(Od,Eb),Ud=Ad.forwardRef(function(e,t){return Ad.createElement(Zn,rt({},e,{ref:t,sideCar:Mb}))});Ud.classNames=Zn.classNames;var Db=Ud,L=require("react/jsx-runtime"),kb=Object.defineProperty,U=(e,t)=>kb(e,"name",{value:t,configurable:!0}),Hd={ItemAligned:"item-aligned",Popper:"popper"},Ob={LTR:"ltr",RTL:"rtl"},Ib=[" ","Enter","ArrowUp","ArrowDown"],Vb=[" ","Enter"],gr="Select",[Jn,ei,Lb]=za(gr),[Ht,Aw]=Tt(gr,[Lb,Sd]),ga=Sd(),[jb,Pt]=Ht(gr),[Nb,Fb]=Ht(gr);function $d(e){let{__scopeSelect:t,children:r,open:n,defaultOpen:i,onOpenChange:o,value:a,defaultValue:s,onValueChange:l,dir:u,name:c,autoComplete:d,disabled:p,required:m,form:f,internal_do_not_use_render:h}=e,g=ga(t),[y,v]=E.useState(null),[x,w]=E.useState(null),[b,S]=E.useState(!1),C=di(u),[P,T]=Yt({prop:n,defaultProp:i??!1,onChange:o,caller:gr}),[_,R]=Yt({prop:a,defaultProp:s,onChange:l,caller:gr}),k=E.useRef(null),I=E.useRef(!1),[O,B]=E.useState(null),N=U(le=>{B({value:le,hasConsumerStoppedPropagation:I.current}),R(le)},"handleUserSelect"),V=E.useRef(_);E.useEffect(()=>{let le=f?y?.ownerDocument.getElementById(f):y?.form;if(le instanceof HTMLFormElement){let Ae=U(()=>R(V.current),"reset");return le.addEventListener("reset",Ae),()=>le.removeEventListener("reset",Ae)}},[f,y,R]);let M=y?!!f||!!y.closest("form"):!0,[D,j]=E.useState(new Set),J=xr(),je=Array.from(D).map(le=>le.props.value).join(";"),Kt=E.useCallback(le=>{j(Ae=>new Set(Ae).add(le))},[]),it=E.useCallback(le=>{j(Ae=>{let Me=new Set(Ae);return Me.delete(le),Me})},[]),_t={required:m,trigger:y,onTriggerChange:v,valueNode:x,onValueNodeChange:w,valueNodeHasChildren:b,onValueNodeHasChildrenChange:S,contentId:J,value:_,onValueChange:R,hasConsumerStoppedPropagationRef:I,userSelection:O,onUserSelect:N,open:P,onOpenChange:T,dir:C,triggerPointerDownPosRef:k,disabled:p,name:c,autoComplete:d,form:f,nativeOptions:D,nativeSelectKey:je,isFormControl:M};return(0,L.jsx)(Mx,{...g,children:(0,L.jsx)(jb,{scope:t,..._t,children:(0,L.jsx)(Jn.Provider,{scope:t,children:(0,L.jsx)(Nb,{scope:t,onNativeOptionAdd:Kt,onNativeOptionRemove:it,children:Jd(h)?h(_t):r})})})})}U($d,"SelectProvider");var Bb=U(e=>{let{__scopeSelect:t,children:r,...n}=e;return(0,L.jsx)($d,{__scopeSelect:t,...n,internal_do_not_use_render:({isFormControl:i})=>(0,L.jsxs)(L.Fragment,{children:[r,i?(0,L.jsx)(pw,{__scopeSelect:t}):null]})})},"Select"),zb="SelectTrigger",Wb=E.forwardRef(U(function(e,t){let{__scopeSelect:r,disabled:n=!1,...i}=e,o=ga(r),a=Pt(zb,r),s=a.disabled||n,l=Y(t,a.onTriggerChange),u=ei(r),c=E.useRef("touch"),[d,p,m]=xa(h=>{let g=u().filter(x=>!x.disabled),y=g.find(x=>x.value===a.value),v=ba(g,h,y);v!==void 0&&a.onUserSelect(v.value)}),f=U(h=>{s||(a.onOpenChange(!0),m()),h&&(a.triggerPointerDownPosRef.current={x:Math.round(h.pageX),y:Math.round(h.pageY)})},"handleOpen");return(0,L.jsx)(kx,{asChild:!0,...o,children:(0,L.jsx)(oe.button,{type:"button",role:"combobox","aria-controls":a.open?a.contentId:void 0,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:s,"data-disabled":s?"":void 0,"data-placeholder":Ur(a.value)?"":void 0,...i,ref:l,onClick:X(i.onClick,h=>{h.currentTarget.focus(),c.current!=="mouse"&&f(h)}),onPointerDown:X(i.onPointerDown,h=>{c.current=h.pointerType;let g=h.target;g.hasPointerCapture(h.pointerId)&&g.releasePointerCapture(h.pointerId),h.button===0&&h.ctrlKey===!1&&h.pointerType==="mouse"&&(f(h),h.preventDefault())}),onKeyDown:X(i.onKeyDown,h=>{let g=d.current!=="";!(h.ctrlKey||h.altKey||h.metaKey)&&h.key.length===1&&(a.hasConsumerStoppedPropagationRef.current=h.isPropagationStopped(),p(h.key)),!(g&&h.key===" ")&&Ib.includes(h.key)&&(f(),h.preventDefault())})})})},"SelectTrigger")),Ub="SelectValue",Hb=E.forwardRef(U(function(e,t){let{__scopeSelect:r,className:n,style:i,children:o,placeholder:a="",...s}=e,l=Pt(Ub,r),{onValueNodeHasChildrenChange:u}=l,c=o!==void 0,d=Y(t,l.onValueNodeChange);ee(()=>{u(c)},[u,c]);let p=Ur(l.value);return(0,L.jsx)(oe.span,{...s,asChild:p?!1:s.asChild,ref:d,style:{pointerEvents:"none"},children:(0,L.jsx)(E.Fragment,{children:p?a:o},p?"placeholder":"value")})},"SelectValue")),$b=E.forwardRef(U(function(e,t){let{__scopeSelect:r,children:n,...i}=e;return(0,L.jsx)(oe.span,{"aria-hidden":!0,...i,ref:t,children:n||"\u25BC"})},"SelectIcon")),qb="SelectPortal",[Kb,Gb]=Ht(qb,{forceMount:void 0}),Yb=U(e=>{let{__scopeSelect:t,forceMount:r,...n}=e;return(0,L.jsx)(Kb,{scope:e.__scopeSelect,forceMount:r,children:(0,L.jsx)(Bx,{asChild:!0,...n})})},"SelectPortal"),$t="SelectContent",Xb=E.forwardRef(U(function(e,t){let r=Gb($t,e.__scopeSelect),{forceMount:n=r.forceMount,...i}=e,o=Pt($t,e.__scopeSelect),[a,s]=E.useState();return ee(()=>{s(new DocumentFragment)},[]),(0,L.jsx)(ss,{present:n||o.open,children:({present:l})=>l?(0,L.jsx)(Jb,{...i,ref:t}):(0,L.jsx)(Zb,{...i,fragment:a})})},"SelectContent")),Zb=E.forwardRef(U(function(e,t){let{__scopeSelect:r,children:n,fragment:i}=e;return i?Iu.createPortal((0,L.jsx)(qd,{scope:r,children:(0,L.jsx)(Jn.Slot,{scope:r,children:(0,L.jsx)("div",{ref:t,children:n})})}),i):null},"SelectContentFragment")),He=10,[qd,qt]=Ht($t),Qb=Et("SelectContent.RemoveScroll"),Jb=E.forwardRef(U(function(e,t){let{__scopeSelect:r}=e,{position:n=Hd.ItemAligned,onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:a,side:s,sideOffset:l,align:u,alignOffset:c,arrowPadding:d,collisionBoundary:p,collisionPadding:m,sticky:f,hideWhenDetached:h,avoidCollisions:g,...y}=e,v=Pt($t,r),[x,w]=E.useState(null),[b,S]=E.useState(null),C=Y(t,w),[P,T]=E.useState(null),[_,R]=E.useState(null),k=ei(r),[I,O]=E.useState(!1),B=E.useRef(!1),N=E.useRef(!1),V=E.useRef(!1);E.useEffect(()=>{if(x)return $x(x)},[x]),qo();let M=E.useCallback(F=>{let[G,...$]=k().map(ye=>ye.ref.current),[H]=$.slice(-1),Q=document.activeElement;for(let ye of F)if(ye===Q||(ye?.scrollIntoView({block:"nearest"}),ye===G&&b&&(b.scrollTop=0),ye===H&&b&&(b.scrollTop=b.scrollHeight),ye?.focus(),document.activeElement!==Q))return},[k,b]),D=E.useCallback(()=>M([P,x]),[M,P,x]);E.useEffect(()=>{I&&D()},[I,D]);let{onOpenChange:j,triggerPointerDownPosRef:J}=v;E.useEffect(()=>{if(x){let F={x:0,y:0},G=U(H=>{F={x:Math.abs(Math.round(H.pageX)-(J.current?.x??0)),y:Math.abs(Math.round(H.pageY)-(J.current?.y??0))}},"handlePointerMove"),$=U(H=>{F.x<=10&&F.y<=10?H.preventDefault():H.composedPath().includes(x)||j(!1),document.removeEventListener("pointermove",G),J.current=null},"handlePointerUp");return J.current!==null&&(document.addEventListener("pointermove",G),document.addEventListener("pointerup",$,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",G),document.removeEventListener("pointerup",$,{capture:!0})}}},[x,j,J]),E.useEffect(()=>{let F=U(()=>j(!1),"close");return window.addEventListener("blur",F),window.addEventListener("resize",F),()=>{window.removeEventListener("blur",F),window.removeEventListener("resize",F)}},[j]);let[je,Kt]=xa(F=>{let G=k().filter(Q=>!Q.disabled),$=G.find(Q=>Q.ref.current===document.activeElement),H=ba(G,F,$);H&&setTimeout(()=>H.ref.current?.focus())}),it=E.useCallback((F,G,$)=>{let H=!N.current;H&&(N.current=!0);let Q=!B.current&&!$;v.value!==void 0&&v.value===G||Q?(T(F),Q&&(B.current=!0)):H&&T(F)},[v.value]),_t=E.useCallback(()=>x?.focus(),[x]),le=E.useCallback((F,G,$)=>{if(!F)return;let H=!V.current;H&&(V.current=!0);let Q=!B.current&&!$;(v.value!==void 0&&v.value===G||Q||H)&&R(F)},[v.value]),Ae=n===Hd.Popper?Kd:ew,Me=Ae===Kd?{side:s,sideOffset:l,align:u,alignOffset:c,arrowPadding:d,collisionBoundary:p,collisionPadding:m,sticky:f,hideWhenDetached:h,avoidCollisions:g}:{};return(0,L.jsx)(qd,{scope:r,content:x,viewport:b,onViewportChange:S,itemRefCallback:it,selectedItem:P,onItemLeave:_t,itemTextRefCallback:le,focusSelectedItem:D,selectedItemText:_,position:n,isPositioned:I,searchRef:je,children:(0,L.jsx)(Db,{as:Qb,allowPinchZoom:!0,children:(0,L.jsx)(f0,{asChild:!0,trapped:v.open,onMountAutoFocus:F=>{F.preventDefault()},onUnmountAutoFocus:X(i,F=>{v.trigger?.focus({preventScroll:!0}),F.preventDefault()}),children:(0,L.jsx)(s0,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:F=>F.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:(0,L.jsx)(Ae,{role:"listbox",id:v.contentId,"data-state":v.open?"open":"closed",dir:v.dir,onContextMenu:F=>F.preventDefault(),...y,...Me,onPlaced:()=>O(!0),ref:C,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:X(y.onKeyDown,F=>{let G=F.ctrlKey||F.altKey||F.metaKey;if(F.key==="Tab"&&F.preventDefault(),!G&&F.key.length===1&&Kt(F.key),["ArrowUp","ArrowDown","Home","End"].includes(F.key)){let $=k().filter(H=>!H.disabled).map(H=>H.ref.current);if(["ArrowUp","End"].includes(F.key)&&($=$.slice().reverse()),["ArrowUp","ArrowDown"].includes(F.key)){let H=F.target,Q=$.indexOf(H);$=$.slice(Q+1)}setTimeout(()=>M($)),F.preventDefault()}})})})})})})},"SelectContentImpl")),ew=E.forwardRef(U(function(e,t){let{__scopeSelect:r,onPlaced:n,...i}=e,o=Pt($t,r),a=qt($t,r),[s,l]=E.useState(null),[u,c]=E.useState(null),d=Y(t,c),p=ei(r),m=E.useRef(!1),f=E.useRef(!0),{viewport:h,selectedItem:g,selectedItemText:y,focusSelectedItem:v}=a,x=E.useCallback(()=>{if(o.trigger&&o.valueNode&&s&&u&&h&&g&&y){let C=o.trigger.getBoundingClientRect(),P=u.getBoundingClientRect(),T=o.valueNode.getBoundingClientRect(),_=y.getBoundingClientRect();if(o.dir!==Ob.RTL){let G=_.left-P.left,$=T.left-G,H=C.left-$,Q=C.width+H,ye=Math.max(Q,P.width),Sa=window.innerWidth-He,Ca=Bo($,[He,Math.max(He,Sa-ye)]);s.style.minWidth=Q+"px",s.style.left=Ca+"px"}else{let G=P.right-_.right,$=window.innerWidth-T.right-G,H=window.innerWidth-C.right-$,Q=C.width+H,ye=Math.max(Q,P.width),Sa=window.innerWidth-He,Ca=Bo($,[He,Math.max(He,Sa-ye)]);s.style.minWidth=Q+"px",s.style.right=Ca+"px"}let R=p(),k=window.innerHeight-He*2,I=h.scrollHeight,O=window.getComputedStyle(u),B=parseInt(O.borderTopWidth,10),N=parseInt(O.paddingTop,10),V=parseInt(O.borderBottomWidth,10),M=parseInt(O.paddingBottom,10),D=B+N+I+M+V,j=Math.min(g.offsetHeight*5,D),J=window.getComputedStyle(h),je=parseInt(J.paddingTop,10),Kt=parseInt(J.paddingBottom,10),it=C.top+C.height/2-He,_t=k-it,le=g.offsetHeight/2,Ae=g.offsetTop+le,Me=B+N+Ae,F=D-Me;if(Me<=it){let G=R.length>0&&g===R[R.length-1].ref.current;s.style.bottom="0px";let $=u.clientHeight-h.offsetTop-h.offsetHeight,H=Math.max(_t,le+(G?Kt:0)+$+V),Q=Me+H;s.style.height=Q+"px"}else{let G=R.length>0&&g===R[0].ref.current;s.style.top="0px";let $=Math.max(it,B+h.offsetTop+(G?je:0)+le)+F;s.style.height=$+"px",h.scrollTop=Me-it+h.offsetTop}s.style.margin=`${He}px 0`,s.style.minHeight=j+"px",s.style.maxHeight=k+"px",n?.(),requestAnimationFrame(()=>m.current=!0)}},[p,o.trigger,o.valueNode,s,u,h,g,y,o.dir,n]);ee(()=>x(),[x]);let[w,b]=E.useState();ee(()=>{u&&b(window.getComputedStyle(u).zIndex)},[u]);let S=E.useCallback(C=>{C&&f.current===!0&&(x(),v?.(),f.current=!1)},[x,v]);return(0,L.jsx)(tw,{scope:r,contentWrapper:s,shouldExpandOnScrollRef:m,onScrollButtonChange:S,children:(0,L.jsx)("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:w},children:(0,L.jsx)(oe.div,{...i,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})},"SelectItemAlignedPosition")),Kd=E.forwardRef(U(function(e,t){let{__scopeSelect:r,align:n="start",collisionPadding:i=He,...o}=e,a=ga(r);return(0,L.jsx)(Ix,{...a,...o,ref:t,align:n,collisionPadding:i,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})},"SelectPopperPosition")),[tw,va]=Ht($t,{}),Gd="SelectViewport",rw=E.forwardRef(U(function(e,t){let{__scopeSelect:r,nonce:n,...i}=e,o=qt(Gd,r),a=va(Gd,r),s=Y(t,o.onViewportChange),l=E.useRef(0);return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),(0,L.jsx)(Jn.Slot,{scope:r,children:(0,L.jsx)(oe.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:s,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:X(i.onScroll,u=>{let c=u.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:p}=a;if(p?.current&&d){let m=Math.abs(l.current-c.scrollTop);if(m>0){let f=window.innerHeight-He*2,h=parseFloat(d.style.minHeight),g=parseFloat(d.style.height),y=Math.max(h,g);if(y<f){let v=y+m,x=Math.min(f,v),w=v-x;d.style.height=x+"px",d.style.bottom==="0px"&&(c.scrollTop=w>0?w:0,d.style.justifyContent="flex-end")}}}l.current=c.scrollTop})})})]})},"SelectViewport")),nw="SelectGroup",[Mw,Dw]=Ht(nw),ya="SelectItem",[iw,Yd]=Ht(ya),ow=E.forwardRef(U(function(e,t){let{__scopeSelect:r,value:n,disabled:i=!1,textValue:o,...a}=e,s=Pt(ya,r),l=qt(ya,r),u=s.value===n,[c,d]=E.useState(o??""),[p,m]=E.useState(!1),f=Qe(x=>l.itemRefCallback?.(x,n,i)),h=Y(t,f),g=xr(),y=E.useRef("touch");function v(x){s.hasConsumerStoppedPropagationRef.current=x.isPropagationStopped(),s.onUserSelect(n),s.onOpenChange(!1)}return U(v,"handleSelect"),(0,L.jsx)(iw,{scope:r,value:n,disabled:i,textId:g,isSelected:u,onItemTextChange:E.useCallback(x=>{d(w=>w||(x?.textContent??"").trim())},[]),children:(0,L.jsx)(Jn.ItemSlot,{scope:r,value:n,disabled:i,textValue:c,children:(0,L.jsx)(oe.div,{role:"option","aria-labelledby":g,"data-highlighted":p?"":void 0,"aria-selected":u&&p,"data-state":u?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...a,ref:h,onFocus:X(a.onFocus,()=>m(!0)),onBlur:X(a.onBlur,()=>m(!1)),onClick:X(a.onClick,x=>{i||y.current!=="mouse"&&v(x)}),onPointerUp:X(a.onPointerUp,x=>{i||y.current==="mouse"&&v(x)}),onPointerDown:X(a.onPointerDown,x=>{y.current=x.pointerType}),onPointerMove:X(a.onPointerMove,x=>{y.current=x.pointerType,i?l.onItemLeave?.():y.current==="mouse"&&x.currentTarget.focus({preventScroll:!0})}),onPointerLeave:X(a.onPointerLeave,x=>{x.currentTarget===document.activeElement&&l.onItemLeave?.()}),onKeyDown:X(a.onKeyDown,x=>{i||x.target!==x.currentTarget||l.searchRef?.current!==""&&x.key===" "||(Vb.includes(x.key)&&v(x),x.key===" "&&x.preventDefault())})})})})},"SelectItem")),ti="SelectItemText",aw=E.forwardRef(U(function(e,t){let{__scopeSelect:r,className:n,style:i,...o}=e,a=Pt(ti,r),s=qt(ti,r),l=Yd(ti,r),u=Fb(ti,r),[c,d]=E.useState(null),p=Qe(v=>s.itemTextRefCallback?.(v,l.value,l.disabled)),m=Y(t,d,l.onItemTextChange,p),f=c?.textContent,h=E.useMemo(()=>(0,L.jsx)("option",{value:l.value,disabled:l.disabled,children:f},l.value),[l.disabled,l.value,f]),{onNativeOptionAdd:g,onNativeOptionRemove:y}=u;return ee(()=>(g(h),()=>y(h)),[g,y,h]),(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(oe.span,{id:l.textId,...o,ref:m}),l.isSelected&&a.valueNode&&!a.valueNodeHasChildren&&!Ur(a.value)?Iu.createPortal(o.children,a.valueNode):null]})},"SelectItemText")),sw="SelectItemIndicator",lw=E.forwardRef(U(function(e,t){let{__scopeSelect:r,...n}=e;return Yd(sw,r).isSelected?(0,L.jsx)(oe.span,{"aria-hidden":!0,...n,ref:t}):null},"SelectItemIndicator")),Xd="SelectScrollUpButton",cw=E.forwardRef(U(function(e,t){let r=qt(Xd,e.__scopeSelect),n=va(Xd,e.__scopeSelect),[i,o]=E.useState(!1),a=Y(t,n.onScrollButtonChange);return ee(()=>{if(r.viewport&&r.isPositioned){let l=function(){let c=u.scrollTop>0;o(c)};var s=l;U(l,"handleScroll");let u=r.viewport;return l(),u.addEventListener("scroll",l),()=>u.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),i?(0,L.jsx)(Qd,{...e,ref:a,onAutoScroll:()=>{let{viewport:s,selectedItem:l}=r;s&&l&&(s.scrollTop=s.scrollTop-l.offsetHeight)}}):null},"SelectScrollUpButton")),Zd="SelectScrollDownButton",uw=E.forwardRef(U(function(e,t){let r=qt(Zd,e.__scopeSelect),n=va(Zd,e.__scopeSelect),[i,o]=E.useState(!1),a=Y(t,n.onScrollButtonChange);return ee(()=>{if(r.viewport&&r.isPositioned){let l=function(){let c=u.scrollHeight-u.clientHeight,d=Math.ceil(u.scrollTop)<c;o(d)};var s=l;U(l,"handleScroll");let u=r.viewport;return l(),u.addEventListener("scroll",l),()=>u.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),i?(0,L.jsx)(Qd,{...e,ref:a,onAutoScroll:()=>{let{viewport:s,selectedItem:l}=r;s&&l&&(s.scrollTop=s.scrollTop+l.offsetHeight)}}):null},"SelectScrollDownButton")),Qd=E.forwardRef(U(function(e,t){let{__scopeSelect:r,onAutoScroll:n,...i}=e,o=qt("SelectScrollButton",r),a=E.useRef(null),s=ei(r),l=E.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return E.useEffect(()=>()=>l(),[l]),ee(()=>{s().find(u=>u.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[s]),(0,L.jsx)(oe.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:X(i.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(n,50))}),onPointerMove:X(i.onPointerMove,()=>{o.onItemLeave?.(),a.current===null&&(a.current=window.setInterval(n,50))}),onPointerLeave:X(i.onPointerLeave,()=>{l()})})},"SelectScrollButtonImpl")),dw="SelectBubbleInput",pw=E.forwardRef(U(function({__scopeSelect:e,...t},r){let n=Pt(dw,e),{value:i,onValueChange:o,required:a,disabled:s,name:l,autoComplete:u,form:c,userSelection:d}=n,{nativeOptions:p,nativeSelectKey:m}=n,f=E.useRef(null),h=Y(r,f),g=i??"",y=E.useRef(g),v=E.useRef(d),x=E.useRef(!1),w=Array.from(p).some(b=>(b.props.value??"")==="");return E.useEffect(()=>{let b=f.current;if(!b)return;let S=window.HTMLSelectElement.prototype,C=Object.getOwnPropertyDescriptor(S,"value").set,P=d!==null&&d!==v.current;v.current=d;let T=y.current!==g;y.current=g;let _=P&&T;if(P&&!T&&d.value!==g&&!d.hasConsumerStoppedPropagation&&C){x.current=!0;try{C.call(b,d.value),b.dispatchEvent(new Event("change",{bubbles:!0}))}finally{x.current=!1,C.call(b,g)}return}let R=_&&!d.hasConsumerStoppedPropagation;if(T&&C){let k=new Event("change",{bubbles:R});C.call(b,g),b.dispatchEvent(k)}},[g,d]),(0,L.jsxs)(oe.select,{"aria-hidden":!0,required:a,tabIndex:-1,name:l,autoComplete:u,disabled:s,form:c,onChange:b=>{x.current||o(b.target.value)},...t,style:{...zx,...t.style},ref:h,defaultValue:g,children:[Ur(i)&&!w?(0,L.jsx)("option",{value:""}):null,Array.from(p)]},m)},"SelectBubbleInput"));function Jd(e){return typeof e=="function"}U(Jd,"isFunction");function Ur(e){return e===""||e===void 0}U(Ur,"shouldShowPlaceholder");function xa(e){let t=Qe(e),r=E.useRef(""),n=E.useRef(0),i=E.useCallback(a=>{let s=r.current+a;t(s);function l(u){r.current=u,window.clearTimeout(n.current),u!==""&&(n.current=window.setTimeout(()=>l(""),1e3))}U(l,"updateSearch"),l(s)},[t]),o=E.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return E.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,i,o]}U(xa,"useTypeaheadSearch");function ba(e,t,r){let n=t.length>1&&Array.from(t).every(s=>s===t[0])?t[0]:t,i=r?e.indexOf(r):-1,o=ep(e,Math.max(i,0));n.length===1&&(o=o.filter(s=>s!==r));let a=o.find(s=>s.textValue.toLowerCase().startsWith(n.toLowerCase()));return a!==r?a:void 0}U(ba,"findNextItem");function ep(e,t){return e.map((r,n)=>e[(t+n)%e.length])}U(ep,"wrapArray");var Le={field:"tapd_arc_select_field",trigger:"tapd_arc_select_trigger",valueText:"tapd_arc_select_valueText",rollingValue:"tapd_arc_select_rollingValue",chevron:"tapd_arc_select_chevron",hint:"tapd_arc_select_hint",content:"tapd_arc_select_content","select-in":"tapd_arc_select_select-in","select-out":"tapd_arc_select_select-out",viewport:"tapd_arc_select_viewport",item:"tapd_arc_select_item",indicator:"tapd_arc_select_indicator","indicator-in":"tapd_arc_select_indicator-in",scrollButton:"tapd_arc_select_scrollButton","select-fade":"tapd_arc_select_select-fade","select-fade-out":"tapd_arc_select_select-fade-out"},re=require("react/jsx-runtime"),hw={enter:e=>({opacity:0,y:`${e*.35}em`,filter:`blur(${W.blur.soft}px)`}),center:{opacity:1,y:0,filter:"blur(0px)",transition:{duration:W.duration.standard,ease:[...W.ease.enter]}}},fw={enter:{opacity:0},center:{opacity:1,y:0,filter:"blur(0px)",transition:{duration:W.duration.instant}}},mw=(0,Bt.forwardRef)(function({label:e,description:t,placeholder:r="Select an option",options:n,id:i,className:o,disabled:a,onValueChange:s,"aria-label":l,"aria-labelledby":u,"aria-describedby":c,"aria-invalid":d,style:p,...m},f){let h=(0,Bt.useId)(),g=i??h,y=e?`${g}-arc-label`:void 0,v=t?`${g}-description`:void 0,x=Nr(),w=(0,Bt.useRef)(!1);(0,Bt.useEffect)(()=>{w.current=!0},[]);let[b,S]=(0,Bt.useState)(m.defaultValue??""),C=m.value??b,P=n.findIndex(O=>O.value===C),T=n[P]?.label??r,[_,R]=(0,Bt.useState)(P),[k,I]=(0,Bt.useState)(1);return _!==P&&(R(P),I(P>_?1:-1)),(0,re.jsxs)("div",{className:Le.field,"data-tavlo-tapd-arc-ui":"",children:[e&&(0,re.jsx)("label",{id:y,htmlFor:g,children:e}),(0,re.jsxs)(Bb,{...m,disabled:a,onValueChange:O=>{S(O),s?.(O)},children:[(0,re.jsxs)(Wb,{ref:f,id:g,"aria-label":l,"aria-labelledby":u??y,"aria-describedby":[c,v].filter(Boolean).join(" ")||void 0,"aria-invalid":d,style:p,className:[Le.trigger,o].filter(Boolean).join(" "),children:[(0,re.jsx)("span",{className:Le.valueText,children:(0,re.jsx)(Hb,{placeholder:r,children:(0,re.jsx)(lt.span,{className:Le.rollingValue,custom:k,variants:x?fw:hw,initial:w.current?"enter":!1,animate:"center",children:T},C)})}),(0,re.jsx)($b,{className:Le.chevron,children:(0,re.jsx)(xi,{size:16,strokeWidth:1.75,"aria-hidden":"true"})})]}),(0,re.jsx)(Yb,{children:(0,re.jsxs)(Xb,{className:Le.content,"data-tavlo-tapd-arc-ui":"","aria-label":l,"aria-labelledby":u??y,position:"popper",sideOffset:4,collisionPadding:12,children:[(0,re.jsx)(cw,{className:Le.scrollButton,children:(0,re.jsx)(Dh,{size:16,strokeWidth:1.75,"aria-hidden":"true"})}),(0,re.jsx)(rw,{className:Le.viewport,children:n.map(O=>(0,re.jsxs)(ow,{value:O.value,disabled:O.disabled,className:Le.item,children:[(0,re.jsx)(aw,{children:O.label}),(0,re.jsx)(lw,{className:Le.indicator,children:(0,re.jsx)(Eh,{size:16,strokeWidth:1.75,"aria-hidden":"true"})})]},O.value))}),(0,re.jsx)(uw,{className:Le.scrollButton,children:(0,re.jsx)(xi,{size:16,strokeWidth:1.75,"aria-hidden":"true"})})]})})]}),t&&(0,re.jsx)("span",{id:v,className:Le.hint,children:t})]})}),vr=require("react"),nt={field:"tapd_arc_input_field",label:"tapd_arc_input_label",input:"tapd_arc_input_input",messageSlot:"tapd_arc_input_messageSlot",description:"tapd_arc_input_description",error:"tapd_arc_input_error",words:"tapd_arc_input_words",word:"tapd_arc_input_word",column:"tapd_arc_input_column",srOnly:"tapd_arc_input_srOnly"},ne=require("react/jsx-runtime"),gw={enter:e=>({opacity:0,y:`${e*.6}em`,filter:`blur(${W.blur.subtle}px)`}),center:{opacity:1,y:0,filter:"blur(0px)"},exit:e=>({opacity:0,y:`${e*-.6}em`,filter:`blur(${W.blur.subtle}px)`})},tp=e=>/^\d[\d.,/:]*%?$/.test(e);function vw({word:e}){let t=Nr(),[r,n]=(0,vr.useState)({word:e,direction:1});r.word!==e&&n({word:e,direction:parseFloat(e.replace(/,/g,""))<parseFloat(r.word.replace(/,/g,""))?-1:1});let i=e.split(""),o=t?{duration:0}:{y:W.spring.snappy,width:W.spring.morph,opacity:{duration:W.duration.fast},filter:{duration:W.duration.fast}};return(0,ne.jsx)(Rn,{initial:!1,children:i.map((a,s)=>(0,ne.jsx)(lt.span,{className:nt.column,initial:{width:0,opacity:0},animate:{width:"auto",opacity:1},exit:{width:0,opacity:0},transition:o,children:(0,ne.jsx)(Rn,{initial:!1,mode:"popLayout",custom:r.direction,children:(0,ne.jsx)(lt.span,{custom:r.direction,variants:gw,initial:"enter",animate:"center",exit:"exit",transition:o,children:a},a)})},i.length-s))})}function yw({text:e}){let t=Nr(),r=e.split(" ");return(0,ne.jsxs)(ne.Fragment,{children:[(0,ne.jsx)("span",{className:nt.srOnly,children:e}),(0,ne.jsx)("span",{className:nt.words,"aria-hidden":"true",children:(0,ne.jsx)(Rn,{initial:!1,mode:"popLayout",children:r.map((n,i)=>(0,ne.jsxs)(lt.span,{className:nt.word,initial:t?{opacity:0}:{opacity:0,y:"0.35em",filter:`blur(${W.blur.soft}px)`},animate:{opacity:1,y:0,filter:"blur(0px)"},exit:t?{opacity:0,transition:{duration:0}}:{opacity:0,y:"-0.35em",filter:`blur(${W.blur.subtle}px)`,transition:{duration:W.duration.exit,ease:[...W.ease.standard]}},transition:t?{duration:W.duration.instant}:{duration:W.duration.standard,ease:[...W.ease.enter]},children:[tp(n)?(0,ne.jsx)(vw,{word:n}):n,i<r.length-1?" ":null]},`${i}:${tp(n)?"#":n}`))})})]})}function rp({id:e,text:t,className:r,alert:n}){return(0,ne.jsx)(Rn,{initial:!1,children:t?(0,ne.jsx)(xw,{id:e,text:t,className:r,alert:n},"message"):null})}function xw({id:e,text:t,className:r,alert:n}){let i=Nr(),o=(0,vr.useRef)(null),[a,s]=(0,vr.useState)("auto");return(0,vr.useEffect)(()=>{let l=o.current;if(!l||typeof ResizeObserver>"u")return;let u=new ResizeObserver(([c])=>{c&&s(c.borderBoxSize?.[0]?.blockSize??l.offsetHeight)});return u.observe(l),()=>u.disconnect()},[]),(0,ne.jsx)(lt.span,{className:nt.messageSlot,initial:i?!1:{height:0,opacity:0},animate:{height:a,opacity:1},exit:{height:0,opacity:0,transition:i?{duration:0}:{height:W.spring.smooth,opacity:{duration:W.duration.instant}}},transition:i?{duration:0}:{height:W.spring.smooth,opacity:{duration:W.duration.fast}},children:(0,ne.jsx)(lt.span,{ref:o,id:e,className:r,role:n?"alert":void 0,initial:i?!1:{y:"0.35em",filter:`blur(${W.blur.soft}px)`},animate:{y:0,filter:"blur(0px)"},transition:{duration:i?0:W.duration.standard,ease:[...W.ease.enter]},children:(0,ne.jsx)(yw,{text:t})})})}var np=(0,vr.forwardRef)(function({label:e,description:t,error:r,id:n,className:i,...o},a){let s=(0,vr.useId)(),l=n??s,u=t?`${l}-description`:void 0,c=r?`${l}-error`:void 0,d=[o["aria-describedby"],u,c].filter(Boolean).join(" ")||void 0;return(0,ne.jsxs)("div",{className:nt.field,"data-tavlo-tapd-arc-ui":"",children:[e&&(0,ne.jsx)("label",{className:nt.label,htmlFor:l,children:e}),(0,ne.jsx)("input",{...o,id:l,ref:a,className:[nt.input,i].filter(Boolean).join(" "),"aria-invalid":r?!0:o["aria-invalid"],"aria-describedby":d}),(0,ne.jsx)(rp,{id:u,text:t,className:nt.description}),(0,ne.jsx)(rp,{id:c,text:r,className:nt.error,alert:!0})]})});np.displayName="Input";var wa=require("react/jsx-runtime");function bw(){return(0,wa.jsx)("style",{"data-tavlo-tapd-arc-styles":"",children:ip})}var ww=(0,hp.forwardRef)(function({choices:e,value:t,defaultValue:r,onChange:n,...i},o){let a=new Set(e.map(([u])=>u)),s="";if(a.has(""))for(s="__tavlo_tapd_blank__";a.has(s)||s===t||s===r;)s+="_";let l=e.map(([u,c,d])=>({value:u||s,label:c,disabled:d}));return(0,wa.jsx)(mw,{...i,ref:o,options:l,value:t===""?s:t,defaultValue:r===""?s:r,onValueChange:u=>n?.(u===s?"":u)})});function Sw({title:e,annotation:t,defaultOpen:r=!1,children:n}){return(0,wa.jsx)(Qy,{defaultOpen:r?0:-1,items:[{title:e,annotation:t,content:n}]})}return Pa.exports})();
116
+ const TAPD_DOCS = 'https://open.tapd.cn/document/api-doc/API文档/'
117
+ const BASIC_GUIDE = `${TAPD_DOCS}API配置指引.html`
118
+ const API_GUIDE = `${TAPD_DOCS}使用必读.html`
119
+ const SUPPORT = 'https://www.tapd.cn/official/support'
120
+ const TOKEN_SETTINGS = 'https://www.tapd.cn/personal_settings/index?tab=personal_token'
121
+ const TOKEN_GUIDE = 'https://www.tapd.cn/help/show#1120003271001001183'
122
+ const PACKAGE = '@tavlo-dsh/dsh-plugin-tapd'
123
+ const SLOT = 'plugins.bundle.config'
124
+ const NS = 'tavlo-tapd-settings'
125
+ const MAX_PROJECTS = 20
126
+
127
+ const en = {
128
+ title: 'TAPD sync settings',
129
+ description: 'Bring TAPD work items into your task board. Nothing is sent back to TAPD.',
130
+ connectionStep: 'Connect to TAPD', projectsStep: 'Choose what to sync', rangeStep: 'Sync limits',
131
+ projectCount: '{count} selected', configuredConnection: 'Credentials available',
132
+ rangeSummary: 'By last update',
133
+ noneSelected: 'No statuses selected',
134
+ storyCount: 'Story statuses: {count}', taskCount: 'Task statuses: {count}',
135
+ projectLinkPlaceholder: 'https://www.tapd.cn/12345678/…',
136
+ visualCredentials: 'Saved credentials', refs: 'Host credential references', none: 'Credentials not configured',
137
+ syncState: 'Sync status', disabled: 'Disabled', waiting: 'Waiting for the Tavlo task board', ready: 'Task board connected',
138
+ enabled: 'Enable TAPD sync', owner: 'TAPD assignee nickname',
139
+ projects: 'TAPD projects', noProjects: 'No projects configured.',
140
+ projectsHint: 'Select the statuses to sync for each project. Leave a work item type empty to skip it.',
141
+ searchingProjects: 'Loading TAPD projects… You can enter a project ID without waiting.',
142
+ tokenProjectHelp: 'Enter a personal access token, then choose Add project. No project ID or link is needed.',
143
+ allProjectsAdded: 'All projects returned by TAPD are already selected.',
144
+ projectAlternatives: 'Project lookup alternatives', addManually: 'Add manually',
145
+ useProjectLink: 'Add from a link',
146
+ linkedProjectNick: 'To look up a company from a link with a personal token, enter the token owner’s TAPD nickname.',
147
+ currentUserUnavailable: 'TAPD did not identify the current user for this token. Check the token’s access or try a project link.',
148
+ automaticContext: 'TAPD rejected the project lookup without a company. Try a project link to identify the company.',
149
+ discoveryContext: 'For a company API account, add a project link under Project lookup alternatives if no company has been configured.',
150
+ discoveryLink: 'TAPD project or work item link', discoveryLinkHint: 'Use only if automatic lookup fails or you need to choose a company. Only the project ID is saved.',
151
+ discoveryLinkInvalid: 'Use a TAPD HTTPS link with a numeric project ID, or leave it blank.',
152
+ companyProjectScope: 'This is the TAPD company’s project list. Access to a project’s work items is checked separately.',
153
+ projectsEmpty: 'TAPD returned no projects for these credentials. Check project access or enter a project ID manually.',
154
+ projectsPermission: 'These credentials can’t list TAPD projects. Ask your TAPD administrator about listing access, or enter a project ID manually.',
155
+ projectsUnavailable: 'Could not load TAPD projects. Retry, or enter a project ID manually.',
156
+ projectsPartial: 'Only part of the TAPD project list is available. Try refreshing or enter an unlisted project ID manually.',
157
+ discoveryMissingCredentials: 'Set up TAPD credentials or Host references for the selected authentication method, then retry.',
158
+ discoveryRejected: 'TAPD rejected these credentials. Check the authentication method and replace an invalid or expired credential, then retry.',
159
+ discoveryThrottled: 'TAPD is limiting requests. Wait a moment and try again.',
160
+ projectSearch: 'Search TAPD projects by name', chooseProject: 'TAPD project', chooseProjectPlaceholder: 'Choose a project',
161
+ noProjectMatches: 'No projects match this search.', projectNamed: '{name} ({id})', savedProjectId: 'Current project ID ({id})',
162
+ manualProject: 'Enter a project ID manually', manualProjectHint: 'Open the project in TAPD and click its name in the upper-left to find the project ID.',
163
+ projectNameUnavailable: 'TAPD did not return the project name. You can still use the project ID.',
164
+ loadStatuses: 'Load status options', refreshStatuses: 'Reload statuses', loadingStatuses: 'Loading TAPD statuses…',
165
+ statusesHint: 'Load the statuses from TAPD, then check the names you want to sync.',
166
+ statusesUnavailable: 'Could not read TAPD statuses. Check that the project still exists and is accessible, then retry.',
167
+ statusesPermission: 'These credentials can’t read statuses for this project. Check your TAPD project access or ask your administrator.',
168
+ statusesPartial: 'TAPD returned only some of the statuses. You can still use the options shown.',
169
+ statusNetwork: 'Could not reach TAPD. Check the Host’s internet connection and try again.',
170
+ statusTimeout: 'TAPD took too long to respond. Try again in a moment.',
171
+ statusUnsupported: 'TAPD did not return a usable status list. Check whether this project exposes its statuses through the API.',
172
+ statusesEmpty: 'TAPD returned no status options.',
173
+ standardTaskHint: 'The project’s task status list could not be verified. These are TAPD’s standard options; selecting them does not confirm task access.',
174
+ standardTaskOpen: 'Not started', standardTaskProgressing: 'In progress', standardTaskDone: 'Completed',
175
+ storiesChoices: 'Story statuses', tasksChoices: 'Task statuses', statusNamed: '{label} ({key})',
176
+ retainedStatuses: '{count} other selected statuses are not listed and will be kept.', removeUnavailableStatuses: 'Deselect unlisted statuses',
177
+ guide: 'How to get TAPD credentials', basicGuide: 'Official TAPD API setup guide', applyGuide: 'Official TAPD API access instructions',
178
+ basicStep: 'A TAPD Enterprise company administrator can request API access in 公司管理 → 开放集成 → API账号管理 (Company Management → Open Integration → API Account Management).',
179
+ basicCopy: 'Enter the issued API account (api_user) and API password (api_password) in the Basic fields, not your TAPD login or password.',
180
+ tokenStep: 'Sign in to TAPD and go to 我的 → 个人访问令牌 (My → Personal Access Tokens). Generate a token with read access to the projects you need, then paste just the token (without “Bearer”) into this settings page, not into a chat. If the option is missing, ask your TAPD administrator or use Basic authentication.',
181
+ supportGuide: 'Official TAPD support', tokenDocs: 'Official TAPD personal token instructions', openTokenSettings: 'Open TAPD personal access token settings',
182
+ lookback: 'Last-updated window', unrestricted: 'No time limit', lookbackPreset: 'Last {days} days', custom: 'Custom',
183
+ lookbackDays: 'Number of days', lookbackHint: 'Each sync looks back from that round using the TAPD last-updated time in China time (UTC+8), not the creation date. It does not remove existing imports.',
184
+ lookbackInvalid: 'Enter a whole number from 1 to 365 for the custom last-updated window.',
185
+ project: 'Project {number}', workspaceId: 'TAPD project ID', targetWorkspaceId: 'DSH workspace', ungrouped: 'Ungrouped',
186
+ workspaceImpact: 'Changes apply only to new imports. Existing tasks aren’t moved, and pending imports keep their original destination.',
187
+ workspaceListUnavailable: 'The DSH workspace list is unavailable. Saved destinations are kept unless you change them to Ungrouped.',
188
+ noWorkspaces: 'No DSH workspaces are registered. New imports can use Ungrouped.',
189
+ missingWorkspace: 'Missing workspace ({id})', unverifiedWorkspace: 'Saved workspace ({id})',
190
+ missingWorkspaceHint: 'New imports for this project are paused. Choose another workspace or Ungrouped to resume.',
191
+ addProject: 'Add project', remove: 'Remove', removeProject: 'Remove project {number}',
192
+ connection: 'TAPD connection', setupConnection: 'Set up TAPD connection',
193
+ auth: 'Authentication', bearer: 'Personal access token (Bearer)', basic: 'API account and key (Basic)',
194
+ credentialsHint: 'To replace a saved credential, enter the new value and choose Save credentials. Leave blank to keep the current value.',
195
+ saveCredentials: 'Save credentials', savingCredentials: 'Saving credentials…', credentialsSaved: 'TAPD credentials saved. Other settings were not changed.',
196
+ credentialsSaveFailed: 'Could not save TAPD credentials.',
197
+ setupCredentialsHint: 'Enter your TAPD credentials and choose Save credentials, or configure credential references on the Host.',
198
+ authChangedHint: 'Leave the fields blank to use any saved credentials or Host credential references for the selected method.',
199
+ token: 'Personal access token', apiUser: 'API account', apiKey: 'API key',
200
+ useRefs: 'Discard saved credentials and use Host credential references',
201
+ useRefsHint: 'Discovery can try the references now. Saved credentials are discarded only when you save.',
202
+ advanced: 'Advanced settings', interval: 'Polling interval (seconds)', intervalHint: '30–86,400 seconds between rounds.',
203
+ maxNew: 'Maximum new items per scope', maxNewHint: '1–1,000 per project and item type. If more items match, that scope imports nothing in that round.',
204
+ loading: 'Loading TAPD settings…', save: 'Save settings', saving: 'Saving…', saved: 'TAPD settings saved.',
205
+ retry: 'Retry loading', reload: 'Reload settings and discard draft',
206
+ loadFailed: 'Could not load TAPD settings. Try again.', saveFailed: 'Could not save TAPD settings.',
207
+ saveUnconfirmed: 'Could not confirm the save. Reload to check the latest settings before saving again.',
208
+ conflict: 'These settings were changed elsewhere. Reload the current settings before saving again.',
209
+ invalidConfig: 'Check the assignee nickname, project IDs, status keys, and polling limits.',
210
+ duplicateProject: 'Each TAPD project ID can only appear once.',
211
+ missingScopes: 'Add at least one project with a story or task status key to enable sync.',
212
+ invalidCredentials: 'The replacement credentials are invalid. For Basic authentication, enter both the API account and key.',
213
+ unavailable: 'TAPD settings are unavailable on this Host.',
214
+ workspaceUnavailable: 'The selected destination can’t be assigned. Reload settings for the current workspace list, or choose Ungrouped.',
215
+ }
216
+ const zh = {
217
+ title: 'TAPD 同步设置',
218
+ description: '把 TAPD 的需求和任务导入你的任务看板。不回写 TAPD。',
219
+ connectionStep: '连接 TAPD', projectsStep: '选择同步项目', rangeStep: '设置同步范围',
220
+ projectCount: '已选 {count} 个', configuredConnection: '凭据就绪',
221
+ rangeSummary: '按最后更新时间',
222
+ noneSelected: '未选择状态',
223
+ storyCount: '{count} 个需求状态', taskCount: '{count} 个任务状态',
224
+ projectLinkPlaceholder: 'https://www.tapd.cn/12345678/…',
225
+ visualCredentials: '已保存凭据', refs: 'Host 凭据引用', none: '尚未配置凭据',
226
+ syncState: '同步状态', disabled: '未启用', waiting: '等待 Tavlo 任务看板', ready: '任务看板已连接',
227
+ enabled: '启用 TAPD 同步', owner: 'TAPD 处理人昵称',
228
+ projects: 'TAPD 项目', noProjects: '尚未配置项目。',
229
+ projectsHint: '为每个项目选择要同步的状态。某种工作项不选状态,就不同步该类型。',
230
+ searchingProjects: '正在加载 TAPD 项目…也可以直接输入项目 ID,无需等待。',
231
+ tokenProjectHelp: '填入个人访问令牌后,点「添加项目」即可尝试获取项目,不需要填 ID 或链接。',
232
+ allProjectsAdded: 'TAPD 返回的项目都已选中。',
233
+ projectAlternatives: '其他添加方式', addManually: '手动添加',
234
+ useProjectLink: '从链接添加',
235
+ linkedProjectNick: '使用个人令牌按链接查询公司项目时,请填写令牌持有人的 TAPD 昵称。',
236
+ currentUserUnavailable: 'TAPD 未能从令牌识别当前用户。请检查令牌权限,或改用项目链接。',
237
+ automaticContext: 'TAPD 未接受不指定公司的项目查询。可改用项目链接识别公司。',
238
+ discoveryContext: '使用企业 API 账号时,如果尚未配置公司,请在「其他添加方式」中补充一个 TAPD 项目链接。',
239
+ discoveryLink: 'TAPD 项目或工作项链接', discoveryLinkHint: '仅在自动获取失败或需要指定公司时填写。只保存项目 ID。',
240
+ discoveryLinkInvalid: '请输入包含数字项目 ID 的 TAPD HTTPS 链接,或留空。',
241
+ companyProjectScope: '这是 TAPD 公司项目列表,工作项读取权限由各项目另行控制。',
242
+ projectsEmpty: 'TAPD 未返回当前凭据可访问的项目。请检查项目权限,或手动输入项目 ID。',
243
+ projectsPermission: '当前凭据无权列出 TAPD 项目。请联系 TAPD 管理员确认是否有列出项目的权限,或手动输入项目 ID。',
244
+ projectsUnavailable: '无法加载 TAPD 项目。请重试,或手动输入项目 ID。',
245
+ projectsPartial: '仅获取到部分 TAPD 项目。可尝试刷新,或手动输入未列出的项目 ID。',
246
+ discoveryMissingCredentials: '请为所选认证方式配置 TAPD 凭据或 Host 凭据引用,然后重试。',
247
+ discoveryRejected: 'TAPD 拒绝了当前凭据。请确认认证方式,替换无效或过期的凭据,然后重试。',
248
+ discoveryThrottled: 'TAPD 正在限制请求频率。请稍后重试。',
249
+ projectSearch: '按名称搜索 TAPD 项目', chooseProject: 'TAPD 项目', chooseProjectPlaceholder: '选择项目',
250
+ noProjectMatches: '没有符合搜索条件的项目。', projectNamed: '{name}({id})', savedProjectId: '当前项目 ID({id})',
251
+ manualProject: '手动输入项目 ID', manualProjectHint: '在 TAPD 中打开对应项目,点击左上角的项目名称查看项目 ID。',
252
+ projectNameUnavailable: '暂时读不到 TAPD 项目名称,仍可使用项目 ID。',
253
+ loadStatuses: '读取可选状态', refreshStatuses: '重新读取状态', loadingStatuses: '正在读取 TAPD 状态…',
254
+ statusesHint: '从 TAPD 读取状态后,勾选要同步的名称。',
255
+ statusesUnavailable: '暂时读不到 TAPD 状态。请确认项目仍可访问,再重新读取。',
256
+ statusesPermission: '当前凭据没有读取状态的权限。请在 TAPD 检查对此项目的访问权限,或联系管理员。',
257
+ statusesPartial: 'TAPD 只返回了部分状态,可先使用已读取的选项。',
258
+ statusNetwork: '目前连接不到 TAPD。请检查 Tavlo 所在设备的网络后再试。',
259
+ statusTimeout: 'TAPD 响应超时,请稍后重新读取。',
260
+ statusUnsupported: 'TAPD 没有返回可用的状态列表。请确认项目已开放相应接口,再重新读取。',
261
+ statusesEmpty: 'TAPD 未返回可选状态。',
262
+ standardTaskHint: '未能核实此项目的任务状态。以下为 TAPD 标准选项,勾选不代表已获得任务读取权限。',
263
+ standardTaskOpen: '未开始', standardTaskProgressing: '进行中', standardTaskDone: '已完成',
264
+ storiesChoices: '需求状态', tasksChoices: '任务状态', statusNamed: '{label}({key})',
265
+ retainedStatuses: '另有 {count} 个已选状态未出现在列表中,仍会保留。', removeUnavailableStatuses: '取消选择未列出的状态',
266
+ guide: '如何获取 TAPD 凭据', basicGuide: 'TAPD 官方 API 配置指引', applyGuide: 'TAPD 官方 API 账号申请说明',
267
+ basicStep: 'TAPD 企业版的公司管理员可以在「公司管理 → 开放集成 → API 账号管理」下申请 API 访问。',
268
+ basicCopy: '在 Basic 字段中分别填写获发的 API 账号(api_user)和 API 口令(api_password),而不是 TAPD 登录账号和密码。',
269
+ tokenStep: '登录 TAPD,前往「我的 → 个人访问令牌」,生成可读取所需项目的令牌。只将令牌本身(不要加 Bearer)粘贴到此设置页,不要发到对话里。如果没有此入口,请联系 TAPD 管理员或改用 Basic 认证。',
270
+ supportGuide: 'TAPD 官方客户服务', tokenDocs: 'TAPD 官方个人令牌说明', openTokenSettings: '打开 TAPD 个人访问令牌设置',
271
+ lookback: '最近更新时间范围', unrestricted: '不限时间', lookbackPreset: '最近 {days} 天', custom: '自定义',
272
+ lookbackDays: '天数', lookbackHint: '每轮同步从本轮时间往前推算,按 TAPD 的最后更新时间筛选(中国时间 UTC+8),不是创建时间。不会移除已经导入的任务。',
273
+ lookbackInvalid: '请为自定义更新时间范围输入 1 至 365 之间的整数。',
274
+ project: '项目 {number}', workspaceId: 'TAPD 项目 ID', targetWorkspaceId: 'DSH 工作区', ungrouped: '未分组',
275
+ workspaceImpact: '更改仅影响新导入的任务,不会移动已有任务,待导入任务仍使用原目标。',
276
+ workspaceListUnavailable: '暂时无法获取 DSH 工作区列表。除非改为「未分组」,否则保留已保存的目标。',
277
+ noWorkspaces: '尚未注册 DSH 工作区,新导入的任务可归入「未分组」。',
278
+ missingWorkspace: '工作区不存在({id})', unverifiedWorkspace: '已保存的工作区({id})',
279
+ missingWorkspaceHint: '此项目暂停导入新任务。请选择其他工作区或「未分组」以恢复导入。',
280
+ addProject: '添加项目', remove: '移除', removeProject: '移除项目 {number}',
281
+ connection: 'TAPD 连接', setupConnection: '设置 TAPD 连接',
282
+ auth: '认证方式', bearer: '个人访问令牌(Bearer)', basic: 'API 账号和密钥(Basic)',
283
+ credentialsHint: '要更换凭据,请填入新值后点「保存凭据」。留空继续使用当前凭据,已保存的值不会显示。',
284
+ saveCredentials: '保存凭据', savingCredentials: '正在保存凭据…', credentialsSaved: 'TAPD 凭据已保存,其他设置未更改。',
285
+ credentialsSaveFailed: '无法保存 TAPD 凭据。',
286
+ setupCredentialsHint: '请填写 TAPD 凭据后点「保存凭据」,也可以在 Host 上配置凭据引用。',
287
+ authChangedHint: '留空则使用所选认证方式对应的已保存凭据或 Host 凭据引用。',
288
+ token: '个人访问令牌', apiUser: 'API 账号', apiKey: 'API 密钥',
289
+ useRefs: '丢弃已保存的凭据,改用 Host 凭据引用',
290
+ useRefsHint: '发现操作可以立即试用 Host 引用;仅在保存设置时才会丢弃已保存的凭据。',
291
+ advanced: '高级设置', interval: '轮询间隔(秒)', intervalHint: '两轮之间间隔 30–86,400 秒。',
292
+ maxNew: '单范围最多新增条数', maxNewHint: '每个项目、每种工作项类型 1–1,000 条。如果超过上限,本轮不导入该范围内的工作项。',
293
+ loading: '正在加载 TAPD 设置…', save: '保存设置', saving: '正在保存…', saved: 'TAPD 设置已保存。',
294
+ retry: '重试加载', reload: '重新加载设置并丢弃草稿',
295
+ loadFailed: '无法加载 TAPD 设置,请重试。', saveFailed: '无法保存 TAPD 设置。',
296
+ saveUnconfirmed: '无法确认保存结果。请重新加载以核对最新设置,再尝试保存。',
297
+ conflict: '其他地方已修改这些设置。请重新加载当前设置后再保存。',
298
+ invalidConfig: '请检查处理人昵称、项目 ID、所选状态和同步频率。',
299
+ duplicateProject: '每个 TAPD 项目 ID 只能填写一次。',
300
+ missingScopes: '请至少为一个项目勾选一种需求或任务状态,再启用同步。',
301
+ invalidCredentials: '替换凭据无效。使用 Basic 认证时,请同时填写 API 账号和密钥。',
302
+ unavailable: '此 Host 上的 TAPD 设置不可用。',
303
+ workspaceUnavailable: '无法分配所选目标。请重新加载设置以获取最新列表,或改为「未分组」。',
304
+ }
305
+
306
+ const errorKeys = new Map([
307
+ ['tapd/revision-conflict', 'conflict'],
308
+ ['tapd/invalid-config', 'invalidConfig'],
309
+ ['tapd/duplicate-project', 'duplicateProject'],
310
+ ['tapd/missing-scopes', 'missingScopes'],
311
+ ['tapd/invalid-credentials', 'invalidCredentials'],
312
+ ['tapd/settings-unavailable', 'unavailable'],
313
+ ['tapd/workspace-unavailable', 'workspaceUnavailable'],
314
+ ])
315
+ const credentialLabels = { visual: 'visualCredentials', refs: 'refs', none: 'none' }
316
+ const syncLabels = { disabled: 'disabled', 'waiting-for-board': 'waiting', ready: 'ready' }
317
+ const emptySecrets = () => ({ token: '', apiUser: '', apiKey: '' })
318
+ const isWorkspaceId = value => typeof value === 'string' && /^[\da-f]{8}-(?:[\da-f]{4}-){3}[\da-f]{12}$/i.test(value)
319
+ const isProjectId = value => typeof value === 'string' && /^[0-9]{1,32}$/.test(value)
320
+ const isStatusKey = value => typeof value === 'string' && /^[A-Za-z0-9_.-]{1,64}$/.test(value)
321
+ const splitKeys = text => [...new Set(text.split(/[,,\s]+/u).filter(Boolean))]
322
+ const lookbackPresets = ['7', '30', '90']
323
+ const validLookback = value => Number.isInteger(value) && value >= 1 && value <= 365
324
+ // A pasted URL is local input only. Neither its query/fragment nor its authority leaves the form.
325
+ function seedProject(link) {
326
+ try {
327
+ const url = new URL(link)
328
+ if (!['https://www.tapd.cn', 'https://tapd.cn'].includes(url.origin) || url.username || url.password) return undefined
329
+ return /^\/([0-9]{1,32})(?:\/|$)/.exec(url.pathname)?.[1]
330
+ } catch {
331
+ return undefined
332
+ }
333
+ }
334
+
335
+ function discoveryError(code, projects, auto) {
336
+ switch (code) {
337
+ case 'tapd/invalid-credentials': return 'discoveryMissingCredentials'
338
+ case 'tapd/auth': return 'discoveryRejected'
339
+ case 'tapd/discovery-forbidden': return projects ? 'projectsPermission' : 'statusesPermission'
340
+ case 'tapd/rate-limit': return 'discoveryThrottled'
341
+ case 'tapd/network': return projects ? 'projectsUnavailable' : 'statusNetwork'
342
+ case 'tapd/timeout': return projects ? 'projectsUnavailable' : 'statusTimeout'
343
+ case 'tapd/malformed':
344
+ case 'tapd/discovery-limit': return projects ? 'projectsUnavailable' : 'statusUnsupported'
345
+ case 'tapd/current-user-unavailable': return 'currentUserUnavailable'
346
+ case 'tapd/project-context-required': return auto ? 'automaticContext' : 'discoveryContext'
347
+ default: return projects ? 'projectsUnavailable' : 'statusesUnavailable'
348
+ }
349
+ }
350
+
351
+ function decodeProjects(value) {
352
+ if (!Array.isArray(value?.projects)) return null
353
+ const projects = new Map()
354
+ for (const project of value.projects) {
355
+ if (!isProjectId(project?.id) || typeof project.name !== 'string' || !project.name.trim() || projects.has(project.id)) return null
356
+ projects.set(project.id, project.name)
357
+ }
358
+ return projects
359
+ }
360
+
361
+ function decodeStatuses(value) {
362
+ if (!Array.isArray(value?.stories) || !Array.isArray(value.tasks)) return null
363
+ const decode = rows => {
364
+ const statuses = new Map()
365
+ for (const row of rows) {
366
+ if (!isStatusKey(row?.key) || typeof row.label !== 'string' || !row.label.trim() || statuses.has(row.key)) return null
367
+ statuses.set(row.key, row.label)
368
+ }
369
+ return statuses
370
+ }
371
+ const stories = decode(value.stories)
372
+ const tasks = decode(value.tasks)
373
+ if (!stories || !tasks) return null
374
+ const issues = Object.fromEntries(['stories', 'tasks'].filter(type => typeof value.errors?.[type] === 'string')
375
+ .map(type => [type, discoveryError(value.errors[type], false)]))
376
+ const useStandardTasks = value.standardTaskOptions === true && !!issues.tasks && !tasks.size && stories.size > 0
377
+ && ['tapd/api', 'tapd/http', 'tapd/malformed'].includes(value.errors.tasks)
378
+ return { stories, tasks, issues, useStandardTasks }
379
+ }
380
+
381
+ function prepareCredentials({ auth, useRefs, token, apiUser, apiKey }) {
382
+ if (useRefs) return { credentials: { mode: 'use-refs' } }
383
+ if (auth === 'bearer' && token !== '') {
384
+ if (!token.trim()) return { error: 'invalidCredentials' }
385
+ return { credentials: { mode: 'replace', token } }
386
+ }
387
+ if (auth === 'basic' && (apiUser !== '' || apiKey !== '')) {
388
+ if (!apiUser.trim() || !apiKey.trim()) return { error: 'invalidCredentials' }
389
+ return { credentials: { mode: 'replace', apiUser, apiKey } }
390
+ }
391
+ return {}
392
+ }
393
+
394
+ function decodeWorkspaces(workspaceStatus, workspaces) {
395
+ if (workspaceStatus !== 'ready' || !Array.isArray(workspaces)) return null
396
+ const catalog = new Map()
397
+ for (const row of workspaces) {
398
+ if (!isWorkspaceId(row?.id) || typeof row.title !== 'string' || typeof row.path !== 'string' || catalog.has(row.id)) return null
399
+ catalog.set(row.id, { title: row.title || row.path || row.id, path: row.path })
400
+ }
401
+ return catalog
402
+ }
403
+
404
+ // Project only the public response fields onto the form; never retain a Host error message or extra fields.
405
+ function decodeSnapshot(value, nextId) {
406
+ const { revision, source, configured, credentialSource, syncState, config, workspaceStatus, workspaces } = value ?? {}
407
+ if (!Number.isSafeInteger(revision) || revision < 0 || !['profile', 'visual'].includes(source)
408
+ || typeof configured !== 'boolean' || typeof credentialSource !== 'string' || !Object.hasOwn(credentialLabels, credentialSource)
409
+ || typeof syncState !== 'string' || !Object.hasOwn(syncLabels, syncState) || !config) return null
410
+ const { enabled, auth, owner, projects, intervalSeconds, maxNewPerScope, lookbackDays, companyId, seedWorkspaceId } = config
411
+ const windowDays = lookbackDays === undefined ? '' : String(lookbackDays)
412
+ const textList = values => Array.isArray(values) && values.every(value => typeof value === 'string')
413
+ if (typeof enabled !== 'boolean' || !['bearer', 'basic'].includes(auth) || typeof owner !== 'string'
414
+ || !Number.isInteger(intervalSeconds) || !Number.isInteger(maxNewPerScope) || !Array.isArray(projects)
415
+ || (lookbackDays !== undefined && !validLookback(lookbackDays)) || (companyId !== undefined && !isProjectId(companyId))
416
+ || (seedWorkspaceId !== undefined && !isProjectId(seedWorkspaceId))
417
+ || projects.length > MAX_PROJECTS || !projects.every(project => typeof project?.workspaceId === 'string'
418
+ && textList(project.stories) && textList(project.tasks)
419
+ && (project.targetWorkspaceId === undefined || isWorkspaceId(project.targetWorkspaceId)))) return null
420
+ return {
421
+ snapshot: {
422
+ revision, auth, configured, credentialSource, syncState,
423
+ catalog: decodeWorkspaces(workspaceStatus, workspaces),
424
+ projectTargets: new Map(projects.map(({ workspaceId, targetWorkspaceId }) => [workspaceId, targetWorkspaceId])),
425
+ },
426
+ draft: {
427
+ enabled, auth, owner, companyId,
428
+ discoveryLink: seedWorkspaceId ? `https://www.tapd.cn/${seedWorkspaceId}/` : '',
429
+ intervalSeconds: String(intervalSeconds), maxNewPerScope: String(maxNewPerScope),
430
+ lookback: !windowDays || lookbackPresets.includes(windowDays) ? windowDays : 'custom', lookbackDays: windowDays,
431
+ projects: projects.map(({ workspaceId, stories, tasks, targetWorkspaceId = '' }) => ({
432
+ id: nextId.current++, workspaceId, lookupWorkspaceId: workspaceId,
433
+ stories: stories.join(', '), tasks: tasks.join(', '), targetWorkspaceId,
434
+ })),
435
+ useRefs: false, ...emptySecrets(),
436
+ },
437
+ }
438
+ }
439
+
440
+ function prepareSave(draft, snapshot) {
441
+ const { enabled, auth } = draft
442
+ const owner = draft.owner.trim()
443
+ if (owner.length > 128 || /[<>|;,\p{Cc}]/u.test(owner) || (enabled && !owner)) return { error: 'invalidConfig' }
444
+ const intervalSeconds = Number(draft.intervalSeconds)
445
+ const maxNewPerScope = Number(draft.maxNewPerScope)
446
+ if (!/^\d+$/.test(draft.intervalSeconds) || intervalSeconds < 30 || intervalSeconds > 86400
447
+ || !/^\d+$/.test(draft.maxNewPerScope) || maxNewPerScope < 1 || maxNewPerScope > 1000
448
+ || draft.projects.length > MAX_PROJECTS) return { error: 'invalidConfig' }
449
+ const lookbackText = draft.lookback === 'custom' ? draft.lookbackDays : draft.lookback
450
+ const lookbackDays = Number(lookbackText)
451
+ if (draft.lookback && (!/^\d+$/.test(lookbackText) || !validLookback(lookbackDays))) return { error: 'lookbackInvalid' }
452
+ const validKeys = keys => keys.length <= 32 && keys.every(isStatusKey)
453
+ const projects = draft.projects.map(({ workspaceId, stories, tasks, targetWorkspaceId }) => ({
454
+ workspaceId, stories: splitKeys(stories), tasks: splitKeys(tasks), ...(targetWorkspaceId && { targetWorkspaceId }),
455
+ }))
456
+ if (projects.some(project => !isProjectId(project.workspaceId)
457
+ || !validKeys(project.stories) || !validKeys(project.tasks))) return { error: 'invalidConfig' }
458
+ if (new Set(projects.map(project => project.workspaceId)).size !== projects.length) return { error: 'duplicateProject' }
459
+ if (enabled && !projects.some(project => project.stories.length || project.tasks.length)) return { error: 'missingScopes' }
460
+ if (projects.some(({ workspaceId, targetWorkspaceId }) => targetWorkspaceId && !snapshot.catalog?.has(targetWorkspaceId)
461
+ && snapshot.projectTargets.get(workspaceId) !== targetWorkspaceId)) return { error: 'workspaceUnavailable' }
462
+ const { credentials, error } = prepareCredentials(draft)
463
+ if (error) return { error }
464
+ const link = draft.discoveryLink.trim()
465
+ const seedWorkspaceId = link ? seedProject(link) : undefined
466
+ if (link && !seedWorkspaceId) return { error: 'discoveryLinkInvalid' }
467
+ const config = { enabled, auth, owner, projects, intervalSeconds, maxNewPerScope,
468
+ ...(draft.lookback && { lookbackDays }), ...(draft.companyId && { companyId: draft.companyId }),
469
+ ...(seedWorkspaceId && { seedWorkspaceId }) }
470
+ return { input: { expectedRevision: snapshot.revision, config, ...(credentials && { credentials }) } }
471
+ }
472
+
473
+ const box = { display: 'grid', gap: 12, minWidth: 0 }
474
+ const line = { display: 'flex', flexWrap: 'wrap', alignItems: 'flex-start', gap: '8px 12px', minWidth: 0 }
475
+ const split = { ...line, justifyContent: 'space-between', alignItems: 'center' }
476
+ const field = { display: 'grid', gap: 4, flex: '1 1 180px', minWidth: 0 }
477
+ function Step({ id, number, title, actions, children }) {
478
+ return h('section', { className: 'tapd-step', 'aria-labelledby': id },
479
+ h('span', { className: 'tapd-step-index', 'aria-hidden': true }, number),
480
+ h('div', { className: 'tapd-step-content' },
481
+ h('div', { className: 'tapd-step-header' }, h('h3', { id }, title), actions), children),
482
+ )
483
+ }
484
+ const message = { margin: 0, color: 'var(--dsw-alias-label-secondary, currentColor)', overflowWrap: 'anywhere' }
485
+ const warning = { ...message, borderInlineStart: '2px solid var(--dsw-alias-state-warn-primary, currentColor)', paddingInlineStart: 8 }
486
+ const labelStyle = { fontWeight: 500 }
487
+
488
+ function Field({ id, label, hint, warn, value, onChange, choices, ...attrs }) {
489
+ const props = {
490
+ id, value,
491
+ 'aria-describedby': hint ? `${id}-hint` : undefined, ...attrs,
492
+ }
493
+ return h('div', { className: 'tapd-field', style: field },
494
+ h('label', { id: `${id}-label`, className: 'tapd-field-label', htmlFor: id, style: labelStyle }, label),
495
+ choices ? h(Select, { ...props, choices, onChange, 'aria-labelledby': `${id}-label` })
496
+ : h(Input, { ...props, onChange: event => onChange(event.currentTarget.value) }),
497
+ hint && h('small', { id: `${id}-hint`, style: warn ? warning : message }, hint),
498
+ )
499
+ }
500
+
501
+ // A single combobox: typing is a filter, and only a committed option changes the project.
502
+ function ProjectPicker({ t, id, name, value, choices, onSelect }) {
503
+ const [search, setSearch] = useState('')
504
+ const [open, setOpen] = useState(false)
505
+ const [active, setActive] = useState(-1)
506
+ const listRef = useRef(null)
507
+ const term = search.trim().toLocaleLowerCase()
508
+ const matches = choices.filter(([key, label]) => !term || key.includes(term) || label.toLocaleLowerCase().includes(term))
509
+ const options = matches.filter(([, , disabled]) => !disabled)
510
+ const candidate = options[active]
511
+ const listId = id + '-options'
512
+ const optionId = key => `${listId}-${key}`
513
+ useEffect(() => {
514
+ if (open && candidate) listRef.current?.children[matches.indexOf(candidate)]?.scrollIntoView({ block: 'nearest' })
515
+ }, [open, candidate?.[0]])
516
+ const close = () => { setOpen(false); setSearch(''); setActive(-1) }
517
+ const choose = key => { close(); onSelect(key) }
518
+ const move = step => {
519
+ if (!options.length) return
520
+ const next = active < 0 ? (step > 0 ? 0 : options.length - 1) : (active + step + options.length) % options.length
521
+ setActive(next)
522
+ }
523
+ return h('div', { className: 'tapd-picker tapd-field', onBlur(event) {
524
+ if (!event.currentTarget.contains(event.relatedTarget)) close()
525
+ } }, h('label', { className: 'tapd-field-label', htmlFor: id }, t('chooseProject')),
526
+ h(Input, { id, type: 'text', role: 'combobox', 'aria-autocomplete': 'list', 'aria-expanded': open, 'aria-controls': listId,
527
+ 'aria-activedescendant': open && candidate ? optionId(candidate[0]) : undefined, value: open ? search : name,
528
+ placeholder: open ? t('projectSearch') : t('chooseProjectPlaceholder'), spellCheck: false, autoComplete: 'off',
529
+ onFocus: () => setOpen(true), onClick: () => setOpen(true),
530
+ onChange: event => { setOpen(true); setActive(-1); setSearch(event.currentTarget.value) },
531
+ onKeyDown(event) {
532
+ if (event.nativeEvent?.isComposing) return
533
+ if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {
534
+ event.preventDefault(); setOpen(true); move(event.key === 'ArrowDown' ? 1 : -1)
535
+ } else if (event.key === 'Enter') {
536
+ event.preventDefault()
537
+ if (open && (candidate || options.length === 1)) choose((candidate || options[0])[0])
538
+ else setOpen(true)
539
+ } else if (open && event.key === 'Escape') { event.preventDefault(); event.stopPropagation(); close() }
540
+ else if (event.key === 'Tab') close()
541
+ },
542
+ }),
543
+ h('div', { className: 'tapd-picker-popup', hidden: !open },
544
+ h('ul', { ref: listRef, role: 'listbox', id: listId, 'aria-label': t('chooseProject') }, matches.map(([key, label, disabled]) => h('li', {
545
+ key, id: optionId(key), role: 'option', 'aria-selected': key === value, 'aria-disabled': disabled || undefined,
546
+ 'data-active': key === candidate?.[0] || undefined,
547
+ onMouseDown: event => event.preventDefault(), onClick: disabled ? undefined : () => choose(key),
548
+ }, label))), !matches.length ? h('p', { role: 'status' }, t('noProjectMatches')) : null))
549
+ }
550
+
551
+ function Details({ title, annotation, defaultOpen, children }) {
552
+ return h(Disclosure, { title, annotation, defaultOpen }, h('div', { style: box }, children))
553
+ }
554
+
555
+ function SyncSwitch({ label, checked, disabled, onChange }) {
556
+ return h('button', {
557
+ type: 'button', role: 'switch', 'aria-checked': checked, disabled, onClick: () => onChange(!checked),
558
+ style: { ...line, alignItems: 'center', border: 0, padding: 0, minHeight: 36, font: 'inherit', fontWeight: 600,
559
+ textAlign: 'start', color: 'inherit', background: 'transparent', cursor: disabled ? 'default' : 'pointer' },
560
+ },
561
+ h('span', { 'aria-hidden': true, style: {
562
+ display: 'flex', alignItems: 'center', justifyContent: checked ? 'flex-end' : 'flex-start', width: 36, height: 20,
563
+ boxSizing: 'border-box', borderRadius: 999, paddingInline: 2, flex: '0 0 auto',
564
+ background: checked ? 'var(--dsw-alias-brand-primary, Highlight)' : 'var(--dsw-alias-border-l3, GrayText)',
565
+ border: '1px solid var(--dsw-alias-border-l3, GrayText)', opacity: disabled ? 0.5 : 1,
566
+ } }, h('span', { style: {
567
+ width: 14, height: 14, borderRadius: '50%', background: checked
568
+ ? 'var(--dsw-alias-label-primary-foreground, HighlightText)' : 'var(--dsw-alias-switch-thumb, Canvas)',
569
+ border: '1px solid var(--dsw-alias-border-l3, GrayText)',
570
+ } })), label,
571
+ )
572
+ }
573
+
574
+ function useKnownProjectNames(request, snapshot, draft, catalog, paused) {
575
+ const [lookup, setLookup] = useState(null)
576
+ // Never send credentials from the draft implicitly. Catalog and status reads are explicit actions.
577
+ const context = !paused && snapshot?.configured && draft.auth === snapshot.auth
578
+ && !draft.useRefs && !draft.token && !draft.apiUser && !draft.apiKey ? snapshot : null
579
+ const ids = context ? [...new Set(draft.projects.map(row => row.lookupWorkspaceId)
580
+ .filter(id => isProjectId(id) && !catalog?.has(id)))].sort().join(',') : ''
581
+ useEffect(() => {
582
+ if (!ids) return
583
+ const controller = new AbortController()
584
+ const workspaceIds = ids.split(',')
585
+ const finish = names => {
586
+ if (!controller.signal.aborted) setLookup({ context, ids, names: names ?? new Map() })
587
+ }
588
+ void request('discover-project-names', { auth: context.auth, workspaceIds }, controller.signal).then(result => {
589
+ finish(result?.ok === true ? decodeProjects(result.value) : null)
590
+ }, () => finish(null))
591
+ return () => controller.abort()
592
+ }, [request, context, ids])
593
+ return context && lookup?.context === context && lookup.ids === ids ? lookup.names : null
594
+ }
595
+
596
+ function SettingsForm({ t, request }) {
597
+ const baseId = useId()
598
+ const nextId = useRef(0)
599
+ const active = useRef(null)
600
+ const discovering = useRef(new Map())
601
+ const [page, setPage] = useState({ pending: 'get' })
602
+ const run = useCallback(async (operation, input) => {
603
+ if (active.current) return
604
+ const ticket = {}
605
+ active.current = ticket
606
+ const saving = operation !== 'get'
607
+ const atConnection = operation === 'save-credentials'
608
+ if (saving) discovering.current.delete('projects')
609
+ setPage(previous => ({ ...previous, pending: operation, error: null, notice: null, atConnection,
610
+ metadata: previous.metadata?.projects?.loading
611
+ ? { ...previous.metadata, projects: { ...previous.metadata.projects, loading: false } }
612
+ : previous.metadata,
613
+ }))
614
+ try {
615
+ const result = await request(operation, input)
616
+ if (active.current !== ticket) return
617
+ if (result?.ok === true) {
618
+ const decoded = decodeSnapshot(result.value, nextId)
619
+ if (decoded) {
620
+ const keepMetadata = saving && !input.credentials
621
+ if (!keepMetadata) discovering.current.clear()
622
+ setPage(previous => ({ ...decoded,
623
+ draft: atConnection ? { ...previous.draft, useRefs: false, ...emptySecrets() } : decoded.draft,
624
+ atConnection, notice: atConnection ? 'credentialsSaved' : saving ? 'saved' : null,
625
+ metadata: keepMetadata ? previous.metadata : { projects: null, statuses: new Map() },
626
+ }))
627
+ return
628
+ }
629
+ } else if (result?.ok === false) {
630
+ const error = errorKeys.get(result.error?.code) ?? (atConnection ? 'credentialsSaveFailed' : saving ? 'saveFailed' : 'loadFailed')
631
+ setPage(previous => ({
632
+ ...previous, pending: null, error, reloadRequired: !saving || error === 'conflict',
633
+ }))
634
+ return
635
+ }
636
+ // A malformed save reply, like a transport failure, leaves the result uncertain.
637
+ setPage(previous => ({ ...previous, pending: null, error: saving ? 'saveUnconfirmed' : 'loadFailed', reloadRequired: true }))
638
+ } catch {
639
+ if (active.current === ticket) {
640
+ setPage(previous => ({ ...previous, pending: null, error: saving ? 'saveUnconfirmed' : 'loadFailed', reloadRequired: true }))
641
+ }
642
+ } finally {
643
+ if (active.current === ticket) active.current = null
644
+ }
645
+ }, [request])
646
+ useEffect(() => {
647
+ void run('get', {})
648
+ return () => { active.current = null; discovering.current.clear() }
649
+ }, [run])
650
+
651
+ const { draft, snapshot, pending, error, notice, atConnection, reloadRequired, metadata } = page
652
+ const projectDiscovery = metadata?.projects
653
+ const projectNames = projectDiscovery?.data
654
+ const knownProjectNames = useKnownProjectNames(request, snapshot, draft, projectNames, pending || reloadRequired)
655
+ const controlId = key => `${baseId}-${key}`
656
+ const edit = (updater, invalidate) => {
657
+ if (invalidate === 'credentials') discovering.current.clear()
658
+ else if (invalidate === 'projects') discovering.current.delete('projects')
659
+ setPage(previous => ({
660
+ ...previous, draft: updater(previous.draft), error: previous.reloadRequired ? previous.error : null, notice: null,
661
+ metadata: invalidate === 'credentials' ? { projects: null, statuses: new Map() }
662
+ : invalidate === 'projects' ? { ...previous.metadata, projects: null } : previous.metadata,
663
+ }))
664
+ }
665
+ const setField = (key, value) => edit(old => ({ ...old, [key]: value }),
666
+ ['token', 'apiUser', 'apiKey'].includes(key) ? 'credentials'
667
+ : ['owner', 'discoveryLink'].includes(key) ? 'projects' : undefined)
668
+ const setDiscovery = (workspaceId, entry, onProjects) => setPage(previous => {
669
+ const metadata = previous.metadata
670
+ if (workspaceId !== undefined) {
671
+ const statuses = new Map(metadata.statuses)
672
+ statuses.set(workspaceId, { ...statuses.get(workspaceId), ...entry })
673
+ return { ...previous, metadata: { ...metadata, statuses } }
674
+ }
675
+ return { ...previous, draft: onProjects ? onProjects(previous.draft) : previous.draft,
676
+ metadata: { ...metadata, projects: { ...metadata.projects, ...entry } } }
677
+ })
678
+ const appendProject = (old, id, seed) => {
679
+ if (old.projects.length >= MAX_PROJECTS) return old
680
+ const workspaceId = seed && !old.projects.some(row => row.workspaceId === seed) ? seed : ''
681
+ return { ...old, projects: [...old.projects, { id, workspaceId, lookupWorkspaceId: workspaceId,
682
+ stories: '', tasks: '', targetWorkspaceId: '',
683
+ }] }
684
+ }
685
+ const projectOptionsLeft = (old, options) => {
686
+ const selected = new Set(old.projects.map(row => row.workspaceId))
687
+ return [...options.keys()].some(id => !selected.has(id))
688
+ }
689
+ const appendChooser = (old, id) => old.projects.some(row => !row.workspaceId) ? old : appendProject(old, id)
690
+ const discover = async (workspaceId, seedWorkspaceId, fromLink = false) => {
691
+ const projects = workspaceId === undefined
692
+ const key = projects ? 'projects' : workspaceId
693
+ if (pending || reloadRequired || active.current || discovering.current.has(key)) return
694
+ const { credentials, error } = prepareCredentials(draft)
695
+ if (error) return setDiscovery(workspaceId, { issue: error })
696
+ const input = { auth: draft.auth, ...(credentials && { credentials }) }
697
+ if (projects) {
698
+ if (draft.auth === 'bearer' && !seedWorkspaceId) {
699
+ input.auto = true
700
+ } else {
701
+ if (seedWorkspaceId) input.seedWorkspaceId = seedWorkspaceId
702
+ else if (draft.companyId) input.companyId = draft.companyId
703
+ else return setDiscovery(undefined, { issue: 'discoveryContext' })
704
+ if (draft.auth === 'bearer') {
705
+ const nick = draft.owner.trim()
706
+ if (!nick) return setDiscovery(undefined, { issue: 'linkedProjectNick' })
707
+ input.nick = nick
708
+ }
709
+ }
710
+ } else {
711
+ if (!isProjectId(workspaceId)) return
712
+ input.workspaceId = workspaceId
713
+ }
714
+ const ticket = {}
715
+ discovering.current.set(key, ticket)
716
+ setDiscovery(workspaceId, { loading: true, issue: null })
717
+ const finish = (entry, onProjects) => {
718
+ if (discovering.current.get(key) !== ticket) return
719
+ discovering.current.delete(key)
720
+ setDiscovery(workspaceId, { ...entry, loading: false }, onProjects)
721
+ }
722
+ const fallback = projects ? 'projectsUnavailable' : 'statusesUnavailable'
723
+ try {
724
+ const result = await request(projects ? 'discover-projects' : 'discover-statuses', input)
725
+ if (result?.ok !== true) return finish({ issue: discoveryError(result?.error?.code, projects, input.auto) })
726
+ const data = projects ? decodeProjects(result.value) : decodeStatuses(result.value)
727
+ if (!data) return finish({ issue: fallback })
728
+ if (projects) {
729
+ const issue = result.value.truncated === true || result.value.warning === 'truncated' ? 'projectsPartial'
730
+ : !data.size ? 'projectsEmpty' : null
731
+ const nick = result.value.currentNick
732
+ if (input.auto && (result.value.scope !== 'participant' || typeof nick !== 'string' || !nick || nick.length > 128
733
+ || nick.trim() !== nick || /[<>|;,\p{Cc}\u2028\u2029]/u.test(nick))) return finish({ issue: 'currentUserUnavailable' })
734
+ finish({ data, issue, companyScope: result.value.scope === 'company' },
735
+ input.auto && !fromLink ? old => !old.owner.trim() ? { ...old, owner: nick } : old : undefined)
736
+ } else {
737
+ finish({ data, issue: result.value.partial === true ? 'statusesPartial' : null })
738
+ }
739
+ } catch {
740
+ finish({ issue: fallback })
741
+ }
742
+ }
743
+ const updateProject = (id, key, value) => edit(old => ({
744
+ ...old, projects: old.projects.map(project => project.id === id ? { ...project, [key]: value } : project),
745
+ }))
746
+ const cannotAdd = () => pending || reloadRequired || active.current || discovering.current.has('projects') || draft.projects.length >= MAX_PROJECTS
747
+ const addManually = () => {
748
+ if (cannotAdd()) return
749
+ const id = nextId.current++
750
+ edit(old => appendProject(old, id))
751
+ }
752
+ const add = () => {
753
+ if (cannotAdd()) return
754
+ const options = metadata.projects?.data
755
+ if (options?.size && !projectOptionsLeft(draft, options)) return setDiscovery(undefined, { issue: 'allProjectsAdded' })
756
+ const id = nextId.current++
757
+ edit(old => appendChooser(old, id))
758
+ if (!options?.size) return discover(undefined, draft.auth === 'basic' ? seedProject(draft.discoveryLink.trim()) : undefined)
759
+ }
760
+ const addFromLink = () => {
761
+ if (cannotAdd()) return
762
+ const seed = seedProject(draft.discoveryLink.trim())
763
+ if (!seed) return setDiscovery(undefined, { issue: 'discoveryLinkInvalid' })
764
+ if (!draft.projects.some(row => row.workspaceId === seed)) {
765
+ const id = nextId.current++
766
+ edit(old => appendProject(old, id, seed))
767
+ }
768
+ if (!metadata.projects?.data?.has(seed)) return discover(undefined, seed, true)
769
+ }
770
+ const remove = id => edit(old => ({ ...old, projects: old.projects.filter(project => project.id !== id) }))
771
+ const submit = event => {
772
+ event.preventDefault()
773
+ if (!draft || pending || reloadRequired || active.current) return
774
+ const prepared = prepareSave(draft, snapshot)
775
+ if (prepared.error) {
776
+ setPage(previous => ({ ...previous, atConnection: false, error: prepared.error, notice: null }))
777
+ return
778
+ }
779
+ return run('save', prepared.input)
780
+ }
781
+ const saveCredentials = () => {
782
+ if (pending || reloadRequired || active.current) return
783
+ const { credentials, error } = prepareCredentials(draft)
784
+ if (error) return setPage(previous => ({ ...previous, atConnection: true, error, notice: null }))
785
+ if (credentials) return run('save-credentials', { expectedRevision: snapshot.revision, auth: draft.auth, credentials })
786
+ }
787
+ const reload = () => run('get', {})
788
+
789
+ const catalog = snapshot?.catalog
790
+ const workspaceListIssue = !catalog ? 'workspaceListUnavailable' : catalog.size === 0 ? 'noWorkspaces' : null
791
+ const duplicateTitles = new Set()
792
+ const seenTitles = new Set()
793
+ for (const { title } of catalog?.values() ?? []) {
794
+ if (seenTitles.has(title)) duplicateTitles.add(title)
795
+ seenTitles.add(title)
796
+ }
797
+ const workspaceChoices = Array.from(catalog ?? [], ([id, { title, path }]) => [
798
+ id, duplicateTitles.has(title) ? `${title} — ${path || id}` : title,
799
+ ])
800
+ const preventSubmit = event => { if (event.key === 'Enter' && !event.nativeEvent?.isComposing) event.preventDefault() }
801
+ const discoveryIssue = key => key && h('p', { role: 'status', style: warning }, t(key))
802
+ const projectFields = (project, index) => {
803
+ const projectId = controlId(`project-${project.id}`)
804
+ const projectField = (key, { label = t(key), ...options }) => h(Field, {
805
+ id: `${projectId}-${key}`, label, value: project[key],
806
+ onChange: value => updateProject(project.id, key, value), ...options,
807
+ })
808
+ const workspace = catalog?.get(project.targetWorkspaceId)
809
+ const unknownTarget = !!project.targetWorkspaceId && !workspace
810
+ const missingTarget = !!catalog && unknownTarget
811
+ const workspaceHint = missingTarget ? t('missingWorkspaceHint') : workspace?.path
812
+ const choices = [['', t('ungrouped')], ...workspaceChoices]
813
+ if (unknownTarget) choices.push([project.targetWorkspaceId,
814
+ t(catalog ? 'missingWorkspace' : 'unverifiedWorkspace', { id: project.targetWorkspaceId }), true])
815
+ const currentName = projectNames?.get(project.workspaceId) ?? knownProjectNames?.get(project.workspaceId)
816
+ const manualProjectInput = {
817
+ type: 'text', inputMode: 'numeric', maxLength: 32, spellCheck: false, required: true,
818
+ hint: !project.workspaceId ? t('manualProjectHint') : !currentName && knownProjectNames
819
+ && project.lookupWorkspaceId === project.workspaceId && isProjectId(project.workspaceId) ? t('projectNameUnavailable') : undefined,
820
+ onBlur: event => updateProject(project.id, 'lookupWorkspaceId', event.currentTarget.value),
821
+ onKeyDown(event) {
822
+ if (event.key !== 'Enter' || event.nativeEvent?.isComposing) return
823
+ event.preventDefault()
824
+ event.currentTarget.blur()
825
+ },
826
+ }
827
+ const selectProject = value => {
828
+ if (value === project.workspaceId) return
829
+ edit(old => ({ ...old, projects: old.projects.map(row => row.id === project.id
830
+ ? { ...row, workspaceId: value, lookupWorkspaceId: value, stories: '', tasks: '' } : row) }))
831
+ if (!metadata.statuses.has(value)) void discover(value)
832
+ }
833
+ const taken = new Set(draft.projects.filter(other => other.id !== project.id).map(other => other.workspaceId))
834
+ const projectChoices = Array.from(projectNames ?? [], ([id, name]) => [id, t('projectNamed', { id, name }), taken.has(id)])
835
+ if (project.workspaceId && !projectNames?.has(project.workspaceId)) {
836
+ projectChoices.unshift([project.workspaceId, currentName
837
+ ? t('projectNamed', { id: project.workspaceId, name: currentName }) : t('savedProjectId', { id: project.workspaceId }), true])
838
+ }
839
+ const showPicker = !project.manualEntry && !!projectNames?.size
840
+ && (!!project.workspaceId || projectChoices.some(([, , unavailable]) => !unavailable))
841
+ const projectStatuses = metadata?.statuses.get(project.workspaceId)
842
+ const types = ['stories', 'tasks']
843
+ const renderStatuses = type => {
844
+ const standard = type === 'tasks' && projectStatuses?.data?.useStandardTasks
845
+ // Official /tasks status vocabulary; not project metadata and never preselected.
846
+ const statuses = standard ? new Map([
847
+ ['open', t('standardTaskOpen')], ['progressing', t('standardTaskProgressing')], ['done', t('standardTaskDone')],
848
+ ]) : projectStatuses?.data?.[type]
849
+ const selected = splitKeys(project[type])
850
+ const issue = !standard && projectStatuses?.data?.issues[type]
851
+ const unlisted = selected.filter(key => !statuses?.has(key))
852
+ const labelCounts = new Map()
853
+ for (const label of statuses?.values() ?? []) labelCounts.set(label, 1 + (labelCounts.get(label) ?? 0))
854
+ return h('fieldset', { key: type, className: 'tapd-status-group' },
855
+ h('legend', { style: labelStyle }, t(`${type}Choices`)),
856
+ standard && h('p', { role: 'status', style: warning }, t('standardTaskHint')),
857
+ issue ? discoveryIssue(issue) : !statuses?.size ? h('p', { style: message }, t('statusesEmpty')) :
858
+ h('div', { className: 'tapd-status-choices' }, Array.from(statuses, ([key, label]) => h('label', { key },
859
+ h('input', {
860
+ type: 'checkbox', value: key, checked: selected.includes(key), disabled: selected.length >= 32 && !selected.includes(key),
861
+ onChange: event => updateProject(project.id, type,
862
+ (event.currentTarget.checked ? [...selected, key] : selected.filter(value => value !== key)).join(', ')),
863
+ }), h('span', null, labelCounts.get(label) > 1 ? t('statusNamed', { label, key }) : label),
864
+ ))),
865
+ unlisted.length > 0 && h('small', { style: message }, t('retainedStatuses', { count: unlisted.length })),
866
+ unlisted.length > 0 && !standard && !issue && !!statuses?.size && h('button', {
867
+ className: 'tapd-button', 'data-tone': 'quiet', type: 'button',
868
+ onClick: () => updateProject(project.id, type, selected.filter(key => statuses.has(key)).join(', ')),
869
+ }, t('removeUnavailableStatuses')),
870
+ )
871
+ }
872
+ const summaries = types.map((type, i) => {
873
+ const count = splitKeys(project[type]).length
874
+ return count && t(i === 0 ? 'storyCount' : 'taskCount', { count })
875
+ }).filter(Boolean)
876
+ return h('div', { key: project.id, role: 'group', 'aria-labelledby': projectId, className: 'tapd-project' },
877
+ h('div', { className: 'tapd-project-head' },
878
+ h('div', null,
879
+ h('h4', { id: projectId }, currentName || t('project', { number: index + 1 })),
880
+ project.workspaceId && h('span', { className: 'tapd-project-code' }, `#${project.workspaceId}`),
881
+ ),
882
+ h('button', {
883
+ type: 'button', className: 'tapd-button', 'data-tone': 'quiet',
884
+ onClick: () => remove(project.id), 'aria-label': t('removeProject', { number: index + 1 }),
885
+ }, t('remove')),
886
+ ),
887
+ h('div', { className: 'tapd-project-fields' },
888
+ showPicker ? h(ProjectPicker, { t, id: `${projectId}-chooser`,
889
+ name: currentName || (project.workspaceId ? t('savedProjectId', { id: project.workspaceId }) : ''),
890
+ value: project.workspaceId, choices: projectChoices, onSelect: selectProject,
891
+ }) : projectField('workspaceId', { ...manualProjectInput,
892
+ onFocus: () => { if (!project.manualEntry) updateProject(project.id, 'manualEntry', true) },
893
+ }),
894
+ projectField('targetWorkspaceId', {
895
+ choices, disabled: !project.targetWorkspaceId && !workspaceChoices.length, hint: workspaceHint, warn: missingTarget,
896
+ 'aria-describedby': [workspaceHint && `${projectId}-targetWorkspaceId-hint`, workspaceListIssue && controlId('workspace-hint')]
897
+ .filter(Boolean).join(' ') || undefined,
898
+ }),
899
+ ),
900
+ showPicker && h(Details, { title: t('manualProject'), annotation: project.workspaceId || undefined },
901
+ projectField('workspaceId', manualProjectInput),
902
+ ),
903
+ h('div', { style: split },
904
+ h('div', { className: 'tapd-chip-line', title: t('statusesHint') }, (summaries.length ? summaries : [t('noneSelected')])
905
+ .map(text => h('span', { key: text, className: 'tapd-chip' }, text))),
906
+ h('button', { type: 'button', className: 'tapd-button', 'data-tone': 'quiet',
907
+ disabled: !isProjectId(project.workspaceId) || !!projectStatuses?.loading,
908
+ onClick: () => discover(project.workspaceId) }, t(projectStatuses?.loading ? 'loadingStatuses'
909
+ : (projectStatuses?.data || projectStatuses?.issue) ? 'refreshStatuses' : 'loadStatuses')),
910
+ ),
911
+ discoveryIssue(projectStatuses?.issue),
912
+ projectStatuses?.data && h('div', { className: 'tapd-project-fields' }, types.map(renderStatuses)),
913
+ isProjectId(project.workspaceId) && !projectStatuses?.loading && !projectStatuses?.issue && !projectStatuses?.data &&
914
+ h('p', { className: 'tapd-project-advisory', style: message }, t('statusesHint')),
915
+ )
916
+ }
917
+ const fieldFor = (key, label, options = {}) => h(Field, {
918
+ id: controlId(key), label: t(label), value: draft[key], onChange: value => setField(key, value), ...options,
919
+ })
920
+ const password = key => fieldFor(key, key, {
921
+ key, type: 'password', autoComplete: 'new-password', spellCheck: false, disabled: draft.useRefs,
922
+ 'aria-describedby': controlId('credential-hint'),
923
+ })
924
+ const officialLink = (url, key) => h('a', { href: url, target: '_blank', rel: 'noopener noreferrer' }, t(key))
925
+ const disabled = !!pending || !!reloadRequired
926
+ const connectionFields = draft && h('div', { style: box },
927
+ h('p', { id: controlId('credential-hint'), style: message }, t(draft.auth !== snapshot.auth
928
+ ? 'authChangedHint' : snapshot.configured ? 'credentialsHint' : 'setupCredentialsHint')),
929
+ h('div', { style: line }, fieldFor('auth', 'auth', {
930
+ choices: [['bearer', t('bearer')], ['basic', t('basic')]],
931
+ onChange: auth => edit(old => ({ ...old, auth, ...emptySecrets() }), 'credentials'),
932
+ 'aria-describedby': controlId('credential-hint'),
933
+ })),
934
+ h('div', { style: line }, draft.auth === 'bearer' ? password('token') : [password('apiUser'), password('apiKey')]),
935
+ h('div', { style: line },
936
+ h('button', { type: 'button', className: 'tapd-button', onClick: saveCredentials,
937
+ disabled: disabled || !(draft.useRefs || (draft.auth === 'bearer' ? draft.token : draft.apiUser || draft.apiKey)),
938
+ }, t(pending === 'save-credentials' ? 'savingCredentials' : 'saveCredentials')),
939
+ ),
940
+ atConnection && (error
941
+ ? h('p', { role: 'alert', style: warning }, t(error))
942
+ : notice && h('p', { role: 'status', style: message }, t(notice))),
943
+ h(Details, { title: t('guide') }, draft.auth === 'bearer' ? h('div', { style: box },
944
+ h('p', { style: message }, t('tokenStep')),
945
+ h('div', { style: line }, officialLink(TOKEN_SETTINGS, 'openTokenSettings'), officialLink(TOKEN_GUIDE, 'tokenDocs'),
946
+ officialLink(SUPPORT, 'supportGuide')),
947
+ ) : h('div', { style: box },
948
+ h('ol', { style: { margin: 0, paddingInlineStart: 24 } }, h('li', null, t('basicStep')), h('li', null, t('basicCopy'))),
949
+ h('div', { style: line }, officialLink(API_GUIDE, 'applyGuide'), officialLink(BASIC_GUIDE, 'basicGuide')),
950
+ )),
951
+ )
952
+ const refHint = controlId('refs-hint')
953
+ const feedback = h('div', { className: 'tapd-feedback' },
954
+ pending === 'get' && h('p', { role: 'status' }, t('loading')),
955
+ !atConnection && error && h('p', { role: 'alert', style: { color: 'var(--dsw-alias-state-error-primary, #b4232b)' } }, t(error)),
956
+ !atConnection && notice && h('p', { role: 'status' }, t(notice)),
957
+ draft && !error && !notice && !pending && h('p', null, t('workspaceImpact')),
958
+ (reloadRequired || error === 'workspaceUnavailable') && !pending && h('div', null, h('button', {
959
+ type: 'button', className: 'tapd-button', onClick: reload,
960
+ }, t(draft ? 'reload' : 'retry'))),
961
+ )
962
+ return h('section', { className: 'tapd-console', 'aria-labelledby': controlId('title') },
963
+ h(ArcStyle),
964
+ h('header', { className: 'tapd-hero' },
965
+ h('div', { className: 'tapd-hero-title' },
966
+ h('div', { className: 'tapd-route', 'aria-hidden': true }, h('span', null, 'TAPD'),
967
+ h('svg', { viewBox: '0 0 24 13', fill: 'none', stroke: 'currentColor', strokeWidth: 1.4 },
968
+ h('path', { d: 'M1 6.5h21 M17 2l5 4.5-5 4.5', strokeLinecap: 'round', strokeLinejoin: 'round' })),
969
+ h('span', null, 'TAVLO')),
970
+ h('h2', { id: controlId('title') }, t('title')),
971
+ h('p', null, t('description')),
972
+ ),
973
+ draft && h('div', { className: 'tapd-control' },
974
+ h(SyncSwitch, { label: t('enabled'), checked: draft.enabled, disabled, onChange: value => setField('enabled', value) }),
975
+ h('div', { role: 'status' },
976
+ h('span', { className: 'tapd-dot', 'data-ready': snapshot.syncState === 'ready', 'aria-hidden': true }),
977
+ t('syncState'), ': ', h('strong', null, t(syncLabels[snapshot.syncState])),
978
+ ),
979
+ ),
980
+ ),
981
+ draft ? h('form', { noValidate: true, autoComplete: 'off', onSubmit: submit, 'aria-busy': !!pending },
982
+ h('fieldset', { disabled, className: 'tapd-body' },
983
+ h(Step, { id: controlId('connection-title'), number: '01', title: t('connectionStep'),
984
+ actions: h('small', null, t(snapshot.configured ? 'configuredConnection' : 'none')) },
985
+ h(Details, { title: t(snapshot.configured ? 'connection' : 'setupConnection'),
986
+ annotation: snapshot.configured ? t(credentialLabels[snapshot.credentialSource]) : undefined,
987
+ defaultOpen: !snapshot.configured,
988
+ }, connectionFields),
989
+ h('div', { className: 'tapd-connection-scope' },
990
+ fieldFor('owner', 'owner', { type: 'text', maxLength: 128, spellCheck: false, required: draft.enabled }),
991
+
992
+ ),
993
+ ),
994
+ h(Step, { id: controlId('projects-title'), number: '02', title: t('projectsStep'),
995
+ actions: h('div', { className: 'tapd-step-actions' },
996
+ h('span', { className: 'tapd-count' }, t('projectCount', { count: draft.projects.filter(row => row.workspaceId).length })),
997
+ h('button', { type: 'button', className: 'tapd-button', disabled: draft.projects.length >= MAX_PROJECTS || !!projectDiscovery?.loading,
998
+ onClick: add }, t('addProject')),
999
+ ) },
1000
+ h('p', { id: controlId('project-hint'), style: message, title: t('workspaceImpact') }, t('projectsHint')),
1001
+ workspaceListIssue && h('p', { id: controlId('workspace-hint'), style: catalog ? message : warning }, t(workspaceListIssue)),
1002
+ projectDiscovery?.loading && h('p', { role: 'status', className: 'tapd-project-advisory', style: message }, t('searchingProjects')),
1003
+ discoveryIssue(projectDiscovery?.issue ?? (projectNames?.size && !projectOptionsLeft(draft, projectNames) ? 'allProjectsAdded' : null)),
1004
+ projectDiscovery?.companyScope && h('p', { className: 'tapd-project-advisory', style: message }, t('companyProjectScope')),
1005
+ !draft.projects.length && h('p', { className: 'tapd-empty' }, t(draft.auth === 'bearer' && !draft.discoveryLink.trim()
1006
+ ? 'tokenProjectHelp' : 'noProjects')),
1007
+ draft.projects.map(projectFields),
1008
+ h(Details, { title: t('projectAlternatives'), annotation: seedProject(draft.discoveryLink.trim()) },
1009
+ h('div', { style: box },
1010
+ fieldFor('discoveryLink', 'discoveryLink', { type: 'url', maxLength: 4096, placeholder: t('projectLinkPlaceholder'),
1011
+ spellCheck: false, onKeyDown: preventSubmit, hint: t('discoveryLinkHint') }),
1012
+ h('div', { style: line }, h('button', { type: 'button', className: 'tapd-button',
1013
+ disabled: !draft.discoveryLink.trim() || draft.projects.length >= MAX_PROJECTS || !!projectDiscovery?.loading,
1014
+ onClick: addFromLink,
1015
+ }, t('useProjectLink')), h('button', { type: 'button', className: 'tapd-button',
1016
+ disabled: draft.projects.length >= MAX_PROJECTS || !!projectDiscovery?.loading,
1017
+ onClick: addManually,
1018
+ }, t('addManually'))),
1019
+ ),
1020
+ ),
1021
+ ),
1022
+ h(Step, { id: controlId('range-title'), number: '03', title: t('rangeStep'),
1023
+ actions: h('small', null, t('rangeSummary')) },
1024
+ h(Details, { title: t('advanced'), annotation: draft.lookback
1025
+ ? t('lookbackPreset', { days: draft.lookback === 'custom' ? draft.lookbackDays : draft.lookback })
1026
+ : t('unrestricted') },
1027
+ h('div', { style: line },
1028
+ fieldFor('lookback', 'lookback', { hint: t('lookbackHint'), choices: [['', t('unrestricted')],
1029
+ ...lookbackPresets.map(days => [days, t('lookbackPreset', { days })]), ['custom', t('custom')]],
1030
+ }),
1031
+ draft.lookback === 'custom' && fieldFor('lookbackDays', 'lookbackDays', { type: 'number', min: 1, max: 365, step: 1, required: true }),
1032
+ ),
1033
+ h('div', { style: line },
1034
+ fieldFor('intervalSeconds', 'interval', { type: 'number', min: 30, max: 86400, step: 1, required: true, hint: t('intervalHint') }),
1035
+ fieldFor('maxNewPerScope', 'maxNew', { type: 'number', min: 1, max: 1000, step: 1, required: true, hint: t('maxNewHint') }),
1036
+ ),
1037
+ snapshot.credentialSource === 'visual' && h('div', { style: { ...box, gap: 4 } },
1038
+ h('label', { style: { display: 'flex', alignItems: 'baseline', gap: 8 } }, h('input', {
1039
+ type: 'checkbox', checked: draft.useRefs, 'aria-describedby': refHint,
1040
+ onChange: event => {
1041
+ const useRefs = event.currentTarget.checked
1042
+ edit(old => ({ ...old, useRefs, ...emptySecrets() }), 'credentials')
1043
+ },
1044
+ }), t('useRefs')),
1045
+ h('small', { id: refHint, style: message }, t('useRefsHint')),
1046
+ ),
1047
+ ),
1048
+ ),
1049
+ ),
1050
+ h('footer', { className: 'tapd-actions' }, feedback,
1051
+ h('button', { type: 'submit', className: 'tapd-button', 'data-tone': 'primary', disabled },
1052
+ t(pending === 'save' ? 'saving' : 'save')),
1053
+ ),
1054
+ ) : h('div', { className: 'tapd-standalone-note' }, feedback),
1055
+ )
1056
+ }
1057
+
1058
+ return {
1059
+ inject: ['slots', 'locale', 'connection'],
1060
+ apply(ctx) {
1061
+ ctx.effect(() => ctx.locale.register(NS, { en, zh }))
1062
+ const request = (operation, input, signal) => ctx.connection.rpc.call('/api', 'tavlo-tapd/settings', { operation, input }, signal)
1063
+ ctx.slots.inject(SLOT, () => ctx.slots.register({ name: SLOT, key: PACKAGE, locale: NS },
1064
+ ({ t, view }) => view === 'page' ? h(SettingsForm, { t, request }) : null,
1065
+ ))
1066
+ },
1067
+ }
1068
+ },
1069
+ })