chatluna-plugin-onebot-sandbox 1.0.1 → 1.1.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/README.md +1 -0
- package/client/chat/composer.tsx +4 -2
- package/client/environment/entity-dialog.css +4 -0
- package/client/environment/entity-dialog.tsx +72 -3
- package/client/locales/en.yml +11 -0
- package/client/locales/zh.yml +11 -0
- package/client/workspace/media-cache.ts +38 -0
- package/client/workspace/store.ts +28 -9
- package/dist/.vite/manifest.json +1 -1
- package/dist/app-SGdVOART.js +85 -0
- package/dist/client.css +1 -1
- package/dist/client.js +1 -1
- package/lib/bot.d.ts +4 -1
- package/lib/bot.d.ts.map +1 -1
- package/lib/channel-assignee.d.ts +4 -3
- package/lib/channel-assignee.d.ts.map +1 -1
- package/lib/chatluna/conversation-lines.d.ts +41 -27
- package/lib/chatluna/conversation-lines.d.ts.map +1 -1
- package/lib/chatluna/model-calls.d.ts +68 -0
- package/lib/chatluna/model-calls.d.ts.map +1 -0
- package/lib/chatluna/presets.d.ts +142 -0
- package/lib/chatluna/presets.d.ts.map +1 -0
- package/lib/chatluna/runtime.d.ts +14 -0
- package/lib/chatluna/runtime.d.ts.map +1 -1
- package/lib/chatluna/state.d.ts +13 -4
- package/lib/chatluna/state.d.ts.map +1 -1
- package/lib/chatluna/wakeup.d.ts +2 -2
- package/lib/chatluna/wakeup.d.ts.map +1 -1
- package/lib/console-contract.d.ts +21 -1
- package/lib/console-contract.d.ts.map +1 -1
- package/lib/console.d.ts +2 -1
- package/lib/console.d.ts.map +1 -1
- package/lib/control-service.d.ts +10 -0
- package/lib/control-service.d.ts.map +1 -1
- package/lib/conversation-resolution.d.ts +17 -0
- package/lib/conversation-resolution.d.ts.map +1 -1
- package/lib/inbound-delivery.d.ts +17 -8
- package/lib/inbound-delivery.d.ts.map +1 -1
- package/lib/index.d.ts +4 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1244 -212
- package/lib/index.js.map +1 -1
- package/lib/mcp/http-api.d.ts.map +1 -1
- package/lib/mcp/service.d.ts +11 -1
- package/lib/mcp/service.d.ts.map +1 -1
- package/lib/mcp/tool-registry.d.ts +6 -0
- package/lib/mcp/tool-registry.d.ts.map +1 -1
- package/lib/onebot-profiles.d.ts +8 -0
- package/lib/onebot-profiles.d.ts.map +1 -1
- package/lib/test-spaces.d.ts.map +1 -1
- package/lib/webui.d.ts.map +1 -1
- package/package.json +5 -1
- package/dist/app-sK3yIFCF.js +0 -85
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import*as e from"react";import t,{createContext as n,createElement as r,forwardRef as i,isValidElement as a,useCallback as o,useContext as s,useEffect as c,useId as l,useImperativeHandle as u,useLayoutEffect as d,useMemo as f,useRef as p,useState as m,useSyncExternalStore as h}from"react";import{useNavigate as g,useParams as _,useSearchParams as v}from"react-router";import{Fragment as y,jsx as b,jsxs as x}from"react/jsx-runtime";import{Button as S}from"@base-ui/react/button";import{Dialog as C}from"@base-ui/react/dialog";import{Input as w}from"@base-ui/react/input";import{Tooltip as T}from"@base-ui/react/tooltip";import{Popover as E}from"@base-ui/react/popover";import{AlertDialog as D}from"@base-ui/react/alert-dialog";import{mergeProps as O}from"@base-ui/react/merge-props";import{useRender as k}from"@base-ui/react/use-render";import{Checkbox as A}from"@base-ui/react/checkbox";import{Collapsible as j}from"@base-ui/react/collapsible";import{Combobox as M}from"@base-ui/react";import{ContextMenu as N}from"@base-ui/react/context-menu";import{ScrollArea as ee}from"@base-ui/react/scroll-area";import{Select as te}from"@base-ui/react/select";import{Switch as P}from"@base-ui/react/switch";import{Tabs as F}from"@base-ui/react/tabs";import{apiErrorMessage as ne,callAction as re,toast as I,useLive as L,useLocale as ie,useTranslate as ae}from"@chatluna/ui-client/client";import{readStored as R,writeStored as z}from"@chatluna/ui-storage";import{createPortal as oe}from"react-dom";import{SchemaForm as se,useFormValidation as ce}from"@chatluna/ui-schema-form/client";var le=Object.create,ue=Object.defineProperty,de=Object.getOwnPropertyDescriptor,fe=Object.getOwnPropertyNames,pe=Object.getPrototypeOf,me=Object.prototype.hasOwnProperty,he=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(e){throw n=[e],e}},ge=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),_e=(e,t)=>{let n={};for(var r in e)ue(n,r,{get:e[r],enumerable:!0});return t||ue(n,Symbol.toStringTag,{value:`Module`}),n},ve=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=fe(t),a=0,o=i.length,s;a<o;a++)s=i[a],!me.call(e,s)&&s!==n&&ue(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=de(t,s))||r.enumerable});return e},ye=(e,t,n)=>(n=e==null?{}:le(pe(e)),ve(t||!e||!e.__esModule||!me.call(e,`default`)?ue(n,`default`,{value:e,enumerable:!0}):n,e)),be=e=>me.call(e,`module.exports`)?e[`module.exports`]:ve(ue({},`__esModule`,{value:!0}),e);function xe(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=xe(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function Se(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=xe(e))&&(r&&(r+=` `),r+=t);return r}var Ce=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},we=(e,t)=>({classGroupId:e,validator:t}),Te=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Ee=`-`,De=[],Oe=`arbitrary..`,ke=e=>{let t=Me(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return je(e);let n=e.split(Ee);return Ae(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?Ce(i,t):t:i||De}return n[e]||De}}},Ae=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=Ae(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(Ee):e.slice(t).join(Ee),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},je=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?Oe+r:void 0})(),Me=e=>{let{theme:t,classGroups:n}=e;return Ne(n,t)},Ne=(e,t)=>{let n=Te();for(let r in e){let i=e[r];Pe(i,n,r,t)}return n},Pe=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];Fe(i,t,n,r)}},Fe=(e,t,n,r)=>{if(typeof e==`string`){Ie(e,t,n);return}if(typeof e==`function`){Le(e,t,n,r);return}Re(e,t,n,r)},Ie=(e,t,n)=>{let r=e===``?t:ze(t,e);r.classGroupId=n},Le=(e,t,n,r)=>{if(Be(e)){Pe(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(we(n,e))},Re=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];Pe(o,ze(t,a),n,r)}},ze=(e,t)=>{let n=e,r=t.split(Ee),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=Te(),n.nextPart.set(t,i)),n=i}return n},Be=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,Ve=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},He=`!`,Ue=`:`,We=[],Ge=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),Ke=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===Ue){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(He)?(c=s.slice(0,-1),l=!0):s.startsWith(He)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return Ge(t,l,c,u)};if(t){let e=t+Ue,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):Ge(We,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},qe=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},Je=e=>({cache:Ve(e.cacheSize),parseClassName:Ke(e),sortModifiers:qe(e),postfixLookupClassGroupIds:Ye(e),...ke(e)}),Ye=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},Xe=/\s+/,Ze=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(Xe),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+He:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},Qe=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=$e(n))&&(i&&(i+=` `),i+=r);return i},$e=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=$e(e[r]))&&(n&&(n+=` `),n+=t);return n},et=(e,...t)=>{let n,r,i,a,o=o=>(n=Je(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=Ze(e,n);return i(e,a),a};return a=o,(...e)=>a(Qe(...e))},tt=[],nt=e=>{let t=t=>t[e]||tt;return t.isThemeGetter=!0,t},rt=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,it=/^\((?:(\w[\w-]*):)?(.+)\)$/i,at=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,ot=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,st=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,ct=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,lt=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ut=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,dt=e=>at.test(e),B=e=>!!e&&!Number.isNaN(Number(e)),ft=e=>!!e&&Number.isInteger(Number(e)),pt=e=>e.endsWith(`%`)&&B(e.slice(0,-1)),mt=e=>ot.test(e),ht=()=>!0,gt=e=>st.test(e)&&!ct.test(e),_t=()=>!1,vt=e=>lt.test(e),yt=e=>ut.test(e),bt=e=>!V(e)&&!H(e),xt=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),St=e=>Lt(e,Vt,_t),V=e=>rt.test(e),Ct=e=>Lt(e,Ht,gt),wt=e=>Lt(e,Ut,B),Tt=e=>Lt(e,Gt,ht),Et=e=>Lt(e,Wt,_t),Dt=e=>Lt(e,zt,_t),Ot=e=>Lt(e,Bt,yt),kt=e=>Lt(e,Kt,vt),H=e=>it.test(e),At=e=>Rt(e,Ht),jt=e=>Rt(e,Wt),Mt=e=>Rt(e,zt),Nt=e=>Rt(e,Vt),Pt=e=>Rt(e,Bt),Ft=e=>Rt(e,Kt,!0),It=e=>Rt(e,Gt,!0),Lt=(e,t,n)=>{let r=rt.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Rt=(e,t,n=!1)=>{let r=it.exec(e);return r?r[1]?t(r[1]):n:!1},zt=e=>e===`position`||e===`percentage`,Bt=e=>e===`image`||e===`url`,Vt=e=>e===`length`||e===`size`||e===`bg-size`,Ht=e=>e===`length`,Ut=e=>e===`number`,Wt=e=>e===`family-name`,Gt=e=>e===`number`||e===`weight`,Kt=e=>e===`shadow`,qt=et(()=>{let e=nt(`color`),t=nt(`font`),n=nt(`text`),r=nt(`font-weight`),i=nt(`tracking`),a=nt(`leading`),o=nt(`breakpoint`),s=nt(`container`),c=nt(`spacing`),l=nt(`radius`),u=nt(`shadow`),d=nt(`inset-shadow`),f=nt(`text-shadow`),p=nt(`drop-shadow`),m=nt(`blur`),h=nt(`perspective`),g=nt(`aspect`),_=nt(`ease`),v=nt(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),H,V],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[H,V,c],T=()=>[dt,`full`,`auto`,...w()],E=()=>[ft,`none`,`subgrid`,H,V],D=()=>[`auto`,{span:[`full`,ft,H,V]},ft,H,V],O=()=>[ft,`auto`,H,V],k=()=>[`auto`,`min`,`max`,`fr`,H,V],A=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],j=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],M=()=>[`auto`,...w()],N=()=>[dt,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],ee=()=>[dt,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],te=()=>[dt,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],P=()=>[e,H,V],F=()=>[...b(),Mt,Dt,{position:[H,V]}],ne=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],re=()=>[`auto`,`cover`,`contain`,Nt,St,{size:[H,V]}],I=()=>[pt,At,Ct],L=()=>[``,`none`,`full`,l,H,V],ie=()=>[``,B,At,Ct],ae=()=>[`solid`,`dashed`,`dotted`,`double`],R=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],z=()=>[B,pt,Mt,Dt],oe=()=>[``,`none`,m,H,V],se=()=>[`none`,B,H,V],ce=()=>[`none`,B,H,V],le=()=>[B,H,V],ue=()=>[dt,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[mt],breakpoint:[mt],color:[ht],container:[mt],"drop-shadow":[mt],ease:[`in`,`out`,`in-out`],font:[bt],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[mt],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[mt],shadow:[mt],spacing:[`px`,B],text:[mt],"text-shadow":[mt],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,dt,V,H,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,H,V]}],"container-named":[xt],columns:[{columns:[B,V,H,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[ft,`auto`,H,V]}],basis:[{basis:[dt,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[B,dt,`auto`,`initial`,`none`,V]}],grow:[{grow:[``,B,H,V]}],shrink:[{shrink:[``,B,H,V]}],order:[{order:[ft,`first`,`last`,`none`,H,V]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...A(),`normal`]}],"justify-items":[{"justify-items":[...j(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...j()]}],"align-content":[{content:[`normal`,...A()]}],"align-items":[{items:[...j(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...j(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":A()}],"place-items":[{"place-items":[...j(),`baseline`]}],"place-self":[{"place-self":[`auto`,...j()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mbs:[{mbs:M()}],mbe:[{mbe:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:N()}],"inline-size":[{inline:[`auto`,...ee()]}],"min-inline-size":[{"min-inline":[`auto`,...ee()]}],"max-inline-size":[{"max-inline":[`none`,...ee()]}],"block-size":[{block:[`auto`,...te()]}],"min-block-size":[{"min-block":[`auto`,...te()]}],"max-block-size":[{"max-block":[`none`,...te()]}],w:[{w:[s,`screen`,...N()]}],"min-w":[{"min-w":[s,`screen`,`none`,...N()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...N()]}],h:[{h:[`screen`,`lh`,...N()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...N()]}],"max-h":[{"max-h":[`screen`,`lh`,...N()]}],"font-size":[{text:[`base`,n,At,Ct]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,It,Tt]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,pt,V]}],"font-family":[{font:[jt,Et,t]}],"font-features":[{"font-features":[V]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,H,V]}],"line-clamp":[{"line-clamp":[B,`none`,H,wt]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,H,V]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,H,V]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:P()}],"text-color":[{text:P()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...ae(),`wavy`]}],"text-decoration-thickness":[{decoration:[B,`from-font`,`auto`,H,Ct]}],"text-decoration-color":[{decoration:P()}],"underline-offset":[{"underline-offset":[B,`auto`,H,V]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[ft,H,V]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,H,V]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,H,V]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:F()}],"bg-repeat":[{bg:ne()}],"bg-size":[{bg:re()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},ft,H,V],radial:[``,H,V],conic:[ft,H,V]},Pt,Ot]}],"bg-color":[{bg:P()}],"gradient-from-pos":[{from:I()}],"gradient-via-pos":[{via:I()}],"gradient-to-pos":[{to:I()}],"gradient-from":[{from:P()}],"gradient-via":[{via:P()}],"gradient-to":[{to:P()}],rounded:[{rounded:L()}],"rounded-s":[{"rounded-s":L()}],"rounded-e":[{"rounded-e":L()}],"rounded-t":[{"rounded-t":L()}],"rounded-r":[{"rounded-r":L()}],"rounded-b":[{"rounded-b":L()}],"rounded-l":[{"rounded-l":L()}],"rounded-ss":[{"rounded-ss":L()}],"rounded-se":[{"rounded-se":L()}],"rounded-ee":[{"rounded-ee":L()}],"rounded-es":[{"rounded-es":L()}],"rounded-tl":[{"rounded-tl":L()}],"rounded-tr":[{"rounded-tr":L()}],"rounded-br":[{"rounded-br":L()}],"rounded-bl":[{"rounded-bl":L()}],"border-w":[{border:ie()}],"border-w-x":[{"border-x":ie()}],"border-w-y":[{"border-y":ie()}],"border-w-s":[{"border-s":ie()}],"border-w-e":[{"border-e":ie()}],"border-w-bs":[{"border-bs":ie()}],"border-w-be":[{"border-be":ie()}],"border-w-t":[{"border-t":ie()}],"border-w-r":[{"border-r":ie()}],"border-w-b":[{"border-b":ie()}],"border-w-l":[{"border-l":ie()}],"divide-x":[{"divide-x":ie()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":ie()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...ae(),`hidden`,`none`]}],"divide-style":[{divide:[...ae(),`hidden`,`none`]}],"border-color":[{border:P()}],"border-color-x":[{"border-x":P()}],"border-color-y":[{"border-y":P()}],"border-color-s":[{"border-s":P()}],"border-color-e":[{"border-e":P()}],"border-color-bs":[{"border-bs":P()}],"border-color-be":[{"border-be":P()}],"border-color-t":[{"border-t":P()}],"border-color-r":[{"border-r":P()}],"border-color-b":[{"border-b":P()}],"border-color-l":[{"border-l":P()}],"divide-color":[{divide:P()}],"outline-style":[{outline:[...ae(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[B,H,V]}],"outline-w":[{outline:[``,B,At,Ct]}],"outline-color":[{outline:P()}],shadow:[{shadow:[``,`none`,u,Ft,kt]}],"shadow-color":[{shadow:P()}],"inset-shadow":[{"inset-shadow":[`none`,d,Ft,kt]}],"inset-shadow-color":[{"inset-shadow":P()}],"ring-w":[{ring:ie()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:P()}],"ring-offset-w":[{"ring-offset":[B,Ct]}],"ring-offset-color":[{"ring-offset":P()}],"inset-ring-w":[{"inset-ring":ie()}],"inset-ring-color":[{"inset-ring":P()}],"text-shadow":[{"text-shadow":[`none`,f,Ft,kt]}],"text-shadow-color":[{"text-shadow":P()}],opacity:[{opacity:[B,H,V]}],"mix-blend":[{"mix-blend":[...R(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":R()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[B]}],"mask-image-linear-from-pos":[{"mask-linear-from":z()}],"mask-image-linear-to-pos":[{"mask-linear-to":z()}],"mask-image-linear-from-color":[{"mask-linear-from":P()}],"mask-image-linear-to-color":[{"mask-linear-to":P()}],"mask-image-t-from-pos":[{"mask-t-from":z()}],"mask-image-t-to-pos":[{"mask-t-to":z()}],"mask-image-t-from-color":[{"mask-t-from":P()}],"mask-image-t-to-color":[{"mask-t-to":P()}],"mask-image-r-from-pos":[{"mask-r-from":z()}],"mask-image-r-to-pos":[{"mask-r-to":z()}],"mask-image-r-from-color":[{"mask-r-from":P()}],"mask-image-r-to-color":[{"mask-r-to":P()}],"mask-image-b-from-pos":[{"mask-b-from":z()}],"mask-image-b-to-pos":[{"mask-b-to":z()}],"mask-image-b-from-color":[{"mask-b-from":P()}],"mask-image-b-to-color":[{"mask-b-to":P()}],"mask-image-l-from-pos":[{"mask-l-from":z()}],"mask-image-l-to-pos":[{"mask-l-to":z()}],"mask-image-l-from-color":[{"mask-l-from":P()}],"mask-image-l-to-color":[{"mask-l-to":P()}],"mask-image-x-from-pos":[{"mask-x-from":z()}],"mask-image-x-to-pos":[{"mask-x-to":z()}],"mask-image-x-from-color":[{"mask-x-from":P()}],"mask-image-x-to-color":[{"mask-x-to":P()}],"mask-image-y-from-pos":[{"mask-y-from":z()}],"mask-image-y-to-pos":[{"mask-y-to":z()}],"mask-image-y-from-color":[{"mask-y-from":P()}],"mask-image-y-to-color":[{"mask-y-to":P()}],"mask-image-radial":[{"mask-radial":[H,V]}],"mask-image-radial-from-pos":[{"mask-radial-from":z()}],"mask-image-radial-to-pos":[{"mask-radial-to":z()}],"mask-image-radial-from-color":[{"mask-radial-from":P()}],"mask-image-radial-to-color":[{"mask-radial-to":P()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[B]}],"mask-image-conic-from-pos":[{"mask-conic-from":z()}],"mask-image-conic-to-pos":[{"mask-conic-to":z()}],"mask-image-conic-from-color":[{"mask-conic-from":P()}],"mask-image-conic-to-color":[{"mask-conic-to":P()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:F()}],"mask-repeat":[{mask:ne()}],"mask-size":[{mask:re()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,H,V]}],filter:[{filter:[``,`none`,H,V]}],blur:[{blur:oe()}],brightness:[{brightness:[B,H,V]}],contrast:[{contrast:[B,H,V]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,Ft,kt]}],"drop-shadow-color":[{"drop-shadow":P()}],grayscale:[{grayscale:[``,B,H,V]}],"hue-rotate":[{"hue-rotate":[B,H,V]}],invert:[{invert:[``,B,H,V]}],saturate:[{saturate:[B,H,V]}],sepia:[{sepia:[``,B,H,V]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,H,V]}],"backdrop-blur":[{"backdrop-blur":oe()}],"backdrop-brightness":[{"backdrop-brightness":[B,H,V]}],"backdrop-contrast":[{"backdrop-contrast":[B,H,V]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,B,H,V]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[B,H,V]}],"backdrop-invert":[{"backdrop-invert":[``,B,H,V]}],"backdrop-opacity":[{"backdrop-opacity":[B,H,V]}],"backdrop-saturate":[{"backdrop-saturate":[B,H,V]}],"backdrop-sepia":[{"backdrop-sepia":[``,B,H,V]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,H,V]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[B,`initial`,H,V]}],ease:[{ease:[`linear`,`initial`,_,H,V]}],delay:[{delay:[B,H,V]}],animate:[{animate:[`none`,v,H,V]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,H,V]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:se()}],"rotate-x":[{"rotate-x":se()}],"rotate-y":[{"rotate-y":se()}],"rotate-z":[{"rotate-z":se()}],scale:[{scale:ce()}],"scale-x":[{"scale-x":ce()}],"scale-y":[{"scale-y":ce()}],"scale-z":[{"scale-z":ce()}],"scale-3d":[`scale-3d`],skew:[{skew:le()}],"skew-x":[{"skew-x":le()}],"skew-y":[{"skew-y":le()}],transform:[{transform:[H,V,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:ue()}],"translate-x":[{"translate-x":ue()}],"translate-y":[{"translate-y":ue()}],"translate-z":[{"translate-z":ue()}],"translate-none":[`translate-none`],zoom:[{zoom:[ft,H,V]}],accent:[{accent:P()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:P()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,H,V]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":P()}],"scrollbar-track-color":[{"scrollbar-track":P()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,H,V]}],fill:[{fill:[`none`,...P()]}],"stroke-w":[{stroke:[B,At,Ct,wt]}],stroke:[{stroke:[`none`,...P()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function U(...e){return qt(Se(e))}var Jt=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),Yt=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),Xt=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),Zt=e=>{let t=Xt(e);return t.charAt(0).toUpperCase()+t.slice(1)},Qt={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`},$t=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},en=n({}),tn=()=>s(en),nn=i(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:i,className:a=``,children:o,iconNode:s,...c},l)=>{let{size:u=24,strokeWidth:d=2,absoluteStrokeWidth:f=!1,color:p=`currentColor`,className:m=``}=tn()??{},h=i??f?Number(n??d)*24/Number(t??u):n??d;return r(`svg`,{ref:l,...Qt,width:t??u??Qt.width,height:t??u??Qt.height,stroke:e??p,strokeWidth:h,className:Jt(`lucide`,m,a),...!o&&!$t(c)&&{"aria-hidden":`true`},...c},[...s.map(([e,t])=>r(e,t)),...Array.isArray(o)?o:[o]])}),rn=(e,t)=>{let n=i(({className:n,...i},a)=>r(nn,{ref:a,iconNode:t,className:Jt(`lucide-${Yt(Zt(e))}`,`lucide-${e}`,n),...i}));return n.displayName=Zt(e),n},an=rn(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),on=rn(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),sn=rn(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),cn=rn(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),ln=rn(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),un=rn(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),dn=rn(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),fn=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,pn=Se,mn=(e,t)=>n=>{if(t?.variants==null)return pn(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=fn(t)||fn(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return pn(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},hn=mn(`group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-[13px] font-medium whitespace-nowrap transition-[background-color,border-color,color,scale] duration-150 ease-spring outline-none select-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring active:not-aria-[haspopup]:scale-[0.97] disabled:pointer-events-none disabled:opacity-40 aria-invalid:border-destructive motion-reduce:active:scale-100 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 max-sm:has-[>[data-slot=button-label]]:aspect-square max-sm:has-[>[data-slot=button-label]]:px-0!`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-[color-mix(in_oklab,var(--primary),var(--primary-foreground)_14%)] active:bg-[color-mix(in_oklab,var(--primary),var(--primary-foreground)_20%)]`,outline:`border-input bg-control hover:border-muted-foreground/60 hover:bg-foreground/4 aria-expanded:bg-foreground/6`,secondary:`bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklab,var(--secondary),var(--foreground)_6%)] active:bg-[color-mix(in_oklab,var(--secondary),var(--foreground)_10%)] aria-expanded:bg-[color-mix(in_oklab,var(--secondary),var(--foreground)_6%)]`,ghost:`hover:bg-foreground/6 active:bg-foreground/10 aria-expanded:bg-foreground/6`,destructive:`bg-destructive/10 text-destructive hover:bg-destructive/16 active:bg-destructive/22 focus-visible:outline-destructive`,link:`text-primary underline-offset-4 hover:underline active:scale-100`},size:{default:`h-[30px] gap-1.5 px-3 has-data-[icon=inline-end]:pr-2.5 has-data-[icon=inline-start]:pl-2.5`,xs:`h-[22px] gap-1 rounded-md px-2 text-xs has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-[26px] gap-1 rounded-md px-2.5 text-[12.5px] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 gap-1.5 px-4 text-sm has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3`,icon:`size-[30px]`,"icon-xs":`size-[22px] rounded-md [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-[26px] rounded-md`,"icon-lg":`size-9`}},defaultVariants:{variant:`default`,size:`default`}});function W({className:e,variant:t=`default`,size:n=`default`,...r}){return b(S,{"data-slot":`button`,className:U(hn({variant:t,size:n,className:e})),...r})}function gn({...e}){return b(C.Root,{"data-slot":`dialog`,...e})}function _n({...e}){return b(C.Portal,{"data-slot":`dialog-portal`,...e})}function vn({className:e,...t}){return b(C.Backdrop,{forceRender:!0,"data-slot":`dialog-overlay`,className:U(`fixed inset-0 isolate z-50 bg-linear-to-b from-scrim-from to-scrim-to duration-200 data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}function yn({className:e,children:t,showCloseButton:n=!0,...r}){return x(_n,{children:[b(vn,{}),x(C.Popup,{"data-slot":`dialog-content`,className:U(`[--control:var(--popover)] fixed top-1/2 left-1/2 z-50 grid max-h-[calc(100dvh-2rem)] w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 overflow-y-auto rounded-[20px] bg-popover p-5 text-sm text-popover-foreground shadow-[0_24px_64px_rgb(0_0_0/0.22)] ring-1 ring-border duration-200 ease-spring outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...r,children:[t,n&&x(C.Close,{"data-slot":`dialog-close`,render:b(W,{variant:`ghost`,className:`absolute top-2 right-2 z-20`,size:`icon-sm`}),children:[b(dn,{}),b(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function bn({className:e,...t}){return b(`div`,{"data-slot":`dialog-header`,className:U(`sticky top-0 z-10 flex shrink-0 flex-col gap-2 bg-popover`,e),...t})}function xn({className:e,showCloseButton:t=!1,children:n,...r}){return x(`div`,{"data-slot":`dialog-footer`,className:U(`sticky bottom-0 z-10 flex shrink-0 flex-col-reverse gap-2 bg-popover pt-2 sm:flex-row sm:justify-end`,e),...r,children:[n,t&&b(C.Close,{render:b(W,{variant:`outline`}),children:`Close`})]})}function Sn({className:e,...t}){return b(C.Title,{"data-slot":`dialog-title`,className:U(`text-base leading-none font-medium`,e),...t})}function Cn({className:e,...t}){return b(C.Description,{"data-slot":`dialog-description`,className:U(`text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground`,e),...t})}function wn({className:e,...t}){return b(`textarea`,{"data-slot":`textarea`,className:U(`flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-control px-2.5 py-2 text-(length:--field-text) leading-normal [--field-text:1rem] transition-colors duration-150 outline-none placeholder:text-muted-foreground/70 hover:border-muted-foreground/60 focus-visible:border-primary disabled:cursor-not-allowed disabled:border-border disabled:bg-muted disabled:text-muted-foreground aria-invalid:border-destructive md:[--field-text:13px] pointer-coarse:text-base!`,e),...t})}function Tn({className:e,type:t,...n}){return b(w,{type:t,"data-slot":`input`,className:U(`h-[30px] w-full min-w-0 text-ellipsis rounded-lg border border-input bg-control px-2.5 py-1 text-(length:--field-text) leading-normal [--field-text:1rem] transition-colors duration-150 outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground/70 hover:border-muted-foreground/60 focus-visible:border-primary disabled:pointer-events-none disabled:cursor-not-allowed disabled:border-border disabled:bg-muted disabled:text-muted-foreground aria-invalid:border-destructive md:[--field-text:13px] pointer-coarse:text-base!`,e),...n})}function En({className:e,...t}){return b(`div`,{"data-slot":`input-group`,role:`group`,className:U(`group/input-group relative flex h-[30px] w-full min-w-0 items-center rounded-lg border border-input bg-control transition-colors duration-150 outline-none hover:border-muted-foreground/60 in-data-[slot=combobox-content]:focus-within:border-inherit has-[[data-slot=input-group-control]:disabled]:border-border has-[[data-slot=input-group-control]:disabled]:bg-muted has-[[data-slot=input-group-control]:disabled]:text-muted-foreground has-[[data-slot=input-group-control]:focus-visible]:border-primary has-[[data-slot][aria-invalid=true]]:border-destructive has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5`,e),...t})}var Dn=mn(`flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4`,{variants:{align:{"inline-start":`order-first pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem]`,"inline-end":`order-last pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem]`,"block-start":`order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2`,"block-end":`order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2`}},defaultVariants:{align:`inline-start`}});function On({className:e,align:t=`inline-start`,...n}){return b(`div`,{role:`group`,"data-slot":`input-group-addon`,"data-align":t,className:U(Dn({align:t}),e),onClick:e=>{!e.currentTarget.contains(e.target)||e.target.closest(`button`)||e.currentTarget.parentElement?.querySelector(`input`)?.focus()},...n})}function kn({className:e,...t}){return b(Tn,{"data-slot":`input-group-control`,className:U(`flex-1 rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent`,e),...t})}e.createContext({size:`default`,variant:`default`,spacing:2,orientation:`horizontal`});function An({delay:e=0,...t}){return b(T.Provider,{"data-slot":`tooltip-provider`,delay:e,...t})}function jn({...e}){return b(T.Root,{"data-slot":`tooltip`,...e})}function Mn({...e}){return b(T.Trigger,{"data-slot":`tooltip-trigger`,...e})}function Nn({className:e,side:t=`top`,sideOffset:n=6,align:r=`center`,alignOffset:i=0,children:a,...o}){return b(T.Portal,{children:b(T.Positioner,{align:r,alignOffset:i,side:t,sideOffset:n,className:`isolate z-50`,children:b(T.Popup,{"data-slot":`tooltip-content`,className:U(`z-50 inline-flex w-max max-w-[min(20rem,var(--available-width))] origin-(--transform-origin) items-center gap-1.5 rounded-lg bg-foreground px-2 py-1 text-xs leading-4 text-background shadow-popup duration-150 ease-fluid has-data-[slot=kbd]:pr-1 dark:bg-popover dark:text-popover-foreground dark:ring-1 dark:ring-border data-[side=bottom]:slide-in-from-top-1 data-[side=inline-end]:slide-in-from-left-1 data-[side=inline-start]:slide-in-from-right-1 data-[side=left]:slide-in-from-right-1 data-[side=right]:slide-in-from-left-1 data-[side=top]:slide-in-from-bottom-1 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 motion-reduce:animate-none`,e),...o,children:a})})})}e.createContext(null),e.createContext(null);function Pn({...e}){return b(E.Root,{"data-slot":`popover`,...e})}function Fn({...e}){return b(E.Trigger,{"data-slot":`popover-trigger`,...e})}function In({align:e=`center`,alignOffset:t=0,side:n=`bottom`,sideOffset:r=4,className:i,...a}){return b(E.Portal,{children:b(E.Positioner,{align:e,alignOffset:t,side:n,sideOffset:r,className:`isolate z-50`,children:b(E.Popup,{"data-slot":`popover-content`,className:U(`[--control:var(--popover)] z-50 flex max-h-(--available-height) w-72 max-w-(--available-width) flex-col gap-2.5 origin-(--transform-origin) overflow-y-auto rounded-xl bg-popover p-2.5 text-sm text-popover-foreground shadow-popup ring-1 ring-border outline-hidden duration-200 ease-fluid data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,i),...a})})})}typeof navigator<`u`&&/Mac|iPhone|iPad/.test(navigator.userAgent);var Ln=mn(`group/alert relative grid w-full gap-0.5 rounded-lg border px-2.5 py-2 text-left text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-card text-card-foreground`,destructive:`bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 *:[svg]:text-current`}},defaultVariants:{variant:`default`}});function Rn({className:e,variant:t,...n}){return b(`div`,{"data-slot":`alert`,role:`alert`,className:U(Ln({variant:t}),e),...n})}function zn({className:e,...t}){return b(`div`,{"data-slot":`alert-description`,className:U(`text-sm text-balance text-muted-foreground md:text-pretty [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-4`,e),...t})}function Bn({...e}){return b(D.Root,{"data-slot":`alert-dialog`,...e})}function Vn({...e}){return b(D.Portal,{"data-slot":`alert-dialog-portal`,...e})}function Hn({className:e,...t}){return b(D.Backdrop,{forceRender:!0,"data-slot":`alert-dialog-overlay`,className:U(`fixed inset-0 isolate z-50 bg-linear-to-b from-scrim-from to-scrim-to duration-200 data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}function Un({className:e,size:t=`default`,...n}){return x(Vn,{children:[b(Hn,{}),b(D.Popup,{"data-slot":`alert-dialog-content`,"data-size":t,className:U(`[--control:var(--popover)] group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 gap-4 rounded-[20px] bg-popover p-5 text-popover-foreground shadow-[0_24px_64px_rgb(0_0_0/0.22)] ring-1 ring-border duration-200 ease-spring outline-none data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...n})]})}function Wn({className:e,...t}){return b(`div`,{"data-slot":`alert-dialog-header`,className:U(`grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-4 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]`,e),...t})}function Gn({className:e,...t}){return b(`div`,{"data-slot":`alert-dialog-footer`,className:U(`flex flex-col-reverse gap-2 pt-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end`,e),...t})}function Kn({className:e,...t}){return b(D.Title,{"data-slot":`alert-dialog-title`,className:U(`text-base font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2`,e),...t})}function qn({className:e,...t}){return b(D.Description,{"data-slot":`alert-dialog-description`,className:U(`text-sm text-balance text-muted-foreground md:text-pretty *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground`,e),...t})}function Jn({className:e,...t}){return b(W,{"data-slot":`alert-dialog-action`,className:U(e),...t})}function Yn({className:e,variant:t=`outline`,size:n=`default`,...r}){return b(D.Close,{"data-slot":`alert-dialog-cancel`,className:U(e),render:b(W,{variant:t,size:n}),...r})}var Xn=mn(`group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-md border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-colors focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive [&>svg]:pointer-events-none [&>svg]:size-3!`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,secondary:`bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80`,destructive:`bg-destructive/10 text-destructive focus-visible:outline-destructive dark:bg-destructive/16 [a]:hover:bg-destructive/20`,outline:`border-input text-foreground [a]:hover:bg-muted`,ghost:`hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50`,link:`text-primary underline-offset-4 hover:underline`}},defaultVariants:{variant:`default`}});function Zn({className:e,variant:t=`default`,render:n,...r}){return k({defaultTagName:`span`,props:O({className:U(Xn({variant:t}),e)},r),render:n,state:{slot:`badge`,variant:t}})}function Qn(e,t,n=`long`){return new Intl.DateTimeFormat(`en-US`,{hour:`numeric`,timeZone:e,timeZoneName:n}).format(t).split(/\s/g).slice(2).join(` `)}var $n={},er={};function tr(e,t){try{let n=($n[e]||=new Intl.DateTimeFormat(`en-US`,{timeZone:e,timeZoneName:`longOffset`}).format)(t).split(`GMT`)[1];return n in er?er[n]:rr(n,n.split(`:`))}catch{if(e in er)return er[e];let t=e?.match(nr);return t?rr(e,t.slice(1)):NaN}}var nr=/([+-]\d\d):?(\d\d)?/;function rr(e,t){let n=+(t[0]||0),r=+(t[1]||0),i=(t[2]||0)/60;return er[e]=n*60+r>0?n*60+r+i:n*60-r-i}var ir=class e extends Date{constructor(...e){super(),e.length>1&&typeof e[e.length-1]==`string`&&(this.timeZone=e.pop()),this.internal=new Date,isNaN(tr(this.timeZone,this))?this.setTime(NaN):e.length?typeof e[0]==`number`&&(e.length===1||e.length===2&&typeof e[1]!=`number`)?this.setTime(e[0]):typeof e[0]==`string`?this.setTime(+new Date(e[0])):e[0]instanceof Date?this.setTime(+e[0]):(this.setTime(+new Date(...e)),cr(this,e)):this.setTime(Date.now())}static tz(t,...n){return n.length?new e(...n,t):new e(Date.now(),t)}withTimeZone(t){return new e(+this,t)}getTimezoneOffset(){let e=-tr(this.timeZone,this);return e>0?Math.floor(e):Math.ceil(e)}setTime(e){return Date.prototype.setTime.apply(this,arguments),or(this),+this}[Symbol.for(`constructDateFrom`)](t){return new e(+new Date(t),this.timeZone)}},ar=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!ar.test(e))return;let t=e.replace(ar,`$1UTC`);ir.prototype[t]&&(e.startsWith(`get`)?ir.prototype[e]=function(){return this.internal[t]()}:(ir.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),sr(this),+this},ir.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),or(this),+this}))});function or(e){e.internal.setTime(+e),e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(-tr(e.timeZone,e)*60))}function sr(e){Date.prototype.setFullYear.call(e,e.internal.getUTCFullYear(),e.internal.getUTCMonth(),e.internal.getUTCDate()),Date.prototype.setHours.call(e,e.internal.getUTCHours(),e.internal.getUTCMinutes(),e.internal.getUTCSeconds(),e.internal.getUTCMilliseconds()),cr(e)}function cr(e,t){let n=Array.isArray(t)?lr(t):+e.internal,r=tr(e.timeZone,e),i=r>0?Math.floor(r):Math.ceil(r),a=new Date(+e);a.setUTCHours(a.getUTCHours()-1);let o=-new Date(+e).getTimezoneOffset(),s=-new Date(+a).getTimezoneOffset(),c=o-s,l=o;if(c&&o!==i&&Date.prototype.getHours.apply(e)!==(Array.isArray(t)?t[3]||0:e.internal.getUTCHours())){let t=new Date(+e),n=o-i;n&&t.setUTCMinutes(t.getUTCMinutes()+n);let r=tr(e.timeZone,t);(r>0?Math.floor(r):Math.ceil(r))===i&&(l=s)}let u=l-i;u&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+u);let d=new Date(+e);d.setUTCSeconds(0);let f=o>0?d.getSeconds():(d.getSeconds()-60)%60,p=Math.round(-(tr(e.timeZone,e)*60))%60;(p||f)&&Date.prototype.setUTCSeconds.call(e,Date.prototype.getUTCSeconds.call(e)+p+f);let m=tr(e.timeZone,e),h=m>0?Math.floor(m):Math.ceil(m),g=-new Date(+e).getTimezoneOffset()-h,_=h!==i,v=g-u,y=h-i,b=n-h*60*1e3,x=y>0&&ur(e)-n===y*60*1e3&&ur(e,b)!==n;if(_&&v&&!x){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+v);let t=tr(e.timeZone,e),n=h-(t>0?Math.floor(t):Math.ceil(t));n&&v<0&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+n)}or(e);let S=(t?n:n+p*1e3)-+e.internal;S&&Math.abs(S)<18e5&&(Date.prototype.setTime.call(e,+e+S),or(e))}function lr(e){return Date.UTC(e[0],e.length>1?e[1]:0,e.length>2?e[2]:1,...e.slice(3))}function ur(e,t){let n=new Date(t??+e);return n.setUTCSeconds(n.getUTCSeconds()-Math.round(-tr(e.timeZone,n)*60)),+n}var dr=class e extends ir{static tz(t,...n){return n.length?new e(...n,t):new e(Date.now(),t)}toISOString(){let[e,t,n]=this.tzComponents(),r=`${e}${t}:${n}`;return this.internal.toISOString().slice(0,-1)+r}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){let[e,t,n,r]=this.internal.toUTCString().split(` `);return`${e?.slice(0,-1)} ${n} ${t} ${r}`}toTimeString(){let e=this.internal.toUTCString().split(` `)[4],[t,n,r]=this.tzComponents();return`${e} GMT${t}${n}${r} (${Qn(this.timeZone,this)})`}toLocaleString(e,t){return Date.prototype.toLocaleString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}toLocaleDateString(e,t){return Date.prototype.toLocaleDateString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}toLocaleTimeString(e,t){return Date.prototype.toLocaleTimeString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}tzComponents(){let e=this.getTimezoneOffset();return[e>0?`-`:`+`,String(Math.floor(Math.abs(e)/60)).padStart(2,`0`),String(Math.abs(e)%60).padStart(2,`0`)]}withTimeZone(t){return new e(+this,t)}[Symbol.for(`constructDateFrom`)](t){return new e(+new Date(t),this.timeZone)}},fr=365.2425,pr=6048e5,mr=864e5,hr=86400;hr*7,hr*fr/12*3;var gr=Symbol.for(`constructDateFrom`);function _r(e,t){return typeof e==`function`?e(t):e&&typeof e==`object`&&gr in e?e[gr](t):e instanceof Date?new e.constructor(t):new Date(t)}function vr(e,t){return _r(t||e,e)}function yr(e,t,n){let r=vr(e,n?.in);return isNaN(t)?_r(n?.in||e,NaN):(t&&r.setDate(r.getDate()+t),r)}function br(e,t,n){let r=vr(e,n?.in);if(isNaN(t))return _r(n?.in||e,NaN);if(!t)return r;let i=r.getDate(),a=_r(n?.in||e,r.getTime());return a.setMonth(r.getMonth()+t+1,0),i>=a.getDate()?a:(r.setFullYear(a.getFullYear(),a.getMonth(),i),r)}var xr={};function Sr(){return xr}function Cr(e,t){let n=Sr(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=vr(e,t?.in),a=i.getDay(),o=(a<r?7:0)+a-r;return i.setDate(i.getDate()-o),i.setHours(0,0,0,0),i}function wr(e,t){return Cr(e,{...t,weekStartsOn:1})}function Tr(e,t){let n=vr(e,t?.in),r=n.getFullYear(),i=_r(n,0);i.setFullYear(r+1,0,4),i.setHours(0,0,0,0);let a=wr(i),o=_r(n,0);o.setFullYear(r,0,4),o.setHours(0,0,0,0);let s=wr(o);return n.getTime()>=a.getTime()?r+1:n.getTime()>=s.getTime()?r:r-1}function Er(e){let t=vr(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),e-+n}function Dr(e,...t){let n=_r.bind(null,e||t.find(e=>typeof e==`object`));return t.map(n)}function Or(e,t){let n=vr(e,t?.in);return n.setHours(0,0,0,0),n}function kr(e,t,n){let[r,i]=Dr(n?.in,e,t),a=Or(r),o=Or(i),s=+a-Er(a),c=+o-Er(o);return Math.round((s-c)/mr)}function Ar(e,t){let n=Tr(e,t),r=_r(t?.in||e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),wr(r)}function jr(e,t,n){return yr(e,t*7,n)}function Mr(e,t,n){return br(e,t*12,n)}function Nr(e,t){let n,r=t?.in;return e.forEach(e=>{!r&&typeof e==`object`&&(r=_r.bind(null,e));let t=vr(e,r);(!n||n<t||isNaN(+t))&&(n=t)}),_r(r,n||NaN)}function Pr(e,t){let n,r=t?.in;return e.forEach(e=>{!r&&typeof e==`object`&&(r=_r.bind(null,e));let t=vr(e,r);(!n||n>t||isNaN(+t))&&(n=t)}),_r(r,n||NaN)}function Fr(e,t,n){let[r,i]=Dr(n?.in,e,t);return+Or(r)==+Or(i)}function Ir(e){return e instanceof Date||typeof e==`object`&&Object.prototype.toString.call(e)===`[object Date]`}function Lr(e){return!(!Ir(e)&&typeof e!=`number`||isNaN(+vr(e)))}function Rr(e,t,n){let[r,i]=Dr(n?.in,e,t),a=r.getFullYear()-i.getFullYear(),o=r.getMonth()-i.getMonth();return a*12+o}function zr(e,t){let n=vr(e,t?.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function Br(e,t){let[n,r]=Dr(e,t.start,t.end);return{start:n,end:r}}function Vr(e,t){let{start:n,end:r}=Br(t?.in,e),i=+n>+r,a=i?+n:+r,o=i?r:n;o.setHours(0,0,0,0),o.setDate(1);let s=t?.step??1;if(!s)return[];s<0&&(s=-s,i=!i);let c=[];for(;+o<=a;)c.push(_r(n,o)),o.setMonth(o.getMonth()+s);return i?c.reverse():c}function Hr(e,t){let n=vr(e,t?.in);return n.setDate(1),n.setHours(0,0,0,0),n}function Ur(e,t){let n=vr(e,t?.in),r=n.getFullYear();return n.setFullYear(r+1,0,0),n.setHours(23,59,59,999),n}function Wr(e,t){let n=vr(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function Gr(e,t){let{start:n,end:r}=Br(t?.in,e),i=+n>+r,a=i?+n:+r,o=i?r:n;o.setHours(0,0,0,0),o.setMonth(0,1);let s=t?.step??1;if(!s)return[];s<0&&(s=-s,i=!i);let c=[];for(;+o<=a;)c.push(_r(n,o)),o.setFullYear(o.getFullYear()+s);return i?c.reverse():c}function Kr(e,t){let n=Sr(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=vr(e,t?.in),a=i.getDay(),o=(a<r?-7:0)+6-(a-r);return i.setDate(i.getDate()+o),i.setHours(23,59,59,999),i}function qr(e,t){return Kr(e,{...t,weekStartsOn:1})}var Jr={lessThanXSeconds:{one:`less than a second`,other:`less than {{count}} seconds`},xSeconds:{one:`1 second`,other:`{{count}} seconds`},halfAMinute:`half a minute`,lessThanXMinutes:{one:`less than a minute`,other:`less than {{count}} minutes`},xMinutes:{one:`1 minute`,other:`{{count}} minutes`},aboutXHours:{one:`about 1 hour`,other:`about {{count}} hours`},xHours:{one:`1 hour`,other:`{{count}} hours`},xDays:{one:`1 day`,other:`{{count}} days`},aboutXWeeks:{one:`about 1 week`,other:`about {{count}} weeks`},xWeeks:{one:`1 week`,other:`{{count}} weeks`},aboutXMonths:{one:`about 1 month`,other:`about {{count}} months`},xMonths:{one:`1 month`,other:`{{count}} months`},aboutXYears:{one:`about 1 year`,other:`about {{count}} years`},xYears:{one:`1 year`,other:`{{count}} years`},overXYears:{one:`over 1 year`,other:`over {{count}} years`},almostXYears:{one:`almost 1 year`,other:`almost {{count}} years`}},Yr=(e,t,n)=>{let r,i=Jr[e];return r=typeof i==`string`?i:t===1?i.one:i.other.replace(`{{count}}`,t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?`in `+r:r+` ago`:r};function Xr(e){return(t={})=>{let n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}var Zr={date:Xr({formats:{full:`EEEE, MMMM do, y`,long:`MMMM do, y`,medium:`MMM d, y`,short:`MM/dd/yyyy`},defaultWidth:`full`}),time:Xr({formats:{full:`h:mm:ss a zzzz`,long:`h:mm:ss a z`,medium:`h:mm:ss a`,short:`h:mm a`},defaultWidth:`full`}),dateTime:Xr({formats:{full:`{{date}} 'at' {{time}}`,long:`{{date}} 'at' {{time}}`,medium:`{{date}}, {{time}}`,short:`{{date}}, {{time}}`},defaultWidth:`full`})},Qr={lastWeek:`'last' eeee 'at' p`,yesterday:`'yesterday at' p`,today:`'today at' p`,tomorrow:`'tomorrow at' p`,nextWeek:`eeee 'at' p`,other:`P`},$r=(e,t,n,r)=>Qr[e];function ei(e){return(t,n)=>{let r=n?.context?String(n.context):`standalone`,i;if(r===`formatting`&&e.formattingValues){let t=e.defaultFormattingWidth||e.defaultWidth,r=n?.width?String(n.width):t;i=e.formattingValues[r]||e.formattingValues[t]}else{let t=e.defaultWidth,r=n?.width?String(n.width):e.defaultWidth;i=e.values[r]||e.values[t]}let a=e.argumentCallback?e.argumentCallback(t):t;return i[a]}}var ti={ordinalNumber:(e,t)=>{let n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+`st`;case 2:return n+`nd`;case 3:return n+`rd`}return n+`th`},era:ei({values:{narrow:[`B`,`A`],abbreviated:[`BC`,`AD`],wide:[`Before Christ`,`Anno Domini`]},defaultWidth:`wide`}),quarter:ei({values:{narrow:[`1`,`2`,`3`,`4`],abbreviated:[`Q1`,`Q2`,`Q3`,`Q4`],wide:[`1st quarter`,`2nd quarter`,`3rd quarter`,`4th quarter`]},defaultWidth:`wide`,argumentCallback:e=>e-1}),month:ei({values:{narrow:[`J`,`F`,`M`,`A`,`M`,`J`,`J`,`A`,`S`,`O`,`N`,`D`],abbreviated:[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],wide:[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`]},defaultWidth:`wide`}),day:ei({values:{narrow:[`S`,`M`,`T`,`W`,`T`,`F`,`S`],short:[`Su`,`Mo`,`Tu`,`We`,`Th`,`Fr`,`Sa`],abbreviated:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],wide:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`]},defaultWidth:`wide`}),dayPeriod:ei({values:{narrow:{am:`a`,pm:`p`,midnight:`mi`,noon:`n`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},abbreviated:{am:`AM`,pm:`PM`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`}},defaultWidth:`wide`,formattingValues:{narrow:{am:`a`,pm:`p`,midnight:`mi`,noon:`n`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`},abbreviated:{am:`AM`,pm:`PM`,midnight:`midnight`,noon:`noon`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`midnight`,noon:`noon`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`}},defaultFormattingWidth:`wide`})};function ni(e){return(t,n={})=>{let r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(i);if(!a)return null;let o=a[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(s)?ii(s,e=>e.test(o)):ri(s,e=>e.test(o)),l;l=e.valueCallback?e.valueCallback(c):c,l=n.valueCallback?n.valueCallback(l):l;let u=t.slice(o.length);return{value:l,rest:u}}}function ri(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function ii(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function ai(e){return(t,n={})=>{let r=t.match(e.matchPattern);if(!r)return null;let i=r[0],a=t.match(e.parsePattern);if(!a)return null;let o=e.valueCallback?e.valueCallback(a[0]):a[0];o=n.valueCallback?n.valueCallback(o):o;let s=t.slice(i.length);return{value:o,rest:s}}}var oi={code:`en-US`,formatDistance:Yr,formatLong:Zr,formatRelative:$r,localize:ti,match:{ordinalNumber:ai({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:ni({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:`any`}),quarter:ni({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:`any`,valueCallback:e=>e+1}),month:ni({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:`any`}),day:ni({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:`any`}),dayPeriod:ni({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:`any`,parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:`any`})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function si(e,t){let n=vr(e,t?.in);return kr(n,Wr(n))+1}function ci(e,t){let n=vr(e,t?.in),r=wr(n)-+Ar(n);return Math.round(r/pr)+1}function li(e,t){let n=vr(e,t?.in),r=n.getFullYear(),i=Sr(),a=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,o=_r(t?.in||e,0);o.setFullYear(r+1,0,a),o.setHours(0,0,0,0);let s=Cr(o,t),c=_r(t?.in||e,0);c.setFullYear(r,0,a),c.setHours(0,0,0,0);let l=Cr(c,t);return+n>=+s?r+1:+n>=+l?r:r-1}function ui(e,t){let n=Sr(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=li(e,t),a=_r(t?.in||e,0);return a.setFullYear(i,0,r),a.setHours(0,0,0,0),Cr(a,t)}function di(e,t){let n=vr(e,t?.in),r=Cr(n,t)-+ui(n,t);return Math.round(r/pr)+1}function fi(e,t){return(e<0?`-`:``)+Math.abs(e).toString().padStart(t,`0`)}var pi={y(e,t){let n=e.getFullYear(),r=n>0?n:1-n;return fi(t===`yy`?r%100:r,t.length)},M(e,t){let n=e.getMonth();return t===`M`?String(n+1):fi(n+1,2)},d(e,t){return fi(e.getDate(),t.length)},a(e,t){let n=e.getHours()/12>=1?`pm`:`am`;switch(t){case`a`:case`aa`:return n.toUpperCase();case`aaa`:return n;case`aaaaa`:return n[0];default:return n===`am`?`a.m.`:`p.m.`}},h(e,t){return fi(e.getHours()%12||12,t.length)},H(e,t){return fi(e.getHours(),t.length)},m(e,t){return fi(e.getMinutes(),t.length)},s(e,t){return fi(e.getSeconds(),t.length)},S(e,t){let n=t.length,r=e.getMilliseconds();return fi(Math.trunc(r*10**(n-3)),t.length)}},mi={am:`am`,pm:`pm`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},hi={G:function(e,t,n){let r=+(e.getFullYear()>0);switch(t){case`G`:case`GG`:case`GGG`:return n.era(r,{width:`abbreviated`});case`GGGGG`:return n.era(r,{width:`narrow`});default:return n.era(r,{width:`wide`})}},y:function(e,t,n){if(t===`yo`){let t=e.getFullYear(),r=t>0?t:1-t;return n.ordinalNumber(r,{unit:`year`})}return pi.y(e,t)},Y:function(e,t,n,r){let i=li(e,r),a=i>0?i:1-i;return t===`YY`?fi(a%100,2):t===`Yo`?n.ordinalNumber(a,{unit:`year`}):fi(a,t.length)},R:function(e,t){return fi(Tr(e),t.length)},u:function(e,t){return fi(e.getFullYear(),t.length)},Q:function(e,t,n){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case`Q`:return String(r);case`QQ`:return fi(r,2);case`Qo`:return n.ordinalNumber(r,{unit:`quarter`});case`QQQ`:return n.quarter(r,{width:`abbreviated`,context:`formatting`});case`QQQQQ`:return n.quarter(r,{width:`narrow`,context:`formatting`});default:return n.quarter(r,{width:`wide`,context:`formatting`})}},q:function(e,t,n){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case`q`:return String(r);case`qq`:return fi(r,2);case`qo`:return n.ordinalNumber(r,{unit:`quarter`});case`qqq`:return n.quarter(r,{width:`abbreviated`,context:`standalone`});case`qqqqq`:return n.quarter(r,{width:`narrow`,context:`standalone`});default:return n.quarter(r,{width:`wide`,context:`standalone`})}},M:function(e,t,n){let r=e.getMonth();switch(t){case`M`:case`MM`:return pi.M(e,t);case`Mo`:return n.ordinalNumber(r+1,{unit:`month`});case`MMM`:return n.month(r,{width:`abbreviated`,context:`formatting`});case`MMMMM`:return n.month(r,{width:`narrow`,context:`formatting`});default:return n.month(r,{width:`wide`,context:`formatting`})}},L:function(e,t,n){let r=e.getMonth();switch(t){case`L`:return String(r+1);case`LL`:return fi(r+1,2);case`Lo`:return n.ordinalNumber(r+1,{unit:`month`});case`LLL`:return n.month(r,{width:`abbreviated`,context:`standalone`});case`LLLLL`:return n.month(r,{width:`narrow`,context:`standalone`});default:return n.month(r,{width:`wide`,context:`standalone`})}},w:function(e,t,n,r){let i=di(e,r);return t===`wo`?n.ordinalNumber(i,{unit:`week`}):fi(i,t.length)},I:function(e,t,n){let r=ci(e);return t===`Io`?n.ordinalNumber(r,{unit:`week`}):fi(r,t.length)},d:function(e,t,n){return t===`do`?n.ordinalNumber(e.getDate(),{unit:`date`}):pi.d(e,t)},D:function(e,t,n){let r=si(e);return t===`Do`?n.ordinalNumber(r,{unit:`dayOfYear`}):fi(r,t.length)},E:function(e,t,n){let r=e.getDay();switch(t){case`E`:case`EE`:case`EEE`:return n.day(r,{width:`abbreviated`,context:`formatting`});case`EEEEE`:return n.day(r,{width:`narrow`,context:`formatting`});case`EEEEEE`:return n.day(r,{width:`short`,context:`formatting`});default:return n.day(r,{width:`wide`,context:`formatting`})}},e:function(e,t,n,r){let i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case`e`:return String(a);case`ee`:return fi(a,2);case`eo`:return n.ordinalNumber(a,{unit:`day`});case`eee`:return n.day(i,{width:`abbreviated`,context:`formatting`});case`eeeee`:return n.day(i,{width:`narrow`,context:`formatting`});case`eeeeee`:return n.day(i,{width:`short`,context:`formatting`});default:return n.day(i,{width:`wide`,context:`formatting`})}},c:function(e,t,n,r){let i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case`c`:return String(a);case`cc`:return fi(a,t.length);case`co`:return n.ordinalNumber(a,{unit:`day`});case`ccc`:return n.day(i,{width:`abbreviated`,context:`standalone`});case`ccccc`:return n.day(i,{width:`narrow`,context:`standalone`});case`cccccc`:return n.day(i,{width:`short`,context:`standalone`});default:return n.day(i,{width:`wide`,context:`standalone`})}},i:function(e,t,n){let r=e.getDay(),i=r===0?7:r;switch(t){case`i`:return String(i);case`ii`:return fi(i,t.length);case`io`:return n.ordinalNumber(i,{unit:`day`});case`iii`:return n.day(r,{width:`abbreviated`,context:`formatting`});case`iiiii`:return n.day(r,{width:`narrow`,context:`formatting`});case`iiiiii`:return n.day(r,{width:`short`,context:`formatting`});default:return n.day(r,{width:`wide`,context:`formatting`})}},a:function(e,t,n){let r=e.getHours()/12>=1?`pm`:`am`;switch(t){case`a`:case`aa`:return n.dayPeriod(r,{width:`abbreviated`,context:`formatting`});case`aaa`:return n.dayPeriod(r,{width:`abbreviated`,context:`formatting`}).toLowerCase();case`aaaaa`:return n.dayPeriod(r,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(r,{width:`wide`,context:`formatting`})}},b:function(e,t,n){let r=e.getHours(),i;switch(i=r===12?mi.noon:r===0?mi.midnight:r/12>=1?`pm`:`am`,t){case`b`:case`bb`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`});case`bbb`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`}).toLowerCase();case`bbbbb`:return n.dayPeriod(i,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(i,{width:`wide`,context:`formatting`})}},B:function(e,t,n){let r=e.getHours(),i;switch(i=r>=17?mi.evening:r>=12?mi.afternoon:r>=4?mi.morning:mi.night,t){case`B`:case`BB`:case`BBB`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`});case`BBBBB`:return n.dayPeriod(i,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(i,{width:`wide`,context:`formatting`})}},h:function(e,t,n){if(t===`ho`){let t=e.getHours()%12;return t===0&&(t=12),n.ordinalNumber(t,{unit:`hour`})}return pi.h(e,t)},H:function(e,t,n){return t===`Ho`?n.ordinalNumber(e.getHours(),{unit:`hour`}):pi.H(e,t)},K:function(e,t,n){let r=e.getHours()%12;return t===`Ko`?n.ordinalNumber(r,{unit:`hour`}):fi(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t===`ko`?n.ordinalNumber(r,{unit:`hour`}):fi(r,t.length)},m:function(e,t,n){return t===`mo`?n.ordinalNumber(e.getMinutes(),{unit:`minute`}):pi.m(e,t)},s:function(e,t,n){return t===`so`?n.ordinalNumber(e.getSeconds(),{unit:`second`}):pi.s(e,t)},S:function(e,t){return pi.S(e,t)},X:function(e,t,n){let r=e.getTimezoneOffset();if(r===0)return`Z`;switch(t){case`X`:return _i(r);case`XXXX`:case`XX`:return vi(r);default:return vi(r,`:`)}},x:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`x`:return _i(r);case`xxxx`:case`xx`:return vi(r);default:return vi(r,`:`)}},O:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`O`:case`OO`:case`OOO`:return`GMT`+gi(r,`:`);default:return`GMT`+vi(r,`:`)}},z:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`z`:case`zz`:case`zzz`:return`GMT`+gi(r,`:`);default:return`GMT`+vi(r,`:`)}},t:function(e,t,n){return fi(Math.trunc(e/1e3),t.length)},T:function(e,t,n){return fi(+e,t.length)}};function gi(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=Math.trunc(r/60),a=r%60;return a===0?n+String(i):n+String(i)+t+fi(a,2)}function _i(e,t){return e%60==0?(e>0?`-`:`+`)+fi(Math.abs(e)/60,2):vi(e,t)}function vi(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=fi(Math.trunc(r/60),2),a=fi(r%60,2);return n+i+t+a}var yi=(e,t)=>{switch(e){case`P`:return t.date({width:`short`});case`PP`:return t.date({width:`medium`});case`PPP`:return t.date({width:`long`});default:return t.date({width:`full`})}},bi=(e,t)=>{switch(e){case`p`:return t.time({width:`short`});case`pp`:return t.time({width:`medium`});case`ppp`:return t.time({width:`long`});default:return t.time({width:`full`})}},xi={p:bi,P:(e,t)=>{let n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return yi(e,t);let a;switch(r){case`P`:a=t.dateTime({width:`short`});break;case`PP`:a=t.dateTime({width:`medium`});break;case`PPP`:a=t.dateTime({width:`long`});break;default:a=t.dateTime({width:`full`})}return a.replace(`{{date}}`,yi(r,t)).replace(`{{time}}`,bi(i,t))}},Si=/^D+$/,Ci=/^Y+$/,wi=[`D`,`DD`,`YY`,`YYYY`];function Ti(e){return Si.test(e)}function Ei(e){return Ci.test(e)}function Di(e,t,n){let r=Oi(e,t,n);if(console.warn(r),wi.includes(e))throw RangeError(r)}function Oi(e,t,n){let r=e[0]===`Y`?`years`:`days of the month`;return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}var ki=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Ai=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ji=/^'([^]*?)'?$/,Mi=/''/g,Ni=/[a-zA-Z]/;function Pi(e,t,n){let r=Sr(),i=n?.locale??r.locale??oi,a=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,o=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,s=vr(e,n?.in);if(!Lr(s))throw RangeError(`Invalid time value`);let c=t.match(Ai).map(e=>{let t=e[0];if(t===`p`||t===`P`){let n=xi[t];return n(e,i.formatLong)}return e}).join(``).match(ki).map(e=>{if(e===`''`)return{isToken:!1,value:`'`};let t=e[0];if(t===`'`)return{isToken:!1,value:Fi(e)};if(hi[t])return{isToken:!0,value:e};if(t.match(Ni))throw RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}});i.localize.preprocessor&&(c=i.localize.preprocessor(s,c));let l={firstWeekContainsDate:a,weekStartsOn:o,locale:i};return c.map(r=>{if(!r.isToken)return r.value;let a=r.value;(!n?.useAdditionalWeekYearTokens&&Ei(a)||!n?.useAdditionalDayOfYearTokens&&Ti(a))&&Di(a,t,String(e));let o=hi[a[0]];return o(s,a,i.localize,l)}).join(``)}function Fi(e){let t=e.match(ji);return t?t[1].replace(Mi,`'`):e}function Ii(e,t){let n=vr(e,t?.in),r=n.getFullYear(),i=n.getMonth(),a=_r(n,0);return a.setFullYear(r,i+1,0),a.setHours(0,0,0,0),a.getDate()}function Li(e,t){return vr(e,t?.in).getMonth()}function Ri(e,t){return vr(e,t?.in).getFullYear()}function zi(e,t){return+vr(e)>+vr(t)}function Bi(e,t){return+vr(e)<+vr(t)}function Vi(e,t,n){let[r,i]=Dr(n?.in,e,t);return r.getFullYear()===i.getFullYear()&&r.getMonth()===i.getMonth()}function Hi(e,t,n){let[r,i]=Dr(n?.in,e,t);return r.getFullYear()===i.getFullYear()}function Ui(e,t,n){let r=vr(e,n?.in),i=r.getFullYear(),a=r.getDate(),o=_r(n?.in||e,0);o.setFullYear(i,t,15),o.setHours(0,0,0,0);let s=Ii(o);return r.setMonth(t,Math.min(a,s)),r}function Wi(e,t,n){let r=vr(e,n?.in);return isNaN(+r)?_r(n?.in||e,NaN):(r.setFullYear(t),r)}var Gi=5,Ki=4;function qi(e,t){let n=t.startOfMonth(e),r=n.getDay()>0?n.getDay():7,i=t.addDays(e,-r+1),a=t.addDays(i,34);return t.getMonth(e)===t.getMonth(a)?Gi:Ki}function Ji(e,t){let n=t.startOfMonth(e),r=n.getDay();return r===1?n:r===0?t.addDays(n,-6):t.addDays(n,-1*(r-1))}function Yi(e,t){let n=Ji(e,t),r=qi(e,t);return t.addDays(n,r*7-1)}var Xi={...oi,labels:{labelDayButton:(e,t,n,r)=>{let i;i=r&&typeof r.format==`function`?r.format.bind(r):(e,t)=>Pi(e,t,{locale:oi,...n});let a=i(e,`PPPP`);return t.today&&(a=`Today, ${a}`),t.selected&&(a=`${a}, selected`),a},labelMonthDropdown:`Choose the Month`,labelNext:`Go to the Next Month`,labelPrevious:`Go to the Previous Month`,labelWeekNumber:e=>`Week ${e}`,labelYearDropdown:`Choose the Year`,labelGrid:(e,t,n)=>{let r;return r=n&&typeof n.format==`function`?n.format.bind(n):(e,n)=>Pi(e,n,{locale:oi,...t}),r(e,`LLLL yyyy`)},labelGridcell:(e,t,n,r)=>{let i;i=r&&typeof r.format==`function`?r.format.bind(r):(e,t)=>Pi(e,t,{locale:oi,...n});let a=i(e,`PPPP`);return t?.today&&(a=`Today, ${a}`),a},labelNav:`Navigation bar`,labelWeekNumberHeader:`Week Number`,labelWeekday:(e,t,n)=>{let r;return r=n&&typeof n.format==`function`?n.format.bind(n):(e,n)=>Pi(e,n,{locale:oi,...t}),r(e,`cccc`)}}},Zi=class e{constructor(e,t){this.today=()=>this.overrides?.today?this.overrides.today():this.options.timeZone?dr.tz(this.options.timeZone):new(this.options.Date??Date),this.newDate=(e,t,n)=>this.overrides?.newDate?this.overrides.newDate(e,t,n):this.options.timeZone?new dr(e,t,n,this.options.timeZone):new Date(e,t,n),this.addDays=(e,t)=>this.overrides?.addDays?this.overrides.addDays(e,t):yr(e,t),this.addMonths=(e,t)=>this.overrides?.addMonths?this.overrides.addMonths(e,t):br(e,t),this.addWeeks=(e,t)=>this.overrides?.addWeeks?this.overrides.addWeeks(e,t):jr(e,t),this.addYears=(e,t)=>this.overrides?.addYears?this.overrides.addYears(e,t):Mr(e,t),this.differenceInCalendarDays=(e,t)=>this.overrides?.differenceInCalendarDays?this.overrides.differenceInCalendarDays(e,t):kr(e,t),this.differenceInCalendarMonths=(e,t)=>this.overrides?.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(e,t):Rr(e,t),this.eachMonthOfInterval=e=>this.overrides?.eachMonthOfInterval?this.overrides.eachMonthOfInterval(e):Vr(e),this.eachYearOfInterval=e=>{let t=this.overrides?.eachYearOfInterval?this.overrides.eachYearOfInterval(e):Gr(e),n=new Set(t.map(e=>this.getYear(e)));if(n.size===t.length)return t;let r=[];return n.forEach(e=>{r.push(new Date(e,0,1))}),r},this.endOfBroadcastWeek=e=>this.overrides?.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(e):Yi(e,this),this.endOfISOWeek=e=>this.overrides?.endOfISOWeek?this.overrides.endOfISOWeek(e):qr(e),this.endOfMonth=e=>this.overrides?.endOfMonth?this.overrides.endOfMonth(e):zr(e),this.endOfWeek=(e,t)=>this.overrides?.endOfWeek?this.overrides.endOfWeek(e,t):Kr(e,this.options),this.endOfYear=e=>this.overrides?.endOfYear?this.overrides.endOfYear(e):Ur(e),this.format=(e,t,n)=>{let r=this.overrides?.format?this.overrides.format(e,t,this.options):Pi(e,t,this.options);return this.options.numerals&&this.options.numerals!==`latn`?this.replaceDigits(r):r},this.getISOWeek=e=>this.overrides?.getISOWeek?this.overrides.getISOWeek(e):ci(e),this.getMonth=(e,t)=>this.overrides?.getMonth?this.overrides.getMonth(e,this.options):Li(e,this.options),this.getYear=(e,t)=>this.overrides?.getYear?this.overrides.getYear(e,this.options):Ri(e,this.options),this.getWeek=(e,t)=>this.overrides?.getWeek?this.overrides.getWeek(e,this.options):di(e,this.options),this.isAfter=(e,t)=>this.overrides?.isAfter?this.overrides.isAfter(e,t):zi(e,t),this.isBefore=(e,t)=>this.overrides?.isBefore?this.overrides.isBefore(e,t):Bi(e,t),this.isDate=e=>this.overrides?.isDate?this.overrides.isDate(e):Ir(e),this.isSameDay=(e,t)=>this.overrides?.isSameDay?this.overrides.isSameDay(e,t):Fr(e,t),this.isSameMonth=(e,t)=>this.overrides?.isSameMonth?this.overrides.isSameMonth(e,t):Vi(e,t),this.isSameYear=(e,t)=>this.overrides?.isSameYear?this.overrides.isSameYear(e,t):Hi(e,t),this.max=e=>this.overrides?.max?this.overrides.max(e):Nr(e),this.min=e=>this.overrides?.min?this.overrides.min(e):Pr(e),this.setMonth=(e,t)=>this.overrides?.setMonth?this.overrides.setMonth(e,t):Ui(e,t),this.setYear=(e,t)=>this.overrides?.setYear?this.overrides.setYear(e,t):Wi(e,t),this.startOfBroadcastWeek=(e,t)=>this.overrides?.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(e,this):Ji(e,this),this.startOfDay=e=>this.overrides?.startOfDay?this.overrides.startOfDay(e):Or(e),this.startOfISOWeek=e=>this.overrides?.startOfISOWeek?this.overrides.startOfISOWeek(e):wr(e),this.startOfMonth=e=>this.overrides?.startOfMonth?this.overrides.startOfMonth(e):Hr(e),this.startOfWeek=(e,t)=>this.overrides?.startOfWeek?this.overrides.startOfWeek(e,this.options):Cr(e,this.options),this.startOfYear=e=>this.overrides?.startOfYear?this.overrides.startOfYear(e):Wr(e),this.options={locale:Xi,...e},this.overrides=t}getDigitMap(){let{numerals:e=`latn`}=this.options,t=new Intl.NumberFormat(`en-US`,{numberingSystem:e}),n={};for(let e=0;e<10;e++)n[e.toString()]=t.format(e);return n}replaceDigits(e){let t=this.getDigitMap();return e.replace(/\d/g,e=>t[e]||e)}formatNumber(e){return this.replaceDigits(e.toString())}getMonthYearOrder(){let t=this.options.locale?.code;return t&&e.yearFirstLocales.has(t)?`year-first`:`month-first`}formatMonthYear(t){let{locale:n,timeZone:r,numerals:i}=this.options,a=n?.code;if(a&&e.yearFirstLocales.has(a))try{return new Intl.DateTimeFormat(a,{month:`long`,year:`numeric`,timeZone:r,numberingSystem:i}).format(t)}catch{}let o=this.getMonthYearOrder()===`year-first`?`y LLLL`:`LLLL y`;return this.format(t,o)}};Zi.yearFirstLocales=new Set([`eu`,`hu`,`ja`,`ja-Hira`,`ja-JP`,`ko`,`ko-KR`,`lt`,`lt-LT`,`lv`,`lv-LV`,`mn`,`mn-MN`,`zh`,`zh-CN`,`zh-HK`,`zh-TW`]);var Qi=new Zi,$i=class{constructor(e,t,n=Qi){this.date=e,this.displayMonth=t,this.outside=!!(t&&!n.isSameMonth(e,t)),this.dateLib=n,this.isoDate=n.format(e,`yyyy-MM-dd`),this.displayMonthId=n.format(t,`yyyy-MM`),this.dateMonthId=n.format(e,`yyyy-MM`)}isEqualTo(e){return this.dateLib.isSameDay(e.date,this.date)&&this.dateLib.isSameMonth(e.displayMonth,this.displayMonth)}},ea=class{constructor(e,t){this.date=e,this.weeks=t}},ta=class{constructor(e,t){this.days=t,this.weekNumber=e}};function na(e){return t.createElement(`span`,{...e})}function ra(e){let{size:n=24,orientation:r=`left`,className:i,style:a}=e;return t.createElement(`svg`,{className:i,style:a,width:n,height:n,viewBox:`0 0 24 24`},r===`up`&&t.createElement(`polygon`,{points:`6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28`}),r===`down`&&t.createElement(`polygon`,{points:`6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72`}),r===`left`&&t.createElement(`polygon`,{points:`16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20`}),r===`right`&&t.createElement(`polygon`,{points:`8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20`}))}function ia(e){let{day:n,modifiers:r,...i}=e;return t.createElement(`td`,{...i})}function aa(e){let{day:n,modifiers:r,...i}=e,a=t.useRef(null);return t.useEffect(()=>{r.focused&&a.current?.focus()},[r.focused]),t.createElement(`button`,{ref:a,...i})}var G;(function(e){e.Root=`root`,e.Chevron=`chevron`,e.Day=`day`,e.DayButton=`day_button`,e.CaptionLabel=`caption_label`,e.Dropdowns=`dropdowns`,e.Dropdown=`dropdown`,e.DropdownRoot=`dropdown_root`,e.Footer=`footer`,e.MonthGrid=`month_grid`,e.MonthCaption=`month_caption`,e.MonthsDropdown=`months_dropdown`,e.Month=`month`,e.Months=`months`,e.Nav=`nav`,e.NextMonthButton=`button_next`,e.PreviousMonthButton=`button_previous`,e.Week=`week`,e.Weeks=`weeks`,e.Weekday=`weekday`,e.Weekdays=`weekdays`,e.WeekNumber=`week_number`,e.WeekNumberHeader=`week_number_header`,e.YearsDropdown=`years_dropdown`})(G||={});var oa;(function(e){e.disabled=`disabled`,e.hidden=`hidden`,e.outside=`outside`,e.focused=`focused`,e.today=`today`})(oa||={});var sa;(function(e){e.range_end=`range_end`,e.range_middle=`range_middle`,e.range_start=`range_start`,e.selected=`selected`})(sa||={});var ca;(function(e){e.weeks_before_enter=`weeks_before_enter`,e.weeks_before_exit=`weeks_before_exit`,e.weeks_after_enter=`weeks_after_enter`,e.weeks_after_exit=`weeks_after_exit`,e.caption_after_enter=`caption_after_enter`,e.caption_after_exit=`caption_after_exit`,e.caption_before_enter=`caption_before_enter`,e.caption_before_exit=`caption_before_exit`})(ca||={});var la=n(void 0);function ua(){let e=s(la);if(e===void 0)throw Error(`useDayPicker() must be used within a custom component.`);return e}function da(e){let{options:n,className:r,...i}=e,{classNames:a,components:o,styles:s}=ua(),c=[a[G.Dropdown],r].join(` `),l=n?.find(({value:e})=>e===i.value);return t.createElement(`span`,{"data-disabled":i.disabled,className:a[G.DropdownRoot],style:s?.[G.DropdownRoot]},t.createElement(o.Select,{className:c,...i},n?.map(({value:e,label:n,disabled:r})=>t.createElement(o.Option,{key:e,value:e,disabled:r},n))),t.createElement(`span`,{className:a[G.CaptionLabel],style:s?.[G.CaptionLabel],"aria-hidden":!0},l?.label,t.createElement(o.Chevron,{orientation:`down`,size:18,className:a[G.Chevron],style:s?.[G.Chevron]})))}function fa(e){return t.createElement(`div`,{...e})}function pa(e){return t.createElement(`div`,{...e})}function ma(e){let{calendarMonth:n,displayIndex:r,...i}=e;return t.createElement(`div`,{...i},e.children)}function ha(e){let{calendarMonth:n,displayIndex:r,...i}=e;return t.createElement(`div`,{...i})}function ga(e){return t.createElement(`table`,{...e})}function _a(e){return t.createElement(`div`,{...e})}function va(e){let{components:n}=ua();return t.createElement(n.Dropdown,{...e})}function ya(e){let{onPreviousClick:n,onNextClick:r,previousMonth:i,nextMonth:a,...s}=e,{components:c,classNames:l,styles:u,labels:{labelPrevious:d,labelNext:f}}=ua(),p=o(e=>{a&&r?.(e)},[a,r]),m=o(e=>{i&&n?.(e)},[i,n]);return t.createElement(`nav`,{...s},t.createElement(c.PreviousMonthButton,{type:`button`,className:l[G.PreviousMonthButton],style:u?.[G.PreviousMonthButton],tabIndex:i?void 0:-1,"aria-disabled":!i||void 0,"aria-label":d(i),onClick:m},t.createElement(c.Chevron,{disabled:!i||void 0,className:l[G.Chevron],style:u?.[G.Chevron],orientation:`left`})),t.createElement(c.NextMonthButton,{type:`button`,className:l[G.NextMonthButton],style:u?.[G.NextMonthButton],tabIndex:a?void 0:-1,"aria-disabled":!a||void 0,"aria-label":f(a),onClick:p},t.createElement(c.Chevron,{disabled:!a||void 0,orientation:`right`,className:l[G.Chevron],style:u?.[G.Chevron]})))}function ba(e){return t.createElement(`button`,{...e})}function xa(e){return t.createElement(`option`,{...e})}function Sa(e){return t.createElement(`button`,{...e})}function Ca(e){let{rootRef:n,...r}=e;return t.createElement(`div`,{...r,ref:n})}function wa(e){return t.createElement(`select`,{...e})}function Ta(e){let{week:n,...r}=e;return t.createElement(`tr`,{...r})}function Ea(e){return t.createElement(`th`,{...e})}function Da(e){return t.createElement(`thead`,{"aria-hidden":!0},t.createElement(`tr`,{...e}))}function Oa(e){let{week:n,...r}=e;return t.createElement(`th`,{...r})}function ka(e){return t.createElement(`th`,{...e})}function Aa(e){return t.createElement(`tbody`,{...e})}function ja(e){let{components:n}=ua();return t.createElement(n.Dropdown,{...e})}var Ma=_e({CaptionLabel:()=>na,Chevron:()=>ra,Day:()=>ia,DayButton:()=>aa,Dropdown:()=>da,DropdownNav:()=>fa,Footer:()=>pa,Month:()=>ma,MonthCaption:()=>ha,MonthGrid:()=>ga,Months:()=>_a,MonthsDropdown:()=>va,Nav:()=>ya,NextMonthButton:()=>ba,Option:()=>xa,PreviousMonthButton:()=>Sa,Root:()=>Ca,Select:()=>wa,Week:()=>Ta,WeekNumber:()=>Oa,WeekNumberHeader:()=>ka,Weekday:()=>Ea,Weekdays:()=>Da,Weeks:()=>Aa,YearsDropdown:()=>ja});function Na(e,t,n=!1,r=Qi){let{from:i,to:a}=e,{differenceInCalendarDays:o,isSameDay:s}=r;return i&&a?(o(a,i)<0&&([i,a]=[a,i]),o(t,i)>=+!!n&&o(a,t)>=+!!n):!n&&a?s(a,t):!n&&i?s(i,t):!1}function Pa(e){return!!(e&&typeof e==`object`&&`before`in e&&`after`in e)}function Fa(e){return!!(e&&typeof e==`object`&&`from`in e)}function Ia(e){return!!(e&&typeof e==`object`&&`after`in e)}function La(e){return!!(e&&typeof e==`object`&&`before`in e)}function Ra(e){return!!(e&&typeof e==`object`&&`dayOfWeek`in e)}function za(e,t){return Array.isArray(e)&&e.every(t.isDate)}function Ba(e,t,n=Qi){let r=Array.isArray(t)?t:[t],{isSameDay:i,differenceInCalendarDays:a,isAfter:o}=n;return r.some(t=>{if(typeof t==`boolean`)return t;if(n.isDate(t))return i(e,t);if(za(t,n))return t.some(t=>i(e,t));if(Fa(t))return Na(t,e,!1,n);if(Ra(t))return Array.isArray(t.dayOfWeek)?t.dayOfWeek.includes(e.getDay()):t.dayOfWeek===e.getDay();if(Pa(t)){let n=a(t.before,e),r=a(t.after,e),i=n>0,s=r<0;return o(t.before,t.after)?s&&i:i||s}return Ia(t)?a(e,t.after)>0:La(t)?a(t.before,e)>0:typeof t==`function`&&t(e)})}function Va(e,t,n,r,i){let{disabled:a,hidden:o,modifiers:s,showOutsideDays:c,broadcastCalendar:l,today:u=i.today()}=t,{isSameDay:d,isSameMonth:f,startOfMonth:p,isBefore:m,endOfMonth:h,isAfter:g}=i,_=n&&p(n),v=r&&h(r),y={[oa.focused]:[],[oa.outside]:[],[oa.disabled]:[],[oa.hidden]:[],[oa.today]:[]},b={};for(let t of e){let{date:e,displayMonth:n}=t,r=!!(n&&!f(e,n)),p=!!(_&&m(e,_)),h=!!(v&&g(e,v)),x=!!(a&&Ba(e,a,i)),S=!!(o&&Ba(e,o,i))||p||h||!l&&!c&&r||l&&c===!1&&r,C=d(e,u);r&&y.outside.push(t),x&&y.disabled.push(t),S&&y.hidden.push(t),C&&y.today.push(t),s&&Object.keys(s).forEach(n=>{let r=s?.[n];r&&Ba(e,r,i)&&(b[n]?b[n].push(t):b[n]=[t])})}return e=>{let t={[oa.focused]:!1,[oa.disabled]:!1,[oa.hidden]:!1,[oa.outside]:!1,[oa.today]:!1},n={};for(let n in y)t[n]=y[n].some(t=>t===e);for(let t in b)n[t]=b[t].some(t=>t===e);return{...t,...n}}}function Ha(e,t,n={}){return Object.entries(e).filter(([,e])=>e===!0).reduce((e,[r])=>(n[r]?e.push(n[r]):t[oa[r]]?e.push(t[oa[r]]):t[sa[r]]&&e.push(t[sa[r]]),e),[t[G.Day]])}function Ua(e){return{...Ma,...e}}function Wa(e){let t={"data-mode":e.mode??void 0,"data-required":`required`in e?e.required:void 0,"data-multiple-months":e.numberOfMonths&&e.numberOfMonths>1||void 0,"data-week-numbers":e.showWeekNumber||void 0,"data-broadcast-calendar":e.broadcastCalendar||void 0,"data-nav-layout":e.navLayout||void 0};return Object.entries(e).forEach(([e,n])=>{e.startsWith(`data-`)&&(t[e]=n)}),t}function Ga(){let e={};for(let t in G)e[G[t]]=`rdp-${G[t]}`;for(let t in oa)e[oa[t]]=`rdp-${oa[t]}`;for(let t in sa)e[sa[t]]=`rdp-${sa[t]}`;for(let t in ca)e[ca[t]]=`rdp-${ca[t]}`;return e}function Ka(e,t,n){return(n??new Zi(t)).formatMonthYear(e)}function qa(e,t,n){return(n??new Zi(t)).format(e,`d`)}function Ja(e,t=Qi){return t.format(e,`LLLL`)}function Ya(e,t,n){return(n??new Zi(t)).format(e,`cccccc`)}function Xa(e,t=Qi){return e<10?t.formatNumber(`0${e.toLocaleString()}`):t.formatNumber(`${e.toLocaleString()}`)}function Za(){return``}function Qa(e,t=Qi){return t.format(e,`yyyy`)}var $a=_e({formatCaption:()=>Ka,formatDay:()=>qa,formatMonthDropdown:()=>Ja,formatWeekNumber:()=>Xa,formatWeekNumberHeader:()=>Za,formatWeekdayName:()=>Ya,formatYearDropdown:()=>Qa});function eo(e){return{...$a,...e}}function to(e,t,n,r){let i=(r??new Zi(n)).format(e,`PPPP`);return t.today&&(i=`Today, ${i}`),t.selected&&(i=`${i}, selected`),i}function no(e,t,n){return(n??new Zi(t)).formatMonthYear(e)}function ro(e,t,n,r){let i=(r??new Zi(n)).format(e,`PPPP`);return t?.today&&(i=`Today, ${i}`),i}function io(e){return`Choose the Month`}function ao(){return``}var oo=`Go to the Next Month`;function so(e,t){return oo}function co(e){return`Go to the Previous Month`}function lo(e,t,n){return(n??new Zi(t)).format(e,`cccc`)}function uo(e,t){return`Week ${e}`}function fo(e){return`Week Number`}function po(e){return`Choose the Year`}var mo=_e({labelDayButton:()=>to,labelGrid:()=>no,labelGridcell:()=>ro,labelMonthDropdown:()=>io,labelNav:()=>ao,labelNext:()=>so,labelPrevious:()=>co,labelWeekNumber:()=>uo,labelWeekNumberHeader:()=>fo,labelWeekday:()=>lo,labelYearDropdown:()=>po}),ho=(e,t,n)=>t||(n?typeof n==`function`?n:(...e)=>n:e);function go(e,t){let n=t.locale?.labels??{};return{...mo,...e??{},labelDayButton:ho(to,e?.labelDayButton,n.labelDayButton),labelMonthDropdown:ho(io,e?.labelMonthDropdown,n.labelMonthDropdown),labelNext:ho(so,e?.labelNext,n.labelNext),labelPrevious:ho(co,e?.labelPrevious,n.labelPrevious),labelWeekNumber:ho(uo,e?.labelWeekNumber,n.labelWeekNumber),labelYearDropdown:ho(po,e?.labelYearDropdown,n.labelYearDropdown),labelGrid:ho(no,e?.labelGrid,n.labelGrid),labelGridcell:ho(ro,e?.labelGridcell,n.labelGridcell),labelNav:ho(ao,e?.labelNav,n.labelNav),labelWeekNumberHeader:ho(fo,e?.labelWeekNumberHeader,n.labelWeekNumberHeader),labelWeekday:ho(lo,e?.labelWeekday,n.labelWeekday)}}function _o(e,t,n,r,i){let{startOfMonth:a,startOfYear:o,endOfYear:s,eachMonthOfInterval:c,getMonth:l}=i;return c({start:o(e),end:s(e)}).map(e=>{let o=r.formatMonthDropdown(e,i);return{value:l(e),label:o,disabled:t&&e<a(t)||n&&e>a(n)||!1}})}function vo(e,t={},n={}){let r={...t?.[G.Day]};return Object.entries(e).filter(([,e])=>e===!0).forEach(([e])=>{r={...r,...n?.[e]}}),r}function yo(e,t,n,r){let i=r??e.today(),a=n?e.startOfBroadcastWeek(i,e):t?e.startOfISOWeek(i):e.startOfWeek(i),o=[];for(let t=0;t<7;t++){let n=e.addDays(a,t);o.push(n)}return o}function bo(e,t,n,r,i=!1){if(!e||!t)return;let{startOfYear:a,endOfYear:o,eachYearOfInterval:s,getYear:c}=r,l=s({start:a(e),end:o(t)});return i&&l.reverse(),l.map(e=>{let t=n.formatYearDropdown(e,r);return{value:c(e),label:t,disabled:!1}})}function xo(e,t={}){let{weekStartsOn:n,locale:r}=t,i=n??r?.options?.weekStartsOn??0,a=t=>{let n=typeof t==`number`||typeof t==`string`?new Date(t):t;return new dr(n.getFullYear(),n.getMonth(),n.getDate(),12,0,0,e)},o=e=>{let t=a(e);return new Date(t.getFullYear(),t.getMonth(),t.getDate(),0,0,0,0)};return{today:()=>a(dr.tz(e)),newDate:(t,n,r)=>new dr(t,n,r,12,0,0,e),startOfDay:e=>a(e),startOfWeek:(e,t)=>{let n=a(e),r=t?.weekStartsOn??i,o=(n.getDay()-r+7)%7;return n.setDate(n.getDate()-o),n},startOfISOWeek:e=>{let t=a(e),n=(t.getDay()-1+7)%7;return t.setDate(t.getDate()-n),t},startOfMonth:e=>{let t=a(e);return t.setDate(1),t},startOfYear:e=>{let t=a(e);return t.setMonth(0,1),t},endOfWeek:(e,t)=>{let n=a(e),r=(((t?.weekStartsOn??i)+6)%7-n.getDay()+7)%7;return n.setDate(n.getDate()+r),n},endOfISOWeek:e=>{let t=a(e),n=(7-t.getDay())%7;return t.setDate(t.getDate()+n),t},endOfMonth:e=>{let t=a(e);return t.setMonth(t.getMonth()+1,0),t},endOfYear:e=>{let t=a(e);return t.setMonth(11,31),t},eachMonthOfInterval:t=>{let n=a(t.start),r=a(t.end),i=[],o=new dr(n.getFullYear(),n.getMonth(),1,12,0,0,e),s=r.getFullYear()*12+r.getMonth();for(;o.getFullYear()*12+o.getMonth()<=s;)i.push(new dr(o,e)),o.setMonth(o.getMonth()+1,1);return i},addDays:(e,t)=>{let n=a(e);return n.setDate(n.getDate()+t),n},addWeeks:(e,t)=>{let n=a(e);return n.setDate(n.getDate()+t*7),n},addMonths:(e,t)=>{let n=a(e);return n.setMonth(n.getMonth()+t),n},addYears:(e,t)=>{let n=a(e);return n.setFullYear(n.getFullYear()+t),n},eachYearOfInterval:t=>{let n=a(t.start),r=a(t.end),i=[],o=new dr(n.getFullYear(),0,1,12,0,0,e);for(;o.getFullYear()<=r.getFullYear();)i.push(new dr(o,e)),o.setFullYear(o.getFullYear()+1,0,1);return i},getWeek:(e,t)=>di(o(e),{weekStartsOn:t?.weekStartsOn??i,firstWeekContainsDate:t?.firstWeekContainsDate??r?.options?.firstWeekContainsDate??1}),getISOWeek:e=>ci(o(e)),differenceInCalendarDays:(e,t)=>kr(o(e),o(t)),differenceInCalendarMonths:(e,t)=>Rr(o(e),o(t))}}var So=e=>e instanceof HTMLElement?e:null,Co=e=>[...e.querySelectorAll(`[data-animated-month]`)??[]],wo=e=>So(e.querySelector(`[data-animated-month]`)),To=e=>So(e.querySelector(`[data-animated-caption]`)),Eo=e=>So(e.querySelector(`[data-animated-weeks]`)),Do=e=>So(e.querySelector(`[data-animated-nav]`)),Oo=e=>So(e.querySelector(`[data-animated-weekdays]`));function ko(e,t,{classNames:n,months:r,focused:i,dateLib:a}){let o=p(null),s=p(r),c=p(!1);d(()=>{let l=s.current;if(s.current=r,!t||!e.current||!(e.current instanceof HTMLElement)||r.length===0||l.length===0||r.length!==l.length)return;let u=a.isSameMonth(r[0].date,l[0].date),d=a.isAfter(r[0].date,l[0].date),f=d?n[ca.caption_after_enter]:n[ca.caption_before_enter],p=d?n[ca.weeks_after_enter]:n[ca.weeks_before_enter],m=o.current,h=e.current.cloneNode(!0);if(h instanceof HTMLElement?(Co(h).forEach(e=>{if(!(e instanceof HTMLElement))return;let t=wo(e);t&&e.contains(t)&&e.removeChild(t);let n=To(e);n&&n.classList.remove(f);let r=Eo(e);r&&r.classList.remove(p)}),o.current=h):o.current=null,c.current||u||i)return;let g=m instanceof HTMLElement?Co(m):[],_=Co(e.current);if(_?.every(e=>e instanceof HTMLElement)&&g?.every(e=>e instanceof HTMLElement)){c.current=!0;let t=[];e.current.style.isolation=`isolate`;let r=Do(e.current);r&&(r.style.zIndex=`1`),_.forEach((i,a)=>{let o=g[a];if(!o)return;i.style.position=`relative`,i.style.overflow=`hidden`;let s=To(i);s&&s.classList.add(f);let l=Eo(i);l&&l.classList.add(p);let u=()=>{c.current=!1,e.current&&(e.current.style.isolation=``),r&&(r.style.zIndex=``),s&&s.classList.remove(f),l&&l.classList.remove(p),i.style.position=``,i.style.overflow=``,i.contains(o)&&i.removeChild(o)};t.push(u),o.style.pointerEvents=`none`,o.style.position=`absolute`,o.style.overflow=`hidden`,o.setAttribute(`aria-hidden`,`true`);let m=Oo(o);m&&(m.style.opacity=`0`);let h=To(o);h&&(h.classList.add(d?n[ca.caption_before_exit]:n[ca.caption_after_exit]),h.addEventListener(`animationend`,u));let _=Eo(o);_&&_.classList.add(d?n[ca.weeks_before_exit]:n[ca.weeks_after_exit]),i.insertBefore(o,i.firstChild)})}})}function Ao(e,t,n,r){let i=e[0],a=e[e.length-1],{ISOWeek:o,fixedWeeks:s,broadcastCalendar:c}=n??{},{addDays:l,differenceInCalendarDays:u,differenceInCalendarMonths:d,endOfBroadcastWeek:f,endOfISOWeek:p,endOfMonth:m,endOfWeek:h,isAfter:g,startOfBroadcastWeek:_,startOfISOWeek:v,startOfWeek:y}=r,b=c?_(i,r):o?v(i):y(i),x=c?f(a):o?p(m(a)):h(m(a)),S=t&&(c?f(t):o?p(t):h(t)),C=u(S&&g(x,S)?S:x,b),w=d(a,i)+1,T=[];for(let e=0;e<=C;e++){let t=l(b,e);T.push(t)}let E=(c?35:42)*w;if(s&&T.length<E){let e=E-T.length;for(let t=0;t<e;t++){let e=l(T[T.length-1],1);T.push(e)}}return T}function jo(e){let t=[];return e.reduce((e,n)=>{let r=n.weeks.reduce((e,t)=>e.concat(t.days.slice()),t.slice());return e.concat(r.slice())},t.slice())}function Mo(e,t,n,r){let{numberOfMonths:i=1}=n,a=[];for(let n=0;n<i;n++){let i=r.addMonths(e,n);if(t&&i>t)break;a.push(i)}return a}function No(e,t,n,r){let{month:i,defaultMonth:a,today:o=r.today(),numberOfMonths:s=1}=e,c=i||a||o,{differenceInCalendarMonths:l,addMonths:u,startOfMonth:d}=r;return n&&l(n,c)<s-1&&(c=u(n,-1*(s-1))),t&&l(c,t)<0&&(c=t),d(c)}function Po(e,t,n,r){let{addDays:i,endOfBroadcastWeek:a,endOfISOWeek:o,endOfMonth:s,endOfWeek:c,getISOWeek:l,getWeek:u,startOfBroadcastWeek:d,startOfISOWeek:f,startOfWeek:p}=r,m=e.reduce((e,m)=>{let h=n.broadcastCalendar?d(m,r):n.ISOWeek?f(m):p(m),g=n.broadcastCalendar?a(m):n.ISOWeek?o(s(m)):c(s(m)),_=t.filter(e=>e>=h&&e<=g),v=n.broadcastCalendar?35:42;if(n.fixedWeeks&&_.length<v){let e=t.filter(e=>{let t=v-_.length;return e>g&&e<=i(g,t)});_.push(...e)}let y=new ea(m,_.reduce((e,t)=>{let i=n.ISOWeek?l(t):u(t),a=e.find(e=>e.weekNumber===i),o=new $i(t,m,r);return a?a.days.push(o):e.push(new ta(i,[o])),e},[]));return e.push(y),e},[]);return n.reverseMonths?m.reverse():m}function Fo(e,t){let{startMonth:n,endMonth:r}=e,{startOfYear:i,startOfDay:a,startOfMonth:o,endOfMonth:s,addYears:c,endOfYear:l,today:u}=t,d=e.captionLayout===`dropdown`||e.captionLayout===`dropdown-years`;return n?n=o(n):!n&&d&&(n=i(c(e.today??u(),-100))),r?r=s(r):!r&&d&&(r=l(e.today??u())),[n&&a(n),r&&a(r)]}function Io(e,t,n,r){if(n.disableNavigation)return;let{pagedNavigation:i,numberOfMonths:a=1}=n,{startOfMonth:o,addMonths:s,differenceInCalendarMonths:c}=r,l=i?a:1,u=o(e);if(!t||!(c(t,e)<a))return s(u,l)}function Lo(e,t,n,r){if(n.disableNavigation)return;let{pagedNavigation:i,numberOfMonths:a}=n,{startOfMonth:o,addMonths:s,differenceInCalendarMonths:c}=r,l=i?a??1:1,u=o(e);if(!t||!(c(u,t)<=0))return s(u,-l)}function Ro(e){return e.reduce((e,t)=>e.concat(t.weeks.slice()),[].slice())}function zo(e,t){let[n,r]=m(e);return[t===void 0?n:t,r]}function Bo(e,t){let[n,r]=Fo(e,t),{startOfMonth:i,endOfMonth:a}=t,o=No(e,n,r,t),[s,l]=zo(o,e.month?o:void 0);c(()=>{let i=No(e,n,r,t);l(i)},[e.timeZone]);let{months:u,weeks:d,days:p,previousMonth:m,nextMonth:h}=f(()=>{let i=Mo(s,r,{numberOfMonths:e.numberOfMonths},t),o=Po(i,Ao(i,e.endMonth?a(e.endMonth):void 0,{ISOWeek:e.ISOWeek,fixedWeeks:e.fixedWeeks,broadcastCalendar:e.broadcastCalendar},t),{broadcastCalendar:e.broadcastCalendar,fixedWeeks:e.fixedWeeks,ISOWeek:e.ISOWeek,reverseMonths:e.reverseMonths},t);return{months:o,weeks:Ro(o),days:jo(o),previousMonth:Lo(s,n,e,t),nextMonth:Io(s,r,e,t)}},[t,s.getTime(),r?.getTime(),n?.getTime(),e.disableNavigation,e.broadcastCalendar,e.endMonth?.getTime(),e.fixedWeeks,e.ISOWeek,e.numberOfMonths,e.pagedNavigation,e.reverseMonths]),{disableNavigation:g,onMonthChange:_}=e,v=e=>d.some(t=>t.days.some(t=>t.isEqualTo(e))),y=e=>{if(g)return;let t=i(e);n&&t<i(n)&&(t=i(n)),r&&t>i(r)&&(t=i(r)),l(t),_?.(t)};return{months:u,weeks:d,days:p,navStart:n,navEnd:r,previousMonth:m,nextMonth:h,goToMonth:y,goToDay:e=>{v(e)||y(e.date)}}}var Vo;(function(e){e[e.Today=0]=`Today`,e[e.Selected=1]=`Selected`,e[e.LastFocused=2]=`LastFocused`,e[e.FocusedModifier=3]=`FocusedModifier`})(Vo||={});function Ho(e){return!e[oa.disabled]&&!e[oa.hidden]&&!e[oa.outside]}function Uo(e,t,n,r){let i,a=-1;for(let o of e){let e=t(o);Ho(e)&&(e[oa.focused]&&a<Vo.FocusedModifier?(i=o,a=Vo.FocusedModifier):r?.isEqualTo(o)&&a<Vo.LastFocused?(i=o,a=Vo.LastFocused):n(o.date)&&a<Vo.Selected?(i=o,a=Vo.Selected):e[oa.today]&&a<Vo.Today&&(i=o,a=Vo.Today))}return i||=e.find(e=>Ho(t(e))),i}function Wo(e,t,n,r,i,a,o){let{ISOWeek:s,broadcastCalendar:c}=a,{addDays:l,addMonths:u,addWeeks:d,addYears:f,endOfBroadcastWeek:p,endOfISOWeek:m,endOfWeek:h,max:g,min:_,startOfBroadcastWeek:v,startOfISOWeek:y,startOfWeek:b}=o,x={day:l,week:d,month:u,year:f,startOfWeek:e=>c?v(e,o):s?y(e):b(e),endOfWeek:e=>c?p(e):s?m(e):h(e)}[e](n,t===`after`?1:-1);return t===`before`&&r?x=g([r,x]):t===`after`&&i&&(x=_([i,x])),x}function Go(e,t,n,r,i,a,o,s=0){if(s>365)return;let c=Wo(e,t,n.date,r,i,a,o),l=!!(a.disabled&&Ba(c,a.disabled,o)),u=!!(a.hidden&&Ba(c,a.hidden,o)),d=new $i(c,c,o);return!l&&!u?d:Go(e,t,d,r,i,a,o,s+1)}function Ko(e,t,n,r,i){let{autoFocus:a}=e,[o,s]=m(),c=Uo(t.days,n,r||(()=>!1),o),[l,u]=m(a?c:void 0);return{isFocusTarget:e=>!!c?.isEqualTo(e),setFocused:u,focused:l,blur:()=>{s(l),u(void 0)},moveFocus:(n,r)=>{if(!l)return;let a=Go(n,r,l,t.navStart,t.navEnd,e,i);a&&(e.disableNavigation&&!t.days.some(e=>e.isEqualTo(a))||(t.goToDay(a),u(a)))}}}function qo(e,t){let{selected:n,required:r,onSelect:i}=e,[a,o]=zo(n,i?n:void 0),s=i?n:a,{isSameDay:c}=t,l=e=>s?.some(t=>c(t,e))??!1,{min:u,max:d}=e;return{selected:s,select:(e,t,n)=>{let a=[...s??[]];if(l(e)){if(s?.length===u||r&&s?.length===1)return;a=s?.filter(t=>!c(t,e))}else a=s?.length===d?[e]:[...a,e];return i||o(a),i?.(a,e,t,n),a},isSelected:l}}function Jo(e,t,n=0,r=0,i=!1,a=Qi){let{from:o,to:s}=t||{},{isSameDay:c,isAfter:l,isBefore:u}=a,d;if(!o&&!s)d={from:e,to:n>0?void 0:e};else if(o&&!s)d=c(o,e)?n===0?{from:o,to:e}:i?{from:o,to:void 0}:void 0:u(e,o)?{from:e,to:o}:{from:o,to:e};else if(o&&s){if(c(o,e)&&c(s,e))d=i?{from:o,to:s}:void 0;else if(c(o,e))d={from:o,to:n>0?void 0:e};else if(c(s,e))d={from:e,to:n>0?void 0:e};else if(u(e,o))d={from:e,to:s};else if(l(e,o))d={from:o,to:e};else if(l(e,s))d={from:o,to:e};else throw Error(`Invalid range`)}if(d?.from&&d?.to){let t=a.differenceInCalendarDays(d.to,d.from);(r>0&&t>r||n>1&&t<n)&&(d={from:e,to:void 0})}return d}function Yo(e,t,n=Qi){let r=Array.isArray(t)?t:[t],i=e.from,a=n.differenceInCalendarDays(e.to,e.from),o=Math.min(a,6);for(let e=0;e<=o;e++){if(r.includes(i.getDay()))return!0;i=n.addDays(i,1)}return!1}function Xo(e,t,n=Qi){return Na(e,t.from,!1,n)||Na(e,t.to,!1,n)||Na(t,e.from,!1,n)||Na(t,e.to,!1,n)}function Zo(e,t,n=Qi){let r=Array.isArray(t)?t:[t];if(r.filter(e=>typeof e!=`function`).some(t=>typeof t==`boolean`?t:n.isDate(t)?Na(e,t,!1,n):za(t,n)?t.some(t=>Na(e,t,!1,n)):Fa(t)?t.from&&t.to?Xo(e,{from:t.from,to:t.to},n):!1:Ra(t)?Yo(e,t.dayOfWeek,n):Pa(t)?n.isAfter(t.before,t.after)?Xo(e,{from:n.addDays(t.after,1),to:n.addDays(t.before,-1)},n):Ba(e.from,t,n)||Ba(e.to,t,n):Ia(t)||La(t)?Ba(e.from,t,n)||Ba(e.to,t,n):!1))return!0;let i=r.filter(e=>typeof e==`function`);if(i.length){let t=e.from,r=n.differenceInCalendarDays(e.to,e.from);for(let e=0;e<=r;e++){if(i.some(e=>e(t)))return!0;t=n.addDays(t,1)}}return!1}function Qo(e,t){let{disabled:n,excludeDisabled:r,resetOnSelect:i,selected:a,required:o,onSelect:s}=e,[c,l]=zo(a,s?a:void 0),u=s?a:c;return{selected:u,select:(a,c,d)=>{let{min:f,max:p}=e,m;if(a){let e=u?.from,n=u?.to,r=!!e&&!!n,s=!!e&&!!n&&t.isSameDay(e,n)&&t.isSameDay(a,e);m=i&&(r||!u?.from)?!o&&s?void 0:{from:a,to:void 0}:Jo(a,u,f,p,o,t)}return r&&n&&m?.from&&m.to&&Zo({from:m.from,to:m.to},n,t)&&(m.from=a,m.to=void 0),s||l(m),s?.(m,a,c,d),m},isSelected:e=>u&&Na(u,e,!1,t)}}function $o(e,t){let{selected:n,required:r,onSelect:i}=e,[a,o]=zo(n,i?n:void 0),s=i?n:a,{isSameDay:c}=t;return{selected:s,select:(e,t,n)=>{let a=e;return!r&&s&&s&&c(e,s)&&(a=void 0),i||o(a),i?.(a,e,t,n),a},isSelected:e=>s?c(s,e):!1}}function es(e,t){let n=$o(e,t),r=qo(e,t),i=Qo(e,t);switch(e.mode){case`single`:return n;case`multiple`:return r;case`range`:return i;default:return}}function ts(e,t){return e instanceof dr&&e.timeZone===t?e:new dr(e,t)}function ns(e,t,n){if(!n)return ts(e,t);let r=ts(e,t),i=new dr(r.getFullYear(),r.getMonth(),r.getDate(),12,0,0,t);return new Date(i.getTime())}function rs(e,t,n){return typeof e==`boolean`||typeof e==`function`?e:e instanceof Date?ns(e,t,n):Array.isArray(e)?e.map(e=>e instanceof Date?ns(e,t,n):e):Fa(e)?{...e,from:e.from?ts(e.from,t):e.from,to:e.to?ts(e.to,t):e.to}:Pa(e)?{before:ns(e.before,t,n),after:ns(e.after,t,n)}:Ia(e)?{after:ns(e.after,t,n)}:La(e)?{before:ns(e.before,t,n)}:e}function is(e,t,n){return e&&(Array.isArray(e)?e.map(e=>rs(e,t,n)):rs(e,t,n))}function as(e){let n=e,r=n.timeZone;if(r&&(n={...e,timeZone:r},n.today&&(n.today=ts(n.today,r)),n.month&&(n.month=ts(n.month,r)),n.defaultMonth&&(n.defaultMonth=ts(n.defaultMonth,r)),n.startMonth&&(n.startMonth=ts(n.startMonth,r)),n.endMonth&&(n.endMonth=ts(n.endMonth,r)),n.mode===`single`&&n.selected?n.selected=ts(n.selected,r):n.mode===`multiple`&&n.selected?n.selected=n.selected?.map(e=>ts(e,r)):n.mode===`range`&&n.selected&&(n.selected={from:n.selected.from?ts(n.selected.from,r):n.selected.from,to:n.selected.to?ts(n.selected.to,r):n.selected.to}),n.disabled!==void 0&&(n.disabled=is(n.disabled,r)),n.hidden!==void 0&&(n.hidden=is(n.hidden,r)),n.modifiers)){let e={};Object.keys(n.modifiers).forEach(t=>{e[t]=is(n.modifiers?.[t],r)}),n.modifiers=e}let{components:i,formatters:a,labels:s,dateLib:c,locale:l,classNames:u}=f(()=>{let e={...Xi,...n.locale},t=n.broadcastCalendar?1:n.weekStartsOn,r=n.noonSafe&&n.timeZone?xo(n.timeZone,{weekStartsOn:t,locale:e}):void 0,i=n.dateLib&&r?{...r,...n.dateLib}:n.dateLib??r,a=new Zi({locale:e,weekStartsOn:t,firstWeekContainsDate:n.firstWeekContainsDate,useAdditionalWeekYearTokens:n.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:n.useAdditionalDayOfYearTokens,timeZone:n.timeZone,numerals:n.numerals},i);return{dateLib:a,components:Ua(n.components),formatters:eo(n.formatters),labels:go(n.labels,a.options),locale:e,classNames:{...Ga(),...n.classNames}}},[n.locale,n.broadcastCalendar,n.weekStartsOn,n.firstWeekContainsDate,n.useAdditionalWeekYearTokens,n.useAdditionalDayOfYearTokens,n.timeZone,n.numerals,n.dateLib,n.noonSafe,n.components,n.formatters,n.labels,n.classNames]);n.today||(n={...n,today:c.today()});let{captionLayout:d,mode:m,navLayout:h,numberOfMonths:g=1,onDayBlur:_,onDayClick:v,onDayFocus:y,onDayKeyDown:b,onDayMouseEnter:x,onDayMouseLeave:S,onNextClick:C,onPrevClick:w,showWeekNumber:T,styles:E}=n,{formatCaption:D,formatDay:O,formatMonthDropdown:k,formatWeekNumber:A,formatWeekNumberHeader:j,formatWeekdayName:M,formatYearDropdown:N}=a,ee=Bo(n,c),{days:te,months:P,navStart:F,navEnd:ne,previousMonth:re,nextMonth:I,goToMonth:L}=ee,ie=Va(te,n,F,ne,c),{isSelected:ae,select:R,selected:z}=es(n,c)??{},{blur:oe,focused:se,isFocusTarget:ce,moveFocus:le,setFocused:ue}=Ko(n,ee,ie,ae??(()=>!1),c),{labelDayButton:de,labelGridcell:fe,labelGrid:pe,labelMonthDropdown:me,labelNav:he,labelPrevious:ge,labelNext:_e,labelWeekday:ve,labelWeekNumber:ye,labelWeekNumberHeader:be,labelYearDropdown:xe}=s,Se=f(()=>yo(c,n.ISOWeek,n.broadcastCalendar,n.today),[c,n.ISOWeek,n.broadcastCalendar,n.today]),Ce=m!==void 0||v!==void 0,we=o(()=>{re&&(L(re),w?.(re))},[re,L,w]),Te=o(()=>{I&&(L(I),C?.(I))},[L,I,C]),Ee=o((e,t)=>n=>{n.preventDefault(),n.stopPropagation(),ue(e),!t.disabled&&(R?.(e.date,t,n),v?.(e.date,t,n))},[R,v,ue]),De=o((e,t)=>n=>{ue(e),y?.(e.date,t,n)},[y,ue]),Oe=o((e,t)=>n=>{oe(),_?.(e.date,t,n)},[oe,_]),ke=o((e,t)=>r=>{let i={ArrowLeft:[r.shiftKey?`month`:`day`,n.dir===`rtl`?`after`:`before`],ArrowRight:[r.shiftKey?`month`:`day`,n.dir===`rtl`?`before`:`after`],ArrowDown:[r.shiftKey?`year`:`week`,`after`],ArrowUp:[r.shiftKey?`year`:`week`,`before`],PageUp:[r.shiftKey?`year`:`month`,`before`],PageDown:[r.shiftKey?`year`:`month`,`after`],Home:[`startOfWeek`,`before`],End:[`endOfWeek`,`after`]};if(i[r.key]){r.preventDefault(),r.stopPropagation();let[e,t]=i[r.key];le(e,t)}b?.(e.date,t,r)},[le,b,n.dir]),Ae=o((e,t)=>n=>{x?.(e.date,t,n)},[x]),je=o((e,t)=>n=>{S?.(e.date,t,n)},[S]),Me=o((e,t)=>n=>{let r=Number(n.target.value),i=c.setMonth(c.startOfMonth(e),r);L(c.addMonths(i,-t))},[c,L]),Ne=o((e,t)=>n=>{let r=Number(n.target.value),i=c.setYear(c.startOfMonth(e),r);L(c.addMonths(i,-t))},[c,L]),{className:Pe,style:Fe}=f(()=>({className:[u[G.Root],n.className].filter(Boolean).join(` `),style:{...E?.[G.Root],...n.style}}),[u,n.className,n.style,E]),Ie=Wa(n),Le=e=>{let t=E?.[G.Dropdown],n=E?.[e];if(!(!t&&!n))return{...t,...n}},Re=p(null);ko(Re,!!n.animate,{classNames:u,months:P,focused:se,dateLib:c});let ze={dayPickerProps:n,selected:z,select:R,isSelected:ae,months:P,nextMonth:I,previousMonth:re,goToMonth:L,getModifiers:ie,components:i,classNames:u,styles:E,labels:s,formatters:a};return t.createElement(la.Provider,{value:ze},t.createElement(i.Root,{rootRef:n.animate?Re:void 0,className:Pe,style:Fe,dir:n.dir,id:n.id,lang:n.lang??l.code,nonce:n.nonce,title:n.title,role:n.role,"aria-label":n[`aria-label`],"aria-labelledby":n[`aria-labelledby`],...Ie},t.createElement(i.Months,{className:u[G.Months],style:E?.[G.Months]},!n.hideNavigation&&!h&&t.createElement(i.Nav,{"data-animated-nav":n.animate?`true`:void 0,className:u[G.Nav],style:E?.[G.Nav],"aria-label":he(),onPreviousClick:we,onNextClick:Te,previousMonth:re,nextMonth:I}),P.map((e,r)=>{let o=n.reverseMonths?P.length-1-r:r;return t.createElement(i.Month,{"data-animated-month":n.animate?`true`:void 0,className:u[G.Month],style:E?.[G.Month],key:r,displayIndex:r,calendarMonth:e},h===`around`&&!n.hideNavigation&&r===0&&t.createElement(i.PreviousMonthButton,{type:`button`,className:u[G.PreviousMonthButton],style:E?.[G.PreviousMonthButton],tabIndex:re?void 0:-1,"aria-disabled":!re||void 0,"aria-label":ge(re),onClick:we,"data-animated-button":n.animate?`true`:void 0},t.createElement(i.Chevron,{disabled:!re||void 0,className:u[G.Chevron],style:E?.[G.Chevron],orientation:n.dir===`rtl`?`right`:`left`})),t.createElement(i.MonthCaption,{"data-animated-caption":n.animate?`true`:void 0,className:u[G.MonthCaption],style:E?.[G.MonthCaption],calendarMonth:e,displayIndex:r},d?.startsWith(`dropdown`)?t.createElement(i.DropdownNav,{className:u[G.Dropdowns],style:E?.[G.Dropdowns]},(()=>{let r=d===`dropdown`||d===`dropdown-months`?t.createElement(i.MonthsDropdown,{key:`month`,className:u[G.MonthsDropdown],"aria-label":me(),disabled:!!n.disableNavigation,onChange:Me(e.date,o),options:_o(e.date,F,ne,a,c),style:Le(G.MonthsDropdown),value:c.getMonth(e.date)}):t.createElement(`span`,{key:`month`},k(e.date,c)),s=d===`dropdown`||d===`dropdown-years`?t.createElement(i.YearsDropdown,{key:`year`,className:u[G.YearsDropdown],"aria-label":xe(c.options),disabled:!!n.disableNavigation,onChange:Ne(e.date,o),options:bo(F,ne,a,c,!!n.reverseYears),style:Le(G.YearsDropdown),value:c.getYear(e.date)}):t.createElement(`span`,{key:`year`},N(e.date,c));return c.getMonthYearOrder()===`year-first`?[s,r]:[r,s]})(),t.createElement(`span`,{role:`status`,"aria-live":`polite`,style:{border:0,clip:`rect(0 0 0 0)`,height:`1px`,margin:`-1px`,overflow:`hidden`,padding:0,position:`absolute`,width:`1px`,whiteSpace:`nowrap`,wordWrap:`normal`}},D(e.date,c.options,c))):t.createElement(i.CaptionLabel,{className:u[G.CaptionLabel],style:E?.[G.CaptionLabel],role:`status`,"aria-live":`polite`},D(e.date,c.options,c))),h===`around`&&!n.hideNavigation&&r===g-1&&t.createElement(i.NextMonthButton,{type:`button`,className:u[G.NextMonthButton],style:E?.[G.NextMonthButton],tabIndex:I?void 0:-1,"aria-disabled":!I||void 0,"aria-label":_e(I),onClick:Te,"data-animated-button":n.animate?`true`:void 0},t.createElement(i.Chevron,{disabled:!I||void 0,className:u[G.Chevron],style:E?.[G.Chevron],orientation:n.dir===`rtl`?`left`:`right`})),r===g-1&&h===`after`&&!n.hideNavigation&&t.createElement(i.Nav,{"data-animated-nav":n.animate?`true`:void 0,className:u[G.Nav],style:E?.[G.Nav],"aria-label":he(),onPreviousClick:we,onNextClick:Te,previousMonth:re,nextMonth:I}),t.createElement(i.MonthGrid,{role:`grid`,"aria-multiselectable":m===`multiple`||m===`range`,"aria-label":pe(e.date,c.options,c)||void 0,className:u[G.MonthGrid],style:E?.[G.MonthGrid]},!n.hideWeekdays&&t.createElement(i.Weekdays,{"data-animated-weekdays":n.animate?`true`:void 0,className:u[G.Weekdays],style:E?.[G.Weekdays]},T&&t.createElement(i.WeekNumberHeader,{"aria-label":be(c.options),className:u[G.WeekNumberHeader],style:E?.[G.WeekNumberHeader],scope:`col`},j()),Se.map(e=>t.createElement(i.Weekday,{"aria-label":ve(e,c.options,c),className:u[G.Weekday],key:String(e),style:E?.[G.Weekday],scope:`col`},M(e,c.options,c)))),t.createElement(i.Weeks,{"data-animated-weeks":n.animate?`true`:void 0,className:u[G.Weeks],style:E?.[G.Weeks]},e.weeks.map(e=>t.createElement(i.Week,{className:u[G.Week],key:e.weekNumber,style:E?.[G.Week],week:e},T&&t.createElement(i.WeekNumber,{week:e,style:E?.[G.WeekNumber],"aria-label":ye(e.weekNumber,{locale:l}),className:u[G.WeekNumber],scope:`row`,role:`rowheader`},A(e.weekNumber,c)),e.days.map(e=>{let{date:r}=e,a=ie(e);if(a[oa.focused]=!a.hidden&&!!se?.isEqualTo(e),a[sa.selected]=ae?.(r)||a.selected,Fa(z)){let{from:e,to:t}=z;a[sa.range_start]=!!(e&&t&&c.isSameDay(r,e)),a[sa.range_end]=!!(e&&t&&c.isSameDay(r,t)),a[sa.range_middle]=Na(z,r,!0,c)}let o=vo(a,E,n.modifiersStyles),s=Ha(a,u,n.modifiersClassNames),l=!Ce&&!a.hidden?fe(r,a,c.options,c):void 0;return t.createElement(i.Day,{key:`${e.isoDate}_${e.displayMonthId}`,day:e,modifiers:a,className:s.join(` `),style:o,role:`gridcell`,"aria-selected":a.selected||void 0,"aria-label":l,"data-day":e.isoDate,"data-month":e.outside?e.dateMonthId:void 0,"data-selected":a.selected||void 0,"data-disabled":a.disabled||void 0,"data-hidden":a.hidden||void 0,"data-outside":e.outside||void 0,"data-focused":a.focused||void 0,"data-today":a.today||void 0},!a.hidden&&Ce?t.createElement(i.DayButton,{className:u[G.DayButton],style:E?.[G.DayButton],type:`button`,day:e,modifiers:a,disabled:!a.focused&&a.disabled||void 0,"aria-disabled":a.focused&&a.disabled||void 0,tabIndex:ce(e)?0:-1,"aria-label":de(r,a,c.options,c),onClick:Ee(e,a),onBlur:Oe(e,a),onFocus:De(e,a),onKeyDown:ke(e,a),onMouseEnter:Ae(e,a),onMouseLeave:je(e,a)},O(r,c.options,c)):!a.hidden&&O(e.date,c.options,c))}))))))})),n.footer&&t.createElement(i.Footer,{className:u[G.Footer],style:E?.[G.Footer],role:`status`,"aria-live":`polite`},n.footer)))}function os({className:e,classNames:t,showOutsideDays:n=!0,captionLayout:r=`label`,buttonVariant:i=`ghost`,locale:a,formatters:o,components:s,...c}){let l=Ga();return b(as,{showOutsideDays:n,className:U(`group/calendar bg-background p-2 [--cell-radius:var(--radius-md)] [--cell-size:--spacing(7)] in-data-[slot=card-content]:bg-transparent in-data-[slot=popover-content]:bg-transparent`,String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,e),captionLayout:r,locale:a,formatters:{formatMonthDropdown:e=>e.toLocaleString(a?.code,{month:`short`}),...o},classNames:{root:U(`w-fit`,l.root),months:U(`relative flex flex-col gap-4 md:flex-row`,l.months),month:U(`flex w-full flex-col gap-4`,l.month),nav:U(`absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1`,l.nav),button_previous:U(hn({variant:i}),`size-(--cell-size) p-0 select-none aria-disabled:opacity-50`,l.button_previous),button_next:U(hn({variant:i}),`size-(--cell-size) p-0 select-none aria-disabled:opacity-50`,l.button_next),month_caption:U(`flex h-(--cell-size) w-full items-center justify-center px-(--cell-size)`,l.month_caption),dropdowns:U(`flex h-(--cell-size) w-full items-center justify-center gap-1.5 text-sm font-medium`,l.dropdowns),dropdown_root:U(`relative rounded-(--cell-radius)`,l.dropdown_root),dropdown:U(`absolute inset-0 bg-popover opacity-0`,l.dropdown),caption_label:U(`font-medium select-none`,r===`label`?`text-sm`:`flex items-center gap-1 rounded-(--cell-radius) text-sm [&>svg]:size-3.5 [&>svg]:text-muted-foreground`,l.caption_label),month_grid:U(`w-full border-collapse`,l.month_grid),weekdays:U(`flex`,l.weekdays),weekday:U(`flex-1 rounded-(--cell-radius) text-[0.8rem] font-normal text-muted-foreground select-none`,l.weekday),week:U(`mt-2 flex w-full`,l.week),week_number_header:U(`w-(--cell-size) select-none`,l.week_number_header),week_number:U(`text-[0.8rem] text-muted-foreground select-none`,l.week_number),day:U(`group/day relative aspect-square h-full w-full p-0 text-center select-none [&:has([data-range-start])]:rounded-l-(--cell-radius) [&:has([data-range-end])]:rounded-r-(--cell-radius) [&[data-outside][data-selected]_button]:bg-transparent [&[data-outside][data-selected]_button]:text-muted-foreground`,l.day),today:U(`rounded-(--cell-radius) text-foreground [&_button]:ring-1 [&_button]:ring-ring/60 data-[selected=true]:rounded-none`,l.today),outside:U(`text-muted-foreground aria-selected:text-muted-foreground`,l.outside),disabled:U(`text-muted-foreground opacity-50`,l.disabled),hidden:U(`invisible`,l.hidden),...t},components:{Root:({className:e,rootRef:t,...n})=>b(`div`,{"data-slot":`calendar`,ref:t,className:U(e),...n}),Chevron:({className:e,orientation:t,...n})=>b(t===`left`?sn:t===`right`?cn:on,{className:U(`size-4`,e),...n}),DayButton:({...e})=>b(ss,{...e,...a===void 0?{}:{locale:a}}),WeekNumber:({children:e,...t})=>b(`td`,{...t,children:b(`div`,{className:`flex size-(--cell-size) items-center justify-center text-center`,children:e})}),...s},...c})}function ss({className:t,day:n,modifiers:r,locale:i,...a}){let o=Ga(),s=e.useRef(null);return e.useEffect(()=>{r.focused&&s.current?.focus()},[r.focused]),b(W,{variant:`ghost`,size:`icon`,"data-day":n.date.toLocaleDateString(i?.code),"data-selected-single":r.selected&&!r.range_start&&!r.range_end&&!r.range_middle,"data-range-start":r.range_start||void 0,"data-range-end":r.range_end||void 0,"data-range-middle":r.range_middle||void 0,className:U(`relative isolate z-10 flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 border-0 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:outline-2 group-data-[focused=true]/day:outline-offset-2 group-data-[focused=true]/day:outline-ring data-[range-end=true]:rounded-(--cell-radius) data-[range-end=true]:rounded-r-(--cell-radius) data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground data-[range-middle=true]:rounded-none data-[range-middle=true]:bg-muted data-[range-middle=true]:text-foreground data-[range-start=true]:rounded-(--cell-radius) data-[range-start=true]:rounded-l-(--cell-radius) data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground dark:hover:text-foreground [&>span]:text-xs [&>span]:opacity-70`,o.day,t),...a})}function cs({className:e,...t}){return b(A.Root,{"data-slot":`checkbox`,className:U(`peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border-[1.5px] border-input bg-control transition-[background-color,border-color,scale] duration-150 ease-spring outline-none group-has-disabled/field:opacity-50 group-has-[:focus-visible]/field-label:outline-none after:absolute after:-inset-x-3 after:-inset-y-2 hover:border-muted-foreground active:scale-90 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring disabled:cursor-not-allowed disabled:opacity-40 aria-invalid:border-destructive data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground motion-reduce:active:scale-100`,e),...t,children:b(A.Indicator,{"data-slot":`checkbox-indicator`,className:`grid place-content-center text-current transition-none [&>svg]:size-3 [&>svg]:stroke-3 [&_path]:[stroke-dasharray:24] [&_path]:animate-[check-draw_260ms_var(--ease-fluid)] motion-reduce:[&_path]:animate-none`,children:b(an,{})})})}function ls({...e}){return b(j.Root,{"data-slot":`collapsible`,...e})}function us({...e}){return b(j.Trigger,{"data-slot":`collapsible-trigger`,...e})}function ds({...e}){return b(j.Panel,{"data-slot":`collapsible-content`,...e})}M.Root;function fs(){let t=e.useRef(null);return e.useEffect(()=>{let e=t.current,n=e?.parentElement;if(!e||!n)return;let r=!1,i=null,a=new ResizeObserver(()=>o());a.observe(n);let o=()=>{let t=n.querySelector(`[data-highlighted]`);if(t!==i&&(i&&a.unobserve(i),t&&a.observe(t),i=t),!t){r=!1,e.style.opacity=`0`;return}let o=0,s=0;for(let e=t;e&&e!==n;e=e.offsetParent instanceof HTMLElement?e.offsetParent:null)o+=e.offsetLeft,s+=e.offsetTop;r||(e.style.transitionProperty=`opacity`),e.style.transform=`translate(${o}px, ${s}px)`,e.style.width=`${t.offsetWidth}px`,e.style.height=`${t.offsetHeight}px`,e.style.opacity=`1`,r||(e.getBoundingClientRect(),e.style.transitionProperty=``),r=!0},s=new MutationObserver(o);return s.observe(n,{subtree:!0,attributes:!0,attributeFilter:[`data-highlighted`]}),()=>{s.disconnect(),a.disconnect()}},[]),b(`span`,{ref:t,"aria-hidden":!0,"data-slot":`sliding-highlight`,className:`pointer-events-none absolute top-0 left-0 -z-1 rounded-md bg-accent opacity-0 transition-[transform,width,height,opacity] duration-200 ease-fluid motion-reduce:transition-none`})}function ps({...e}){return b(N.Root,{"data-slot":`context-menu`,...e})}function ms({...e}){return b(N.Trigger,{"data-slot":`context-menu-trigger`,...e})}function hs({align:e=`start`,alignOffset:t,side:n,sideOffset:r,className:i,children:a,...o}){return b(N.Portal,{children:b(N.Positioner,{className:`isolate z-50 outline-none`,align:e,...t===void 0?{}:{alignOffset:t},...n===void 0?{}:{side:n},...r===void 0?{}:{sideOffset:r},children:x(N.Popup,{"data-slot":`context-menu-content`,className:U(`relative z-50 max-h-(--available-height) w-max max-w-(--available-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-xl bg-popover p-[5px] text-popover-foreground shadow-popup ring-1 ring-border duration-200 ease-fluid outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95`,i),...o,children:[b(fs,{}),a]})})})}function K({className:e,inset:t,variant:n=`default`,...r}){return b(N.Item,{"data-slot":`context-menu-item`,"data-inset":t,"data-variant":n,className:U(`group/context-menu-item relative flex cursor-default items-center min-h-[30px] gap-2.5 rounded-md px-2.5 py-1 text-[13px] outline-hidden select-none data-inset:pl-[35px] data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-[15px] *:[svg]:text-muted-foreground data-[variant=destructive]:*:[svg]:text-destructive`,e),...r})}function gs({...e}){return b(N.SubmenuRoot,{"data-slot":`context-menu-sub`,...e})}function _s({className:e,inset:t,children:n,...r}){return x(N.SubmenuTrigger,{"data-slot":`context-menu-sub-trigger`,"data-inset":t,className:U(`flex cursor-default items-center min-h-[30px] gap-2.5 rounded-md px-2.5 py-1 text-[13px] outline-hidden select-none data-inset:pl-[35px] data-popup-open:bg-accent data-popup-open:text-accent-foreground data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-[15px] *:[svg]:text-muted-foreground`,e),...r,children:[n,b(cn,{className:`ml-auto`})]})}function vs({className:e,...t}){return b(hs,{"data-slot":`context-menu-sub-content`,className:U(`w-max max-w-(--available-width) min-w-[96px] rounded-lg bg-popover p-[5px] text-popover-foreground shadow-lg ring-1 ring-foreground/10`,e),...t})}function ys({className:e,...t}){return b(N.Separator,{"data-slot":`context-menu-separator`,className:U(`-mx-[5px] my-[5px] h-px bg-border`,e),...t})}function bs({className:e,...t}){return b(`label`,{"data-slot":`label`,className:U(`flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,e),...t})}function xs({className:e,children:t,...n}){return x(ee.Root,{"data-slot":`scroll-area`,className:U(`relative flex flex-col`,e),...n,children:[b(ee.Viewport,{"data-slot":`scroll-area-viewport`,className:`min-h-0 w-full flex-1 rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-ring`,children:t}),b(Ss,{}),b(ee.Corner,{})]})}function Ss({className:e,orientation:t=`vertical`,...n}){return b(ee.Scrollbar,{"data-slot":`scroll-area-scrollbar`,"data-orientation":t,orientation:t,className:U(`flex touch-none p-px transition-colors select-none data-horizontal:h-2.5 data-horizontal:flex-col data-horizontal:border-t data-horizontal:border-t-transparent data-vertical:h-full data-vertical:w-2.5 data-vertical:border-l data-vertical:border-l-transparent`,e),...n,children:b(ee.Thumb,{"data-slot":`scroll-area-thumb`,className:`relative flex-1 rounded-full bg-border`})})}var Cs=te.Root;function ws({className:e,...t}){return b(te.Value,{"data-slot":`select-value`,className:U(`flex flex-1 text-left`,e),...t})}function Ts({className:e,size:t=`default`,children:n,...r}){return x(te.Trigger,{"data-slot":`select-trigger`,"data-size":t,className:U(`flex w-fit items-center justify-between gap-1.5 rounded-lg border border-input bg-control py-2 pr-2 pl-2.5 text-[13px] whitespace-nowrap transition-colors duration-150 outline-none select-none hover:border-muted-foreground/60 focus-visible:border-primary data-popup-open:border-primary disabled:cursor-not-allowed disabled:border-border disabled:bg-muted disabled:text-muted-foreground aria-invalid:border-destructive data-placeholder:text-muted-foreground data-[size=default]:h-[30px] data-[size=sm]:h-[26px] data-[size=sm]:rounded-md *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[popup-open]:[&_[data-slot=select-icon]]:rotate-180`,e),...r,children:[n,b(te.Icon,{render:b(on,{"data-slot":`select-icon`,className:`pointer-events-none size-4 text-muted-foreground transition-transform duration-200 ease-fluid`})})]})}function Es({className:e,children:t,side:n=`bottom`,sideOffset:r=4,align:i=`center`,alignOffset:a=0,alignItemWithTrigger:o=!1,...s}){return b(te.Portal,{children:b(te.Positioner,{side:n,sideOffset:r,align:i,alignOffset:a,alignItemWithTrigger:o,className:`isolate z-50`,children:x(te.Popup,{"data-slot":`select-content`,"data-align-trigger":o,className:U(`relative isolate z-50 max-h-(--available-height) w-max max-w-[min(24rem,var(--available-width))] min-w-(--anchor-width) origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-xl bg-popover text-popover-foreground shadow-popup ring-1 ring-border duration-200 ease-fluid data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...s,children:[b(fs,{}),b(Os,{}),b(te.List,{children:t}),b(ks,{})]})})})}function Ds({className:e,children:t,...n}){return x(te.Item,{"data-slot":`select-item`,className:U(`relative flex w-full cursor-default items-center min-h-[30px] gap-2.5 rounded-md py-1 pr-8 pl-2.5 text-[13px] outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-[15px] *:[svg]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2`,e),...n,children:[b(te.ItemText,{className:`flex flex-1 shrink-0 gap-2 whitespace-nowrap`,children:t}),b(te.ItemIndicator,{render:b(`span`,{className:`pointer-events-none absolute right-2.5 flex size-4 items-center justify-center`}),children:b(an,{className:`pointer-events-none`})})]})}function Os({className:e,...t}){return b(te.ScrollUpArrow,{"data-slot":`select-scroll-up-button`,className:U(`top-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-[15px] *:[svg]:text-muted-foreground`,e),...t,children:b(ln,{})})}function ks({className:e,...t}){return b(te.ScrollDownArrow,{"data-slot":`select-scroll-down-button`,className:U(`bottom-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-[15px] *:[svg]:text-muted-foreground`,e),...t,children:b(on,{})})}function As({className:e,...t}){return b(un,{"data-slot":`spinner`,role:`status`,"aria-label":`Loading`,className:U(`size-4 animate-spin`,e),...t})}function js({className:e,size:t=`default`,...n}){return b(P.Root,{"data-slot":`switch`,"data-size":t,className:U(`peer group/switch relative inline-flex shrink-0 items-center rounded-full p-0.5 transition-colors duration-200 outline-none group-has-[:focus-visible]/field-label:outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring aria-invalid:outline-2 aria-invalid:outline-destructive data-[size=default]:h-5 data-[size=default]:w-[34px] data-[size=sm]:h-4 data-[size=sm]:w-[26px] data-checked:bg-primary data-unchecked:bg-foreground/12 data-disabled:cursor-not-allowed data-disabled:opacity-40`,e),...n,children:b(P.Thumb,{"data-slot":`switch-thumb`,className:`pointer-events-none block h-4 w-4 rounded-full bg-white shadow-[0_1px_2px_rgb(0_0_0/0.25)] transition-[translate,width] duration-[260ms] ease-spring group-data-[size=sm]/switch:h-3 group-data-[size=sm]/switch:w-3 group-active/switch:w-5 group-data-[size=sm]/switch:group-active/switch:w-[15px] data-checked:translate-x-3.5 group-active/switch:data-checked:translate-x-2.5 group-data-[size=sm]/switch:data-checked:translate-x-2.5 group-data-[size=sm]/switch:group-active/switch:data-checked:translate-x-[7px] dark:data-checked:bg-primary-foreground motion-reduce:transition-none`})})}function Ms({className:e,orientation:t=`horizontal`,...n}){return b(F.Root,{"data-slot":`tabs`,"data-orientation":t,className:U(`group/tabs flex gap-2 data-horizontal:flex-col`,e),...n})}var Ns=mn(`group/tabs-list relative isolate inline-flex w-fit items-center justify-center text-muted-foreground group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col`,{variants:{variant:{default:`gap-0.5 rounded-lg bg-muted p-[3px] group-data-horizontal/tabs:h-[30px]`,line:`gap-1 bg-transparent group-data-horizontal/tabs:h-9`}},defaultVariants:{variant:`default`}}),Ps=mn(`absolute z-0 transition-[left,top,width,height] duration-[260ms] ease-spring motion-reduce:transition-none`,{variants:{variant:{default:`top-(--active-tab-top) left-(--active-tab-left) h-(--active-tab-height) w-(--active-tab-width) rounded-md bg-background shadow-[0_1px_2px_rgb(0_0_0/0.1),0_1px_1px_rgb(0_0_0/0.04)] dark:bg-accent`,line:`rounded-full bg-foreground group-data-horizontal/tabs:bottom-0 group-data-horizontal/tabs:left-(--active-tab-left) group-data-horizontal/tabs:h-0.5 group-data-horizontal/tabs:w-(--active-tab-width) group-data-vertical/tabs:top-(--active-tab-top) group-data-vertical/tabs:right-0 group-data-vertical/tabs:h-(--active-tab-height) group-data-vertical/tabs:w-0.5`}},defaultVariants:{variant:`default`}});function Fs({className:e,variant:t=`default`,children:n,...r}){return x(F.List,{"data-slot":`tabs-list`,"data-variant":t,className:U(Ns({variant:t}),e),...r,children:[n,b(F.Indicator,{"data-slot":`tabs-indicator`,className:Ps({variant:t})})]})}function Is({className:e,...t}){return b(F.Tab,{"data-slot":`tabs-trigger`,className:U(`relative z-1 inline-flex h-full flex-1 items-center justify-center gap-1.5 rounded-md px-2.5 text-[13px] font-medium whitespace-nowrap text-muted-foreground transition-colors duration-150 outline-none group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start group-data-vertical/tabs:py-1.5 group-data-[variant=line]/tabs-list:px-2 hover:text-foreground focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-40 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-disabled:pointer-events-none aria-disabled:opacity-40 data-active:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...t})}function Ls(e){let t=l();return`${e??t}`}var Rs=typeof window<`u`?d:c;function zs(e){let t=p(e);return Rs(()=>{t.current=e},[e]),o((...e)=>t.current?.(...e),[t])}function Bs(...e){return zs(t=>{e.forEach(e=>{if(e)switch(typeof e){case`function`:e(t);break;case`object`:e.current=t;break}})})}function Vs(e,t=`Assertion error`){if(!e)throw Error(t)}n(null);var Hs;function Us(){return Hs===void 0&&(Hs=typeof matchMedia==`function`&&!!matchMedia(`(pointer:coarse)`).matches),Hs}function Ws({expandHitTargets:e,axis:t,rect:n}){let r=e?Us()?t.resizeTargetMinimumSize.coarse:t.resizeTargetMinimumSize.fine:0;if(n.width<r){let e=r-n.width;n=new DOMRect(n.x-e/2,n.y,n.width+e,n.height)}if(n.height<r){let e=r-n.height;n=new DOMRect(n.x,n.y-e/2,n.width,n.height+e)}return n}function Gs(e){switch(typeof e){case`number`:return[e,`px`];case`string`:{let t=parseFloat(e);return e.endsWith(`%`)?[t,`%`]:e.endsWith(`px`)?[t,`px`]:e.endsWith(`rem`)?[t,`rem`]:e.endsWith(`em`)?[t,`em`]:e.endsWith(`vh`)?[t,`vh`]:e.endsWith(`vw`)?[t,`vw`]:[t,`%`]}}}var Ks=class{#e={};addListener(e,t){let n=this.#e[e];return n===void 0?this.#e[e]=[t]:n.includes(t)||n.push(t),()=>{this.removeListener(e,t)}}emit(e,t){let n=this.#e[e];if(n!==void 0){if(n.length===1)n[0].call(null,t);else{let e=!1,r=null,i=Array.from(n);for(let n=0;n<i.length;n++){let a=i[n];try{a.call(null,t)}catch(t){r===null&&(e=!0,r=t)}}if(e)throw r}}}removeAllListeners(){this.#e={}}removeListener(e,t){let n=this.#e[e];if(n!==void 0){let e=n.indexOf(t);e>=0&&n.splice(e,1)}}},qs={cursorFlags:0,state:`inactive`},Js=new Ks;function Ys(){return qs}function Xs(e){return Js.addListener(`change`,e)}function Zs(e,t=[],n,r=!1){let i=qs,a={...qs};a.cursorFlags=e,a.state===`active`&&(a.didPointerMove||=r,a.previews=t,n&&(a.previewLayoutMap=n)),qs=a,Js.emit(`change`,{prev:i,next:a})}function Qs(e){let t=qs;qs=e,t.state===`active`&&e.state!==`active`&&t.didPointerMove&&t.hitRegions.forEach(({separator:e})=>{e&&e.element.ownerDocument.activeElement===e.element&&e.element.blur()}),Js.emit(`change`,{prev:t,next:e})}function $s(e){qs.state!==`active`||!qs.previews.some(t=>t.separator===e)||Qs({...qs,previews:qs.previews.map(t=>t.separator===e?{...t}:t)})}function ec(e){if(qs.state===`inactive`)return!1;let t=qs.hitRegions.filter(t=>t.axis!==e),n=qs.state===`active`&&qs.previews.some(t=>t.axis===e);if(t.length===qs.hitRegions.length&&!n)return!1;if(t.length===0)Qs({cursorFlags:0,state:`inactive`});else if(qs.state===`active`){let n=new Map(qs.initialLayoutMap),r=new Map(qs.previewLayoutMap);n.delete(e),r.delete(e),Qs({...qs,cursorFlags:0,hitRegions:t,initialLayoutMap:n,previewLayoutMap:r,previews:qs.previews.filter(t=>t.axis!==e)})}else Qs({...qs,hitRegions:t});return!0}var tc=e=>e,nc=()=>{},rc=1,ic=2,ac=4,oc=8,sc=3,cc=12,lc;function uc(){return lc===void 0&&(lc=!1,typeof window<`u`&&(window.navigator.userAgent.includes(`Chrome`)||window.navigator.userAgent.includes(`Firefox`))&&(lc=!0)),lc}function dc({cursorFlags:e,axes:t,state:n}){let r=0,i=0;switch(n){case`active`:case`hover`:t.forEach(e=>{if(!e.mutableState.disableCursor)switch(e.orientation){case`horizontal`:r++;break;case`vertical`:i++;break}})}if(r!==0||i!==0){if(n===`active`&&e&&uc()){let t=(e&rc)!==0,n=(e&ic)!==0,r=(e&ac)!==0,i=(e&oc)!==0;if(t)return r?`se-resize`:i?`ne-resize`:`e-resize`;if(n)return r?`sw-resize`:i?`nw-resize`:`w-resize`;if(r)return`s-resize`;if(i)return`n-resize`}return uc()?r>0&&i>0?`move`:r>0?`ew-resize`:`ns-resize`:r>0&&i>0?`grab`:r>0?`col-resize`:`row-resize`}}var fc=new WeakMap;function pc(e){if(!e.defaultView||!e.adoptedStyleSheets)return;let{prevStyle:t,styleSheet:n}=fc.get(e)??{};n===void 0&&(n=new e.defaultView.CSSStyleSheet,e.adoptedStyleSheets&&(Object.isExtensible(e.adoptedStyleSheets)?e.adoptedStyleSheets.push(n):e.adoptedStyleSheets=[...e.adoptedStyleSheets,n]));let r=Ys();switch(r.state){case`active`:case`hover`:{let e=dc({cursorFlags:r.cursorFlags,axes:r.hitRegions.map(e=>e.axis),state:r.state}),i=`*, *:hover {cursor: ${e} !important; }`;if(t===i)return;t=i,e?n.cssRules.length===0?n.insertRule(i):n.replaceSync(i):n.cssRules.length===1&&n.deleteRule(0);break}case`inactive`:t=void 0,n.cssRules.length===1&&n.deleteRule(0)}fc.set(e,{prevStyle:t,styleSheet:n})}function mc({axis:e}){let{layoutStrategy:t,orientation:n,items:r}=e;return t?t.calculateAvailableSize():r.reduce((e,t)=>(e+=n===`horizontal`?t.element.offsetWidth:t.element.offsetHeight,e),0)}function hc(e,t){let n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_DISCONNECTED?0:n&Node.DOCUMENT_POSITION_FOLLOWING?-1:n&Node.DOCUMENT_POSITION_PRECEDING?1:0}function gc(e,t){return Array.from(t).sort((t,n)=>{let r=e===`horizontal`?_c(t,n):vc(t,n);return r===0?hc(t.element,n.element):r})}function _c(e,t){let n=e.element.offsetLeft-t.element.offsetLeft;return n===0?e.element.offsetWidth-t.element.offsetWidth:n}function vc(e,t){let n=e.element.offsetTop-t.element.offsetTop;return n===0?e.element.offsetHeight-t.element.offsetHeight:n}function yc(e){return typeof e==`object`&&!!e&&`nodeType`in e&&e.nodeType===Node.ELEMENT_NODE}function bc(e,t){return{x:e.x>=t.left&&e.x<=t.right?0:Math.min(Math.abs(e.x-t.left),Math.abs(e.x-t.right)),y:e.y>=t.top&&e.y<=t.bottom?0:Math.min(Math.abs(e.y-t.top),Math.abs(e.y-t.bottom))}}function xc({orientation:e,rects:t,targetRect:n}){let r={x:n.x+n.width/2,y:n.y+n.height/2},i,a=Number.MAX_VALUE;for(let n of t){let{x:t,y:o}=bc(r,n),s=e===`horizontal`?t:o;s<a&&(a=s,i=n)}return Vs(i,`No rect found`),i}function Sc({expandHitTargets:e=!0,axis:t,includeDisabled:n=!1}){if(t.layoutStrategy)return t.layoutStrategy.calculateHitRegions({expandHitTargets:e,axis:t,includeDisabled:n});let{element:r,orientation:i,items:a,separators:o}=t,s=gc(i,Array.from(r.children).filter(yc).filter(e=>!e.hasAttribute(`data-resize-preview`)).map(e=>({element:e}))).map(({element:e})=>e),c=[],l=!1,u=!1,d=-1,f,p=-1,m=0,h,g=[];{let e=-1;for(let t of s)t.hasAttribute(`data-panel`)&&(e++,t.hasAttribute(`data-disabled`)||(m++,d===-1&&(d=e),p=e))}if(n||m>1){let r=-1;for(let m of s)if(m.hasAttribute(`data-panel`)){r++;let o=a.find(e=>e.element===m);if(o){if(h){let a=h.element.getBoundingClientRect(),s=m.getBoundingClientRect(),_;if(u){let e=i===`horizontal`?new DOMRect(a.right,a.top,0,a.height):new DOMRect(a.left,a.bottom,a.width,0),t=i===`horizontal`?new DOMRect(s.left,s.top,0,s.height):new DOMRect(s.left,s.top,s.width,0);switch(g.length){case 0:_=[e,t];break;case 1:{let n=g[0];_=[n,xc({orientation:i,rects:[a,s],targetRect:n.element.getBoundingClientRect()})===a?t:e];break}default:_=g}}else _=g.length?g:[i===`horizontal`?new DOMRect(a.right,s.top,s.left-a.right,s.height):new DOMRect(s.left,a.bottom,s.width,s.top-a.bottom)];for(let i of _){let a=Ws({expandHitTargets:e,axis:t,rect:`width`in i?i:i.element.getBoundingClientRect()});(n||!l&&!(r<=d||r>p))&&(f??=mc({axis:t}),c.push({axis:t,axisSize:f,items:[h,o],separator:`width`in i?void 0:i,rect:a})),l=!1}}u=!1,h=o,g=[]}}else if(m.hasAttribute(`data-separator`)){m.ariaDisabled!==null&&(l=!0);let e=o.find(e=>e.element===m);e?g.push(e):(h=void 0,g=[])}else u=!0}return c}function Cc(e,t){let n=getComputedStyle(e);return t*parseFloat(n.fontSize)}function wc(e,t){let n=getComputedStyle(e.ownerDocument.documentElement);return t*parseFloat(n.fontSize)}function Tc(e){return e/100*window.innerHeight}function Ec(e){return e/100*window.innerWidth}function Dc({axisSize:e,itemElement:t,styleProp:n}){let r,[i,a]=Gs(n);switch(a){case`%`:r=i/100*e;break;case`px`:r=i;break;case`rem`:r=wc(t,i);break;case`em`:r=Cc(t,i);break;case`vh`:r=Tc(i);break;case`vw`:r=Ec(i)}return r}function Oc(e){return parseFloat(e.toFixed(3))}function kc(e){let{items:t}=e,n=mc({axis:e});return n===0?t.map(e=>({groupResizeBehavior:e.constraintProps.groupResizeBehavior,collapsedSize:0,collapsible:e.constraintProps.collapsible===!0,defaultSize:void 0,disabled:e.constraintProps.disabled,minSize:0,maxSize:100,itemId:e.id})):t.map(e=>{let{element:t,constraintProps:r}=e,i=0;r.collapsedSize!==void 0&&(i=Oc(Dc({axisSize:n,itemElement:t,styleProp:r.collapsedSize})/n*100));let a;r.collapsedThreshold!==void 0&&(a=Oc(Dc({axisSize:n,itemElement:t,styleProp:r.collapsedThreshold})/n*100));let o;r.defaultSize!==void 0&&(o=Oc(Dc({axisSize:n,itemElement:t,styleProp:r.defaultSize})/n*100));let s=0;r.minSize!==void 0&&(s=Oc(Dc({axisSize:n,itemElement:t,styleProp:r.minSize})/n*100));let c=100;return r.maxSize!==void 0&&(c=Oc(Dc({axisSize:n,itemElement:t,styleProp:r.maxSize})/n*100)),{groupResizeBehavior:r.groupResizeBehavior,collapsedSize:i,collapsedThreshold:a,collapsible:r.collapsible===!0,defaultSize:o,disabled:r.disabled,minSize:s,maxSize:c,itemId:e.id}})}var Ac=new Map,jc=new Ks;function Mc(e){Ac=new Map(Ac),Ac.delete(e)}function Nc(e,t){for(let[t]of Ac)if(t.id===e)return t}function Pc(e,t){for(let[t,n]of Ac)if(t.id===e)return n;if(t)throw Error(`Could not find data for Group with id ${e}`)}function Fc(){return Ac}function Ic(e,t){return jc.addListener(`axisChange`,n=>{n.axis.id===e&&t(n)})}function Lc(e,t,n){let r=Ac.get(e);Ac=new Map(Ac),Ac.set(e,t),jc.emit(`axisChange`,{axis:e,isUserInteraction:n?.isUserInteraction===!0,prev:r,next:t})}function Rc(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function zc(e,t,n=0){return Math.abs(Oc(e)-Oc(t))<=n}function Bc(e,t){return zc(e,t)?0:e>t?1:-1}function Vc({overrideDisabledItems:e,itemConstraints:t,prevSize:n,size:r}){let{collapsedSize:i=0,collapsedThreshold:a,collapsible:o,disabled:s,maxSize:c=100,minSize:l=0}=t;if(s&&!e)return n;if(Bc(r,l)<0){if(o){let e=a??(l-i)/2,t=Bc(n,i)<=0,o=t?i+e:l-e,s=Bc(r,o);r=Bc(r,i)<=0||s<0||a!==void 0&&t&&s===0?i:l}else r=l}return r=Math.min(c,r),r=Oc(r),r}function Hc({delta:e,initialLayout:t,itemConstraints:n,pivotIndices:r,prevLayout:i,trigger:a}){if(zc(e,0))return t;let o=a===`imperative-api`,s=n.map(({itemId:e})=>t[e]),c=n.map(({itemId:e})=>i[e]),l=[...s],[u,d]=r;Vs(u!=null,`Invalid first pivot index`),Vs(d!=null,`Invalid second pivot index`);let f=0;switch(a){case`keyboard`:{let t=e<0?d:u,r=n[t];Vs(r,`Panel constraints not found for index ${t}`);let{collapsedSize:i=0,collapsible:a,minSize:o=0}=r;if(a){let n=s[t];if(Vs(n!=null,`Previous layout not found for panel index ${t}`),zc(n,i)){let t=o-n;Bc(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}{let t=e<0?u:d,r=n[t];Vs(r,`No panel constraints found for index ${t}`);let{collapsedSize:i=0,collapsible:a,minSize:o=0}=r;if(a){let n=s[t];if(Vs(n!=null,`Previous layout not found for panel index ${t}`),zc(n,o)){let t=n-i;Bc(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}break;default:{let t=e<0?d:u,r=n[t];Vs(r,`Panel constraints not found for index ${t}`);let i=s[t],{collapsedSize:a,collapsedThreshold:o,collapsible:c,minSize:l}=r;if(c&&Bc(i,l)<0){let t=l-a,n=o??t/2;if(Bc(i+Math.abs(e),l)<0){let r=Bc(Math.abs(e),n);e=r>0||r===0&&o===void 0&&e<0?e<0?-t:t:0}}break}}{let t=e<0?1:-1,r=e<0?d:u,i=0;for(;;){let e=s[r];Vs(e!=null,`Previous layout not found for panel index ${r}`);let a=Vc({overrideDisabledItems:o,itemConstraints:n[r],prevSize:e,size:100})-e;if(i+=a,r+=t,r<0||r>=n.length)break}let a=Math.min(Math.abs(e),Math.abs(i));e=e<0?0-a:a}{let t=e<0?u:d;for(;t>=0&&t<n.length;){let r=Math.abs(e)-Math.abs(f),i=s[t];Vs(i!=null,`Previous layout not found for panel index ${t}`);let a=i-r,c=Vc({overrideDisabledItems:o,itemConstraints:n[t],prevSize:i,size:a});if(!zc(i,c)&&(f+=i-c,l[t]=c,f.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?t--:t++}}if(Rc(c,l))return i;{let t=e<0?d:u,r=s[t];Vs(r!=null,`Previous layout not found for panel index ${t}`);let i=r+f,a=Vc({overrideDisabledItems:o,itemConstraints:n[t],prevSize:r,size:i});if(l[t]=a,!zc(a,i)){let t=i-a,r=e<0?d:u;for(;r>=0&&r<n.length;){let i=l[r];Vs(i!=null,`Previous layout not found for panel index ${r}`);let a=i+t,s=Vc({overrideDisabledItems:o,itemConstraints:n[r],prevSize:i,size:a});if(zc(i,s)||(t-=s-i,l[r]=s),zc(t,0))break;e>0?r--:r++}}}return zc(Object.values(l).reduce((e,t)=>t+e,0),100,.1)?l.reduce((e,t,r)=>(e[n[r].itemId]=t,e),{}):i}function Uc(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(t[n]===void 0||Bc(e[n],t[n])!==0)return!1;return!0}function Wc({commit:e,document:t,event:n,hitRegions:r,initialLayoutMap:i,mountedAxes:a,pointerDownAtPoint:o,prevCursorFlags:s}){let c=0,l=Ys(),u=l.state===`active`?l.previews:[],d=new Map(l.state===`active`?l.previewLayoutMap:void 0);r.forEach(t=>{let{axis:r,axisSize:s}=t,{orientation:l,items:f}=r;if(e&&r.resizePreviewMode!==`separator`)return;let{disableCursor:p}=r.mutableState,m=0;m=o?l===`horizontal`?(n.clientX-o.x)/s*100:(n.clientY-o.y)/s*100:l===`horizontal`?n.clientX<0?-100:100:n.clientY<0?-100:100;let h=i.get(r),g=a.get(r);if(!h||!g)return;let{defaultLayoutDeferred:_,derivedItemConstraints:v,axisSize:y,layout:b,separatorToItems:x}=g;if(v&&b&&x){let n=r.resizePreviewMode===`separator`?d.get(r)??b:b,i=Hc({delta:m,initialLayout:h,itemConstraints:v,pivotIndices:t.items.map(e=>f.indexOf(e)),prevLayout:n,trigger:`mouse-or-touch`});if(r.resizePreviewMode===`separator`&&!e&&!Uc(i,n)){d.set(r,i);let e=0,t=f.map(t=>(e+=i[t.id]-h[t.id],s/100*e));u=u.map(e=>{if(e.axis!==r)return e;let n=t[e.itemIndex];return n===e.offset?e:{...e,offset:n}})}if(Uc(i,n)&&m!==0&&!p)switch(l){case`horizontal`:c|=m<0?rc:ic;break;case`vertical`:c|=m<0?ac:oc;break}(r.resizePreviewMode!==`separator`||e)&&!Uc(i,b)&&Lc(t.axis,{defaultLayoutDeferred:_,derivedItemConstraints:v,axisSize:y,layout:i,requestedAxisSize:y,requestedLayout:i,separatorToItems:x})}});let f=0;n.movementX===0?f|=s&sc:f|=c&sc,n.movementY===0?f|=s&cc:f|=c&cc;let p=l.state===`active`&&(n.clientX!==l.pointerDownAtPoint.x||n.clientY!==l.pointerDownAtPoint.y);Zs(f,u,d,p),pc(t)}function Gc(e,t){let n=Ys(),r=Fc(),i=!1;return n.state===`active`&&(Wc({commit:!0,document:e,event:t,hitRegions:n.hitRegions,initialLayoutMap:n.initialLayoutMap,mountedAxes:r,pointerDownAtPoint:n.pointerDownAtPoint,prevCursorFlags:n.cursorFlags}),Qs({cursorFlags:0,state:`inactive`}),n.hitRegions.length>0&&(pc(e),i=!0,n.hitRegions.forEach(e=>{if(!r.has(e.axis))return;let t=Pc(e.axis.id,!0);Lc(e.axis,t,{isUserInteraction:!0})}))),i}function Kc(e){e.defaultPrevented||Gc(e.currentTarget,e)}function qc(e,t,n){let r,i={x:1/0,y:1/0};for(let a of t){let t=bc(n,a.rect);switch(e){case`horizontal`:(t.x<i.x||t.x===i.x&&t.y<=i.y)&&(r=a,i=t);break;case`vertical`:(t.y<i.y||t.y===i.y&&t.x<=i.x)&&(r=a,i=t)}}return r?{distance:i,hitRegion:r}:void 0}function Jc(e){return typeof e==`object`&&!!e&&`nodeType`in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function Yc(e,t){if(e===t)throw Error(`Cannot compare node with itself`);let n={a:tl(e),b:tl(t)},r;for(;n.a.at(-1)===n.b.at(-1);)r=n.a.pop(),n.b.pop();Vs(r,`Stacking order can only be calculated for elements with a common ancestor`);let i={a:el($c(n.a)),b:el($c(n.b))};if(i.a===i.b){let e=r.childNodes,t={a:n.a.at(-1),b:n.b.at(-1)},i=e.length;for(;i--;){let n=e[i];if(n===t.a)return 1;if(n===t.b)return-1}}return Math.sign(i.a-i.b)}var Xc=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function Zc(e){let t=getComputedStyle(nl(e)??e).display;return t===`flex`||t===`inline-flex`}function Qc(e){let t=getComputedStyle(e);return!!(t.position===`fixed`||t.zIndex!==`auto`&&(t.position!==`static`||Zc(e))||+t.opacity<1||`transform`in t&&t.transform!==`none`||`webkitTransform`in t&&t.webkitTransform!==`none`||`mixBlendMode`in t&&t.mixBlendMode!==`normal`||`filter`in t&&t.filter!==`none`||`webkitFilter`in t&&t.webkitFilter!==`none`||`isolation`in t&&t.isolation===`isolate`||Xc.test(t.willChange)||t.webkitOverflowScrolling===`touch`)}function $c(e){let t=e.length;for(;t--;){let n=e[t];if(Vs(n,`Missing node`),Qc(n))return n}return null}function el(e){return e&&Number(getComputedStyle(e).zIndex)||0}function tl(e){let t=[];for(;e;)t.push(e),e=nl(e);return t}function nl(e){let{parentNode:t}=e;return Jc(t)?t.host:t}function rl(e,t){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function il(e){try{return e.matches(`:modal`)}catch{return!1}}function al({axisElement:e,hitRegion:t,pointerEventTarget:n}){if(yc(n)){let t=n.closest(`dialog`);if(t&&!t.contains(e)&&il(t))return!1}if(!yc(n)||n.contains(e)||e.contains(n))return!0;if(Yc(n,e)>0){let r=n;for(;r;){if(r.contains(e))return!0;if(rl(r.getBoundingClientRect(),t))return!1;r=r.parentElement}}return!0}function ol(e,t){let n=[];return t.forEach((t,r)=>{if(r.disabled)return;let i=Sc({axis:r}),a=qc(r.orientation,i,{x:e.clientX,y:e.clientY});a&&a.distance.x<=0&&a.distance.y<=0&&al({axisElement:r.element,hitRegion:a.hitRegion.rect,pointerEventTarget:e.target})&&n.push(a.hitRegion)}),n}function sl({layout:e,itemConstraints:t}){let n=t.map(({itemId:t})=>e[t]),r=[...n],i=r.reduce((e,t)=>e+t,0);if(Object.keys(e).length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${Object.values(e).map(e=>`${e}%`).join(`, `)}`);if(!zc(i,100)&&r.length>0)for(let e=0;e<t.length;e++){let t=r[e];Vs(t!=null,`No layout data found for index ${e}`);let n=100/i*t;r[e]=n}let a=0;for(let e=0;e<t.length;e++){let i=n[e];Vs(i!=null,`No layout data found for index ${e}`);let o=r[e];Vs(o!=null,`No layout data found for index ${e}`);let s=Vc({overrideDisabledItems:!0,itemConstraints:t[e],prevSize:i,size:o});o!=s&&(a+=o-s,r[e]=s)}if(!zc(a,0))for(let e=0;e<t.length;e++){let n=r[e];Vs(n!=null,`No layout data found for index ${e}`);let i=n+a,o=Vc({overrideDisabledItems:!0,itemConstraints:t[e],prevSize:n,size:i});if(n!==o&&(a-=o-n,r[e]=o,zc(a,0)))break}return r.reduce((e,n,r)=>(e[t[r].itemId]=n,e),{})}function cl({axisId:e,itemId:t}){let n=()=>{let t=Fc();for(let[n,{defaultLayoutDeferred:r,derivedItemConstraints:i,layout:a,axisSize:o,separatorToItems:s}]of t)if(n.id===e)return{defaultLayoutDeferred:r,derivedItemConstraints:i,axis:n,axisSize:o,layout:a,separatorToItems:s};throw Error(`Group ${e} not found`)},r=()=>{let e=n().derivedItemConstraints.find(e=>e.itemId===t);if(e!==void 0)return e;throw Error(`Panel constraints not found for Panel ${t}`)},i=()=>{let e=n().axis.items.find(e=>e.id===t);if(e!==void 0)return e;throw Error(`Layout not found for Panel ${t}`)},a=()=>{let e=n().layout[t];if(e!==void 0)return e;throw Error(`Layout not found for Panel ${t}`)},o=({nextSize:e,items:n,prevLayout:r,derivedItemConstraints:i})=>{let o=a(),s=n.findIndex(e=>e.id===t),c=s===0,l=s===n.length-1;if(l&&e<o&&(c||n.slice(0,s).every((e,t)=>{let n=i[t];return n?.collapsible&&zc(n.collapsedSize,r[n.itemId])}))){let e=n.slice(0,s).reduce((e,t)=>e+r[t.id],0);return{...r,[t]:Oc(100-e)}}return Hc({delta:l?o-e:e-o,initialLayout:r,itemConstraints:i,pivotIndices:l?[s-1,s]:[s,s+1],prevLayout:r,trigger:`imperative-api`})},s=e=>{if(e===a())return;let{defaultLayoutDeferred:t,derivedItemConstraints:r,axis:i,axisSize:s,layout:c,separatorToItems:l}=n(),u=sl({layout:o({nextSize:e,items:i.items,prevLayout:c,derivedItemConstraints:r}),itemConstraints:r});Uc(c,u)||Lc(i,{defaultLayoutDeferred:t,derivedItemConstraints:r,axisSize:s,layout:u,requestedAxisSize:s,requestedLayout:u,separatorToItems:l})};return{collapse:()=>{let{collapsible:e,collapsedSize:t}=r(),{mutableValues:n}=i(),o=a();e&&o!==t&&(n.expandToSize=o,s(t))},expand:()=>{let{collapsible:e,collapsedSize:t,minSize:n}=r(),{mutableValues:o}=i(),c=a();if(e&&c===t){let e=o.expandToSize??n;e===0&&(e=1),s(e)}},getSize:()=>{let{axis:e}=n(),r=a(),{element:o}=i();return{asPercentage:r,inPixels:e.layoutStrategy?e.layoutStrategy.getItemSizeInPixels(t):e.orientation===`horizontal`?o.offsetWidth:o.offsetHeight}},isCollapsed:()=>{let{collapsible:e,collapsedSize:t}=r(),n=a();return e&&zc(t,n)},resize:e=>{let{axis:t}=n(),{element:r}=i(),a=mc({axis:t}),o=Oc(Dc({axisSize:a,itemElement:r,styleProp:e})/a*100);s(o)}}}function ll(e){e.defaultPrevented||ol(e,Fc()).forEach(t=>{if(t.separator&&!t.separator.disableDoubleClick){let n=t.items.find(e=>e.constraintProps.defaultSize!==void 0);if(n){let r=n.constraintProps.defaultSize,i=cl({axisId:t.axis.id,itemId:n.id});i&&r!==void 0&&(i.resize(r),e.preventDefault())}}})}function ul(e){let t=Fc();for(let[n]of t)if(n.separators.some(t=>t.element===e))return n;throw Error(`Could not find parent Group for separator element`)}function dl({axisId:e}){let t=()=>{let t=Fc();for(let[n,r]of t)if(n.id===e)return{axis:n,...r};throw Error(`Could not find Group with id "${e}"`)};return{getLayout(){let{defaultLayoutDeferred:e,layout:n}=t();return e?{}:n},setLayout(e){let{defaultLayoutDeferred:n,derivedItemConstraints:r,axis:i,axisSize:a,layout:o,separatorToItems:s}=t(),c=sl({layout:e,itemConstraints:r});return n?o:(Uc(o,c)||Lc(i,{defaultLayoutDeferred:n,derivedItemConstraints:r,axisSize:a,layout:c,requestedAxisSize:a,requestedLayout:c,separatorToItems:s}),c)}}}function fl(e,t){let n=ul(e),r=Pc(n.id,!0),i=n.separators.find(t=>t.element===e);Vs(i,`Matching separator not found`);let a=r.separatorToItems.get(i);Vs(a,`Matching panels not found`);let o=a.map(e=>n.items.indexOf(e)),s=dl({axisId:n.id}).getLayout(),c=sl({layout:Hc({delta:t,initialLayout:s,itemConstraints:r.derivedItemConstraints,pivotIndices:o,prevLayout:s,trigger:`keyboard`}),itemConstraints:r.derivedItemConstraints});Uc(s,c)||Lc(n,{defaultLayoutDeferred:r.defaultLayoutDeferred,derivedItemConstraints:r.derivedItemConstraints,axisSize:r.axisSize,layout:c,requestedAxisSize:r.axisSize,requestedLayout:c,separatorToItems:r.separatorToItems},{isUserInteraction:!0})}function pl(e){if(e.defaultPrevented)return;let t=e.currentTarget,n=ul(t);if(!(n.disabled||n.separators.find(e=>e.element===t)?.disabled))switch(e.key){case`ArrowDown`:e.preventDefault(),n.orientation===`vertical`&&fl(t,5);break;case`ArrowLeft`:e.preventDefault(),n.orientation===`horizontal`&&fl(t,-5);break;case`ArrowRight`:e.preventDefault(),n.orientation===`horizontal`&&fl(t,5);break;case`ArrowUp`:e.preventDefault(),n.orientation===`vertical`&&fl(t,-5);break;case`End`:e.preventDefault(),fl(t,100);break;case`Enter`:{e.preventDefault();let{derivedItemConstraints:r,layout:i,separatorToItems:a}=Pc(n.id,!0),o=n.separators.find(e=>e.element===t);Vs(o,`Matching separator not found`);let s=a.get(o);Vs(s,`Matching panels not found`);let c=s[0],l=r.find(e=>e.itemId===c.id);if(Vs(l,`Panel metadata not found`),l.collapsible){let e=i[c.id];fl(t,(l.collapsedSize===e?n.mutableState.expandedItemSizes[c.id]??l.minSize:l.collapsedSize)-e)}break}case`F6`:{e.preventDefault();let t=n.separators.map(e=>e.element),r=Array.from(t).findIndex(t=>t===e.currentTarget);Vs(r!==null,`Index not found`),t[e.shiftKey?r>0?r-1:t.length-1:r+1<t.length?r+1:0].focus({preventScroll:!0});break}case`Home`:e.preventDefault(),fl(t,-100);break}}function ml(e,t){let{element:n,orientation:r,items:i}=e,a=n.getBoundingClientRect(),o=r===`horizontal`;return Sc({expandHitTargets:!1,axis:e,includeDisabled:!0}).map(({items:r,rect:s,separator:c},l)=>{let u=i.indexOf(r[0]),d=o?s.left+s.width/2:s.top+s.height/2;return{active:t.some(t=>{if(t.axis!==e||t.items[0]!==r[0])return!1;if(c||t.separator)return t.separator===c;let n=o?t.rect.left+t.rect.width/2:t.rect.top+t.rect.height/2;return zc(d,n)}),axis:e,key:c?`separator-${c.id}`:`panel-${r[0].id}-${l}`,offset:0,itemIndex:u,rect:new DOMRect((o&&!c?d:s.left)-a.left-n.clientLeft+n.scrollLeft,(!o&&!c?d:s.top)-a.top-n.clientTop+n.scrollTop,o&&!c?0:s.width,!o&&!c?0:s.height),separator:c}})}function hl(e){if(e.defaultPrevented||e.pointerType===`mouse`&&e.button>0)return;let t=Fc(),n=ol(e,t);if(n.length===0)return;let r=new Map,i=!1;n.forEach(e=>{e.separator&&(i||(i=!0,e.separator.element.focus({focusVisible:!1,preventScroll:!0})));let n=t.get(e.axis);n&&r.set(e.axis,n.layout)});let a=Array.from(r.keys()).flatMap(e=>e.resizePreviewMode===`separator`?ml(e,n):[]);Qs({cursorFlags:0,didPointerMove:!1,hitRegions:n,initialLayoutMap:r,pointerDownAtPoint:{x:e.clientX,y:e.clientY},previewLayoutMap:new Map(r),previews:a,state:`active`}),e.preventDefault()}function gl(e){let t=Fc(),n=Ys();n.state===`active`&&Wc({commit:!1,document:e.currentTarget,event:e,hitRegions:n.hitRegions,initialLayoutMap:n.initialLayoutMap,mountedAxes:t,prevCursorFlags:n.cursorFlags})}function _l(e){if(e.defaultPrevented)return;let t=Ys(),n=Fc();switch(t.state){case`active`:if(e.buttons===0){t.previewLayoutMap.forEach((e,t)=>{let r=n.get(t);t.resizePreviewMode===`separator`&&r&&!Uc(e,r.layout)&&Lc(t,{...r,layout:e,requestedAxisSize:r.axisSize,requestedLayout:e})}),Qs({cursorFlags:0,state:`inactive`}),t.hitRegions.forEach(e=>{if(!n.has(e.axis))return;let t=Pc(e.axis.id,!0);Lc(e.axis,t,{isUserInteraction:!0})}),pc(e.currentTarget);return}for(let n of t.hitRegions)if(n.separator){let{element:t}=n.separator;t.isConnected&&!t.hasPointerCapture?.(e.pointerId)&&t.setPointerCapture?.(e.pointerId)}Wc({commit:!1,document:e.currentTarget,event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedAxes:n,pointerDownAtPoint:t.pointerDownAtPoint,prevCursorFlags:t.cursorFlags});break;default:{let r=ol(e,n);r.length===0?t.state!==`inactive`&&Qs({cursorFlags:0,state:`inactive`}):Qs({cursorFlags:0,hitRegions:r,state:`hover`}),pc(e.currentTarget);break}}}function vl(e){if(e.relatedTarget instanceof HTMLIFrameElement)switch(Ys().state){case`hover`:Qs({cursorFlags:0,state:`inactive`})}}function yl(e){e.defaultPrevented||e.pointerType===`mouse`&&e.button>0||Gc(e.currentTarget,e)&&e.preventDefault()}function bl(e){let t=0,n=0,r={};for(let i of e)if(i.defaultSize!==void 0){t++;let e=Oc(i.defaultSize);n+=e,r[i.itemId]=e}else r[i.itemId]=void 0;let i=e.length-t;if(i!==0){let t=Oc((100-n)/i);for(let n of e)n.defaultSize===void 0&&(r[n.itemId]=t)}return r}function xl(e,t){let n=e.map(e=>e.id),r=Object.keys(t);if(n.length!==r.length)return!1;for(let e of n)if(!r.includes(e))return!1;return!0}function Sl({axis:e,itemConstraints:t}){let n=e.items.map(({id:e})=>e).join(`,`),r=e.mutableState.defaultLayout;return e.mutableState.layouts[n]??(r&&xl(e.items,r)?r:bl(t))}function Cl({itemIds:e,layout:t}){return sl({layout:t,itemConstraints:e.map(e=>({collapsedSize:0,collapsible:!1,defaultSize:void 0,disabled:void 0,itemId:e,maxSize:100,minSize:0}))})}function wl(e,t,n){if(!n[0])return;let r=e.items.find(e=>e.element===t);if(!r||!r.onResize)return;let i=mc({axis:e}),a=e.orientation===`horizontal`?r.element.offsetWidth:r.element.offsetHeight,o=r.mutableValues.prevSize,s={asPercentage:Oc(a/i*100),inPixels:a};r.mutableValues.prevSize=s,r.onResize(s,r.id,o)}function Tl(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function El(e,t){return e.length===t.length&&e.every((e,n)=>Tl(e,t[n]))}function Dl({axis:e,nextAxisSize:t,prevAxisSize:n,prevLayout:r}){if(n<=0||t<=0||n===t)return r;let i=0,a=0,o=!1,s=new Map,c=[];for(let l of e.items){let e=r[l.id]??0;switch(l.constraintProps.groupResizeBehavior){case`preserve-pixel-size`:{o=!0;let r=Oc(e/100*n/t*100);s.set(l.id,r),i+=r;break}default:c.push(l.id),a+=e}}if(!o||c.length===0)return r;let l=100-i,u={...r};if(s.forEach((e,t)=>{u[t]=e}),a>0)for(let e of c)u[e]=Oc((r[e]??0)/a*l);else{let e=Oc(l/c.length);for(let t of c)u[t]=e}return u}var Ol=new Map;function kl(e){let t=!0;Vs(e.element.ownerDocument.defaultView,`Cannot register an unmounted Group`);let n=e.element.ownerDocument.defaultView.ResizeObserver,r=new Set,i=new Set,a=new n(n=>{for(let r of n){let{borderBoxSize:n,target:i}=r;if(i===e.element){if(t){let t=mc({axis:e});if(t===0)return;let n=Pc(e.id);if(!n)return;let r=kc(e),i=n.requestedAxisSize,a=n.requestedLayout;n.defaultLayoutDeferred&&(i=t,a=Cl({itemIds:e.items.map(({id:e})=>e),layout:Sl({axis:e,itemConstraints:r})}));let o=sl({layout:Dl({axis:e,nextAxisSize:t,prevAxisSize:i,prevLayout:a}),itemConstraints:r});if(!n.defaultLayoutDeferred&&Uc(n.layout,o)&&El(n.derivedItemConstraints,r)&&n.axisSize===t)continue;Lc(e,{defaultLayoutDeferred:!1,derivedItemConstraints:r,axisSize:t,layout:o,requestedAxisSize:i,requestedLayout:a,separatorToItems:n.separatorToItems})}}else wl(e,i,n)}});a.observe(e.element),e.items.forEach(e=>{Vs(!r.has(e.id),`Panel ids must be unique; id "${e.id}" was used more than once`),r.add(e.id),e.onResize&&a.observe(e.element)});let o=mc({axis:e}),s=kc(e),c=Sl({axis:e,itemConstraints:s}),l=sl({layout:c,itemConstraints:s}),u=e.element.ownerDocument;Ol.set(u,(Ol.get(u)??0)+1);let d=new Map;return Sc({axis:e,includeDisabled:!0}).forEach(e=>{e.separator&&d.set(e.separator,e.items)}),Lc(e,{defaultLayoutDeferred:o===0,derivedItemConstraints:s,axisSize:o,layout:l,requestedAxisSize:o,requestedLayout:Cl({itemIds:e.items.map(({id:e})=>e),layout:c}),separatorToItems:d}),e.separators.forEach(e=>{Vs(!i.has(e.id),`Separator ids must be unique; id "${e.id}" was used more than once`),i.add(e.id),e.element.addEventListener(`keydown`,pl)}),Ol.get(u)===1&&(u.addEventListener(`contextmenu`,Kc,!0),u.addEventListener(`dblclick`,ll,!0),u.addEventListener(`pointerdown`,hl,!0),u.addEventListener(`pointerleave`,gl),u.addEventListener(`pointermove`,_l),u.addEventListener(`pointerout`,vl),u.addEventListener(`pointerup`,yl,!0)),function(){t=!1,Ol.set(u,Math.max(0,(Ol.get(u)??0)-1)),Mc(e),ec(e)&&pc(u),e.separators.forEach(e=>{e.element.removeEventListener(`keydown`,pl)}),Ol.get(u)||(u.removeEventListener(`contextmenu`,Kc,!0),u.removeEventListener(`dblclick`,ll,!0),u.removeEventListener(`pointerdown`,hl,!0),u.removeEventListener(`pointerleave`,gl),u.removeEventListener(`pointermove`,_l),u.removeEventListener(`pointerout`,vl),u.removeEventListener(`pointerup`,yl,!0)),a.disconnect()}}function Al({derivedItemConstraints:e,axis:t,layout:n,prevLayout:r,requestedLayout:i}){let a=t.items.map(({id:e})=>e).join(`,`);t.mutableState.layouts[a]=i,r&&e.forEach(e=>{if(e.collapsible){let i=zc(e.collapsedSize,n[e.itemId]),a=zc(e.collapsedSize,r[e.itemId]);i&&!a&&(t.mutableState.expandedItemSizes[e.itemId]=r[e.itemId])}})}function jl(){let[e,t]=m({});return[e,o(()=>t({}),[])]}function Ml(e){let t=p({...e});return Rs(()=>{for(let n in e)t.current[n]=e[n]},[e]),t.current}var Nl=n(null);function Pl({layout:e,itemConstraints:t,itemId:n,itemIndex:r}){let i,a,o=e[n],s=t.find(e=>e.itemId===n);if(s){let c=s.maxSize,l=s.collapsible?s.collapsedSize:s.minSize,u=[r,r+1];a=sl({layout:Hc({delta:l-o,initialLayout:e,itemConstraints:t,pivotIndices:u,prevLayout:e}),itemConstraints:t})[n],i=sl({layout:Hc({delta:c-o,initialLayout:e,itemConstraints:t,pivotIndices:u,prevLayout:e}),itemConstraints:t})[n]}return{valueControls:n,valueMax:i,valueMin:a,valueNow:o}}function Fl({attributes:e,axisId:t,axisOrientation:n,children:r,className:i,disableCursor:a,disabled:o,disableDoubleClick:s,elementRef:l,id:u,isSharedHitRegion:d,preview:f,registerSeparator:h,requiredStyle:g,style:_,styleDefaults:v,tabIndex:y=0,updateSeparatorProps:x}){let S=Ml({disabled:o,disableDoubleClick:s,children:r,className:i,preview:f,style:_}),[C,w]=m({}),[T,E]=m(`inactive`),[D,O]=m(!1),k=p(null),A=p(null),j=Bs(k,l),M=n===`horizontal`?`vertical`:`horizontal`;Rs(()=>{let e=k.current;if(e!==null){let n={disabled:S.disabled,disableDoubleClick:S.disableDoubleClick,element:e,id:u,get children(){return S.children},get className(){return S.className},get preview(){return S.preview},get style(){return S.style}};A.current=n;let r=h(n),i=Xs(e=>{E(e.next.state!==`inactive`&&e.next.hitRegions.some(e=>e.separator===n||(d?.(e)??!1))?e.next.state:`inactive`)}),a=Ic(t,e=>{let{derivedItemConstraints:t,layout:r,separatorToItems:i}=e.next,a=i.get(n);if(a){let n=a[0],i=t.findIndex(e=>e.itemId===n.id),{layoutStrategy:o}=e.axis;w({...Pl({layout:r,itemConstraints:t,itemId:n.id,itemIndex:i}),...o?.getItemAriaControls&&{valueControls:o.getItemAriaControls(n.id)}})}});return()=>{A.current=null,i(),a(),r()}}},[t,u,d,h,S]),Rs(()=>{let e=A.current;e&&$s(e)},[f]),c(()=>{x(u,{disabled:o,disableDoubleClick:s})},[o,s,u,x]);let N;o&&!a&&(N=`not-allowed`);let ee;if(o)ee=`disabled`;else switch(T){case`active`:ee=`active`;break;default:ee=D?`focus`:T}return b(`div`,{...e,"aria-controls":C.valueControls,"aria-disabled":o||void 0,"aria-orientation":M,"aria-valuemax":C.valueMax,"aria-valuemin":C.valueMin,"aria-valuenow":C.valueNow,children:r,className:i,"data-separator":ee,"data-testid":u,id:u,onBlur:()=>O(!1),onFocus:()=>O(!0),ref:j,role:`separator`,style:{...v,cursor:N,..._,...g,touchAction:`none`},tabIndex:o?void 0:y})}function Il(e){for(let t=1;t<e.length;t++)if(hc(e[t-1],e[t])>0)return!1;return!0}function Ll({separator:e}){let{element:t}=e,n=p(null);return Rs(()=>{let e=t.cloneNode(!0),r=[t,...t.querySelectorAll(`*`)],i=[e,...e.querySelectorAll(`*`)],a=t.ownerDocument.defaultView;return r.forEach((e,t)=>{let n=i[t];if(n instanceof a.HTMLElement||n instanceof a.SVGElement){let t=a.getComputedStyle(e);for(let e=0;e<t.length;e++){let r=t.item(e);n.style.setProperty(r,t.getPropertyValue(r))}}n.removeAttribute(`data-testid`),n.removeAttribute(`id`)}),Object.assign(e.style,{boxSizing:`border-box`,height:`100%`,margin:`0`,position:`static`,transform:`none`,width:`100%`}),n.current.appendChild(e),()=>e.remove()},[t]),b(`div`,{ref:n,style:{height:`100%`,opacity:.65,pointerEvents:`none`,width:`100%`}})}function Rl(){let e=s(Nl);return Vs(e,`Group Context not found; did you render a Panel or Separator outside of a Group?`),e}function zl(e){let{registerOverlay:t}=Rl(),n=p(e);Tl(n.current,e)||(n.current=e);let r=n.current;return Rs(()=>t(r),[t,r]),null}zl.displayName=`SeparatorOverlay`;function Bl({active:e,orientation:t,style:n,...r}){let i;switch(t){case`horizontal`:i={height:`100%`,minWidth:`1px`};break;case`vertical`:i={minHeight:`1px`,width:`100%`}}return b(`div`,{...r,"data-separator-overlay":e?`active`:`inactive`,style:{...i,...n,flexShrink:0,pointerEvents:`none`}})}function Vl({overlay:e,preview:t}){let{axis:n,offset:r,rect:i,separator:o}=t,s=n.orientation===`horizontal`,c=o?.preview,l=e;return a(c)&&c.type===zl&&(l=c.props,c=void 0),c??(l?c=b(Bl,{...l,active:t.active,orientation:n.orientation}):o&&(c=b(Ll,{separator:o}))),b(`div`,{"aria-hidden":`true`,"data-resize-preview":!0,inert:!0,style:{height:i.height,left:i.left,pointerEvents:`none`,position:`absolute`,top:i.top,transform:s?`translateX(${r}px)`:`translateY(${r}px)`,width:i.width},children:c})}function Hl(e){return Array.from(e).sort(hc)}function Ul(e,t){let n=p({getLayout:()=>({}),setLayout:tc});u(t,()=>n.current,[]),Rs(()=>{Object.assign(n.current,dl({axisId:e}))})}function Wl({groupId:e,resizePreviewMode:t}){let[n,r]=m([]),i=p(n);return Rs(()=>{let n=n=>{let a=Nc(e),o=t===`separator`&&n.state===`active`?n.previews.filter(e=>e.axis===a&&(e.active||!zc(e.offset,0))):[],s=i.current;s.length===o.length&&o.every((e,t)=>e===s[t])||(i.current=o,r(o))};if(t!==`separator`){n(Ys());return}let a=Xs(({next:e})=>n(e));return n(Ys()),a},[e,t]),n}function Gl({children:e,className:t,defaultLayout:n,disableCursor:r,disabled:i,elementRef:a,groupRef:o,id:s,onLayoutChange:l,onLayoutChanged:u,orientation:d=`horizontal`,resizePreviewMode:h=`panel`,resizeTargetMinimumSize:g={coarse:20,fine:10},style:_,...v}){let y=p({onLayoutChange:{},onLayoutChanged:{}}),S=zs(e=>{Uc(y.current.onLayoutChange,e)||(y.current.onLayoutChange=e,l?.(e))}),C=zs((e,t,n)=>{Uc(y.current.onLayoutChanged,e)||(y.current.onLayoutChanged=e,u?.(e,{isUserInteraction:t,requestedLayout:n}))}),w=Ls(s),[T,E]=m(),D=Wl({groupId:w,resizePreviewMode:h}),O=p(null),[k,A]=jl(),j=p([]),M=p({lastExpandedPanelSizes:{},layouts:{},panels:[],separators:[]}),N=Bs(O,a);Ul(w,o);let ee=zs((e,t)=>{let r=Pc(e);if(r)return{flexGrow:r.layout[t]??1};if(n?.[t])return{flexGrow:n?.[t]}}),te=Ml({defaultLayout:n,disableCursor:r,resizeTargetMinimumSize:g}),P=f(()=>({get disableCursor(){return!!te.disableCursor},getPanelStyles:ee,id:w,orientation:d,registerPanel:e=>{let t=M.current;return t.panels=gc(d,[...t.panels,e]),A(),()=>{t.panels=t.panels.filter(t=>t!==e),A()}},registerOverlay:e=>(E(e),()=>{E(void 0)}),registerSeparator:e=>{let t=M.current;return t.separators=gc(d,[...t.separators,e]),A(),()=>{t.separators=t.separators.filter(t=>t!==e),A()}},updatePanelProps:(e,{disabled:t})=>{let n=M.current.panels.find(t=>t.id===e);n&&(n.constraintProps.disabled=t);let r=Nc(w),i=Pc(w);r&&i&&Lc(r,{...i,derivedItemConstraints:kc(r)})},updateSeparatorProps:(e,{disabled:t,disableDoubleClick:n})=>{let r=M.current.separators.find(t=>t.id===e);r&&(r.disabled=t,r.disableDoubleClick=n)}}),[ee,w,A,d,te]),F=p(null);return Rs(()=>{let e=O.current;if(e===null)return;let t=M.current;t.panels=gc(d,t.panels),t.separators=gc(d,t.separators),j.current=Hl([...t.panels.map(({element:e})=>e),...t.separators.map(({element:e})=>e)]);let n;if(te.defaultLayout!==void 0&&Object.keys(te.defaultLayout).length===t.panels.length){n={};for(let e of t.panels){let t=te.defaultLayout[e.id];t!==void 0&&(n[e.id]=t)}}let r={disabled:!!i,element:e,id:w,mutableState:{defaultLayout:n,disableCursor:!!te.disableCursor,expandedItemSizes:M.current.lastExpandedPanelSizes,layouts:M.current.layouts},orientation:d,items:t.panels,resizePreviewMode:h,get resizeTargetMinimumSize(){return te.resizeTargetMinimumSize},separators:t.separators};F.current=r;let a=kl(r),{defaultLayoutDeferred:o,derivedItemConstraints:s,layout:c,requestedLayout:l}=Pc(r.id,!0);!o&&s.length>0&&(S(c),C(c,!1,l));let u=Ic(w,e=>{let{defaultLayoutDeferred:t,derivedItemConstraints:n,layout:i,requestedLayout:a}=e.next;if(t||n.length===0)return;Al({derivedItemConstraints:n,axis:r,layout:i,prevLayout:e.prev?.layout,requestedLayout:a});let o=Ys(),s=o.state!==`active`||!o.hitRegions.some(e=>e.axis===r);S(i),s&&C(i,e.isUserInteraction,a)});return()=>{F.current=null,a(),u()}},[i,w,C,S,d,k,h,te]),Rs(()=>{Il(j.current)||A()}),c(()=>{let e=F.current;e&&(e.mutableState.defaultLayout=n,e.mutableState.disableCursor=!!r)}),b(Nl.Provider,{value:P,children:x(`div`,{...v,className:t,"data-group":!0,"data-testid":w,id:w,ref:N,style:{height:`100%`,width:`100%`,overflow:`hidden`,position:h===`separator`?`relative`:void 0,..._,display:`flex`,flexDirection:d===`horizontal`?`row`:`column`,flexWrap:`nowrap`,touchAction:d===`horizontal`?`pan-y`:`pan-x`},children:[e,D.map(e=>b(Vl,{overlay:T,preview:e},e.key))]})})}Gl.displayName=`Group`;function Kl(e,t){let{id:n}=Rl(),r=p({collapse:nc,expand:nc,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:nc});u(t,()=>r.current,[]),Rs(()=>{Object.assign(r.current,cl({axisId:n,itemId:e}))})}function ql({children:e,className:t,collapsedSize:n=`0%`,collapsedThreshold:r,collapsible:i=!1,defaultSize:a,disabled:o,elementRef:s,groupResizeBehavior:l=`preserve-relative-size`,id:u,maxSize:d=`100%`,minSize:f=`0%`,onResize:m,panelRef:g,style:_,...v}){let y=!!u,x=Ls(u),S=Ml({disabled:o}),C=p(null),w=Bs(C,s),{getPanelStyles:T,id:E,orientation:D,registerPanel:O,updatePanelProps:k}=Rl(),A=m!==null,j=zs((e,t,n)=>{m?.(e,u,n)});Rs(()=>{let e=C.current;if(e!==null){let t={element:e,id:x,idIsStable:y,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:A?j:void 0,constraintProps:{groupResizeBehavior:l,collapsedSize:n,collapsedThreshold:r,collapsible:i,defaultSize:a,disabled:S.disabled,maxSize:d,minSize:f}};return O(t)}},[l,n,r,i,a,A,x,y,d,f,j,O,S]),c(()=>{k(x,{disabled:o})},[o,x,k]),Kl(x,g);let M=()=>{let e=T(E,x);if(e)return JSON.stringify(e)},N=h(e=>Ic(E,e),M,M),ee;return ee=N?JSON.parse(N):a===void 0?{flexGrow:1}:{flexGrow:void 0,flexShrink:void 0,flexBasis:a},b(`div`,{...v,"data-disabled":o||void 0,"data-panel":!0,"data-testid":x,id:x,ref:w,style:{...Jl,display:`flex`,flexBasis:0,flexShrink:1,overflow:`visible`,...ee},children:b(`div`,{className:t,style:{maxHeight:`100%`,maxWidth:`100%`,flexGrow:1,overflow:`auto`,..._,touchAction:D===`horizontal`?`pan-y`:`pan-x`},children:e})})}ql.displayName=`Panel`;var Jl={minHeight:0,maxHeight:`100%`,height:`auto`,minWidth:0,maxWidth:`100%`,width:`auto`,border:`none`,borderWidth:0,padding:0,margin:0},Yl={flexBasis:`auto`},Xl={flexGrow:0,flexShrink:0};function Zl({children:e,className:t,disabled:n,disableDoubleClick:r,elementRef:i,id:a,preview:o,style:s,...c}){let l=Ls(a),{disableCursor:u,id:d,orientation:f,registerSeparator:p,updateSeparatorProps:m}=Rl();return b(Fl,{attributes:c,axisId:d,axisOrientation:f,className:t,disableCursor:u,disabled:n,disableDoubleClick:r,elementRef:i,id:l,preview:o,registerSeparator:p,requiredStyle:Xl,style:s,styleDefaults:Yl,updateSeparatorProps:m,children:e})}Zl.displayName=`Separator`;function Ql({className:e,...t}){return b(Gl,{"data-slot":`resizable-panel-group`,className:U(`flex h-full w-full aria-[orientation=vertical]:flex-col`,e),...t})}function $l({...e}){return b(ql,{"data-slot":`resizable-panel`,...e})}function eu({withHandle:e,className:t,...n}){return b(Zl,{"data-slot":`resizable-handle`,className:U(`relative flex w-px items-center justify-center bg-border ring-offset-background after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-ring focus-visible:outline-hidden aria-[orientation=horizontal]:h-px aria-[orientation=horizontal]:w-full aria-[orientation=horizontal]:after:left-0 aria-[orientation=horizontal]:after:h-1 aria-[orientation=horizontal]:after:w-full aria-[orientation=horizontal]:after:translate-x-0 aria-[orientation=horizontal]:after:-translate-y-1/2 [&[aria-orientation=horizontal]>div]:rotate-90`,t),...n,children:e&&b(`div`,{className:`z-10 flex h-6 w-1 shrink-0 rounded-lg bg-border`})})}e.createContext(null);var tu=`onebot-sandbox`;function q(){let t=ie(),n=ae(tu);return e.useMemo(()=>(e,t)=>n(e,t),[n,t])}function nu(e,t){return t.type===`main`?e(`sandbox.source.main`):t.name}function ru(){let t=e.useRef(null),[n,r]=e.useState(0);return e.useLayoutEffect(()=>{let e=t.current;if(!e)return;r(e.offsetWidth);let n=new ResizeObserver(()=>r(e.offsetWidth));return n.observe(e),()=>n.disconnect()},[]),[t,n]}function iu(e){return e.kind===`user`}function au(e){return e.kind===`bot`}function ou(e){return e.participants.filter(iu)}function su(e){return e.participants.filter(au)}function cu(e,t){let[n,r]=[e,t].sort();return`private:${n}:${r}`}function lu(e){return`group:${e}`}function uu(e){return e.forwardId&&(e.sourceMessageId||e.content.trim()===`[合并转发]`)?``:e.content}function du(e){return e?.lifecycle?.status===`recalled`}function fu(e,t){return`${t||e.lifecycle.operatorId} 撤回了一条消息`}function pu(e){let t={id:e.id,kind:`root`,rootConversationId:e.id,...e.hasMoreMessages?{hasMoreMessages:!0}:{}};return e.type===`direct`?{...t,type:`direct`,participantIds:e.participantIds}:{...t,type:`group`,groupId:e.groupId}}function mu(e,t){let n=hu(e,t.rootConversationId);if(!n)return;let r={id:t.id,kind:`instance`,rootConversationId:n.id,title:t.title,...t.hasMoreMessages?{hasMoreMessages:!0}:{}};return n.type===`direct`?{...r,type:`direct`,participantIds:n.participantIds}:{...r,type:`group`,groupId:n.groupId}}function hu(e,t){return e.conversations.find(({id:e})=>e===t)}function gu(e){return Array.isArray(e.conversationInstances)?e.conversationInstances:[]}function _u(e,t){return gu(e).find(({id:e})=>e===t)}function vu(e,t){return hu(e,t)??_u(e,t)}function yu(e){let t=`forkPoint`in e?e.forkPoint:void 0;if(!(!t||typeof t!=`object`))return typeof t.conversationId==`string`&&typeof t.messageId==`string`?t:void 0}function bu(e,t,n){let r=yu(t);if(!r)return t.messageIds;if(n.has(t.id))return[];n.add(t.id);let i=vu(e,r.conversationId);if(!i)return t.messageIds;let a=bu(e,i,n),o=a.indexOf(r.messageId);return o<0?t.messageIds:[...a.slice(0,o+1),...t.messageIds]}function xu(e,t){let n=vu(e,t);return n?bu(e,n,new Set):[]}function Su(e,t){return!!t&&e.conversationId!==t}function Cu(e){return e.conversations.map(pu)}function wu(e){return gu(e).flatMap(t=>{let n=mu(e,t);return n?[n]:[]})}function Tu(e){return[...Cu(e),...wu(e)]}function Eu(e,t,n){return t.type===`direct`?!!t.participantIds?.includes(n):!!e.groups.find(({id:e})=>e===t.groupId)?.members.some(e=>e.participantId===n)}function Du(e,t,n){let r=hu(e,cu(t,n));return r?pu(r):void 0}function Ou(e,t){let n=hu(e,lu(t));return n?pu(n):void 0}function ku(e,t){if(e.type!==`direct`)return;let n=e.participantIds;return n?.find(e=>e!==t)??n?.[0]}function Au(e,t){return t?e.participants.filter(({id:e})=>e!==t).map(n=>{let r=e.friendships.find(({participantIds:e})=>e.includes(t)&&e.includes(n.id)),i=e.requests.some(({type:e,requesterId:r,targetId:i})=>e===`friend`&&r===t&&i===n.id),a=e.requests.some(({type:e,requesterId:r,targetId:i})=>e===`friend`&&r===n.id&&i===t),o=n.kind===`bot`,s=Du(e,t,n.id)?.id;return{id:n.id,isBot:o,isFriend:!!r,pendingOutgoing:i,pendingIncoming:a,conversationId:s,avatar:n.avatar,displayName:r?.remarks[t]||n.name,statusKey:r?o?`sandbox.relation.botFriend`:`sandbox.relation.friend`:i?`sandbox.relation.outgoing`:a?`sandbox.relation.incoming`:o?`sandbox.relation.botMissing`:`sandbox.relation.missing`,participantName:n.name,relation:r?`added`:i||a?`pending`:`missing`}}):[]}function ju(e,t){return t?e.groups.map(n=>{let r=n.members.find(({participantId:e})=>e===t),i=e.requests.some(({type:e,subType:r,requesterId:i,groupId:a})=>e===`group`&&(r??`add`)===`add`&&i===t&&a===n.id),a=r?Ou(e,n.id)?.id:void 0;return{...n,member:r,pending:i,conversationId:a,relation:r?`joined`:i?`pending`:`missing`}}):[]}var Mu=64,Nu=new Map,Pu=new Map;function Fu(e){let t=Nu.get(e);if(t!==void 0)return t;let n=Pu.get(e);if(n!==void 0)return Pu.delete(e),Pu.set(e,n),n}function Iu(e,t,n){if(n){Nu.set(e,t),Pu.delete(e);return}if(!Nu.has(e))for(Pu.delete(e),Pu.set(e,t);Pu.size>Mu;)Pu.delete(Pu.keys().next().value)}function Lu(e,t){let n=e.participants.find(({id:e})=>e===t.currentOperatorId)??e.participants.find(({kind:e})=>e===`user`)??e.participants[0],r=n?Tu(e).filter(t=>Eu(e,t,n.id)):[],i=r.find(({id:e})=>e===t.activeConversationId)??r[0];return{currentOperatorId:n?.id,activeConversationId:i?.id}}async function Ru(e,t){try{return await re(e,t??{})}catch(e){throw Error(Vu(e))}}var zu=e=>e;function Bu(e){zu=e}function Vu(e,t=zu(`sandbox.common.failed`)){return(e instanceof Error?e.message:typeof e==`string`?e:``).trim().split(/\r?\n/,1)[0]?.replace(/^Error:\s*/,``)||t}var Hu=/^sandbox-media:\/\/([a-f0-9]{32})$/;function Uu(e){return e?.match(Hu)?.[1]}function Wu(e){return`chatluna.onebot-sandbox.selection.${e??`main`}`}function Gu(e){let t=R(Wu(e));if(!t||typeof t!=`object`)return{};let n=t;return{currentOperatorId:typeof n.currentOperatorId==`string`?n.currentOperatorId:void 0,activeConversationId:typeof n.activeConversationId==`string`?n.activeConversationId:void 0}}var Ku=class{spaceId;view={media:{},mediaFailures:{}};listeners=new Set;refreshTask;pendingRefresh=!1;mediaLoading=new Set;disposed=!1;constructor(e){this.spaceId=e}subscribe=e=>(this.listeners.add(e),()=>this.listeners.delete(e));getView=()=>this.view;activate(){this.disposed=!1}dispose(){this.disposed=!0}set(e){if(!this.disposed){this.view={...this.view,...e};for(let e of this.listeners)e()}}scoped(e){return this.spaceId?{...e,spaceId:this.spaceId}:e}get snapshot(){return this.view.workspace?.snapshot}requireOperatorId(){let e=this.view.currentOperatorId;if(!e)throw Error(zu(`sandbox.error.noOperator`));return e}saveSelection(){z(Wu(this.spaceId),{currentOperatorId:this.view.currentOperatorId,activeConversationId:this.view.activeConversationId})}replaceWorkspace(e,t={},n=!0){let r=Lu(e.snapshot,{currentOperatorId:t.currentOperatorId??this.view.currentOperatorId,activeConversationId:t.activeConversationId??this.view.activeConversationId}),{avatarIds:i,messageMediaIds:a}=qu(e.snapshot),o=[...i,...a].flatMap(e=>{let t=this.view.media[e]?void 0:Fu(e);return t?[[e,t]]:[]});this.set({workspace:e,currentOperatorId:r.currentOperatorId,activeConversationId:r.activeConversationId,loadError:void 0,...o.length?{media:{...this.view.media,...Object.fromEntries(o)}}:{}}),n&&this.saveSelection(),this.loadVisibleMedia()}seed(e){this.replaceWorkspace(e,Gu(this.spaceId),!1)}async load(){let e=Gu(this.spaceId);try{let t;try{t=await Ru(`onebot-sandbox.workspace`,this.scoped(e.currentOperatorId?{operatorId:e.currentOperatorId}:{}))}catch{t=await Ru(`onebot-sandbox.workspace`,this.scoped({}))}this.replaceWorkspace(t,e)}catch(e){this.set({loadError:Vu(e,zu(`sandbox.error.loadWorkspace`))})}}notifySceneChanged(){this.pendingRefresh=!0,!this.refreshTask&&(this.refreshTask=(async()=>{try{for(;this.pendingRefresh&&!this.disposed;){this.pendingRefresh=!1;let e=this.view.currentOperatorId;try{let t=await Ru(`onebot-sandbox.workspace`,this.scoped(e?{operatorId:e}:{}));t.snapshot.revision>=(this.snapshot?.revision??0)&&this.replaceWorkspace(t)}catch{}}}finally{this.refreshTask=void 0}})())}selectConversation(e){this.set({activeConversationId:e}),this.saveSelection()}async selectOperator(e){let t=await Ru(`onebot-sandbox.workspace`,this.scoped({operatorId:e}));this.set({currentOperatorId:e}),this.replaceWorkspace(t,{currentOperatorId:e})}async mutate(e,t){let n=await Ru(e,this.scoped({...t,operatorId:this.requireOperatorId()}));return n&&typeof n==`object`&&`snapshot`in n&&this.replaceWorkspace(n),n}sendMessage(e){return this.mutate(`onebot-sandbox.send-message`,e)}sendMediaMessage(e){return this.mutate(`onebot-sandbox.send-media-message`,e)}sendForwardMessage(e){return this.mutate(`onebot-sandbox.send-forward-message`,e)}recallMessage(e){return this.mutate(`onebot-sandbox.recall-message`,e)}clearConversationMessages(e){return this.mutate(`onebot-sandbox.clear-conversation-messages`,e)}setMessageReaction(e){return this.mutate(`onebot-sandbox.set-message-reaction`,e)}async createConversationInstance(e){let{conversationId:t}=await this.mutate(`onebot-sandbox.create-conversation-instance`,{rootConversationId:e});return this.selectConversation(t),t}async branchConversationInstance(e){let{conversationId:t}=await this.mutate(`onebot-sandbox.branch-conversation-instance`,e);return this.selectConversation(t),t}renameConversationInstance(e){return this.mutate(`onebot-sandbox.rename-conversation-instance`,e)}deleteConversationInstance(e){return this.mutate(`onebot-sandbox.delete-conversation-instance`,{conversationId:e})}performFriendAction(e){return this.mutate(`onebot-sandbox.friend-action`,e)}performGroupAction(e){return this.mutate(`onebot-sandbox.group-action`,e)}handleRelationshipRequest(e,t){let n=this.snapshot?.requests.find(({id:t})=>t===e);if(!n)throw Error(zu(`sandbox.error.requestMissing`));return n.type===`group`?this.performGroupAction({action:`handle-request`,requestId:e,approve:t}):this.performFriendAction({action:`handle-request`,requestId:e,approve:t})}setGroupAnnouncement(e){return this.mutate(`onebot-sandbox.set-group-announcement`,e)}deleteGroupAnnouncement(e){return this.mutate(`onebot-sandbox.delete-group-announcement`,e)}async manageEnvironment(e){let t=this.view.currentOperatorId,n=await Ru(`onebot-sandbox.manage-environment`,this.scoped(e)),r=(e.action===`delete-user`||e.action===`delete-bot`)&&e.data.id===t;this.replaceWorkspace(t&&!r?await Ru(`onebot-sandbox.workspace`,this.scoped({operatorId:t})):n)}searchConversationMessages(e){return Ru(`onebot-sandbox.search-conversation-messages`,this.scoped({...e,operatorId:this.requireOperatorId()}))}async getForwardMessage(e){let t=await Ru(`onebot-sandbox.get-forward-message`,this.scoped({...e,operatorId:this.requireOperatorId()})),n=this.view.workspace;return n&&!(n.snapshot.forwards??[]).some(({id:e})=>e===t.id)&&(this.set({workspace:{...n,snapshot:{...n.snapshot,forwards:[...n.snapshot.forwards??[],t]}}}),this.loadVisibleMedia()),t}async loadEarlierMessages(e){let t=this.view.workspace;if(!t)return;let n=xu(t.snapshot,e)[0];if(!n)return;let r=await Ru(`onebot-sandbox.message-history`,this.scoped({operatorId:this.requireOperatorId(),conversationId:e,beforeMessageId:n,limit:50})),i=this.view.workspace??t,a=i.snapshot,o=new Set(a.messages.map(({id:e})=>e)),s=new Set((a.forwards??[]).map(({id:e})=>e)),c=t=>t.map(t=>t.id===e?{...t,messageIds:[...r.messages.map(({id:e})=>e),...t.messageIds],hasMoreMessages:!!r.nextBeforeMessageId}:t);this.set({workspace:{...i,snapshot:{...a,conversations:c(a.conversations),conversationInstances:c(a.conversationInstances??[]),messages:[...r.messages.filter(({id:e})=>!o.has(e)),...a.messages],forwards:[...a.forwards??[],...(r.forwards??[]).filter(({id:e})=>!s.has(e))]}}}),this.loadVisibleMedia()}resolveAvatar(e){let t=Uu(e);return t?this.view.media[t]??``:e??``}async loadVisibleMedia(){let e=this.snapshot,t=this.view.currentOperatorId;if(!e||!t)return;let{avatarIds:n,messageMediaIds:r}=qu(e),i=[...new Set([...n,...r])].filter(e=>!this.view.media[e]&&!this.mediaLoading.has(e));await Promise.all(i.map(async e=>{this.mediaLoading.add(e);try{let r=await Ru(`onebot-sandbox.media-content`,this.scoped({operatorId:t,mediaId:e})),i=`data:${r.mimeType};base64,${r.dataBase64}`;Iu(e,i,n.has(e));let{[e]:a,...o}=this.view.mediaFailures;this.set({media:{...this.view.media,[e]:i},mediaFailures:o})}catch{this.set({mediaFailures:{...this.view.mediaFailures,[e]:!0}})}finally{this.mediaLoading.delete(e)}}))}};function qu(e){return{avatarIds:new Set([...e.participants.map(({avatar:e})=>e),...e.groups.map(({avatar:e})=>e)].flatMap(e=>Uu(e)??[])),messageMediaIds:new Set([...e.messages.flatMap(({media:e})=>e?.map(({id:e})=>e)??[]),...(e.forwards??[]).flatMap(({nodes:e})=>e.flatMap(({media:e})=>e?.map(({id:e})=>e)??[]))])}}function Ju(e,t){return t?Tu(e).filter(n=>Eu(e,n,t)):[]}function Yu(e,t){if(!t)return[];let n=xu(e,t),r=new Map(e.messages.map(e=>[e.id,e]));return n.flatMap(e=>r.get(e)??[])}var Xu=e.createContext(void 0);function Zu(){let t=e.useContext(Xu);if(!t)throw Error(`useSandbox must be used inside SandboxProvider`);return t}function Qu(){let{derived:e}=Zu();if(!e)throw Error(`workspace is not loaded`);return e}function $u(e,t){let n=e.workspace;if(!n)return;let r=n.snapshot,i=e.currentOperatorId,a=r.participants.find(({id:e})=>e===i),o=Ju(r,i),s=o.find(({id:t})=>t===e.activeConversationId),c=s?ku(s,i):void 0,l=su(r).find(({id:e})=>e===c),u=l??ou(r).find(({id:e})=>e===c),d=e=>t.resolveAvatar(e),f=Object.fromEntries(r.participants.map(({id:e,name:t,avatar:n,kind:r})=>[e,{name:t,avatar:d(n),isBot:r===`bot`}]));return{workspace:n,snapshot:r,operator:a,operatorId:i,conversations:o,conversation:s,group:r.groups.find(({id:e})=>e===s?.groupId),peer:u,bot:l,participants:f,participantNames:Object.fromEntries(r.participants.map(({id:e,name:t})=>[e,t])),resolveAvatar:d,media:e.media,mediaFailures:e.mediaFailures}}function ed({store:t,dialogs:n,children:r}){let i=e.useSyncExternalStore(t.subscribe,t.getView,t.getView),a=e.useMemo(()=>$u(i,t),[i,t]),o=e.useCallback(async(e,t)=>{try{return await t(),!0}catch(t){return I.error(e,{description:Vu(t)}),!1}},[]),s=e.useMemo(()=>({store:t,view:i,derived:a,run:o,dialogs:n}),[t,i,a,o,n]);return b(Xu.Provider,{value:s,children:r})}var td=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),nd=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),rd=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),id=e=>{let t=rd(e);return t.charAt(0).toUpperCase()+t.slice(1)},ad={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`},od=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},sd=n({}),cd=()=>s(sd),ld=i(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:i,className:a=``,children:o,iconNode:s,...c},l)=>{let{size:u=24,strokeWidth:d=2,absoluteStrokeWidth:f=!1,color:p=`currentColor`,className:m=``}=cd()??{},h=i??f?Number(n??d)*24/Number(t??u):n??d;return r(`svg`,{ref:l,...ad,width:t??u??ad.width,height:t??u??ad.height,stroke:e??p,strokeWidth:h,className:td(`lucide`,m,a),...!o&&!od(c)&&{"aria-hidden":`true`},...c},[...s.map(([e,t])=>r(e,t)),...Array.isArray(o)?o:[o]])}),J=(e,t)=>{let n=i(({className:n,...i},a)=>r(ld,{ref:a,iconNode:t,className:td(`lucide-${nd(id(e))}`,`lucide-${e}`,n),...i}));return n.displayName=id(e),n},ud=J(`arrow-down-to-line`,[[`path`,{d:`M12 17V3`,key:`1cwfxf`}],[`path`,{d:`m6 11 6 6 6-6`,key:`12ii2o`}],[`path`,{d:`M19 21H5`,key:`150jfl`}]]),dd=J(`arrow-down-wide-narrow`,[[`path`,{d:`m3 16 4 4 4-4`,key:`1co6wj`}],[`path`,{d:`M7 20V4`,key:`1yoxec`}],[`path`,{d:`M11 4h10`,key:`1w87gc`}],[`path`,{d:`M11 8h7`,key:`djye34`}],[`path`,{d:`M11 12h4`,key:`q8tih4`}]]),fd=J(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),pd=J(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),md=J(`arrow-up-narrow-wide`,[[`path`,{d:`m3 8 4-4 4 4`,key:`11wl7u`}],[`path`,{d:`M7 4v16`,key:`1glfcx`}],[`path`,{d:`M11 12h4`,key:`q8tih4`}],[`path`,{d:`M11 16h7`,key:`uosisv`}],[`path`,{d:`M11 20h10`,key:`jvxblo`}]]),hd=J(`arrow-up-to-line`,[[`path`,{d:`M5 3h14`,key:`7usisc`}],[`path`,{d:`m18 13-6-6-6 6`,key:`1kf1n9`}],[`path`,{d:`M12 7v14`,key:`1akyts`}]]),gd=J(`at-sign`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8`,key:`7n84p3`}]]),_d=J(`award`,[[`path`,{d:`m15.477 12.89 1.515 8.526a.5.5 0 0 1-.81.47l-3.58-2.687a1 1 0 0 0-1.197 0l-3.586 2.686a.5.5 0 0 1-.81-.469l1.514-8.526`,key:`1yiouv`}],[`circle`,{cx:`12`,cy:`8`,r:`6`,key:`1vp47v`}]]),vd=J(`bell`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]),yd=J(`bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),bd=J(`box`,[[`path`,{d:`M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z`,key:`hh9hay`}],[`path`,{d:`m3.3 7 8.7 5 8.7-5`,key:`g66t2b`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}]]),xd=J(`braces`,[[`path`,{d:`M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1`,key:`ezmyqa`}],[`path`,{d:`M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1`,key:`e1hn23`}]]),Sd=J(`calendar-clock`,[[`path`,{d:`M16 14v2.2l1.6 1`,key:`fo4ql5`}],[`path`,{d:`M16 2v3`,key:`otl347`}],[`path`,{d:`M21 7.338V5a2 2 0 00-2-2H5a2 2 0 00-2 2v14a2 2 0 002 2h2.338`,key:`7hb8p4`}],[`path`,{d:`M3 9h5.859`,key:`numkqi`}],[`path`,{d:`M8 2v3`,key:`1ioesn`}],[`circle`,{cx:`16`,cy:`16`,r:`6`,key:`qoo3c4`}]]),Cd=J(`calendar`,[[`path`,{d:`M8 2v3`,key:`1ioesn`}],[`path`,{d:`M16 2v3`,key:`otl347`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}],[`path`,{d:`M3 9h18`,key:`1pudct`}]]),wd=J(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),Td=J(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),Ed=J(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),Dd=J(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),Od=J(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),kd=J(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),Ad=J(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),jd=J(`corner-up-left`,[[`path`,{d:`M20 20v-7a4 4 0 0 0-4-4H4`,key:`1nkjon`}],[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}]]),Md=J(`cpu`,[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]),Nd=J(`crown`,[[`path`,{d:`M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z`,key:`1vdc57`}],[`path`,{d:`M5 21h14`,key:`11awu3`}]]),Pd=J(`database`,[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]),Fd=J(`ellipsis`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]]),Id=J(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),Ld=J(`face-slightly-smiling-plus`,[[`path`,{d:`M13.267 2.08a10 10 0 108.653 8.653`,key:`1wbpyh`}],[`path`,{d:`M15 10V9`,key:`4dkmfx`}],[`path`,{d:`M16 5h6`,key:`1vod17`}],[`path`,{d:`M16.472 15a6 6 0 01-8.943 0`,key:`7qomzy`}],[`path`,{d:`M19 2v6`,key:`4bpg5p`}],[`path`,{d:`M9 10V9`,key:`1lazqi`}]]),Rd=J(`file`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}]]),zd=J(`flask-conical`,[[`path`,{d:`M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2`,key:`18mbvz`}],[`path`,{d:`M6.453 15h11.094`,key:`3shlmq`}],[`path`,{d:`M8.5 2h7`,key:`csnxdl`}]]),Bd=J(`funnel`,[[`path`,{d:`M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z`,key:`sc7q7i`}]]),Vd=J(`git-branch`,[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]),Hd=J(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),Ud=J(`hand`,[[`path`,{d:`M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2`,key:`1fvzgz`}],[`path`,{d:`M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2`,key:`1kc0my`}],[`path`,{d:`M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8`,key:`10h0bg`}],[`path`,{d:`M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15`,key:`1s1gnw`}]]),Wd=J(`id-card`,[[`path`,{d:`M16 10h2`,key:`8sgtl7`}],[`path`,{d:`M16 14h2`,key:`epxaof`}],[`path`,{d:`M6.17 15a3 3 0 0 1 5.66 0`,key:`n6f512`}],[`circle`,{cx:`9`,cy:`11`,r:`2`,key:`yxgjnd`}],[`rect`,{x:`2`,y:`5`,width:`20`,height:`14`,rx:`2`,key:`qneu4z`}]]),Gd=J(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),Kd=J(`key-round`,[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]),qd=J(`link`,[[`path`,{d:`M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71`,key:`1cjeqo`}],[`path`,{d:`M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71`,key:`19qd67`}]]),Jd=J(`list-checks`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]),Yd=J(`message-circle`,[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}]]),Xd=J(`palette`,[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`,key:`e79jfc`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}]]),Zd=J(`paperclip`,[[`path`,{d:`m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551`,key:`1miecu`}]]),Qd=J(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),$d=J(`plug`,[[`path`,{d:`M12 22v-5`,key:`1ega77`}],[`path`,{d:`M15 8V2`,key:`18g5xt`}],[`path`,{d:`M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z`,key:`1xoxul`}],[`path`,{d:`M9 8V2`,key:`14iosj`}]]),ef=J(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),tf=J(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),nf=J(`reply`,[[`path`,{d:`M20 18v-2a4 4 0 0 0-4-4H4`,key:`5vmcpk`}],[`path`,{d:`m9 17-5-5 5-5`,key:`nvlc11`}]]),rf=J(`save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]),af=J(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),of=J(`send`,[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]),sf=J(`server-cog`,[[`path`,{d:`m10.852 14.772-.383.923`,key:`11vil6`}],[`path`,{d:`M13.148 14.772a3 3 0 1 0-2.296-5.544l-.383-.923`,key:`1v3clb`}],[`path`,{d:`m13.148 9.228.383-.923`,key:`t2zzyc`}],[`path`,{d:`m13.53 15.696-.382-.924a3 3 0 1 1-2.296-5.544`,key:`1bxfiv`}],[`path`,{d:`m14.772 10.852.923-.383`,key:`k9m8cz`}],[`path`,{d:`m14.772 13.148.923.383`,key:`1xvhww`}],[`path`,{d:`M4.5 10H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-.5`,key:`tn8das`}],[`path`,{d:`M4.5 14H4a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2h-.5`,key:`1g2pve`}],[`path`,{d:`M6 18h.01`,key:`uhywen`}],[`path`,{d:`M6 6h.01`,key:`1utrut`}],[`path`,{d:`m9.228 10.852-.923-.383`,key:`1wtb30`}],[`path`,{d:`m9.228 13.148-.923.383`,key:`1a830x`}]]),cf=J(`share-2`,[[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}],[`circle`,{cx:`6`,cy:`12`,r:`3`,key:`w7nqdw`}],[`circle`,{cx:`18`,cy:`19`,r:`3`,key:`1xt0gg`}],[`line`,{x1:`8.59`,x2:`15.42`,y1:`13.51`,y2:`17.49`,key:`47mynk`}],[`line`,{x1:`15.41`,x2:`8.59`,y1:`6.51`,y2:`10.49`,key:`1n3mei`}]]),lf=J(`sliders-horizontal`,[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]),uf=J(`tag`,[[`path`,{d:`M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z`,key:`vktsd0`}],[`circle`,{cx:`7.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`kqv944`}]]),df=J(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),ff=J(`undo-2`,[[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`,key:`f3b9sd`}]]),pf=J(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]),mf=J(`user-minus`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}],[`line`,{x1:`22`,x2:`16`,y1:`11`,y2:`11`,key:`1shjgl`}]]),hf=J(`user-plus`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}],[`line`,{x1:`19`,x2:`19`,y1:`8`,y2:`14`,key:`1bvyxn`}],[`line`,{x1:`22`,x2:`16`,y1:`11`,y2:`11`,key:`1shjgl`}]]),gf=J(`user`,[[`path`,{d:`M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2`,key:`975kel`}],[`circle`,{cx:`12`,cy:`7`,r:`4`,key:`17ys0d`}]]),_f=J(`users`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),vf=J(`webhook`,[[`path`,{d:`M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2`,key:`q3hayz`}],[`path`,{d:`m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06`,key:`1go1hn`}],[`path`,{d:`m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8`,key:`qlwsc0`}]]),yf=J(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),bf={recall:!1,react:!1,reply:!1,branch:!1,forward:!1};function xf(e,t){let{message:n}=t;switch(e){case`reply`:return n.event?`event-message`:du(n)?`recalled-message`:void 0;case`branch`:return n.event?`event-message`:void 0;case`forward`:return n.event?`event-message`:du(n)?`recalled-message`:void 0;case`react`:return Cf(t)??(t.operatorId?void 0:`no-operator`);case`recall`:return Cf(t)??wf(t)}}function Sf(e){return{recall:!xf(`recall`,e),react:!xf(`react`,e),reply:!xf(`reply`,e),branch:!xf(`branch`,e),forward:!xf(`forward`,e)}}function Cf({message:e,conversation:t}){return e.event?`event-message`:du(e)?`recalled-message`:Su(e,t.id)?`inherited-prefix`:void 0}function wf({message:e,operatorId:t,group:n}){if(!t)return`no-operator`;if(e.authorId===t)return;if(!n)return`not-own-message`;let r=Tf(n,t);if(!r)return`actor-not-in-group`;let i=Tf(n,e.authorId);if(!i)return`author-not-in-group`;if(r.role===`member`)return`requires-group-authority`;if(i.role===`owner`||r.role===`admin`&&i.role===`admin`)return`target-outranks-actor`}function Tf(e,t){return e.members.find(e=>e.participantId===t)}function Ef(e){let t=e.conversation;return t?Object.fromEntries(e.messages.map(n=>[n.id,Sf({message:n,conversation:t,operatorId:e.operatorId,group:e.group})])):{}}function Df(e,t,n){let r=e[t],i=e[t-1];return!r||!i?!1:!Su(r,n)&&Su(i,n)}function Of(e,t){return e.replace(/<at\s+id="([^"]+)"\s*\/>/g,(e,n)=>`@${t[n]??n}`)}function kf(e){return e.type===`image`?`图片`:e.type===`audio`?`语音`:e.type===`video`?`视频`:`文件`}function Af(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(1)} MB`}function jf(e,t){return!!e.event||du(e)&&!t.markRecalledMessages}function Mf(e,t){return du(e)?fu(e,t(e.lifecycle?.operatorId??e.authorId)):e.content}function Nf(e){return e.chatLuna?.thought?e.chatLuna:void 0}function Pf(e){let t=e.chatLuna;return t&&!t.thought&&t.usage?t:void 0}function Ff(e,t){return!!Nf(e)&&!(du(e)&&!t.markRecalledMessages)}function If(e,t){return!!Pf(e)&&!(du(e)&&!t.markRecalledMessages)}function Lf(e,t){if(e.forwardId)return``;let n=e.media;return n?.length===1&&e.content===`[${kf(n[0])}] ${n[0].name}`?``:Of(e.content,t.participantNames)}function Rf(e,t){return e.replyToMessageId?t.replyMessages[e.replyToMessageId]:void 0}function zf(e,t){return e.forwardId?t.forwardPreviews[e.id]:void 0}function Bf(e,t){return t.messageCapabilities[e.id]??bf}function Vf(e,t){return Su(e,t.currentConversationId)}function Hf(e,t,n){return Df(e,t,n.currentConversationId)}function Uf(e,t,n){let r=n.currentOperatorId;if(!Bf(e,n).react||!r)return;let i=e.reactions?.find(e=>e.emojiId===t);return{messageId:e.id,emojiId:t,enabled:!i?.participantIds.includes(r)}}function Wf(e){let t=uu(e).replace(/\s+/g,` `).trim();return[t,...!t&&e.media?.length?e.media.map(e=>`[${kf(e)}] ${e.name}`):[],...e.forwardId?[`[合并转发]`]:[]].filter(Boolean).join(` `)||`[消息]`}function Gf(e){return{title:e.title??`群聊的聊天记录`,total:e.nodes.length,lines:e.nodes.slice(0,4).map(e=>`${e.nickname}:${Wf(e)}`)}}function Kf(e,t){let n=new Map(t.map(e=>[e.id,e]));return Object.fromEntries(e.flatMap(e=>{if(!e.forwardId)return[];let t=n.get(e.forwardId);return t?[[e.id,Gf(t)]]:[]}))}function qf(e){return e}var Jf=new Intl.DateTimeFormat(void 0,{hour:`2-digit`,minute:`2-digit`});function Yf(e){let t=new Map;for(let n of e.conversations){if(n.kind!==`instance`)continue;let r=t.get(n.rootConversationId)??[];r.push({...Zf(e,n),kind:`instance`}),t.set(n.rootConversationId,r)}return e.conversations.filter(({kind:e})=>e===`root`).map(n=>({...Zf(e,n),kind:`root`,children:t.get(n.id)??[]}))}function Xf(e){return e.map(({id:e,title:t,preview:n,avatar:r,avatarKind:i})=>({conversationId:e,title:t,subtitle:n,avatar:r,avatarKind:i}))}function Zf(e,t){let{scene:n,operatorId:r}=e,i=e.resolveAvatar??qf,a=t.type===`group`?n.groups.find(({id:e})=>e===t.groupId):void 0,o=ku(t,r),s=su(n).find(({id:e})=>e===o),c=s??ou(n).find(({id:e})=>e===o),l=Qf(n,t.id);return{id:t.id,groupId:a?.id,kind:t.kind,title:t.title??a?.name??c?.name??t.id,avatar:i(a?.avatar??c?.avatar),avatarKind:a?`group`:s?`bot`:`user`,preview:l?$f(n,l):e.emptyPreview??``,time:l?.createdAt?Jf.format(new Date(l.createdAt)):``,actorRole:a?.members.find(({participantId:e})=>e===r)?.role,entityTarget:a?{type:`group`,id:a.id}:{type:s?`bot`:`user`,id:o??``}}}function Qf(e,t){let n=new Set(xu(e,t));return e.messages.filter(({id:e})=>n.has(e)).at(-1)}function $f(e,t){let n=Object.fromEntries(e.participants.map(({id:e,name:t})=>[e,t]));if(!du(t))return Of(t.content,n);let r=t.lifecycle.operatorId;return fu(t,n[r]??r)}function ep(e,t,n){return n===`push`?[...e,t]:[t]}function tp(){return[]}async function np(e){let t;try{t=await e.load(e.input)}catch{return}let n=await Promise.all(t.nodes.map(e=>e.forwardId).filter(e=>!!e).map(async t=>{try{return[t,await e.load({forwardId:t})]}catch{return}}));return{title:Gf(t).title,items:t.nodes.map(e=>({...e})),nestedForwards:Object.fromEntries(n.filter(e=>!!e))}}var rp={active:!1,messageIds:[]};function ip(e,t){return t.messageCapabilities[e]?.forward??!1}function ap(e,t){if(ip(e,t))return{active:!0,messageIds:[e]}}function op(e,t,n){return!e.active||!ip(t,n)?e:e.messageIds.includes(t)?{active:!0,messageIds:e.messageIds.filter(e=>e!==t)}:{active:!0,messageIds:[...e.messageIds,t]}}function sp(){return rp}function cp(e,t,n){let r=e.messageIds.filter(e=>ip(e,n));return r.length?{kind:`send`,conversationId:t,messageIds:r}:{kind:`reject`}}function lp({kind:t,name:n=``,src:r,className:i,badge:a=!0}){let[o,s]=e.useState(!1),c=r&&!r.startsWith(`sandbox-media:`)?r:``;return e.useEffect(()=>s(!1),[c]),x(`span`,{className:U(`relative inline-flex size-9 shrink-0 select-none`,i),children:[b(`span`,{className:`flex size-full items-center justify-center overflow-hidden rounded-full bg-muted text-[13px] font-medium text-muted-foreground`,children:c&&!o?b(`img`,{src:c,alt:n,className:`size-full object-cover`,onError:()=>s(!0)}):n.trim().slice(0,1).toUpperCase()||`?`}),a&&t!==`user`&&b(`span`,{className:`absolute -right-0.5 -bottom-0.5 flex size-3.5 items-center justify-center rounded-full bg-background ring-1 ring-border`,children:t===`bot`?b(yd,{className:`size-2.5 text-primary`}):b(_f,{className:`size-2.5 text-muted-foreground`})})]})}var up=typeof window<`u`,dp=up?window:null,fp=up?document:null,pp={OBJECT:0,ATTRIBUTE:1,CSS:2,TRANSFORM:3,CSS_VAR:4},mp={NUMBER:0,UNIT:1,COLOR:2,COMPLEX:3},hp={NONE:0,AUTO:1,FORCE:2},gp={replace:0,none:1,blend:2},_p=Symbol(),vp=Symbol(),yp=Symbol(),bp=Symbol(),xp=Symbol(),Sp=1e-11,Cp=0xe8d4a51000,wp=1e3,Tp=[],Ep=(()=>{let e=new Map;return e.set(`x`,`translateX`),e.set(`y`,`translateY`),e.set(`z`,`translateZ`),e})(),Dp=[`perspective`,`translateX`,`translateY`,`translateZ`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`scale`,`scaleX`,`scaleY`,`scaleZ`,`skew`,`skewX`,`skewY`],Op=Dp.reduce((e,t)=>({...e,[t]:t+`(`}),{}),kp=()=>{},Ap=e=>e,jp=/\)\s*[-.\d]/,Mp=/(^#([\da-f]{3}){1,2}$)|(^#([\da-f]{4}){1,2}$)/i,Np=/rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/i,Pp=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(-?\d+|-?\d*.\d+)\s*\)/i,Fp=/hsl\(\s*(-?\d+|-?\d*.\d+)\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)%\s*\)/i,Ip=/hsla\(\s*(-?\d+|-?\d*.\d+)\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)\s*\)/i,Lp=/[-+]?\d*\.?\d+(?:e[-+]?\d)?/gi,Rp=/^([-+]?\d*\.?\d+(?:e[-+]?\d+)?)([a-z]+|%)$/i,zp=/([a-z])([A-Z])/g,Bp=/(\*=|\+=|-=)/,Vp=/var\(\s*(--[\w-]+)(?:\s*,\s*([^)]+))?\s*\)/,Hp={id:null,keyframes:null,playbackEase:null,playbackRate:1,frameRate:240,loop:0,reversed:!1,alternate:!1,autoplay:!0,persist:!1,duration:wp,delay:0,loopDelay:0,ease:`out(2)`,composition:gp.replace,modifier:Ap,onBegin:kp,onBeforeUpdate:kp,onUpdate:kp,onLoop:kp,onPause:kp,onComplete:kp,onRender:kp},Up={current:null,root:fp},Y={defaults:Hp,precision:4,timeScale:1,tickThreshold:200,editor:null},Wp={version:`4.5.0`,engine:null};up&&(dp.AnimeJS||=[],dp.AnimeJS.push(Wp));var Gp=e=>e.replace(zp,`$1-$2`).toLowerCase(),Kp=(e,t)=>e.indexOf(t)===0,qp=Date.now,Jp=Array.isArray,Yp=e=>e&&e.constructor===Object,Xp=e=>typeof e==`number`&&!isNaN(e),Zp=e=>typeof e==`string`,Qp=e=>typeof e==`function`,X=e=>e===void 0,$p=e=>X(e)||e===null,em=e=>up&&e instanceof SVGElement,tm=e=>Mp.test(e),nm=e=>Kp(e,`rgb`),rm=e=>Kp(e,`hsl`),im=e=>tm(e)||(nm(e)||rm(e))&&(e[e.length-1]===`)`||!jp.test(e)),am=e=>!Y.defaults.hasOwnProperty(e),om=[`opacity`,`rotate`,`overflow`,`color`],sm=(e,t)=>{if(om.includes(t))return!1;if(e.getAttribute(t)||t in e){if(t===`scale`){let t=e.parentNode;return t&&t.tagName===`filter`}return!0}},cm=Math.pow,lm=Math.sqrt,um=Math.sin,dm=Math.cos,fm=Math.abs,pm=Math.exp,mm=Math.floor,hm=Math.asin,gm=Math.PI,_m=Math.round,vm=(e,t,n)=>e<t?t:e>n?n:e,ym=(e,t)=>{if(t<0)return e;if(!t)return _m(e);let n=10**t;return _m(e*n)/n},bm=(e,t,n)=>n===1?t:n===0?e:e+(t-e)*n,xm=e=>e===1/0?Cp:e===-1/0?-Cp:e,Sm=e=>e<=1e-11?Sp:xm(ym(e,11)),Cm=e=>Jp(e)?[...e]:e,wm=(e,t)=>{let n={...e};for(let r in t){let i=e[r];n[r]=X(i)?t[r]:i}return n},Tm=(e,t,n,r=`_prev`,i=`_next`)=>{let a=e._head,o=i;for(n&&(a=e._tail,o=r);a;){let e=a[o];t(a),a=e}},Em=(e,t,n=`_prev`,r=`_next`)=>{let i=t[n],a=t[r];i?i[r]=a:e._head=a,a?a[n]=i:e._tail=i,t[n]=null,t[r]=null},Dm=(e,t,n,r=`_prev`,i=`_next`)=>{let a=e._tail;for(;a&&n&&n(a,t);)a=a[r];let o=a?a[i]:e._head;a?a[i]=t:e._head=t,o?o[r]=t:e._tail=t,t[r]=a,t[i]=o},Om=(e,t,n)=>{let r=e.style.transform;if(r){let i=e[bp],a=0,o=r.length,s;for(;a<o;){for(;a<o&&r.charCodeAt(a)===32;)a++;if(a>=o)break;let e=a;for(;a<o&&r.charCodeAt(a)!==40;)a++;if(a>=o)break;let t=r.substring(e,a),n=1,c=a+1,l=-1,u=-1;for(a++;a<o&&n>0;){let e=r.charCodeAt(a);e===40?n++:e===41?n--:e===44&&n===1&&(l===-1?l=a:u===-1&&(u=a)),a++}let d=a-1;t===`translate`||t===`translate3d`?(l===-1?i.translateX=r.substring(c,d).trim():(i.translateX=r.substring(c,l).trim(),u===-1?i.translateY=r.substring(l+1,d).trim():(i.translateY=r.substring(l+1,u).trim(),i.translateZ=r.substring(u+1,d).trim())),s=r.substring(c,d)):t===`scale`||t===`scale3d`?l===-1?i.scale=r.substring(c,d).trim():(i.scaleX=r.substring(c,l).trim(),u===-1?i.scaleY=r.substring(l+1,d).trim():(i.scaleY=r.substring(l+1,u).trim(),i.scaleZ=r.substring(u+1,d).trim())):i[t]=r.substring(c,d)}if(t===`translate3d`&&s)return n&&(n[t]=s),s;let c=i[t];if(!X(c))return n&&(n[t]=c),c}return t===`translate3d`?`0px, 0px, 0px`:t===`rotate3d`?`0, 0, 0, 0deg`:Kp(t,`scale`)?`1`:Kp(t,`rotate`)||Kp(t,`skew`)?`0deg`:`0px`},km=e=>{let t=``;for(let n=0,r=Dp.length;n<r;n++){let r=Dp[n],i=e[r];if(i!==void 0){if(r===`translateX`){let r=e.translateY;if(r!==void 0){let a=e.translateZ;a===void 0?(t+=`translate(${i},${r}) `,n+=1):(t+=`translate3d(${i},${r},${a}) `,n+=2);continue}}if(r===`scaleX`&&e.scale===void 0){let r=e.scaleY;if(r!==void 0){let a=e.scaleZ;a===void 0?(t+=`scale(${i},${r}) `,n+=1):(t+=`scale3d(${i},${r},${a}) `,n+=2);continue}}t+=`${Op[r]}${i}) `}r===`rotateZ`&&e.rotate3d!==void 0&&(t+=`rotate3d(${e.rotate3d}) `)}return e.matrix!==void 0&&(t+=`matrix(${e.matrix}) `),e.matrix3d!==void 0&&(t+=`matrix3d(${e.matrix3d}) `),t},Am=[];function jm(e,t){if(!e)return null;let n=Am.length;outer:for(let r=0;r<n;r++){let n=Am[r];if(n.detect&&!n.detect(e))continue;let i=n.targetAdapters;for(let n=0,r=i.length;n<r;n++){let r=i[n];if(r.detect(e)){let n=r.props[t];if(n&&(!n.gate||n.gate(e)))return n;break outer}}}for(let r=0;r<n;r++){let n=Am[r];if(n.detect&&!n.detect(e))continue;let i=n.propertyResolvers;for(let n=0,r=i.length;n<r;n++){let r=i[n](e,t);if(r)return r}}return null}var Mm=e=>{let t=Np.exec(e)||Pp.exec(e),n=X(t[4])?1:+t[4];return[+t[1],+t[2],+t[3],n]},Nm=e=>{let t=e.length,n=t===4||t===5;return[+(`0x`+e[1]+e[n?1:2]),+(`0x`+e[n?2:3]+e[n?2:4]),+(`0x`+e[n?3:5]+e[n?3:6]),t===5||t===9?+((`0x`+e[n?4:7]+e[n?4:8])/255).toFixed(3):1]},Pm=(e,t,n)=>(n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e),Fm=e=>{let t=Fp.exec(e)||Ip.exec(e),n=t[1]/360,r=t[2]/100,i=t[3]/100,a=X(t[4])?1:+t[4],o,s,c;if(r===0)o=s=c=i;else{let e=i<.5?i*(1+r):i+r-i*r,t=2*i-e;o=ym(Pm(t,e,n+1/3)*255,0),s=ym(Pm(t,e,n)*255,0),c=ym(Pm(t,e,n-1/3)*255,0)}return[o,s,c,a]},Im=e=>nm(e)?Mm(e):tm(e)?Nm(e):rm(e)?Fm(e):[0,0,0,1],Z=(e,t)=>X(e)?t:e,Lm=(e,t)=>{let n=e.match(Vp),r=t[vp]?t:document.documentElement,i=getComputedStyle(r)?.getPropertyValue(n[1]);return(!i||i.trim()===``)&&n[2]&&(i=n[2].trim()),i||0},Rm=(e,t,n,r,i,a)=>{if(Qp(e)){if(!i){let i=e(t,n,r,a);return isNaN(+i)?i||0:+i}let o=()=>{let i=e(t,n,r,a);return isNaN(+i)?i||0:+i};return i.func=o,o()}if(Zp(e)&&Kp(e,`var(`)){if(!i)return Lm(e,t);let n=()=>Lm(e,t);return i.func=n,n()}return e},zm=(e,t)=>e[vp]?e[yp]&&sm(e,t)?pp.ATTRIBUTE:Dp.includes(t)||Ep.get(t)?pp.TRANSFORM:Kp(t,`--`)?pp.CSS_VAR:t in e.style?pp.CSS:t in e?pp.OBJECT:pp.ATTRIBUTE:pp.OBJECT,Bm=(e,t,n)=>{let r=e.style[t];r&&n&&(n[t]=r);let i=r||getComputedStyle(e[xp]||e).getPropertyValue(t);return i===`auto`?`0`:i},Vm=(e,t,n,r)=>{let i=X(n)?zm(e,t):n,a=jm(e,t);if(a){let n=a.get(e);return n&&r&&(r[t]=n),n??0}if(i===pp.OBJECT){let n=e[t];return n&&r&&(r[t]=n),n||0}if(i===pp.ATTRIBUTE){let n=e.getAttribute(t);return n&&r&&(r[t]=n),n}return i===pp.TRANSFORM?Om(e,t,r):i===pp.CSS_VAR?Bm(e,t,r).trimStart():Bm(e,t,r)},Hm=(e,t,n)=>n===`-`?e-t:n===`+`?e+t:e*t,Um=()=>({t:mp.NUMBER,n:0,u:null,o:null,d:null,s:null}),Wm=(e,t)=>{if(t.t=mp.NUMBER,t.n=0,t.u=null,t.o=null,t.d=null,t.s=null,!e)return t;let n=+e;if(!isNaN(n))return t.n=n,t;let r=e;r[1]===`=`&&(t.o=r[0],r=r.slice(2));let i=!r.includes(` `)&&Rp.exec(r);if(i)return t.t=mp.UNIT,t.n=+i[1],t.u=i[2],t;if(t.o)return t.n=+r,t;if(im(r))return t.t=mp.COLOR,t.d=Im(r),t;{let e=r.match(Lp);return t.t=mp.COMPLEX,t.d=e?e.map(Number):[],t.s=r.split(Lp)||[],t}},Gm=(e,t)=>(t.t=e._valueType,t.n=e._toNumber,t.u=e._unit,t.o=null,t.d=Cm(e._toNumbers),t.s=Cm(e._strings),t),Km=Um(),qm=(e,t,n)=>{let r=e._modifier,i=e._fromNumbers,a=e._toNumbers,o=e._strings,s=o[0];for(let c=0,l=a.length;c<l;c++){let l=r(ym(bm(i[c],a[c],t),n)),u=o[c+1];s+=`${u?l+u:l}`,e._numbers[c]=l}return s},Jm=(e,t,n,r,i)=>{let a=e.parent,o=e.duration,s=e.completed,c=e.iterationDuration,l=e.iterationCount,u=e._currentIteration,d=e._loopDelay,f=e._reversed,p=e._alternate,m=e._hasChildren,h=e._delay,g=e._currentTime,_=h+c,v=t-h,y=vm(g,-h,o),b=vm(v,-h,o),x=v-g,S=b>0,C=b>=o,w=o<=Sp,T=i===hp.FORCE,E=0,D=v,O=0;if(l>1){let t=c+(C?0:d),n=~~(b/t);e._currentIteration=vm(n,0,l),C&&e._currentIteration--,E=e._currentIteration%2,D=b-n*t||0}let k=f^(p&&E),A=e._ease,j=C?k?0:o:k?c-D:D;A&&(j=c*A(j/c)||0);let M=(a?a.backwards:v<g)?!k:!!k;if(e._currentTime=v,e._iterationTime=j,e.backwards=M,S&&!e.began?(e.began=!0,!n&&!(a&&(M||!a.began))&&e.onBegin(e)):v<=0&&(e.began=!1),!n&&!m&&S&&e._currentIteration!==u&&e.onLoop(e),T||i===hp.AUTO&&(t>=(a&&h>0?0:h)&&t<=_||t<=h&&y>h||t>=_&&y!==o)||j>=_&&y!==o||j<=h&&y>0&&!C||t<=y&&y===o&&s||C&&!s&&w){if(S&&(e.computeDeltaTime(y),n||e.onBeforeUpdate(e)),!m){let t=T||(M?x*-1:x)>=Y.tickThreshold,i=ym(e._offset+(a?a._offset:0)+h+j,12),o=e._head,s,c,l,u,d=0;for(;o;){let e=o._composition,n=o._currentTime,a=o._changeDuration,f=o._absoluteStartTime+o._changeDuration,p=o._nextRep,m=o._prevRep,h=e!==gp.none,g=m?m._absoluteStartTime+m._changeDuration:0,_=m&&m.parent!==o.parent,v=!p||p._isOverridden?f:p.parent===o.parent?f+p._delay:p._absoluteStartTime<p._absoluteUpdateStartTime?p._absoluteStartTime:p._absoluteUpdateStartTime;if((t||(n!==a||i<=v||m&&!_&&(!p||p.parent!==o.parent))&&(n!==0||i>=o._absoluteStartTime||_&&!o._hasFromValue&&!m._isOverridden&&i>=g||p&&!p._isOverridden&&p.parent===o.parent&&p._currentTime!==0&&j<p._startTime))&&(!m||_||j>=o._startTime)&&(!h||!o._isOverridden&&(!o._isOverlapped||i<=f)&&(!p||p._isOverridden||i<=v)&&(!m||m._isOverridden||(_?i>=o._absoluteStartTime||!o._hasFromValue&&i>=g:i>=g+o._delay)))){let t=o._currentTime=vm(j-o._startTime,0,a),n=o._ease(t/o._updateDuration),i=o._modifier,f=o._valueType,p=o._tweenType,m=p===pp.OBJECT,g=f===mp.NUMBER,_=g&&m||n===0||n===1?-1:Y.precision,v,y;if(g)v=y=i(ym(bm(o._fromNumber,o._toNumber,n),_));else if(f===mp.UNIT)y=i(ym(bm(o._fromNumber,o._toNumber,n),_)),v=`${y}${o._unit}`;else if(f===mp.COLOR){let e=o._numbers,t=o._fromNumbers,a=o._toNumbers,s=1-n,c=t[0],l=t[1],u=t[2],d=a[0],f=a[1],p=a[2];e[0]=i(Math.sqrt(c*c*s+d*d*n)),e[1]=i(Math.sqrt(l*l*s+f*f*n)),e[2]=i(Math.sqrt(u*u*s+p*p*n)),e[3]=i(bm(t[3],a[3],n)),(!o._setter||r)&&(v=`rgba(${ym(e[0],0)},${ym(e[1],0)},${ym(e[2],0)},${e[3]})`)}else f===mp.COMPLEX&&(v=qm(o,n,_));if(h&&(o._number=y),!r&&e!==gp.blend){let e=o.property;s=o.target,o._setter?o._setter(s,y,o):m?s[e]=v:p===pp.ATTRIBUTE?s.setAttribute(e,v):(c=s.style,p===pp.TRANSFORM?(s!==l&&(l=s,u=s[bp]),u[e]=v,d=1):p===pp.CSS?c[e]=v:p===pp.CSS_VAR&&c.setProperty(e,v)),S&&(O=1)}else o._value=v}else n&&m&&!_&&j<o._startTime&&(o._currentTime=0);d&&o._renderTransforms&&(c.transform=km(u),d=0),o=o._next}!n&&O&&e.onRender(e)}!n&&S&&e.onUpdate(e)}return a&&w?!n&&(a.began&&!M&&v>0&&!s||M&&v<=1e-11&&s)&&(e.onComplete(e),e.completed=!M):S&&C?l===1/0?e._startTime+=e.duration:e._currentIteration>=l-1&&(e.paused=!0,!s&&!m&&(e.completed=!0,!n&&!(a&&(M||!a.began))&&(e.onComplete(e),e._resolve(e)))):e.completed=!1,O},Ym=(e,t,n,r,i)=>{let a=e._currentIteration;if(Jm(e,t,n,r,i),e._hasChildren){let o=e,s=o.backwards,c=r?t:o._iterationTime,l=qp(),u=0,d=!0;if(!r&&o._currentIteration!==a){let e=o.iterationDuration;Tm(o,t=>{if(!s)!t.completed&&!t.backwards&&t._currentTime<t.iterationDuration&&Jm(t,e,n,1,hp.FORCE),t.began=!1,t.completed=!1;else{let r=t.duration,i=t._offset+t._delay,a=i+r;!n&&r<=1e-11&&(!i||a===e)&&t.onComplete(t)}}),n||o.onLoop(o)}Tm(o,e=>{let t=ym((c-e._offset)*e._speed,12);if(s&&t>e._delay+e.duration)return;let a=e._fps<o._fps?e.requestTick(l):i;u+=Jm(e,t,n,r,a),!e.completed&&d&&(d=!1)},s),!n&&u&&o.onRender(o),(d||s)&&o._currentTime>=o.duration&&(o.paused=!0,o.completed||(o.completed=!0,n||(o.onComplete(o),o._resolve(o))))}},Xm={},Zm=(e,t,n)=>{if(n===pp.TRANSFORM)return Ep.get(e)||e;if(n===pp.CSS||n===pp.ATTRIBUTE&&em(t)&&e in t.style){let t=Xm[e];if(t)return t;{let t=e&&Gp(e);return Xm[e]=t,t}}return e},Qm=(e,t=!1)=>{if(e._hasChildren)Tm(e,e=>Qm(e,t),!0);else{let n=e;n.pause(),Tm(n,e=>{let r=e.property,i=e.target,a=e._tweenType,o=e._inlineValue,s=$p(o)||o===``;if(e._setter){if(!t&&!s){if(Wm(o,Km),Km.d){let t=Km.d,n=e._numbers;for(let e=0,r=t.length;e<r;e++)n[e]=t[e]}else e._number=Km.n;e._setter(e.target,e._number,e)}}else if(a===pp.OBJECT)!t&&!s&&(i[r]=o);else if(i[vp]){if(a===pp.ATTRIBUTE)t||(s?i.removeAttribute(r):i.setAttribute(r,o));else{let t=i.style;if(a===pp.TRANSFORM){let n=i[bp];s?delete n[r]:n[r]=o,e._renderTransforms&&(Object.keys(n).length?t.transform=km(n):t.removeProperty(`transform`))}else s?t.removeProperty(Gp(r)):t[r]=o}}i[vp]&&n._tail===e&&n.targets.forEach(e=>{e.getAttribute&&e.getAttribute(`style`)===``&&e.removeAttribute(`style`)})})}return e},$m=class{constructor(e=0){this.deltaTime=0,this._currentTime=e,this._lastTickTime=e,this._startTime=e,this._lastTime=e,this._frameDuration=wp/240,this._fps=240,this._speed=1,this._hasChildren=!1,this._head=null,this._tail=null}get fps(){return this._fps}set fps(e){let t=+e,n=t<1e-11?Sp:t,r=wp/n;n>Hp.frameRate&&(Hp.frameRate=n),this._fps=n,this._frameDuration=r}get speed(){return this._speed}set speed(e){let t=+e;this._speed=t<1e-11?Sp:t}requestTick(e){let t=this._frameDuration,n=e-this._lastTickTime,r=t*.25;return n+(r<4?r:4)<t?hp.NONE:(this._lastTickTime=n>=t?e-n%t:e,hp.AUTO)}computeDeltaTime(e){let t=e-this._lastTime;return this.deltaTime=t,this._lastTime=e,t}},eh={animation:null,update:kp},th=e=>{let t=eh.animation;return t||(t={duration:Sp,computeDeltaTime:kp,_offset:0,_delay:0,_head:null,_tail:null},eh.animation=t,eh.update=()=>{e.forEach(e=>{for(let t in e){let n=e[t],r=n._head;if(r){let e=r._valueType,t=e===mp.COMPLEX||e===mp.COLOR?Cm(r._fromNumbers):null,i=r._fromNumber,a=n._tail;for(;a&&a!==r;){if(t)for(let e=0,n=a._numbers.length;e<n;e++)t[e]+=a._numbers[e];else i+=a._number;a=a._prevAdd}r._toNumber=i,r._toNumbers=t}}}),Jm(t,1,1,0,hp.FORCE)}),t},nh=up?requestAnimationFrame:setImmediate,rh=up?cancelAnimationFrame:clearImmediate,ih=class extends $m{constructor(e){super(e),this.useDefaultMainLoop=!0,this.pauseOnDocumentHidden=!0,this.defaults=Hp,this.paused=!0,this.reqId=0}update(){let e=this._currentTime=qp();if(this.requestTick(e)){this.computeDeltaTime(e);let t=this._speed,n=this._fps,r=this._head;for(;r;){let i=r._next;r.paused?(Em(this,r),this._hasChildren=!!this._tail,r._running=!1,r.completed&&!r._cancelled&&r.cancel()):Ym(r,(e-r._startTime)*r._speed*t,0,0,r._fps<n?r.requestTick(e):hp.AUTO),r=i}eh.update()}}wake(){return this.useDefaultMainLoop&&!this.reqId&&(this.requestTick(qp()),this.reqId=nh(oh)),this}pause(){if(this.reqId)return this.paused=!0,sh()}resume(){if(this.paused)return this.paused=!1,Tm(this,e=>e.resetTime()),this.wake()}get speed(){return this._speed*(Y.timeScale===1?1:wp)}set speed(e){let t=e*Y.timeScale;this._speed!==t&&(this._speed=t,Tm(this,e=>e.speed=e._speed))}get timeUnit(){return Y.timeScale===1?`ms`:`s`}set timeUnit(e){let t=.001,n=e===`s`,r=n?t:1;if(Y.timeScale!==r){Y.timeScale=r,Y.tickThreshold=200*r;let e=n?t:wp;this.defaults.duration*=e,this._speed*=e}}get precision(){return Y.precision}set precision(e){Y.precision=e}},ah=(()=>{let e=new ih(qp());return up&&(Wp.engine=e,fp.addEventListener(`visibilitychange`,()=>{e.pauseOnDocumentHidden&&(fp.hidden?e.pause():e.resume())})),e})(),oh=()=>{ah._head?(ah.reqId=nh(oh),ah.update()):ah.reqId=0},sh=()=>(rh(ah.reqId),ah.reqId=0,ah),ch={_rep:new WeakMap,_add:new Map},lh=(e,t,n=`_rep`)=>{let r=ch[n],i=r.get(e);return i||(i={},r.set(e,i)),i[t]?i[t]:i[t]={_head:null,_tail:null}},uh=(e,t)=>e._isOverridden||e._absoluteStartTime>t._absoluteStartTime,dh=e=>{e._isOverlapped=1,e._isOverridden=1,e._changeDuration=Sp,e._currentTime=Sp},fh=(e,t)=>{let n=e._composition;if(n===gp.replace){let n=e._absoluteStartTime;Dm(t,e,uh,`_prevRep`,`_nextRep`);let r=e._prevRep;if(r){let t=r.parent,i=r._absoluteEndTime;if(e.parent.id!==t.id&&t.iterationCount>1&&i+(t.duration-t.iterationDuration)>n){dh(r);let e=r._prevRep;for(;e&&e.parent.id===t.id;)dh(e),e=e._prevRep}let a=e._absoluteUpdateStartTime;if(i>a){let e=r._startTime,t=ym(a-(i-(e+r._updateDuration))-e,12);r._changeDuration=t,r._currentTime=t,r._isOverlapped=1,t<1e-11&&dh(r)}let o=e.parent.parent;if(!o||o!==t.parent){let e=!0;if(Tm(t,t=>{t._isOverlapped||(e=!1)}),e){let e=t.parent;if(e){let n=!0;Tm(e,e=>{e!==t&&Tm(e,e=>{e._isOverlapped||(n=!1)})}),n&&e.cancel()}else t.cancel()}}}}else if(n===gp.blend){let t=lh(e.target,e.property,`_add`),n=th(ch._add),r=t._head;r||(r={...e},r._composition=gp.replace,r._updateDuration=Sp,r._startTime=0,r._numbers=Cm(e._fromNumbers),r._number=0,r._next=null,r._prev=null,Dm(t,r),Dm(n,r));let i=e._toNumber;if(e._fromNumber=r._fromNumber-i,e._toNumber=0,e._numbers=Cm(e._fromNumbers),e._number=0,r._fromNumber=i,e._toNumbers.length){let t=Cm(e._toNumbers);t.forEach((t,n)=>{e._fromNumbers[n]=r._fromNumbers[n]-t,e._toNumbers[n]=0}),r._fromNumbers=t}Dm(t,e,null,`_prevAdd`,`_nextAdd`)}return e},ph=e=>{let t=e._composition;if(t!==gp.none){let n=e.target,r=e.property,i=ch._rep.get(n)[r];if(Em(i,e,`_prevRep`,`_nextRep`),t===gp.blend){let t=ch._add,i=t.get(n);if(!i)return;let a=i[r],o=eh.animation;Em(a,e,`_prevAdd`,`_nextAdd`);let s=a._head;if(s&&s===a._tail){Em(a,s,`_prevAdd`,`_nextAdd`),Em(o,s);let e=!0;for(let t in i)if(i[t]._head){e=!1;break}e&&t.delete(n)}}}return e},mh=(e,t,n)=>{let r=!1;return Tm(t,i=>{let a=i.target;if(e.includes(a)){let e=i.property,o=i._tweenType,s=Zm(n,a,o);(!s||s&&s===e)&&(i.parent._tail===i&&i._tweenType===pp.TRANSFORM&&i._prev&&i._prev._tweenType===pp.TRANSFORM&&(i._prev._renderTransforms=1),Em(t,i),ph(i),r=!0)}},!0),r},hh=(e,t,n)=>{let r=t||ah,i;if(r._hasChildren){let t=0;Tm(r,a=>{if(!a._hasChildren){if(i=mh(e,a,n),i&&!a._head)a.cancel(),Em(r,a);else{let e=a._offset+a._delay+a.duration;e>t&&(t=e)}}a._head?hh(e,a,n):a._hasChildren=!1},!0),X(r.iterationDuration)||(r.iterationDuration=t)}else i=mh(e,r,n);i&&!r._head&&(r._hasChildren=!1,r.cancel&&r.cancel())},gh=e=>(e.paused=!0,e.began=!1,e.completed=!1,e),_h=e=>e._cancelled?(e._hasChildren?Tm(e,_h):Tm(e,e=>{e._composition!==gp.none&&fh(e,lh(e.target,e.property))}),e._cancelled=0,e):e,vh=0,yh=(e,t)=>e._priority>t._priority,bh=class extends $m{constructor(e={},t=null,n=0){super(0),++vh;let{id:r,delay:i,duration:a,reversed:o,alternate:s,loop:c,loopDelay:l,autoplay:u,frameRate:d,playbackRate:f,priority:p,onComplete:m,onLoop:h,onPause:g,onBegin:_,onBeforeUpdate:v,onUpdate:y}=e;Up.current&&Up.current.register(this);let b=t?0:ah._lastTickTime,x=t?t.defaults:Y.defaults,S=Qp(i)||X(i)?x.delay:+i,C=Qp(a)||X(a)?1/0:+a,w=Z(c,x.loop),T=Z(l,x.loopDelay),E=w===!0||w===1/0||w<0?1/0:w+1,D=0;t?D=n:(ah.reqId||ah.requestTick(qp()),D=(ah._lastTickTime-ah._startTime)*Y.timeScale),this.id=X(r)?vh:r,this.parent=t,this.duration=xm((C+T)*E-T)||1e-11,this.backwards=!1,this.paused=!0,this.began=!1,this.completed=!1,this.onBegin=_||x.onBegin,this.onBeforeUpdate=v||x.onBeforeUpdate,this.onUpdate=y||x.onUpdate,this.onLoop=h||x.onLoop,this.onPause=g||x.onPause,this.onComplete=m||x.onComplete,this.iterationDuration=C,this.iterationCount=E,this._autoplay=!t&&Z(u,x.autoplay),this._offset=D,this._delay=S,this._loopDelay=T,this._iterationTime=0,this._currentIteration=0,this._resolve=kp,this._running=!1,this._reversed=+Z(o,x.reversed),this._reverse=this._reversed,this._cancelled=0,this._alternate=Z(s,x.alternate),this._prev=null,this._next=null,this._lastTickTime=b,this._startTime=b,this._lastTime=b,this._fps=Z(d,x.frameRate),this._speed=Z(f,x.playbackRate),this._priority=+Z(p,1)}get cancelled(){return!!this._cancelled}set cancelled(e){e?this.cancel():this.reset(!0).play()}get currentTime(){return vm(ym(this._currentTime,Y.precision),-this._delay,this.duration)}set currentTime(e){let t=this.paused;this.pause().seek(+e),t||this.resume()}get iterationCurrentTime(){return vm(ym(this._iterationTime,Y.precision),0,this.iterationDuration)}set iterationCurrentTime(e){this.currentTime=this.iterationDuration*this._currentIteration+e}get progress(){return vm(ym(this._currentTime/this.duration,10),0,1)}set progress(e){this.currentTime=this.duration*e}get iterationProgress(){return vm(ym(this._iterationTime/this.iterationDuration,10),0,1)}set iterationProgress(e){let t=this.iterationDuration;this.currentTime=t*this._currentIteration+t*e}get currentIteration(){return this._currentIteration}set currentIteration(e){this.currentTime=this.iterationDuration*vm(+e,0,this.iterationCount-1)}get reversed(){return!!this._reversed}set reversed(e){e?this.reverse():this.play()}get speed(){return super.speed}set speed(e){super.speed=e,this.resetTime()}reset(e=!1){return _h(this),this._reversed&&!this._reverse&&(this.reversed=!1),this._iterationTime=this.iterationDuration,Ym(this,0,1,~~e,hp.FORCE),gh(this),this._hasChildren&&Tm(this,gh),this}init(e=!1){this.fps=this._fps,this.speed=this._speed,!e&&this._hasChildren&&Ym(this,this.duration,1,~~e,hp.FORCE),this.reset(e);let t=this._autoplay;return t===!0?this.resume():t&&!X(t.linked)&&t.link(this),this}resetTime(){let e=1/(this._speed*ah._speed);return this._startTime=qp()-(this._currentTime+this._delay)*e,this}pause(){return this.paused?this:(this.paused=!0,this.onPause(this),this)}resume(){return this.paused?(this.paused=!1,this.duration<=1e-11&&!this._hasChildren?Ym(this,Sp,0,0,hp.FORCE):(this._running||=(Dm(ah,this,yh),ah._hasChildren=!0,!0),this.resetTime(),this._startTime-=12,ah.wake()),this):this}restart(){return this.reset().resume()}seek(e,t=0,n=0){_h(this),this.completed=!1;let r=this.paused;return this.paused=!0,Ym(this,e+this._delay,~~t,~~n,hp.AUTO),r?this:this.resume()}alternate(){let e=this._reversed,t=this.iterationCount,n=this.iterationDuration,r=t===1/0?mm(Cp/n):t;return this._reversed=+(this._alternate&&!(r%2)?e:!e),t===1/0?this.iterationProgress=this._reversed?1-this.iterationProgress:this.iterationProgress:this.seek(n*r-this._currentTime),this.resetTime(),this}play(){return this._reversed&&this.alternate(),this.resume()}reverse(){return this._reversed||this.alternate(),this.resume()}cancel(){return this._hasChildren?Tm(this,e=>e.cancel(),!0):Tm(this,ph),this._cancelled=1,this.pause()}stretch(e){let t=this.duration,n=Sm(e);if(t===n)return this;let r=e/t,i=e<=Sp;return this.duration=i?Sp:n,this.iterationDuration=i?Sp:Sm(this.iterationDuration*r),this._offset*=r,this._delay*=r,this._loopDelay*=r,this}revert(){Ym(this,0,1,0,hp.AUTO);let e=this._autoplay;return e&&e.linked&&e.linked===this&&e.revert(),this.cancel()}complete(e=0){return this.seek(this.duration,e).cancel()}then(e=kp){let t=this.then,n=()=>{this.then=null,e(this),this.then=t,this._resolve=kp};return new Promise(e=>(this._resolve=()=>e(n()),this.completed&&this._resolve(),this))}};function xh(e){let t=Zp(e)?Up.root.querySelectorAll(e):e;if(t instanceof NodeList||t instanceof HTMLCollection)return t}function Sh(e){if($p(e))return[];if(!up)return Jp(e)&&e.flat(1/0)||[e];if(Jp(e)){let t=e.flat(1/0),n=[];for(let e=0,r=t.length;e<r;e++){let r=t[e];if(!$p(r)){let e=xh(r);if(e)for(let t=0,r=e.length;t<r;t++){let r=e[t];if(!$p(r)){let e=!1;for(let t=0,i=n.length;t<i;t++)if(n[t]===r){e=!0;break}e||n.push(r)}}else{let e=!1;for(let t=0,i=n.length;t<i;t++)if(n[t]===r){e=!0;break}e||n.push(r)}}}return n}let t=xh(e);return t?Array.from(t):[e]}function Ch(e){let t=Sh(e),n=t.length;for(let e=0;e<n;e++){let n=t[e];if(!n[_p]){n[_p]=!0;let e=em(n);(n.nodeType||e)&&(n[vp]=!0,n[yp]=e,n[bp]={})}}return t}var wh={deg:1,rad:180/gm,turn:360},Th={},Eh=(e,t,n,r=!1)=>{let i=t.u,a=t.n;if(t.t===mp.UNIT&&i===n)return t;let o=a+i+n,s=Th[o];if(!X(s)&&!r)t.n=s;else{let r;if(i in wh)r=a*wh[i]/wh[n];else{let t=e.cloneNode(),o=e.parentNode,s=o&&o!==fp?o:fp.body;s.appendChild(t);let c=t.style;c.width=100+i;let l=t.offsetWidth||100;c.width=100+n;let u=l/(t.offsetWidth||100);s.removeChild(t),r=u*a}t.n=r,Th[o]=r}return t.t,mp.UNIT,t.u=n,t},Dh=e=>e,Oh=(e=1.68)=>t=>cm(t,+e),kh={in:e=>t=>e(t),out:e=>t=>1-e(1-t),inOut:e=>t=>t<.5?e(t*2)/2:1-e(t*-2+2)/2,outIn:e=>t=>t<.5?(1-e(1-t*2))/2:(e(t*2-1)+1)/2},Ah=gm/2,jh=gm*2,Mh={"":Oh,Quad:Oh(2),Cubic:Oh(3),Quart:Oh(4),Quint:Oh(5),Sine:e=>1-dm(e*Ah),Circ:e=>1-lm(1-e*e),Expo:e=>e?cm(2,10*e-10):0,Bounce:e=>{let t,n=4;for(;e<((t=cm(2,--n))-1)/11;);return 1/cm(4,3-n)-7.5625*cm((t*3-2)/22-e,2)},Back:(e=1.7)=>t=>(+e+1)*t*t*t-+e*t*t,Elastic:(e=1,t=.3)=>{let n=vm(+e,1,10),r=vm(+t,Sp,2),i=r/jh*hm(1/n),a=jh/r;return e=>e===0||e===1?e:-n*cm(2,-10*(1-e))*um((1-e-i)*a)}},Nh=(()=>{let e={linear:Dh,none:Dh};for(let t in kh)for(let n in Mh){let r=Mh[n],i=kh[t];e[t+n]=n===``||n===`Back`||n===`Elastic`?(e,t)=>i(r(e,t)):i(r)}return e})(),Ph={linear:Dh,none:Dh},Fh=e=>{if(Ph[e])return Ph[e];if(e.indexOf(`(`)<=-1){let t=kh[e]||e.includes(`Back`)||e.includes(`Elastic`)?Nh[e]():Nh[e];return t?Ph[e]=t:Dh}{let t=e.slice(0,-1).split(`(`),n=Nh[t[0]];return n?Ph[e]=n(...t[1].split(`,`)):Dh}},Ih=[`steps(`,`irregular(`,`linear(`,`cubicBezier(`],Lh=e=>{if(Zp(e)){for(let t=0,n=Ih.length;t<n;t++)if(Kp(e,Ih[t]))return console.warn(`String syntax for \`ease: "${e}"\` has been removed from the core and replaced by importing and passing the easing function directly: \`ease: ${e}\``),Dh}return Qp(e)?e:Zp(e)?Fh(e):Dh},Q=Um(),$=Um(),Rh={},zh={func:null},Bh={func:null},Vh=[null],Hh=[null,null],Uh={to:null},Wh=0,Gh=0,Kh,qh,Jh=(e,t)=>{let n={};if(Jp(e)){let t=[].concat(...e.map(e=>Object.keys(e))).filter(am);for(let r=0,i=t.length;r<i;r++){let i=t[r];n[i]=e.map(e=>{let t={};for(let n in e){let r=e[n];am(n)?n===i&&(t.to=r):t[n]=r}return t})}}else{let r=Z(t.duration,Y.defaults.duration);Object.keys(e).map(t=>({o:parseFloat(t)/100,p:e[t]})).sort((e,t)=>e.o-t.o).forEach(e=>{let t=e.o,i=e.p;for(let e in i)if(am(e)){let a=n[e];a||=n[e]=[];let o=t*r,s=a.length,c=a[s-1],l={to:i[e]},u=0;for(let e=0;e<s;e++)u+=a[e].duration;s===1&&(l.from=c.to),i.ease&&(l.ease=i.ease),l.duration=o-(s?u:0),a.push(l)}return e});for(let e in n){let t=n[e],r;for(let e=0,n=t.length;e<n;e++){let n=t[e],i=n.ease;n.ease=r||void 0,r=i}t[0].duration||t.shift()}}return n},Yh=class extends bh{constructor(e,t,n,r,i=!1,a=0,o){super(t,n,r),this._head,this._tail,++Gh;let s=Ch(e),c=s.length,l=t.keyframes,u=l?wm(Jh(l,t),t):t,{id:d,delay:f,duration:p,ease:m,playbackEase:h,modifier:g,composition:_,onRender:v}=u,y=n?n.defaults:Y.defaults,b=Z(m,y.ease),x=Z(h,y.playbackEase),S=x?Lh(x):null,C=!X(b.ease),w=C?b.ease:Z(m,S?`linear`:y.ease),T=C?b.settlingDuration:Z(p,y.duration),E=Z(f,y.delay),D=g||y.modifier,O=X(_)&&c>=1e3?gp.none:X(_)?y.composition:_,k=this._offset+(n?n._offset:0);C&&(b.parent=this);let A=NaN,j=NaN,M=0,N=0;for(let e=0;e<c;e++){let t=s[e],r=a||e,c=o||s,l=NaN,d=NaN;for(let e in u)if(am(e)){let a=zm(t,e),o=jm(t,e),s=Zm(e,t,a),f=u[e],p=Jp(f);if(i&&!p&&(Hh[0]=f,Hh[1]=f,f=Hh),p){let e=f.length,t=!Yp(f[0]);e===2&&t?(Uh.to=f,Vh[0]=Uh,Kh=Vh):e>2&&t?(Kh=[],f.forEach((e,t)=>{t?t===1?(Hh[1]=e,Kh.push(Hh)):Kh.push(e):Hh[0]=e})):Kh=f}else Vh[0]=f,Kh=Vh;let m=null,h=null,g=NaN,_=0,v=0;for(let e=Kh.length;v<e;v++){let i=Kh[v];Yp(i)?qh=i:(Uh.to=i,qh=Uh),zh.func=null,Bh.func=null;let l=Rm(Z(qh.composition,O),t,r,c,null,null),u=Xp(l)?l:gp[l];!m&&u!==gp.none&&(m=lh(t,s));let d=m?m._tail:null,f=n&&d&&d.parent.parent===n?d:h,p=Rm(qh.to,t,r,c,zh,f),y;Yp(p)&&!X(p.to)?(qh=p,y=p.to):y=p;let b=Rm(qh.from,t,r,c,Bh,f),x=qh.ease||w,S=Rm(x,t,r,c,null,f),C=Qp(S)||Zp(S)?S:x,A=!X(C)&&!X(C.ease),j=A?C.ease:C,ee=A?C.settlingDuration:Rm(Z(qh.duration,e>1?Rm(T,t,r,c,null,f)/e:T),t,r,c,null,f),te=Rm(Z(qh.delay,v?0:E),t,r,c,null,f),P=qh.modifier||D,F=!X(b),ne=!X(y),re=Jp(y),I=re||F&&ne,L=h?_:0,ie=h?_+te:te,ae=ym(k+ie,12),R=ym(k+L,12);!N&&(F||re)&&(N=1);let z=h;if(u!==gp.none){let e=m._head;for(;e&&e._absoluteStartTime<=ae;)if(e._isOverridden||(z=e),e=e._nextRep,e&&e._absoluteStartTime>=ae)for(;e;)dh(e),e=e._nextRep}if(I){Wm(re?Rm(y[0],t,r,c,Bh,f):b,Q),Wm(re?Rm(y[1],t,r,c,zh,f):y,$);let e=Vm(t,s,a,Rh);Q.t===mp.NUMBER&&(z?z._valueType===mp.UNIT&&(Q.t=mp.UNIT,Q.u=z._unit):(Wm(e,Km),Km.t===mp.UNIT&&(Q.t=mp.UNIT,Q.u=Km.u)))}else ne?Wm(y,$):h?Gm(h,$):Wm(n&&z&&z.parent.parent===n?z._value:Vm(t,s,a,Rh),$),F?Wm(b,Q):h?Gm(h,Q):Wm(n&&z&&z.parent.parent===n?z._value:Vm(t,s,a,Rh),Q);if(Q.o&&(Q.n=Hm(z?z._toNumber:Wm(Vm(t,s,a,Rh),Km).n,Q.n,Q.o)),$.o&&($.n=Hm(Q.n,$.n,$.o)),Q.t!==$.t){if(Q.t===mp.COMPLEX||$.t===mp.COMPLEX){let e=Q.t===mp.COMPLEX?Q:$,t=Q.t===mp.COMPLEX?$:Q;t.t=mp.COMPLEX,t.s=Cm(e.s),t.d=e.d.map(()=>t.n)}else if(Q.t===mp.UNIT||$.t===mp.UNIT){let e=Q.t===mp.UNIT?Q:$,t=Q.t===mp.UNIT?$:Q;t.t=mp.UNIT,t.u=e.u}else if(Q.t===mp.COLOR||$.t===mp.COLOR){let e=Q.t===mp.COLOR?Q:$,t=Q.t===mp.COLOR?$:Q;t.t=mp.COLOR,t.d=e.d.map(()=>0)}}if(Q.u!==$.u){let e=$.u?Q:$;e=Eh(t,e,$.u?$.u:Q.u,!1)}if($.d&&Q.d&&$.d.length!==Q.d.length){let e=Q.d.length>$.d.length?Q:$,t=e===Q?$:Q;t.d=e.d.map((e,n)=>X(t.d[n])?0:t.d[n]),t.s=Cm(e.s)}let oe=ym(+ee||1e-11,12),se=Rh[s];$p(se)||(Rh[s]=null);let ce=o?o.set:null;_=ym(ie+oe,12);let le=Q.d,ue=$.d,de=$.s,fe={parent:this,id:Wh++,property:s,target:t,_value:null,_toFunc:zh.func,_fromFunc:Bh.func,_ease:Lh(j),_fromNumbers:le?Cm(le):Tp,_toNumbers:ue?Cm(ue):Tp,_strings:de?Cm(de):Tp,_fromNumber:Q.n,_toNumber:$.n,_numbers:le?Cm(le):Tp,_number:Q.n,_unit:$.u,_modifier:P,_currentTime:0,_startTime:ie,_delay:+te,_updateDuration:oe,_changeDuration:oe,_absoluteStartTime:ae,_absoluteUpdateStartTime:R,_absoluteEndTime:ym(k+_,12),_hasFromValue:F||re?1:0,_tweenType:a,_setter:ce,_valueType:$.t,_composition:u,_isOverlapped:0,_isOverridden:0,_renderTransforms:0,_inlineValue:se,_prevRep:null,_nextRep:null,_prevAdd:null,_nextAdd:null,_prev:null,_next:null};u!==gp.none&&fh(fe,m);let pe=fe._valueType;if(pe===mp.COMPLEX)fe._value=qm(fe,1,-1);else if(pe===mp.UNIT)fe._value=`${P(fe._toNumber)}${fe._unit}`;else if(pe===mp.COLOR){let e=$.d;fe._value=`rgba(${ym(e[0],0)},${ym(e[1],0)},${ym(e[2],0)},${e[3]})`}else fe._value=P(fe._toNumber);isNaN(g)&&(g=fe._startTime),h=fe,M++,Dm(this,fe)}(isNaN(j)||g<j)&&(j=g),(isNaN(A)||_>A)&&(A=_),a===pp.TRANSFORM&&(l=M-v,d=M)}if(!isNaN(l)){let e=0;Tm(this,t=>{e>=l&&e<d&&(t._renderTransforms=1,t._composition===gp.blend&&Tm(eh.animation,e=>{e.id===t.id&&(e._renderTransforms=1)})),e++})}}c||console.warn(`No target found. Make sure the element you're trying to animate is accessible before creating your animation.`),j?(Tm(this,e=>{e._startTime-e._delay||(e._delay-=j),e._startTime-=j}),A-=j):j=0,A||(A=Sp,this.iterationCount=0),this.targets=s,this.id=X(d)?Gh:d,this.duration=A===1e-11?Sp:xm((A+this._loopDelay)*this.iterationCount-this._loopDelay)||1e-11,this.onRender=v||y.onRender,this._ease=S,this._delay=j,this.iterationDuration=A,!this._autoplay&&N&&this.onRender(this)}stretch(e){let t=this.duration;if(t===Sm(e))return this;let n=e/t;return Tm(this,e=>{e._updateDuration=Sm(e._updateDuration*n),e._changeDuration=Sm(e._changeDuration*n),e._currentTime*=n,e._delay*=n,e._startTime*=n,e._absoluteStartTime*=n,e._absoluteUpdateStartTime*=n,e._absoluteEndTime*=n}),super.stretch(e)}refresh(){return Tm(this,e=>{let t=e._toFunc,n=e._fromFunc;(t||n)&&(n?(Wm(n(),Q),Q.u!==e._unit&&e.target[vp]&&Eh(e.target,Q,e._unit,!0),e._fromNumbers=Cm(Q.d),e._fromNumber=Q.n):t&&(Wm(Vm(e.target,e.property,e._tweenType),Km),e._fromNumbers=Cm(Km.d),e._fromNumber=Km.n),t&&(Wm(t(),$),e._toNumbers=Cm($.d),e._strings=Cm($.s),e._toNumber=$.o?Hm(e._fromNumber,$.n,$.o):$.n))}),this.duration===1e-11&&this.restart(),this}revert(){return super.revert(),Qm(this)}then(e){return super.then(e)}},Xh=(e,t)=>{if(Kp(t,`<`)){let n=t[1]===`<`,r=e._tail,i=r?r._offset+r._delay:0;return n?i:i+r.duration}},Zh=(e,t)=>{let n=e.iterationDuration;if(n===1e-11&&(n=0),X(t))return n;if(Xp(+t))return+t;let r=t,i=e?e.labels:null,a=!$p(i),o=Xh(e,r),s=!X(o),c=Bp.exec(r);if(c){let e=c[0],t=r.split(e),l=a&&t[0]?i[t[0]]:n;return Hm(s?o:a?l:n,+t[1],e[0])}return s?o:a?X(i[r])?n:i[r]:n};function Qh(e){return xm((e.iterationDuration+e._loopDelay)*e.iterationCount-e._loopDelay)||1e-11}function $h(e,t,n,r,i,a){let o=Xp(e.duration)&&e.duration<=1e-11?n-Sp:n;t.composition&&Ym(t,o,1,1,hp.AUTO);let s=r?new Yh(r,e,t,o,!1,i,a):new bh(e,t,o);return t.composition&&s.init(!0),Dm(t,s),Tm(t,e=>{let n=e._offset+e._delay+e.duration;n>t.iterationDuration&&(t.iterationDuration=n)}),t.duration=Qh(t),t}var eg=0,tg=class extends bh{constructor(e={}){super(e,null,0),++eg,this.id=X(e.id)?eg:e.id,this.duration=0,this.labels={};let t=e.defaults,n=Y.defaults;this.defaults=t?wm(t,n):n,this.composition=Z(e.composition,!0),this.onRender=e.onRender||n.onRender;let r=Z(e.playbackEase,n.playbackEase);this._ease=r?Lh(r):null,this.iterationDuration=0}add(e,t,n){let r=Yp(t),i=Yp(e);if(r||i){if(this._hasChildren=!0,r){let r=t,i=Y.editor&&Y.editor.addTimelineChild,a=n&&n.type===`Stagger`&&Y.editor,o=Qp(n)?n:null;if(o||a){let t=Sh(e),a=this.duration,s=this.iterationDuration,c=r.id,l=0,u=t.length,d=i?i(e,r,this.id,n,u):null,f=o||Y.editor.resolveStagger(n.defaultValue);t.forEach(e=>{let n={...d||r};this.duration=a,this.iterationDuration=s,X(c)||(n.id=c+`-`+l);let i=Zh(this,f(e,l,t,null,this));$h(n,this,i,e,l,t),l++})}else{let t=i?i(e,r,this.id,n):r,a=n&&n.type?n.defaultValue:n;$h(t,this,Zh(this,a),e)}}else $h(e,this,Zh(this,t));return this.composition&&this.init(!0),this}}sync(e,t){if(X(e)||e&&X(e.pause))return this;e.pause();let n=+(e.effect?e.effect.getTiming().duration:e.duration);!X(e)&&!X(e.persist)&&(e.persist=!0);let r=Y.editor,i=r&&r.addTimelineChild;r&&r.addTimelineSync&&(t=r.addTimelineSync(e,t,this.id),r.addTimelineChild=null);let a=this.add(e,{currentTime:[0,n],duration:n,delay:0,ease:`linear`,playbackEase:`linear`},t);return r&&(r.addTimelineChild=i),a}set(e,t,n){return X(t)?this:(t.duration=Sp,t.composition=gp.replace,this.add(e,t,n))}call(e,t){return X(e)||e&&!Qp(e)?this:(Y.editor&&Y.editor.addTimelineCall&&(t=Y.editor.addTimelineCall(e,t,this.id)),this.add({duration:0,delay:0,onComplete:()=>e(this)},t))}label(e,t){return X(e)||e&&!Zp(e)?this:(Y.editor&&Y.editor.addTimelineLabel&&(t=Y.editor.addTimelineLabel(e,t,this.id)),this.labels[e]=Zh(this,t),this)}remove(e,t){return hh(Sh(e),this,t),this}stretch(e){let t=this.duration;if(t===Sm(e))return this;let n=e/t,r=this.labels;Tm(this,e=>e.stretch(e.duration*n));for(let e in r)r[e]*=n;return super.stretch(e)}refresh(){return Tm(this,e=>{e.refresh&&e.refresh()}),this}revert(){return super.revert(),Tm(this,e=>e.revert,!0),Qm(this)}then(e){return super.then(e)}},ng=e=>Y.editor?Y.editor.addTimeline(e):new tg(e).init(),rg=wp*10,ig=class{constructor(e={}){let t=!X(e.bounce)||!X(e.duration);this.timeStep=.02,this.restThreshold=5e-4,this.restDuration=200,this.maxDuration=6e4,this.maxRestSteps=this.restDuration/this.timeStep/wp,this.maxIterations=this.maxDuration/this.timeStep/wp,this.bn=vm(Z(e.bounce,.5),-1,1),this.pd=vm(Z(e.duration,628),10*Y.timeScale,rg*Y.timeScale),this.m=vm(Z(e.mass,1),1,rg),this.s=vm(Z(e.stiffness,100),Sp,rg),this.d=vm(Z(e.damping,10),Sp,rg),this.v=vm(Z(e.velocity,0),-rg,rg),this.w0=0,this.zeta=0,this.wd=0,this.b=0,this.completed=!1,this.solverDuration=0,this.settlingDuration=0,this.parent=null,this.onComplete=e.onComplete||kp,t&&this.calculateSDFromBD(),this.compute(),this.ease=e=>{let t=e*this.settlingDuration,n=this.completed,r=this.pd;return t>=r&&!n&&(this.completed=!0,this.onComplete(this.parent)),t<r&&n&&(this.completed=!1),e===0||e===1?e:this.solve(e*this.solverDuration)}}solve(e){let{zeta:t,w0:n,wd:r,b:i}=this,a=e;return a=t<1?pm(-a*t*n)*(1*dm(r*a)+i*um(r*a)):t===1?(1+i*a)*pm(-a*n):((1+i)*pm((-t*n+r)*a)+(1-i)*pm((-t*n-r)*a))/2,1-a}calculateSDFromBD(){let e=Y.timeScale===1?this.pd/wp:this.pd;this.m=1,this.v=0,this.s=cm(2*gm/e,2),this.d=this.bn>=0?(1-this.bn)*4*gm/e:4*gm/(e*(1+this.bn)),this.s=ym(vm(this.s,Sp,rg),3),this.d=ym(vm(this.d,Sp,300),3)}calculateBDFromSD(){let e=2*gm/lm(this.s);this.pd=e*(Y.timeScale===1?wp:1),this.bn=this.d/(2*lm(this.s))<=1?1-this.d*e/(4*gm):4*gm/(this.d*e)-1,this.bn=ym(vm(this.bn,-1,1),3),this.pd=ym(vm(this.pd,10*Y.timeScale,rg*Y.timeScale),3)}compute(){let{maxRestSteps:e,maxIterations:t,restThreshold:n,timeStep:r,m:i,d:a,s:o,v:s}=this,c=this.w0=vm(lm(o/i),Sp,wp),l=this.zeta=a/(2*lm(o*i));l<1?(this.wd=c*lm(1-l*l),this.b=(l*c+-s)/this.wd):l===1?(this.wd=0,this.b=-s+c):(this.wd=c*lm(l*l-1),this.b=(l*c+-s)/this.wd);let u=0,d=0,f=0;for(;d<=e&&f<=t;)fm(1-this.solve(u))<n?d++:d=0,this.solverDuration=u,u+=r,f++;this.settlingDuration=ym(this.solverDuration*wp,0)*Y.timeScale}get bounce(){return this.bn}set bounce(e){this.bn=vm(Z(e,1),-1,1),this.calculateSDFromBD(),this.compute()}get duration(){return this.pd}set duration(e){this.pd=vm(Z(e,1),10*Y.timeScale,rg*Y.timeScale),this.calculateSDFromBD(),this.compute()}get stiffness(){return this.s}set stiffness(e){this.s=vm(Z(e,100),Sp,rg),this.calculateBDFromSD(),this.compute()}get damping(){return this.d}set damping(e){this.d=vm(Z(e,10),Sp,rg),this.calculateBDFromSD(),this.compute()}get mass(){return this.m}set mass(e){this.m=vm(Z(e,1),1,rg),this.compute()}get velocity(){return this.v}set velocity(e){this.v=vm(Z(e,0),-rg,rg),this.compute()}},ag=e=>new ig(e),og={_head:null,_tail:null},sg=(e,t,n)=>{let r=og._head,i;for(;r;){let a=r._next,o=r.$el===e,s=!t||r.property===t,c=!n||r.parent===n;if(o&&s&&c){i=r.animation;try{i.commitStyles()}catch{}i.cancel(),Em(og,r);let e=r.parent;e&&(e._completed++,e.animations.length===e._completed&&(e.completed=!0,e.paused=!0,e.muteCallbacks||(e.onComplete(e),e._resolve(e))))}r=a}return i},cg=(e,t,n,r,i)=>{let a=t.animate(r,i),o=i.delay+ +i.duration*i.iterations;a.playbackRate=e._speed,e.paused&&a.pause(),e.duration<o&&(e.duration=o,e.controlAnimation=a),e.animations.push(a),sg(t,n),Dm(og,{parent:e,animation:a,$el:t,property:n,_next:null,_prev:null});let s=()=>sg(t,n,e);return a.oncancel=s,a.onremove=s,e.persist||(a.onfinish=s),a},lg=(e,t=100)=>{let n=[];for(let r=0;r<=t;r++)n.push(ym(e(r/t),4));return`linear(${n.join(`, `)})`},ug={},dg=e=>{let t=ug[e];if(t)return t;if(t=`linear`,Zp(e)){if(Kp(e,`linear`)||Kp(e,`cubic-`)||Kp(e,`steps`)||Kp(e,`ease`))t=e;else if(Kp(e,`cubicB`))t=Gp(e);else{let n=Fh(e);Qp(n)&&(t=n===Dh?`linear`:lg(n))}ug[e]=t}else if(Qp(e)){let n=lg(e);n&&(t=n)}else e.ease&&(t=lg(e.ease));return t},fg=[`x`,`y`,`z`],pg=[`perspective`,`width`,`height`,`margin`,`padding`,`top`,`right`,`bottom`,`left`,`borderWidth`,`fontSize`,`borderRadius`,...fg],mg=[...fg,...Dp.filter(e=>[`X`,`Y`,`Z`].some(t=>e.endsWith(t)))],hg=null,gg=(e,t,n,r,i)=>{let a=Zp(t)?t:Rm(t,n,r,i,null,null);return Xp(a)?pg.includes(e)||Kp(e,`translate`)?`${a}px`:Kp(e,`rotate`)||Kp(e,`skew`)?`${a}deg`:`${a}`:a},_g=(e,t,n,r,i,a)=>{let o=`0`,s=X(r)?getComputedStyle(e)[t]:gg(t,r,e,i,a);return o=X(n)?Jp(r)?r.map(n=>gg(t,n,e,i,a)):s:[gg(t,n,e,i,a),s],o},vg=class{constructor(e,t){Up.current&&Up.current.register(this),$p(hg)&&(up&&(X(CSS)||!Object.hasOwnProperty.call(CSS,`registerProperty`))?hg=!1:(Dp.forEach(e=>{let t=Kp(e,`skew`),n=Kp(e,`scale`),r=Kp(e,`rotate`),i=Kp(e,`translate`),a=r||t,o=a?`<angle>`:n?`<number>`:i?`<length-percentage>`:`*`;try{CSS.registerProperty({name:`--`+e,syntax:o,inherits:!1,initialValue:i?`0px`:a?`0deg`:n?`1`:`0`})}catch{}}),hg=!0));let n=Ch(e);n.length||console.warn(`No target found. Make sure the element you're trying to animate is accessible before creating your animation.`);let r=Z(t.autoplay,Y.defaults.autoplay),i=r&&r.link?r:!1,a=t.alternate&&t.alternate===!0,o=t.reversed&&t.reversed===!0,s=Z(t.loop,Y.defaults.loop),c=s===!0||s===1/0?1/0:Xp(s)?s+1:1,l=a?o?`alternate-reverse`:`alternate`:o?`reverse`:`normal`,u=Y.timeScale===1?1:wp;this.targets=n,this.animations=[],this.controlAnimation=null,this.onComplete=t.onComplete||Y.defaults.onComplete,this.duration=0,this.muteCallbacks=!1,this.completed=!1,this.paused=!r||i!==!1,this.reversed=o,this.persist=Z(t.persist,Y.defaults.persist),this.autoplay=r,this._speed=Z(t.playbackRate,Y.defaults.playbackRate),this._resolve=kp,this._completed=0,this._inlineStyles=[],n.forEach((e,r)=>{let i=e[bp],a=mg.some(e=>t.hasOwnProperty(e)),o=e.style,s=this._inlineStyles[r]={},d=Z(t.ease,Y.defaults.ease),f=Rm(d,e,r,n,null,null),p=Qp(f)||Zp(f)?f:d,m=d.ease&&d,h=dg(p),g=(m?m.settlingDuration:Rm(Z(t.duration,Y.defaults.duration),e,r,n,null,null))*u,_=Rm(Z(t.delay,Y.defaults.delay),e,r,n,null,null)*u,v=Z(t.composition,`replace`);for(let d in t){if(!am(d))continue;let f={},p={iterations:c,direction:l,fill:`both`,easing:h,duration:g,delay:_,composite:v},m=t[d],y=a?Dp.includes(d)?d:Ep.get(d):!1,b=y?`transform`:d;s[b]||(s[b]=o[b]);let x;if(Yp(m)){let t=m,a=Z(t.ease,h),s=a.ease&&a,c=t.to,l=t.from;if(p.duration=(s?s.settlingDuration:Rm(Z(t.duration,g),e,r,n,null,null))*u,p.delay=Rm(Z(t.delay,_),e,r,n,null,null)*u,p.composite=Z(t.composition,v),p.easing=dg(a),x=_g(e,d,l,c,r,n),y?(f[`--${y}`]=x,i[y]=x):f[d]=_g(e,d,l,c,r,n),cg(this,e,d,f,p),!X(l)){if(!y)o[d]=f[d][0];else{let e=`--${y}`;o.setProperty(e,f[e][0])}}}else x=Jp(m)?m.map(t=>gg(d,t,e,r,n)):gg(d,m,e,r,n),y?(f[`--${y}`]=x,i[y]=x):f[d]=x,cg(this,e,d,f,p)}if(a){let e=``;for(let t in i)e+=`${Op[t]}var(--${t})) `;o.transform=e}}),i&&this.autoplay.link(this)}forEach(e){try{let t=Zp(e)?t=>t[e]():e;this.animations.forEach(t)}catch{}return this}get speed(){return this._speed}set speed(e){this._speed=+e,this.forEach(t=>t.playbackRate=e)}get currentTime(){let e=this.controlAnimation,t=Y.timeScale;return this.completed?this.duration:e?+e.currentTime*(t===1?1:t):0}set currentTime(e){let t=e*(Y.timeScale===1?1:wp);this.forEach(e=>{!this.persist&&t>=this.duration&&e.play(),e.currentTime=t})}get progress(){return this.currentTime/this.duration}set progress(e){this.forEach(t=>t.currentTime=e*this.duration||0)}resume(){return this.paused?(this.paused=!1,this.forEach(`play`)):this}pause(){return this.paused?this:(this.paused=!0,this.forEach(`pause`))}alternate(){return this.reversed=!this.reversed,this.forEach(`reverse`),this.paused&&this.forEach(`pause`),this}play(){return this.reversed&&this.alternate(),this.resume()}reverse(){return this.reversed||this.alternate(),this.resume()}seek(e,t=!1){return t&&(this.muteCallbacks=!0),e<this.duration&&(this.completed=!1),this.currentTime=e,this.muteCallbacks=!1,this.paused&&this.pause(),this}restart(){return this.completed=!1,this.seek(0,!0).resume()}commitStyles(){return this.forEach(`commitStyles`)}complete(){return this.seek(this.duration)}cancel(){return this.muteCallbacks=!0,this.commitStyles().forEach(`cancel`),this.animations.length=0,requestAnimationFrame(()=>{this.targets.forEach(e=>{e.style.transform===`none`&&e.style.removeProperty(`transform`)})}),this}revert(){return this.cancel().targets.forEach((e,t)=>{let n=e.style,r=this._inlineStyles[t];for(let t in r){let i=r[t];X(i)||i===``?n.removeProperty(Gp(t)):e.style[t]=i}e.getAttribute(`style`)===``&&e.removeAttribute(`style`)}),this}then(e=kp){let t=this.then,n=()=>{this.then=null,e(this),this.then=t,this._resolve=kp};return new Promise(e=>(this._resolve=()=>e(n()),this.completed&&this._resolve(),this))}},yg={animate:(e,t)=>new vg(e,t),convertEase:lg},bg=0,xg=0,Sg=(e,t)=>!e||!t?!1:e===t||e.contains(t),Cg=e=>{if(!e)return null;let t=e.style,n=t.transition||``;return t.setProperty(`transition`,`none`,`important`),n},wg=(e,t)=>{if(!e)return;let n=e.style;t?n.transition=t:n.removeProperty(`transition`)},Tg=e=>{let t=e.layout.transitionMuteStore,n=e.$el,r=e.$measure;n&&!t.has(n)&&t.set(n,Cg(n)),r&&!t.has(r)&&t.set(r,Cg(r))},Eg=e=>{e.forEach((e,t)=>wg(t,e)),e.clear()},Dg={display:`none`,visibility:`hidden`,opacity:`0`,transform:`none`,position:`static`},Og=e=>{if(!e)return;let t=e.parentNode;t&&(t._head===e&&(t._head=e._next),t._tail===e&&(t._tail=e._prev),e._prev&&(e._prev._next=e._next),e._next&&(e._next._prev=e._prev),e._prev=null,e._next=null,e.parentNode=null)},kg=(e,t,n,r)=>{let i=e.dataset.layoutId;i||=e.dataset.layoutId=`node-${xg++}`;let a=r||{};return a.$el=e,a.$measure=e,a.id=i,a.index=0,a.targets=null,a.delay=0,a.duration=0,a.ease=null,a.state=n,a.layout=n.layout,a.parentNode=t||null,a.isTarget=!1,a.isEntering=!1,a.isLeaving=!1,a.isInlined=!1,a.hasTransform=!1,a.inlineStyles=[],a.inlineTransforms=null,a.inlineTransition=null,a.branchAdded=!1,a.branchRemoved=!1,a.branchNotRendered=!1,a.sizeChanged=!1,a.hasVisibilitySwap=!1,a.hasDisplayNone=!1,a.hasVisibilityHidden=!1,a.measuredInlineTransform=null,a.measuredInlineTransition=null,a.measuredDisplay=null,a.measuredVisibility=null,a.measuredPosition=null,a.measuredHasDisplayNone=!1,a.measuredHasVisibilityHidden=!1,a.measuredIsVisible=!1,a.measuredIsRemoved=!1,a.measuredIsInsideRoot=!1,a.properties={transform:`none`,x:0,y:0,left:0,top:0,clientLeft:0,clientTop:0,width:0,height:0},a.layout.properties.forEach(e=>a.properties[e]=0),a._head=null,a._tail=null,a._prev=null,a._next=null,a},Ag=(e,t,n,r)=>{let i=e.$el,a=e.layout.root,o=a===i,s=e.properties,c=e.state.rootNode,l=e.parentNode,u=n.transform,d=i.style.transform,f=l?l.measuredIsRemoved:!1,p=n.position;o&&(e.layout.absoluteCoords=p===`fixed`||p===`absolute`),e.$measure=t,e.inlineTransforms=d,e.hasTransform=u&&u!==`none`,e.measuredIsInsideRoot=Sg(a,t),e.measuredInlineTransform=null,e.measuredDisplay=n.display,e.measuredVisibility=n.visibility,e.measuredPosition=p,e.measuredHasDisplayNone=n.display===`none`,e.measuredHasVisibilityHidden=n.visibility===`hidden`,e.measuredIsVisible=!(e.measuredHasDisplayNone||e.measuredHasVisibilityHidden),e.measuredIsRemoved=e.measuredHasDisplayNone||e.measuredHasVisibilityHidden||f;let m=!1,h=i.previousSibling;for(;h&&(h.nodeType===Node.COMMENT_NODE||h.nodeType===Node.TEXT_NODE&&!h.textContent.trim());)h=h.previousSibling;if(h&&h.nodeType===Node.TEXT_NODE)m=!0;else{for(h=i.nextSibling;h&&(h.nodeType===Node.COMMENT_NODE||h.nodeType===Node.TEXT_NODE&&!h.textContent.trim());)h=h.nextSibling;m=h!==null&&h.nodeType===Node.TEXT_NODE}if(e.isInlined=m,e.hasTransform&&!r){let n=e.layout.transitionMuteStore;n.get(i)||(e.inlineTransition=Cg(i)),t===i?i.style.transform=`none`:(n.get(t)||(e.measuredInlineTransition=Cg(t)),e.measuredInlineTransform=t.style.transform,t.style.transform=`none`)}let g=0,_=0,v=0,y=0;if(!r){let e=t.getBoundingClientRect();g=e.left,_=e.top,v=e.width,y=e.height}for(let e in s){let t=e===`transform`?u:n[e]||n.getPropertyValue&&n.getPropertyValue(e);X(t)||(s[e]=t)}s.left=g,s.top=_,s.clientLeft=r?0:t.clientLeft,s.clientTop=r?0:t.clientTop;let b,x;if(o)e.layout.absoluteCoords?(b=g,x=_):(b=0,x=0);else{let t=l||c,n=t.properties.left,r=t.properties.top,i=t.properties.clientLeft,a=t.properties.clientTop;if(e.layout.absoluteCoords)b=g-n-i,x=_-r-a;else if(t===c){let e=c.properties.left,t=c.properties.top,n=c.properties.clientLeft,r=c.properties.clientTop;b=g-e-n,x=_-t-r}else b=g-n-i,x=_-r-a}return s.x=b,s.y=x,s.width=v,s.height=y,e},jg=(e,t)=>{if(t)for(let n in t)e.properties[n]=t[n]},Mg=(e,t)=>{let n=Rm(t.ease,e.$el,e.index,e.targets,null,null),r=Qp(n)?n:t.ease,i=!X(r)&&!X(r.ease);e.ease=i?r.ease:r,e.duration=i?r.settlingDuration:Rm(t.duration,e.$el,e.index,e.targets,null,null),e.delay=Rm(t.delay,e.$el,e.index,e.targets,null,null)},Ng=e=>{let t=e.$el.style,n=e.inlineStyles;n.length=0,e.layout.recordedProperties.forEach(e=>{n.push(e,t[e]||``)})},Pg=e=>{let t=e.$el.style,n=e.inlineStyles;for(let e=0,r=n.length;e<r;e+=2){let r=n[e],i=n[e+1];i&&i!==``?t[r]=i:(t[r]=``,t.removeProperty(r))}},Fg=e=>{let t=e.inlineTransforms,n=e.$el.style;!e.hasTransform||!t||e.hasTransform&&n.transform===`none`||t&&t===`none`?n.removeProperty(`transform`):t&&(n.transform=t);let r=e.$measure;if(e.hasTransform&&r!==e.$el){let t=r.style,n=e.measuredInlineTransform;n&&n!==``?t.transform=n:t.removeProperty(`transform`)}e.measuredInlineTransform=null,e.inlineTransition!==null&&(wg(e.$el,e.inlineTransition),e.inlineTransition=null),r!==e.$el&&e.measuredInlineTransition!==null&&(wg(r,e.measuredInlineTransition),e.measuredInlineTransition=null)},Ig=e=>{(e.measuredIsRemoved||e.hasVisibilitySwap)&&(e.$el.style.removeProperty(`display`),e.$el.style.removeProperty(`visibility`),e.hasVisibilitySwap&&(e.$measure.style.removeProperty(`display`),e.$measure.style.removeProperty(`visibility`))),e.layout.pendingRemoval.delete(e.$el)},Lg=(e,t,n)=>(t.properties={...e.properties},t.state=n,t.isTarget=e.isTarget,t.hasTransform=e.hasTransform,t.inlineTransforms=e.inlineTransforms,t.measuredIsVisible=e.measuredIsVisible,t.measuredDisplay=e.measuredDisplay,t.measuredIsRemoved=e.measuredIsRemoved,t.measuredHasDisplayNone=e.measuredHasDisplayNone,t.measuredHasVisibilityHidden=e.measuredHasVisibilityHidden,t.hasDisplayNone=e.hasDisplayNone,t.isInlined=e.isInlined,t.hasVisibilityHidden=e.hasVisibilityHidden,t),Rg=class{constructor(e){this.layout=e,this.rootNode=null,this.rootNodes=new Set,this.nodes=new Map,this.scrollX=0,this.scrollY=0}revert(){return this.forEachNode(e=>{this.layout.pendingRemoval.delete(e.$el),e.$el.removeAttribute(`data-layout-id`),e.$measure.removeAttribute(`data-layout-id`)}),this.rootNode=null,this.rootNodes.clear(),this.nodes.clear(),this}getNode(e){if(!(!e||!e.dataset))return this.nodes.get(e.dataset.layoutId)}getComputedValue(e,t){let n=this.getNode(e);if(n)return n.properties[t]}forEach(e,t){let n=e,r=0;for(;n;)if(t(n,r++),n._head)n=n._head;else if(n._next)n=n._next;else{for(;n&&!n._next;)n=n.parentNode;n&&=n._next}}forEachRootNode(e){this.forEach(this.rootNode,e)}forEachNode(e){for(let t of this.rootNodes)this.forEach(t,e)}registerElement(e,t){if(!e||e.nodeType!==1)return null;this.layout.transitionMuteStore.has(e)||this.layout.transitionMuteStore.set(e,Cg(e));let n=[e,t],r=this.layout.root,i=null;for(;n.length;){let e=n.pop(),t=n.pop();if(!t||t.nodeType!==1||em(t))continue;let a=e?e.measuredIsRemoved:!1,o=a?Dg:getComputedStyle(t),s=a?!0:o.display===`none`,c=a?!0:o.visibility===`hidden`,l=!s&&!c,u=t.dataset.layoutId,d=Sg(r,t),f=u?this.nodes.get(u):null;if(f&&f.$el!==t){let s=Sg(r,f.$el),c=f.measuredIsVisible,u=!s&&(d||!d&&!c&&l),p=s&&!c&&l;if(u)Og(f),f=kg(t,e,this,f);else if(p){Ag(f,t,o,a);let e=t.lastElementChild;for(;e;)n.push(e,f),e=e.previousElementSibling;i||=f;continue}else{let r=t.lastElementChild;for(;r;)n.push(r,e),r=r.previousElementSibling;i||=f;continue}}else f=kg(t,e,this,f);f.branchAdded=!1,f.branchRemoved=!1,f.branchNotRendered=!1,f.isTarget=!1,f.sizeChanged=!1,f.hasVisibilityHidden=c,f.hasDisplayNone=s,f.hasVisibilitySwap=c&&!f.measuredHasVisibilityHidden||s&&!f.measuredHasDisplayNone,this.nodes.set(f.id,f),f.parentNode=e||null,f._prev=null,f._next=null,e?(this.rootNodes.delete(f),e._head?(e._tail._next=f,f._prev=e._tail,e._tail=f):(e._head=f,e._tail=f)):this.rootNodes.add(f),Ag(f,f.$el,o,a);let p=t.lastElementChild;for(;p;)n.push(p,f),p=p.previousElementSibling;i||=f}return i}ensureDetachedNode(e,t){if(!e||e===this.layout.root)return null;let n=e.dataset.layoutId,r=n?this.nodes.get(n):null;if(r&&r.$el===e)return r;let i=null,a=e.parentElement;for(;a&&a!==this.layout.root;){if(t.has(a)){i=this.ensureDetachedNode(a,t);break}a=a.parentElement}return this.registerElement(e,i)}record(){let e=this.layout,t=e.children,n=e.root,r=Jp(t)?t:[t],i=[],a=t===`*`?n:Up.root,o=[],s=n.parentElement;for(;s&&s.nodeType===1;){let e=getComputedStyle(s);if(e.transform&&e.transform!==`none`){let e=s.style.transform||``,t=Cg(s);o.push(s,e,t),s.style.transform=`none`}s=s.parentElement}for(let e=0,t=r.length;e<t;e++){let t=r[e];i[e]=Zp(t)?a.querySelectorAll(t):t}let c=Ch(i);this.nodes.clear(),this.rootNodes.clear();let l=this.registerElement(n,null);l.isTarget=!0,this.rootNode=l;let u=new Set,d=0,f=[];this.nodes.forEach(e=>{f.push(e.$el)}),this.nodes.forEach((e,t)=>{e.index=d++,e.targets=f,e&&e.measuredIsInsideRoot&&u.add(t)});let p=new Set,m=[];for(let e=0,t=c.length;e<t;e++){let t=c[e];if(!(!t||t.nodeType!==1||t===n)){if(!Sg(n,t)){let e=t.dataset.layoutId;if(!e||!u.has(e))continue}p.has(t)||(p.add(t),m.push(t))}}for(let e=0,t=m.length;e<t;e++)this.ensureDetachedNode(m[e],p);for(let e=0,t=c.length;e<t;e++){let t=c[e],n=this.getNode(t);if(n){let e=n;for(;e&&!e.isTarget;)e.isTarget=!0,e=e.parentNode}}this.scrollX=window.scrollX,this.scrollY=window.scrollY,this.forEachNode(Fg);for(let e=0,t=o.length;e<t;e+=3){let t=o[e],n=o[e+1],r=o[e+2];n&&n!==``?t.style.transform=n:t.style.removeProperty(`transform`),wg(t,r)}return this}};function zg(e){let t={},n={};for(let r in e){let i=e[r];r===`duration`||r===`delay`||r===`ease`?n[r]=i:t[r]=i}return[t,n]}var Bg=class{constructor(e,t={}){Up.current&&Up.current.register(this);let n=zg(t.swapAt),r=zg(t.enterFrom),i=zg(t.leaveTo),a=t.properties;if(t.duration=Z(t.duration,350),t.delay=Z(t.delay,0),t.ease=Z(t.ease,`inOut(3.5)`),this.params=t,this.root=Ch(e)[0],this.id=t.id||bg++,this.children=t.children||`*`,this.absoluteCoords=!1,this.swapAtParams=wm(t.swapAt||{opacity:0},{ease:`inOut(1.75)`}),this.enterFromParams=t.enterFrom||{opacity:0},this.leaveToParams=t.leaveTo||{opacity:0},this.properties=new Set([`opacity`,`fontSize`,`color`,`backgroundColor`,`borderRadius`,`border`,`filter`,`clipPath`]),n[0])for(let e in n[0])this.properties.add(e);if(r[0])for(let e in r[0])this.properties.add(e);if(i[0])for(let e in i[0])this.properties.add(e);if(a)for(let e=0,t=a.length;e<t;e++)this.properties.add(a[e]);this.recordedProperties=new Set([`display`,`visibility`,`translate`,`position`,`left`,`top`,`marginLeft`,`marginTop`,`width`,`height`,`maxWidth`,`maxHeight`,`minWidth`,`minHeight`]),this.properties.forEach(e=>this.recordedProperties.add(e)),this.pendingRemoval=new WeakSet,this.transitionMuteStore=new Map,this.oldState=new Rg(this),this.newState=new Rg(this),this.timeline=null,this.transformAnimation=null,this.animating=[],this.swapping=[],this.leaving=[],this.entering=[],this.oldState.record(),Eg(this.transitionMuteStore)}revert(){return this.root.classList.remove(`is-animated`),this.timeline&&=(this.timeline.complete(),null),this.transformAnimation&&=(this.transformAnimation.complete(),null),this.animating.length=this.swapping.length=this.leaving.length=this.entering.length=0,this.oldState.revert(),this.newState.revert(),requestAnimationFrame(()=>Eg(this.transitionMuteStore)),this}record(){return this.transformAnimation&&=(this.transformAnimation.cancel(),null),this.oldState.record(),this.timeline&&=(this.timeline.cancel(),null),this.newState.forEachRootNode(Pg),this}animate(e={}){let t={ease:Z(e.ease,this.params.ease),delay:Z(e.delay,this.params.delay),duration:Z(e.duration,this.params.duration)},n={id:this.id},r=Z(e.onComplete,this.params.onComplete),i=Z(e.onPause,this.params.onPause);for(let t in Hp)t!==`ease`&&t!==`duration`&&t!==`delay`&&(X(e[t])?X(this.params[t])||(n[t]=this.params[t]):n[t]=e[t]);n.onComplete=()=>{let t=e.autoplay,n=Y.editor;if(t&&t.linked||n&&n.showPanel){r&&r(this.timeline);return}this.transformAnimation&&this.transformAnimation.cancel(),h.forEachRootNode(e=>{Ig(e),Pg(e)});for(let e=0,t=C.length;e<t;e++){let t=C[e];t.style.transform=h.getComputedValue(t,`transform`)}this.root.classList.contains(`is-animated`)&&(this.root.classList.remove(`is-animated`),r&&r(this.timeline)),requestAnimationFrame(()=>{this.root.classList.contains(`is-animated`)||Eg(this.transitionMuteStore)})},n.onPause=()=>{let t=e.autoplay;if(t&&t.linked){r&&r(this.timeline),i&&i(this.timeline);return}this.root.classList.contains(`is-animated`)&&(this.transformAnimation&&this.transformAnimation.cancel(),h.forEachRootNode(Ig),this.root.classList.remove(`is-animated`),r&&r(this.timeline),i&&i(this.timeline))},n.composition=!1;let a=wm(wm(e.swapAt||{},this.swapAtParams),t),o=wm(wm(e.enterFrom||{},this.enterFromParams),t),s=wm(wm(e.leaveTo||{},this.leaveToParams),t),[c,l]=zg(a),[u,d]=zg(o),[f,p]=zg(s),m=this.oldState,h=this.newState,g=this.animating,_=this.swapping,v=this.entering,y=this.leaving,b=this.pendingRemoval;g.length=_.length=v.length=y.length=0,m.forEachRootNode(Tg),h.record(),h.forEachRootNode(Ng);let x=[],S=[],C=[],w=[],T=h.rootNode,E=T.$el;h.forEachRootNode(e=>{let t=e.$el,n=e.id,r=e.parentNode,i=r?r.branchAdded:!1,a=r?r.branchRemoved:!1,o=r?r.branchNotRendered:!1,s=m.nodes.get(n),c=!s;c?(s=Lg(e,{},m),m.nodes.set(n,s),s.measuredIsRemoved=!0):s.measuredIsRemoved&&!e.measuredIsRemoved&&(Lg(e,s,m),s.measuredIsRemoved=!0);let l=s.parentNode,d=(l?l.id:null)!==(r?r.id:null),p=s.$el!==e.$el,_=s.measuredIsRemoved,S=e.measuredIsRemoved;if(!s.measuredIsRemoved&&!S&&!c&&(d||p)){let e=s.properties.left,t=s.properties.top,n=r||h.rootNode,i=n.id?m.nodes.get(n.id):null,a=i?i.properties.left:n.properties.left,o=i?i.properties.top:n.properties.top,c=i?i.properties.clientLeft:n.properties.clientLeft,l=i?i.properties.clientTop:n.properties.clientTop;s.properties.x=e-a-c,s.properties.y=t-o-l}e.hasVisibilitySwap&&(e.hasVisibilityHidden&&(e.$el.style.visibility=`visible`,e.$measure.style.visibility=`hidden`),e.hasDisplayNone&&(e.$el.style.display=s.measuredDisplay||e.measuredDisplay||``,e.$measure.style.visibility=`hidden`));let C=b.has(t),w=s.measuredIsVisible,E=e.measuredIsVisible,D=!w&&E&&!o,O=!S&&(_||C)&&!i,k=S&&!_&&!a,A=k||S&&C&&!a;e.branchAdded=i||O,e.branchRemoved=a||A,e.branchNotRendered=o||S,S&&w&&(e.$el.style.display=s.measuredDisplay,e.$el.style.visibility=`visible`,Lg(s,e,h)),k?(e.isTarget&&(y.push(t),e.isLeaving=!0),b.add(t)):!S&&C&&b.delete(t),O&&!o||D?(jg(s,u),e.isTarget&&(v.push(t),e.isEntering=!0)):A&&!o&&jg(e,f),e!==T&&e.isTarget&&!e.isEntering&&!e.isLeaving&&g.push(t),x.push(t)});let D=0,O=0,k=0;h.forEachRootNode(e=>{let n=e.$el,r=e.parentNode,i=m.nodes.get(e.id),a=e.properties,o=i.properties,s=r!==T&&r;for(;s&&!s.isTarget&&s!==T;)s=s.parentNode;e===T?(e.index=0,e.targets=g,Mg(e,t)):e.isEntering?(e.index=s?s.index:D,e.targets=s?g:v,Mg(e,d),D++):e.isLeaving?(e.index=s?s.index:O,e.targets=s?g:y,O++,Mg(e,p)):e.isTarget?(e.index=k++,e.targets=g,Mg(e,t)):(e.index=s?s.index:0,e.targets=g,Mg(e,l)),i.index=e.index,i.targets=e.targets;for(let t in a)a[t]=Rm(a[t],n,e.index,e.targets,null,null),o[t]=Rm(o[t],n,i.index,i.targets,null,null);let u=Math.abs(a.width-o.width)>1,f=Math.abs(a.height-o.height)>1;if(e.sizeChanged=u||f,e.isTarget&&(!e.measuredIsRemoved&&i.measuredIsVisible||e.measuredIsRemoved&&e.measuredIsVisible)){(a.transform!==`none`||o.transform!==`none`)&&(e.hasTransform=!0,C.push(n));for(let e in a)if(e!==`transform`&&a[e]!==o[e]){S.push(n);break}}e.isTarget||(_.push(n),e.sizeChanged&&r&&r.isTarget&&r.sizeChanged&&(c.transform&&(e.hasTransform=!0,C.push(n)),w.push(n)))});let A={delay:e=>h.getNode(e).delay,duration:e=>h.getNode(e).duration,ease:e=>h.getNode(e).ease};if(n.defaults=A,this.timeline=ng(n),!S.length&&!C.length&&!_.length)return Eg(this.transitionMuteStore),this.timeline.complete();if(x.length){this.root.classList.add(`is-animated`);for(let e=0,t=x.length;e<t;e++){let t=x[e],n=t.dataset.layoutId,r=m.nodes.get(n),i=h.nodes.get(n),a=r.properties;i.isInlined||((r.measuredDisplay===`grid`||i.measuredDisplay===`grid`)&&t.style.setProperty(`display`,`block`,`important`),(t!==E||this.absoluteCoords)&&(t.style.position=this.absoluteCoords?`fixed`:`absolute`,t.style.left=`0px`,t.style.top=`0px`,t.style.marginLeft=`0px`,t.style.marginTop=`0px`,t.style.translate=`${a.x}px ${a.y}px`),t===E&&i.measuredPosition===`static`&&(t.style.position=`relative`,t.style.left=`0px`,t.style.top=`0px`)),t.style.width=`${a.width}px`,t.style.height=`${a.height}px`,t.style.minWidth=`auto`,t.style.minHeight=`auto`,t.style.maxWidth=`none`,t.style.maxHeight=`none`}(m.scrollX!==window.scrollX||m.scrollY!==window.scrollY)&&requestAnimationFrame(()=>window.scrollTo(m.scrollX,m.scrollY));for(let e=0,t=S.length;e<t;e++){let t=S[e],n=t.dataset.layoutId,r=m.nodes.get(n),i=h.nodes.get(n),a=r.properties,o=i.properties,s=!1,c={composition:`none`};a.width!==o.width&&(c.width=[a.width,o.width],s=!0),a.height!==o.height&&(c.height=[a.height,o.height],s=!0),!i.hasTransform&&!i.isInlined&&(c.translate=[`${a.x}px ${a.y}px`,`${o.x}px ${o.y}px`],s=!0),this.properties.forEach(e=>{let t=a[e],n=o[e];e!==`transform`&&t!==n&&(c[e]=[t,n],s=!0)}),s&&this.timeline.add(t,c,0)}}if(_.length){for(let e=0,t=_.length;e<t;e++){let t=_[e],n=m.getNode(t),r=n.properties;t.style.width=`${r.width}px`,t.style.height=`${r.height}px`,t.style.minWidth=`auto`,t.style.minHeight=`auto`,t.style.maxWidth=`none`,t.style.maxHeight=`none`,n.isInlined||(t.style.translate=`${r.x}px ${r.y}px`),this.properties.forEach(e=>{e!==`transform`&&(t.style[e]=`${m.getComputedValue(t,e)}`)})}for(let e=0,t=_.length;e<t;e++){let t=_[e],n=h.getNode(t),r=n.properties;this.timeline.call(()=>{t.style.width=`${r.width}px`,t.style.height=`${r.height}px`,t.style.minWidth=`auto`,t.style.minHeight=`auto`,t.style.maxWidth=`none`,t.style.maxHeight=`none`,n.isInlined||(t.style.translate=`${r.x}px ${r.y}px`),this.properties.forEach(e=>{e!==`transform`&&(t.style[e]=`${h.getComputedValue(t,e)}`)})},n.delay+n.duration/2)}if(w.length){let e=Lh(h.nodes.get(w[0].dataset.layoutId).ease),t=t=>1-e(1-t),n={};if(c)for(let e in c)e!==`transform`&&(n[e]=[{from:t=>m.getComputedValue(t,e),to:c[e]},{from:c[e],to:t=>h.getComputedValue(t,e),ease:t}]);this.timeline.add(w,n,0)}}let j=C.length;if(j){for(let e=0;e<j;e++){let t=C[e],n=h.getNode(t);n.isInlined||(t.style.translate=`${m.getComputedValue(t,`x`)}px ${m.getComputedValue(t,`y`)}px`),t.style.transform=m.getComputedValue(t,`transform`),w.includes(t)&&(n.ease=Rm(a.ease,t,n.index,n.targets,null,null),n.duration=Rm(a.duration,t,n.index,n.targets,null,null))}this.transformAnimation=yg.animate(C,{translate:e=>h.getNode(e).isInlined?`0px 0px`:`${h.getComputedValue(e,`x`)}px ${h.getComputedValue(e,`y`)}px`,transform:e=>{let t=h.getComputedValue(e,`transform`);if(!w.includes(e))return t;let n=m.getComputedValue(e,`transform`),r=h.getNode(e);return[n,Rm(c.transform,e,r.index,r.targets,null,null),t]},autoplay:!1,...A}),this.timeline.sync(this.transformAnimation,0)}return this.timeline.init()}update(e,t={}){return this.record(),e(this),this.animate(t)}},Vg=(e,t)=>new Bg(e,t);function Hg(e,t,n,r){return{id:t,kind:e,svg:`<svg xmlns="http://www.w3.org/2000/svg" width="128" height="128" viewBox="0 0 128 128"><rect width="128" height="128" rx="32" fill="${n}"/>${r}</svg>`}}function Ug(e,t,n,r,i){return Hg(`user`,e,t,`<circle cx="64" cy="64" r="44" fill="${n}" opacity=".18"/><circle cx="64" cy="${r}" r="${i}" fill="${n}"/><path d="M28 108c5-24 18-36 36-36s31 12 36 36" fill="${n}"/>`)}function Wg(e,t,n,r,i){return Hg(`bot`,e,t,`<path d="${i}" stroke="${n}" stroke-width="7" stroke-linecap="round"/><rect x="24" y="32" width="80" height="68" rx="22" fill="${n}"/><circle cx="49" cy="62" r="8" fill="${r}"/><circle cx="79" cy="62" r="8" fill="${r}"/><path d="M45 82h38" stroke="${r}" stroke-width="7" stroke-linecap="round"/>`)}function Gg(e,t,n,r,i){return Hg(`group`,e,t,`<circle cx="46" cy="50" r="16" fill="${n}"/><circle cx="82" cy="50" r="16" fill="${r}"/><circle cx="64" cy="42" r="18" fill="${n}"/><path d="M17 105c3-20 14-30 29-30 8 0 14 2 18 7 4-5 10-7 18-7 15 0 26 10 29 30" fill="${r}"/><path d="M33 ${108-i%3*2}c4-25 15-37 31-37s27 12 31 37" fill="${n}"/>`)}var Kg={user:[Ug(`sunny`,`#f59e0b`,`#fff7ed`,54,20),Ug(`mint`,`#10b981`,`#ecfdf5`,50,19),Ug(`ocean`,`#0ea5e9`,`#f0f9ff`,52,20),Ug(`violet`,`#8b5cf6`,`#f5f3ff`,51,19),Ug(`rose`,`#f43f5e`,`#fff1f2`,53,20),Ug(`slate`,`#475569`,`#f8fafc`,50,18),Ug(`coral`,`#f97316`,`#fff7ed`,52,19),Ug(`indigo`,`#4f46e5`,`#eef2ff`,51,20)],bot:[Wg(`cobalt`,`#1d4ed8`,`#dbeafe`,`#1e3a8a`,`M64 32V18M64 18l10-8`),Wg(`cyan`,`#0891b2`,`#cffafe`,`#155e75`,`M64 32V16M55 12h18`),Wg(`emerald`,`#059669`,`#d1fae5`,`#065f46`,`M64 32V17M64 17l-9-7`),Wg(`amber`,`#d97706`,`#fef3c7`,`#92400e`,`M64 32V15M64 15h12`),Wg(`magenta`,`#c026d3`,`#fae8ff`,`#86198f`,`M64 32V18M54 12l10 6`),Wg(`crimson`,`#dc2626`,`#fee2e2`,`#991b1b`,`M64 32V16M58 10h12`),Wg(`navy`,`#334155`,`#e2e8f0`,`#0f172a`,`M64 32V17M64 17l8-7`),Wg(`lime`,`#65a30d`,`#ecfccb`,`#3f6212`,`M64 32V16M54 9l10 7`)],group:[Gg(`harbor`,`#0f766e`,`#ccfbf1`,`#5eead4`,0),Gg(`sky`,`#0369a1`,`#e0f2fe`,`#7dd3fc`,1),Gg(`grape`,`#7e22ce`,`#f3e8ff`,`#d8b4fe`,2),Gg(`cherry`,`#be123c`,`#ffe4e6`,`#fda4af`,3),Gg(`forest`,`#15803d`,`#dcfce7`,`#86efac`,4),Gg(`sunset`,`#c2410c`,`#ffedd5`,`#fdba74`,5),Gg(`night`,`#3730a3`,`#e0e7ff`,`#a5b4fc`,6),Gg(`stone`,`#44403c`,`#f5f5f4`,`#d6d3d1`,7)]};function qg(e){let t=new TextEncoder().encode(e.svg),n=``;for(let e of t)n+=String.fromCharCode(e);return`data:image/svg+xml;base64,${btoa(n)}`}function Jg({kind:e,onBack:t,onSelect:n}){let r=q();return x(`section`,{className:`flex flex-col gap-4`,"aria-label":r(`sandbox.avatar.title`),children:[x(`header`,{className:`flex items-start gap-2`,children:[b(W,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":r(`sandbox.avatar.back`),onClick:t,children:b(fd,{})}),x(`div`,{className:`flex flex-col gap-1`,children:[b(`strong`,{className:`text-sm font-medium`,children:r(`sandbox.avatar.title`)}),b(`p`,{className:`text-xs text-muted-foreground`,children:r(`sandbox.avatar.description`)})]})]}),b(Yg,{kind:e,onSelect:n})]})}function Yg({kind:t,onSelect:n}){let r=q(),[i,a]=e.useState(``),o=e.useRef(null);return x(`div`,{className:`flex flex-col gap-4`,children:[b(`div`,{className:`grid grid-cols-4 gap-2`,children:Kg[t].map(e=>b(`button`,{type:`button`,className:`aspect-square overflow-hidden rounded-full ring-1 ring-border transition-transform duration-150 ease-spring hover:scale-105 focus-visible:outline-2 focus-visible:outline-ring`,"aria-label":r(`sandbox.avatar.builtin`,{id:e.id}),onClick:()=>n(qg(e)),children:b(`img`,{src:qg(e),alt:``,className:`size-full`})},e.id))}),b(`input`,{ref:o,type:`file`,className:`hidden`,accept:`image/png,image/jpeg,image/webp,image/gif,image/svg+xml`,onChange:e=>{let t=e.target.files?.[0];if(e.target.value=``,!t)return;if(!t.type.startsWith(`image/`))return a(r(`sandbox.avatar.notImage`));let i=new FileReader;i.addEventListener(`load`,()=>{typeof i.result==`string`&&(a(``),n(i.result))}),i.addEventListener(`error`,()=>a(r(`sandbox.avatar.readFailed`))),i.readAsDataURL(t)}}),x(`button`,{type:`button`,className:`flex items-center gap-3 rounded-lg border border-border px-3 py-2 text-left transition-colors hover:bg-accent`,onClick:()=>o.current?.click(),children:[b(`span`,{className:`flex size-8 items-center justify-center rounded-md bg-muted`,children:b(pf,{className:`size-4`})}),x(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[b(`strong`,{className:`text-[13px] font-medium`,children:r(`sandbox.avatar.upload`)}),b(`small`,{className:`text-xs text-muted-foreground`,children:r(`sandbox.avatar.uploadHint`)})]}),b(Dd,{className:`size-4 text-muted-foreground`})]}),i&&b(`p`,{role:`alert`,className:`text-xs text-destructive`,children:i})]})}var Xg=[{value:`napcat`,label:`NapCat`},{value:`llbot`,label:`LLBot`},{value:`snowluma`,label:`SnowLuma`}];function Zg(e){return Xg.find(t=>t.value===e)?.label??e}function Qg({type:t,operator:n,bots:r=[],side:i=`right`,trigger:a,onOpenChange:o}){let s=q(),{store:c}=Zu(),[l,u]=e.useState(!1),[d,f]=e.useState(!1),[p,m]=e.useState(``),[h,g]=e.useState(!1),[_,v]=e.useState(`user`),[S,C]=e.useState(`napcat`),[w,T]=e.useState(!0),[E,D]=e.useState({id:``,name:``,avatar:``,personalNote:``}),O=t===`participant`?_:t,k=!!n&&r.length>0,A=e=>{u(e),o?.(e),e&&(m(``),g(!1),D({id:``,name:``,avatar:``,personalNote:``}),v(`user`),C(`napcat`),T(!0))},j=()=>{let e=E.personalNote.trim()?{personalNote:E.personalNote.trim()}:void 0,t=E.avatar?{avatar:E.avatar}:{};if(O===`user`)return{action:`create-user`,data:{id:E.id,name:E.name,...t,...e?{profile:e}:{}}};if(O===`bot`)return{action:`create-bot`,data:{id:E.id,name:E.name,implementation:S,enabled:w,...t,...e?{profile:e}:{}}};if(!(!n||!r.length))return{action:`create-group`,data:{id:E.id,name:E.name,...t,members:[{participantId:n.id,card:n.name,role:`owner`},...r.filter(({id:e})=>e!==n.id).map(e=>({participantId:e.id,card:e.name,role:`member`}))]}}},M=async e=>{if(e.preventDefault(),d)return;let t=j();if(t){f(!0),m(``);try{await c.manageEnvironment(t),A(!1)}catch(e){m(Vu(e,s(`sandbox.create.failed`)))}finally{f(!1)}}},N=s(t===`participant`?`sandbox.create.participant`:`sandbox.create.${t}`),ee=O===`user`?s(`sandbox.create.userHint`):O===`bot`?s(`sandbox.create.botHint`):n?r.length?s(`sandbox.create.groupHint`,{name:n.name}):s(`sandbox.create.groupNoBot`):s(`sandbox.create.groupNoOperator`);return x(Pn,{open:l,onOpenChange:A,children:[b(Fn,{render:a}),b(In,{side:i,align:`start`,className:`sandbox-glass w-80 gap-4 p-4`,"aria-label":N,children:h?b(Jg,{kind:O,onBack:()=>g(!1),onSelect:e=>{D(t=>({...t,avatar:e})),g(!1)}}):x(`form`,{className:`flex flex-col gap-4`,onSubmit:M,children:[x(`div`,{className:`flex items-center gap-3`,children:[x(`button`,{type:`button`,className:`group relative rounded-full`,"aria-label":s(`sandbox.avatar.title`),onClick:()=>g(!0),children:[b(lp,{kind:O,name:E.name,src:E.avatar,className:`size-12`,badge:!1}),b(`span`,{className:`absolute inset-0 flex items-center justify-center rounded-full bg-black/45 text-[10px] text-white opacity-0 transition-opacity group-hover:opacity-100`,children:s(`sandbox.avatar.change`)})]}),x(`header`,{className:`flex min-w-0 flex-col gap-1`,children:[b(`strong`,{className:`text-sm font-medium`,children:N}),b(`p`,{className:`text-xs leading-5 text-muted-foreground`,children:ee})]})]}),t===`participant`&&x(`div`,{className:`flex flex-col gap-2`,children:[b(bs,{children:s(`sandbox.create.accountType`)}),x(Cs,{value:_,onValueChange:e=>e&&v(e===`bot`?`bot`:`user`),items:[{value:`user`,label:s(`sandbox.kind.user`)},{value:`bot`,label:s(`sandbox.kind.bot`)}],children:[b(Ts,{className:`w-full`,children:b(ws,{})}),x(Es,{className:`sandbox-glass`,children:[b(Ds,{value:`user`,children:s(`sandbox.kind.user`)}),b(Ds,{value:`bot`,children:s(`sandbox.kind.bot`)})]})]})]}),x(`div`,{className:`flex flex-col gap-2`,children:[b(bs,{htmlFor:`sandbox-create-id`,children:s(O===`group`?`sandbox.field.groupId`:`sandbox.field.qqId`)}),b(Tn,{id:`sandbox-create-id`,inputMode:`numeric`,pattern:`[0-9]+`,required:!0,value:E.id,onChange:e=>D(t=>({...t,id:e.target.value}))})]}),x(`div`,{className:`flex flex-col gap-2`,children:[b(bs,{htmlFor:`sandbox-create-name`,children:s(`sandbox.field.name.${O}`)}),b(Tn,{id:`sandbox-create-name`,required:!0,value:E.name,onChange:e=>D(t=>({...t,name:e.target.value}))})]}),O!==`group`&&x(`div`,{className:`flex flex-col gap-2`,children:[b(bs,{htmlFor:`sandbox-create-note`,children:s(`sandbox.field.personalNote`)}),b(Tn,{id:`sandbox-create-note`,placeholder:s(`sandbox.field.optional`),value:E.personalNote,onChange:e=>D(t=>({...t,personalNote:e.target.value}))})]}),O===`bot`&&x(y,{children:[b($g,{value:S,onChange:C}),x(`label`,{className:`flex items-center gap-2 text-[13px]`,children:[b(cs,{checked:w,onCheckedChange:e=>T(e===!0)}),s(`sandbox.field.botEnabled`)]})]}),p&&b(`p`,{role:`alert`,className:`text-xs text-destructive`,children:p}),b(W,{type:`submit`,disabled:d||O===`group`&&!k,children:s(d?`sandbox.create.busy`:`sandbox.create.${O}`)})]})})]})}function $g({value:e,onChange:t}){let n=q();return x(`div`,{className:`flex flex-col gap-2`,children:[b(bs,{children:n(`sandbox.field.implementation`)}),x(Cs,{value:e,onValueChange:e=>{let n=Xg.find(({value:t})=>t===e);n&&t(n.value)},items:Xg,children:[b(Ts,{className:`w-full`,children:b(ws,{})}),b(Es,{className:`sandbox-glass`,children:Xg.map(({value:e,label:t})=>b(Ds,{value:e,children:t},e))})]})]})}function e_(){return{tokens:[{type:`text`,text:``}],tokenIndex:0,offset:0}}function t_(e){return!e.some(e=>e.type===`mention`||!!e.text.trim())}function n_(e){return e.map(e=>e.type===`mention`?`<at id="${e.id}"/>`:e.text.replace(/ /g,` `)).join(``).trim()}function r_(e){let t=[];for(let n of e)if(n.type===`mention`)t.push({...n});else{let e=n.text.replace(//g,``),r=t.at(-1);r?.type===`text`?r.text+=e:t.push({type:`text`,text:e})}if(!t.length)return[{type:`text`,text:``}];let n=[];return t.forEach((e,r)=>{n.push(e),e.type===`mention`&&(!t[r+1]||t[r+1].type===`mention`)&&n.push({type:`text`,text:``})}),n[0]?.type===`mention`&&n.unshift({type:`text`,text:``}),n}function i_(e,t,n){let r=Math.min(Math.max(t,0),Math.max(0,e.length-1));if(e[r]?.type!==`text`&&(r=e.findIndex(e=>e.type===`text`)),r<0)return e_();let i=e[r],a=i?.type===`text`?i.text:``;return{tokens:[...e],tokenIndex:r,offset:Math.min(Math.max(n,0),a.length)}}function a_(e,t,n,r){return o_(e,t,n,n,r)}function o_(e,t,n,r,i){let a=e[t]?.type===`text`?e[t].text:``,o=Math.max(0,Math.min(n,r,a.length)),s=Math.max(o,Math.min(Math.max(n,r),a.length)),c=a.slice(0,o),l=a.slice(s);c&&!/\s$/.test(c)&&(c+=` `);let u=l?l.startsWith(` `)?l:` ${l}`:`\xA0`,d=r_([...e.slice(0,t),...c?[{type:`text`,text:c}]:[],{type:`mention`,id:i.id,name:i.name},{type:`text`,text:u},...e.slice(t+1)]),f=d.findIndex((e,n)=>n>=t&&e.type===`mention`&&e.id===i.id)+1,p=d[f];return i_(d,f,p?.type===`text`&&/^[ ]/.test(p.text)?1:0)}function s_(e,t,n){let r=i_(r_(e),t,n),i=r.tokens[r.tokenIndex],a=r.tokens[r.tokenIndex-1];return i?.type===`text`&&r.offset===1&&i.text.startsWith(`\xA0`)&&a?.type===`mention`?i_(r_([...r.tokens.slice(0,r.tokenIndex-1),{type:`text`,text:i.text.slice(1)},...r.tokens.slice(r.tokenIndex+1)]),r.tokenIndex-1,2**53-1):i?.type===`text`&&r.offset>0?i_(r_([...r.tokens.slice(0,r.tokenIndex),{type:`text`,text:i.text.slice(0,r.offset-1)+i.text.slice(r.offset)},...r.tokens.slice(r.tokenIndex+1)]),r.tokenIndex,r.offset-1):r.tokenIndex<=0?r:a?.type===`mention`?i_(r_([...r.tokens.slice(0,r.tokenIndex-1),...r.tokens.slice(r.tokenIndex)]),r.tokenIndex-1,2**53-1):r}function c_(e,t){let n=e.slice(0,t),r=/(^|[^\s@])?@([^\s@]*)$/.exec(n);return r?{query:r[2],start:t-r[2].length-1}:null}function l_(e){return[e.name,e.id,...e.keywords??[]]}function u_(e,t){let n=t.trim().toLocaleLowerCase();return[...e].filter(e=>!n||l_(e).some(e=>e.toLocaleLowerCase().includes(n))).sort((e,t)=>{let r=l_(e).some(e=>e.toLocaleLowerCase().startsWith(n)),i=l_(t).some(e=>e.toLocaleLowerCase().startsWith(n));return Number(i)-Number(r)||e.name.localeCompare(t.name,`zh-Hans`)||e.id.localeCompare(t.id)})}function d_(e){let t=[],n=e=>{if(e.kind===`text`){t.push({type:`text`,text:e.text});return}if(e.kind===`mention`){t.push({type:`mention`,id:e.id,name:e.name});return}if(e.kind===`line-break`){t.push({type:`text`,text:`
|
|
2
|
+
`});return}e.children.forEach(n)};return e.forEach(n),r_(t)}function f_(e){let t=e.map(e=>e.type===`text`?{kind:`text`,text:e.text||``}:{kind:`mention`,id:e.id,name:e.name});return t.length?t:[{kind:`text`,text:``}]}function p_(e,t,n){let r=Math.max(0,e.length-1),i=Math.min(Math.max(t,0),r),a=e[i];return a?.type===`text`?{tokenIndex:i,offset:Math.min(Math.max(n,0),a.text.length)}:{tokenIndex:Math.min(i+1,r),offset:0}}function m_(e,t){if(t.kind===`editor`){let n=e[t.childOffset];return n?n.type===`mention`?p_(e,t.childOffset-1,2**53-1):p_(e,t.childOffset,0):p_(e,e.length-1,2**53-1)}let n=e[t.childIndex];return p_(e,t.childIndex,n?.type===`text`?t.offset:0)}function h_(e,t,n){let r=e[t];return r?r.type===`text`?{kind:`child`,childIndex:t,offset:Math.max(n,0)}:{kind:`child`,childIndex:t+1,offset:0}:{kind:`editor-end`}}function g_(e,t){let n=Math.max(t,0),r=0;for(;r<e.length&&n>0;)e[r]!==``&&--n,r+=1;for(;r<e.length&&e[r]===``;)r+=1;return r}function __(e){if(!e.hasCandidates||e.composing)return;let t=e.tokens[e.tokenIndex];if(t?.type!==`text`)return;let n=c_(t.text,e.offset);if(n)return{tokenIndex:e.tokenIndex,start:n.start,query:n.query}}function v_(e,t,n){return n!==0||e[t]?.type!==`text`?!1:e[t-1]?.type===`mention`}function y_(e,t){let n=e[t-2];return{tokens:s_(e,t,0).tokens,tokenIndex:Math.max(0,t-2),offset:n?.type===`text`?n.text.length:0}}function b_(e){if(e.disabled)return{kind:`blocked`};if(e.menuOpen){if(e.key===`ArrowDown`)return{kind:`move-candidate`,delta:1};if(e.key===`ArrowUp`)return{kind:`move-candidate`,delta:-1};if(e.key===`Enter`||e.key===`Tab`)return{kind:`select-candidate`};if(e.key===`Escape`)return{kind:`close-menu`}}return e.key===`Enter`&&!e.shiftKey&&!e.composing?{kind:`submit`}:e.key===`Backspace`&&e.mentionBoundary&&!e.composing?{kind:`delete-mention`}:{kind:`none`}}function x_(e){return{ref:t=>{let n=t;return{get value(){return n},set value(t){Object.is(t,n)||(n=t,e())}}},computed:e=>({get value(){return e()}})}}function S_(e,t=()=>{}){let{ref:n,computed:r}=x_(t),i=n(e_()),a=n(!1),o=r(()=>!a.value&&t_(i.value.tokens)),s=n(void 0),c=n(0),l=r(()=>!!s.value&&e.readMentionCandidates().length>0),u=r(()=>s.value?u_(e.readMentionCandidates(),s.value.query):[]),d=r(()=>Math.min(Math.max(c.value,0),Math.max(0,u.value.length-1))),f=!1;function p(){s.value=void 0,c.value=0}function m(){let t=i.value,n=__({tokens:t.tokens,tokenIndex:t.tokenIndex,offset:t.offset,composing:a.value,hasCandidates:e.readMentionCandidates().length>0});if(!n){p();return}s.value=n,c.value=0}function h(){f=!0,e.renderNodes(f_(i.value.tokens)),f=!1}function g(t,n={}){i.value={tokens:r_(t.tokens),tokenIndex:t.tokenIndex,offset:t.offset},h(),n.focus!==!1&&e.nextTick().then(_)}function _(){e.focus();let t=i.value;e.writeCaret(h_(t.tokens,t.tokenIndex,t.offset))}function v(){g(e_(),{focus:!1}),p()}function y(t){let n=e.readCaret();if(n)return m_(t,n)}function b(){let e=y(i.value.tokens);e&&(i.value={...i.value,...e})}async function x(){if(f)return;if(a.value){p();return}await e.nextTick();let t=e.readNodes();if(!t)return;let n=d_(t),r=y(n);i.value={tokens:n,tokenIndex:r?.tokenIndex??i.value.tokenIndex,offset:r?.offset??i.value.offset},m()}function S(){a.value=!0}async function C(){a.value=!1,await x()}function w(e){b();let t=i.value,n=t.tokens[t.tokenIndex]?.type===`text`?t.offset:0;g(a_(t.tokens,t.tokenIndex,n,e)),p()}function T(e){let t=s.value;if(!t)return;let n=i.value.tokens[t.tokenIndex]?.type===`text`?i.value.offset:t.start;g(o_(i.value.tokens,t.tokenIndex,t.start,Math.max(t.start,n),{id:e.id,name:e.name})),p()}function E(e){let t=u.value.length;t&&(c.value=(d.value+e+t)%t)}function D(e){let t=i.value,n=b_({key:e.key,shiftKey:e.shiftKey,disabled:e.disabled,composing:a.value,menuOpen:l.value,mentionBoundary:v_(t.tokens,t.tokenIndex,t.offset)});if(n.kind===`move-candidate`&&E(n.delta),n.kind===`close-menu`&&p(),n.kind===`select-candidate`){let e=u.value[d.value];e&&T(e)}return n.kind===`delete-mention`&&g(y_(t.tokens,t.tokenIndex)),n}function O(){return n_(i.value.tokens)}return{draft:i,composing:a,isEmpty:o,mentionMenuOpen:l,mentionCandidates:u,mentionMenuIndex:d,render:h,apply:g,reset:v,syncCaretFromHost:b,handleInput:x,startComposition:S,endComposition:C,insertMention:w,selectMentionCandidate:T,closeMentionMenu:p,setMentionSelection:e=>{c.value=e},routeKey:D,serialize:O,focus:_}}function C_(e,t){let n=e.findIndex(({id:e})=>e===t);return n>0?[e[n],...e.slice(0,n),...e.slice(n+1)]:e}function w_(e,t=!1){let n=Math.min(e,t?1:3),r=Math.max(0,e-n);return{collapsedVisibleCount:n,overflowCount:r,collapsedWidth:36+Math.max(0,n-1)*21+(r?21:0),expandedWidth:36+Math.max(0,e-1)*27}}function T_(e,t=!1){let n=w_(e,t),r=n.overflowCount?n.collapsedWidth-36:e*21,i=e*27;return{collapsedWidth:n.overflowCount?n.collapsedWidth:36+r,expandedWidth:36+i,addCollapsedRight:r,addExpandedRight:i}}function E_(){let e=q();return x(jn,{children:[b(Mn,{render:b(`span`,{className:`ml-auto inline-flex text-muted-foreground`,"aria-label":e(`sandbox.extension.description`)}),children:b(zd,{className:`size-3.5`})}),b(Nn,{side:`right`,children:e(`sandbox.extension.description`)})]})}var D_=10485760,O_=88,k_=100,A_=`image/png,image/jpeg,image/gif,image/webp,audio/*,video/mp4,video/webm,video/quicktime,.txt,.csv,.json,.pdf,.zip,.doc,.docx,.xls,.xlsx,.ppt,.pptx`;function j_(e){let t=e.lastIndexOf(`.`);return t<=0?{baseName:e,extension:``}:{baseName:e.slice(0,t),extension:e.slice(t)}}function M_(e){return new Promise((t,n)=>{let r=new FileReader;r.addEventListener(`load`,()=>t(typeof r.result==`string`?r.result:``)),r.addEventListener(`error`,()=>n(r.error??Error(`unreadable`))),r.readAsDataURL(e)})}var N_=e.forwardRef(function({replyingTo:t,mentionCandidates:n,onClearReply:r,onSend:i,onOpenImage:a,onSpaceChange:o},s){let c=q(),{store:l,dialogs:u}=Zu(),{conversation:d,operatorId:f,snapshot:p,resolveAvatar:m}=Qu(),h=e.useRef(null),g=e.useRef(null),[,_]=e.useReducer(e=>e+1,0),[v,y]=e.useState([]),[S,C]=e.useState(!1),[w,T]=e.useState(``),[E,D]=e.useState(!1),[O,k]=e.useState(`idle`),[A,j]=e.useState(!1),M=e.useRef(null),N=e.useRef(null),ee=e.useRef(null),te=e.useRef(null),P=e.useRef(void 0),F=e.useRef(void 0),ne=e.useRef(0),re=e.useRef({}),I=e.useRef({hovered:!1,focused:!1,creating:!1,suppress:!1}),L=e.useRef({hasOverflow:!1,expanded:!1}),ie=e.useRef(n);ie.current=n;let ae=e.useRef({conversationId:d?.id,operatorId:f});ae.current={conversationId:d?.id,operatorId:f};let R=e.useMemo(()=>S_({readNodes:()=>{let e=h.current;if(!e)return;let t=e=>e.nodeType===Node.TEXT_NODE?{kind:`text`,text:e.textContent??``}:e instanceof HTMLElement?e.dataset.mentionId?{kind:`mention`,id:e.dataset.mentionId,name:e.dataset.mentionName||e.textContent?.replace(/^@/,``)||e.dataset.mentionId}:e.tagName===`BR`?{kind:`line-break`}:{kind:`container`,children:Array.from(e.childNodes).map(t)}:{kind:`container`,children:[]};return Array.from(e.childNodes).map(t)},renderNodes:e=>{let t=h.current;if(t){t.replaceChildren();for(let n of e){if(n.kind===`text`){t.appendChild(document.createTextNode(n.text));continue}let e=document.createElement(`span`);e.className=`sandbox-composer-mention`,e.contentEditable=`false`,e.dataset.mentionId=n.id,e.dataset.mentionName=n.name,e.textContent=`@${n.name}`,t.appendChild(e)}}},readCaret:()=>{let e=h.current,t=window.getSelection();if(!e||!t||t.rangeCount===0)return;let n=t.getRangeAt(0);if(!e.contains(n.startContainer))return;if(n.startContainer===e)return{kind:`editor`,childOffset:n.startOffset};let r=0;for(let t of Array.from(e.childNodes)){if(t===n.startContainer||t.contains(n.startContainer))return{kind:`child`,childIndex:r,offset:n.startOffset};(t.nodeType===Node.TEXT_NODE||t instanceof HTMLElement&&t.dataset.mentionId)&&(r+=1)}return{kind:`editor`,childOffset:e.childNodes.length}},writeCaret:e=>{let t=h.current,n=window.getSelection();if(!t||!n)return;let r=t,i=t.childNodes.length;if(e.kind===`child`){let n=t.childNodes[e.childIndex];n&&(r=n,i=g_(n.textContent??``,e.offset))}try{let e=document.createRange();e.setStart(r,i),e.collapse(!0),n.removeAllRanges(),n.addRange(e)}catch{}},nextTick:()=>new Promise(e=>requestAnimationFrame(()=>e())),focus:()=>h.current?.focus(),readMentionCandidates:()=>ie.current},_),[]);e.useImperativeHandle(s,()=>({focus:()=>R.focus(),insertMention:e=>R.insertMention(e)}),[R]),e.useEffect(()=>{R.render()},[R]),e.useEffect(()=>{R.reset(),T(``),y(e=>{for(let t of e)t.previewUrl&&URL.revokeObjectURL(t.previewUrl);return[]})},[d?.id,f,R]),e.useEffect(()=>()=>{y(e=>{for(let t of e)t.previewUrl&&URL.revokeObjectURL(t.previewUrl);return e})},[]);let z=e=>{let t=[],n=!1;for(let r of e){if(r.size>D_){n=!0;continue}t.push({id:`${r.name}:${r.size}:${r.lastModified}:${Math.random().toString(36).slice(2,8)}`,file:r,previewUrl:r.type.startsWith(`image/`)?URL.createObjectURL(r):void 0,...j_(r.name)})}n&&T(c(`sandbox.composer.oversize`)),t.length&&y(e=>[...e,...t])},oe=e=>y(t=>t.filter(t=>t.id!==e||(t.previewUrl&&URL.revokeObjectURL(t.previewUrl),!1))),se=S||!d,ce=async()=>{R.closeMentionMenu();let e=R.serialize(),n={...ae.current};if(!(S||R.composing.value||!e&&!v.length||!n.conversationId||!n.operatorId)){C(!0),T(``);try{let a=v.length?await Promise.all(v.map(async({file:e})=>{let t=await M_(e);return{fileName:e.name,mimeType:e.type,dataBase64:t.slice(t.indexOf(`,`)+1)}})):void 0;await i({conversationId:n.conversationId,content:e,replyToMessageId:t?.id,media:a}),R.reset();for(let e of v)e.previewUrl&&URL.revokeObjectURL(e.previewUrl);y([]),r()}catch(e){T(Vu(e,c(`sandbox.composer.failed`)))}finally{le.current=n,C(!1)}}},le=e.useRef(void 0);e.useLayoutEffect(()=>{let e=le.current;if(S||!e||(le.current=void 0,ae.current.conversationId!==e.conversationId||ae.current.operatorId!==e.operatorId))return;let t=h.current;if(!t)return;t.focus();let n=document.createRange();n.selectNodeContents(t),n.collapse(!1);let r=window.getSelection();r?.removeAllRanges(),r?.addRange(n)},[S]);let ue=C_(p.participants.map(e=>({...e,avatar:m(e.avatar)})),f),de=w_(ue.length,A),fe=T_(ue.length,A),pe=de.overflowCount>0,me=E&&pe,he=me||!pe,ge=ue[de.collapsedVisibleCount],_e=e=>pe&&e>=de.collapsedVisibleCount,ve=e=>!me&&_e(e);L.current={hasOverflow:pe,expanded:me};let ye=e=>{!L.current.hasOverflow||L.current.expanded===e||(k(e?`expanding`:`collapsing`),clearTimeout(re.current.motion),re.current.motion=setTimeout(()=>k(`idle`),280),L.current.expanded=e,D(e),ne.current=performance.now()+180)},be=()=>{I.current.suppress||ye(I.current.hovered||I.current.focused||I.current.creating)};e.useEffect(()=>{pe||D(!1)},[pe]);let xe=()=>(!P.current&&te.current&&(P.current=Vg(te.current,{children:[`.sandbox-composer-user-capsule`,`.sandbox-composer-user-stack`,`.sandbox-composer-user-switch`,`.sandbox-composer-user-overflow`,`.sandbox-composer-user-add`]})),P.current?.record(),P.current);e.useLayoutEffect(()=>{let e=F.current;e&&(F.current=void 0,e.animate({duration:260,ease:`out(3)`}))},[f]),e.useEffect(()=>()=>{P.current?.revert(),clearTimeout(re.current.motion),clearTimeout(re.current.suppress)},[]);let Se=async e=>{if(e===f)return;I.current.suppress=!0,clearTimeout(re.current.suppress);let t=ne.current-performance.now();t>0&&await new Promise(e=>setTimeout(e,t)),F.current=xe();try{await l.selectOperator(e),T(``)}catch(e){F.current=void 0,T(Vu(e,c(`sandbox.composer.switchFailed`)))}finally{re.current.suppress=setTimeout(()=>{I.current.suppress=!1,I.current.focused=!!M.current?.contains(document.activeElement),be()},280)}},Ce=ue.length;e.useLayoutEffect(()=>{let e=N.current;if(!e||typeof ResizeObserver>`u`)return;let t=()=>{let t=T_(Ce).collapsedWidth;j(e.clientWidth<t+O_+k_);let n=e.offsetHeight,r=ee.current?ee.current.offsetHeight+8:0;o?.(n+r+28)},n=new ResizeObserver(t);return n.observe(e),ee.current&&n.observe(ee.current),t(),()=>n.disconnect()},[Ce,!!t,v.length,o]);let we=Math.max(0,fe.collapsedWidth-36),Te=he?Math.max(0,fe.expandedWidth-fe.collapsedWidth):0,Ee=me||O===`expanding`,De=e=>e,Oe=R.mentionMenuOpen.value,ke=R.mentionCandidates.value,Ae=R.mentionMenuIndex.value;return b(`div`,{ref:M,className:`sandbox-composer-layout-root`,children:x(`form`,{ref:N,className:`sandbox-composer`,style:De({width:`${460+we}px`,"--sandbox-composer-visual-extension":`${Te}px`}),onSubmit:e=>{e.preventDefault(),ce()},children:[w&&b(`span`,{role:`alert`,className:`sandbox-composer-error`,children:w}),(t||v.length>0)&&x(`div`,{ref:ee,className:`sandbox-composer-context`,children:[t&&x(`div`,{className:`sandbox-composer-reply`,children:[b(`span`,{children:c(`sandbox.composer.replyTo`,{name:t.authorName,content:t.content})}),b(`button`,{type:`button`,"aria-label":c(`sandbox.composer.clearReply`),onClick:r,children:b(yf,{className:`size-[15px]`,"aria-hidden":!0})})]}),v.map(e=>e.previewUrl?x(`span`,{className:`sandbox-composer-attachment-image`,children:[b(`button`,{type:`button`,className:`sandbox-composer-attachment-preview`,"aria-label":c(`sandbox.composer.preview`,{name:e.file.name}),onClick:()=>a?.(e.previewUrl),children:b(`img`,{src:e.previewUrl,alt:e.file.name})}),b(`button`,{type:`button`,className:`sandbox-composer-attachment-remove`,"aria-label":c(`sandbox.composer.remove`,{name:e.file.name}),onClick:()=>oe(e.id),children:b(yf,{className:`size-3`,"aria-hidden":!0})})]},e.id):x(`span`,{className:`sandbox-composer-attachment-file`,children:[b(Rd,{className:`size-3.5`,strokeWidth:2,"aria-hidden":!0}),x(`span`,{className:`sandbox-composer-attachment-name`,children:[b(`span`,{className:`sandbox-composer-attachment-base`,children:e.baseName}),b(`span`,{children:e.extension})]}),b(`button`,{type:`button`,"aria-label":c(`sandbox.composer.remove`,{name:e.file.name}),onClick:()=>oe(e.id),children:b(yf,{className:`size-3.5`,"aria-hidden":!0})})]},e.id))]}),b(`div`,{ref:te,className:`sandbox-composer-user-layout-root`,style:De({"--sandbox-user-layout-width":`${fe.collapsedWidth}px`}),children:b(`div`,{className:U(`sandbox-composer-user-capsule`,he&&`is-expanded`),style:De({"--sandbox-user-capsule-collapsed-width":`${fe.collapsedWidth}px`,"--sandbox-user-capsule-expanded-width":`${fe.expandedWidth}px`}),onPointerEnter:()=>{I.current.hovered=!0,be()},onPointerLeave:()=>{I.current.hovered=!1,be()},onFocus:()=>{I.current.focused=!0,be()},onBlur:e=>{I.current.focused=e.relatedTarget instanceof Node&&e.currentTarget.contains(e.relatedTarget),be()},children:x(`div`,{className:U(`sandbox-composer-user-stack`,he&&`is-expanded`,O===`expanding`&&`is-overflow-expanding`,O===`collapsing`&&`is-overflow-collapsing`),style:De({"--sandbox-user-stack-collapsed-width":`${fe.collapsedWidth}px`,"--sandbox-user-stack-expanded-width":`${fe.expandedWidth}px`}),children:[ue.map((e,t)=>{let n=e.id===f,r=e.kind===`bot`?`${e.name}(${c(`sandbox.kind.bot`)})`:e.name;return x(jn,{children:[b(Mn,{render:b(`span`,{className:U(`sandbox-composer-user-switch`,t>0&&`is-overlapped`,_e(t)&&`is-collapsed-extra`),"aria-hidden":ve(t)||void 0,style:De({"--sandbox-user-collapsed-right":`${(_e(t)?de.collapsedVisibleCount:t)*21}px`,"--sandbox-user-expanded-right":`${t*27}px`,zIndex:ue.length-t})}),children:x(ps,{children:[b(ms,{render:b(`button`,{type:`button`,className:`sandbox-composer-user-button`,"aria-pressed":n,"aria-label":c(n?`sandbox.composer.currentSender`:`sandbox.composer.switchSender`,{name:r}),tabIndex:ve(t)?-1:void 0,onClick:()=>void Se(e.id)}),children:b(lp,{kind:e.kind,name:e.name,src:e.avatar,badge:!1,className:`sandbox-composer-user-avatar`})}),x(hs,{className:`sandbox-glass`,children:[x(K,{onClick:()=>u.openEntity(`edit`,{type:e.kind,id:e.id}),children:[b(Qd,{}),c(`sandbox.menu.editEntity`,{kind:c(`sandbox.kind.${e.kind}`)}),b(E_,{})]}),x(K,{variant:`destructive`,onClick:()=>u.openEntity(`delete`,{type:e.kind,id:e.id}),children:[b(df,{}),c(`sandbox.menu.deleteEntity`,{kind:c(`sandbox.kind.${e.kind}`)}),b(E_,{})]})]})]})}),b(Nn,{side:`top`,children:e.name})]},e.id)}),pe&&x(`span`,{className:`sandbox-composer-user-overflow`,"aria-hidden":!0,style:De({"--sandbox-user-overflow-right":`${de.collapsedVisibleCount*21}px`,"--sandbox-user-overflow-expanded-right":`${de.collapsedVisibleCount*27}px`,"--sandbox-user-overflow-z-index":`${ue.length-de.collapsedVisibleCount-+!!Ee}`}),children:[ge&&b(lp,{kind:ge.kind,name:ge.name,src:ge.avatar,badge:!1,className:`sandbox-composer-user-overflow-avatar`}),x(`span`,{className:`sandbox-composer-user-overflow-label`,children:[b(`span`,{className:`sandbox-composer-user-overflow-plus`,children:`+`}),b(`span`,{className:`sandbox-composer-user-overflow-count`,children:de.overflowCount})]})]}),b(Qg,{type:`participant`,side:`top`,onOpenChange:e=>{I.current.creating=e,be()},trigger:b(`button`,{type:`button`,className:U(`sandbox-composer-user-add`,pe&&!he&&`is-collapsed-hidden`),style:De({"--sandbox-user-add-collapsed-right":`${fe.addCollapsedRight}px`,"--sandbox-user-add-expanded-right":`${fe.addExpandedRight}px`}),"aria-label":c(`sandbox.composer.addAccount`),children:b(ef,{className:`size-[18px]`,strokeWidth:2,"aria-hidden":!0})})})]})})}),x(`div`,{className:`sandbox-composer-main`,children:[R.isEmpty.value&&b(`span`,{"aria-hidden":!0,className:`sandbox-composer-placeholder`,children:c(`sandbox.composer.placeholder`)}),b(`div`,{ref:h,role:`textbox`,"aria-multiline":`true`,"aria-label":c(`sandbox.composer.input`),"aria-disabled":se||void 0,contentEditable:!se,suppressContentEditableWarning:!0,className:`sandbox-composer-editor`,onKeyDown:e=>{let t=R.routeKey({key:e.key,shiftKey:e.shiftKey,disabled:se});t.kind!==`none`&&e.preventDefault(),t.kind===`submit`&&ce()},onInput:()=>void R.handleInput(),onCompositionStart:()=>R.startComposition(),onCompositionEnd:()=>void R.endComposition(),onPaste:e=>{let t=Array.from(e.clipboardData?.files??[]);if(t.length){e.preventDefault(),z(t);return}e.preventDefault(),document.execCommand(`insertText`,!1,e.clipboardData.getData(`text/plain`))},onMouseUp:()=>R.syncCaretFromHost(),onKeyUp:()=>R.syncCaretFromHost()}),Oe&&x(`div`,{className:`sandbox-glass absolute right-0 bottom-[calc(100%+8px)] left-0 z-30 flex max-h-[220px] flex-col gap-0.5 overflow-y-auto rounded-[14px] bg-popover p-1.5 text-popover-foreground shadow-popup ring-1 ring-border`,role:`listbox`,"aria-label":c(`sandbox.composer.mention`),children:[ke.map((e,t)=>x(`button`,{type:`button`,role:`option`,"aria-selected":t===Ae,className:U(`flex min-w-0 items-center gap-2 rounded-[10px] px-2 py-1.5 text-left hover:bg-accent`,t===Ae&&`bg-accent`),onMouseDown:t=>{t.preventDefault(),R.selectMentionCandidate(e)},onMouseEnter:()=>R.setMentionSelection(t),children:[b(lp,{kind:e.kind,name:e.name,src:e.avatar,className:`size-7`}),x(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[b(`strong`,{className:`truncate text-[13px] leading-4 font-semibold`,children:e.name}),b(`small`,{className:`truncate text-[11px] leading-[14px] text-muted-foreground`,children:e.id})]})]},e.id)),!ke.length&&b(`p`,{className:`px-2 py-2.5 text-center text-xs text-muted-foreground`,children:c(`sandbox.composer.noMention`)})]})]}),b(`input`,{ref:g,type:`file`,multiple:!0,accept:A_,className:`sr-only`,onChange:e=>{e.target.files&&z(Array.from(e.target.files)),e.target.value=``}}),b(`button`,{type:`button`,className:`sandbox-composer-action`,"aria-label":c(`sandbox.composer.attach`),disabled:se,onClick:()=>g.current?.click(),children:b(Zd,{className:`size-[19px]`,strokeWidth:2,"aria-hidden":!0})}),b(`button`,{type:`submit`,className:`sandbox-composer-action is-primary`,"aria-label":c(`sandbox.composer.send`),disabled:se||R.isEmpty.value&&!v.length,children:b(of,{className:`size-[19px]`,strokeWidth:2,"aria-hidden":!0})})]})})}),P_=_e({default:()=>F_}),F_,I_=he((()=>{F_=JSON.parse(`[{"QSid":"0","QDes":"/惊讶","IQLid":"33","AQLid":"33","EMCode":"114","Input":["jingya","jy"]},{"QSid":"1","QDes":"/撇嘴","IQLid":"40","AQLid":"40","EMCode":"101","Input":["piezui","pz"]},{"QSid":"2","QDes":"/色","IQLid":"19","AQLid":"19","EMCode":"102","Input":["se"]},{"QSid":"3","QDes":"/发呆","IQLid":"43","AQLid":"43","EMCode":"103","Input":["fadai","fd"]},{"QSid":"4","QDes":"/得意","IQLid":"21","AQLid":"21","EMCode":"104","Input":["deyi","dy"]},{"QSid":"5","QDes":"/流泪","IQLid":"9","AQLid":"9","EMCode":"105","Input":["liulei","ll"]},{"QSid":"6","QDes":"/害羞","IQLid":"20","AQLid":"20","EMCode":"106","Input":["haixiu","hx"]},{"QSid":"7","QDes":"/闭嘴","IQLid":"104","AQLid":"106","EMCode":"107","Input":["bizui","bz"]},{"QSid":"8","QDes":"/睡","IQLid":"35","AQLid":"35","EMCode":"108","Input":["shui"]},{"QSid":"9","QDes":"/大哭","IQLid":"10","AQLid":"10","EMCode":"109","Input":["daku","dk"]},{"QSid":"10","QDes":"/尴尬","IQLid":"25","AQLid":"25","EMCode":"110","Input":["ganga","gg"]},{"QSid":"11","QDes":"/发怒","IQLid":"24","AQLid":"24","EMCode":"111","Input":["fanu","fn"]},{"QSid":"12","QDes":"/调皮","IQLid":"1","AQLid":"1","EMCode":"112","Input":["tiaopi","tp"]},{"QSid":"13","QDes":"/呲牙","IQLid":"0","AQLid":"0","EMCode":"113","Input":["ziya","zy"]},{"QSid":"14","QDes":"/微笑","IQLid":"23","AQLid":"23","EMCode":"100","Input":["weixiao","wx"]},{"QSid":"15","QDes":"/难过","IQLid":"32","AQLid":"32","EMCode":"115","isStatic":"1","Input":["nanguo","ng"]},{"QSid":"16","QDes":"/酷","IQLid":"12","AQLid":"12","EMCode":"116","Input":["ku"]},{"QSid":"18","QDes":"/抓狂","IQLid":"13","AQLid":"13","EMCode":"118","Input":["zhuakuang","zk"]},{"QSid":"19","QDes":"/吐","IQLid":"22","AQLid":"22","EMCode":"119","Input":["tu"]},{"QSid":"20","QDes":"/偷笑","IQLid":"3","AQLid":"3","EMCode":"120","Input":["touxiao","tx"]},{"QSid":"21","QDes":"/可爱","IQLid":"18","AQLid":"18","EMCode":"121","Input":["keai","ka"]},{"QSid":"22","QDes":"/白眼","IQLid":"30","AQLid":"30","EMCode":"122","Input":["baiyan","by"]},{"QSid":"23","QDes":"/傲慢","IQLid":"31","AQLid":"31","EMCode":"123","Input":["aoman","am"]},{"QSid":"24","QDes":"/饥饿","IQLid":"79","AQLid":"81","EMCode":"124","Input":["jie","je"]},{"QSid":"25","QDes":"/困","IQLid":"80","AQLid":"82","EMCode":"125","Input":["kun"]},{"QSid":"26","QDes":"/惊恐","IQLid":"26","AQLid":"26","EMCode":"126","Input":["jingkong","jk"]},{"QSid":"27","QDes":"/流汗","IQLid":"2","AQLid":"2","EMCode":"127","Input":["liuhan","lh"]},{"QSid":"28","QDes":"/憨笑","IQLid":"37","AQLid":"37","EMCode":"128","Input":["hanxiao","hx"]},{"QSid":"29","QDes":"/悠闲","IQLid":"50","AQLid":"50","EMCode":"129","Input":["youxian","yx"]},{"QSid":"30","QDes":"/奋斗","IQLid":"42","AQLid":"42","EMCode":"130","Input":["fendou","fd"]},{"QSid":"31","QDes":"/咒骂","IQLid":"81","AQLid":"83","EMCode":"131","Input":["zhouma","zm"]},{"QSid":"32","QDes":"/疑问","IQLid":"34","AQLid":"34","EMCode":"132","Input":["yiwen","yw"]},{"QSid":"33","QDes":"/嘘","IQLid":"11","AQLid":"11","EMCode":"133","Input":["xu"]},{"QSid":"34","QDes":"/晕","IQLid":"49","AQLid":"49","EMCode":"134","Input":["yun"]},{"QSid":"35","QDes":"/折磨","IQLid":"82","AQLid":"84","EMCode":"135","Input":["zhemo","zm"]},{"QSid":"36","QDes":"/衰","isStatic":"1","IQLid":"39","AQLid":"39","EMCode":"136","Input":["shuai"]},{"QSid":"37","QDes":"/骷髅","isStatic":"1","IQLid":"76","AQLid":"78","EMCode":"137","Input":["kulou","kl"]},{"QSid":"38","QDes":"/敲打","IQLid":"5","AQLid":"5","EMCode":"138","Input":["qiaoda","qd"]},{"QSid":"39","QDes":"/再见","IQLid":"4","AQLid":"4","EMCode":"139","Input":["zaijian","zj"]},{"QSid":"41","QDes":"/发抖","isStatic":"1","IQLid":"69","AQLid":"71","EMCode":"193","Input":["fadou","fd"]},{"QSid":"42","QDes":"/爱情","IQLid":"38","AQLid":"38","EMCode":"190","Input":["aiqing","aq"]},{"QSid":"43","QDes":"/跳跳","IQLid":"93","AQLid":"95","EMCode":"192","Input":["tiaotiao","tt"]},{"QSid":"46","QDes":"/猪头","isStatic":"1","IQLid":"7","AQLid":"7","EMCode":"162","Input":["zhutou","zt"]},{"QSid":"49","QDes":"/拥抱","IQLid":"45","AQLid":"45","EMCode":"178","Input":["yongbao","yb"]},{"QSid":"53","QDes":"/蛋糕","IQLid":"59","AQLid":"59","EMCode":"168","Input":["dangao","dg"]},{"QSid":"54","QDes":"/闪电","isStatic":"1","IQLid":"78","AQLid":"80","EMCode":"169","Input":["shandian","sd"]},{"QSid":"55","QDes":"/炸弹","isStatic":"1","IQLid":"16","AQLid":"16","EMCode":"170","Input":["zhadan","zd"]},{"QSid":"56","QDes":"/刀","IQLid":"68","AQLid":"70","EMCode":"171","Input":["dao"]},{"QSid":"57","QDes":"/足球","IQLid":"75","AQLid":"77","EMCode":"172","Input":["zuqiu","zq"]},{"QSid":"59","QDes":"/便便","IQLid":"15","AQLid":"15","EMCode":"174","Input":["bianbian","bb"]},{"QSid":"60","QDes":"/咖啡","IQLid":"66","AQLid":"66","EMCode":"160","Input":["kafei","kf"]},{"QSid":"61","QDes":"/饭","isStatic":"1","IQLid":"58","AQLid":"58","EMCode":"161","Input":["fan"]},{"QSid":"63","QDes":"/玫瑰","isStatic":"1","IQLid":"8","AQLid":"8","EMCode":"163","Input":["meigui","mg"]},{"QSid":"64","QDes":"/凋谢","isStatic":"1","IQLid":"57","AQLid":"57","EMCode":"164","Input":["diaoxie","dx"]},{"QSid":"66","QDes":"/爱心","isStatic":"1","IQLid":"28","AQLid":"28","EMCode":"166","Input":["aixin","ax"]},{"QSid":"67","QDes":"/心碎","IQLid":"72","AQLid":"74","EMCode":"167","Input":["xinsui","xs"]},{"QSid":"69","QDes":"/礼物","isStatic":"1","IQLid":"74","AQLid":"76","EMCode":"177","Input":["liwu","lw"]},{"QSid":"74","QDes":"/太阳","isStatic":"1","IQLid":"73","AQLid":"75","EMCode":"176","Input":["taiyang","ty"]},{"QSid":"75","QDes":"/月亮","isStatic":"1","IQLid":"67","AQLid":"68","EMCode":"175","Input":["yueliang","yl"]},{"QSid":"76","QDes":"/赞","IQLid":"52","AQLid":"52","EMCode":"179","Input":["zan"]},{"QSid":"77","QDes":"/踩","IQLid":"53","AQLid":"53","EMCode":"180","Input":["cai"]},{"QSid":"78","QDes":"/握手","IQLid":"54","AQLid":"54","EMCode":"181","Input":["woshou","ws"]},{"QSid":"79","QDes":"/胜利","IQLid":"55","AQLid":"55","EMCode":"182","Input":["shengli","sl"]},{"QSid":"85","QDes":"/飞吻","isStatic":"1","IQLid":"47","AQLid":"47","EMCode":"191","Input":["feiwen","fw"]},{"QSid":"86","QDes":"/怄火","IQLid":"94","AQLid":"96","EMCode":"194","Input":["ouhuo","oh"]},{"QSid":"89","QDes":"/西瓜","isStatic":"1","IQLid":"60","AQLid":"60","EMCode":"156","Input":["xigua","xg"]},{"QSid":"96","QDes":"/冷汗","IQLid":"27","AQLid":"27","EMCode":"117","Input":["lenghan","lh"]},{"QSid":"97","QDes":"/擦汗","IQLid":"6","AQLid":"6","EMCode":"140","Input":["cahan","ch"]},{"QSid":"98","QDes":"/抠鼻","IQLid":"83","AQLid":"85","EMCode":"141","Input":["koubi","kb"]},{"QSid":"99","QDes":"/鼓掌","IQLid":"84","AQLid":"86","EMCode":"142","Input":["guzhang","gz"]},{"QSid":"100","QDes":"/糗大了","IQLid":"85","AQLid":"87","EMCode":"143","Input":["qiudale","qdl"]},{"QSid":"101","QDes":"/坏笑","IQLid":"46","AQLid":"46","EMCode":"144","Input":["huaixiao","hx"]},{"QSid":"102","QDes":"/左哼哼","IQLid":"86","AQLid":"88","EMCode":"145","Input":["zuohengheng","zhh"]},{"QSid":"103","QDes":"/右哼哼","IQLid":"44","AQLid":"44","EMCode":"146","Input":["youhengheng","yhh"]},{"QSid":"104","QDes":"/哈欠","IQLid":"87","AQLid":"89","EMCode":"147","Input":["haqian","hq"]},{"QSid":"105","QDes":"/鄙视","IQLid":"48","AQLid":"48","EMCode":"148","Input":["bishi","bs"]},{"QSid":"106","QDes":"/委屈","IQLid":"14","AQLid":"14","EMCode":"149","Input":["weiqu","wq"]},{"QSid":"107","QDes":"/快哭了","IQLid":"88","AQLid":"90","EMCode":"150","Input":["kuaikule","kkl"]},{"QSid":"108","QDes":"/阴险","IQLid":"41","AQLid":"41","EMCode":"151","Input":["yinxian","yx"]},{"QSid":"109","QDes":"/左亲亲","IQLid":"36","AQLid":"36","EMCode":"152","Input":["zuoqinqin","zqq"]},{"QSid":"110","QDes":"/吓","IQLid":"89","AQLid":"91","EMCode":"153","Input":["xia"]},{"QSid":"111","QDes":"/可怜","IQLid":"51","AQLid":"51","EMCode":"154","Input":["kelian","kl"]},{"QSid":"112","QDes":"/菜刀","IQLid":"17","AQLid":"17","EMCode":"155","Input":["caidao","cd"]},{"QSid":"113","QDes":"/啤酒","IQLid":"61","AQLid":"61","EMCode":"157","Input":["pijiu","pj"]},{"QSid":"114","QDes":"/篮球","IQLid":"90","AQLid":"92","EMCode":"158","Input":["lanqiu","lq"]},{"QSid":"115","QDes":"/乒乓","IQLid":"91","AQLid":"93","EMCode":"159","Input":["pingpang","pp"]},{"QSid":"116","QDes":"/示爱","IQLid":"29","AQLid":"29","EMCode":"165","Input":["shiai","sa"]},{"QSid":"117","QDes":"/瓢虫","IQLid":"62","AQLid":"62","EMCode":"173","Input":["piaochong","pc"]},{"QSid":"118","QDes":"/抱拳","IQLid":"56","AQLid":"56","EMCode":"183","Input":["baoquan","bq"]},{"QSid":"119","QDes":"/勾引","IQLid":"63","AQLid":"63","EMCode":"184","Input":["gouyin","gy"]},{"QSid":"120","QDes":"/拳头","IQLid":"71","AQLid":"73","EMCode":"185","Input":["quantou","qt"]},{"QSid":"121","QDes":"/差劲","IQLid":"70","AQLid":"72","EMCode":"186","Input":["chajin","cj"]},{"QSid":"122","QDes":"/爱你","IQLid":"65","AQLid":"65","EMCode":"187","Input":["aini","an"]},{"QSid":"123","QDes":"/NO","IQLid":"92","AQLid":"94","EMCode":"188","Input":["NO","N"]},{"QSid":"124","QDes":"/OK","isStatic":"1","IQLid":"64","AQLid":"64","EMCode":"189","Input":["OK","O"]},{"QSid":"125","QDes":"/转圈","IQLid":"95","AQLid":"97","EMCode":"195","Input":["zhuanquan","zq"]},{"QSid":"126","QDes":"/磕头","IQLid":"96","AQLid":"98","EMCode":"196","Input":["ketou","kt"]},{"QSid":"127","QDes":"/回头","IQLid":"97","AQLid":"99","EMCode":"197","Input":["huitou","ht"]},{"QSid":"128","QDes":"/跳绳","IQLid":"98","AQLid":"100","EMCode":"198","Input":["tiaosheng","ts"]},{"QSid":"129","QDes":"/挥手","IQLid":"77","AQLid":"79","EMCode":"199","Input":["huishou","hs"]},{"QSid":"130","QDes":"/激动","IQLid":"99","AQLid":"101","EMCode":"200","Input":["jidong","jd"]},{"QSid":"131","QDes":"/街舞","IQLid":"100","AQLid":"102","EMCode":"201","Input":["jiewu","jw"]},{"QSid":"132","QDes":"/献吻","IQLid":"101","AQLid":"103","EMCode":"202","Input":["xianwen","xw"]},{"QSid":"133","QDes":"/左太极","IQLid":"102","AQLid":"104","EMCode":"203","Input":["zuotaiji","ztj"]},{"QSid":"134","QDes":"/右太极","IQLid":"103","AQLid":"105","EMCode":"204","Input":["youtaiji","ytj"]},{"QSid":"136","QDes":"/双喜","isStatic":"1","IQLid":"106","AQLid":"108","EMCode":"121001","Input":["shuangxi","sx"]},{"QSid":"137","QDes":"/鞭炮","isStatic":"1","IQLid":"107","AQLid":"109","EMCode":"121002","Input":["bianpao","bp"]},{"QSid":"138","QDes":"/灯笼","isStatic":"1","IQLid":"108","AQLid":"110","EMCode":"121003","Input":["denglong","dl"]},{"QSid":"140","QDes":"/K歌","isStatic":"1","IQLid":"110","AQLid":"112","EMCode":"121005","Input":["Kge","Kg"]},{"QSid":"144","QDes":"/喝彩","isStatic":"1","IQLid":"114","AQLid":"116","EMCode":"121009","Input":["hecai","hc"]},{"QSid":"145","QDes":"/祈祷","isStatic":"1","IQLid":"115","AQLid":"117","EMCode":"121010","Input":["qidao","qd"]},{"QSid":"146","QDes":"/爆筋","isStatic":"1","IQLid":"116","AQLid":"118","EMCode":"121011","Input":["baojin","bj"]},{"QSid":"147","QDes":"/棒棒糖","isStatic":"1","IQLid":"117","AQLid":"119","EMCode":"121012","Input":["bangbangtang","bbt"]},{"QSid":"148","QDes":"/喝奶","isStatic":"1","IQLid":"118","AQLid":"120","EMCode":"121013","Input":["henai","hn"]},{"QSid":"151","QDes":"/飞机","isStatic":"1","IQLid":"121","AQLid":"123","EMCode":"121016","Input":["feiji","fj"]},{"QSid":"158","QDes":"/钞票","isStatic":"1","IQLid":"128","AQLid":"130","EMCode":"121023","Input":["chaopiao","cp"]},{"QSid":"168","QDes":"/药","isStatic":"1","IQLid":"138","AQLid":"140","EMCode":"121033","Input":["yao"]},{"QSid":"169","QDes":"/手枪","isStatic":"1","IQLid":"139","AQLid":"141","EMCode":"121034","Input":["shouqiang","sq"]},{"QSid":"171","QDes":"/茶","IQLid":"141","AQLid":"163","EMCode":"241","Input":["cha"]},{"QSid":"172","QDes":"/眨眼睛","IQLid":"142","AQLid":"164","EMCode":"242","Input":["zhayanjing","zyj"]},{"QSid":"173","QDes":"/泪奔","IQLid":"143","AQLid":"165","EMCode":"243","Input":["leiben","lb"]},{"QSid":"174","QDes":"/无奈","IQLid":"144","AQLid":"166","EMCode":"244","Input":["wunai","wn"]},{"QSid":"175","QDes":"/卖萌","IQLid":"145","AQLid":"167","EMCode":"245","Input":["maimeng","mm"]},{"QSid":"176","QDes":"/小纠结","IQLid":"146","AQLid":"168","EMCode":"246","Input":["xiaojiujie","xjj"]},{"QSid":"177","QDes":"/喷血","IQLid":"147","AQLid":"169","EMCode":"247","Input":["penxie","px"]},{"QSid":"178","QDes":"/斜眼笑","IQLid":"148","AQLid":"170","EMCode":"248","Input":["xieyanxiao","xyx"]},{"QSid":"179","QDes":"/doge","IQLid":"149","AQLid":"171","EMCode":"249","Input":["doge","d"]},{"QSid":"180","QDes":"/惊喜","IQLid":"150","AQLid":"172","EMCode":"250","Input":["jingxi","jx"]},{"QSid":"181","QDes":"/骚扰","IQLid":"151","AQLid":"173","EMCode":"251","Input":["saorao","sr"]},{"QSid":"182","QDes":"/笑哭","IQLid":"152","AQLid":"174","EMCode":"252","Input":["xiaoku","xk"]},{"QSid":"183","QDes":"/我最美","IQLid":"153","AQLid":"175","EMCode":"253","Input":["wozuimei","wzm"]},{"QSid":"184","QDes":"/河蟹","IQLid":"154","AQLid":"176","EMCode":"254","Input":["hexie","hx"]},{"QSid":"185","QDes":"/羊驼","IQLid":"155","AQLid":"177","EMCode":"255","Input":["yangtuo","yt"]},{"QSid":"187","QDes":"/幽灵","IQLid":"157","AQLid":"179","EMCode":"257","Input":["youling","yl"]},{"QSid":"188","QDes":"/蛋","IQLid":"158","AQLid":"180","EMCode":"258","Input":["dan"]},{"QSid":"190","QDes":"/菊花","IQLid":"160","AQLid":"182","EMCode":"260","Input":["juhua","jh"]},{"QSid":"192","QDes":"/红包","IQLid":"162","AQLid":"184","EMCode":"262","Input":["hongbao","hb"]},{"QSid":"193","QDes":"/大笑","IQLid":"163","AQLid":"185","EMCode":"263","isStatic":"1","Input":["daxiao","dx"]},{"QSid":"194","QDes":"/不开心","IQLid":"164","AQLid":"143","EMCode":"264","Input":["bukaixin","bkx"]},{"QSid":"197","QDes":"/冷漠","IQLid":"167","AQLid":"146","EMCode":"267","Input":["lengmo","lm"]},{"QSid":"198","QDes":"/呃","IQLid":"168","AQLid":"147","EMCode":"268","Input":["e"]},{"QSid":"199","QDes":"/好棒","IQLid":"169","AQLid":"148","EMCode":"269","Input":["haobang","hb"]},{"QSid":"200","QDes":"/拜托","IQLid":"170","AQLid":"149","EMCode":"270","Input":["baituo","bt"]},{"QSid":"201","QDes":"/点赞","IQLid":"171","AQLid":"150","EMCode":"271","Input":["dianzan","dz"]},{"QSid":"202","QDes":"/无聊","IQLid":"172","AQLid":"151","EMCode":"272","Input":["wuliao","wl"]},{"QSid":"203","QDes":"/托脸","IQLid":"173","AQLid":"152","EMCode":"273","Input":["tuolian","tl"]},{"QSid":"204","QDes":"/吃","IQLid":"174","AQLid":"153","EMCode":"274","Input":["chi"]},{"QSid":"205","QDes":"/送花","IQLid":"175","AQLid":"154","EMCode":"275","Input":["songhua","sh"]},{"QSid":"206","QDes":"/害怕","IQLid":"176","AQLid":"155","EMCode":"276","Input":["haipa","hp"]},{"QSid":"207","QDes":"/花痴","IQLid":"177","AQLid":"156","EMCode":"277","Input":["huachi","hc"]},{"QSid":"208","QDes":"/小样儿","IQLid":"178","AQLid":"157","EMCode":"278","Input":["xiaoyanger","xye"]},{"QSid":"210","QDes":"/飙泪","IQLid":"180","AQLid":"159","EMCode":"280","Input":["biaolei","bl"]},{"QSid":"211","QDes":"/我不看","IQLid":"181","AQLid":"160","EMCode":"281","Input":["wobukan","wbk"]},{"QSid":"212","QDes":"/托腮","IQLid":"182","AQLid":"161","EMCode":"282","Input":["tuosai","ts"]},{"QSid":"214","QDes":"/啵啵","IQLid":"184","isCMEmoji":"1","AQLid":"186","EMCode":"284","Input":["bobo","bb"]},{"QSid":"215","QDes":"/糊脸","IQLid":"185","isCMEmoji":"1","AQLid":"187","EMCode":"285","Input":["hulian","hl"]},{"QSid":"216","QDes":"/拍头","IQLid":"186","isCMEmoji":"1","AQLid":"188","EMCode":"286","Input":["paitou","pt"]},{"QSid":"217","QDes":"/扯一扯","IQLid":"187","isCMEmoji":"1","AQLid":"189","EMCode":"287","Input":["cheyiche","cyc"]},{"QSid":"218","QDes":"/舔一舔","IQLid":"188","isCMEmoji":"1","AQLid":"190","EMCode":"288","Input":["tianyitian","tyt"]},{"QSid":"219","QDes":"/蹭一蹭","IQLid":"189","isCMEmoji":"1","AQLid":"191","EMCode":"289","Input":["cengyiceng","cyc"]},{"QSid":"220","QDes":"/拽炸天","IQLid":"190","isCMEmoji":"1","AQLid":"192","EMCode":"290","Input":["zhuaizhatian","zzt"]},{"QSid":"221","QDes":"/顶呱呱","IQLid":"191","isCMEmoji":"1","AQLid":"193","EMCode":"291","Input":["dingguagua","dgg"]},{"QSid":"222","QDes":"/抱抱","IQLid":"192","isCMEmoji":"1","AQLid":"194","EMCode":"292","Input":["baobao","bb"]},{"QSid":"223","QDes":"/暴击","IQLid":"193","isCMEmoji":"1","AQLid":"195","EMCode":"293","Input":["baoji","bj"]},{"QSid":"224","QDes":"/开枪","IQLid":"194","isCMEmoji":"1","AQLid":"196","EMCode":"295","Input":["kaiqiang","kq"]},{"QSid":"225","QDes":"/撩一撩","IQLid":"195","isCMEmoji":"1","AQLid":"197","EMCode":"296","Input":["liaoyiliao","lyl"]},{"QSid":"226","QDes":"/拍桌","IQLid":"196","isCMEmoji":"1","AQLid":"198","EMCode":"297","Input":["paizhuo","pz"]},{"QSid":"227","QDes":"/拍手","IQLid":"197","isCMEmoji":"1","AQLid":"199","EMCode":"294","Input":["paishou","ps"]},{"QSid":"228","QDes":"/恭喜","IQLid":"198","isCMEmoji":"1","AQLid":"200","EMCode":"298","Input":["gongxi","gx"]},{"QSid":"229","QDes":"/干杯","IQLid":"199","isCMEmoji":"1","AQLid":"201","EMCode":"299","Input":["ganbei","gb"]},{"QSid":"230","QDes":"/嘲讽","IQLid":"200","isCMEmoji":"1","AQLid":"202","EMCode":"300","Input":["chaofeng","cf"]},{"QSid":"231","QDes":"/哼","IQLid":"201","isCMEmoji":"1","AQLid":"203","EMCode":"301","Input":["heng"]},{"QSid":"232","QDes":"/佛系","IQLid":"202","isCMEmoji":"1","AQLid":"204","EMCode":"302","Input":["foxi","fx"]},{"QSid":"233","QDes":"/掐一掐","IQLid":"203","isCMEmoji":"1","AQLid":"205","EMCode":"303","Input":["qiayiqia","qyq"]},{"QSid":"234","QDes":"/惊呆","IQLid":"204","isCMEmoji":"1","AQLid":"206","EMCode":"304","Input":["jingdai","jd"]},{"QSid":"235","QDes":"/颤抖","IQLid":"205","isCMEmoji":"1","AQLid":"207","EMCode":"305","Input":["chandou","cd"]},{"QSid":"236","QDes":"/啃头","IQLid":"206","isCMEmoji":"1","AQLid":"208","EMCode":"306","Input":["kentou","kt"]},{"QSid":"237","QDes":"/偷看","IQLid":"207","isCMEmoji":"1","AQLid":"209","EMCode":"307","Input":["toukan","tk"]},{"QSid":"238","QDes":"/扇脸","IQLid":"208","isCMEmoji":"1","AQLid":"210","EMCode":"308","Input":["shanlian","sl"]},{"QSid":"239","QDes":"/原谅","IQLid":"209","isCMEmoji":"1","AQLid":"211","EMCode":"309","Input":["yuanliang","yl"]},{"QSid":"240","QDes":"/喷脸","IQLid":"210","isCMEmoji":"1","AQLid":"212","EMCode":"310","Input":["penlian","pl"]},{"QSid":"241","QDes":"/生日快乐","IQLid":"211","isCMEmoji":"1","AQLid":"213","EMCode":"311","Input":["shengrikuaile","srkl"]},{"QSid":"242","QDes":"/头撞击","IQLid":"212","isCMEmoji":"1","AQLid":"214","EMCode":"314","Input":["touzhuangji","tzj"]},{"QSid":"243","QDes":"/甩头","IQLid":"213","isCMEmoji":"1","AQLid":"215","EMCode":"313","Input":["shuaitou","st"]},{"QSid":"244","QDes":"/扔狗","IQLid":"214","isCMEmoji":"1","AQLid":"216","EMCode":"312","Input":["renggou","rg"]},{"QSid":"245","QDes":"/加油必胜","IQLid":"245","AQLid":"217","EMCode":"202001","Input":["jiayoubisheng","jybs"]},{"QSid":"246","QDes":"/加油抱抱","IQLid":"246","AQLid":"218","EMCode":"202002","Input":["jiayoubaobao","jybb"]},{"QSid":"247","QDes":"/口罩护体","isStatic":"1","IQLid":"247","AQLid":"219","EMCode":"202003","Input":["kouzhaohuti","kzht"]},{"QSid":"260","QDes":"/搬砖中","isStatic":"1","IQLid":"260","AQLid":"260","EMCode":"10260","Input":["banzhuanzhong","bzz"]},{"QSid":"261","QDes":"/忙到飞起","IQLid":"261","AQLid":"261","EMCode":"10261","Input":["mangdaofeiqi","mdfq"]},{"QSid":"262","QDes":"/脑阔疼","IQLid":"262","AQLid":"262","EMCode":"10262","Input":["naokuoteng","nkt"]},{"QSid":"263","QDes":"/沧桑","IQLid":"263","AQLid":"263","EMCode":"10263","Input":["cangsang","cs"]},{"QSid":"264","QDes":"/捂脸","IQLid":"264","AQLid":"264","EMCode":"10264","Input":["wulian","wl"]},{"QSid":"265","QDes":"/辣眼睛","IQLid":"265","AQLid":"265","EMCode":"10265","Input":["layanjing","lyj"]},{"QSid":"266","QDes":"/哦哟","IQLid":"266","AQLid":"266","EMCode":"10266","Input":["oyo","oy"]},{"QSid":"267","QDes":"/头秃","IQLid":"267","AQLid":"267","EMCode":"10267","Input":["toutu","tt"]},{"QSid":"268","QDes":"/问号脸","IQLid":"268","AQLid":"268","EMCode":"10268","Input":["wenhaolian","whl"]},{"QSid":"269","QDes":"/暗中观察","IQLid":"269","AQLid":"269","EMCode":"10269","Input":["anzhongguancha","azgc"]},{"QSid":"270","QDes":"/emm","IQLid":"270","AQLid":"270","EMCode":"10270","Input":["emm","e"]},{"QSid":"271","QDes":"/吃瓜","IQLid":"271","AQLid":"271","EMCode":"10271","Input":["chigua","cg"]},{"QSid":"272","QDes":"/呵呵哒","IQLid":"272","AQLid":"272","EMCode":"10272","Input":["heheda","hhd"]},{"QSid":"273","QDes":"/我酸了","isStatic":"1","IQLid":"273","AQLid":"273","EMCode":"10273","Input":["wosuanle","wsl"]},{"QSid":"274","QDes":"/太南了","isStatic":"1","IQLid":"274","AQLid":"274","EMCode":"10274","Input":["tainanle","tnl"]},{"QSid":"276","QDes":"/辣椒酱","isStatic":"1","IQLid":"276","AQLid":"276","QHide":"1","EMCode":"10276","Input":["lajiaojiang","ljj"]},{"QSid":"277","QDes":"/汪汪","isStatic":"1","IQLid":"277","AQLid":"277","EMCode":"10277","Input":["wangwang","ww"]},{"QSid":"278","QDes":"/汗","IQLid":"278","isCMEmoji":"1","AQLid":"278","EMCode":"20237","Input":["han"]},{"QSid":"279","QDes":"/打脸","IQLid":"279","isCMEmoji":"1","AQLid":"279","EMCode":"20238","Input":["dalian","dl"]},{"QSid":"280","QDes":"/击掌","IQLid":"280","isCMEmoji":"1","AQLid":"280","EMCode":"20239","Input":["jizhang","jz"]},{"QSid":"281","QDes":"/无眼笑","IQLid":"281","AQLid":"281","EMCode":"10281","Input":["wuyanxiao","wyx"]},{"QSid":"282","QDes":"/敬礼","IQLid":"282","AQLid":"282","EMCode":"10282","Input":["jingli","jl"]},{"QSid":"283","QDes":"/狂笑","IQLid":"283","AQLid":"283","EMCode":"10283","Input":["kuangxiao","kx"]},{"QSid":"284","QDes":"/面无表情","IQLid":"284","AQLid":"284","EMCode":"10284","Input":["mianwubiaoqing","mwbq"]},{"QSid":"285","QDes":"/摸鱼","IQLid":"285","AQLid":"285","EMCode":"10285","Input":["moyu","my"]},{"QSid":"286","QDes":"/魔鬼笑","IQLid":"286","AQLid":"286","EMCode":"10286","Input":["moguixiao","mgx"]},{"QSid":"287","QDes":"/哦","IQLid":"287","AQLid":"287","EMCode":"10287","Input":["o"]},{"QSid":"288","QDes":"/请","IQLid":"288","AQLid":"288","EMCode":"10288","Input":["qing"]},{"QSid":"289","QDes":"/睁眼","IQLid":"289","AQLid":"289","EMCode":"10289","Input":["zhengyan","zy"]},{"QSid":"290","QDes":"/敲开心","IQLid":"290","isCMEmoji":"1","AQLid":"290","EMCode":"20240","Input":["qiaokaixin","qkx"]},{"QSid":"291","QDes":"/震惊","IQLid":"291","isCMEmoji":"1","AQLid":"291","EMCode":"20241","Input":["zhenjing","zj"]},{"QSid":"292","QDes":"/让我康康","IQLid":"292","isCMEmoji":"1","AQLid":"292","EMCode":"20242","Input":["rangwokangkang","rwkk"]},{"QSid":"293","QDes":"/摸锦鲤","IQLid":"293","AQLid":"293","EMCode":"10293","Input":["mojinli","mjl"]},{"QSid":"294","QDes":"/期待","IQLid":"294","AQLid":"294","EMCode":"10294","Input":["qidai","qd"]},{"QSid":"295","QDes":"/拿到红包","IQLid":"295","AQLid":"295","QHide":"1","EMCode":"10295","Input":["nadaohongbao","ndhb"]},{"QSid":"296","QDes":"/真好","IQLid":"296","AQLid":"296","QHide":"1","EMCode":"10296","Input":["zhenhao","zh"]},{"QSid":"297","QDes":"/拜谢","IQLid":"297","AQLid":"297","EMCode":"10297","Input":["baixie","bx"]},{"QSid":"298","QDes":"/元宝","IQLid":"298","AQLid":"298","EMCode":"10298","Input":["yuanbao","yb"]},{"QSid":"299","QDes":"/牛啊","IQLid":"299","AQLid":"299","EMCode":"10299","Input":["niua","na"]},{"QSid":"300","QDes":"/胖三斤","IQLid":"300","AQLid":"300","EMCode":"10300","Input":["pangsanjin","psj"]},{"QSid":"301","QDes":"/好闪","IQLid":"301","AQLid":"301","EMCode":"10301","Input":["haoshan","hs"]},{"QSid":"302","QDes":"/左拜年","IQLid":"302","AQLid":"302","QHide":"1","EMCode":"10302","Input":["zuobainian","zbn"]},{"QSid":"303","QDes":"/右拜年","IQLid":"303","AQLid":"303","QHide":"1","EMCode":"10303","Input":["youbainian","ybn"]},{"QSid":"304","QDes":"/红包包","IQLid":"304","AQLid":"304","QHide":"1","EMCode":"10304","Input":["hongbaobao","hbb"]},{"QSid":"305","QDes":"/右亲亲","IQLid":"305","AQLid":"305","EMCode":"10305","Input":["youqinqin","yqq"]},{"QSid":"306","QDes":"/牛气冲天","isStatic":"1","IQLid":"306","AQLid":"306","EMCode":"10306","Input":["niuqichongtian","nqct"]},{"QSid":"307","QDes":"/喵喵","isStatic":"1","IQLid":"307","AQLid":"307","EMCode":"10307","Input":["miaomiao","mm"]},{"QSid":"308","QDes":"/求红包","IQLid":"308","isCMEmoji":"1","AQLid":"308","EMCode":"20243","Input":["qiuhongbao","qhb"]},{"QSid":"309","QDes":"/谢红包","IQLid":"309","isCMEmoji":"1","AQLid":"309","EMCode":"20244","Input":["xiehongbao","xhb"]},{"QSid":"310","QDes":"/新年烟花","IQLid":"310","isCMEmoji":"1","AQLid":"310","EMCode":"20245","Input":["xinnianyanhua","xnyh"]},{"QSid":"311","QDes":"/打call","IQLid":"311","AQLid":"311","EMCode":"10311","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"1","Input":["dacall","dc"]},{"QSid":"312","QDes":"/变形","IQLid":"312","AQLid":"312","EMCode":"10312","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"2","Input":["bianxing","bx"]},{"QSid":"313","QDes":"/嗑到了","IQLid":"313","AQLid":"313","QHide":"1","EMCode":"10313","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"3","Input":["kedaole","kdl"]},{"QSid":"314","QDes":"/仔细分析","IQLid":"314","AQLid":"314","EMCode":"10314","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"4","Input":["zixifenxi","zxfx"]},{"QSid":"315","QDes":"/加油","IQLid":"315","AQLid":"315","EMCode":"10315","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"5","Input":["jiayou","jy"]},{"QSid":"316","QDes":"/我没事","IQLid":"316","AQLid":"316","QHide":"1","EMCode":"10316","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"6","Input":["womeishi","wms"]},{"QSid":"317","QDes":"/菜狗","IQLid":"317","AQLid":"317","EMCode":"10317","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"7","Input":["caigou","cg"]},{"QSid":"318","QDes":"/崇拜","IQLid":"318","AQLid":"318","EMCode":"10318","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"8","Input":["chongbai","cb"]},{"QSid":"319","QDes":"/比心","IQLid":"319","AQLid":"319","EMCode":"10319","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"9","Input":["bixin","bx"]},{"QSid":"320","QDes":"/庆祝","IQLid":"320","AQLid":"320","EMCode":"10320","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"10","Input":["qingzhu","qz"]},{"QSid":"321","QDes":"/老色痞","IQLid":"321","AQLid":"321","QHide":"1","EMCode":"10321","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"11","Input":["laosepi","lsp"]},{"QSid":"322","QDes":"/拒绝","IQLid":"322","AQLid":"322","EMCode":"10322","Input":["jujue","jj"]},{"QSid":"323","QDes":"/嫌弃","IQLid":"323","AQLid":"323","EMCode":"10323","Input":["xianqi","xq"]},{"QSid":"324","QDes":"/吃糖","IQLid":"324","AQLid":"324","EMCode":"10324","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"12"},{"QSid":"325","QDes":"/惊吓","IQLid":"325","AQLid":"325","EMCode":"10325","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"14"},{"QSid":"326","QDes":"/生气","IQLid":"326","AQLid":"326","EMCode":"10326","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"15"},{"QSid":"327","QDes":"/加一","QHide":"1","IQLid":"327","AQLid":"327","EMCode":"10327"},{"QSid":"328","QDes":"/错号","QHide":"1","IQLid":"328","AQLid":"328","EMCode":"10328"},{"QSid":"329","QDes":"/对号","QHide":"1","IQLid":"329","AQLid":"329","EMCode":"10329"},{"QSid":"330","QDes":"/完成","QHide":"1","IQLid":"330","AQLid":"330","EMCode":"10330"},{"QSid":"331","QDes":"/明白","QHide":"1","IQLid":"331","AQLid":"331","EMCode":"10331"},{"QSid":"332","QDes":"/举牌牌","IQLid":"332","AQLid":"332","EMCode":"10332"},{"QSid":"333","QDes":"/烟花","isStatic":"1","IQLid":"333","AQLid":"333","EMCode":"10333","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"19"},{"QSid":"334","QDes":"/虎虎生威","IQLid":"334","AQLid":"334","EMCode":"10334","isStatic":"1"},{"QSid":"336","QDes":"/豹富","IQLid":"336","AQLid":"336","EMCode":"10336","isStatic":"1"},{"QSid":"337","QDes":"/花朵脸","IQLid":"337","AQLid":"337","EMCode":"10337","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"22"},{"QSid":"338","QDes":"/我想开了","IQLid":"338","AQLid":"338","EMCode":"10338","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"20"},{"QSid":"339","QDes":"/舔屏","IQLid":"339","AQLid":"339","EMCode":"10339","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"21"},{"QSid":"340","QDes":"/热化了","IQLid":"340","AQLid":"340","QHide":"1","EMCode":"10340","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"23"},{"QSid":"341","QDes":"/打招呼","IQLid":"341","AQLid":"341","EMCode":"10341","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"24"},{"QSid":"342","QDes":"/酸Q","IQLid":"342","AQLid":"342","EMCode":"10342","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"26"},{"QSid":"343","QDes":"/我方了","IQLid":"343","AQLid":"343","EMCode":"10343","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"27"},{"QSid":"344","QDes":"/大怨种","IQLid":"344","AQLid":"344","EMCode":"10344","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"28"},{"QSid":"345","QDes":"/红包多多","IQLid":"345","AQLid":"345","EMCode":"10345","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"29"},{"QSid":"346","QDes":"/你真棒棒","IQLid":"346","AQLid":"346","EMCode":"10346","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"25"},{"QSid":"347","QDes":"/大展宏兔","IQLid":"347","AQLid":"347","EMCode":"10347","isStatic":"1"},{"QSid":"348","QDes":"/福萝卜","IQLid":"348","AQLid":"348","EMCode":"10348","isStatic":"1"}]`)})),L_=ye(ge(((e,t)=>{var n=(I_(),be(P_).default);function r(e){return e=String(e),n.find(t=>t.QSid===e)}function i(e){e[0]===`/`&&(e=e.substring(1));let t=n.find(t=>t.QDes.substring(1)===e)||n.find(t=>t.Input.includes(e))||n.find(t=>t.Input.some(t=>t.startsWith(e)));return t?t.QSid:null}function a(e,t=`https://koishi.js.org/QFace`){let n=r(e);return n?t+(n.isStatic?`/static/s${e}.png`:`/gif/s${e}.gif`):``}t.exports={data:n,get:r,getUrl:a,getByText:i}}))(),1),R_=[`76`,`66`,`63`,`64`,`39`,`116`,`59`,`98`,`2`,`178`,`179`,`182`];function z_(e){return{id:e.QSid,label:e.QDes.replace(/^\//,``)||e.QSid,url:L_.getUrl(e.QSid),inputs:e.Input??[]}}function B_(){return L_.data.filter(e=>!e.QHide).map(z_)}function V_(e){let t=L_.get(e);if(t)return z_(t);let n=e.trim();if(n)return{id:n,label:/^\d+$/.test(n)?`[表情]`:n,url:``,inputs:[]}}function H_(){let e=new Map(B_().map(e=>[e.id,e])),t=R_.flatMap(t=>{let n=e.get(t);return n?[n]:[]});return t.length?t:B_().filter(e=>L_.get(e.id)?.isCMEmoji).slice(0,24)}function U_(e){let t=e.trim().toLowerCase(),n=B_();return t?n.filter(e=>e.id.includes(t)||e.label.toLowerCase().includes(t)?!0:e.inputs.some(e=>e.toLowerCase().includes(t))):n}var W_=`chatluna.onebot-sandbox.recent-emoji-ids`;function G_(){let e=R(W_);return Array.isArray(e)?e.filter(e=>typeof e==`string`&&!!e.trim()).slice(0,24):[]}function K_(e){let t=e.trim();if(!t)return G_();let n=[t,...G_().filter(e=>e!==t)].slice(0,24);return z(W_,n),n}function q_({open:t,onOpenChange:n,onSelect:r}){let i=q(),[a,o]=e.useState(``),[s,c]=e.useState([]);e.useEffect(()=>{t&&(o(``),c(G_()))},[t]);let l=!!a.trim(),u=s.map(V_).filter(e=>!!e),d=e.useMemo(()=>U_(a),[a]),f=e=>{c(K_(e)),r(e),n(!1)},p=(e,t)=>b(`div`,{className:`grid grid-cols-8 gap-1`,children:e.map(e=>b(`button`,{type:`button`,title:e.label,className:`flex aspect-square items-center justify-center rounded-md transition-colors hover:bg-accent`,onClick:()=>f(e.id),children:e.url?b(`img`,{src:e.url,alt:e.label,className:`size-6`}):b(`span`,{className:`text-[10px]`,children:e.label})},`${t}:${e.id}`))});return b(gn,{open:t,onOpenChange:n,children:x(yn,{className:`flex flex-col overflow-hidden sm:max-w-md`,children:[b(bn,{children:b(Sn,{children:i(`sandbox.emoji.title`)})}),b(Tn,{type:`search`,className:`sandbox-search-input`,value:a,autoFocus:!0,placeholder:i(`sandbox.emoji.search`),"aria-label":i(`sandbox.emoji.search`),onChange:e=>o(e.target.value)}),x(`div`,{className:`-mx-5 flex max-h-[55vh] min-h-0 flex-col gap-4 overflow-y-auto px-5`,children:[!l&&u.length>0&&x(`section`,{className:`flex flex-col gap-2`,children:[b(`h3`,{className:`text-xs text-muted-foreground`,children:i(`sandbox.emoji.recent`)}),p(u,`recent`)]}),!l&&x(`section`,{className:`flex flex-col gap-2`,children:[b(`h3`,{className:`text-xs text-muted-foreground`,children:i(`sandbox.emoji.common`)}),p(H_(),`common`)]}),x(`section`,{className:`flex flex-col gap-2`,children:[b(`h3`,{className:`text-xs text-muted-foreground`,children:i(l?`sandbox.emoji.results`:`sandbox.emoji.all`)}),d.length?p(d,`all`):b(`p`,{className:`py-6 text-center text-xs text-muted-foreground`,children:i(`sandbox.emoji.empty`)})]})]})]})})}function J_(t){let n=e.useRef(t);return t!==void 0&&(n.current=t),t??n.current}function Y_(e,t){return!!e&&!!t&&e.userId===t.userId}function X_(e,t){return Y_(e[t-1],e[t])}function Z_(e,t){if(!e[t])return``;let n=Y_(e[t-1],e[t]),r=Y_(e[t],e[t+1]);return n&&r?`is-cluster-middle`:r?`is-cluster-first`:n?`is-cluster-last`:``}function Q_({open:t,targets:n,onOpenChange:r,onConfirm:i}){let a=q(),[o,s]=e.useState(`recent`),[c,l]=e.useState(``),[u,d]=e.useState(``),[f,p]=e.useState(!1),[m,h]=e.useState(``),g=c.trim().toLowerCase(),_=n[o].filter(e=>!g||e.title.toLowerCase().includes(g)||e.conversationId.toLowerCase().includes(g)||!!e.subtitle?.toLowerCase().includes(g));return e.useEffect(()=>{t&&(s(`recent`),l(``),p(!1),h(``),d(n.recent[0]?.conversationId??n.friends[0]?.conversationId??n.groups[0]?.conversationId??``))},[t]),e.useEffect(()=>{_.some(({conversationId:e})=>e===u)||d(_[0]?.conversationId??``)},[o,g]),b(gn,{open:t,onOpenChange:r,children:x(yn,{className:`flex flex-col overflow-hidden sm:max-w-md`,children:[x(bn,{children:[b(Sn,{children:a(`sandbox.forward.targetTitle`)}),b(Cn,{children:a(`sandbox.forward.targetHint`)})]}),x(`div`,{className:`relative`,children:[b(af,{className:`pointer-events-none absolute top-1/2 left-2.5 size-4 -translate-y-1/2 text-muted-foreground`}),b(Tn,{type:`search`,className:`sandbox-search-input pl-8!`,value:c,placeholder:a(`sandbox.forward.search`),"aria-label":a(`sandbox.forward.search`),onChange:e=>l(e.target.value)})]}),b(Ms,{value:o,onValueChange:e=>s(e),children:b(Fs,{className:`w-full`,children:[`recent`,`friends`,`groups`].map(e=>b(Is,{value:e,className:`text-xs`,children:a(`sandbox.sidebar.${e}`)},e))})}),x(`div`,{className:`-mx-5 flex max-h-72 min-h-0 flex-col gap-0.5 overflow-y-auto px-5 py-1`,role:`listbox`,"aria-label":a(`sandbox.forward.targets`),children:[_.map(e=>x(`button`,{type:`button`,role:`option`,"aria-selected":u===e.conversationId,className:U(`flex items-center gap-3 rounded-lg px-2 py-1.5 text-left hover:bg-accent`,u===e.conversationId&&`bg-accent ring-1 ring-primary/40`),onClick:()=>d(e.conversationId),children:[b(lp,{kind:e.avatarKind,name:e.title,src:e.avatar,className:`size-8`}),x(`span`,{className:`flex min-w-0 flex-col`,children:[b(`strong`,{className:`truncate text-[13px] font-medium`,children:e.title}),b(`small`,{className:`truncate text-xs text-muted-foreground`,children:e.subtitle||e.conversationId})]})]},e.conversationId)),!_.length&&b(`p`,{className:`py-10 text-center text-xs text-muted-foreground`,children:a(g?`sandbox.forward.noMatch`:`sandbox.forward.empty.${o}`)})]}),m&&b(`p`,{role:`alert`,className:`text-xs text-destructive`,children:m}),x(xn,{children:[b(W,{variant:`outline`,disabled:f,onClick:()=>r(!1),children:a(`sandbox.common.cancel`)}),b(W,{disabled:!u||f,onClick:async()=>{if(!(!u||f)){p(!0),h(``);try{await i(u),r(!1)}catch(e){h(Vu(e,a(`sandbox.forward.failed`)))}finally{p(!1)}}},children:a(f?`sandbox.forward.sending`:`sandbox.forward.send`)})]})]})})}function $_({stack:e,imageOpen:t,onCloseFrom:n,onOpenForward:r,onOpenImage:i}){return b(ev,{stack:e,depth:0,imageOpen:t,onCloseFrom:n,onOpenForward:r,onOpenImage:i})}function ev({stack:e,depth:t,imageOpen:n,onCloseFrom:r,onOpenForward:i,onOpenImage:a}){let o=q(),{participants:s,media:c,mediaFailures:l,workspace:u}=Qu(),d=e[t],f=J_(d);if(!f)return null;let p=e=>{let t=uu(e);return e.media?.length===1&&t===`[${kf(e.media[0])}] ${e.media[0].name}`?``:t},{appearance:m}=u;return b(gn,{open:!!d,onOpenChange:e=>!e&&!n&&r(t),children:x(yn,{className:`flex max-h-[80vh] flex-col gap-3 overflow-hidden sm:max-w-lg`,children:[b(bn,{className:`min-w-0 pr-8`,children:b(Sn,{className:`truncate leading-6`,children:f.title||o(`sandbox.forward.title`)})}),b(`div`,{className:`-mx-5 flex min-h-0 flex-1 flex-col overflow-y-auto px-5`,children:f.items.length?b(`ol`,{className:U(`sandbox-message-list sandbox-forward-list`,m.sandboxTimBubbleTail&&`has-tail`,m.sandboxIncomingBubbleStyle===`outline`&&`has-outline`),style:{"--sandbox-accent":m.sandboxAccentColor},children:f.items.map((e,t)=>{let n=X_(f.items,t),r=e.forwardId?f.nestedForwards[e.forwardId]:void 0,u=r?Gf(r):void 0,d=p(e);return x(`li`,{className:U(`sandbox-message-row is-incoming`,Z_(f.items,t),n&&`is-merged`),children:[b(`span`,{className:`sandbox-message-avatar-wrap`,children:b(lp,{kind:s[e.userId]?.isBot?`bot`:`user`,name:e.nickname,src:s[e.userId]?.avatar,className:`size-8`})}),x(`div`,{className:`sandbox-message-content`,children:[!n&&b(`div`,{className:`sandbox-message-sender-line`,children:b(`span`,{children:e.nickname})}),b(`div`,{className:`sandbox-message-body`,children:b(`div`,{className:`sandbox-message-stack`,children:x(`div`,{className:`sandbox-message-bubble`,children:[e.forwardId&&x(`button`,{type:`button`,className:`sandbox-message-quote sandbox-message-forward`,"aria-label":o(`sandbox.forward.open`),onClick:()=>e.forwardId&&i(e.forwardId),children:[b(`strong`,{className:`sandbox-message-quote-title`,children:u?.title||o(`sandbox.forward.title`)}),u?x(y,{children:[u.lines.map((e,t)=>b(`span`,{children:e},t)),x(`span`,{className:`sandbox-message-forward-entry`,children:[o(`sandbox.forward.total`,{count:u.total}),b(Dd,{className:`size-4`})]})]}):b(`span`,{children:o(`sandbox.forward.placeholder`)})]}),e.media?.map(e=>{let t=c[e.id];return b(`div`,{className:`sandbox-message-media`,children:t?e.type===`image`?b(`button`,{type:`button`,className:`sandbox-message-image`,"aria-label":o(`sandbox.media.viewImage`),onClick:()=>a(t),children:b(`img`,{src:t,alt:e.name})}):e.type===`audio`?b(`audio`,{src:t,controls:!0,preload:`metadata`}):e.type===`video`?b(`video`,{src:t,controls:!0,preload:`metadata`}):x(`a`,{href:t,download:e.name,className:`sandbox-message-file`,children:[b(Zd,{className:`size-[18px]`}),x(`span`,{children:[b(`strong`,{children:e.name}),b(`small`,{children:Af(e.size)})]})]}):b(`span`,{className:`sandbox-message-media-loading`,children:l[e.id]?o(`sandbox.media.unavailable`):o(`sandbox.media.loading`)})},e.id)}),d&&b(`span`,{className:`sandbox-message-text`,children:d}),!d&&!e.media?.length&&!e.forwardId&&b(`span`,{className:`sandbox-message-text`,children:o(`sandbox.forward.emptyNode`)})]})})})]})]},t)})}):b(`p`,{className:`py-8 text-center text-xs text-muted-foreground`,children:o(`sandbox.forward.noItems`)})}),b(ev,{stack:e,depth:t+1,imageOpen:n,onCloseFrom:r,onOpenForward:i,onOpenImage:a})]})})}var tv=1,nv=8,rv=1.2;function iv({url:t,onClose:n}){let r=q(),i=e.useRef(null),[a,o]=e.useState(1),[s,c]=e.useState({x:0,y:0}),l=e.useRef(void 0),u=e.useRef(0);e.useEffect(()=>{let e=e=>{e.key===`Escape`&&n()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[n]);let d=(e,t)=>{let n=i.current;if(!n)return e;let r=Math.max((n.offsetWidth*t-window.innerWidth)/2,0),a=Math.max((n.offsetHeight*t-window.innerHeight)/2,0);return{x:Math.min(Math.max(e.x,-r),r),y:Math.min(Math.max(e.y,-a),a)}};return oe(x(`div`,{role:`dialog`,"aria-modal":`true`,"aria-label":r(`sandbox.media.preview`),className:`fixed inset-0 z-[100] flex items-center justify-center overflow-hidden bg-black/80 text-sm leading-6 animate-in fade-in-0`,onWheel:e=>{if(!e.deltaY)return;let t=Math.min(Math.max(a*(e.deltaY<0?rv:1/rv),tv),nv);if(t===a)return;let n=t/a,r=e.clientX-window.innerWidth/2,i=e.clientY-window.innerHeight/2;o(t),c(d({x:r-(r-s.x)*n,y:i-(i-s.y)*n},t))},onClick:e=>{performance.now()<u.current||e.target===e.currentTarget&&n()},children:[b(`img`,{ref:i,src:t,alt:``,draggable:!1,className:`max-h-[90vh] max-w-[90vw] select-none object-contain transition-transform duration-75`,style:{transform:`translate(${s.x}px, ${s.y}px) scale(${a})`},onPointerDown:e=>{e.button!==0||a<=tv||(l.current={id:e.pointerId,x:e.clientX,y:e.clientY,ox:s.x,oy:s.y,moved:!1},e.currentTarget.setPointerCapture(e.pointerId))},onPointerMove:e=>{let t=l.current;if(!t||t.id!==e.pointerId)return;let n=e.clientX-t.x,r=e.clientY-t.y;!t.moved&&Math.hypot(n,r)<3||(t.moved=!0,c(d({x:t.ox+n,y:t.oy+r},a)))},onPointerUp:e=>{l.current?.moved&&(u.current=performance.now()+250),l.current=void 0,e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId)}}),x(`span`,{className:`absolute bottom-6 left-1/2 -translate-x-1/2 rounded-full bg-black/60 px-3 py-1 text-xs text-white tabular-nums`,children:[Math.round(a*100),`%`]}),b(W,{variant:`ghost`,size:`icon`,className:`absolute top-4 right-4 text-white hover:bg-white/15 hover:text-white`,"aria-label":r(`sandbox.common.close`),onClick:n,children:b(yf,{})})]}),document.body)}var av=`—`,ov=new Map;function sv(e){let t=`${e.locale??``}|${e.timeZone??``}`,n=ov.get(t);if(n)return n;let r=new Intl.DateTimeFormat(e.locale??[],{...e.timeZone?{timeZone:e.timeZone}:{},hour:`2-digit`,minute:`2-digit`});return ov.set(t,r),r}function cv(e,t={}){let n=lv(e);return n===void 0?av:sv(t).format(new Date(n))}function lv(e){let t=e instanceof Date?e.getTime():typeof e==`number`?e:Date.parse(e);return Number.isFinite(t)?t:void 0}var uv=24,dv=900;function fv({target:t,className:n}){let r=e.useRef(null),[i,a]=e.useState({top:0,size:0,visible:!1}),[o,s]=e.useState(!1),[c,l]=e.useState(!1),u=e.useRef(void 0),d=e.useRef(void 0),f=e.useCallback(()=>{let e=t.current,n=r.current;if(!e||!n)return;let i=e.scrollHeight-e.clientHeight,o=n.clientHeight;if(i<=1||!o)return a(e=>e.visible?{top:0,size:0,visible:!1}:e);let s=Math.max(uv,o*e.clientHeight/e.scrollHeight),c=(o-s)*e.scrollTop/i;a({top:c,size:s,visible:!0})},[t]);e.useLayoutEffect(()=>{let e=t.current;if(!e)return;f();let n=()=>{s(!0),clearTimeout(d.current),d.current=setTimeout(()=>s(!1),dv)},i=()=>{f(),n()};e.addEventListener(`scroll`,i,{passive:!0}),e.addEventListener(`pointermove`,n,{passive:!0});let a=new ResizeObserver(f);a.observe(e),r.current&&a.observe(r.current);for(let t of e.children)a.observe(t);let o=new MutationObserver(()=>{for(let t of e.children)a.observe(t);f()});return o.observe(e,{childList:!0,subtree:!0}),()=>{clearTimeout(d.current),e.removeEventListener(`scroll`,i),e.removeEventListener(`pointermove`,n),a.disconnect(),o.disconnect()}},[t,f]);let p=()=>{let e=t.current,n=r.current;if(!e||!n)return 0;let a=n.clientHeight-i.size;return a>0?(e.scrollHeight-e.clientHeight)/a:0};return b(`div`,{ref:r,"aria-hidden":!0,className:U(`sandbox-overlay-scrollbar`,i.visible&&`is-visible`,(o||c)&&`is-active`,c&&`is-dragging`,n),onPointerDown:e=>{let n=t.current;if(e.button!==0||!n||e.target!==e.currentTarget)return;let r=e.clientY-e.currentTarget.getBoundingClientRect().top;n.scrollBy({top:(r<i.top?-1:1)*n.clientHeight*.9,behavior:`smooth`})},children:b(`div`,{className:`sandbox-overlay-scrollbar-thumb`,style:{height:i.size,transform:`translateY(${i.top}px)`},onPointerDown:e=>{let n=t.current;e.button!==0||!n||(e.preventDefault(),u.current={id:e.pointerId,y:e.clientY,scrollTop:n.scrollTop},e.currentTarget.setPointerCapture(e.pointerId),l(!0))},onPointerMove:e=>{let n=u.current,r=t.current;!n||n.id!==e.pointerId||!r||(r.scrollTop=n.scrollTop+(e.clientY-n.y)*p())},onPointerUp:()=>{u.current=void 0,l(!1)},onPointerCancel:()=>{u.current=void 0,l(!1)}})})}function pv(e){let t=e?.media;return!!e&&t?.length===1&&t[0].type===`image`&&e.content===`[图片] ${t[0].name}`}function mv(e,t){if(e)return e.authorId===t?`outgoing`:`incoming`}function hv(e,t,n){return!!e&&!!t&&!e.event&&!t.event&&e.authorId===t.authorId&&e.conversationId===t.conversationId&&mv(e,n)===mv(t,n)}function gv(e,t,n,r){let i=e[t];if(i)for(let a=t+n;a>=0&&a<e.length;a+=n){let t=e[a];if(!hv(i,t,r))return;if(!pv(t))return t}}function _v(e,t,n){return hv(e[t-1],e[t],n)}function vv(e,t,n){if(!e[t])return``;let r=!!gv(e,t,-1,n),i=!!gv(e,t,1,n);return r&&i?`is-cluster-middle`:i?`is-cluster-first`:r?`is-cluster-last`:``}function yv(e,t){return e.isFriend?t?[`poke`,`remark`,`delete`]:[`remark`,`delete`]:e.pendingOutgoing||e.pendingIncoming?[]:[`request`]}function bv(e,t){return e?.card?.trim()||t}function xv(e){if(!e)return;let t=e.title?.trim()||void 0;return e.role===`owner`||e.role===`admin`?t?{kind:e.role,title:t}:{kind:e.role}:t?{kind:`title`,title:t}:void 0}function Sv(e,t){if(!e)return[];let n=[];return e.participantId!==t.participantId&&n.push(`mention`,`poke`),(e.participantId===t.participantId||e.role===`owner`||e.role===`admin`&&t.role===`member`)&&n.push(`set-card`),e.role===`owner`&&n.push(`set-title`),e.role===`owner`&&t.role!==`owner`&&n.push(t.role===`admin`?`unset-admin`:`set-admin`),e.role===`owner`&&e.participantId!==t.participantId&&n.push(`transfer-owner`),e.participantId!==t.participantId&&t.role!==`owner`&&(e.role===`owner`||e.role===`admin`&&t.role===`member`)&&n.push(`kick`),n}var Cv={isFriend:!1,pendingOutgoing:!1,pendingIncoming:!1};function wv(e,t){return t.participants[e]?.name??e}function Tv(e,t){return t.currentGroup?.members.find(t=>t.participantId===e)}function Ev(e,t){return bv(Tv(e,t),wv(e,t))}function Dv(e,t){return xv(Tv(e,t))}function Ov(e,t){let n=Tv(e,t);return n?Sv(Tv(t.currentOperatorId??``,t),n):[]}var kv=[`set-card`,`set-title`,`set-admin`,`unset-admin`,`transfer-owner`,`kick`];function Av(e,t){return Ov(e,t).some(e=>kv.includes(e))}function jv(e,t){return t.friendMenuStates[e]??Cv}function Mv(e,t){return yv(jv(e,t),!0)}function Nv(e,t){return t===void 0?e(`sandbox.chat.thinkingProcess`):e(`sandbox.chat.thoughtFor`,{seconds:Math.max(0,Math.round(t/1e3))})}function Pv({target:e,managementOnly:t,onMention:n}){let r=q(),{store:i,run:a,dialogs:o}=Zu(),{group:s,operatorId:c,conversation:l}=Qu();if(!s)return null;let u=s.members.find(({participantId:e})=>e===c),d=Sv(u,e),f=e.participantId,p=e=>a(r(`sandbox.error.group`),()=>i.performGroupAction(e)),m=!u||u.participantId===f?``:u.role===`member`?r(`sandbox.member.kickNeedAdmin`):u.role===`admin`&&e.role!==`member`?r(`sandbox.member.adminLimit`):``;return x(y,{children:[!t&&d.includes(`mention`)&&n&&x(K,{onClick:()=>n(f),children:[b(gd,{}),r(`sandbox.member.mention`)]}),!t&&d.includes(`poke`)&&l&&x(K,{onClick:()=>p({action:`poke`,groupId:s.id,targetId:f,conversationId:l.id}),children:[b(Ud,{}),r(`sandbox.member.poke`)]}),d.includes(`set-card`)&&x(K,{onClick:()=>o.openGroupAction(`card`,f,s.id),children:[b(uf,{}),r(`sandbox.member.setCard`)]}),d.includes(`set-title`)&&x(K,{onClick:()=>o.openGroupAction(`title`,f,s.id),children:[b(_d,{}),r(`sandbox.member.setTitle`)]}),d.includes(`set-admin`)&&x(K,{onClick:()=>p({action:`set-admin`,groupId:s.id,targetId:f,enabled:!0}),children:[b(hf,{}),r(`sandbox.member.setAdmin`)]}),d.includes(`unset-admin`)&&x(K,{onClick:()=>p({action:`set-admin`,groupId:s.id,targetId:f,enabled:!1}),children:[b(mf,{}),r(`sandbox.member.unsetAdmin`)]}),d.includes(`transfer-owner`)&&x(K,{onClick:()=>p({action:`transfer-owner`,groupId:s.id,targetId:f}),children:[b(Nd,{}),r(`sandbox.member.transferOwner`),b(E_,{})]}),d.includes(`kick`)?x(K,{variant:`destructive`,onClick:()=>p({action:`kick`,groupId:s.id,targetId:f}),children:[b(mf,{}),r(`sandbox.member.kick`)]}):m&&x(K,{disabled:!0,children:[b(mf,{}),m]})]})}var Fv=3;function Iv({reactions:e,readonly:t,onToggle:n}){let{participants:r}=Qu();return b(`div`,{className:`sandbox-message-reactions`,children:e.map(e=>{let i=V_(e.emojiId),a=e.participantIds.slice(0,Fv);return x(`button`,{type:`button`,className:`sandbox-message-reaction`,disabled:t,"aria-label":`${i?.label??e.emojiId} ${e.participantIds.length}`,onClick:t=>{t.stopPropagation(),n(e.emojiId)},children:[i?.url?b(`img`,{src:i.url,alt:i.label,className:`sandbox-message-reaction-emoji`}):b(`span`,{children:i?.label??e.emojiId}),a.length>0&&b(`span`,{className:`sandbox-message-reaction-users`,children:a.map((e,t)=>b(`span`,{title:r[e]?.name??e,className:`sandbox-message-reaction-avatar`,style:{zIndex:a.length-t},children:b(lp,{kind:r[e]?.isBot?`bot`:`user`,name:r[e]?.name??e,src:r[e]?.avatar,className:`size-full text-[9px]`,badge:!1})},e))})]},e.emojiId)})})}var Lv=new Map,Rv=48,zv=e.forwardRef(function(t,n){let r=q(),i=g(),{store:a,run:o,dialogs:s}=Zu(),{conversation:c,group:l,peer:u,operatorId:d,participants:f,participantNames:p,resolveAvatar:m,media:h,mediaFailures:_,workspace:v}=Qu(),S=v.appearance.sandboxMarkRecalledMessages,C=v.appearance.sandboxTimBubbleTail,w=v.appearance.sandboxIncomingBubbleStyle===`outline`,T=e.useRef(null),E=e.useRef(null),D=e.useRef(!0),O=e.useRef(0),k=e.useRef(void 0),[A,j]=e.useState(!1),[M,N]=e.useState(``),[ee,te]=e.useState({}),P=e.useRef(void 0),F={replyMessages:t.replyMessages,forwardPreviews:t.forwardPreviews,messageCapabilities:t.capabilities,participantNames:p,markRecalledMessages:S,currentConversationId:c?.id,currentOperatorId:d,participants:f,friendMenuStates:t.friendMenuStates,currentGroup:l},ne=e=>Ev(e,F),re=()=>{let e=T.current;e&&(e.scrollTop=e.scrollHeight)};e.useLayoutEffect(()=>{let e=Lv.get(t.scrollKey);D.current=!e||e.bottom,D.current?re():T.current&&(T.current.scrollTop=e.top),O.current=T.current?.scrollTop??0;let n=t.scrollKey,r=T.current;return()=>{r&&Lv.set(n,{top:r.scrollTop,bottom:D.current})}},[t.scrollKey]);let I=`${t.messages.at(-1)?.id??``}:${t.messages.length}:${t.chatLunaStates.filter(({thinking:e})=>e).length}`;e.useLayoutEffect(()=>{let e=T.current;if(!e)return;let t=k.current;if(t){k.current=void 0;let n=e.querySelector(`[data-message-id="${CSS.escape(t.messageId)}"]`);n&&(e.scrollTop+=n.getBoundingClientRect().top-e.getBoundingClientRect().top-t.offset);return}D.current&&re()},[I]),e.useEffect(()=>{let e=E.current;if(!e||typeof ResizeObserver>`u`)return;let t=new ResizeObserver(()=>{D.current&&re()});return t.observe(e),()=>t.disconnect()},[t.scrollKey,t.messages.length>0]);let L=()=>{let e=T.current;if(!e)return;let t=e.scrollTop;e.scrollHeight-t-e.clientHeight<Rv?D.current=!0:t<O.current&&(D.current=!1),O.current=t},ie=async()=>{let e=T.current;if(A||!e)return;let n=e.querySelector(`[data-message-id]`);n&&(k.current={messageId:n.dataset.messageId??``,offset:n.getBoundingClientRect().top-e.getBoundingClientRect().top}),D.current=!1,j(!0);try{await t.onLoadHistory()}catch{k.current=void 0}finally{j(!1)}},ae=e=>{let t=T.current,n=t?.querySelector(`[data-message-id="${CSS.escape(e)}"]`);return!t||!n?!1:(D.current=!1,n.scrollIntoView({block:`center`,behavior:`smooth`}),N(e),clearTimeout(P.current),P.current=setTimeout(()=>N(``),1600),!0)};e.useImperativeHandle(n,()=>({revealMessage:ae})),e.useEffect(()=>()=>clearTimeout(P.current),[]);let R=t.chatLunaStates.filter(({thinking:e})=>e),z=!t.messages.length&&!R.length,oe=l?`group`:f[c?.participantIds?.find(e=>e!==d)??``]?.isBot?`bot`:`user`,se=e=>o(r(`sandbox.error.friend`),()=>a.performFriendAction(e)),ce=e=>e.media?.map(e=>{let n=h[e.id];return b(`div`,{className:`sandbox-message-media`,children:n?e.type===`image`?b(`button`,{type:`button`,className:`sandbox-message-image`,"aria-label":r(`sandbox.media.viewImage`),onClick:e=>{t.selectionMode||(e.stopPropagation(),t.onOpenImage(n))},children:b(`img`,{src:n,alt:e.name})}):e.type===`audio`?b(`audio`,{src:n,controls:!0,preload:`metadata`}):e.type===`video`?b(`video`,{src:n,controls:!0,preload:`metadata`}):x(`a`,{href:n,download:e.name,className:`sandbox-message-file`,children:[b(Zd,{className:`size-[18px]`}),x(`span`,{children:[b(`strong`,{children:e.name}),b(`small`,{children:Af(e.size)})]})]}):b(`span`,{className:`sandbox-message-media-loading`,children:_[e.id]?r(`sandbox.media.unavailable`):r(`sandbox.media.loading`)})},e.id)});return x(y,{children:[x(ps,{disabled:t.selectionMode||!c,children:[b(ms,{render:b(`div`,{ref:T,className:`sandbox-message-scroller min-h-0 flex-1 overflow-y-auto overscroll-contain [overflow-anchor:none]`,"aria-label":r(`sandbox.chat.messages`),onScroll:L}),children:z?x(`div`,{className:`flex h-full flex-col items-center justify-center gap-2 px-6 text-center`,style:{paddingBottom:t.bottomSpace},children:[b(lp,{kind:oe,name:c?.title??l?.name??u?.name,src:m(l?.avatar??u?.avatar),className:`size-14`}),oe===`bot`?x(y,{children:[b(`h2`,{className:`mt-2 text-sm font-medium`,children:r(`sandbox.chat.emptyBotTitle`)}),b(`p`,{className:`text-xs text-muted-foreground`,children:r(`sandbox.chat.emptyBotHint`)})]}):b(`p`,{className:`text-xs text-muted-foreground`,children:r(`sandbox.chat.emptyHint`)})]}):x(`ol`,{ref:E,className:U(`sandbox-message-list`,C&&`has-tail`,w&&`has-outline`,t.selectionMode&&`is-selecting`),style:{paddingBottom:t.bottomSpace},children:[t.hasMoreMessages&&b(`li`,{className:`sandbox-message-history-row`,children:b(`button`,{type:`button`,className:`sandbox-message-history`,disabled:A,onClick:ie,children:r(A?`sandbox.common.loading`:`sandbox.chat.earlier`)})}),t.messages.map((n,u)=>{let p=n.authorId===d,m=p?`is-outgoing`:`is-incoming`,h=Bf(n,F),g=_v(t.messages,u,d),_=vv(t.messages,u,d),v=du(n),S=Vf(n,F),C=t.selectedIds.includes(n.id),w=t.selectionMode&&h.forward,T=Rf(n,F),E=zf(n,F),D=Lf(n,F),O=Dv(n.authorId,F),k=f[n.authorId]?.isBot,A=Ff(n,F)?Nf(n):void 0,j=!A&&If(n,F)?Pf(n)?.usage:void 0,N=Hf(t.messages,u,F)&&b(`li`,{className:`sandbox-message-fork-boundary`,children:r(`sandbox.chat.forkBoundary`)},`${n.id}:boundary`);if(jf(n,F))return x(e.Fragment,{children:[N,b(`li`,{"data-message-id":n.id,className:`sandbox-message-event`,children:Mf(n,ne)})]},n.id);let P=x(ps,{disabled:t.selectionMode,children:[b(ms,{render:b(`button`,{type:`button`,className:`sandbox-message-avatar-wrap`,"aria-label":r(`sandbox.chat.viewProfileOf`,{name:ne(n.authorId)}),onClick:e=>{t.selectionMode||(e.stopPropagation(),s.openProfile(n.authorId,{x:e.clientX,y:e.clientY}))},onContextMenu:e=>e.stopPropagation()}),children:b(lp,{kind:k?`bot`:`user`,name:ne(n.authorId),src:f[n.authorId]?.avatar,className:`size-8`})}),x(hs,{className:`sandbox-glass`,children:[x(K,{onClick:()=>s.openProfile(n.authorId),children:[b(Wd,{}),r(`sandbox.menu.profile`)]}),!p&&x(y,{children:[Ov(n.authorId,F).includes(`mention`)&&x(K,{onClick:()=>t.onMention(n.authorId),children:[b(gd,{}),r(`sandbox.member.mention`)]}),l&&c&&Ov(n.authorId,F).includes(`poke`)&&x(K,{onClick:()=>o(r(`sandbox.error.group`),()=>a.performGroupAction({action:`poke`,groupId:l.id,targetId:n.authorId,conversationId:c.id})),children:[b(Ud,{}),r(`sandbox.member.poke`)]}),Av(n.authorId,F)&&x(gs,{children:[x(_s,{children:[b(_f,{}),r(`sandbox.member.manage`)]}),b(vs,{className:`sandbox-glass`,children:b(Pv,{target:Tv(n.authorId,F),managementOnly:!0})})]}),Mv(n.authorId,F).includes(`request`)?x(K,{onClick:()=>se({action:`request`,targetId:n.authorId,comment:r(`sandbox.friend.requestComment`)}),children:[b(hf,{}),r(`sandbox.menu.requestFriend`),b(E_,{})]}):jv(n.authorId,F).pendingOutgoing?x(K,{disabled:!0,children:[b(kd,{}),r(`sandbox.menu.waitingPeer`)]}):jv(n.authorId,F).pendingIncoming?x(K,{disabled:!0,children:[b(vd,{}),r(`sandbox.menu.handleInNotice`)]}):null,!l&&c&&Mv(n.authorId,F).includes(`poke`)&&x(K,{onClick:()=>se({action:`poke`,targetId:n.authorId,conversationId:c.id}),children:[b(Ud,{}),r(`sandbox.member.poke`)]}),!l&&Mv(n.authorId,F).includes(`remark`)&&x(K,{onClick:()=>s.openRemark(n.authorId),children:[b(uf,{}),r(`sandbox.menu.remark`),b(E_,{})]}),!l&&Mv(n.authorId,F).includes(`delete`)&&x(K,{variant:`destructive`,onClick:()=>se({action:`delete`,targetId:n.authorId}),children:[b(mf,{}),r(`sandbox.menu.deleteFriend`)]})]})]})]}),re=x(`div`,{className:`sandbox-message-bubble`,onClickCapture:e=>{!t.selectionMode||!w||(e.preventDefault(),e.stopPropagation(),t.onToggleSelection(n.id))},children:[T&&x(`button`,{type:`button`,className:`sandbox-message-quote`,"aria-label":r(`sandbox.chat.jumpToQuote`),onClick:e=>{e.stopPropagation(),ae(T.id)},children:[b(`strong`,{className:`sandbox-message-quote-title`,children:ne(T.authorId)}),b(`span`,{children:Lf(T,F)})]}),n.forwardId?x(`button`,{type:`button`,className:`sandbox-message-quote sandbox-message-forward`,disabled:!E,"aria-label":r(`sandbox.forward.open`),onClick:e=>{t.selectionMode||!E||!n.forwardId||(e.stopPropagation(),t.onOpenForward({messageId:n.id,forwardId:n.forwardId}))},children:[b(`strong`,{className:`sandbox-message-quote-title`,children:E?.title||r(`sandbox.forward.title`)}),E?x(y,{children:[E.lines.map((e,t)=>b(`span`,{children:e},t)),x(`span`,{className:`sandbox-message-forward-entry`,children:[r(`sandbox.forward.total`,{count:E.total}),b(Dd,{className:`size-4`})]})]}):b(`span`,{children:D||r(`sandbox.forward.placeholder`)})]}):x(y,{children:[ce(n),D&&b(`span`,{className:`sandbox-message-text`,children:D})]}),v&&b(`span`,{className:`sandbox-message-recalled-label`,children:r(`sandbox.chat.recalled`)}),!!n.reactions?.length&&b(Iv,{reactions:n.reactions,readonly:!h.react,onToggle:e=>{let r=Uf(n,e,F);r&&t.onReact(r.messageId,r.emojiId,r.enabled)}})]}),I=n.chatLuna?.trace,L=!!ee[n.id];return x(e.Fragment,{children:[N,x(`li`,{"data-message-id":n.id,"aria-selected":t.selectionMode?C:void 0,className:U(`sandbox-message-row`,m,_,g&&`is-merged`,M===n.id&&`is-quote-target`,v&&`is-recalled`,S&&`is-inherited`,t.selectionMode&&`is-selecting`,w&&`is-selectable`),onClick:e=>{w&&e.currentTarget.contains(e.target)&&(e.target.closest(`a,button,audio,video`)||t.onToggleSelection(n.id))},children:[w&&b(`span`,{className:U(`sandbox-message-select-marker`,C&&`is-checked`),"aria-hidden":!0,children:b(wd,{className:`size-3`,strokeWidth:3})}),x(`div`,{className:`sandbox-message-select-body`,children:[P,x(`div`,{className:`sandbox-message-content`,children:[!g&&x(`div`,{className:`sandbox-message-sender-line`,children:[b(`span`,{children:ne(n.authorId)}),O&&b(`span`,{className:U(`sandbox-message-role-badge`,`is-${O.kind}`),children:O.title??r(`sandbox.role.${O.kind}`)})]}),x(`div`,{className:`sandbox-message-body`,children:[b(`div`,{className:`sandbox-message-stack`,children:x(ps,{disabled:v||t.selectionMode,children:[b(ms,{render:b(`div`,{className:`sandbox-message-bubble-trigger`,onContextMenu:e=>e.stopPropagation()}),children:re}),x(hs,{className:`sandbox-glass`,children:[k&&I&&x(K,{onClick:()=>i(Vv(I)),children:[b(Id,{}),r(`sandbox.chat.openRequest`)]}),h.reply&&x(K,{onClick:()=>t.onReply(n.id),children:[b(nf,{}),r(`sandbox.chat.reply`)]}),h.branch&&x(K,{onClick:()=>t.onBranch(n.id),children:[b(Vd,{}),r(`sandbox.chat.branch`)]}),h.react&&x(K,{onClick:()=>t.onOpenReactionPicker(n.id),children:[b(Ld,{}),r(`sandbox.chat.react`)]}),h.forward&&x(K,{onClick:()=>t.onEnterSelection(n.id),children:[b(Jd,{}),r(`sandbox.chat.multiSelect`)]}),h.recall&&x(y,{children:[b(ys,{}),x(K,{variant:`destructive`,onClick:()=>t.onRecall(n.id),children:[b(jd,{}),r(`sandbox.chat.recall`)]})]})]})]})}),b(`time`,{className:`sandbox-message-time`,children:cv(n.createdAt)})]})]})]})]}),A?x(`li`,{className:U(`sandbox-message-thinking-row`,m,v&&`is-recalled`),children:[x(`button`,{type:`button`,className:`sandbox-message-thinking-toggle`,"aria-expanded":L,onClick:()=>te(e=>({...e,[n.id]:!e[n.id]})),children:[A.usage&&b(Bv,{input:A.usage.inputTokens,output:A.usage.outputTokens}),b(`span`,{className:`sandbox-message-thinking-duration`,children:Nv(r,A.thoughtDurationMs)}),b(Dd,{className:U(`sandbox-message-thinking-chevron`,L&&`is-expanded`),"aria-hidden":!0})]}),L&&b(`div`,{className:`sandbox-message-thinking-panel`,children:b(`div`,{className:`sandbox-message-thinking-content`,children:A.thought})})]}):j&&b(`li`,{className:U(`sandbox-message-thinking-row is-usage-only`,m,v&&`is-recalled`),children:b(Bv,{input:j.inputTokens,output:j.outputTokens})})]},n.id)}),R.map(e=>x(`li`,{className:U(`sandbox-message-row`,e.botParticipantId===d?`is-outgoing`:`is-incoming`),children:[b(`span`,{className:`sandbox-message-avatar-wrap`,children:b(lp,{kind:`bot`,name:f[e.botParticipantId]?.name,src:f[e.botParticipantId]?.avatar,className:`size-8`})}),x(`div`,{className:`sandbox-message-content`,children:[b(`div`,{className:`sandbox-message-sender-line`,children:b(`span`,{children:f[e.botParticipantId]?.name??e.botParticipantId})}),b(`div`,{className:`sandbox-message-body`,children:b(`div`,{className:`sandbox-message-bubble`,"aria-label":r(`sandbox.chat.thinking`),children:b(`span`,{className:`sandbox-message-thinking-dots`,children:[0,1,2].map(e=>b(`span`,{className:`sandbox-message-thinking-dot`},e))})})})]})]},`${e.botParticipantId}:${e.conversationId}`))]})}),b(hs,{className:`sandbox-glass`,children:x(K,{variant:`destructive`,onClick:t.onClearConversation,children:[b(df,{}),r(`sandbox.chat.clear`)]})})]}),b(fv,{target:T,className:`sandbox-message-scrollbar`})]})});function Bv({input:e,output:t}){let n=q();return b(`span`,{className:`sandbox-message-thinking-usage`,"aria-label":n(`sandbox.chat.usage`),children:x(`span`,{className:`sandbox-message-thinking-usage-group`,children:[b(hd,{className:`sandbox-message-thinking-usage-icon`,"aria-hidden":!0}),b(`span`,{children:e??`-`}),b(ud,{className:`sandbox-message-thinking-usage-icon is-output`,"aria-hidden":!0}),b(`span`,{children:t??`-`})]})})}function Vv({sessionId:e,turn:t,step:n}){return`/traces/${encodeURIComponent(e)}?turn=${t}&step=${n}`}function Hv(e){let t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e);if(!t)return;let n=new Date(Number(t[1]),Number(t[2])-1,Number(t[3]));return n.getDate()===Number(t[3])?n:void 0}function Uv(e){if(!e)return``;let t=e=>String(e).padStart(2,`0`);return`${e.getFullYear()}-${t(e.getMonth()+1)}-${t(e.getDate())}`}function Wv(e){let t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e);if(!t)return;let n=Number(t[1]),r=Number(t[2]),i=Number(t[3]),a=new Date(n,r-1,i);if(a.getFullYear()!==n||a.getMonth()!==r-1||a.getDate()!==i)return;let o=new Date(a);return o.setDate(o.getDate()+1),{createdAtStart:a.toISOString(),createdAtEnd:o.toISOString()}}async function Gv(e){if(e.isLoaded())return!0;let t=0,n=e.maxAttempts??40,r=e.getOldestLoadedMessageId?.();for(;!e.isLoaded()&&e.canLoadMore()&&t<n;){if(t+=1,await e.loadMore(),e.isLoaded())return!0;let n=e.getOldestLoadedMessageId?.();if(e.getOldestLoadedMessageId&&n===r)return!1;r=n}return e.isLoaded()}var Kv=30;function qv({adapter:t,onClose:n}){let r=q(),{participants:i,participantNames:a}=Qu(),[o,s]=e.useState(``),[c,l]=e.useState(``),[u,d]=e.useState(!1),[f,p]=e.useState(!1),[m,h]=e.useState(``),[g,_]=e.useState([]),[v,y]=e.useState(),[S,C]=e.useState(``),[w,T]=e.useState(``),E=e.useRef(0),D=e.useRef({query:``}),O=e.useRef(null),k=e.useRef(t);k.current=t,e.useEffect(()=>O.current?.focus(),[]);let A=e.useCallback(async(e,t)=>{let n=k.current.conversationId,i=t?Wv(t):void 0,a=++E.current;if(D.current={query:e,...i},C(``),_([]),y(void 0),h(``),!n||!e&&!i)return p(!1);if(t&&!i)return p(!1),h(r(`sandbox.search.invalidDate`));p(!0);try{let e=await k.current.search({conversationId:n,...D.current,limit:Kv});if(a!==E.current)return;_(e.hits),y(e.nextBeforeMessageId)}catch(e){a===E.current&&h(Vu(e,r(`sandbox.search.failed`)))}finally{a===E.current&&p(!1)}},[r]);e.useEffect(()=>{let e=o.trim();if(!e){A(``,c);return}let t=setTimeout(()=>void A(e,c),250);return()=>clearTimeout(t)},[o,c,A]);let j=async()=>{let e=t.conversationId;if(!e||!v||f)return;let n=++E.current;p(!0),h(``);try{let r=await t.search({conversationId:e,...D.current,beforeMessageId:v,limit:Kv});if(n!==E.current)return;_(e=>{let t=new Set(e.map(({messageId:e})=>e));return[...e,...r.hits.filter(({messageId:e})=>!t.has(e))]}),y(r.nextBeforeMessageId)}catch(e){n===E.current&&h(Vu(e,r(`sandbox.search.failed`)))}finally{n===E.current&&p(!1)}},M=async e=>{if(!w){T(e.messageId),h(``);try{if(!await Gv({messageId:e.messageId,isLoaded:()=>k.current.isLoaded(e.messageId),canLoadMore:()=>k.current.canLoadMore(),getOldestLoadedMessageId:()=>k.current.oldestLoadedId(),loadMore:()=>k.current.loadMore()}))return h(r(`sandbox.search.notLoaded`));if(await new Promise(e=>requestAnimationFrame(e)),!k.current.reveal(e.messageId))return h(r(`sandbox.search.notFound`));C(e.messageId)}catch(e){h(Vu(e,r(`sandbox.search.revealFailed`)))}finally{T(``)}}},N=m||(f&&!g.length?r(`sandbox.search.searching`):``)||(w?r(`sandbox.search.revealing`):``)||(!f&&!g.length?r(`sandbox.search.empty`):``),ee=new Date;return x(`section`,{role:`search`,"aria-label":r(`sandbox.search.label`),className:`relative w-72 min-w-36 shrink`,children:[x(En,{className:`h-8`,children:[b(On,{children:b(af,{})}),b(kn,{ref:O,type:`search`,value:o,autoComplete:`off`,className:`sandbox-search-input text-[13px]!`,placeholder:r(`sandbox.search.placeholder`),"aria-label":r(`sandbox.search.input`),onChange:e=>s(e.target.value),onKeyDown:e=>{e.key!==`Escape`||u||(e.preventDefault(),e.stopPropagation(),n())}}),x(On,{align:`inline-end`,className:`gap-0.5`,children:[x(Pn,{open:u,onOpenChange:d,children:[b(Fn,{render:b(W,{variant:`ghost`,size:`icon-xs`,className:U(c&&`text-primary`),"aria-pressed":!!c,"aria-label":c?r(`sandbox.search.dateCurrent`,{date:c}):r(`sandbox.search.date`)}),children:b(Cd,{})}),b(In,{align:`end`,className:`sandbox-glass w-auto p-0`,children:b(os,{mode:`single`,captionLayout:`dropdown`,startMonth:new Date(ee.getFullYear()-9,0),endMonth:ee,selected:Hv(c),onSelect:e=>{l(Uv(e)),d(!1)}})})]}),b(W,{variant:`ghost`,size:`icon-xs`,"aria-label":r(o||c?`sandbox.search.clear`:`sandbox.search.close`),onClick:()=>{o||c?(s(``),l(``),O.current?.focus()):n()},children:b(yf,{})})]})]}),(o.trim()||c)&&x(`div`,{className:`absolute top-10 right-0 z-30 flex max-h-96 w-80 flex-col gap-0.5 overflow-y-auto rounded-xl sandbox-search-results p-1.5 text-popover-foreground shadow-popup ring-1 ring-border`,role:`listbox`,"aria-label":r(`sandbox.search.results`),children:[N&&b(`p`,{role:`status`,"aria-live":`polite`,className:`px-2 py-3 text-center text-xs text-muted-foreground`,children:N}),g.map(e=>{let t=i[e.authorId]??{name:e.authorId,isBot:!1};return x(`button`,{type:`button`,role:`option`,"aria-selected":S===e.messageId,disabled:!!w,className:U(`flex items-start gap-2.5 rounded-lg px-2 py-1.5 text-left hover:bg-accent disabled:opacity-60`,S===e.messageId&&`bg-accent`),onClick:()=>M(e),children:[b(lp,{kind:t.isBot?`bot`:`user`,name:t.name,src:t.avatar,className:`size-7`}),x(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[x(`span`,{className:`flex items-center gap-2`,children:[b(`strong`,{className:`truncate text-xs font-medium`,children:t.name}),b(`time`,{className:`ml-auto shrink-0 text-[11px] text-muted-foreground`,dateTime:e.createdAt,children:new Intl.DateTimeFormat(void 0,{month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`}).format(new Date(e.createdAt))})]}),b(`span`,{className:`line-clamp-2 text-xs text-muted-foreground`,children:Of(e.summary,a)})]})]},e.messageId)}),v&&g.length>0&&b(W,{variant:`ghost`,size:`sm`,disabled:f||!!w,onClick:j,children:r(f?`sandbox.common.loading`:`sandbox.search.more`)})]})]})}var Jv=80;function Yv({detailsVisible:t,onToggleDetails:n,onBack:r,mentionBridge:i,className:a}){let o=q(),{store:s,run:c,dialogs:l}=Zu(),u=Qu(),{snapshot:d,conversation:f,group:p,peer:m,bot:h,operatorId:g,participants:_,participantNames:v,resolveAvatar:S}=u,C=e.useRef(null),w=e.useRef(null),[T,E]=e.useState(``),[D,O]=e.useState(``),[k,A]=e.useState(sp()),[j,M]=e.useState(!1),[N,ee]=e.useState([]),[te,P]=e.useState(``),[F,ne]=e.useState(72),[re,I]=e.useState(!1),L=e.useMemo(()=>Yu(d,f?.id),[d,f?.id]),ie=e.useMemo(()=>{let e=new Map(d.messages.map(e=>[e.id,e]));return Object.fromEntries(L.flatMap(({replyToMessageId:t})=>{let n=t?e.get(t):void 0;return n?[[n.id,n]]:[]}))},[L,d.messages]),ae=e.useMemo(()=>Kf(L,d.forwards??[]),[L,d.forwards]),R=e.useMemo(()=>Ef({messages:L,conversation:f,operatorId:g,group:p}),[L,f,g,p]),z=e.useMemo(()=>g?Object.fromEntries(d.participants.map(({id:e})=>[e,{isFriend:d.friendships.some(({participantIds:t})=>t.includes(g)&&t.includes(e)),pendingOutgoing:d.requests.some(t=>t.type===`friend`&&t.requesterId===g&&t.targetId===e),pendingIncoming:d.requests.some(t=>t.type===`friend`&&t.requesterId===e&&t.targetId===g)}])):{},[d,g]),oe=e.useMemo(()=>p?.members.flatMap(e=>{let t=_[e.participantId];if(!t)return[];let n=e.card?.trim();return[{id:e.participantId,name:n||t.name,avatar:t.avatar,kind:t.isBot?`bot`:`user`,keywords:n&&n!==t.name?[t.name]:void 0}]})??[],[p,_]),se=e.useMemo(()=>({recent:Xf(Yf({scene:d,conversations:u.conversations,operatorId:g,resolveAvatar:S,emptyPreview:o(`sandbox.chat.emptyPreview`)})),friends:Au(d,g).filter(e=>e.isFriend&&e.conversationId).map(e=>({conversationId:e.conversationId,title:e.displayName,subtitle:o(e.statusKey,{name:e.participantName}),avatar:S(e.avatar),avatarKind:e.isBot?`bot`:`user`})),groups:ju(d,g).filter(e=>e.member&&e.conversationId).map(e=>({conversationId:e.conversationId,title:e.name,subtitle:o(`sandbox.chat.groupSubtitle`,{id:e.id,count:e.members.length}),avatar:S(e.avatar),avatarKind:`group`}))}),[d,u.conversations,g,S,o]),ce=u.workspace.chatLunaStates.filter(({conversationId:e})=>e===f?.id);e.useEffect(()=>{E(``),O(``),A(sp()),M(!1),ee(tp()),I(!1)},[f?.id]),e.useEffect(()=>{let e=e=>{e.key!==`Escape`||!k.active||j||(e.preventDefault(),A(sp()))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[k.active,j]);let le=e=>w.current?.insertMention({id:e,name:oe.find(t=>t.id===e)?.name??v[e]??e});e.useEffect(()=>{i&&(i.current=le)});let ue={messageCapabilities:R},de=L.find(({id:e})=>e===T),fe=f?.id,pe=async(e,t)=>{let n=await np({input:e,load:e=>s.getForwardMessage(e)});n&&ee(e=>ep(e,n,t))},me=f?.title??p?.name??m?.name??f?.id??o(`sandbox.chat.pick`),he=p?.name??m?.name??``,ge=f?.kind===`instance`?`${he} · `:``,_e=p?`${ge}${o(`sandbox.chat.groupSubtitle`,{id:p.id,count:p.members.length})}`:h?`${ge}${o(`sandbox.chat.botSubtitle`)}`:m?`${ge}${o(`sandbox.chat.friendSubtitle`)}`:o(`sandbox.chat.none`),ve=p?`group`:h?`bot`:`user`;return x(`main`,{className:U(`sandbox-chat-pane flex min-h-0 min-w-0 flex-1 flex-col bg-background`,a),children:[x(`header`,{className:`sandbox-chat-header flex h-14 shrink-0 items-center gap-2 border-b border-border px-3`,children:[r&&b(W,{variant:`ghost`,size:`icon-sm`,"aria-label":o(`sandbox.chat.back`),onClick:r,children:b(Ed,{})}),x(`button`,{type:`button`,className:`flex min-w-0 items-center gap-2.5 rounded-lg px-1 py-1 text-left hover:bg-accent/60 disabled:hover:bg-transparent`,disabled:!p&&!m,"aria-label":o(`sandbox.chat.viewProfileOf`,{name:me}),onClick:e=>{let t={x:e.clientX,y:e.clientY};p?l.openGroupProfile(p.id,t):m&&l.openProfile(m.id,t)},children:[b(lp,{kind:ve,name:me,src:S(p?.avatar??m?.avatar),className:`size-8`}),x(`span`,{className:`flex min-w-0 flex-col`,children:[b(`strong`,{className:`truncate text-sm font-medium`,children:me}),b(`span`,{className:`truncate text-[11px] text-muted-foreground`,children:_e})]})]}),x(`div`,{className:`ml-auto flex min-w-0 items-center gap-1`,children:[re&&f?b(qv,{adapter:{conversationId:fe,search:e=>s.searchConversationMessages(e),isLoaded:e=>Yu(s.snapshot??d,fe).some(({id:t})=>t===e),canLoadMore:()=>!!Xv(s,fe)?.hasMoreMessages,oldestLoadedId:()=>Yu(s.snapshot??d,fe)[0]?.id,loadMore:()=>fe?s.loadEarlierMessages(fe):Promise.resolve(),reveal:e=>C.current?.revealMessage(e)??!1},onClose:()=>I(!1)}):b(W,{variant:`ghost`,size:`icon`,disabled:!f,"aria-label":o(`sandbox.search.label`),onClick:()=>{A(sp()),I(!0)},children:b(af,{})}),n&&b(W,{variant:`ghost`,size:`icon`,"aria-pressed":t,"aria-label":o(t?`sandbox.details.close`:`sandbox.details.open`),onClick:n,children:b(Fd,{})})]})]}),f?b(y,{children:x(`div`,{className:`sandbox-chat-stage relative flex min-h-0 flex-1 flex-col`,children:[b(zv,{ref:C,bottomSpace:k.active?Jv:F,messages:L,chatLunaStates:ce,replyMessages:ie,forwardPreviews:ae,capabilities:R,friendMenuStates:z,hasMoreMessages:!!f.hasMoreMessages,scrollKey:`${s.spaceId??`main`}:${f.id}`,selectionMode:k.active,selectedIds:[...k.messageIds],onReply:e=>{E(e),requestAnimationFrame(()=>w.current?.focus())},onBranch:e=>c(o(`sandbox.error.branch`),()=>s.branchConversationInstance({conversationId:f.id,messageId:e})),onRecall:e=>c(o(`sandbox.error.recall`),()=>s.recallMessage({conversationId:f.id,messageId:e})),onReact:(e,t,n)=>c(o(`sandbox.error.react`),()=>s.setMessageReaction({conversationId:f.id,messageId:e,emojiId:t,enabled:n})),onOpenReactionPicker:e=>!k.active&&O(e),onEnterSelection:e=>{let t=ap(e,ue);t&&(E(``),I(!1),A(t))},onToggleSelection:e=>A(t=>op(t,e,ue)),onOpenForward:e=>void pe(e,`replace`),onOpenImage:P,onLoadHistory:()=>s.loadEarlierMessages(f.id),onClearConversation:()=>c(o(`sandbox.error.clear`),()=>s.clearConversationMessages({conversationId:f.id})),onMention:le}),!k.active&&b(N_,{ref:w,replyingTo:de?{id:de.id,authorName:v[de.authorId]??de.authorId,content:Of(de.content,v)}:void 0,mentionCandidates:oe,onClearReply:()=>E(``),onOpenImage:P,onSpaceChange:ne,onSend:async e=>{e.media?.length?await s.sendMediaMessage({conversationId:e.conversationId,media:e.media,content:e.content||void 0,replyToMessageId:e.replyToMessageId}):await s.sendMessage({conversationId:e.conversationId,content:e.content,replyToMessageId:e.replyToMessageId})}}),k.active&&x(`div`,{role:`toolbar`,"aria-label":o(`sandbox.chat.selectionToolbar`),className:`sandbox-selection-bar`,children:[b(`strong`,{className:`text-[13px] font-medium`,children:o(`sandbox.chat.selected`,{count:k.messageIds.length})}),x(`div`,{className:`flex gap-2`,children:[b(W,{variant:`outline`,onClick:()=>A(sp()),children:o(`sandbox.common.cancel`)}),x(W,{disabled:!k.messageIds.length,onClick:()=>M(!0),children:[b(cf,{}),o(`sandbox.forward.send`)]})]})]})]})}):b(`div`,{className:`flex flex-1 items-center justify-center text-sm text-muted-foreground`,children:o(`sandbox.chat.pick`)}),b(q_,{open:!!D,onOpenChange:e=>!e&&O(``),onSelect:e=>{f&&D&&c(o(`sandbox.error.react`),()=>s.setMessageReaction({conversationId:f.id,messageId:D,emojiId:e,enabled:!0}))}}),b(Q_,{open:j,targets:se,onOpenChange:M,onConfirm:async e=>{let t=cp(k,e,ue);if(t.kind===`reject`)throw Error(o(`sandbox.forward.noSelectable`));await s.sendForwardMessage({conversationId:e,messageIds:[...t.messageIds]}),A(sp())}}),b($_,{stack:N,imageOpen:!!te,onCloseFrom:e=>ee(t=>e?t.slice(0,e):tp()),onOpenForward:e=>void pe({forwardId:e},`push`),onOpenImage:P}),te&&b(iv,{url:te,onClose:()=>P(``)})]})}function Xv(e,t){let n=e.snapshot;if(!(!n||!t))return[...n.conversations,...n.conversationInstances??[]].find(({id:e})=>e===t)}function Zv({request:e,onClose:t}){let n=q(),r=J_(e);return b(Bn,{open:!!e,onOpenChange:e=>!e&&t(),children:x(Un,{children:[x(Wn,{children:[b(Kn,{children:r?.title}),b(qn,{children:r?.description})]}),x(Gn,{children:[b(Yn,{children:n(`sandbox.common.cancel`)}),b(Jn,{variant:`destructive`,onClick:()=>{t(),e?.onConfirm()},children:r?.action})]})]})})}var Qv=`chatluna.onebot-sandbox.details-layout`,$v=`announcements`,ey=`members`;function ty(){let e=R(Qv);if(!e||typeof e!=`object`)return;let t=e,n=t[$v],r=t[ey];if(typeof n==`number`&&typeof r==`number`)return{[$v]:n,[ey]:r}}function ny({onClose:t,onMention:n,className:r}){let i=q(),{store:a,dialogs:o}=Zu(),{group:s,conversation:c,participants:l}=Qu(),[u,d]=e.useState(``),[f,p]=e.useState(!1),[m,h]=e.useState(``),[g,_]=e.useState(!1),[v,y]=e.useState(``),[S,C]=e.useState(),[w,T]=e.useState(``),[E]=e.useState(ty);e.useEffect(()=>{d(``),p(!1),h(``),y(``),T(``)},[c?.id]);let D=(e,t)=>bv({card:t},l[e]?.name??e),O=u.trim().toLowerCase(),k=s?.members.filter(e=>!O||D(e.participantId,e.card).toLowerCase().includes(O)||e.participantId.includes(O))??[],A=async e=>{e.preventDefault();let t=m.trim();if(!(!s||!t||g)){_(!0),T(``);try{await a.setGroupAnnouncement({groupId:s.id,content:t}),h(``),p(!1)}catch(e){T(Vu(e,i(`sandbox.details.publishFailed`)))}finally{_(!1)}}},j=async e=>{if(!(!s||v)){y(e),T(``);try{await a.deleteGroupAnnouncement({groupId:s.id,announcementId:e})}catch(e){T(Vu(e,i(`sandbox.details.deleteFailed`)))}finally{y(``)}}};if(!s)return null;let M=i(`sandbox.details.group`);return x(`aside`,{className:U(`flex min-h-0 w-72 shrink-0 flex-col border-l border-border bg-sidebar/40`,r),"aria-label":M,children:[x(`header`,{className:`flex h-14 shrink-0 items-center justify-between border-b border-border px-4`,children:[b(`strong`,{className:`text-sm font-medium`,children:M}),b(W,{variant:`ghost`,size:`icon-sm`,"aria-label":i(`sandbox.details.close`),onClick:t,children:b(yf,{})})]}),x(Ql,{orientation:`vertical`,className:`min-h-0 flex-1`,defaultLayout:E,onLayoutChanged:e=>z(Qv,e),children:[x($l,{id:$v,defaultSize:`40`,minSize:96,maxSize:`75`,className:`flex min-h-0 flex-col gap-2 p-4`,style:{overflow:`hidden`},children:[x(`div`,{className:`flex items-center justify-between`,children:[b(`h3`,{className:`text-[13px] font-medium`,children:i(`sandbox.details.announcements`)}),b(W,{variant:`ghost`,size:`icon-xs`,"aria-label":i(f?`sandbox.details.cancelAnnouncement`:`sandbox.details.addAnnouncement`),onClick:()=>{p(e=>!e),h(``),T(``)},children:b(ef,{className:U(`transition-transform duration-200 ease-spring`,f&&`rotate-45`)})})]}),x(`div`,{className:`flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto`,children:[w&&b(`span`,{role:`alert`,className:`text-xs text-destructive`,children:w}),f&&x(`form`,{className:`flex shrink-0 flex-col gap-2`,onSubmit:A,children:[b(wn,{rows:3,value:m,placeholder:i(`sandbox.details.announcementPlaceholder`),onChange:e=>h(e.target.value)}),b(W,{type:`submit`,size:`sm`,className:`self-end`,disabled:g||!m.trim(),children:i(g?`sandbox.details.publishing`:`sandbox.details.publish`)})]}),!s.announcements.length&&b(`p`,{className:`py-2 text-xs text-muted-foreground`,children:i(`sandbox.details.noAnnouncement`)}),s.announcements.map(e=>x(`article`,{className:`group/notice relative rounded-lg bg-muted/60 p-2.5 pr-8`,children:[b(`p`,{className:`text-xs leading-5 whitespace-pre-wrap`,children:e.content}),x(`time`,{className:`mt-1 block text-[11px] text-muted-foreground`,children:[l[e.authorId]?.name??e.authorId,` · `,new Intl.DateTimeFormat(void 0,{month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`}).format(new Date(e.createdAt))]}),b(W,{variant:`ghost`,size:`icon-xs`,className:`absolute top-1.5 right-1.5 opacity-0 group-hover/notice:opacity-100 focus-visible:opacity-100`,disabled:v===e.id,"aria-label":i(`sandbox.details.deleteAnnouncement`,{content:e.content}),onClick:()=>C({title:i(`sandbox.details.deleteAnnouncementTitle`),description:i(`sandbox.details.deleteAnnouncementDescription`,{content:e.content}),action:i(`sandbox.common.delete`),onConfirm:()=>void j(e.id)}),children:b(df,{})})]},e.id))]})]}),b(eu,{"aria-label":i(`sandbox.details.resize`)}),x($l,{id:ey,minSize:160,className:`flex min-h-0 flex-col gap-2 p-4`,style:{overflow:`hidden`},children:[b(`h3`,{className:`text-[13px] font-medium`,children:i(`sandbox.details.members`,{count:s.members.length})}),b(Tn,{type:`search`,className:`sandbox-search-input h-8`,value:u,placeholder:i(`sandbox.details.memberSearch`),onChange:e=>d(e.target.value)}),x(`div`,{className:`-mx-2 flex min-h-0 flex-1 flex-col gap-0.5 overflow-y-auto`,children:[!k.length&&b(`p`,{className:`px-2 py-4 text-center text-xs text-muted-foreground`,children:i(`sandbox.details.noMember`)}),k.map(e=>x(ps,{children:[x(ms,{render:b(`button`,{type:`button`,className:`flex items-center gap-2.5 rounded-lg px-2 py-1.5 text-left hover:bg-accent`,onClick:t=>o.openProfile(e.participantId,{x:t.clientX,y:t.clientY})}),children:[b(lp,{kind:l[e.participantId]?.isBot?`bot`:`user`,name:D(e.participantId,e.card),src:l[e.participantId]?.avatar,className:`size-8`}),x(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[b(`strong`,{className:`truncate text-xs font-medium`,children:D(e.participantId,e.card)}),b(`small`,{className:`text-[11px] text-muted-foreground`,children:e.participantId})]}),x(`span`,{className:`flex shrink-0 gap-1`,children:[e.title&&b(`span`,{className:`sandbox-message-role-badge is-title`,children:e.title}),e.role!==`member`&&b(`span`,{className:`sandbox-message-role-badge is-${e.role}`,children:i(`sandbox.role.${e.role}`)})]})]}),b(hs,{className:`sandbox-glass`,children:b(Pv,{target:e,onMention:n})})]},e.participantId))]})]})]}),b(Zv,{request:S,onClose:()=>C(void 0)})]})}function ry(e,t){if(!t)return{friends:[],groups:[]};let n=new Set(e.groups.filter(({members:e})=>e.some(({participantId:e,role:n})=>e===t&&(n===`owner`||n===`admin`))).map(({id:e})=>e));return{friends:e.requests.filter(({type:e,targetId:n})=>e===`friend`&&n===t),groups:e.requests.filter(({type:e,subType:r,groupId:i,targetId:a})=>e===`group`&&!!i&&(r===`invite`&&a===t||(r??`add`)===`add`&&n.has(i)))}}function iy(e){let t=new Date(e),n=e=>String(e).padStart(2,`0`);return`${n(t.getMonth()+1)}/${n(t.getDate())} ${n(t.getHours())}:${n(t.getMinutes())}`}function ay({requests:t}){let n=q(),{store:r}=Zu(),{participants:i,snapshot:a}=Qu(),[o,s]=e.useState(`friends`),[c,l]=e.useState(``),[u,d]=e.useState(``),f=o===`friends`?t.friends:t.groups,p=e=>a.groups.find(t=>t.id===e)?.name??n(`sandbox.notice.group`),m=e=>i[e]?.name??e,h=async(e,t)=>{l(e.id),d(``);try{await r.handleRelationshipRequest(e.id,t)}catch(e){d(Vu(e,n(`sandbox.notice.failed`)))}finally{l(``)}};return x(`div`,{className:`flex max-h-96 flex-col`,children:[b(`div`,{className:`flex gap-1 border-b border-border p-1.5`,children:[`friends`,`groups`].map(e=>x(W,{variant:`ghost`,size:`sm`,className:U(`flex-1`,o===e&&`bg-accent`),onClick:()=>s(e),children:[n(`sandbox.notice.${e}`),(e===`friends`?t.friends:t.groups).length>0&&b(`span`,{className:`ml-1 rounded-full bg-destructive px-1.5 text-[10px] leading-4 text-white`,children:(e===`friends`?t.friends:t.groups).length})]},e))}),x(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-1.5`,children:[u&&b(`p`,{role:`alert`,className:`px-2 py-1 text-xs text-destructive`,children:u}),!f.length&&b(`p`,{className:`py-8 text-center text-xs text-muted-foreground`,children:n(`sandbox.notice.empty`)}),f.map(e=>x(`article`,{className:`flex items-start gap-2.5 rounded-lg p-2 hover:bg-accent/50`,children:[b(lp,{kind:i[e.requesterId]?.isBot?`bot`:`user`,name:m(e.requesterId),src:i[e.requesterId]?.avatar,className:`size-8`}),x(`div`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[b(`strong`,{className:`truncate text-[13px] font-medium`,children:e.type===`friend`?m(e.requesterId):p(e.groupId)}),b(`span`,{className:`truncate text-xs text-muted-foreground`,children:e.type===`friend`?n(`sandbox.notice.fromQQ`,{id:e.requesterId}):n(e.subType===`invite`?`sandbox.notice.invite`:`sandbox.notice.join`,{name:m(e.requesterId)})}),e.comment&&b(`small`,{className:`truncate text-[11px] text-muted-foreground`,children:e.comment}),b(`time`,{className:`text-[11px] text-muted-foreground`,children:iy(e.createdAt)})]}),x(`div`,{className:`flex shrink-0 gap-1`,children:[b(W,{size:`xs`,disabled:c===e.id,onClick:()=>h(e,!0),children:n(`sandbox.notice.approve`)}),b(W,{size:`xs`,variant:`outline`,disabled:c===e.id,onClick:()=>h(e,!1),children:n(`sandbox.notice.reject`)})]})]},e.id))]})]})}function oy({onSelectConversation:t,className:n}){let r=q(),{store:i,run:a,dialogs:o}=Zu(),s=Qu(),{snapshot:c,operatorId:l,operator:u,conversation:d,group:f,resolveAvatar:p}=s,[m,h]=e.useState(`recent`),[g,_]=e.useState(``),[v,S]=e.useState({}),C=e.useMemo(()=>Yf({scene:c,conversations:s.conversations,operatorId:l,resolveAvatar:p,emptyPreview:r(`sandbox.chat.emptyPreview`)}),[c,s.conversations,l,p,r]),w=ry(c,l),T=w.friends.length+w.groups.length,E=su(c);e.useEffect(()=>{d?.kind===`instance`&&S(e=>e[d.rootConversationId]?e:{...e,[d.rootConversationId]:!0})},[d]);let D=g.trim().toLowerCase(),O=m===`friends`?Au(c,l).filter(({id:e,displayName:t})=>!D||e.includes(D)||t.toLowerCase().includes(D)):[],k=m===`groups`?ju(c,l).filter(({id:e,name:t})=>!D||e.includes(D)||t.toLowerCase().includes(D)):[],A=m===`recent`?!C.length:m===`friends`?!O.length:!k.length,j=!u&&m!==`groups`,M=(e,t)=>a(e,()=>i.performFriendAction(t)),N=(e,t)=>a(e,()=>i.performGroupAction(t)),ee=[{id:`recent`,icon:kd},{id:`friends`,icon:gf},{id:`groups`,icon:_f}];return x(`aside`,{className:U(`flex min-h-0 w-72 shrink-0 flex-col border-r border-border bg-sidebar/40`,n),"aria-label":r(`sandbox.sidebar.label`),children:[x(`header`,{className:`flex items-center gap-1 px-3 pt-3 pb-2`,children:[b(Ms,{className:`min-w-0 flex-1`,value:m,onValueChange:e=>{h(e),_(``)},children:b(Fs,{className:`w-full`,"aria-label":r(`sandbox.sidebar.tabs`),children:ee.map(({id:e,icon:t})=>x(Is,{value:e,className:`gap-1 px-1.5 text-xs`,children:[b(t,{className:`size-3.5`}),r(`sandbox.sidebar.${e}`)]},e))})}),x(Pn,{children:[b(Fn,{render:x(W,{variant:`ghost`,size:`icon`,className:`relative`,"aria-label":T?r(`sandbox.notice.labelCount`,{count:T}):r(`sandbox.notice.label`),children:[b(vd,{}),T>0&&b(`span`,{className:`absolute top-1 right-1 size-2 rounded-full bg-destructive`})]})}),b(In,{align:`end`,className:`sandbox-glass w-80 p-0`,children:b(ay,{requests:w})})]})]}),m!==`recent`&&b(`div`,{className:`px-3 pb-2`,children:x(`div`,{className:`relative`,children:[b(af,{className:`pointer-events-none absolute top-1/2 left-2.5 size-4 -translate-y-1/2 text-muted-foreground`}),b(Tn,{type:`search`,className:`sandbox-search-input h-8 pl-8!`,value:g,autoComplete:`off`,"aria-label":r(`sandbox.sidebar.search`),placeholder:r(m===`friends`?`sandbox.sidebar.searchFriends`:`sandbox.sidebar.searchGroups`),onChange:e=>_(e.target.value)})]})}),b(xs,{className:`min-h-0 flex-1`,children:x(`div`,{className:`flex flex-col gap-0.5 px-2 pb-3`,children:[j&&b(Qg,{type:`participant`,trigger:x(`button`,{type:`button`,className:`flex items-center gap-3 rounded-lg px-2 py-2 text-left transition-colors hover:bg-accent`,children:[b(`span`,{className:`flex size-9 items-center justify-center rounded-full border border-dashed border-border text-muted-foreground`,children:b(ef,{className:`size-4`})}),x(`span`,{className:`flex min-w-0 flex-col`,children:[b(`strong`,{className:`text-[13px] font-medium`,children:r(`sandbox.create.participant`)}),b(`small`,{className:`text-xs text-muted-foreground`,children:r(`sandbox.sidebar.addAccountHint`)})]})]})}),m===`groups`&&b(Qg,{type:`group`,operator:u,bots:E,trigger:x(`button`,{type:`button`,className:`flex items-center gap-3 rounded-lg px-2 py-2 text-left transition-colors hover:bg-accent`,children:[b(`span`,{className:`flex size-9 items-center justify-center rounded-full border border-dashed border-border text-muted-foreground`,children:b(ef,{className:`size-4`})}),x(`span`,{className:`flex min-w-0 flex-col`,children:[b(`strong`,{className:`text-[13px] font-medium`,children:r(`sandbox.sidebar.addGroup`)}),b(`small`,{className:`text-xs text-muted-foreground`,children:r(`sandbox.sidebar.addGroupHint`)})]})]})}),m===`recent`&&C.map(e=>b(cy,{node:e,activeId:d?.id,expanded:!!v[e.id],onToggle:()=>S(t=>({...t,[e.id]:!t[e.id]})),onSelect:t},e.id)),O.map(e=>x(ps,{children:[b(ms,{render:b(sy,{kind:e.isBot?`bot`:`user`,title:e.displayName,subtitle:r(e.statusKey,{name:e.participantName}),avatar:p(e.avatar),active:!!e.conversationId&&e.conversationId===d?.id,status:r(e.isFriend?`sandbox.sidebar.added`:e.pendingOutgoing||e.pendingIncoming?`sandbox.sidebar.pending`:`sandbox.sidebar.notAdded`),onClick:n=>e.conversationId?t(e.conversationId):o.openProfile(e.id,{x:n.clientX,y:n.clientY})})}),x(hs,{className:`sandbox-glass`,children:[x(K,{onClick:()=>o.openProfile(e.id),children:[b(Wd,{}),r(`sandbox.menu.profile`)]}),!e.isFriend&&!e.pendingOutgoing&&!e.pendingIncoming&&x(K,{onClick:()=>M(r(`sandbox.error.friend`),{action:`request`,targetId:e.id,comment:r(`sandbox.friend.requestComment`)}),children:[b(hf,{}),r(`sandbox.menu.requestFriend`),b(E_,{})]}),e.pendingOutgoing&&x(K,{disabled:!0,children:[b(kd,{}),r(`sandbox.menu.waitingPeer`)]}),e.pendingIncoming&&x(K,{disabled:!0,children:[b(vd,{}),r(`sandbox.menu.handleInNotice`)]}),e.isFriend&&x(y,{children:[x(K,{onClick:()=>o.openRemark(e.id),children:[b(uf,{}),r(`sandbox.menu.remark`),b(E_,{})]}),x(K,{variant:`destructive`,onClick:()=>M(r(`sandbox.error.friend`),{action:`delete`,targetId:e.id}),children:[b(mf,{}),r(`sandbox.menu.deleteFriend`)]})]}),e.isFriend&&f&&!f.members.some(({participantId:t})=>t===e.id)&&x(K,{onClick:()=>N(r(`sandbox.error.group`),{action:`invite`,groupId:f.id,targetId:e.id}),children:[b(hf,{}),r(`sandbox.menu.inviteToGroup`),b(E_,{})]}),b(ys,{}),b(dy,{target:{type:e.isBot?`bot`:`user`,id:e.id}})]})]},e.id)),k.map(e=>x(ps,{children:[b(ms,{render:b(sy,{kind:`group`,title:e.name,subtitle:r(`sandbox.chat.groupSubtitle`,{id:e.id,count:e.members.length}),avatar:p(e.avatar),active:!!e.conversationId&&e.conversationId===d?.id,status:r(e.member?`sandbox.sidebar.joined`:e.pending?`sandbox.sidebar.pending`:`sandbox.sidebar.notJoined`),onClick:()=>e.conversationId&&t(e.conversationId)})}),x(hs,{className:`sandbox-glass`,children:[!e.member&&!e.pending&&x(K,{onClick:()=>N(r(`sandbox.error.group`),{action:`request-join`,groupId:e.id,comment:r(`sandbox.group.requestComment`)}),children:[b(hf,{}),r(`sandbox.menu.requestJoin`),b(E_,{})]}),!e.member&&e.pending&&x(K,{disabled:!0,children:[b(kd,{}),r(`sandbox.menu.waitingAdmin`)]}),e.member&&b(uy,{groupId:e.id,role:e.member.role}),b(ys,{}),b(dy,{target:{type:`group`,id:e.id}})]})]},e.id)),A&&b(`p`,{className:`px-3 py-8 text-center text-xs text-muted-foreground`,children:r(D?`sandbox.sidebar.empty`:`sandbox.sidebar.none.${m}`)})]})})]})}var sy=e.forwardRef(function({kind:e,title:t,subtitle:n,avatar:r,status:i,time:a,active:o,className:s,...c},l){return x(`button`,{ref:l,type:`button`,className:U(`flex w-full items-center gap-3 rounded-lg px-2 py-2 text-left transition-colors hover:bg-accent`,o&&`bg-accent`,s),"aria-current":o||void 0,...c,children:[b(lp,{kind:e,name:t,src:r}),x(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[x(`span`,{className:`flex items-center gap-2`,children:[b(`strong`,{className:`truncate text-[13px] font-medium`,children:t}),a&&b(`time`,{className:`ml-auto shrink-0 text-[11px] text-muted-foreground`,children:a})]}),b(`small`,{className:`truncate text-xs text-muted-foreground`,children:n})]}),i&&b(Zn,{variant:`outline`,className:`shrink-0 text-[10px] text-muted-foreground`,children:i})]})});function cy({node:e,activeId:t,expanded:n,onToggle:r,onSelect:i}){let a=q(),{store:o,run:s,dialogs:c}=Zu(),l=e.children.length;return x(`div`,{className:`flex flex-col`,children:[x(ps,{children:[b(ms,{render:x(`div`,{className:`group relative`,children:[b(sy,{kind:e.avatarKind,title:e.title,subtitle:e.preview,avatar:e.avatar,time:e.time,active:e.id===t,className:l?`pr-12!`:void 0,onClick:()=>i(e.id)}),l>0&&x(`button`,{type:`button`,className:`absolute top-1/2 right-2 flex h-6 -translate-y-1/2 items-center gap-0.5 rounded-md px-1.5 text-[11px] text-muted-foreground hover:bg-background hover:text-foreground`,"aria-expanded":n,"aria-label":a(n?`sandbox.sidebar.collapse`:`sandbox.sidebar.expand`,{count:l}),onClick:e=>{e.stopPropagation(),r()},children:[l,b(Td,{className:U(`size-3.5 transition-transform duration-200 ease-spring`,n&&`rotate-180`)})]})]})}),x(hs,{className:`sandbox-glass`,children:[e.groupId&&b(uy,{groupId:e.groupId,role:e.actorRole}),x(K,{onClick:()=>s(a(`sandbox.error.createConversation`),()=>o.createConversationInstance(e.id)),children:[b(ef,{}),a(`sandbox.menu.newConversation`)]}),b(ys,{}),b(dy,{target:e.entityTarget})]})]}),n&&b(`div`,{className:`ml-6 flex flex-col gap-0.5 border-l border-border pl-2`,children:e.children.map(e=>x(ps,{children:[b(ms,{render:b(ly,{row:e,active:e.id===t,onClick:()=>i(e.id)})}),x(hs,{className:`sandbox-glass`,children:[x(K,{onClick:()=>c.openConversationRename(e.id),children:[b(Qd,{}),a(`sandbox.menu.renameConversation`)]}),x(K,{variant:`destructive`,onClick:()=>s(a(`sandbox.error.deleteConversation`),()=>o.deleteConversationInstance(e.id)),children:[b(df,{}),a(`sandbox.menu.deleteConversation`)]})]})]},e.id))})]})}var ly=e.forwardRef(function({row:e,active:t,className:n,...r},i){return x(`button`,{ref:i,type:`button`,className:U(`flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left transition-colors hover:bg-accent`,t&&`bg-accent`,n),"aria-current":t||void 0,...r,children:[b(Yd,{className:`size-3.5 shrink-0 text-muted-foreground`}),x(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[x(`span`,{className:`flex items-center gap-2`,children:[b(`strong`,{className:`truncate text-xs font-medium`,children:e.title}),e.time&&b(`time`,{className:`ml-auto shrink-0 text-[11px] text-muted-foreground`,children:e.time})]}),b(`small`,{className:`truncate text-[11px] text-muted-foreground`,children:e.preview})]})]})});function uy({groupId:e,role:t}){let n=q(),{store:r,run:i,dialogs:a}=Zu();return x(y,{children:[x(K,{disabled:t===`member`,onClick:()=>a.openGroupAction(`name`,``,e),children:[b(Qd,{}),n(t===`member`?`sandbox.menu.renameGroupNeedAdmin`:`sandbox.menu.renameGroup`)]}),x(K,{disabled:t===`owner`,variant:`destructive`,onClick:()=>i(n(`sandbox.error.group`),()=>r.performGroupAction({action:`leave`,groupId:e})),children:[b(mf,{}),n(t===`owner`?`sandbox.menu.ownerCannotLeave`:`sandbox.menu.leaveGroup`)]})]})}function dy({target:e}){let t=q(),{dialogs:n}=Zu(),r=t(`sandbox.kind.${e.type}`);return x(y,{children:[x(K,{onClick:()=>n.openEntity(`edit`,e),children:[b(Qd,{}),t(`sandbox.menu.editEntity`,{kind:r}),b(E_,{})]}),x(K,{variant:`destructive`,onClick:()=>n.openEntity(`delete`,e),children:[b(df,{}),t(`sandbox.menu.deleteEntity`,{kind:r}),b(E_,{})]})]})}var fy=640;function py(){let{store:t}=Zu(),{workspace:n,group:r}=Qu(),[i,a]=ru(),o=a>=1132,s=a>0&&a<fy,[c,l]=e.useState(`auto`),[u,d]=e.useState(`chat`),f=u===`details`&&!r?`chat`:u,p=!!r&&(c===`auto`?o:c===`open`);e.useEffect(()=>l(`auto`),[o]);let m=()=>{if(s)return d(e=>e===`details`?`chat`:`details`);l(p?`closed`:`open`)},h=e.useRef(()=>{});return x(`div`,{ref:i,className:`sandbox-webqq flex min-h-0 min-w-0 flex-1 border-t border-border`,style:{"--sandbox-accent":n.appearance.sandboxAccentColor},children:[b(oy,{className:U(s&&f!==`contacts`&&`hidden`,s&&`w-full`),onSelectConversation:e=>{t.selectConversation(e),s&&d(`chat`)}}),b(Yv,{className:U(s&&f!==`chat`&&`hidden`,!s&&!o&&p&&`hidden`),detailsVisible:s?f===`details`:p,onToggleDetails:r?m:void 0,onBack:s?()=>d(`contacts`):void 0,mentionBridge:h}),(s?f===`details`:p)&&b(ny,{className:U(s&&`w-full border-l-0`,!s&&!o&&`flex-1`),onClose:s?()=>d(`chat`):()=>l(`closed`),onMention:e=>h.current(e)})]})}var my=[`read`,`interact`,`manage`,`debug`];function hy(t,n){let[r,i]=e.useState(),[a,o]=e.useState(!1),[s,c]=e.useState(``),l=e.useRef(t);return l.current=t,{catalog:r,loading:a,error:s,load:e.useCallback(async()=>{o(!0),c(``);try{i(await l.current())}catch(e){c(Vu(e,n))}finally{o(!1)}},[n])}}function gy({loading:e,error:t,onRetry:n,unavailable:r}){let i=q();return e?b(`div`,{className:`flex flex-1 items-center justify-center p-8`,children:b(As,{})}):t?x(`div`,{className:`flex flex-1 flex-col items-center justify-center gap-3 p-8 text-xs`,children:[b(`p`,{role:`alert`,className:`text-destructive`,children:t}),b(W,{size:`sm`,variant:`outline`,onClick:n,children:i(`sandbox.common.retry`)})]}):b(`p`,{className:`p-8 text-center text-xs text-muted-foreground`,children:r})}function _y({items:e}){return b(`div`,{className:`grid grid-cols-3 gap-2`,children:e.map(e=>x(`article`,{className:`flex flex-col gap-0.5 rounded-lg bg-muted/50 px-3 py-2.5`,children:[b(`strong`,{className:`text-base font-semibold tabular-nums`,children:e.value}),b(`span`,{className:`text-[11px] text-muted-foreground`,children:e.label})]},e.label))})}function vy({value:e,onChange:t,placeholder:n}){return x(`div`,{className:`relative flex-1`,children:[b(af,{className:`pointer-events-none absolute top-1/2 left-2.5 size-3.5 -translate-y-1/2 text-muted-foreground`}),b(Tn,{type:`search`,className:`sandbox-search-input h-8 pl-8!`,value:e,placeholder:n,"aria-label":n,onChange:e=>t(e.target.value)})]})}function yy({active:e,onClick:t,children:n}){return b(W,{size:`sm`,variant:e?`secondary`:`ghost`,"aria-pressed":e,onClick:t,children:n})}function by({catalog:t,loading:n,error:r,onRetry:i}){let a=q(),[o,s]=e.useState(``),[c,l]=e.useState(`tools`),[u,d]=e.useState(`all`);if(!t||n||r)return b(gy,{loading:n,error:r,onRetry:i,unavailable:a(`sandbox.env.mcpUnavailable`)});let f=o.trim().toLocaleLowerCase(),p=e=>a(`sandbox.scope.${e}`),m=t.tools.filter(e=>(u===`all`||e.scope===u)&&(!f||[e.name,e.description,p(e.scope)].some(e=>e.toLocaleLowerCase().includes(f)))),h=t.resources.filter(e=>!f||[e.name,e.uri,e.mimeType].some(e=>e.toLocaleLowerCase().includes(f))),g=t.serverCapabilities,_=t.endpoint,v=_&&JSON.stringify({mcpServers:{"onebot-sandbox":{type:`streamable-http`,url:_.url,headers:{Authorization:`Bearer <${a(`sandbox.env.http.tokenPlaceholder`)}>`}}}},null,2);return x(`div`,{className:`flex flex-col gap-4 p-4`,children:[_&&!_.enabled&&b(`p`,{className:`rounded-lg bg-amber-500/10 p-3 text-xs leading-5 text-amber-800 dark:text-amber-300`,children:a(`sandbox.env.mcp.disabledNotice`)}),_&&x(`section`,{className:`flex flex-col gap-2`,children:[b(`h3`,{className:`text-xs font-medium`,children:a(`sandbox.env.mcp.connect`)}),x(`p`,{className:`text-xs leading-5 text-muted-foreground`,children:[a(`sandbox.env.mcp.connectBefore`),(e=>b(`code`,{className:`rounded bg-muted px-1 py-0.5 font-mono text-[11px]`,children:e}))(_.url),a(`sandbox.env.mcp.connectAfter`)]}),b(`pre`,{className:`overflow-auto rounded-lg bg-muted/50 p-3 font-mono text-[11px] leading-5`,children:v})]}),b(_y,{items:[{value:t.tools.length,label:a(`sandbox.env.mcp.tools`)},{value:t.resources.length,label:a(`sandbox.env.mcp.resources`)},{value:t.scopes.length,label:a(`sandbox.env.mcp.scopes`)}]}),x(`div`,{className:`flex flex-wrap items-center gap-1.5 text-xs`,children:[b(`span`,{className:`mr-1 text-muted-foreground`,children:a(`sandbox.env.mcp.serverCapabilities`)}),b(Zn,{variant:g.tools?`secondary`:`outline`,children:a(`sandbox.env.mcp.capability.tools`)}),b(Zn,{variant:g.resources?`secondary`:`outline`,children:a(`sandbox.env.mcp.capability.resources`)}),b(Zn,{variant:g.prompts?`secondary`:`outline`,children:g.prompts?a(`sandbox.env.mcp.capability.prompts`):a(`sandbox.env.mcp.promptsMissing`)})]}),x(`div`,{className:`flex flex-wrap items-center gap-2`,children:[b(vy,{value:o,onChange:s,placeholder:a(`sandbox.env.mcp.search`)}),x(`div`,{className:`flex gap-0.5`,children:[b(yy,{active:c===`tools`,onClick:()=>l(`tools`),children:a(`sandbox.env.mcp.tools`)}),b(yy,{active:c===`resources`,onClick:()=>l(`resources`),children:a(`sandbox.env.mcp.resources`)})]})]}),c===`tools`?x(y,{children:[x(`div`,{className:`flex flex-wrap gap-0.5`,"aria-label":a(`sandbox.env.mcp.scopeFilter`),children:[b(yy,{active:u===`all`,onClick:()=>d(`all`),children:a(`sandbox.env.mcp.allScopes`)}),my.map(e=>b(yy,{active:u===e,onClick:()=>d(e),children:p(e)},e))]}),x(`div`,{className:`flex flex-col gap-1.5`,children:[m.map(e=>x(ls,{className:`rounded-lg ring-1 ring-border`,children:[x(us,{className:`group flex w-full items-center gap-3 rounded-lg px-3 py-2.5 text-left hover:bg-accent/60`,children:[b(Dd,{className:`size-3.5 shrink-0 text-muted-foreground transition-transform group-data-[panel-open]:rotate-90`}),x(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[b(`strong`,{className:`truncate font-mono text-xs font-medium`,children:e.name}),b(`small`,{className:`line-clamp-2 text-[11px] text-muted-foreground`,children:e.description})]}),b(Zn,{variant:`outline`,children:p(e.scope)})]}),x(ds,{className:`flex flex-col gap-1.5 px-3 pb-3`,children:[b(`span`,{className:`text-[11px] text-muted-foreground`,children:a(`sandbox.env.mcp.inputSchema`)}),b(`pre`,{className:`max-h-80 overflow-auto rounded-md bg-muted/50 p-2.5 font-mono text-[11px] leading-5`,children:JSON.stringify(e.inputSchema,null,2)})]})]},e.name)),!m.length&&b(`p`,{className:`py-6 text-center text-xs text-muted-foreground`,children:a(`sandbox.env.mcp.noTool`)})]})]}):x(`div`,{className:`flex flex-col gap-1.5`,children:[h.map(e=>x(`article`,{className:`flex items-center gap-3 rounded-lg px-3 py-2.5 ring-1 ring-border`,children:[x(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[b(`strong`,{className:`truncate text-xs font-medium`,children:e.name}),b(`small`,{className:`truncate font-mono text-[11px] text-muted-foreground`,children:e.uri})]}),x(`span`,{className:`flex shrink-0 flex-wrap justify-end gap-1`,children:[e.requiredScopes.map(e=>b(Zn,{variant:`outline`,children:p(e)},e)),b(Zn,{variant:`secondary`,children:e.mimeType})]})]},e.uri)),!h.length&&b(`p`,{className:`py-6 text-center text-xs text-muted-foreground`,children:a(`sandbox.env.mcp.noResource`)})]})]})}function xy({catalog:t,loading:n,error:r,onRetry:i}){let a=q(),[o,s]=e.useState(``);if(!t||n||r)return b(gy,{loading:n,error:r,onRetry:i,unavailable:a(`sandbox.env.httpUnavailable`)});let c=t.maxBodyBytes/1048576,l=`${Number.isInteger(c)?c:c.toFixed(1)} MiB`,u=t.routes.find(e=>e.kind===`list-tools`),d=u?[`TOKEN=<${a(`sandbox.env.http.tokenPlaceholder`)}>`,``,`# ${a(`sandbox.env.http.exampleList`)}`,`curl -s -H "authorization: Bearer $TOKEN" "${t.baseUrl}${u.target}"`,``,`# ${a(`sandbox.env.http.exampleCall`)}`,`curl -s -X POST -H "authorization: Bearer $TOKEN" "${t.baseUrl}${u.target}/get_server_info"`].join(`
|
|
3
|
+
`):``,f=o.trim().toLocaleLowerCase(),p=new Map;for(let{code:e,status:n}of t.errorStatuses)f&&!e.includes(f)&&!String(n).includes(f)||p.set(n,[...p.get(n)??[],e]);let m=[...p].sort(([e],[t])=>e-t),h=e=>b(`code`,{className:`rounded bg-muted px-1 py-0.5 font-mono text-[11px]`,children:e});return x(`div`,{className:`flex flex-col gap-4 p-4`,children:[!t.enabled&&b(`p`,{className:`rounded-lg bg-amber-500/10 p-3 text-xs leading-5 text-amber-800 dark:text-amber-300`,children:a(`sandbox.env.http.disabledNotice`)}),b(_y,{items:[{value:t.routes.length,label:a(`sandbox.env.http.routes`)},{value:t.errorStatuses.length,label:a(`sandbox.env.http.errorMappings`)},{value:l,label:a(`sandbox.env.http.bodyLimit`)}]}),x(`div`,{className:`flex flex-wrap items-center gap-1.5 text-xs`,children:[b(`span`,{className:`mr-1 text-muted-foreground`,children:a(`sandbox.env.http.protocol`)}),b(Zn,{variant:t.enabled?`secondary`:`outline`,children:a(t.enabled?`sandbox.env.enabled`:`sandbox.env.http.closed`)}),b(Zn,{variant:`outline`,children:a(`sandbox.env.http.basePath`,{path:t.basePath})}),b(Zn,{variant:`outline`,children:a(`sandbox.env.http.version`,{version:t.version})})]}),x(`section`,{className:`flex flex-col gap-2`,children:[b(`h3`,{className:`text-xs font-medium`,children:a(`sandbox.env.http.auth`)}),x(`p`,{className:`text-xs leading-5 text-muted-foreground`,children:[a(`sandbox.env.http.authBefore`),h(t.baseUrl),a(`sandbox.env.http.authMiddle`),h(`Authorization`),a(`sandbox.env.http.authCarry`),h(`Bearer <${a(`sandbox.env.http.tokenPlaceholder`)}>`),a(`sandbox.env.http.authAfter`)]}),d&&b(`pre`,{className:`overflow-auto rounded-lg bg-muted/50 p-3 font-mono text-[11px] leading-5`,children:d})]}),x(`section`,{className:`flex flex-col gap-2`,children:[b(`h3`,{className:`text-xs font-medium`,children:a(`sandbox.env.http.routes`)}),t.routes.map(e=>x(`article`,{className:`flex flex-col gap-1 rounded-lg px-3 py-2.5 ring-1 ring-border`,children:[x(`p`,{className:`flex min-w-0 items-center gap-2`,children:[b(Zn,{variant:`secondary`,className:`font-mono`,children:e.method}),b(`code`,{className:`truncate font-mono text-xs`,children:e.target})]}),b(`small`,{className:`text-[11px] text-muted-foreground`,children:e.summary})]},e.kind))]}),x(`section`,{className:`flex flex-col gap-2`,children:[b(`h3`,{className:`text-xs font-medium`,children:a(`sandbox.env.http.statusTitle`)}),x(`p`,{className:`text-xs leading-5 text-muted-foreground`,children:[a(`sandbox.env.http.statusBefore`),h(`Retry-After`),a(`sandbox.env.http.statusAfter`)]}),b(vy,{value:o,onChange:s,placeholder:a(`sandbox.env.http.statusSearch`)}),m.map(([e,t])=>x(`article`,{className:`flex items-start gap-3 rounded-lg px-3 py-2 ring-1 ring-border`,children:[b(Zn,{variant:e>=500?`destructive`:`outline`,className:`font-mono`,children:e}),b(`span`,{className:`flex min-w-0 flex-wrap gap-1`,children:t.map(e=>b(`code`,{className:U(`rounded bg-muted px-1 py-0.5 font-mono text-[11px]`),children:e},e))})]},e)),!m.length&&b(`p`,{className:`py-4 text-center text-xs text-muted-foreground`,children:a(`sandbox.env.http.noStatus`)})]})]})}function Sy(t,n){let r=q(),[i,a]=e.useState(!1);return{requestClose:()=>{t?a(!0):n()},confirm:b(Bn,{open:i,onOpenChange:a,children:x(Un,{children:[x(Wn,{children:[b(Kn,{children:r(`sandbox.discard.title`)}),b(qn,{children:r(`sandbox.discard.description`)})]}),x(Gn,{children:[b(Yn,{children:r(`sandbox.discard.keep`)}),b(Jn,{variant:`destructive`,onClick:()=>{a(!1),n()},children:r(`sandbox.discard.confirm`)})]})]})})}}function Cy(){let t=q(),[n,r]=e.useState([]),[i,a]=e.useState(``),[o,s]=e.useState(),[c,l]=e.useState(``),[u,d]=e.useState(!1),[f,p]=e.useState(``),[m,h]=e.useState(),g=e.useCallback(async()=>{try{r(await Ru(`onebot-sandbox.test-credentials`,void 0)),a(``)}catch(e){a(Vu(e,t(`sandbox.credential.loadFailed`)))}},[t]);e.useEffect(()=>{g()},[g]);let _=async(e,t)=>{d(!0);try{await t()}catch(t){l(Vu(t,e))}finally{d(!1)}},v=async()=>{if(!o)return;if(l(``),!o.name.trim()||!o.scopes.length){l(t(`sandbox.credential.invalid`));return}let e=o.editing;e?await _(t(`sandbox.credential.saveFailed`),async()=>{await Ru(`onebot-sandbox.update-test-credential`,{id:e.id,name:o.name,scopes:o.scopes}),s(void 0),await g()}):await _(t(`sandbox.credential.createFailed`),async()=>{let e=await Ru(`onebot-sandbox.create-test-credential`,{name:o.name,scopes:o.scopes});s(void 0),p(e.token),await g()})},y=async()=>{let e=o?.editing;e&&(l(``),await _(t(`sandbox.credential.rotateFailed`),async()=>{let t=await Ru(`onebot-sandbox.rotate-test-credential-token`,{id:e.id});s(e=>e&&{...e,editing:t}),await g()}))},S=async(e,t)=>{try{await t(),await g()}catch(t){a(Vu(t,e))}},C=async e=>{try{await navigator.clipboard.writeText(e),I.success(t(`sandbox.credential.copied`))}catch{I.error(t(`sandbox.credential.copyFailed`))}},w=J_(o),T=J_(m),E=J_(f||void 0)??``,D=o?.editing?{name:o.editing.name,scopes:o.editing.scopes}:{name:``,scopes:[`read`]},{requestClose:O,confirm:k}=Sy(!!o&&(o.name!==D.name||[...o.scopes].sort().join()!==[...D.scopes].sort().join()),()=>s(void 0)),A=e=>e.map(e=>t(`sandbox.scope.${e}`)).join(` · `),j=e=>new Intl.DateTimeFormat(void 0,{month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`}).format(new Date(e)),M=w?.editing;return x(`div`,{className:`flex flex-col gap-3 p-4`,children:[x(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[b(`p`,{className:`max-w-xl text-xs leading-5 text-muted-foreground`,children:t(`sandbox.credential.hint`)}),x(W,{size:`sm`,onClick:()=>{l(``),s({name:``,scopes:[`read`]})},children:[b(ef,{}),t(`sandbox.credential.create`)]})]}),i&&b(`p`,{role:`alert`,className:`text-xs text-destructive`,children:i}),n.map(e=>x(`article`,{className:`flex flex-wrap items-center justify-between gap-3 rounded-lg px-3 py-2.5 ring-1 ring-border`,children:[x(`button`,{type:`button`,className:`flex min-w-0 flex-col gap-0.5 text-left`,onClick:()=>{l(``),s({editing:e,name:e.name,scopes:[...e.scopes]})},children:[b(`strong`,{className:`truncate text-xs font-medium`,children:e.name}),x(`small`,{className:`text-[11px] text-muted-foreground`,children:[A(e.scopes),` · `,j(e.createdAt)]})]}),x(`div`,{className:`flex shrink-0 items-center gap-1.5`,children:[b(Zn,{variant:e.enabled?`secondary`:`outline`,children:t(e.enabled?`sandbox.env.enabled`:`sandbox.env.disabled`)}),b(W,{size:`sm`,variant:`outline`,onClick:()=>{l(``),s({editing:e,name:e.name,scopes:[...e.scopes]})},children:t(`sandbox.credential.view`)}),b(W,{size:`sm`,variant:`outline`,onClick:()=>void S(t(`sandbox.common.failed`),()=>Ru(`onebot-sandbox.set-test-credential-enabled`,{id:e.id,enabled:!e.enabled})),children:t(e.enabled?`sandbox.credential.disable`:`sandbox.credential.enable`)}),b(W,{size:`sm`,variant:`destructive`,onClick:()=>h(e),children:t(`sandbox.credential.revoke`)})]})]},e.id)),!n.length&&!i&&b(`p`,{className:`py-6 text-center text-xs text-muted-foreground`,children:t(`sandbox.credential.empty`)}),b(gn,{open:!!o,onOpenChange:e=>!e&&O(),children:x(yn,{className:`flex flex-col overflow-hidden`,children:[x(bn,{children:[b(Sn,{children:t(M?`sandbox.credential.viewTitle`:`sandbox.credential.createTitle`)}),b(Cn,{children:t(M?`sandbox.credential.viewDescription`:`sandbox.credential.createDescription`)})]}),x(`div`,{className:`-mx-5 flex min-h-0 flex-col gap-4 overflow-y-auto px-5`,children:[x(`div`,{className:`flex flex-col gap-2`,children:[b(bs,{htmlFor:`sandbox-credential-name`,children:t(`sandbox.credential.name`)}),b(Tn,{id:`sandbox-credential-name`,autoComplete:`off`,value:w?.name??``,onChange:e=>s(t=>t&&{...t,name:e.target.value})})]}),x(`fieldset`,{className:`flex flex-col gap-2`,children:[b(`legend`,{className:`mb-2 text-sm font-medium`,children:t(`sandbox.credential.scopes`)}),b(`div`,{className:`grid grid-cols-2 gap-2`,children:my.map(e=>x(`label`,{className:`flex items-center gap-2 text-sm`,children:[b(cs,{checked:w?.scopes.includes(e)??!1,onCheckedChange:t=>s(n=>n&&{...n,scopes:t===!0?[...new Set([...n.scopes,e])]:n.scopes.filter(t=>t!==e)})}),t(`sandbox.scope.${e}`)]},e))})]}),M&&x(`div`,{className:`flex flex-col gap-2`,children:[b(bs,{children:`Token`}),M.token?x(`div`,{className:`flex items-center gap-2`,children:[b(`code`,{className:`min-w-0 flex-1 rounded-md bg-muted px-2.5 py-2 font-mono text-xs break-all`,children:M.token}),b(W,{size:`icon-sm`,variant:`ghost`,"aria-label":t(`sandbox.credential.copy`),onClick:()=>void C(M.token),children:b(Ad,{})})]}):b(`p`,{className:`text-xs leading-5 text-muted-foreground`,children:t(`sandbox.credential.noPlainToken`)}),b(W,{size:`sm`,variant:`outline`,className:`self-start`,disabled:u,onClick:()=>void y(),children:t(M.token?`sandbox.credential.rotate`:`sandbox.credential.generate`)}),x(`p`,{className:`text-[11px] text-muted-foreground`,children:[t(`sandbox.credential.createdAt`,{time:j(M.createdAt)}),` · `,t(M.enabled?`sandbox.env.enabled`:`sandbox.env.disabled`)]})]}),c&&b(`p`,{role:`alert`,className:`text-xs text-destructive`,children:c})]}),x(xn,{children:[b(W,{variant:`outline`,onClick:O,children:t(`sandbox.common.cancel`)}),b(W,{disabled:u,onClick:()=>void v(),children:t(M?`sandbox.common.save`:`sandbox.credential.createAction`)})]}),k]})}),b(gn,{open:!!f,onOpenChange:e=>!e&&p(``),children:x(yn,{children:[x(bn,{children:[b(Sn,{children:t(`sandbox.credential.tokenTitle`)}),b(Cn,{children:t(`sandbox.credential.tokenDescription`)})]}),x(`div`,{className:`flex items-center gap-2`,children:[b(Tn,{readOnly:!0,value:E,className:`font-mono text-xs!`}),b(W,{size:`icon-sm`,variant:`ghost`,"aria-label":t(`sandbox.credential.copy`),onClick:()=>void C(E),children:b(Ad,{})})]}),b(xn,{children:b(W,{onClick:()=>p(``),children:t(`sandbox.credential.saved`)})})]})}),b(Bn,{open:!!m,onOpenChange:e=>!e&&h(void 0),children:x(Un,{children:[x(Wn,{children:[b(Kn,{children:t(`sandbox.credential.revokeTitle`,{name:T?.name??``})}),b(qn,{children:t(`sandbox.credential.revokeDescription`)})]}),x(Gn,{children:[b(Yn,{children:t(`sandbox.common.cancel`)}),b(Jn,{variant:`destructive`,onClick:()=>{let e=m;h(void 0),e&&S(t(`sandbox.common.failed`),()=>Ru(`onebot-sandbox.revoke-test-credential`,{id:e.id}))},children:t(`sandbox.credential.revoke`)})]})]})})]})}function wy(){let[t,n]=e.useState([]),[r,i]=e.useState(``),a=e.useCallback(async()=>{try{n(await Ru(`onebot-sandbox.test-spaces`,void 0)),i(``)}catch(e){i(Vu(e))}},[]);return e.useEffect(()=>{a()},[a]),{spaces:t,error:r,reload:a}}function Ty(e){return e}function Ey(e,t=[],n=Ty){return[...su(e).map(e=>({...e,avatar:n(e.avatar),source:{type:`main`,name:`主环境`}})),...t.flatMap(e=>su(e.snapshot).map(t=>({...t,avatar:n(t.avatar),source:{type:`test-space`,spaceId:e.id,name:e.name}})))]}function Dy(e,t=[],n=Ty){return{users:ou(e).map(e=>({...e,avatar:n(e.avatar)})),bots:Ey(e,t,n),groups:e.groups.map(e=>({...e,avatar:n(e.avatar)}))}}var Oy={users:`user`,bots:`bot`,groups:`group`};function ky(){let t=q(),{snapshot:n,resolveAvatar:r,operator:i}=Qu(),{spaces:a}=wy(),o=e.useMemo(()=>Dy(n,a,r),[n,a,r]),[s,c]=e.useState(`users`),l=e.useRef(null),u=hy(()=>Ru(`onebot-sandbox.mcp-capabilities`,void 0),t(`sandbox.env.mcpFailed`)),d=hy(()=>Ru(`onebot-sandbox.http-capabilities`,void 0),t(`sandbox.env.httpFailed`)),f=u.load,p=d.load;e.useEffect(()=>{f(),p()},[f,p]);let m=[{id:`directory`,items:[{id:`users`,icon:gf,count:o.users.length},{id:`bots`,icon:yd,count:o.bots.length},{id:`groups`,icon:_f,count:o.groups.length}]},{id:`endpoint`,items:[{id:`mcp`,icon:sf,count:u.catalog?.tools.length},{id:`http`,icon:vf,count:d.catalog?.routes.length},{id:`credentials`,icon:Kd}]}],h=Oy[s],g=e=>{c(e),l.current?.scrollTo({top:0})};return x(`div`,{className:`flex min-h-0 flex-1 flex-col gap-4 overflow-hidden px-6 pt-3 pb-6 text-sm leading-5`,children:[b(`p`,{className:`text-xs text-muted-foreground`,children:t(`sandbox.env.description`)}),x(`div`,{className:`grid min-h-0 flex-1 grid-rows-[auto_minmax(0,1fr)] gap-4 md:grid-cols-[14rem_minmax(0,1fr)] md:grid-rows-1`,children:[b(`nav`,{"aria-label":t(`sandbox.env.sections`),className:`sandbox-scroll-strip flex gap-0.5 self-start overflow-x-auto rounded-xl p-1.5 ring-1 ring-border md:flex-col md:overflow-x-visible`,children:m.map((n,r)=>x(e.Fragment,{children:[r>0&&b(`div`,{role:`separator`,className:`mx-1 w-px shrink-0 bg-border md:hidden`}),b(`p`,{className:U(`hidden px-2.5 pt-1.5 pb-1 text-[11px] leading-4 font-medium text-muted-foreground md:block`,r>0&&`md:mt-2`),children:t(`sandbox.env.nav.${n.id}`)}),n.items.map(({id:e,icon:n,count:r})=>x(W,{variant:`ghost`,className:U(`shrink-0 justify-start md:w-full`,s===e&&`bg-accent text-accent-foreground`),"aria-current":s===e?`page`:void 0,onClick:()=>g(e),children:[b(n,{}),b(`span`,{children:t(`sandbox.env.section.${e}.label`)}),r!==void 0&&b(`span`,{className:U(`ml-auto pl-2 text-xs tabular-nums`,s===e?`text-foreground/70`:`text-muted-foreground`),children:r})]},e))]},n.id))}),x(`section`,{"aria-label":t(`sandbox.env.section.${s}.label`),className:`flex min-h-0 flex-col overflow-hidden rounded-xl ring-1 ring-border`,children:[x(`header`,{className:`flex shrink-0 items-center gap-3 border-b border-border px-5 py-3.5`,children:[x(`div`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[b(`h2`,{className:`text-sm leading-5 font-semibold`,children:t(`sandbox.env.section.${s}.label`)}),b(`p`,{className:`text-xs leading-4 text-muted-foreground`,children:t(`sandbox.env.section.${s}.description`)})]}),h&&b(Qg,{type:h,operator:i,bots:su(n),side:`bottom`,trigger:x(W,{size:`sm`,variant:`outline`,className:`shrink-0`,children:[b(ef,{}),t(`sandbox.create.${h}`)]})},h)]}),x(`div`,{className:`relative flex min-h-0 flex-1 flex-col`,children:[x(`div`,{ref:l,className:`sandbox-env-scroller min-h-0 flex-1 overflow-y-auto`,children:[s===`users`&&b(Ay,{icon:gf,empty:t(`sandbox.env.noUser`),children:o.users.map(e=>b(jy,{target:{type:`user`,id:e.id},avatar:b(lp,{kind:`user`,name:e.name,src:e.avatar,className:`size-10`}),title:e.name,subtitle:e.id},e.id))}),s===`bots`&&b(Ay,{icon:yd,empty:t(`sandbox.env.noBot`),children:o.bots.map(e=>{let n={avatar:b(lp,{kind:`bot`,name:e.name,src:e.avatar,className:`size-10`}),title:e.name,subtitle:e.id,meta:x(y,{children:[b(Zn,{variant:`secondary`,children:Zg(e.implementation)}),b(Zn,{variant:`outline`,className:`max-w-40`,children:b(`span`,{className:`truncate`,children:nu(t,e.source)})}),b(Ny,{enabled:e.enabled})]})};return e.source.type===`main`?b(jy,{target:{type:`bot`,id:e.id},...n},`main:${e.id}`):b(My,{...n},`space:${e.source.spaceId}:${e.id}`)})}),s===`groups`&&b(Ay,{icon:_f,empty:t(`sandbox.env.noGroup`),children:o.groups.map(e=>b(jy,{target:{type:`group`,id:e.id},avatar:b(lp,{kind:`group`,name:e.name,src:e.avatar,className:`size-10`}),title:e.name,subtitle:t(`sandbox.env.groupSubtitle`,{id:e.id,count:e.members.length})},e.id))}),s===`credentials`&&b(Cy,{}),s===`mcp`&&b(by,{catalog:u.catalog,loading:u.loading,error:u.error,onRetry:()=>void u.load()}),s===`http`&&b(xy,{catalog:d.catalog,loading:d.loading,error:d.error,onRetry:()=>void d.load()})]}),b(fv,{target:l,className:`sandbox-env-scrollbar`})]})]})]})]})}function Ay({icon:e,empty:t,children:n}){return n.length?b(`div`,{className:`grid grid-cols-[repeat(auto-fill,minmax(15rem,1fr))] gap-3 p-4`,children:n}):x(`div`,{className:`flex flex-col items-center gap-3 px-6 py-16 text-center`,children:[b(`span`,{className:`flex size-10 items-center justify-center rounded-full bg-muted text-muted-foreground`,children:b(e,{className:`size-5`})}),b(`p`,{className:`text-xs text-muted-foreground`,children:t})]})}function jy({target:e,...t}){let n=q(),{dialogs:r}=Zu(),i=n(`sandbox.kind.${e.type}`),a=n(`sandbox.menu.editEntity`,{kind:i}),o=n(`sandbox.menu.deleteEntity`,{kind:i}),s=()=>r.openEntity(`edit`,e),c=()=>r.openEntity(`delete`,e);return x(ps,{children:[b(ms,{render:b(My,{...t,onEdit:s,actions:x(y,{children:[b(W,{size:`icon-sm`,variant:`ghost`,"aria-label":a,onClick:s,children:b(Qd,{})}),b(W,{size:`icon-sm`,variant:`ghost`,"aria-label":o,className:`hover:text-destructive`,onClick:c,children:b(df,{})})]})})}),x(hs,{className:`sandbox-glass`,children:[x(K,{onClick:s,children:[b(Qd,{}),a]}),x(K,{variant:`destructive`,onClick:c,children:[b(df,{}),o]})]})]})}var My=e.forwardRef(function({avatar:e,title:t,subtitle:n,meta:r,onEdit:i,actions:a,className:o,...s},c){return x(`article`,{ref:c,className:U(`relative flex flex-col gap-3 rounded-xl bg-muted/30 p-3.5 ring-1 ring-border/70`,i&&`group transition-[background-color,box-shadow] duration-150 hover:bg-muted/60 hover:ring-border`,o),...s,children:[x(`div`,{className:`flex items-center gap-3`,children:[e,x(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[i?b(`button`,{type:`button`,className:`block w-full truncate text-left text-[13px] leading-5 font-medium outline-none after:absolute after:inset-0 after:rounded-xl focus-visible:after:ring-2 focus-visible:after:ring-ring/50`,onClick:i,children:t}):b(`strong`,{className:`truncate text-[13px] leading-5 font-medium`,children:t}),b(`small`,{className:`truncate text-xs leading-4 text-muted-foreground tabular-nums`,children:n})]}),a&&b(`span`,{className:`relative z-10 -my-1 -mr-1.5 flex shrink-0 items-center gap-0.5 self-start text-muted-foreground opacity-0 transition-opacity duration-150 group-focus-within:opacity-100 group-hover:opacity-100`,children:a})]}),r&&b(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:r})]})});function Ny({enabled:e}){let t=q();return x(`span`,{className:`ml-auto flex shrink-0 items-center gap-1.5 text-[11px] leading-5 text-muted-foreground`,children:[b(`span`,{"aria-hidden":!0,className:U(`size-1.5 rounded-full`,e?`bg-emerald-500`:`bg-muted-foreground/40`)}),t(e?`sandbox.env.enabled`:`sandbox.env.disabled`)]})}function Py(e){if(!Number.isFinite(e)||e<0)return`—`;if(e<1e3)return`${Math.round(e)} ms`;if(e<6e4){let t=e/1e3;return`${Fy(t,t<10?2:1)} s`}let t=Math.round(e/1e3),n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=t%60,a=[];return n&&a.push(`${n} h`),r&&a.push(`${r} min`),(i||!a.length)&&a.push(`${i} s`),a.join(` `)}function Fy(e,t){return String(Number(e.toFixed(t)))}var Iy=2e3;function Ly({title:t,description:n,loading:r,error:i,live:a,onLiveChange:o,onRefresh:s,clear:c,children:l}){let u=q(),[d,f]=e.useState(!1);return x(`section`,{"aria-label":t,className:`flex min-h-0 flex-1 flex-col gap-4 overflow-hidden px-6 pt-3 pb-6 text-sm leading-5`,children:[x(`header`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[b(`p`,{className:`min-w-0 text-xs text-muted-foreground`,children:n}),x(`div`,{className:`flex items-center gap-2`,children:[x(`label`,{className:`mr-1 flex items-center gap-2 text-xs text-muted-foreground`,children:[b(js,{checked:a,onCheckedChange:e=>o(e===!0)}),u(`sandbox.records.live`)]}),x(W,{variant:`outline`,size:`sm`,disabled:r,onClick:s,children:[b(tf,{}),u(`sandbox.records.refresh`)]}),x(W,{variant:`outline`,size:`sm`,className:`text-destructive`,disabled:r||c.disabled,onClick:()=>f(!0),children:[b(df,{}),c.label]})]})]}),i&&b(`p`,{role:`alert`,className:`text-xs text-destructive`,children:i}),b(`div`,{className:`grid min-h-0 flex-1 grid-rows-[minmax(10rem,40%)_minmax(0,1fr)] gap-4 md:grid-cols-[minmax(16rem,22rem)_minmax(0,1fr)] md:grid-rows-1`,children:l}),b(Bn,{open:d,onOpenChange:f,children:x(Un,{children:[x(Wn,{children:[b(Kn,{children:c.title}),b(qn,{children:c.description})]}),x(Gn,{children:[b(Yn,{children:u(`sandbox.common.cancel`)}),b(Jn,{variant:`destructive`,onClick:()=>{f(!1),c.onConfirm()},children:c.label})]})]})})]})}function Ry({label:t,order:n,onToggleOrder:r,filter:i,loading:a,empty:o,children:s}){let c=q(),l=e.useRef(null),u=n===`asc`?md:dd;return x(`section`,{"aria-label":t,className:`flex min-h-0 flex-col overflow-hidden rounded-xl ring-1 ring-border`,children:[x(`header`,{className:`flex h-12 shrink-0 items-center justify-between gap-2 border-b border-border pr-2 pl-4`,children:[b(`h2`,{className:`text-[13px] font-medium`,children:t}),x(`div`,{className:`flex items-center gap-1`,children:[x(W,{variant:`ghost`,size:`sm`,"aria-label":c(n===`asc`?`sandbox.records.orderAscHint`:`sandbox.records.orderDescHint`),onClick:r,children:[b(u,{}),c(n===`asc`?`sandbox.records.orderAsc`:`sandbox.records.orderDesc`)]}),x(Pn,{open:i.open,onOpenChange:i.onOpenChange,children:[b(Fn,{render:b(W,{variant:i.active?`secondary`:`ghost`,size:`icon-sm`,"aria-label":c(`sandbox.records.filterLabel`,{summary:i.summary})}),children:b(Bd,{})}),b(In,{align:`end`,className:`sandbox-glass flex w-72 flex-col gap-3`,children:i.content})]})]})]}),a&&o?b(`div`,{className:`flex flex-1 items-center justify-center`,children:b(As,{})}):o?b(`p`,{className:`flex flex-1 items-center justify-center p-6 text-center text-xs text-muted-foreground`,children:c(`sandbox.records.empty`)}):x(`div`,{className:`relative flex min-h-0 flex-1 flex-col`,children:[b(`div`,{ref:l,className:`sandbox-record-scroller flex min-h-0 flex-1 flex-col gap-0.5 overflow-y-auto p-1.5`,children:s}),b(fv,{target:l,className:`sandbox-record-scrollbar`})]})]})}function zy({active:e,onClick:t,title:n,status:r,tag:i,time:a,duration:o,meta:s=[]}){let c=q();return x(`button`,{type:`button`,"aria-current":e?`true`:void 0,className:U(`sandbox-record-item`,e&&`is-active`),onClick:t,children:[x(`span`,{className:`flex min-w-0 items-center gap-2`,children:[b(`span`,{role:`img`,"aria-label":c(r===`error`?`sandbox.records.statusError`:`sandbox.records.statusSuccess`),className:U(`sandbox-record-dot`,r===`error`&&`is-error`)}),b(`strong`,{className:U(`min-w-0 flex-1 truncate font-mono text-[13px] leading-5 font-medium`,r===`error`&&`text-destructive`),children:n}),i&&b(By,{children:i})]}),x(`span`,{className:`sandbox-record-item-meta`,children:[b(`time`,{dateTime:a,title:tb(a),children:eb(a)}),b(`span`,{children:Py(o)}),s.map((e,t)=>b(`span`,{className:`min-w-0 truncate`,children:e},t))]})]})}function By({children:e}){return b(`span`,{className:`sandbox-record-tag`,children:e})}function Vy({time:e,duration:t}){return x(`span`,{className:`flex flex-wrap items-center gap-x-3 gap-y-0.5 text-[11px] text-muted-foreground tabular-nums`,children:[x(`time`,{dateTime:e,className:`flex items-center gap-1`,children:[b(Sd,{className:`size-3.5`}),tb(e)]}),x(`span`,{className:`flex items-center gap-1`,children:[b(kd,{className:`size-3.5`}),Py(t)]})]})}function Hy({label:t,loading:n,header:r,scrollKey:i,children:a}){let o=q(),s=e.useRef(null);return e.useLayoutEffect(()=>{s.current?.scrollTo({top:0})},[i]),b(`section`,{"aria-label":t,className:`flex min-h-0 flex-col overflow-hidden rounded-xl ring-1 ring-border`,children:a?x(y,{children:[r,x(`div`,{className:`relative flex min-h-0 flex-1 flex-col`,children:[b(`article`,{ref:s,className:`sandbox-record-scroller flex min-h-0 flex-1 flex-col gap-5 overflow-y-auto px-5 pt-4 pb-6`,children:a}),b(fv,{target:s,className:`sandbox-record-scrollbar`})]})]}):n?b(`div`,{className:`flex flex-1 items-center justify-center`,children:b(As,{})}):b(`p`,{className:`flex flex-1 items-center justify-center p-6 text-center text-xs text-muted-foreground`,children:o(`sandbox.records.pick`)})})}function Uy({title:e,badges:t,time:n,duration:r}){return x(`header`,{className:`flex shrink-0 flex-col gap-1.5 border-b border-border px-5 py-3.5`,children:[x(`span`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[b(`h2`,{className:`min-w-0 truncate font-mono text-[15px] leading-6 font-semibold`,children:e}),t]}),b(Vy,{time:n,duration:r})]})}function Wy({status:e}){let t=q();return e===`error`?b(Zn,{variant:`destructive`,children:t(`sandbox.records.statusError`)}):b(Zn,{variant:`secondary`,className:`text-emerald-700 dark:text-emerald-400`,children:t(`sandbox.records.statusSuccess`)})}function Gy({children:e}){return b(`dl`,{className:`sandbox-record-meta`,children:e})}function Ky({icon:e,label:t,value:n,wide:r}){return x(`div`,{className:U(`sandbox-record-meta-item`,r&&`is-wide`),children:[x(`dt`,{className:`sandbox-record-meta-label`,children:[b(e,{}),t]}),b(`dd`,{className:`sandbox-record-meta-value`,children:n})]})}function qy({items:e}){return b(`span`,{className:`sandbox-record-chips`,children:e.map(([e,t])=>x(`span`,{className:`sandbox-record-chip`,children:[b(`span`,{className:`sandbox-record-chip-key`,children:e}),t]},e))})}function Jy({icon:e,title:t,tone:n,children:r}){return x(`section`,{className:U(`sandbox-record-notice`,n===`destructive`&&`is-destructive`),children:[b(e,{}),x(`div`,{className:`min-w-0`,children:[b(`h3`,{className:`sandbox-record-notice-title`,children:t}),b(`div`,{className:`sandbox-record-notice-body`,children:r})]})]})}function Yy({icon:e,title:t,children:n}){return x(`section`,{className:`flex flex-col gap-2`,children:[x(`h3`,{className:`flex items-center gap-1.5 text-xs font-medium text-muted-foreground`,children:[b(e,{className:`size-3.5`}),t]}),n]})}var Xy=/("(?:\\.|[^"\\])*")(\s*:)?|\b(?:true|false|null)\b|-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?|[{}[\],]/g;function Zy(e){let t=[],n=0;for(let r of e.matchAll(Xy)){let[i,a,o]=r;r.index>n&&t.push(e.slice(n,r.index));let s=a===void 0?/^[{}[\],]$/.test(i)?`punct`:/^[tfn]/.test(i)?`literal`:`number`:o?`key`:`string`;t.push(b(`span`,{className:`sandbox-json-${s}`,children:a??i},r.index)),o&&t.push(o),n=r.index+i.length}return n<e.length&&t.push(e.slice(n)),t}function Qy({value:t}){let n=q(),r=e.useMemo(()=>JSON.stringify(t,null,2)??String(t),[t]),i=e.useMemo(()=>Zy(r),[r]),[a,o]=e.useState(!1);e.useEffect(()=>{if(!a)return;let e=setTimeout(()=>o(!1),1500);return()=>clearTimeout(e)},[a]);let s=async()=>{try{await navigator.clipboard.writeText(r),o(!0)}catch{I.error(n(`sandbox.records.copyFailed`))}};return x(`div`,{className:`sandbox-record-code`,children:[b(`pre`,{children:i}),b(W,{variant:`outline`,size:`icon-sm`,className:`sandbox-record-code-copy`,"aria-label":n(a?`sandbox.records.copied`:`sandbox.records.copy`),onClick:()=>void s(),children:b(a?wd:Ad,{})})]})}function $y({label:e,children:t}){return x(`label`,{className:`flex flex-col gap-1.5 text-xs`,children:[b(`span`,{className:`text-muted-foreground`,children:e}),t]})}function eb(e){let t=new Date(e),n=tb(e),r=new Date;return t.getFullYear()===r.getFullYear()&&t.getMonth()===r.getMonth()&&t.getDate()===r.getDate()?n.slice(11):n.slice(5)}function tb(e){let t=new Date(e),n=e=>String(e).padStart(2,`0`);return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())} ${n(t.getHours())}:${n(t.getMinutes())}:${n(t.getSeconds())}`}function nb(t,n){let r=e.useRef(n);r.current=n,e.useEffect(()=>{r.current()},[]),e.useEffect(()=>{if(!t)return;let e,n=()=>{let t=document.visibilityState===`visible`;t&&!e&&(e=setInterval(()=>r.current(),Iy)),!t&&e&&(clearInterval(e),e=void 0)};return n(),document.addEventListener(`visibilitychange`,n),()=>{document.removeEventListener(`visibilitychange`,n),e&&clearInterval(e)}},[t])}function rb(e,t,n){let r=t===`asc`?1:-1;return[...e].sort((e,t)=>r*(e.createdAt.localeCompare(t.createdAt)||n(e,t)))}var ib={botKey:`all`,direction:`all`,action:``,requestedAction:``,errorsOnly:!1};function ab(e){return e.type===`main`?`main`:`space:${e.spaceId}`}function ob(e){return`${ab(e.source)}:${e.id}`}function sb(e){return`${ab(e.source)}:${e.id}`}function cb(e){return!e||typeof e!=`object`?0:Reflect.get(e,`kind`)===`large-value`?1:Object.values(e).reduce((e,t)=>e+cb(t),0)}function lb(){let t=q(),{view:n}=Zu(),r=n.workspace?.snapshot,{spaces:i}=wy(),a=e.useMemo(()=>r?Ey(r,i):[],[r,i]),[o,s]=e.useState([]),[c,l]=e.useState(),[u,d]=e.useState(!1),[f,p]=e.useState(!1),[m,h]=e.useState(``),[g,_]=e.useState(ib),[v,S]=e.useState(`desc`),[C,w]=e.useState(!1),[T,E]=e.useState(!1),D=async(e=g,n=v)=>{let r={botId:e.botKey===`all`?void 0:a.find(t=>ob(t)===e.botKey)?.id,direction:e.direction===`all`?void 0:e.direction,action:e.action.trim()||void 0,requestedAction:e.requestedAction.trim()||void 0,status:e.errorsOnly?`error`:void 0,order:n};d(!0);try{s((await Ru(`onebot-sandbox.debug-records`,r)).records),h(``)}catch(e){h(Vu(e,t(`sandbox.debug.loadFailed`)))}finally{d(!1)}},O=async e=>{p(!0);try{l(await Ru(`onebot-sandbox.debug-record`,{recordId:e.id,includeLargeValues:!0,...e.source.type===`test-space`?{spaceId:e.source.spaceId}:{}})),h(``)}catch(e){h(Vu(e,t(`sandbox.debug.detailFailed`)))}finally{p(!1)}},k=()=>{D(),c&&O(c)};nb(T,k);let A=(e,t=!1)=>{let n={...g,...e};_(n),t&&D(n)},j=g.botKey!==`all`||g.direction!==`all`||!!g.action.trim()||!!g.requestedAction.trim()||g.errorsOnly,M=[g.botKey===`all`?``:a.find(e=>ob(e)===g.botKey)?.name??g.botKey,g.direction===`all`?``:t(`sandbox.debug.direction.${g.direction}`),g.action.trim(),g.requestedAction.trim(),g.errorsOnly?t(`sandbox.records.errorsOnly`):``].filter(Boolean).join(` · `)||t(`sandbox.records.noFilter`),N=e=>a.find(t=>t.id===e.botId&&ab(t.source)===ab(e.source))?.name??e.botId,ee=c?sb(c):void 0,te=[{value:`all`,label:t(`sandbox.debug.allBots`)},...a.map(e=>({value:ob(e),label:`${e.name} · ${e.id} · ${nu(t,e.source)}`}))],P=[`all`,`action`,`event`].map(e=>({value:e,label:t(`sandbox.debug.direction.${e}`)}));return x(Ly,{title:t(`sandbox.debug.title`),description:t(`sandbox.debug.description`),loading:u,error:m,live:T,onLiveChange:E,onRefresh:k,clear:{label:t(`sandbox.debug.clear`),title:t(`sandbox.debug.clearTitle`),description:t(`sandbox.debug.clearDescription`),disabled:!o.length,onConfirm:async()=>{try{await Ru(`onebot-sandbox.clear-debug-records`,{}),l(void 0),await D()}catch(e){h(Vu(e,t(`sandbox.debug.clearFailed`)))}}},children:[b(Ry,{label:t(`sandbox.records.list`),order:v,onToggleOrder:()=>{let e=v===`desc`?`asc`:`desc`;S(e),D(g,e)},loading:u,empty:!o.length,filter:{active:j,summary:M,open:C,onOpenChange:e=>{w(e),e||D()},content:x(y,{children:[b($y,{label:t(`sandbox.debug.bot`),children:x(Cs,{value:g.botKey,onValueChange:e=>e&&A({botKey:e}),items:te,children:[b(Ts,{className:`w-full`,children:b(ws,{})}),x(Es,{className:`sandbox-glass`,children:[b(Ds,{value:`all`,children:t(`sandbox.debug.allBots`)}),a.map(e=>x(Ds,{value:ob(e),children:[b(lp,{kind:`bot`,name:e.name,src:e.avatar,className:`size-5`,badge:!1}),x(`span`,{className:`truncate`,children:[e.name,` · `,e.id,` · `,nu(t,e.source)]})]},ob(e)))]})]})}),b($y,{label:t(`sandbox.debug.directionLabel`),children:x(Cs,{value:g.direction,onValueChange:e=>e&&A({direction:e}),items:P,children:[b(Ts,{className:`w-full`,children:b(ws,{})}),b(Es,{className:`sandbox-glass`,children:P.map(e=>b(Ds,{value:e.value,children:e.label},e.value))})]})}),b($y,{label:t(`sandbox.debug.action`),children:b(Tn,{value:g.action,placeholder:`get_group_info`,onChange:e=>A({action:e.target.value}),onKeyDown:e=>e.key===`Enter`&&void D()})}),b($y,{label:t(`sandbox.debug.requestedAction`),children:b(Tn,{value:g.requestedAction,placeholder:`getGroupInfo`,onChange:e=>A({requestedAction:e.target.value}),onKeyDown:e=>e.key===`Enter`&&void D()})}),x(`label`,{className:`flex items-center gap-2 text-xs`,children:[b(cs,{checked:g.errorsOnly,onCheckedChange:e=>A({errorsOnly:e===!0},!0)}),t(`sandbox.records.errorsOnly`)]}),b(W,{variant:`outline`,size:`sm`,onClick:()=>{_(ib),D(ib)},children:t(`sandbox.records.reset`)})]})},children:rb(o,v,(e,t)=>e.sequence-t.sequence).map(e=>b(zy,{active:sb(e)===ee,onClick:()=>void O(e),title:e.requestedAction,status:e.status,tag:e.direction.toUpperCase(),time:e.createdAt,duration:e.durationMs,meta:[nu(t,e.source)]},sb(e)))}),b(Hy,{label:t(`sandbox.records.detail`),loading:f,scrollKey:ee,header:c&&b(Uy,{title:c.requestedAction,time:c.createdAt,duration:c.durationMs,badges:x(y,{children:[b(Wy,{status:c.status}),b(By,{children:c.direction.toUpperCase()})]})}),children:c&&b(ub,{record:c,botName:N(c)})})]})}function ub({record:e,botName:t}){let n=q(),r=Object.entries(e.entities).filter(e=>!!e[1]),i=e.conversationObservation,a=e.direction===`action`;return x(y,{children:[e.error&&x(Jy,{icon:Od,title:n(`sandbox.records.diagnosis`),tone:`destructive`,children:[b(`span`,{className:`font-mono`,children:e.error.code}),` · `,e.error.message,x(`span`,{className:`mt-0.5 block font-mono text-[11px]`,children:[`trace `,e.error.traceId]})]}),i&&b(Jy,{icon:Vd,title:n(`sandbox.debug.observation.${i.kind}.title`),children:n(`sandbox.debug.observation.${i.kind}.detail`,{event:i.eventConversationId,actual:i.conversationId})}),x(Gy,{children:[b(Ky,{icon:yd,label:n(`sandbox.debug.bot`),value:x(y,{children:[t,` `,b(`span`,{className:`font-mono font-normal text-muted-foreground`,children:e.botId})]})}),b(Ky,{icon:bd,label:n(`sandbox.debug.source`),value:nu(n,e.source)}),b(Ky,{icon:Md,label:n(`sandbox.debug.implementation`),value:Zg(e.implementation)}),e.action!==e.requestedAction&&b(Ky,{icon:pd,label:n(`sandbox.debug.action`),value:b(`span`,{className:`font-mono`,children:e.action})}),e.matchedAlias&&b(Ky,{icon:uf,label:n(`sandbox.debug.alias`),value:b(`span`,{className:`font-mono`,children:e.matchedAlias})}),b(Ky,{icon:qd,label:n(`sandbox.debug.entities`),wide:!0,value:r.length?b(qy,{items:r}):b(`span`,{className:`font-normal text-muted-foreground`,children:n(`sandbox.debug.noEntities`)})})]}),e.payload!==void 0&&x(Yy,{icon:xd,title:n(a?`sandbox.debug.input`:`sandbox.debug.eventData`),children:[b(Qy,{value:e.payload}),cb(e.payload)>0&&b(`p`,{className:`text-[11px] text-muted-foreground`,children:n(`sandbox.debug.folded`,{count:cb(e.payload)})})]}),e.result!==void 0&&x(Yy,{icon:xd,title:n(a?`sandbox.debug.output`:`sandbox.debug.handled`),children:[b(Qy,{value:e.result}),cb(e.result)>0&&b(`p`,{className:`text-[11px] text-muted-foreground`,children:n(`sandbox.debug.folded`,{count:cb(e.result)})})]})]})}var db={dirty:!1},fb=new Set,pb=e=>{e.preventDefault()};function mb(e){e.dirty!==db.dirty&&(e.dirty?window.addEventListener(`beforeunload`,pb):window.removeEventListener(`beforeunload`,pb)),db=e;for(let e of fb)e()}var hb=e=>(fb.add(e),()=>fb.delete(e)),gb=()=>db,_b={setValue:e=>mb({value:e,dirty:e!==void 0&&db.dirty}),setDirty:e=>{e!==db.dirty&&mb({...db,dirty:e})}};function vb(){return e.useSyncExternalStore(hb,gb,gb)}var yb=`chatluna-plugin-onebot-sandbox`,bb=`1.1.0`;function xb(){let e=q(),t=[{label:e(`sandbox.settings.about.version`),value:bb,mono:!0},{label:e(`sandbox.settings.about.package`),value:yb,mono:!0},{label:e(`sandbox.settings.about.license`),value:`MIT`},{label:e(`sandbox.settings.about.protocol`),value:`OneBot v11`},{label:e(`sandbox.settings.about.host`),value:`ChatLuna v2`}];return x(`div`,{className:`flex flex-col gap-5`,children:[x(`div`,{className:`flex items-center gap-3`,children:[b(`div`,{className:`flex size-11 shrink-0 items-center justify-center rounded-xl bg-primary/10 text-primary`,children:b(zd,{className:`size-5`})}),x(`div`,{className:`flex min-w-0 flex-col gap-0.5`,children:[x(`div`,{className:`flex flex-wrap items-center gap-2`,children:[b(`h3`,{className:`text-[15px] leading-5 font-semibold`,children:e(`onebot-sandbox.title`)}),x(Zn,{variant:`outline`,className:`font-mono`,children:[`v`,bb]})]}),b(`p`,{className:`text-xs text-muted-foreground`,children:e(`sandbox.settings.about.summary`)})]})]}),b(`dl`,{className:`grid grid-cols-[max-content_minmax(0,1fr)] gap-x-6 gap-y-2.5 border-t border-border pt-4 text-[13px] leading-5`,children:t.map(e=>x(`div`,{className:`contents`,children:[b(`dt`,{className:`text-muted-foreground`,children:e.label}),b(`dd`,{className:e.mono?`font-mono text-xs leading-5 break-all`:void 0,children:e.value})]},e.label))})]})}var Sb=`sandbox.settings.schema.`,Cb=[`label`,`description`];function wb(e,t,n,r,i){let a=e.refs[t];if(!a)return;let o=a.meta?.i18n,s=typeof o==`string`?o:n;if(s&&i(t,s),a.type===`object`)for(let[t,n]of Object.entries(a.dict??{})){let a=r?`${r}.${t}`:t;wb(e,n,a,a,i)}else if(a.type===`intersect`)for(let t of a.list??[])wb(e,t,void 0,r,i);else if(a.type===`array`&&a.inner!==void 0)wb(e,a.inner,void 0,r,i);else if(a.type===`union`)for(let t of a.list??[]){let n=e.refs[t];n?.type===`const`&&wb(e,t,`${r}.option.${String(n.value)}`,r,i)}}function Tb(e,t){let n={...e.refs};return wb(e,e.uid,void 0,``,(e,r)=>{let i=n[e],a={...i.meta};for(let e of Cb){if(typeof a[e]!=`string`||!a[e])continue;let n=`${Sb}${r}.${e}`,i=t(n);i!==n&&(a[e]=i)}n[e]={...i,meta:a}}),{uid:e.uid,refs:n}}var Eb={sandboxAccentColor:Xd,persistenceMode:Pd,testEndpoint:sf},Db=(e,t)=>JSON.stringify(e)===JSON.stringify(t),Ob=e=>typeof e==`string`&&e?e:void 0;function kb(e,t){let n=e[t];return n?.type===`intersect`?(n.list??[]).flatMap(t=>kb(e,t)):Object.keys(n?.dict??{})}function Ab(e,t){let n=e.refs[e.uid];return(n?.type===`intersect`?n.list??[]:[e.uid]).map(n=>{let r=e.refs[n],{label:i,description:a,...o}=r.meta??{},s={...r,meta:o};return{title:Ob(i)??Ob(a)??t,description:Ob(i)?Ob(a):void 0,schema:{uid:n,refs:{...e.refs,[n]:s}},keys:kb(e.refs,n)}})}function jb(){let t=q(),n=L(`onebot-sandbox.settings`),r=ce(),i=vb().value,a=_b.setValue,[o,s]=e.useState(),[c,l]=e.useState(!1),[u,d]=e.useState(0),f=e.useRef(null),p=n.data,m=o&&o.revision===p?.revision?o.value:p?.value,h=i??m??{},g=i!==void 0&&!Db(i,m);e.useEffect(()=>{p&&_b.setDirty(g)},[p,g]);let _=t(`sandbox.nav.settings`),v=e.useMemo(()=>p?Ab(Tb(p.schema,t),_):[],[p,t,_]),y=u===`about`,S=y?void 0:v[Math.min(u,v.length-1)],C=y?t(`sandbox.settings.about.title`):S?.title,w=y?t(`sandbox.settings.about.description`):S?.description,T=()=>{a(void 0),r.reset()},E=async()=>{if(!(!p||!i)){if(!r.attempt()){I.error(t(`sandbox.settings.invalid`));return}l(!0);try{await re(`onebot-sandbox.settings.save`,{config:i,revision:p.revision}),s({revision:p.revision,value:i}),a(void 0),r.reset(),I.success(t(`sandbox.settings.saved`))}catch(e){I.error(t(`sandbox.settings.saveFailed`),{description:ne(e)})}finally{l(!1)}}},D=e=>{d(e),f.current?.scrollTo({top:0})};return x(`div`,{className:`flex min-h-0 flex-1 flex-col gap-4 overflow-hidden px-6 pt-3 pb-6 text-sm leading-5`,children:[x(`div`,{className:`flex shrink-0 flex-wrap items-center justify-between gap-3`,children:[b(`p`,{className:`min-w-0 text-xs text-muted-foreground`,children:t(`sandbox.settings.description`)}),x(`div`,{className:`flex items-center gap-2`,children:[g&&b(`span`,{className:`text-xs text-muted-foreground`,children:t(`sandbox.settings.unsaved`)}),x(W,{variant:`outline`,size:`sm`,disabled:!g||c,onClick:T,children:[b(ff,{}),t(`sandbox.settings.discard`)]}),x(W,{size:`sm`,disabled:!g||c,onClick:()=>void E(),children:[b(c?As:rf,{}),t(c?`sandbox.common.saving`:`sandbox.common.save`)]})]})]}),p&&v.length?x(`div`,{className:`grid min-h-0 w-full max-w-5xl flex-1 grid-rows-[auto_minmax(0,1fr)] gap-4 md:grid-cols-[14rem_minmax(0,1fr)] md:grid-rows-1`,children:[x(`nav`,{"aria-label":t(`sandbox.settings.sections`),className:`sandbox-scroll-strip flex gap-0.5 self-start overflow-x-auto rounded-xl p-1.5 ring-1 ring-border md:flex-col md:overflow-x-visible`,children:[v.map((e,n)=>{let r=Eb[e.keys[0]??``]??lf,a=i!==void 0&&e.keys.some(e=>!Db(i[e],m?.[e]));return x(W,{variant:`ghost`,className:U(`shrink-0 justify-start md:w-full`,e===S&&`bg-accent text-accent-foreground`),"aria-current":e===S?`page`:void 0,onClick:()=>D(n),children:[b(r,{}),b(`span`,{children:e.title}),a&&b(`span`,{role:`img`,"aria-label":t(`sandbox.settings.unsaved`),className:`ml-auto size-1.5 shrink-0 rounded-full bg-primary`})]},n)}),b(`div`,{role:`separator`,className:`mx-1 shrink-0 bg-border max-md:w-px md:my-1 md:h-px`}),x(W,{variant:`ghost`,className:U(`shrink-0 justify-start md:w-full`,y&&`bg-accent text-accent-foreground`),"aria-current":y?`page`:void 0,onClick:()=>D(`about`),children:[b(Gd,{}),b(`span`,{children:t(`sandbox.settings.about.title`)})]})]}),x(`section`,{"aria-label":C,className:`flex min-h-0 flex-col overflow-hidden rounded-xl ring-1 ring-border`,children:[x(`header`,{className:`flex shrink-0 flex-col gap-0.5 border-b border-border px-4 py-3`,children:[b(`h2`,{className:`text-[13px] font-medium`,children:C}),w&&b(`p`,{className:`text-[11px] text-muted-foreground`,children:w})]}),x(`div`,{className:`relative flex min-h-0 flex-1 flex-col`,children:[b(`div`,{ref:f,className:`sandbox-settings-scroller min-h-0 flex-1 overflow-y-auto`,children:x(`fieldset`,{disabled:c,className:`sandbox-settings-form min-w-0 px-5 py-4`,children:[v.map((e,t)=>b(`div`,{hidden:e!==S,children:b(se,{schema:e.schema,value:h,initial:m,onChange:a,validation:r,formId:`onebot-sandbox.settings`})},t)),y&&b(xb,{})]})}),b(fv,{target:f,className:`sandbox-settings-scrollbar`})]})]})]}):n.error?b(Rn,{variant:`destructive`,className:`max-w-5xl`,children:b(zn,{children:t(`sandbox.settings.unavailableDetail`,{error:n.error})})}):b(`div`,{className:`flex justify-center py-12 text-muted-foreground`,children:b(As,{})})]})}var Mb={tool:``,credentialName:``,transport:`all`,spaceId:``,testRunId:``,errorsOnly:!1};function Nb(){let t=q(),[n,r]=e.useState([]),[i,a]=e.useState(),[o,s]=e.useState(!1),[c,l]=e.useState(!1),[u,d]=e.useState(``),[f,p]=e.useState(Mb),[m,h]=e.useState(`desc`),[g,_]=e.useState(!1),[v,S]=e.useState(!1),C=async(e=f,n=m)=>{let i={tool:e.tool.trim()||void 0,credentialName:e.credentialName.trim()||void 0,transport:e.transport===`all`?void 0:e.transport,spaceId:e.spaceId.trim()||void 0,testRunId:e.testRunId.trim()||void 0,status:e.errorsOnly?`error`:void 0,order:n};s(!0);try{r((await Ru(`onebot-sandbox.test-call-records`,i)).records),d(``)}catch(e){d(Vu(e,t(`sandbox.testCall.loadFailed`)))}finally{s(!1)}},w=async e=>{l(!0);try{a(await Ru(`onebot-sandbox.test-call-record`,{recordId:e})),d(``)}catch(e){d(Vu(e,t(`sandbox.testCall.detailFailed`)))}finally{l(!1)}},T=()=>{C(),i&&w(i.id)};nb(v,T);let E=(e,t=!1)=>{let n={...f,...e};p(n),t&&C(n)},D=e=>t(`sandbox.testCall.transport.${e}`),O=[f.tool,f.credentialName,f.spaceId,f.testRunId].map(e=>e.trim()),k=O.some(Boolean)||f.transport!==`all`||f.errorsOnly,A=[O[0],O[1],f.transport===`all`?``:D(f.transport),O[2],O[3],f.errorsOnly?t(`sandbox.records.errorsOnly`):``].filter(Boolean).join(` · `)||t(`sandbox.records.noFilter`),j=[{value:`all`,label:t(`sandbox.testCall.transport.all`)},{value:`mcp`,label:D(`mcp`)},{value:`http`,label:D(`http`)},{value:`chatluna`,label:D(`chatluna`)}];return x(Ly,{title:t(`sandbox.testCall.title`),description:t(`sandbox.testCall.description`),loading:o,error:u,live:v,onLiveChange:S,onRefresh:T,clear:{label:t(`sandbox.testCall.clear`),title:t(`sandbox.testCall.clearTitle`),description:t(`sandbox.testCall.clearDescription`),disabled:!n.length,onConfirm:async()=>{try{await Ru(`onebot-sandbox.clear-test-call-records`,void 0),a(void 0),await C()}catch(e){d(Vu(e,t(`sandbox.testCall.clearFailed`)))}}},children:[b(Ry,{label:t(`sandbox.records.list`),order:m,onToggleOrder:()=>{let e=m===`desc`?`asc`:`desc`;h(e),C(f,e)},loading:o,empty:!n.length,filter:{active:k,summary:A,open:g,onOpenChange:e=>{_(e),e||C()},content:x(y,{children:[b($y,{label:t(`sandbox.testCall.tool`),children:b(Tn,{value:f.tool,placeholder:`send_message`,onChange:e=>E({tool:e.target.value}),onKeyDown:e=>e.key===`Enter`&&void C()})}),b($y,{label:t(`sandbox.testCall.credential`),children:b(Tn,{value:f.credentialName,onChange:e=>E({credentialName:e.target.value}),onKeyDown:e=>e.key===`Enter`&&void C()})}),b($y,{label:t(`sandbox.testCall.transportLabel`),children:x(Cs,{value:f.transport,onValueChange:e=>e&&E({transport:e},!0),items:j,children:[b(Ts,{className:`w-full`,children:b(ws,{})}),b(Es,{className:`sandbox-glass`,children:j.map(e=>b(Ds,{value:e.value,children:e.label},e.value))})]})}),b($y,{label:t(`sandbox.testCall.space`),children:b(Tn,{value:f.spaceId,placeholder:`space-1`,onChange:e=>E({spaceId:e.target.value}),onKeyDown:e=>e.key===`Enter`&&void C()})}),b($y,{label:t(`sandbox.testCall.testRun`),children:b(Tn,{value:f.testRunId,placeholder:`run-1`,onChange:e=>E({testRunId:e.target.value}),onKeyDown:e=>e.key===`Enter`&&void C()})}),x(`label`,{className:`flex items-center gap-2 text-xs`,children:[b(cs,{checked:f.errorsOnly,onCheckedChange:e=>E({errorsOnly:e===!0},!0)}),t(`sandbox.records.errorsOnly`)]}),b(W,{variant:`outline`,size:`sm`,onClick:()=>{p(Mb),C(Mb)},children:t(`sandbox.records.reset`)})]})},children:rb(n,m,(e,t)=>e.id.localeCompare(t.id)).map(e=>b(zy,{active:e.id===i?.id,onClick:()=>void w(e.id),title:e.tool,status:e.status,tag:e.transport.toUpperCase(),time:e.createdAt,duration:e.durationMs,meta:[e.credentialName]},e.id))}),b(Hy,{label:t(`sandbox.records.detail`),loading:c,scrollKey:i?.id,header:i&&b(Uy,{title:i.tool,time:i.createdAt,duration:i.durationMs,badges:x(y,{children:[b(Wy,{status:i.status}),b(By,{children:i.transport.toUpperCase()})]})}),children:i&&b(Pb,{record:i})})]})}function Pb({record:e}){let t=q();return x(y,{children:[e.error&&x(Jy,{icon:Od,title:t(`sandbox.records.diagnosis`),tone:`destructive`,children:[b(`span`,{className:`font-mono`,children:e.error.code}),` · `,e.error.message]}),x(Gy,{children:[b(Ky,{icon:Kd,label:t(`sandbox.testCall.credential`),value:e.credentialName}),b(Ky,{icon:$d,label:t(`sandbox.testCall.transportLabel`),value:(e=>t(`sandbox.testCall.transport.${e}`))(e.transport)}),e.sourceIp&&b(Ky,{icon:Hd,label:t(`sandbox.testCall.sourceIp`),value:b(`span`,{className:`font-mono`,children:e.sourceIp})}),e.spaceId&&b(Ky,{icon:bd,label:t(`sandbox.testCall.space`),value:b(`span`,{className:`font-mono`,children:e.spaceId})}),e.testRunId&&b(Ky,{icon:uf,label:t(`sandbox.testCall.testRun`),value:b(`span`,{className:`font-mono`,children:e.testRunId})})]}),b(Yy,{icon:xd,title:t(`sandbox.testCall.arguments`),children:b(Qy,{value:e.arguments})}),e.result!==void 0&&b(Yy,{icon:xd,title:t(`sandbox.testCall.result`),children:b(Qy,{value:e.result})}),e.error&&b(Yy,{icon:Od,title:t(`sandbox.testCall.error`),children:b(Qy,{value:e.error})})]})}function Fb({label:t=`AI`,size:n=20}){let[r,i]=e.useState({top:`38%`,left:`55%`}),[a,o]=e.useState(!1),[s,c]=e.useState(!1),l=e.useRef({}),u=e.useCallback(()=>{clearTimeout(l.current.click),clearTimeout(l.current.loading)},[]);return e.useEffect(()=>{if(window.matchMedia(`(prefers-reduced-motion: reduce)`).matches)return;let e,t=()=>{e=setTimeout(()=>{u(),o(!1),c(!1),i({top:`${22+Math.random()*52}%`,left:`${18+Math.random()*60}%`}),t()},5200+Math.random()*3800)};return l.current.loading=setTimeout(()=>c(!0),200),t(),()=>{clearTimeout(e),u()}},[u]),b(`div`,{className:U(`sandbox-agent-cursor`,a&&`is-clicking`,s&&`is-loading`),style:r,"aria-hidden":`true`,onTransitionEnd:e=>{e.propertyName===`top`&&(u(),o(!0),l.current.click=setTimeout(()=>{o(!1),l.current.loading=setTimeout(()=>c(!0),200)},400))},children:x(`span`,{className:`sandbox-agent-cursor-float`,children:[b(`svg`,{viewBox:`0 0 20 20`,width:n,height:n,fill:`none`,"aria-hidden":`true`,children:b(`path`,{d:`M6.465 15.647 4.511 4.813a1 1 0 0 1 1.366-1.102l9.698 4.007c.853.352.815 1.572-.058 1.87l-4.682 1.6a1 1 0 0 0-.588.534l-1.887 4.16c-.405.894-1.72.73-1.895-.235Z`,fill:`currentColor`,stroke:`#fff`,strokeWidth:`1.5`})}),b(`span`,{className:`sandbox-agent-cursor-label`,children:t})]})})}var Ib=`url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2020%2020%22%3E%3Cdefs%3E%3Cmask%20id%3D%22m%22%20maskUnits%3D%22userSpaceOnUse%22%3E%3Crect%20x%3D%22-8%22%20y%3D%22-8%22%20width%3D%2236%22%20height%3D%2236%22%20fill%3D%22%23fff%22%2F%3E%3Cpath%20d%3D%22M9.3%2016.3%208.08%209.53a.63%20.63%200%200%201%20.85-.69L15%2011.35a.63%20.63%200%200%201-.03%201.18l-2.93%201a.63%20.63%200%200%200-.37.34l-1.18%202.6a.63%20.63%200%200%201-1.19-.17Z%22%20transform%3D%22translate(1.6%201)%20translate(0%20.35)%20translate(10.8%2012.4)%20scale(1.28)%20translate(-10.8%20-12.4)%22%20fill%3D%22%23000%22%20stroke%3D%22%23000%22%20stroke-width%3D%223.2%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cellipse%20cx%3D%2212.6%22%20cy%3D%2216.9%22%20rx%3D%224.2%22%20ry%3D%223.4%22%20fill%3D%22%23000%22%2F%3E%3Cellipse%20cx%3D%2214.8%22%20cy%3D%2214.6%22%20rx%3D%222.6%22%20ry%3D%222.4%22%20fill%3D%22%23000%22%2F%3E%3Ccircle%20cx%3D%2210.6%22%20cy%3D%2217.8%22%20r%3D%222.8%22%20fill%3D%22%23000%22%2F%3E%3C%2Fmask%3E%3C%2Fdefs%3E%3Crect%20x%3D%22-8%22%20y%3D%22-8%22%20width%3D%2236%22%20height%3D%2236%22%20fill%3D%22%23fff%22%20mask%3D%22url(%23m)%22%2F%3E%3C%2Fsvg%3E")`,Lb={maskImage:Ib,maskSize:`100% 100%`,maskRepeat:`no-repeat`,WebkitMaskImage:Ib,WebkitMaskSize:`100% 100%`,WebkitMaskRepeat:`no-repeat`};function Rb({running:e,small:t}){return x(`span`,{className:U(`sandbox-agent-control`,e&&`is-running`,t&&`is-small`),"aria-hidden":`true`,children:[x(`span`,{className:`sandbox-agent-control-orbit`,children:[b(`span`,{className:`sandbox-agent-control-orbit-band is-inner`}),b(`span`,{className:`sandbox-agent-control-orbit-band is-outer`})]}),b(`svg`,{className:`sandbox-agent-control-icon sandbox-agent-control-rays-layer`,style:Lb,viewBox:`0 0 20 20`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,children:b(`g`,{transform:`translate(1.6 1)`,children:b(`g`,{transform:`translate(8.7 8.4)`,children:b(`g`,{className:`sandbox-agent-control-icon-rays`,children:b(`g`,{transform:`translate(-8.7 -8.4)`,children:b(`path`,{d:`M8.4.9v2.5M3.33 3.33 5.1 5.1M1.2 8.4h2.5M3.33 13.47l1.77-1.77M13.47 3.33 11.7 5.1M13.1 8.4h2.5M8.4 15.9v-2.5M13.47 13.47 11.7 11.7`,transform:`translate(.3 0)`})})})})})}),b(`svg`,{className:`sandbox-agent-control-icon sandbox-agent-control-pointer`,viewBox:`0 0 20 20`,fill:`none`,children:b(`g`,{transform:`translate(1.6 1)`,children:b(`path`,{d:`M9.3 16.3 8.08 9.53a.63 .63 0 0 1 .85-.69L15 11.35a.63 .63 0 0 1-.03 1.18l-2.93 1a.63 .63 0 0 0-.37.34l-1.18 2.6a.63 .63 0 0 1-1.19-.17Z`,transform:`translate(0 .35)`,fill:`currentColor`,stroke:`none`})})})]})}var zb=`#version 100
|
|
4
|
+
precision mediump float;
|
|
5
|
+
|
|
6
|
+
uniform vec2 uResolution;
|
|
7
|
+
|
|
8
|
+
uniform float uStroke;
|
|
9
|
+
uniform float uBlur;
|
|
10
|
+
uniform float uRadius;
|
|
11
|
+
uniform float uFade;
|
|
12
|
+
uniform vec4 uAccent;
|
|
13
|
+
uniform float uScrollOffset;
|
|
14
|
+
|
|
15
|
+
float hash21(vec2 p) {
|
|
16
|
+
vec2 q = fract(p * vec2(0.3183099, 0.3678794)) + 0.1;
|
|
17
|
+
q = q + dot(q, q + 19.19);
|
|
18
|
+
return fract(q.x * q.y);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
float ringDist(vec2 p_in) {
|
|
22
|
+
float r = max(uRadius, 0.0);
|
|
23
|
+
vec2 half_res = uResolution * 0.5;
|
|
24
|
+
vec2 p = abs(p_in - half_res) - (half_res - vec2(r));
|
|
25
|
+
float outside = length(max(p, vec2(0.0)));
|
|
26
|
+
float inside = min(max(p.x, p.y), 0.0);
|
|
27
|
+
return -(outside + inside - r);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
vec4 rampColor(float t_in) {
|
|
31
|
+
float t = fract(t_in);
|
|
32
|
+
vec4 a = vec4(uAccent.rgb, 0.8);
|
|
33
|
+
vec4 m = vec4(uAccent.rgb, 0.0);
|
|
34
|
+
vec4 lo = mix(a, m, smoothstep(0.0, 0.5, t));
|
|
35
|
+
vec4 hi = mix(m, a, smoothstep(0.5, 1.0, t));
|
|
36
|
+
return t < 0.5 ? lo : hi;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
float hardStroke(vec2 p) {
|
|
40
|
+
float d = ringDist(p);
|
|
41
|
+
float halfS = max(uStroke * 0.5, 1.0);
|
|
42
|
+
return smoothstep(halfS, 0.0, abs(d));
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
float sampleStroke(vec2 fragcoord, float blur, float cs, float sn, vec2 off) {
|
|
46
|
+
vec2 rot = vec2(off.x * cs - off.y * sn, off.x * sn + off.y * cs);
|
|
47
|
+
return hardStroke(fragcoord + rot * blur);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
void main() {
|
|
51
|
+
vec2 fragcoord = gl_FragCoord.xy;
|
|
52
|
+
float blur = max(uBlur, 0.5);
|
|
53
|
+
float theta = hash21(fragcoord) * 6.2831853;
|
|
54
|
+
float cs = cos(theta);
|
|
55
|
+
float sn = sin(theta);
|
|
56
|
+
|
|
57
|
+
float sum = hardStroke(fragcoord) * 1.00000000;
|
|
58
|
+
sum += sampleStroke(fragcoord, blur, cs, sn, vec2(0.5253, -0.1547)) * 0.54895195;
|
|
59
|
+
sum += sampleStroke(fragcoord, blur, cs, sn, vec2(-0.4254, -0.3611)) * 0.53648497;
|
|
60
|
+
sum += sampleStroke(fragcoord, blur, cs, sn, vec2(0.0840, 0.6276)) * 0.44848703;
|
|
61
|
+
sum += sampleStroke(fragcoord, blur, cs, sn, vec2(-0.6783, 0.2515)) * 0.35109927;
|
|
62
|
+
sum += sampleStroke(fragcoord, blur, cs, sn, vec2(-0.2049, -0.8231)) * 0.23717542;
|
|
63
|
+
sum += sampleStroke(fragcoord, blur, cs, sn, vec2(0.7975, 0.4521)) * 0.18622469;
|
|
64
|
+
sum += sampleStroke(fragcoord, blur, cs, sn, vec2(-0.8654, -0.1832)) * 0.20909663;
|
|
65
|
+
sum += sampleStroke(fragcoord, blur, cs, sn, vec2(0.1521, -0.5736)) * 0.49445322;
|
|
66
|
+
sum += sampleStroke(fragcoord, blur, cs, sn, vec2(0.5612, 0.2138)) * 0.48611417;
|
|
67
|
+
sum += sampleStroke(fragcoord, blur, cs, sn, vec2(-0.1834, 0.3015)) * 0.77952102;
|
|
68
|
+
sum += sampleStroke(fragcoord, blur, cs, sn, vec2(-0.4421, 0.7531)) * 0.21757231;
|
|
69
|
+
sum += sampleStroke(fragcoord, blur, cs, sn, vec2(0.8123, -0.4986)) * 0.16253425;
|
|
70
|
+
sum += sampleStroke(fragcoord, blur, cs, sn, vec2(-0.7211, -0.6173)) * 0.16495394;
|
|
71
|
+
sum += sampleStroke(fragcoord, blur, cs, sn, vec2(0.2412, -0.9012)) * 0.17540148;
|
|
72
|
+
|
|
73
|
+
float tile = max(uResolution.y, 1.0);
|
|
74
|
+
float scroll = mod(uScrollOffset, tile);
|
|
75
|
+
if (scroll < 0.0) {
|
|
76
|
+
scroll += tile;
|
|
77
|
+
}
|
|
78
|
+
float t = (fragcoord.y + scroll) / tile;
|
|
79
|
+
vec4 ramp = rampColor(t);
|
|
80
|
+
float alpha = (sum / 6.22071317) * clamp(uFade, 0.0, 1.0) * ramp.a;
|
|
81
|
+
gl_FragColor = vec4(ramp.rgb * alpha, alpha);
|
|
82
|
+
}
|
|
83
|
+
`,Bb=`attribute vec2 a_Position;
|
|
84
|
+
void main() { gl_Position = vec4(a_Position, 0.0, 1.0); }
|
|
85
|
+
`,Vb=[.27,.42,.85],Hb=[{stroke:160,blur:115,radius:14,fade:1,scrollSpeed:1/7,scrollPhase:0},{stroke:76,blur:185,radius:14,fade:1,scrollSpeed:-1/9,scrollPhase:.5}];function Ub(e,t,n){let r=e.createShader(t);return r?(e.shaderSource(r,n),e.compileShader(r),e.getShaderParameter(r,e.COMPILE_STATUS)?r:(console.warn(`[chatluna-sandbox] overlay shader 编译失败:`,e.getShaderInfoLog(r)),e.deleteShader(r),null)):null}function Wb(e,t){let n=Ub(e,e.VERTEX_SHADER,Bb),r=Ub(e,e.FRAGMENT_SHADER,t);if(!n||!r)return null;let i=e.createProgram();if(!i)return null;if(e.attachShader(i,n),e.attachShader(i,r),e.bindAttribLocation(i,0,`a_Position`),e.linkProgram(i),!e.getProgramParameter(i,e.LINK_STATUS))return console.warn(`[chatluna-sandbox] overlay shader 链接失败:`,e.getProgramInfoLog(i)),null;let a={},o=e.getProgramParameter(i,e.ACTIVE_UNIFORMS);for(let t=0;t<o;t++){let n=e.getActiveUniform(i,t);n&&(a[n.name]=e.getUniformLocation(i,n.name))}return{program:i,uniforms:a}}function Gb(e){let t=getComputedStyle(e).color.match(/rgba?\(\s*([\d.]+)[\s,]+([\d.]+)[\s,]+([\d.]+)/);return t?[Number(t[1])/255,Number(t[2])/255,Number(t[3])/255]:Vb}function Kb(e){let t=e.getContext(`webgl`,{alpha:!0,premultipliedAlpha:!0,antialias:!1});if(!t)return null;let n=Wb(t,zb);if(!n)return null;let r=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,r),t.bufferData(t.ARRAY_BUFFER,new Float32Array([-1,-1,3,-1,-1,3]),t.STATIC_DRAW),t.enableVertexAttribArray(0),t.vertexAttribPointer(0,2,t.FLOAT,!1,0,0),t.enable(t.BLEND),t.blendFunc(t.ONE,t.ONE_MINUS_SRC_ALPHA);let i=Math.min(window.devicePixelRatio||1,2),a=window.matchMedia(`(prefers-reduced-motion: reduce)`).matches,o=0,s=!1,c=performance.now(),l=Gb(e);function u(){let t=Math.max(1,Math.round(e.clientWidth*i)),n=Math.max(1,Math.round(e.clientHeight*i));(e.width!==t||e.height!==n)&&(e.width=t,e.height=n)}function d(e,r){let i=n.uniforms[e];i&&t.uniform1f(i,r)}function f(r){if(s)return;u();let p=e.width,m=e.height,h=(r-c)/1e3;t.viewport(0,0,p,m),t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT),t.useProgram(n.program);for(let e of Hb){t.uniform2f(n.uniforms.uResolution,p,m),d(`uStroke`,e.stroke*i),d(`uBlur`,e.blur*i),d(`uRadius`,e.radius*i),d(`uFade`,e.fade);let r=n.uniforms.uAccent;r&&t.uniform4f(r,l[0],l[1],l[2],1),d(`uScrollOffset`,(h*e.scrollSpeed+e.scrollPhase)*m),t.drawArrays(t.TRIANGLES,0,3)}a||(o=requestAnimationFrame(f))}let p=typeof ResizeObserver>`u`?null:new ResizeObserver(()=>{a&&f(performance.now())});p?.observe(e);let m=typeof MutationObserver>`u`?null:new MutationObserver(()=>{l=Gb(e),a&&f(performance.now())});return m?.observe(document.documentElement,{attributes:!0,attributeFilter:[`class`,`style`,`data-theme`]}),f(performance.now()),()=>{s=!0,cancelAnimationFrame(o),p?.disconnect(),m?.disconnect(),t.deleteBuffer(r),t.deleteProgram(n.program)}}function qb({spaceName:t,busy:n,style:r,onTakeOver:i,onTerminate:a}){let o=q(),s=e.useRef(null);return e.useEffect(()=>{if(s.current)return Kb(s.current)??void 0},[]),x(`div`,{className:`sandbox-agent-observe`,style:r,"aria-live":`polite`,children:[b(`div`,{className:`sandbox-agent-observe-dots`,"aria-hidden":`true`}),b(`canvas`,{ref:s,className:`sandbox-agent-observe-canvas`,"aria-hidden":`true`}),b(Fb,{}),x(`div`,{role:`toolbar`,"aria-label":t,className:`sandbox-agent-taskbar sandbox-glass bg-popover text-popover-foreground shadow-popup ring-1 ring-border`,children:[b(`span`,{className:`sandbox-agent-pulse-dot`,"aria-hidden":`true`}),b(`span`,{className:`sandbox-agent-taskbar-status`,children:o(`sandbox.spaces.taskbar.subtitle`)}),b(`span`,{className:`sandbox-agent-taskbar-divider`,"aria-hidden":`true`}),b(W,{size:`sm`,className:`rounded-full`,disabled:n,onClick:i,children:o(`sandbox.spaces.taskbar.takeOver`)}),b(W,{size:`sm`,variant:`ghost`,className:`rounded-full text-destructive`,disabled:n,onClick:a,children:o(`sandbox.spaces.taskbar.terminate`)})]})]})}function Jb(e){let t=e.getBoundingClientRect(),n=[e,...e.querySelectorAll(`*`)].flatMap((e,t)=>e.scrollLeft||e.scrollTop?[{index:t,left:e.scrollLeft,top:e.scrollTop}]:[]),r=e.cloneNode(!0);return Xb(e,r),Zb(r),{element:r,width:t.width,height:t.height,scrollOffsets:n}}function Yb(e){let t=e.element.cloneNode(!0);Xb(e.element,t);let n=[t,...t.querySelectorAll(`*`)];for(let e of n)e.removeAttribute(`id`);return t.inert=!0,t.setAttribute(`aria-hidden`,`true`),t.classList.add(`sandbox-space-thumbnail-live`),t}function Xb(e,t){let n=[...e.querySelectorAll(`canvas`)].filter(e=>!e.closest(`.sandbox-agent-observe`)),r=[...t.querySelectorAll(`canvas`)].filter(e=>!e.closest(`.sandbox-agent-observe`));for(let[e,t]of n.entries()){let n=r[e];n&&(n.width=t.width,n.height=t.height,n.getContext(`2d`)?.drawImage(t,0,0))}}function Zb(e){for(let t of e.querySelectorAll(`.sandbox-agent-observe`))t.remove()}function Qb(e,t){let n=[t,...t.querySelectorAll(`*`)];for(let{index:t,left:r,top:i}of e.scrollOffsets){let e=n[t];e&&(e.scrollLeft=r,e.scrollTop=i)}}function $b(e){let{containerWidth:t,containerHeight:n,canvasWidth:r,canvasHeight:i}=e;if(!t||!n||!r||!i)return;let a=Math.min(t/r,n/i);return{scale:a,left:(t-r*a)/2,top:(n-i*a)/2}}var ex=lx(400,.17),tx=lx(340,0),nx=lx(300,.25),rx=24,ix=1.08,ax=18,ox=`sandbox-workspace-zooming`,sx=`data-zoom-hidden`,cx=`.sandbox-space-thumbnail-live, .sandbox-space-thumbnail-preview`;function lx(e,t){let n=ag({duration:e,bounce:t}),r=Math.min(n.settlingDuration,Math.round(e*1.5)),i=r/n.settlingDuration;return{duration:r,easing:`linear(${Array.from({length:65},(e,t)=>t===64?1:Math.round(n.ease(t/64*i)*1e4)/1e4).join(`, `)})`}}var ux;function dx(){return window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}function fx(e){if(dx())return;let t=e?.getBoundingClientRect();return t&&t.width>0&&t.height>0?t:void 0}function px(e){return fx(e?.querySelector(cx)??e)}function mx(){let e=ux;if(ux=void 0,e){for(let t of e.animations)t.cancel();e.cleanup()}}function hx(){mx()}function gx(e,t){return Object.assign(e.style,{transition:`none`,...t}),()=>{for(let n of[`transition`,...Object.keys(t)])e.style.removeProperty(n.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`))}}function _x(e,t){let n={animations:e,cleanup:t};return ux=n,Promise.all(e.map(e=>e.finished)).then(()=>{ux===n&&(ux=void 0,t())},()=>{}),n}function vx(e,t,n=t){let r=e.width/n.width;return{scale:r,transform:`translate(${e.left-t.left-(n.left-t.left)*r}px, ${e.top+(e.height-n.height*r)/2-t.top-(n.top-t.top)*r}px) scale(${r})`}}var yx=`translate(0px, 0px) scale(1)`;function bx(e,t,n,r,i){mx();let a=e.getBoundingClientRect();if(dx()||!a.width||!a.height){i?.();return}let o=e,{scale:s,transform:c}=vx(t,a);document.documentElement.classList.add(ox);let l=[gx(o,{transformOrigin:`0 0`,overflow:`hidden`})],u=[o.animate({transform:[c,yx]},ex),o.animate({borderRadius:[`${ax/s}px`,`0px`]},ex)];if(n){let e=n.getBoundingClientRect();l.push(gx(n,{transformOrigin:`${t.left+t.width/2-e.left}px ${t.top+t.height/2-e.top}px`})),u.push(n.animate({transform:[`scale(1)`,`scale(${ix})`],opacity:[1,0]},{...tx,fill:`forwards`}))}r&&(r.setAttribute(sx,``),l.push(()=>r.removeAttribute(sx))),_x(u,()=>{for(let e of l)e();document.documentElement.classList.remove(ox),i?.()})}function xx(e,t){if(mx(),dx())return()=>!1;let n=[],r=[],i=t?.card;if(i&&t){e.classList.add(`is-zooming`),n.push(()=>e.classList.remove(`is-zooming`));let a=i.getBoundingClientRect(),o=i.querySelector(cx)?.getBoundingClientRect(),{transform:s}=vx(t.rect,a,o?.width?o:a);n.push(gx(i,{transformOrigin:`0 0`,zIndex:`30`})),r.push(i.animate({transform:[s,yx]},ex),i.animate({borderRadius:[`0px`,`${ax}px`]},ex))}let a=[...e.querySelectorAll(`.sandbox-space-card`)].filter(e=>e!==i);for(let[e,t]of a.entries())n.push(gx(t,{})),r.push(t.animate({transform:[`translateY(16px)`,`translateY(0px)`],opacity:[0,1]},{...nx,delay:e*rx,fill:`backwards`}));if(!r.length)return()=>!1;let o=_x(r,()=>{for(let e of n)e()});return()=>ux===o&&(mx(),!0)}var Sx=[`all`,`running`,`taken-over`,`completed`,`failed`],Cx=1440,wx=760,Tx={openEntity(){},openRemark(){},openGroupAction(){},openConversationRename(){},openProfile(){},openGroupProfile(){}},Ex=new Intl.DateTimeFormat(void 0,{month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`});function Dx({spaces:t,mainStore:n,captures:r,exitZoom:i,launching:a,onEnter:o,onCreate:s,onAction:c}){let l=q(),[u,d]=e.useState(`all`),[f,p]=e.useState(),m=e.useRef(null),h=e.useSyncExternalStore(n.subscribe,n.getView,n.getView).workspace,g=Ox(t,h),_=u===`all`?t:t.filter(e=>e.status===u),v=Sx.map(e=>({value:e,label:l(`sandbox.spaces.filter.${e}`)})),y=a!==void 0;e.useLayoutEffect(()=>{if(y)return;let e=i.current;i.current=void 0;let t=m.current;if(!t)return;let n=xx(t,e&&{card:t.querySelector(`[data-space-id="${CSS.escape(e.key)}"]`),rect:e.rect});return()=>{n()&&(i.current=e)}},[i,y]);let S=e=>t=>{`key`in t&&t.key!==`Enter`||o(e)};return x(`section`,{ref:m,"aria-label":l(`sandbox.spaces.overviewLabel`),className:U(`sandbox-space-overview`,y&&`is-backdrop`),inert:y,"aria-hidden":y||void 0,style:{"--sandbox-accent":h?.appearance.sandboxAccentColor??`#2563eb`,top:a?.top},children:[x(`header`,{className:`sandbox-space-toolbar`,children:[b(`p`,{children:l(`sandbox.spaces.summary`,{count:t.length})}),x(Cs,{value:u,onValueChange:e=>e&&d(e),items:v,children:[b(Ts,{className:`w-36`,"aria-label":l(`sandbox.spaces.filterLabel`),children:b(ws,{})}),b(Es,{className:`sandbox-glass`,children:v.map(e=>b(Ds,{value:e.value,children:e.label},e.value))})]})]}),x(`div`,{className:`sandbox-space-grid`,children:[x(`article`,{className:`sandbox-space-card is-main`,"data-space-id":`main`,tabIndex:0,onClick:S(),onKeyDown:S(),children:[b(kx,{capture:r.main,store:h?n:void 0}),x(`footer`,{children:[x(`div`,{className:`min-w-0`,children:[b(`strong`,{className:`truncate`,children:l(`sandbox.spaces.main.name`)}),b(`small`,{children:l(`sandbox.spaces.main.note`)})]}),b(Zn,{variant:`secondary`,children:l(`sandbox.spaces.main.badge`)})]})]}),_.map(e=>{let t=e.status===`running`;return x(`article`,{className:U(`sandbox-space-card`,t&&`is-running`),"data-space-id":e.id,tabIndex:0,onClick:S(e.id),onKeyDown:S(e.id),children:[b(kx,{capture:r[e.id],store:h?g.get(e.id):void 0,running:t}),x(`footer`,{children:[x(`div`,{className:`min-w-0`,children:[b(`strong`,{className:`truncate`,children:e.name}),x(`small`,{children:[t&&b(`span`,{className:`sandbox-agent-pulse-dot`,"aria-hidden":`true`}),l(`sandbox.spaces.status.${e.status}`),` · `,Ex.format(new Date(e.createdAt))]})]}),x(`div`,{className:`sandbox-space-card-actions`,onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),children:[e.status===`taken-over`&&b(`button`,{type:`button`,className:`sandbox-space-card-pill`,onClick:()=>c(`return`,e.id),children:l(`sandbox.spaces.return`)}),(e.status===`completed`||e.status===`failed`)&&b(`button`,{type:`button`,className:`sandbox-space-card-pill`,onClick:()=>c(`reactivate`,e.id),children:l(`sandbox.spaces.reactivate`)}),b(W,{size:`icon-xs`,variant:`ghost`,"aria-label":l(`sandbox.spaces.delete`),onClick:()=>p({title:l(`sandbox.spaces.deleteTitle`,{name:e.name}),description:l(`sandbox.spaces.deleteDescription`),action:l(`sandbox.spaces.delete`),onConfirm:()=>c(`delete`,e.id)}),children:b(df,{})})]})]})]},e.id)}),x(`button`,{type:`button`,className:`sandbox-space-card sandbox-space-create`,onClick:s,children:[b(ef,{className:`size-10`,strokeWidth:1.4,"aria-hidden":`true`}),b(`strong`,{className:`font-medium`,children:l(`sandbox.spaces.create`)})]})]}),b(Zv,{request:f,onClose:()=>p(void 0)})]})}function Ox(t,n){let r=e.useRef(new Map);for(let e of t)r.current.has(e.id)||r.current.set(e.id,{store:new Ku(e.id)});return e.useEffect(()=>{let e=new Set(t.map(({id:e})=>e));for(let t of r.current.keys())e.has(t)||r.current.delete(t);if(n)for(let e of t){let t=r.current.get(e.id);!t||t.revision===e.snapshot.revision||(t.store.seed({...n,snapshot:e.snapshot,chatLunaStates:[]}),t.revision=e.snapshot.revision)}},[t,n]),new Map([...r.current].map(([e,{store:t}])=>[e,t]))}function kx({capture:t,store:n,running:r}){let i=e.useRef(null),a=e.useRef(null),o=e.useRef(null),s=e.useCallback(()=>{let e=i.current,n=t?a.current?.firstElementChild:o.current;if(!e||!(n instanceof HTMLElement))return;let r=$b({containerWidth:e.clientWidth,containerHeight:e.clientHeight,canvasWidth:t?.width??Cx,canvasHeight:t?.height??wx});r&&(t&&(n.style.width=`${t.width}px`,n.style.height=`${t.height}px`),n.style.transform=`translate(${r.left}px, ${r.top}px) scale(${r.scale})`)},[t]);e.useLayoutEffect(()=>{let e=a.current;if(!e||(e.replaceChildren(),!t))return;let n=Yb(t);e.append(n),s();let r=requestAnimationFrame(()=>Qb(t,n));return()=>cancelAnimationFrame(r)},[t,s]);let c=!t&&n!==void 0;return e.useLayoutEffect(()=>{s();let e=i.current;if(!e)return;let t=new ResizeObserver(s);return t.observe(e),()=>t.disconnect()},[s,c]),x(`div`,{ref:i,className:`sandbox-space-thumbnail`,"aria-hidden":`true`,children:[b(`div`,{ref:a,className:`sandbox-space-thumbnail-host`}),!t&&n&&b(`div`,{ref:o,inert:!0,className:`sandbox-space-thumbnail-preview`,children:b(ed,{store:n,dialogs:Tx,children:b(Ax,{})})}),r&&b(Fb,{size:16})]})}function Ax(){let{derived:e}=Zu();return e?b(py,{}):null}var jx=1500;function Mx(){let[t,n]=e.useState([]),[r,i]=e.useState(!1),a=e.useRef(``),o=e.useCallback(async()=>{let e=await Ru(`onebot-sandbox.test-spaces`,void 0),t=e.map(({id:e,name:t,status:n,snapshot:r})=>`${e}:${t}:${n}:${r.revision}`).join(`|`);i(!0),t!==a.current&&(a.current=t,n(e))},[]);return e.useEffect(()=>{let e=()=>void o().catch(()=>{});e();let t=setInterval(e,jx);return()=>clearInterval(t)},[o]),{spaces:t,loaded:r,reload:o}}var Nx={get_status:`获取机器人在线状态和运行状态`,get_login_info:`获取当前机器人的 QQ ID 和昵称`,get_version_info:`获取当前 OneBot 实现和协议版本信息`,get_friend_list:`获取当前机器人的好友列表`,get_group_list:`获取当前机器人已加入的群列表`,get_group_info:`获取指定群的名称和成员数量`,get_group_member_info:`获取指定群成员的资料和群身份`,get_group_member_list:`获取指定群的全部成员列表`,send_private_msg:`向指定好友发送私聊消息`,send_group_msg:`向指定群发送群聊消息`,send_msg:`根据参数自动发送私聊或群聊消息`,get_msg:`按消息 ID 获取机器人可见的消息详情`,delete_msg:`撤回机器人发送且仍可操作的消息`,set_group_kick:`将指定普通成员踢出群聊`,set_group_admin:`设置或取消指定成员的管理员身份`,set_group_card:`修改指定成员的群名片`,set_group_name:`修改指定群的群名称`,set_friend_add_request:`同意或拒绝好友申请`,set_group_add_request:`同意或拒绝加群申请或群邀请`,set_group_leave:`退出指定群聊(群主不可直接退出)`,set_group_ban:`禁言或解除禁言指定群成员;沙盒保存禁言到期时间`,set_group_special_title:`设置或清除群成员专属头衔;沙盒保存头衔并在群成员资料中返回`},Px=[{id:`get_stranger_info`,action:`get_stranger_info`,handler:`get_stranger_info`,description:`获取指定 QQ 用户的基础资料`,surface:`native`,supported:!0},{id:`message.history.friend`,action:`get_friend_msg_history`,handler:`get_friend_msg_history`,description:`获取指定好友的私聊历史消息`,surface:`native`,supported:!0},{id:`message.history.group`,action:`get_group_msg_history`,handler:`get_group_msg_history`,description:`获取指定群的群聊历史消息`,surface:`native`,supported:!0},{id:`friend.category.list`,action:`get_friends_with_category`,handler:`get_friends_with_category`,description:`获取按 QQ 好友分组整理的好友列表`,surface:`native`,supported:!0},{id:`friend.remark.set`,action:`set_friend_remark`,handler:`set_friend_remark`,description:`修改当前机器人对指定好友的备注;空备注表示清除备注,get_friend_list 与 get_recent_contact 立刻返回同一份值`,surface:`native`,supported:!0},{id:`delete_friend`,action:`delete_friend`,handler:`delete_friend`,description:`删除当前机器人的指定好友`,surface:`native`,supported:!0},{id:`set_qq_profile`,action:`set_qq_profile`,handler:`set_qq_profile`,description:`修改当前机器人的昵称和个性签名`,surface:`native`,supported:!0},{id:`set_qq_avatar`,action:`set_qq_avatar`,handler:`set_qq_avatar`,description:`修改当前机器人的头像`,surface:`native`,supported:!0},{id:`send_poke`,action:`send_poke`,handler:`send_poke`,description:`向好友或群成员发送戳一戳`,aliases:[`friend_poke`,`group_poke`],surface:`native`,supported:!0},{id:`group.member.shut-list`,action:`get_group_shut_list`,handler:`get_group_shut_list`,description:`获取指定群当前处于禁言状态的成员列表`,aliases:[`getGroupShutList`],surface:`native`,supported:!0},{id:`group.notice.list`,action:`_get_group_notice`,handler:`get_group_notice`,description:`获取指定群的公告列表;沙盒公告没有图片、发布设置与阅读数,NapCat 的 image 与 images 都返回空数组,LLBot 必给的 settings 五项按 false 返回,NapCat 的可选 settings 与 read_num 不出现`,surface:`native`,supported:!0},{id:`group.system-msg`,action:`get_group_system_msg`,handler:`get_group_system_msg`,description:`获取机器人有权审批的入群申请与发给它的群邀请;返回的 request_id 可直接作为 set_group_add_request 的 flag`,surface:`native`,supported:!0},{id:`message.emoji-like`,action:`set_msg_emoji_like`,handler:`set_msg_emoji_like`,description:`给消息贴表情回应;沙盒按 emoji 保存回应参与者`,surface:`native`,supported:!0},{id:`message.emoji-like.list`,action:`fetch_emoji_like`,handler:`fetch_emoji_like`,description:`获取消息上某个 emoji 的表情回应参与者;沙盒不分页,cookie 恒为空串;nickName 刻意返回参与者真名,而不是复刻 LLBot 上游写死的空串`,surface:`native`,supported:!0},{id:`message.forward.send`,action:`send_forward_msg`,handler:`send_forward_msg`,description:`发送合并转发消息;沙盒创建独立转发资源,并在会话中写入外层 forward 卡片消息`,aliases:[`send_group_forward_msg`,`send_private_forward_msg`],surface:`native`,supported:!0},{id:`message.forward.get`,action:`get_forward_msg`,handler:`get_forward_msg`,description:`读取合并转发详情;接受转发资源 id 或外层消息 message_id,返回 node 列表`,surface:`native`,supported:!0}];function Fx(e){let t=new Map(e.map(e=>[e.id,e])),n=[...Object.entries(Nx).map(([e,t])=>({id:e,action:e,handler:e,description:t,surface:`standard`,supported:!0})),...Px].map(e=>t.get(e.id)??e),r=new Set(n.map(({id:e})=>e));return[...n,...e.filter(({id:e})=>!r.has(e))]}var Ix={napcat:{id:`napcat`,label:`NapCat`,snapshotDate:`2026-07-24`,sourceRevision:`33546b936e008c017b2b9c1c41a0bb4f9e86c5be`,appName:`NapCat.Onebot`,appVersion:`sandbox-2026.07.24`,capabilities:Fx([{id:`group.member.shut-list`,action:`get_group_shut_list`,handler:`get_group_shut_list`,description:`获取指定群当前处于禁言状态的成员列表;原样返回 QQ 内核的 ShutUpGroupMember:uin 是字符串 QQ 号,昵称 nick、群名片 cardName、禁言到期时间 shutUpTime,role 是内核编号(2 成员、3 管理员、4 群主),uid 是与 QQ 号无关的内核 ID`,aliases:[`getGroupShutList`],surface:`native`,supported:!0},{id:`contact.recent.list`,action:`get_recent_contact`,handler:`get_recent_contact`,description:`获取当前机器人的最近私聊和群聊会话`,surface:`native`,supported:!0},{id:`group.notice.delete`,action:`_del_group_notice`,handler:`delete_group_notice`,description:`删除指定群公告`,surface:`native`,supported:!0},{id:`group.member.kick-batch`,action:`set_group_kick_members`,handler:`batch_kick_group_members`,description:`一次将多个普通成员踢出群聊`,surface:`native`,supported:!0},{id:`group.album.list`,action:`get_qun_album_list`,handler:`get_group_album_list`,description:`获取指定群的相册列表`,surface:`native`,supported:!1,reason:`沙盒未模拟 NapCat 群相册资源`},{id:`group.ai.characters`,action:`get_ai_characters`,handler:`get_ai_characters`,description:`获取 NapCat 群聊 AI 声聊角色列表`,surface:`native`,supported:!1,reason:`沙盒未模拟 NapCat 群聊 AI 声聊资源`}])},llbot:{id:`llbot`,label:`LLBot`,snapshotDate:`2026-07-24`,sourceRevision:`d6e2f485b8164597d04a2907d307739ecfcf4a55`,appName:`LLOneBot`,appVersion:`sandbox-2026.07.24`,capabilities:Fx([{id:`group.member.shut-list`,action:`get_group_shut_list`,handler:`get_group_shut_list`,description:`获取指定群当前处于禁言状态的成员列表;每项是 uid、uin(字符串 QQ 号)、nick、cardName、role(2 成员、3 管理员、4 群主)、禁言到期时间 shutUpTime、memberRealLevel、memberSpecialTitle、joinTime、lastSpeakTime`,aliases:[`getGroupShutList`],surface:`native`,supported:!0},{id:`group.notice.delete`,action:`_delete_group_notice`,handler:`delete_group_notice`,description:`删除指定群公告`,surface:`native`,supported:!0},{id:`group.member.kick-batch`,action:`batch_delete_group_member`,handler:`batch_kick_group_members`,description:`一次将多个普通成员踢出群聊`,surface:`native`,supported:!0},{id:`group.album.list`,action:`get_group_album_list`,handler:`get_group_album_list`,description:`获取指定群的相册列表`,surface:`native`,supported:!1,reason:`沙盒未模拟 LLBot 群相册资源`},{id:`flash.file.info`,action:`get_flash_file_info`,handler:`get_flash_file_info`,description:`获取 LLBot 闪传文件信息`,surface:`native`,supported:!1,reason:`沙盒未模拟 LLBot 闪传文件`}])},snowluma:{id:`snowluma`,label:`SnowLuma`,snapshotDate:`2026-11-03`,sourceRevision:`e44e4ced17c5911b9aa9db449ba29f2d9e567d2a`,appName:`SnowLuma`,appVersion:`sandbox-2026.11.03`,capabilities:Fx([{id:`message.history.friend`,action:`get_friend_msg_history`,handler:`get_friend_msg_history`,description:`获取指定好友的私聊历史消息;以 message_id 为锚且包含锚点,reverse_order 缺省为 true 取锚点及更旧的消息,false 取更新的消息,锚点不存在时返回空列表`,surface:`native`,supported:!0},{id:`message.history.group`,action:`get_group_msg_history`,handler:`get_group_msg_history`,description:`获取指定群的群聊历史消息;以 message_id 为锚且包含锚点,reverse_order 缺省为 true 取锚点及更旧的消息,false 取更新的消息,锚点不存在时返回空列表`,surface:`native`,supported:!0},{id:`group.member.shut-list`,action:`get_group_shut_list`,handler:`get_group_shut_list`,description:`获取指定群当前处于禁言状态的成员列表;每项只有 user_id、nickname 与禁言到期时间 shut_up_time`,surface:`native`,supported:!0},{id:`group.notice.list`,action:`_get_group_notice`,handler:`get_group_notice`,description:`获取指定群的公告列表;沙盒公告没有图片、发布设置与阅读数,image 与 images 返回空数组,上游原样透传的 settings 各项与 read_num 按 0 返回`,surface:`native`,supported:!0},{id:`group.system-msg`,action:`get_group_system_msg`,handler:`get_group_system_msg`,description:`获取机器人有权审批的入群申请与发给它的群邀请;返回不分桶的数组,可按 group_id 过滤,每项的 flag 可直接作为 set_group_add_request 的 flag`,surface:`native`,supported:!0},{id:`message.emoji-like`,action:`set_msg_emoji_like`,handler:`set_msg_emoji_like`,description:`给群消息贴表情回应;SnowLuma 不支持私聊消息的表情回应,沙盒按 emoji 保存回应参与者`,surface:`native`,supported:!0},{id:`message.emoji-like.list`,action:`fetch_emoji_like`,handler:`fetch_emoji_like`,description:`获取消息上某个 emoji 的表情回应参与者;沙盒不分页,cookie 恒为空串;nickName 刻意返回参与者真名,而不是复刻 SnowLuma 上游的空串`,surface:`native`,supported:!0},{id:`contact.recent.list`,action:`get_recent_contact`,handler:`get_recent_contact`,description:`获取当前机器人的最近会话;SnowLuma 上游是空实现,沙盒同样恒返回空数组`,surface:`native`,supported:!0},{id:`group.notice.delete`,action:`_del_group_notice`,handler:`delete_group_notice`,description:`删除指定群公告;公告 ID 可写在 notice_id 或 fid`,surface:`native`,supported:!0},{id:`group.member.kick-batch`,action:`set_group_kick_members`,handler:`batch_kick_group_members`,description:`一次将多个普通成员踢出群聊`,surface:`native`,supported:!0},{id:`group.album.list`,action:`get_group_album_list`,handler:`get_group_album_list`,description:`获取指定群的相册列表`,aliases:[`get_qun_album_list`],surface:`native`,supported:!1,reason:`沙盒未模拟 SnowLuma 群相册资源`},{id:`group.ai.characters`,action:`get_ai_characters`,handler:`get_ai_characters`,description:`获取 SnowLuma 群聊 AI 声聊角色列表`,surface:`native`,supported:!1,reason:`沙盒未模拟 SnowLuma 群聊 AI 声聊资源`}])}};function Lx(e){return structuredClone(Ix[e])}var Rx=`onebot-sandbox:follow-route`,zx={id:``,name:``,avatar:``,personalNote:``,sex:`unset`,implementation:`napcat`,enabled:!0,disabledCapabilities:[],members:[]};function Bx({open:t,mode:n,target:r,onOpenChange:i}){let a=q(),{store:o}=Zu(),{snapshot:s,resolveAvatar:c}=Qu(),[l,u]=e.useState(zx),[d,f]=e.useState(zx),[p,m]=e.useState(!1),[h,g]=e.useState(``),[_,v]=e.useState(!1),[S,C]=e.useState(``),[w,T]=e.useState(``),[E,D]=e.useState({status:`loading`}),[O,k]=e.useState(Rx),[A,j]=e.useState(Rx),M=e.useRef(null),N=e.useRef(null),ee=ou(s),te=su(s),P=[...ee.map(e=>({...e,type:`user`})),...te.map(e=>({...e,type:`bot`}))],F=r?.type===`group`?s.groups.find(({id:e})=>e===r.id):s.participants.find(({id:e})=>e===r?.id),ne=e=>{u(e),f(e)},{requestClose:re,confirm:I}=Sy(n===`edit`&&(JSON.stringify(l)!==JSON.stringify(d)||O!==A),()=>i(!1));e.useEffect(()=>{if(!t||!r)return;if(g(``),v(!1),C(``),T(``),r.type===`group`){let e=s.groups.find(({id:e})=>e===r.id);e&&ne({...zx,id:e.id,name:e.name,avatar:e.avatar??``,members:e.members.map(e=>({...e}))});return}let e=s.participants.find(({id:e})=>e===r.id);e&&ne({...zx,id:e.id,name:e.name,avatar:e.avatar??``,personalNote:e.profile?.personalNote??``,sex:e.profile?.sex??`unset`,...e.kind===`bot`?{implementation:e.implementation,enabled:e.enabled,disabledCapabilities:e.disabledCapabilities??[]}:{}})},[t,r?.type,r?.id]),e.useEffect(()=>{if(k(Rx),j(Rx),!t||n!==`edit`||r?.type!==`bot`)return;let e=r.id,i=!0;return D({status:`loading`}),Ru(`onebot-sandbox.bot-presets`,void 0).then(t=>{if(!i)return;let n=t.assignments.find(t=>t.botId===e)?.presetId??Rx;D({status:`ready`,catalog:t}),k(n),j(n)},e=>{i&&D({status:`failed`,error:Vu(e)})}),()=>{i=!1}},[t,n,r?.type,r?.id]);let L=async(e,t)=>{if(!p){m(!0),g(``);try{await t?.(),await o.manageEnvironment(e),i(!1)}catch(e){g(Vu(e,a(`sandbox.entity.failed`)))}finally{m(!1)}}},ie=()=>{let e={...l.personalNote.trim()?{personalNote:l.personalNote.trim()}:{},...l.sex===`unset`?{}:{sex:l.sex}};return Object.keys(e).length?e:void 0},ae=e=>{e.preventDefault(),r?.type===`user`?L({action:`update-user`,data:{id:l.id,name:l.name,avatar:l.avatar,profile:ie()}}):r?.type===`bot`?L({action:`update-bot`,data:{id:l.id,name:l.name,implementation:l.implementation,enabled:l.enabled,disabledCapabilities:[...l.disabledCapabilities],avatar:l.avatar,profile:ie()}},O===A?void 0:async()=>{await Ru(`onebot-sandbox.set-bot-preset`,{botId:l.id,presetId:O===Rx?null:O,...o.spaceId?{spaceId:o.spaceId}:{}}),j(O)}):r?.type===`group`&&L({action:`update-group`,data:{id:l.id,name:l.name,avatar:l.avatar,members:l.members.map(e=>({...e}))}})},R=()=>{r&&L({action:`delete-${r.type}`,data:{id:r.id}})},z=e=>l.members.find(t=>t.participantId===e),oe=e=>{if(z(e)){u(t=>({...t,members:t.members.filter(t=>t.participantId!==e)})),w===e&&T(``);return}let t=P.find(({id:t})=>t===e);t&&u(n=>({...n,members:[...n.members,{participantId:e,card:t.name,role:n.members.some(({role:e})=>e===`owner`)?`member`:`owner`}]}))},se=(e,t)=>u(n=>({...n,members:n.members.map(n=>n.participantId===e?{...n,...t}:n)})),ce=Lx(l.implementation),le=S.trim().toLowerCase(),ue=le?ce.capabilities.filter(e=>[e.id,e.action,e.description,e.reason,...e.aliases??[]].some(e=>e?.toLowerCase().includes(le))):ce.capabilities,de=ce.capabilities.filter(({supported:e})=>e).length,fe=ce.capabilities.filter(({id:e,supported:t})=>t&&!l.disabledCapabilities.includes(e)).length,pe=r?.type??`user`,me=a(`sandbox.kind.${pe}`),he=P.find(({id:e})=>e===w),ge=z(w),_e=E.status===`ready`?[{value:Rx,label:a(`sandbox.entity.presetFollowRoute`)},...E.catalog.presets.map(({id:e,name:t,status:n})=>{let r=t===e?e:`${t}(${e})`;return{value:e,label:n===`error`?a(`sandbox.entity.presetError`,{name:r}):r}}),...O!==Rx&&!E.catalog.presets.some(({id:e})=>e===O)?[{value:O,label:a(`sandbox.entity.presetMissing`,{id:O})}]:[]]:[{value:Rx,label:a(`sandbox.entity.presetFollowRoute`)}],ve=E.status===`ready`&&E.catalog.available,ye=E.status===`loading`?a(`sandbox.entity.presetLoading`):E.status===`failed`?a(`sandbox.entity.presetFailed`,{error:E.error}):E.catalog.available?a(`sandbox.entity.presetHint`):a(`sandbox.entity.presetUnavailable`),be=[{value:`owner`,label:a(`sandbox.role.owner`)},{value:`admin`,label:a(`sandbox.role.admin`)},{value:`member`,label:a(`sandbox.role.member`)}];return b(gn,{open:t,onOpenChange:e=>e?i(!0):re(),children:x(yn,{className:U(`flex flex-col overflow-hidden`,n===`edit`&&`sm:max-w-lg`),children:[x(bn,{children:[b(Sn,{children:a(n===`edit`?`sandbox.entity.editTitle`:`sandbox.entity.deleteTitle`,{kind:me})}),b(Cn,{children:a(n===`edit`?`sandbox.entity.editHint`:`sandbox.entity.deleteHint`)})]}),n===`delete`?x(y,{children:[x(`div`,{className:`flex flex-col gap-4`,children:[b(`p`,{className:`text-[13px] leading-6`,children:a(r?.type===`user`?`sandbox.entity.deleteUser`:`sandbox.entity.deleteOther`,{kind:me,name:F?.name??r?.id??``})}),h&&b(`p`,{role:`alert`,className:`text-xs text-destructive`,children:h})]}),x(xn,{children:[b(W,{variant:`outline`,onClick:()=>i(!1),children:a(`sandbox.common.cancel`)}),b(W,{variant:`destructive`,disabled:p,onClick:R,children:a(p?`sandbox.entity.deleting`:`sandbox.entity.confirmDelete`)})]})]}):x(`form`,{className:`flex min-h-0 flex-col gap-4`,onSubmit:ae,children:[x(`div`,{className:`sandbox-entity-body`,children:[x(`div`,{ref:M,className:`sandbox-entity-scroller`,children:[x(`div`,{className:`sandbox-entity-hero`,children:[x(`button`,{type:`button`,className:`sandbox-entity-avatar`,"aria-label":a(`sandbox.avatar.change`),onClick:()=>v(!0),children:[b(lp,{kind:pe,name:l.name,src:c(l.avatar),className:`sandbox-entity-avatar-image`,badge:!1}),b(`span`,{className:`sandbox-entity-avatar-edit`,"aria-hidden":!0,children:b(Qd,{})})]}),x(`div`,{className:`sandbox-entity-identity`,children:[b(`strong`,{className:U(`sandbox-entity-name`,!l.name.trim()&&`is-empty`),children:l.name.trim()||a(`sandbox.field.name.${pe}`)}),x(`span`,{className:`sandbox-entity-id`,children:[a(pe===`group`?`sandbox.field.groupId`:`sandbox.field.qqId`),` `,l.id]})]})]}),x(`section`,{className:`sandbox-entity-section`,children:[b(`h3`,{className:`sandbox-entity-section-title`,children:a(`sandbox.entity.section.basic`)}),x(`div`,{className:`sandbox-entity-grid`,children:[x(`div`,{className:U(`sandbox-entity-field`,pe===`group`&&`is-wide`),children:[b(bs,{htmlFor:`sandbox-entity-name`,children:a(`sandbox.field.name.${pe}`)}),b(Tn,{id:`sandbox-entity-name`,required:!0,value:l.name,onChange:e=>u(t=>({...t,name:e.target.value}))})]}),pe!==`group`&&x(y,{children:[x(`div`,{className:`sandbox-entity-field`,children:[b(bs,{children:a(`sandbox.field.sex`)}),x(Cs,{value:l.sex,onValueChange:e=>e&&u(t=>({...t,sex:e===`unset`?`unset`:e===`male`?`male`:e===`female`?`female`:`unknown`})),items:[`unset`,`unknown`,`male`,`female`].map(e=>({value:e,label:a(`sandbox.sex.${e}`)})),children:[b(Ts,{className:`w-full`,children:b(ws,{})}),b(Es,{className:`sandbox-glass`,children:[`unset`,`unknown`,`male`,`female`].map(e=>b(Ds,{value:e,children:a(`sandbox.sex.${e}`)},e))})]})]}),x(`div`,{className:`sandbox-entity-field is-wide`,children:[b(bs,{htmlFor:`sandbox-entity-note`,children:a(`sandbox.field.personalNote`)}),b(Tn,{id:`sandbox-entity-note`,placeholder:a(`sandbox.field.personalNotePlaceholder`),value:l.personalNote,onChange:e=>u(t=>({...t,personalNote:e.target.value}))})]})]})]})]}),pe===`bot`&&x(`section`,{className:`sandbox-entity-section`,children:[b(`h3`,{className:`sandbox-entity-section-title`,children:a(`sandbox.entity.section.runtime`)}),x(`label`,{className:`sandbox-entity-toggle`,children:[b(`span`,{children:a(`sandbox.field.botEnabled`)}),b(js,{checked:l.enabled,onCheckedChange:e=>u(t=>({...t,enabled:e===!0}))})]}),b($g,{value:l.implementation,onChange:e=>u(t=>({...t,implementation:e}))}),x(`div`,{className:`sandbox-entity-field`,children:[b(bs,{children:a(`sandbox.entity.preset`)}),x(Cs,{value:O,disabled:!ve,onValueChange:e=>e&&k(e),items:_e,children:[b(Ts,{className:`w-full`,children:b(ws,{})}),b(Es,{className:`sandbox-glass`,children:_e.map(({value:e,label:t})=>b(Ds,{value:e,children:t},e))})]}),b(`p`,{className:U(`sandbox-entity-hint`,E.status===`failed`&&`is-error`),children:ye})]}),x(`div`,{className:`sandbox-entity-field`,children:[x(`div`,{className:`sandbox-entity-section-title`,children:[b(bs,{children:a(`sandbox.entity.capabilities`)}),b(`span`,{className:`sandbox-entity-section-meta`,children:a(`sandbox.entity.capabilityCount`,{enabled:fe,total:de})})]}),x(`div`,{className:`relative`,children:[b(af,{className:`pointer-events-none absolute top-1/2 left-2.5 size-4 -translate-y-1/2 text-muted-foreground`}),b(Tn,{type:`search`,className:`sandbox-search-input pl-8!`,value:S,placeholder:a(`sandbox.entity.capabilitySearch`),"aria-label":a(`sandbox.entity.capabilitySearch`),onChange:e=>C(e.target.value)})]}),x(`div`,{className:`sandbox-entity-capabilities`,children:[x(`div`,{ref:N,className:`sandbox-entity-capability-list`,children:[ue.map(e=>x(`label`,{className:U(`sandbox-entity-capability`,!e.supported&&`is-unsupported`),children:[b(cs,{className:`mt-0.5`,checked:e.supported&&!l.disabledCapabilities.includes(e.id),disabled:!e.supported,onCheckedChange:t=>u(n=>({...n,disabledCapabilities:t===!0?n.disabledCapabilities.filter(t=>t!==e.id):[...new Set([...n.disabledCapabilities,e.id])]}))}),x(`span`,{className:`sandbox-entity-capability-text`,children:[x(`span`,{className:`sandbox-entity-capability-action`,children:[e.action,b(Zn,{variant:`secondary`,className:`text-[10px]`,children:a(e.surface===`standard`?`sandbox.entity.standard`:`sandbox.entity.native`)})]}),b(`span`,{className:`sandbox-entity-capability-description`,children:e.description}),(e.aliases?.length||!e.supported)&&x(`small`,{className:`sandbox-entity-capability-note`,children:[e.aliases?.length?a(`sandbox.entity.aliases`,{aliases:e.aliases.join(`、`)}):``,e.aliases?.length&&!e.supported?` · `:``,e.supported?``:e.reason]})]})]},e.id)),!ue.length&&b(`p`,{className:`sandbox-entity-empty`,children:a(`sandbox.entity.noCapability`)})]}),b(fv,{target:N,className:`sandbox-entity-capability-scrollbar`})]})]})]}),pe===`group`&&x(`section`,{className:`sandbox-entity-section`,children:[x(`h3`,{className:`sandbox-entity-section-title`,children:[b(`span`,{children:a(`sandbox.entity.members`)}),x(`span`,{className:`sandbox-entity-section-meta`,children:[l.members.length,` / `,P.length]})]}),b(`p`,{className:`sandbox-entity-hint`,children:a(`sandbox.entity.membersHint`)}),b(`div`,{className:`sandbox-entity-members`,children:P.map(e=>{let t=z(e.id);return x(`article`,{className:U(`sandbox-entity-member`,t&&`is-member`,w===e.id&&`is-editing`),children:[x(`button`,{type:`button`,className:`sandbox-entity-member-toggle`,"aria-pressed":!!t,"aria-label":a(t?`sandbox.entity.removeMember`:`sandbox.entity.addMember`,{name:e.name,id:e.id}),onClick:()=>oe(e.id),children:[x(`span`,{className:`sandbox-entity-member-avatar`,children:[b(lp,{kind:e.type,name:e.name,src:c(e.avatar),className:`size-8`}),b(`span`,{className:`sandbox-entity-member-marker`,"aria-hidden":!0,children:b(t?wd:ef,{})})]}),x(`span`,{className:`sandbox-entity-member-text`,children:[b(`strong`,{children:e.name}),b(`small`,{children:t?`${t.card||a(`sandbox.entity.noCard`)} · ${a(`sandbox.role.${t.role}`)}`:e.id})]})]}),t&&b(W,{type:`button`,variant:`ghost`,size:`icon-xs`,"aria-label":a(`sandbox.entity.editMember`,{name:e.name}),onClick:()=>T(e.id),children:b(Qd,{})})]},e.id)})}),he&&ge&&x(`div`,{className:`sandbox-entity-member-editor`,children:[x(`div`,{className:`sandbox-entity-member-editor-head`,children:[b(lp,{kind:he.type,name:he.name,src:c(he.avatar),className:`size-7`}),x(`span`,{className:`sandbox-entity-member-text flex-1`,children:[b(`strong`,{children:he.name}),b(`small`,{children:he.id})]}),b(W,{type:`button`,variant:`ghost`,size:`icon-xs`,"aria-label":a(`sandbox.common.close`),onClick:()=>T(``),children:b(yf,{})})]}),x(`div`,{className:`sandbox-entity-grid`,children:[x(`div`,{className:`sandbox-entity-field`,children:[b(bs,{children:a(`sandbox.entity.card`)}),b(Tn,{value:ge.card??``,onChange:e=>se(he.id,{card:e.target.value})})]}),x(`div`,{className:`sandbox-entity-field`,children:[b(bs,{children:a(`sandbox.entity.role`)}),x(Cs,{value:ge.role,onValueChange:e=>e&&se(he.id,{role:e===`owner`?`owner`:e===`admin`?`admin`:`member`}),items:be,children:[b(Ts,{className:`w-full`,children:b(ws,{})}),b(Es,{className:`sandbox-glass`,children:be.map(({value:e,label:t})=>b(Ds,{value:e,children:t},e))})]})]})]})]}),!l.members.length&&b(`p`,{className:`text-xs text-destructive`,children:a(`sandbox.entity.needOwner`)})]}),h&&b(`p`,{role:`alert`,className:`text-xs text-destructive`,children:h})]}),b(fv,{target:M,className:`sandbox-entity-scrollbar`})]}),x(xn,{children:[b(W,{type:`button`,variant:`outline`,onClick:re,children:a(`sandbox.common.cancel`)}),b(W,{type:`submit`,disabled:p,children:a(p?`sandbox.common.saving`:`sandbox.common.save`)})]})]}),r&&b(gn,{open:_,onOpenChange:v,children:x(yn,{className:`flex flex-col overflow-hidden sm:max-w-md`,children:[x(bn,{children:[b(Sn,{children:a(`sandbox.avatar.title`)}),b(Cn,{children:a(`sandbox.avatar.description`)})]}),b(`div`,{className:`-mx-5 min-h-0 overflow-y-auto px-5`,children:b(Yg,{kind:r.type,onSelect:e=>{u(t=>({...t,avatar:e})),v(!1)}})})]})}),I]})})}var Vx=8,Hx=12;function Ux(e,t,n){let r=Math.min(n.width,Math.max(0,t.width-24)),i=Math.min(n.height,Math.max(0,t.height-24));return{x:Math.max(Hx,Math.min(e.x+Vx,t.width-r-Hx)),y:Math.max(Hx,Math.min(e.y+Vx,t.height-i-Hx))}}function Wx(e,t,n){return{x:Math.max(Hx,Math.min(e.x,t.width-n.width-Hx)),y:Math.max(Hx,Math.min(e.y,t.height-n.height-Hx))}}function Gx(e){return typeof Element<`u`&&e instanceof Element&&!!e.closest(`button, input, textarea, select, [role="button"], a`)}function Kx(e,t){return e(`sandbox.profileCard.group.${t}`)}function qx(e,t){if(t)return e(`sandbox.sex.${t}`)}function Jx(e,t){return e(t?`sandbox.profileCard.yes`:`sandbox.profileCard.no`)}function Yx(e,t,n,r){r!==void 0&&r!==``&&e.push({group:t,label:n,value:String(r)})}function Xx(e,t){if(!t)return[];let n=[],r=t=>e(`sandbox.profileCard.field.${t}`);if(Yx(n,`account`,r(`sex`),qx(e,t.sex)),Yx(n,`account`,r(`age`),t.age),Yx(n,`account`,`QID`,t.qid),Yx(n,`account`,r(`level`),t.level),Yx(n,`account`,r(`loginDays`),t.loginDays),Yx(n,`account`,r(`regTime`),t.regTime),Yx(n,`account`,r(`city`),t.city),Yx(n,`account`,r(`country`),t.country),t.birthdayYear!==void 0||t.birthdayMonth!==void 0||t.birthdayDay!==void 0){let e=[t.birthdayYear,t.birthdayMonth,t.birthdayDay].filter(e=>e!==void 0);e.length&&Yx(n,`account`,r(`birthday`),e.join(`-`))}return t.labels?.length&&Yx(n,`account`,r(`labels`),t.labels.join(e(`sandbox.profileCard.separator`))),t.isVip!==void 0&&Yx(n,`account`,`VIP`,Jx(e,t.isVip)),t.isYearsVip!==void 0&&Yx(n,`account`,r(`yearsVip`),Jx(e,t.isYearsVip)),Yx(n,`account`,r(`vipLevel`),t.vipLevel),n}function Zx(e,t,n){let r=[];for(let i of t.friendships)if(i.participantIds.includes(n))for(let[a,o]of Object.entries(i.remarks)){if(!o)continue;let s=i.participantIds.find(e=>e!==a)??n;s===n?Yx(r,`friendship`,e(`sandbox.profileCard.remarkBy`,{name:t.participants.find(({id:e})=>e===a)?.name??a}),o):a===n&&Yx(r,`friendship`,e(`sandbox.profileCard.remarkFor`,{name:t.participants.find(({id:e})=>e===s)?.name??s}),o)}return r}function Qx(e,t,n){let r=[],i=t=>e(`sandbox.profileCard.field.${t}`);return Yx(r,`group-member`,i(`group`),t.name),Yx(r,`group-member`,i(`groupId`),t.id),Yx(r,`group-member`,i(`role`),e(`sandbox.role.${n.role}`)),Yx(r,`group-member`,i(`card`),n.card),Yx(r,`group-member`,i(`title`),n.title),Yx(r,`group-member`,i(`area`),n.area),Yx(r,`group-member`,i(`joinTime`),n.joinTime),Yx(r,`group-member`,i(`lastSentTime`),n.lastSentTime),Yx(r,`group-member`,i(`groupLevel`),n.level),n.unfriendly!==void 0&&Yx(r,`group-member`,i(`unfriendly`),Jx(e,n.unfriendly)),Yx(r,`group-member`,i(`titleExpire`),n.titleExpireTime),n.cardChangeable!==void 0&&Yx(r,`group-member`,i(`cardChangeable`),Jx(e,n.cardChangeable)),r}function $x(e,t){let n=t=>e(`sandbox.profileCard.field.${t}`),r=[{group:`bot-runtime`,label:n(`implementation`),value:Zg(t.implementation)},{group:`bot-runtime`,label:n(`enabled`),value:e(t.enabled?`sandbox.env.enabled`:`sandbox.env.disabled`)}];return t.disabledCapabilities?.length&&r.push({group:`bot-runtime`,label:n(`disabledCapabilities`),value:t.disabledCapabilities.join(e(`sandbox.profileCard.separator`))}),r}function eS(e,t){let n=t.snapshot.participants.find(({id:e})=>e===t.participantId);if(!n)return;let r=[];r.push(...Xx(e,n.profile)),r.push(...Zx(e,t.snapshot,n.id));let i=t.groupId?t.snapshot.groups.filter(({id:e})=>e===t.groupId).flatMap(e=>{let t=e.members.find(({participantId:e})=>e===n.id);return t?[{group:e,member:t}]:[]}):t.snapshot.groups.flatMap(e=>{let t=e.members.find(({participantId:e})=>e===n.id);return t?[{group:e,member:t}]:[]});for(let{group:t,member:n}of i)r.push(...Qx(e,t,n));return au(n)&&r.push(...$x(e,n)),{participantId:n.id,name:n.name,avatar:n.avatar,avatarKind:au(n)?`bot`:`user`,identityLabel:`QQ`,...n.profile?.personalNote?{personalNote:n.profile.personalNote}:{},fields:r}}function tS(e,t){return{participantId:t.id,name:t.name,...t.avatar?{avatar:t.avatar}:{},avatarKind:`group`,identityLabel:e(`sandbox.profileCard.field.groupId`),fields:[{group:`group`,label:e(`sandbox.profileCard.field.members`),value:e(`sandbox.profileCard.memberCount`,{count:t.members.length})},{group:`group`,label:e(`sandbox.profileCard.field.announcements`),value:e(`sandbox.profileCard.announcementCount`,{count:t.announcements.length})}]}}function nS(e,t){return[`account`,`friendship`,`group-member`,`bot-runtime`,`group`].map(n=>({group:n,label:Kx(e,n),fields:t.filter(e=>e.group===n)})).filter(e=>e.fields.length>0)}function rS(t){let n=q(),[r,i]=e.useState({});return{state:r,setState:i,dialogs:e.useMemo(()=>{let e=e=>e??{x:window.innerWidth/2-160,y:window.innerHeight/3};return{openEntity:(e,t)=>i(n=>({...n,entity:{mode:e,target:t}})),openRemark:e=>{let n=t.snapshot,r=t.getView().currentOperatorId??``,a=n?.friendships.find(({participantIds:t})=>t.includes(r)&&t.includes(e));i(t=>({...t,text:{kind:`remark`,targetId:e,value:a?.remarks[r]??``}}))},openGroupAction:(e,n,r)=>{let a=t.snapshot?.groups.find(({id:e})=>e===r);if(!a)return;let o=a.members.find(({participantId:e})=>e===n),s=e===`name`?a.name:e===`title`?o?.title??``:o?.card??``;i(t=>({...t,text:{kind:e,targetId:n,groupId:a.id,value:s}}))},openConversationRename:e=>{let n=t.snapshot?.conversationInstances?.find(({id:t})=>t===e);n&&i(t=>({...t,text:{kind:`rename`,conversationId:e,value:n.title??``}}))},openProfile:(r,a)=>{let o=t.snapshot;if(!o)return;let s=t.getView(),c=[...o.conversations,...o.conversationInstances??[]].find(({id:e})=>e===s.activeConversationId),l=c&&`groupId`in c?c.groupId:void 0,u=eS(n,{snapshot:o,participantId:r,viewerId:s.currentOperatorId,groupId:l});u&&i(t=>({...t,profile:{card:u,...e(a)}}))},openGroupProfile:(r,a)=>{let o=t.snapshot?.groups.find(({id:e})=>e===r);o&&i(t=>({...t,profile:{card:tS(n,o),...e(a)}}))}}},[t,n])}}function iS({state:e,setState:t}){let n=J_(e.entity);return x(y,{children:[b(Bx,{open:!!e.entity,mode:n?.mode??`edit`,target:n?.target,onOpenChange:e=>!e&&t(e=>({...e,entity:void 0}))}),b(aS,{dialog:e.text,onClose:()=>t(e=>({...e,text:void 0}))}),e.profile&&b(cS,{...e.profile,onClose:()=>t(e=>({...e,profile:void 0}))})]})}function aS({dialog:t,onClose:n}){let r=q(),{store:i}=Zu(),[a,o]=e.useState(``),[s,c]=e.useState(!1),[l,u]=e.useState(``),d=J_(t),{requestClose:f,confirm:p}=Sy(!!t&&a!==t.value,n);e.useLayoutEffect(()=>{t&&(o(t.value),u(``))},[t]);let m=async()=>{if(!(!t||s)){c(!0),u(``);try{t.kind===`remark`?await i.performFriendAction({action:`set-remark`,targetId:t.targetId,remark:a}):t.kind===`rename`?await i.renameConversationInstance({conversationId:t.conversationId,title:a}):t.kind===`name`?await i.performGroupAction({action:`set-name`,groupId:t.groupId,name:a}):t.kind===`title`?await i.performGroupAction({action:`set-title`,groupId:t.groupId,targetId:t.targetId,title:a}):await i.performGroupAction({action:`set-card`,groupId:t.groupId,targetId:t.targetId,card:a}),n()}catch(e){u(Vu(e,r(`sandbox.common.failed`)))}finally{c(!1)}}},h=d?.kind??`remark`;return b(gn,{open:!!t,onOpenChange:e=>!e&&f(),children:x(yn,{children:[x(bn,{children:[b(Sn,{children:r(`sandbox.text.${h}.title`)}),b(Cn,{children:r(`sandbox.text.${h}.description`)})]}),b(Tn,{autoFocus:!0,value:a,placeholder:r(`sandbox.text.${h}.placeholder`),onChange:e=>o(e.target.value),onKeyDown:e=>{e.key===`Enter`&&!e.nativeEvent.isComposing&&m()}}),l&&b(`p`,{role:`alert`,className:`text-xs text-destructive`,children:l}),x(xn,{children:[b(W,{variant:`outline`,onClick:f,children:r(`sandbox.common.cancel`)}),b(W,{disabled:s,onClick:m,children:r(s?`sandbox.common.saving`:`sandbox.common.save`)})]}),p]})})}var oS=320,sS=380;function cS({card:t,x:n,y:r,onClose:i}){let a=q(),{resolveAvatar:o}=Qu(),s=e.useRef(null),c=e.useRef(null),[l,u]=e.useState(()=>Ux({x:n,y:r},{width:window.innerWidth,height:window.innerHeight},{width:oS,height:sS})),d=e.useRef(void 0);e.useLayoutEffect(()=>{let e=s.current?{width:s.current.offsetWidth,height:s.current.offsetHeight}:{width:oS,height:sS};u(Ux({x:n,y:r},{width:window.innerWidth,height:window.innerHeight},e))},[t,n,r]),e.useEffect(()=>{let e=e=>{s.current?.contains(e.target)||i()},t=e=>{e.key===`Escape`&&i()},n=setTimeout(()=>document.addEventListener(`pointerdown`,e));return window.addEventListener(`keydown`,t),()=>{clearTimeout(n),document.removeEventListener(`pointerdown`,e),window.removeEventListener(`keydown`,t)}},[i]);let f=nS(a,t.fields);return oe(x(`section`,{ref:s,"aria-label":a(`sandbox.profile.title`),className:`sandbox-glass fixed z-50 flex max-h-[min(32rem,calc(100vh-24px))] w-80 flex-col overflow-hidden rounded-xl bg-popover text-sm leading-6 text-popover-foreground shadow-popup ring-1 ring-border animate-in fade-in-0 zoom-in-95`,style:{left:l.x,top:l.y},children:[b(W,{variant:`ghost`,size:`icon-xs`,className:`sandbox-profile-close`,"aria-label":a(`sandbox.common.close`),onClick:i,children:b(yf,{})}),x(`div`,{ref:c,className:`sandbox-profile-scroller`,children:[x(`header`,{className:`sandbox-profile-hero`,onPointerDown:e=>{if(e.button!==0||Gx(e.target)||!s.current)return;let t=s.current.getBoundingClientRect();d.current={id:e.pointerId,x:e.clientX,y:e.clientY,left:t.left,top:t.top},e.currentTarget.setPointerCapture(e.pointerId)},onPointerMove:e=>{let t=d.current;!t||t.id!==e.pointerId||!s.current||u(Wx({x:t.left+e.clientX-t.x,y:t.top+e.clientY-t.y},{width:window.innerWidth,height:window.innerHeight},{width:s.current.offsetWidth,height:s.current.offsetHeight}))},onPointerUp:()=>{d.current=void 0},children:[b(lp,{kind:t.avatarKind,name:t.name,src:o(t.avatar),className:`sandbox-profile-avatar`}),x(`div`,{className:`sandbox-profile-identity`,children:[b(`h2`,{className:`sandbox-profile-name`,children:t.name}),x(`div`,{className:`sandbox-profile-id`,children:[x(`span`,{children:[t.identityLabel,` `,t.participantId]}),b(lS,{value:t.participantId})]}),t.personalNote&&b(`p`,{className:`sandbox-profile-note`,children:t.personalNote})]})]}),b(`div`,{className:`sandbox-profile-body`,children:f.map(e=>x(`section`,{children:[b(`h3`,{className:`sandbox-profile-section-title`,children:e.label}),e.group===`group`?b(`dl`,{className:`sandbox-profile-stats`,children:e.fields.map(e=>x(`div`,{className:`sandbox-profile-stat`,children:[b(`dt`,{children:e.label}),b(`dd`,{children:e.value})]},e.label))}):b(`dl`,{className:`sandbox-profile-fields`,children:e.fields.map(e=>x(`div`,{className:`sandbox-profile-field`,children:[b(`dt`,{children:e.label}),b(`dd`,{children:e.value})]},`${e.label}:${e.value}`))})]},e.group))})]}),b(fv,{target:c,className:`sandbox-profile-scrollbar`})]}),document.body)}function lS({value:t}){let n=q(),[r,i]=e.useState(!1);e.useEffect(()=>{if(!r)return;let e=setTimeout(()=>i(!1),1500);return()=>clearTimeout(e)},[r]);let a=async()=>{try{await navigator.clipboard.writeText(t),i(!0)}catch{I.error(n(`sandbox.records.copyFailed`))}};return b(W,{variant:`ghost`,size:`icon-xs`,"aria-label":n(r?`sandbox.profile.copied`:`sandbox.profile.copyId`),onClick:()=>void a(),children:b(r?wd:Ad,{})})}var uS=[`messages`,`debug`,`test-calls`,`environment`,`spaces`,`settings`],dS=[`messages`,`debug`,`test-calls`,`environment`,`settings`],fS=[`messages`];function pS(){let t=q();Bu(t);let n=g(),r=_(),[i]=v(),a=uS.find(e=>e===r.view)??`messages`,o=a===`messages`?i.get(`space`)??void 0:void 0,s=e.useRef(new Map),c=e.useCallback(e=>{let t=e??`main`,n=s.current.get(t);return n||s.current.set(t,n=new Ku(e)),n},[]),l=c(o),u=c(void 0),{state:d,setState:f,dialogs:p}=rS(l),m=e.useSyncExternalStore(l.subscribe,l.getView,l.getView),h=L(`onebot-sandbox.signal`),S=h.data?.scenes[o??``],C=h.data?.startedAt,{spaces:w,loaded:T,reload:E}=Mx(),[D,O]=e.useState({}),[k,A]=e.useState(!1),j=e.useRef(null),M=e.useRef(null),N=e.useRef(null),[ee,te]=e.useState(0);e.useLayoutEffect(()=>{let e=N.current;if(!e)return;let t=()=>te(e.getBoundingClientRect().height);t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]);let P=e.useRef(void 0),F=e.useRef(void 0),[ne,re]=e.useState(),ie=o?w.find(({id:e})=>e===o):void 0,ae=h.data?.mcpRunning??!1,R=t(ae?`sandbox.nav.spacesRunning`:`sandbox.nav.spaces`),z=vb().dirty;e.useEffect(()=>(l.activate(),l.load(),f({}),()=>l.dispose()),[l,f]),e.useEffect(()=>{o&&T&&!w.some(({id:e})=>e===o)&&n(`/onebot-sandbox/messages`,{replace:!0})},[o,w,T,n]);let oe=e.useRef(void 0);e.useEffect(()=>{S!==void 0&&(oe.current?.store===l&&oe.current.tick!==S&&l.notifySceneChanged(),oe.current={store:l,tick:S})},[S,l]);let se=e.useRef(void 0);e.useEffect(()=>{C!==void 0&&(se.current!==void 0&&se.current!==C&&(l.getView().workspace?l.notifySceneChanged():l.load()),se.current=C)},[C,l]),e.useLayoutEffect(()=>{let e=P.current;if(!e||a!==`messages`)return;P.current=void 0;let t=j.current?.querySelector(`.sandbox-space-overview.is-backdrop`),n=ne&&t?.querySelector(`[data-space-id="${CSS.escape(ne.key)}"]`);M.current?bx(M.current,e,t,n,()=>re(void 0)):re(void 0)});let ce=async e=>{A(!0);try{await e()}catch(e){I.error(t(`sandbox.spaces.actionFailed`),{description:Vu(e)})}finally{A(!1)}},le=async e=>{let t=e??`main`,r=px(document.querySelector(`[data-space-id="${CSS.escape(t)}"]`)??document.querySelector(`.sandbox-space-create`)),i=c(e);i.activate(),await i.load(),P.current=r;let a=j.current?.querySelector(`.sandbox-space-overview`);r&&a&&j.current&&re({key:t,top:a.getBoundingClientRect().top-j.current.getBoundingClientRect().top}),n(e?`/onebot-sandbox/messages?space=${encodeURIComponent(e)}`:`/onebot-sandbox/messages`)},ue=async()=>{hx();let e=a===`messages`?M.current:null;if(e){let t=o??`main`,n=Jb(e);O(e=>({...e,[t]:n}));let r=fx(e);F.current=r&&{key:t,rect:r}}else F.current=void 0;await E().catch(()=>{}),n(`/onebot-sandbox/spaces`)},de=(e,t)=>ce(async()=>{e===`return`?await Ru(`onebot-sandbox.return-test-space`,{spaceId:t}):e===`reactivate`?await Ru(`onebot-sandbox.reactivate-test-space`,{spaceId:t}):e===`take-over`?await Ru(`onebot-sandbox.take-over-test-space`,{spaceId:t}):e===`terminate`?await Ru(`onebot-sandbox.terminate-test-space`,{spaceId:t}):(await Ru(`onebot-sandbox.delete-test-space`,{spaceId:t}),s.current.delete(t),O(({[t]:e,...n})=>n)),await E()}),fe=()=>ce(async()=>{let e=await Ru(`onebot-sandbox.create-test-space`,{});await E(),await le(e.id)}),pe=e=>{e===`spaces`?ue():n(`/onebot-sandbox/${e}`)},me=b(`div`,{className:`flex flex-1 flex-col items-center justify-center gap-3 text-xs text-muted-foreground`,children:m.loadError?x(y,{children:[b(`p`,{role:`alert`,className:`text-destructive`,children:m.loadError}),b(W,{size:`sm`,variant:`outline`,onClick:()=>void l.load(),children:t(`sandbox.common.retry`)})]}):b(As,{})});return b(An,{children:b(ed,{store:l,dialogs:p,children:x(`div`,{ref:j,className:`relative flex h-full min-h-0 flex-col bg-background text-sm leading-6 text-foreground`,style:{overflow:`clip`},children:[x(Ms,{ref:N,value:a,className:U(`shrink-0 gap-4 px-6 py-3 data-horizontal:flex-row data-horizontal:items-center`,a===`messages`&&`sandbox-page-header`),onValueChange:e=>pe(e),children:[b(`h1`,{className:`shrink-0 text-lg font-semibold`,children:t(`onebot-sandbox.title`)}),b(Fs,{className:`sandbox-scroll-strip min-w-0 max-w-full justify-start overflow-x-auto`,"aria-label":t(`sandbox.nav.label`),children:(o?fS:dS).map(e=>x(Is,{value:e,children:[t(`sandbox.nav.${e}`),e===`settings`&&z&&b(`span`,{role:`img`,"aria-label":t(`sandbox.settings.unsaved`),className:`size-1.5 shrink-0 rounded-full bg-primary`})]},e))}),ie&&b(Zn,{variant:`secondary`,className:`min-w-0 max-w-60`,children:b(`span`,{className:`truncate`,children:t(`sandbox.spaces.current`,{name:ie.name})})}),x(jn,{children:[b(Mn,{render:b(W,{variant:`ghost`,size:`icon`,className:U(`ml-auto shrink-0 overflow-visible`,a===`spaces`&&`bg-accent text-accent-foreground`),style:ae?{color:`var(--primary)`}:void 0,"aria-label":R,"aria-current":a===`spaces`?`page`:void 0,onClick:()=>pe(`spaces`)}),children:b(Rb,{running:ae})}),b(Nn,{children:R})]})]}),(a===`spaces`||ne&&a===`messages`)&&b(Dx,{spaces:w,mainStore:u,captures:D,exitZoom:F,launching:a===`spaces`?void 0:ne,onEnter:e=>void ce(()=>le(e)),onCreate:()=>void fe(),onAction:(e,t)=>void de(e,t)}),a===`settings`?b(jb,{}):a===`spaces`?null:m.workspace?x(y,{children:[a===`messages`&&b(`div`,{ref:M,className:`sandbox-stage relative flex min-h-0 flex-1`,style:{"--sandbox-accent":m.workspace.appearance.sandboxAccentColor,"--sandbox-page-header-height":`${ee}px`},children:b(py,{})}),a===`messages`&&ie?.status===`running`&&b(qb,{spaceName:ie.name,busy:k,style:{"--sandbox-accent":m.workspace.appearance.sandboxAccentColor,"--sandbox-page-header-height":`${ee}px`},onTakeOver:()=>void de(`take-over`,ie.id),onTerminate:()=>void de(`terminate`,ie.id)}),a===`debug`&&b(lb,{}),a===`test-calls`&&b(Nb,{}),a===`environment`&&b(ky,{}),b(iS,{state:d,setState:f})]}):me]})})})}export{pS as SandboxApp};
|